From 9bff294f8681021b7fcf9c1bae3261a9251cdeef Mon Sep 17 00:00:00 2001 From: Jonty-Buchan Date: Wed, 18 Nov 2020 18:05:26 +1300 Subject: [PATCH] Download now exports correctly formatted data as csv file --- client/components/LowerSect.jsx | 13 +++--- package-lock.json | 5 +++ package.json | 1 + server/public/bundle.js | 78 +++++++++++++++++++++++++++++---- server/public/bundle.js.map | 2 +- 5 files changed, 84 insertions(+), 15 deletions(-) diff --git a/client/components/LowerSect.jsx b/client/components/LowerSect.jsx index 1146b82..32851dd 100644 --- a/client/components/LowerSect.jsx +++ b/client/components/LowerSect.jsx @@ -1,6 +1,7 @@ import React from 'react' import db from '../firebase' +import { downloadFile } from 'download-csv' import jsonexport from 'jsonexport' @@ -16,12 +17,12 @@ function downloadData () { const leadsRef = db.database().ref('metaData') leadsRef.on('value', function (snapshot) { - snapshot.forEach(function (childSnapshot) { - const childData = childSnapshot.val() - jsonexport(childData, function (err, csv) { - if (err) return console.error(err) - console.log(csv) - }) + let childData = snapshot.val() + + jsonexport(childData, function (err, csv) { + if (err) return console.error(err) + console.log(csv) + downloadFile(csv, 'meta-data') }) }) } diff --git a/package-lock.json b/package-lock.json index c6e5b2e..8d67cb1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10599,6 +10599,11 @@ "is-obj": "^2.0.0" } }, + "download-csv": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/download-csv/-/download-csv-1.1.1.tgz", + "integrity": "sha1-wLB29INE8b5Hr0AFzzLVMoPriOs=" + }, "duplexer3": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", diff --git a/package.json b/package.json index 0ce7d27..1d4bb0a 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ ] }, "dependencies": { + "download-csv": "^1.1.1", "express": "^4.17.1", "firebase": "^8.0.0", "heroku": "^7.42.13", diff --git a/server/public/bundle.js b/server/public/bundle.js index 1a0fef7..85ede18 100644 --- a/server/public/bundle.js +++ b/server/public/bundle.js @@ -458,8 +458,10 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _firebase__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../firebase */ "./client/firebase.js"); -/* harmony import */ var jsonexport__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! jsonexport */ "./node_modules/jsonexport/lib/index.js"); -/* harmony import */ var jsonexport__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(jsonexport__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var download_csv__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! download-csv */ "./node_modules/download-csv/index.js"); +/* harmony import */ var download_csv__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(download_csv__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var jsonexport__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! jsonexport */ "./node_modules/jsonexport/lib/index.js"); +/* harmony import */ var jsonexport__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(jsonexport__WEBPACK_IMPORTED_MODULE_8__); @@ -474,6 +476,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re + var deleteButton = function deleteButton() { deleteUserData(); }; @@ -485,12 +488,11 @@ function deleteUserData() { function downloadData() { var leadsRef = _firebase__WEBPACK_IMPORTED_MODULE_6__["default"].database().ref('metaData'); leadsRef.on('value', function (snapshot) { - snapshot.forEach(function (childSnapshot) { - var childData = childSnapshot.val(); - jsonexport__WEBPACK_IMPORTED_MODULE_7___default()(childData, function (err, csv) { - if (err) return console.error(err); - console.log(csv); - }); + var childData = snapshot.val(); + jsonexport__WEBPACK_IMPORTED_MODULE_8___default()(childData, function (err, csv) { + if (err) return console.error(err); + console.log(csv); + Object(download_csv__WEBPACK_IMPORTED_MODULE_7__["downloadFile"])(csv, 'meta-data'); }); }); } @@ -51025,6 +51027,66 @@ function toComment(sourceMap) { return "/*# ".concat(data, " */"); } +/***/ }), + +/***/ "./node_modules/download-csv/dist/creatCSVFile.js": +/*!********************************************************!*\ + !*** ./node_modules/download-csv/dist/creatCSVFile.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};module.exports=function(n,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:",";if(!n||Array.isArray(n)&&!n.length||!Object.keys(n).length)return"传入数据为空(the download datas is null)";var r=[];if("object"===("undefined"==typeof n?"undefined":_typeof(n))&&Array.isArray(n)){var o=function(){var o=Array.isArray(n[0]);return n.some(function(n){return Array.isArray(n)!==o})?{v:"传入数据格式不一致(the array element data format is inconsistent)"}:void(o?r=r.concat(n.map(function(n){return n.join(t)})):!function(){var o=[];if(n.forEach(function(n){return o=o.concat(Object.keys(n))}),o=o.filter(function(n,e,t){return t.indexOf(n)===e}),o.length>0)if(e&&"object"===("undefined"==typeof e?"undefined":_typeof(e))){var f=o.map(function(n){return e.hasOwnProperty(n)?e[n]:n});r.push(f.join(t))}else r.push(o.join(t));n.map(function(n){return o.map(function(e){return"undefined"!=typeof n[e]?n[e]:""})}).forEach(function(n){r.push(n.join(t))})}())}();if("object"===("undefined"==typeof o?"undefined":_typeof(o)))return o.v}else{if("object"!==("undefined"==typeof n?"undefined":_typeof(n)))return n;for(var f in n)e&&e.hasOwnProperty(f)?r.push(e[f]+","+n[f]):r.push(f+","+n[f])}return r.join("\r\n")}; + +/***/ }), + +/***/ "./node_modules/download-csv/dist/detectionClientType.js": +/*!***************************************************************!*\ + !*** ./node_modules/download-csv/dist/detectionClientType.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +module.exports=function(){var e={},r=navigator.userAgent.toLowerCase(),a=void 0;return(a=r.match(/msie ([\d.]+)/))?e.ie=a[1]:(a=r.match(/firefox\/([\d.]+)/))?e.firefox=a[1]:(a=r.match(/chrome\/([\d.]+)/))?e.chrome=a[1]:(a=r.match(/opera.([\d.]+)/))?e.opera=a[1]:(a=r.match(/version\/([\d.]+).*safari/))?e.safari=a[1]:0,e.ie?{name:"IE",version:e.ie}:e.firefox?{name:"Firefox",version:e.firefox}:e.chrome?{name:"Chrome",version:e.chrome}:e.opera?{name:"Opera",version:e.opera}:e.safari?{name:"Safari",version:e.safari}:{name:""}}; + +/***/ }), + +/***/ "./node_modules/download-csv/dist/downloadFile.js": +/*!********************************************************!*\ + !*** ./node_modules/download-csv/dist/downloadFile.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +var detectionClientType=__webpack_require__(/*! ./detectionClientType */ "./node_modules/download-csv/dist/detectionClientType.js");module.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"export.csv";if(!e)return void console.log("the file is null");var n=detectionClientType(),o="\ufeff",c="data:attachment/csv;charset=utf-8,"+o+encodeURIComponent(e);if(window.Blob&&window.URL&&window.URL.createObjectURL){var a=new Blob([o+e],{type:"text/csv"});c=URL.createObjectURL(a)}if("IE"===n.name){var d=window.top.open("about:blank","_blank");return d.document.write("sep=,\r\n"+e),d.document.close(),d.document.execCommand("SaveAs",!0,t),void d.close()}if("Safari"===n.name){var i=document.createElement("a");i.id="csvDwnLink",document.body.appendChild(i);var r=o+e,l="data:attachment/csv;charset=utf-8,"+encodeURIComponent(r);return document.getElementById("csvDwnLink").setAttribute("href",l),document.getElementById("csvDwnLink").click(),void document.body.removeChild(i)}if("Firefox"===n.name){var v=document.createElement("a");v.download=t,v.target="_blank",v.href=c;var m=document.createEvent("MouseEvents");return m.initEvent("click",!0,!0),void v.dispatchEvent(m)}var u=document.createElement("a");u.download=t,u.href=c,u.click()}; + +/***/ }), + +/***/ "./node_modules/download-csv/index.js": +/*!********************************************!*\ + !*** ./node_modules/download-csv/index.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var creatCSVFile = __webpack_require__(/*! ./dist/creatCSVFile */ "./node_modules/download-csv/dist/creatCSVFile.js"); +var downloadFile = __webpack_require__(/*! ./dist/downloadFile */ "./node_modules/download-csv/dist/downloadFile.js"); +var detectionClientType = __webpack_require__(/*! ./dist/detectionClientType */ "./node_modules/download-csv/dist/detectionClientType.js"); + +function downloadCsv(datas, columns, filename) { + downloadFile(creatCSVFile(datas, columns), filename); +}; + +downloadCsv.creatCsvFile = creatCSVFile; +downloadCsv.downloadFile = downloadFile; +downloadCsv.detectionClientType = detectionClientType; + +module.exports = downloadCsv; + + /***/ }), /***/ "./node_modules/events/events.js": diff --git a/server/public/bundle.js.map b/server/public/bundle.js.map index 3881728..dcbbcc8 100644 --- a/server/public/bundle.js.map +++ b/server/public/bundle.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./client/actions/index.js","webpack:///./client/components/App.jsx","webpack:///./client/components/Description.jsx","webpack:///./client/components/DescriptionCharCount.jsx","webpack:///./client/components/Header.jsx","webpack:///./client/components/LowerSect.jsx","webpack:///./client/components/PopUp.jsx","webpack:///./client/components/Preview.jsx","webpack:///./client/components/Title.jsx","webpack:///./client/components/TitleCharCount.jsx","webpack:///./client/components/Url.jsx","webpack:///./client/firebase.js","webpack:///./client/index.js","webpack:///./client/reducers/description.js","webpack:///./client/reducers/index.js","webpack:///./client/reducers/title.js","webpack:///./client/reducers/url.js","webpack:///./node_modules/@babel/runtime/helpers/assertThisInitialized.js","webpack:///./node_modules/@babel/runtime/helpers/classCallCheck.js","webpack:///./node_modules/@babel/runtime/helpers/createClass.js","webpack:///./node_modules/@babel/runtime/helpers/esm/extends.js","webpack:///./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack:///./node_modules/@babel/runtime/helpers/getPrototypeOf.js","webpack:///./node_modules/@babel/runtime/helpers/inherits.js","webpack:///./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","webpack:///./node_modules/@babel/runtime/helpers/setPrototypeOf.js","webpack:///./node_modules/@babel/runtime/helpers/typeof.js","webpack:///./node_modules/@firebase/analytics/dist/index.esm.js","webpack:///./node_modules/@firebase/app/dist/index.esm.js","webpack:///./node_modules/@firebase/auth/dist/auth.esm.js","webpack:///./node_modules/@firebase/component/dist/index.esm.js","webpack:///./node_modules/@firebase/database/dist/index.esm.js","webpack:///./node_modules/@firebase/firestore/dist/index.esm.js","webpack:///./node_modules/@firebase/functions/dist/index.esm.js","webpack:///./node_modules/@firebase/installations/dist/index.esm.js","webpack:///./node_modules/@firebase/logger/dist/index.esm.js","webpack:///./node_modules/@firebase/messaging/dist/index.esm.js","webpack:///./node_modules/@firebase/performance/dist/index.esm.js","webpack:///./node_modules/@firebase/remote-config/dist/index.esm.js","webpack:///./node_modules/@firebase/storage/dist/index.esm.js","webpack:///./node_modules/@firebase/util/dist/index.esm.js","webpack:///./node_modules/@firebase/webchannel-wrapper/dist/index.esm.js","webpack:///./node_modules/base64-js/index.js","webpack:///./node_modules/buffer/index.js","webpack:///./node_modules/copy-to-clipboard/index.js","webpack:///./node_modules/core-util-is/lib/util.js","webpack:///./node_modules/css-loader/dist/runtime/api.js","webpack:///./node_modules/events/events.js","webpack:///./node_modules/firebase/dist/index.esm.js","webpack:///./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","webpack:///./node_modules/idb/build/idb.js","webpack:///./node_modules/ieee754/index.js","webpack:///./node_modules/inherits/inherits_browser.js","webpack:///./node_modules/isarray/index.js","webpack:///./node_modules/jsonexport/lib/core/eol.js","webpack:///./node_modules/jsonexport/lib/core/escape-delimiters.js","webpack:///./node_modules/jsonexport/lib/core/helper.js","webpack:///./node_modules/jsonexport/lib/core/join-rows.js","webpack:///./node_modules/jsonexport/lib/core/stream.js","webpack:///./node_modules/jsonexport/lib/index.js","webpack:///./node_modules/jsonexport/lib/parser/csv.js","webpack:///./node_modules/jsonexport/lib/parser/handler.js","webpack:///./node_modules/object-assign/index.js","webpack:///./node_modules/os-browserify/browser.js","webpack:///./node_modules/process-nextick-args/index.js","webpack:///./node_modules/process/browser.js","webpack:///./node_modules/prop-types/checkPropTypes.js","webpack:///./node_modules/prop-types/factoryWithTypeCheckers.js","webpack:///./node_modules/prop-types/index.js","webpack:///./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack:///./node_modules/react-copy-to-clipboard/lib/Component.js","webpack:///./node_modules/react-copy-to-clipboard/lib/index.js","webpack:///./node_modules/react-dom/cjs/react-dom.development.js","webpack:///./node_modules/react-dom/index.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/Context.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/hooks/useDispatch.js","webpack:///./node_modules/react-redux/es/hooks/useReduxContext.js","webpack:///./node_modules/react-redux/es/hooks/useSelector.js","webpack:///./node_modules/react-redux/es/hooks/useStore.js","webpack:///./node_modules/react-redux/es/index.js","webpack:///./node_modules/react-redux/es/utils/Subscription.js","webpack:///./node_modules/react-redux/es/utils/batch.js","webpack:///./node_modules/react-redux/es/utils/isPlainObject.js","webpack:///./node_modules/react-redux/es/utils/reactBatchedUpdates.js","webpack:///./node_modules/react-redux/es/utils/shallowEqual.js","webpack:///./node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js","webpack:///./node_modules/react-redux/es/utils/verifyPlainObject.js","webpack:///./node_modules/react-redux/es/utils/warning.js","webpack:///./node_modules/react/cjs/react.development.js","webpack:///./node_modules/react/index.js","webpack:///./node_modules/reactjs-popup/dist/index.css","webpack:///./node_modules/reactjs-popup/dist/reactjs-popup.esm.js","webpack:///./node_modules/readable-stream/duplex-browser.js","webpack:///./node_modules/readable-stream/lib/_stream_duplex.js","webpack:///./node_modules/readable-stream/lib/_stream_passthrough.js","webpack:///./node_modules/readable-stream/lib/_stream_readable.js","webpack:///./node_modules/readable-stream/lib/_stream_transform.js","webpack:///./node_modules/readable-stream/lib/_stream_writable.js","webpack:///./node_modules/readable-stream/lib/internal/streams/BufferList.js","webpack:///./node_modules/readable-stream/lib/internal/streams/destroy.js","webpack:///./node_modules/readable-stream/lib/internal/streams/stream-browser.js","webpack:///./node_modules/readable-stream/passthrough.js","webpack:///./node_modules/readable-stream/readable-browser.js","webpack:///./node_modules/readable-stream/transform.js","webpack:///./node_modules/readable-stream/writable-browser.js","webpack:///./node_modules/redux-thunk/es/index.js","webpack:///./node_modules/redux/es/redux.js","webpack:///./node_modules/safe-buffer/index.js","webpack:///./node_modules/scheduler/cjs/scheduler-tracing.development.js","webpack:///./node_modules/scheduler/cjs/scheduler.development.js","webpack:///./node_modules/scheduler/index.js","webpack:///./node_modules/scheduler/tracing.js","webpack:///./node_modules/setimmediate/setImmediate.js","webpack:///./node_modules/stream-browserify/index.js","webpack:///./node_modules/string_decoder/lib/string_decoder.js","webpack:///./node_modules/symbol-observable/es/index.js","webpack:///./node_modules/symbol-observable/es/ponyfill.js","webpack:///./node_modules/timers-browserify/main.js","webpack:///./node_modules/toggle-selection/index.js","webpack:///./node_modules/tslib/tslib.es6.js","webpack:///./node_modules/util-deprecate/browser.js","webpack:///(webpack)/buildin/global.js","webpack:///(webpack)/buildin/harmony-module.js","webpack:///util (ignored)","webpack:///util (ignored)?4b85"],"names":["COLLECT_TITLE","COLLECT_DESCRIPTION","COLLECT_URL","collectTitle","title","type","collectDescription","description","collectUrl","url","App","React","Component","handleChange","e","dispatch","target","value","Description","props","mapStateToProps","state","connect","start","warning","perfect","characterCount","textColor","text","DescriptionCharCount","length","Header","deleteButton","deleteUserData","db","database","ref","set","downloadData","leadsRef","on","snapshot","forEach","childSnapshot","childData","val","jsonexport","err","csv","console","error","log","LowerSect","PopUp","close","carryInfo","data","writeUserData","urlDomain","a","document","createElement","href","hostname","domain","name","split","join","Preview","onCopy","Title","TitleCharCount","Url","firebaseConfig","apiKey","authDomain","databaseURL","projectId","storageBucket","messagingSenderId","appId","measurementId","firebase","initializeApp","composeEnhancers","window","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","compose","store","createStore","reducers","applyMiddleware","thunkMiddleware","ReactDOM","render","getElementById","action","combineReducers"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAMA,aAAa,GAAG,eAAtB;AACA,IAAMC,mBAAmB,GAAG,qBAA5B;AACA,IAAMC,WAAW,GAAG,aAApB;AAEA,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAAW;AACrC,SAAO;AACLC,QAAI,EAAE,eADD;AAELD,SAAK,EAAEA;AAFF,GAAP;AAID,CALM;AAOA,IAAME,kBAAkB,GAAG,SAArBA,kBAAqB,CAACC,WAAD,EAAiB;AACjD,SAAO;AACLF,QAAI,EAAE,qBADD;AAELE,eAAW,EAAEA;AAFR,GAAP;AAID,CALM;AAOA,IAAMC,UAAU,GAAG,SAAbA,UAAa,CAACC,GAAD,EAAS;AACjC,SAAO;AACLJ,QAAI,EAAE,aADD;AAELI,OAAG,EAAEA;AAFA,GAAP;AAID,CALM,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClBP;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;IAEMC,G;;;;;;;;;;;;;6BACM;AACR,0BACE;AAAK,iBAAS,EAAC;AAAf,sBACE,2DAAC,+CAAD,OADF,eAEE,2DAAC,+CAAD,OAFF,eAGE;AAAK,iBAAS,EAAC;AAAf,sBACE,mGADF,eAEE,2DAAC,4CAAD,OAFF,eAGE,2DAAC,8CAAD,OAHF,eAIE,2DAAC,oDAAD,OAJF,CAHF,eASE,2DAAC,iDAAD,OATF,eAUE,2DAAC,mDAAD,OAVF,CADF;AAcD;;;;EAhBeC,4CAAK,CAACC,S;;AAmBTF,kEAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7BA;AACA;AACA;;AAEA,SAASG,YAAT,CAAuBC,CAAvB,EAA0BC,QAA1B,EAAoC;AAClCA,UAAQ,CAACT,mEAAkB,CAACQ,CAAC,CAACE,MAAF,CAASC,KAAV,CAAnB,CAAR;AACD;;IAEKC,W;;;;;;;;;;;;;6BACM;AAAA;;AACR,0BACE,qFACE;AAAG,iBAAS,EAAC;AAAb,uBADF,eAEE;AACE,YAAI,EAAC,MADP;AAEE,UAAE,EAAC,aAFL;AAGE,iBAAS,EAAC,mBAHZ;AAIE,mBAAW,EAAC,qCAJd;AAKE,gBAAQ,EAAE,kBAAAJ,CAAC;AAAA,iBAAID,YAAY,CAACC,CAAD,EAAI,KAAI,CAACK,KAAL,CAAWJ,QAAf,CAAhB;AAAA;AALb,QAFF,CADF;AAaD;;;;EAfuBJ,4CAAK,CAACC,S;;AAkBhC,IAAMQ,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,KAAK,EAAI;AAC/B,SAAO;AACLd,eAAW,EAAEc,KAAK,CAACd;AADd,GAAP;AAGD,CAJD;;AAMee,0HAAO,CAACF,eAAD,CAAP,CAAyBF,WAAzB,CAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AChCA;AACA;AAEA,IAAMK,KAAK,GAAG,8DAAd;AACA,IAAMC,OAAO,GAAG,+EAAhB;AACA,IAAMC,OAAO,GAAG,mDAAhB;AAEA,IAAIC,cAAc,GAAG,EAArB;AACA,IAAIC,SAAS,GAAG,cAAhB;AACA,IAAIC,IAAI,GAAG,EAAX;;IAEMC,oB;;;;;;;;;;;;;6BACM;AACR,UAAI,KAAKV,KAAL,CAAWZ,WAAf,EAA4B;AAC1BmB,sBAAc,GAAG,KAAKP,KAAL,CAAWZ,WAAX,CAAuBuB,MAAxC;AACD,OAFD,MAEO;AACLJ,sBAAc,GAAG,CAAjB;AACD;;AAED,UAAIA,cAAc,KAAK,CAAvB,EAA0B;AACxBC,iBAAS,GAAG,cAAZ;AACAC,YAAI,GAAGL,KAAP;AACD,OAHD,MAGO,IAAIG,cAAc,GAAG,GAAjB,IAAwBA,cAAc,GAAG,GAA7C,EAAkD;AACvDC,iBAAS,GAAG,cAAZ;AACAC,YAAI,GAAGJ,OAAP;AACD,OAHM,MAGA;AACLG,iBAAS,GAAG,cAAZ;AACAC,YAAI,GAAGH,OAAP;AACD;;AACD,0BACE,qFACE;AAAG,iBAAS,EAAEE;AAAd,SAA0BC,IAA1B,OAAiCF,cAAjC,gBADF,CADF;AAKD;;;;EAvBgCf,4CAAK,CAACC,S;;AA0BzC,IAAMQ,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,KAAK,EAAI;AAC/B,SAAO;AACLd,eAAW,EAAEc,KAAK,CAACd;AADd,GAAP;AAGD,CAJD;;AAMee,0HAAO,CAACF,eAAD,CAAP,CAAyBS,oBAAzB,CAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3CA;;IAEME,M;;;;;;;;;;;;;6BACM;AACR,0BACE;AAAK,iBAAS,EAAC;AAAf,sBACE,2FADF,CADF;AAKD;;;;EAPkBpB,4CAAK,CAACC,S;;AAUZmB,qEAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACZA;AAEA;AAEA;;AAEA,IAAMC,YAAY,GAAG,SAAfA,YAAe,GAAM;AACzBC,gBAAc;AACf,CAFD;;AAIA,SAASA,cAAT,GAA2B;AACzBC,mDAAE,CAACC,QAAH,GAAcC,GAAd,CAAkB,UAAlB,EAA8BC,GAA9B,CAAkC,IAAlC;AACD;;AAED,SAASC,YAAT,GAAyB;AACvB,MAAMC,QAAQ,GAAGL,iDAAE,CAACC,QAAH,GAAcC,GAAd,CAAkB,UAAlB,CAAjB;AAEAG,UAAQ,CAACC,EAAT,CAAY,OAAZ,EAAqB,UAAUC,QAAV,EAAoB;AACvCA,YAAQ,CAACC,OAAT,CAAiB,UAAUC,aAAV,EAAyB;AACxC,UAAMC,SAAS,GAAGD,aAAa,CAACE,GAAd,EAAlB;AACAC,uDAAU,CAACF,SAAD,EAAY,UAAUG,GAAV,EAAeC,GAAf,EAAoB;AACxC,YAAID,GAAJ,EAAS,OAAOE,OAAO,CAACC,KAAR,CAAcH,GAAd,CAAP;AACTE,eAAO,CAACE,GAAR,CAAYH,GAAZ;AACD,OAHS,CAAV;AAID,KAND;AAOD,GARD;AASD;;IAEKI,S;;;;;;;;;;;;;6BACM;AACR,0BACE;AAAK,iBAAS,EAAC;AAAf,sBACE;AAAQ,iBAAS,EAAC,eAAlB;AAAkC,eAAO,EAAE;AAAA,iBAAMpB,YAAY,EAAlB;AAAA;AAA3C,sBADF,eAEE;AAAQ,iBAAS,EAAC,iBAAlB;AAAoC,eAAO,EAAE;AAAA,iBAAMM,YAAY,EAAlB;AAAA;AAA7C,yBAFF,CADF;AAMD;;;;EARqB3B,4CAAK,CAACC,S;;AAWfwC,wEAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvCA;AACA;AACA;AACA;;IAEMC,K;;;;;;;;;;;;;6BACM;AAAA;;AACR,0BACE;AAAK,iBAAS,EAAC;AAAf,sBACE,2DAAC,qDAAD;AACE,eAAO,eAAE;AAAQ,mBAAS,EAAC;AAAlB,0CAAiD,sEAAjD,eADX;AAEE,aAAK,MAFP;AAGE,cAAM;AAHR,SAKG,UAAAC,KAAK;AAAA,4BACJ;AAAK,mBAAS,EAAC;AAAf,wBACE;AAAQ,mBAAS,EAAC,OAAlB;AAA0B,iBAAO,EAAEA;AAAnC,kBADF,eAIE;AAAK,mBAAS,EAAC;AAAf,wBACE;AAAK,mBAAS,EAAC;AAAf,8BADF,eAEE;AAAK,mBAAS,EAAC;AAAf,WACG,GADH,gFAGE,sEAHF,aAIgB,KAAI,CAACnC,KAAL,CAAWf,KAJ3B,2BAKE,sEALF,qCAM6C,KAAI,CAACe,KAAL,CAAWf,KANxD,sBAOE,sEAPF,2CAQmD,KAAI,CAACe,KAAL,CAAWZ,WAR9D,6BASE,sEATF,CAFF,eAaE;AAAK,mBAAS,EAAC;AAAf,wBACE;AACE,mBAAS,EAAC,QADZ;AAEE,iBAAO,EAAE,mBAAM;AACb0C,mBAAO,CAACE,GAAR,CAAY,eAAZ;AACAG,iBAAK;AACN;AALH,kBADF,CAbF,CAJF,CADI;AAAA,OALR,CADF,CADF;AA0CD;;;;EA5CiB3C,4CAAK,CAACC,S;;AA+C1B,IAAMQ,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,KAAK,EAAI;AAC/B,SAAO;AACLjB,SAAK,EAAEiB,KAAK,CAACjB,KADR;AAELG,eAAW,EAAEc,KAAK,CAACd;AAFd,GAAP;AAID,CALD;;AAOee,0HAAO,CAACF,eAAD,CAAP,CAAyBiC,KAAzB,CAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3DA;AACA;AACA;AACA;AAEA;AACA;;AAEA,IAAME,SAAS,GAAG,SAAZA,SAAY,CAACC,IAAD,EAAU;AAC1BC,eAAa,CAACD,IAAI,CAAC/C,GAAN,EAAW+C,IAAI,CAACpD,KAAhB,EAAuBoD,IAAI,CAACjD,WAA5B,CAAb;AACD,CAFD;;AAIA,SAASmD,SAAT,CAAoBF,IAApB,EAA0B;AACxB,MAAIG,CAAC,GAAGC,QAAQ,CAACC,aAAT,CAAuB,GAAvB,CAAR;AACAF,GAAC,CAACG,IAAF,GAASN,IAAT;AACA,SAAOG,CAAC,CAACI,QAAT;AACD;;AAED,SAASN,aAAT,CAAwBhD,GAAxB,EAA6BL,KAA7B,EAAoCG,WAApC,EAAiD;AAC/C,MAAMyD,MAAM,GAAGN,SAAS,CAACjD,GAAD,CAAxB;AACA,MAAMwD,IAAI,GAAGD,MAAM,CAACE,KAAP,CAAa,GAAb,EAAkBC,IAAlB,CAAuB,EAAvB,CAAb;AACAjC,mDAAE,CAACC,QAAH,GAAcC,GAAd,CAAkB,cAAc6B,IAAhC,EAAsC5B,GAAtC,CAA0C;AACxCjC,SAAK,EAAEA,KADiC;AAExCG,eAAW,EAAEA,WAF2B;AAGxCE,OAAG,EAAEA;AAHmC,GAA1C;AAKD;;IAEK2D,O;;;;;;;;;;;;;6BACM;AAAA;;AACR,0BACE;AAAK,iBAAS,EAAC;AAAf,sBACE,mGADF,eAEE;AAAK,iBAAS,EAAC;AAAf,sBACE;AAAI,iBAAS,EAAC;AAAd,SAA+B,KAAKjD,KAAL,CAAWf,KAA1C,CADF,eAEE;AAAG,iBAAS,EAAC;AAAb,SAA4B,KAAKe,KAAL,CAAWV,GAAvC,CAFF,eAGE;AAAG,iBAAS,EAAC;AAAb,SAAoC,KAAKU,KAAL,CAAWZ,WAA/C,CAHF,CAFF,eAOE;AAAK,iBAAS,EAAC;AAAf,sBACE,2DAAC,uEAAD;AAAiB,YAAI,EAAE,KAAKY,KAAL,CAAWf,KAAlC;AAAyC,cAAM,EAAE,KAAKiE;AAAtD,sBACE,wFADF,CADF,eAIE,2DAAC,uEAAD;AAAiB,YAAI,EAAE,KAAKlD,KAAL,CAAWZ,WAAlC;AAA+C,cAAM,EAAE,KAAK8D;AAA5D,sBACE,8FADF,CAJF,eAOE;AAAQ,eAAO,EAAE;AAAA,iBAAMd,SAAS,CAAC,KAAI,CAACpC,KAAN,CAAf;AAAA,SAAjB;AAA8C,iBAAS,EAAC;AAAxD,gBAPF,CAPF,eAgBE;AAAK,iBAAS,EAAC;AAAf,sBACE,2DAAC,uDAAD,OADF,eAEE,2DAAC,8DAAD,OAFF,CAhBF,CADF;AAwBD;;;;EA1BmBR,4CAAK,CAACC,S;;AA6B5B,IAAMQ,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,KAAK,EAAI;AAC/B,SAAO;AACLjB,SAAK,EAAEiB,KAAK,CAACjB,KADR;AAELG,eAAW,EAAEc,KAAK,CAACd,WAFd;AAGLE,OAAG,EAAEY,KAAK,CAACZ;AAHN,GAAP;AAKD,CAND;;AAQea,0HAAO,CAACF,eAAD,CAAP,CAAyBgD,OAAzB,CAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjEA;AACA;AACA;;AAEA,SAASvD,YAAT,CAAuBC,CAAvB,EAA0BC,QAA1B,EAAoC;AAClCA,UAAQ,CAACZ,6DAAY,CAACW,CAAC,CAACE,MAAF,CAASC,KAAV,CAAb,CAAR;AACD;;IAEKqD,K;;;;;;;;;;;;;6BACM;AAAA;;AACR,0BACE,qFACE;AAAG,iBAAS,EAAC;AAAb,iBADF,eAEE;AACE,YAAI,EAAC,MADP;AAEE,UAAE,EAAC,OAFL;AAGE,iBAAS,EAAC,aAHZ;AAIE,mBAAW,EAAC,2CAJd;AAKE,gBAAQ,EAAE,kBAAAxD,CAAC;AAAA,iBAAID,YAAY,CAACC,CAAD,EAAI,KAAI,CAACK,KAAL,CAAWJ,QAAf,CAAhB;AAAA;AALb,QAFF,CADF;AAaD;;;;EAfiBJ,4CAAK,CAACC,S;;AAkB1B,IAAMQ,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,KAAK,EAAI;AAC/B,SAAO;AACLjB,SAAK,EAAEiB,KAAK,CAACjB;AADR,GAAP;AAGD,CAJD;;AAMekB,0HAAO,CAACF,eAAD,CAAP,CAAyBkD,KAAzB,CAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AChCA;AACA;AAEA,IAAM/C,KAAK,GAAG,sDAAd;AACA,IAAMC,OAAO,GAAG,uEAAhB;AACA,IAAMC,OAAO,GAAG,6CAAhB;AAEA,IAAIC,cAAc,GAAG,EAArB;AACA,IAAIC,SAAS,GAAG,cAAhB;AACA,IAAIC,IAAI,GAAGL,KAAX;;IAEMgD,c;;;;;;;;;;;;;6BACM;AACR,UAAI,KAAKpD,KAAL,CAAWf,KAAf,EAAsB;AACpBsB,sBAAc,GAAG,KAAKP,KAAL,CAAWf,KAAX,CAAiB0B,MAAlC;AACD,OAFD,MAEO;AACLJ,sBAAc,GAAG,CAAjB;AACD;;AAED,UAAIA,cAAc,KAAK,CAAvB,EAA0B;AACxBC,iBAAS,GAAG,cAAZ;AACAC,YAAI,GAAGL,KAAP;AACD,OAHD,MAGO,IAAIG,cAAc,GAAG,EAAjB,IAAuBA,cAAc,GAAG,EAA5C,EAAgD;AACrDC,iBAAS,GAAG,cAAZ;AACAC,YAAI,GAAGJ,OAAP;AACD,OAHM,MAGA,IAAIE,cAAc,GAAG,EAAjB,IAAuBA,cAAc,GAAG,EAA5C,EAAgD;AACrDC,iBAAS,GAAG,cAAZ;AACAC,YAAI,GAAGH,OAAP;AACD;;AAED,0BACE,qFACE;AAAG,iBAAS,EAAEE;AAAd,SAA0BC,IAA1B,OAAiCF,cAAjC,gBADF,CADF;AAKD;;;;EAxB0Bf,4CAAK,CAACC,S;;AA2BnC,IAAMQ,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,KAAK,EAAI;AAC/B,SAAO;AACLjB,SAAK,EAAEiB,KAAK,CAACjB;AADR,GAAP;AAGD,CAJD;;AAMekB,0HAAO,CAACF,eAAD,CAAP,CAAyBmD,cAAzB,CAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5CA;AACA;AACA;;AAEA,SAAS1D,YAAT,CAAuBC,CAAvB,EAA0BC,QAA1B,EAAoC;AAClCA,UAAQ,CAACP,2DAAU,CAACM,CAAC,CAACE,MAAF,CAASC,KAAV,CAAX,CAAR;AACD;;IAEKuD,G;;;;;;;;;;;;;6BACM;AAAA;;AACR,0BACE,qFACE;AAAG,iBAAS,EAAC;AAAb,eADF,eAEE;AAAK,iBAAS,EAAC;AAAf,sBACE;AACE,YAAI,EAAC,MADP;AAEE,UAAE,EAAC,KAFL;AAGE,iBAAS,EAAC,WAHZ;AAIE,mBAAW,EAAC,qBAJd;AAKE,gBAAQ,EAAE,kBAAA1D,CAAC;AAAA,iBAAID,YAAY,CAACC,CAAD,EAAI,KAAI,CAACK,KAAL,CAAWJ,QAAf,CAAhB;AAAA;AALb,QADF,CAFF,CADF;AAeD;;;;EAjBeJ,4CAAK,CAACC,S;;AAoBxB,IAAMQ,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,KAAK,EAAI;AAC/B,SAAO;AACLZ,OAAG,EAAEY,KAAK,CAACZ;AADN,GAAP;AAGD,CAJD;;AAMea,0HAAO,CAACF,eAAD,CAAP,CAAyBoD,GAAzB,CAAf,E;;;;;;;;;;;;AClCA;AAAA;AAAA;AAEA,IAAMC,cAAc,GAAG;AACrBC,QAAM,EAAE,yCADa;AAErBC,YAAU,EAAE,mCAFS;AAGrBC,aAAW,EAAE,0CAHQ;AAIrBC,WAAS,EAAE,mBAJU;AAKrBC,eAAa,EAAE,+BALM;AAMrBC,mBAAiB,EAAE,cANE;AAOrBC,OAAK,EAAE,2CAPc;AAQrBC,eAAa,EAAE;AARM,CAAvB;AAWA,IAAM/C,EAAE,GAAGgD,gDAAQ,CAACC,aAAT,CAAuBV,cAAvB,CAAX;AAEevC,iEAAf,E;;;;;;;;;;;;ACfA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA,IAAMkD,gBAAgB,GAAGC,MAAM,CAACC,oCAAP,IAA+CC,6CAAxE;AACA,IAAMC,KAAK,GAAGC,yDAAW,CACvBC,iDADuB,EAEvBN,gBAAgB,CAACO,6DAAe,CAACC,mDAAD,CAAhB,CAFO,CAAzB;AAKAC,gDAAQ,CAACC,MAAT,eACE,2DAAC,oDAAD;AAAU,OAAK,EAAEN;AAAjB,gBACE,2DAAC,uDAAD,OADF,CADF,EAIE5B,QAAQ,CAACmC,cAAT,CAAwB,KAAxB,CAJF,E;;;;;;;;;;;;ACfA;AAAA;AAAA;AAAA;AAEe,SAASzF,kBAAT,GAAuL;AAAA,MAA1Je,KAA0J,uEAAlJ,wIAAkJ;AAAA,MAAR2E,MAAQ;;AACpM,UAAQA,MAAM,CAAC3F,IAAf;AACE,SAAKJ,4DAAL;AACE,aAAO+F,MAAM,CAACzF,WAAd;;AACF;AACE,aAAOc,KAAP;AAJJ;AAMD,C;;;;;;;;;;;;ACTD;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAEe4E,4HAAe,CAAC;AAC7B7F,OAAK,EAALA,8CAD6B;AAE7BG,aAAW,EAAXA,oDAF6B;AAG7BE,KAAG,EAAHA,4CAAGA;AAH0B,CAAD,CAA9B,E;;;;;;;;;;;;ACLA;AAAA;AAAA;AAAA;AAEe,SAASN,YAAT,GAA8F;AAAA,MAAvEkB,KAAuE,uEAA/D,qDAA+D;AAAA,MAAR2E,MAAQ;;AAC3G,UAAQA,MAAM,CAAC3F,IAAf;AACE,SAAKL,sDAAL;AACE,aAAOgG,MAAM,CAAC5F,KAAd;;AACF;AACE,aAAOiB,KAAP;AAJJ;AAMD,C;;;;;;;;;;;;ACTD;AAAA;AAAA;AAAA;AAEe,SAASb,UAAT,GAA+D;AAAA,MAA1Ca,KAA0C,uEAAlC,wBAAkC;AAAA,MAAR2E,MAAQ;;AAC5E,UAAQA,MAAM,CAAC3F,IAAf;AACE,SAAKH,oDAAL;AACE,aAAO8F,MAAM,CAACvF,GAAd;;AACF;AACE,aAAOY,KAAP;AAJJ;AAMD,C;;;;;;;;;;;ACTD;AACA;AACA;AACA;;AAEA;AACA;;AAEA,wC;;;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;;AAEA,iC;;;;;;;;;;;ACNA;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,8B;;;;;;;;;;;;AChBA;AAAA;AAAe;AACf;AACA,mBAAmB,sBAAsB;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,C;;;;;;;;;;;;AChBA;AAAA;AAAe;AACf;AACA;AACA;AACA;;AAEA,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;;AAEA,iC;;;;;;;;;;;ACPA,qBAAqB,mBAAO,CAAC,iFAAkB;;AAE/C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA,2B;;;;;;;;;;;ACjBA,cAAc,mBAAO,CAAC,0EAAmB;;AAEzC,4BAA4B,mBAAO,CAAC,+FAAyB;;AAE7D;AACA;AACA;AACA;;AAEA;AACA;;AAEA,4C;;;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,iC;;;;;;;;;;;ACTA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yB;;;;;;;;;;;;AChBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAyD;AACpB;AACJ;AACS;AACmI;AAC7H;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmF,OAAO;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kCAAkC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8BAA8B;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,sDAAQ,CAAC,sDAAQ,GAAG,iBAAiB,2BAA2B;AAC7F;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA,mDAAmD,4BAA4B;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA,mDAAmD,gBAAgB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA,8DAA8D,gBAAgB;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,uDAAM;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E,+CAA+C,EAAE;AAChI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,0CAA0C,EAAE;AACnI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,4BAA4B;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,gBAAgB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,+FAA+F,IAAI;AACnG;AACA;AACA;AACA;AACA;AACA,0IAA0I,QAAQ;AAClJ;AACA;AACA,0EAA0E,WAAW;AACrF;AACA;AACA,0EAA0E,WAAW;AACrF;AACA,8EAA8E,uBAAuB;AACrG,0FAA0F,YAAY,GAAG,iBAAiB;AAC1H;AACA;AACA;AACA;AACA;AACA,wBAAwB,2DAAY;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,uBAAuB;AACjE,wCAAwC,uCAAuC;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,OAAO;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,8BAA8B;AAC7D,WAAW,uDAAS;AACpB;AACA;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,QAAQ,uDAAS;AACrD,uBAAuB,yDAAW;AAClC;AACA;AACA;AACA,iBAAiB;AACjB,aAAa,EAAE,EAAE;AACjB,sEAAsE,6DAA6D;AACnI,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,8BAA8B;AAC7D,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,6CAA6C;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,6CAA6C;AAChG;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,6EAAsB;AAChD,0BAA0B,6EAAsB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA,uBAAuB,4DAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,mBAAmB,EAAE;AACzE;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA,0BAA0B,2EAAoB;AAC9C;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,yCAAyC,gFAAyB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,6CAA6C,wBAAwB,EAAE;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,2BAA2B;AAClE,kDAAkD,mCAAmC;AACrF,wCAAwC,yBAAyB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,yEAAkB;AAC1B;AACA;AACA,SAAS,wEAAiB;AAC1B;AACA;AACA;AACA;AACA,4CAA4C,2CAA2C,EAAE;AACzF;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iIAAiI,wBAAwB,EAAE;AAC3J,SAAS;AACT;AACA,6HAA6H,wBAAwB,EAAE;AACvJ,SAAS;AACT;AACA,8GAA8G,wBAAwB,EAAE;AACxI,SAAS;AACT;AACA,8HAA8H,wBAAwB,EAAE;AACxJ,SAAS;AACT;AACA,yGAAyG,wBAAwB,EAAE;AACnI,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,4CAA4C,6DAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL,4CAA4C,6DAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,kBAAkB,qDAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA,wBAAwB,yEAAkB;AAC1C;AACA;AACA,yBAAyB,wEAAiB;AAC1C;AACA;AACA,yBAAyB,2EAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA,yCAAyC,gFAAyB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEgF;AAChF;;;;;;;;;;;;;ACpsCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA2C;AACuE;AAC9C;AACM;;AAE1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,mDAAmD,SAAS;AAC5D;AACA,iEAAiE,SAAS;AAC1E,oEAAoE,SAAS;AAC7E,gEAAgE,SAAS;AACzE,uEAAuE,SAAS;AAChF;AACA;AACA;AACA,wBAAwB,2DAAY;;AAEpC;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,uDAAM;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+DAAQ;AAChC,6BAA6B,sEAAkB;AAC/C;AACA,+BAA+B,6DAAS,qBAAqB,cAAc,EAAE;AAC7E;AACA;AACA,0BAA0B,sDAAQ,8DAA8D,UAAU;AAC1G;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,uFAAuF,0BAA0B,EAAE;AACnH,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,yCAAyC;AACrF;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,yCAAyC;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,sBAAsB;AAC/F;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,4DAAW;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,+DAAQ;AACrB,+DAA+D,gBAAgB;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,gBAAgB;AACnD;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,YAAY,+DAAQ;AACpB,6EAA6E,gBAAgB;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,mBAAmB,EAAE;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,gBAAgB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iEAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,uBAAuB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ,oCAAoC,UAAU;AAChF;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,6DAAS,oCAAoC,UAAU,qCAAqC,EAAE,EAAE;AAC9H;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,QAAQ,0EAAiB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,sDAAQ,CAAC,sDAAQ,GAAG,wBAAwB;AACrE;AACA,yBAAyB,8DAAe;AACxC,sBAAsB,2DAAY;AAClC,oBAAoB,yDAAU,EAAE;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,iEAAU;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,0CAA0C,kBAAkB,EAAE;AAC9D;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,6DAAS,0CAA0C,6CAA6C,EAAE;AAC9I;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gEAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;;AAEe,yEAAU,EAAC;AACQ;AAClC;;;;;;;;;;;;;AC7pBA;AAAA;AAAqC,aAAa;;AAElD;AACA;AACA;AACA,0FAA0F,yDAAyD,eAAe,kGAAkG,YAAY,WAAW,KAAK,WAAW,4BAA4B,kBAAkB;AACzV,iBAAiB,MAAM,SAAS,eAAe,YAAY,aAAa,KAAK,WAAW,gBAAgB,EAAE,OAAO,gBAAgB,OAAO,OAAO,uBAAuB,oCAAoC,GAAG,eAAe,QAAQ,kBAAkB,mBAAmB,qBAAqB,EAAE,UAAU,eAAe,sEAAsE,oBAAoB;AACnZ,yBAAyB,cAAc,SAAS,cAAc,UAAU,eAAe,IAAI,sBAAsB,SAAS,aAAa,aAAa,YAAY,cAAc,0CAA0C,KAAK,EAAE,cAAc,0BAA0B,iBAAiB,UAAU,WAAW,kBAAkB,MAAM,EAAE,gBAAgB,oBAAoB,0BAA0B,QAAQ,yBAAyB,KAAK,sBAAsB,EAAE,aAAa,UAAU,YAAY,WAAW,KAAK;AACtf,KAAK,UAAU,IAAI,IAAI,SAAS,YAAY,aAAa,0BAA0B,kBAAkB,SAAS,GAAG,yBAAyB,cAAc,mBAAmB,uBAAuB,gBAAgB,OAAO,qCAAqC,0BAA0B,wEAAwE,iCAAiC,KAAK,mBAAmB,4BAA4B,QAAQ,qBAAqB,QAAQ,aAAa;AACve,0BAA0B,aAAa,IAAI,SAAS,SAAS,UAAU,OAAO,4CAA4C,0BAA0B,aAAa,0BAA0B,aAAa,4BAA4B,iGAAiG,SAAS,SAAS,UAAU,yBAAyB,iBAAiB,YAAY,gBAAgB,mBAAmB,cAAc,YAAY,0BAA0B;AAC9e,0BAA0B,4BAA4B,eAAe,IAAI,6BAA6B,SAAS,cAAc,+BAA+B,gBAAgB,wCAAwC,IAAI,SAAS,UAAU,OAAO,GAAG,8BAA8B,IAAI,IAAI,EAAE,uBAAuB,UAAU,8BAA8B,4BAA4B,6BAA6B,aAAa,YAAY,cAAc,MAAM,cAAc,MAAM;AACtd,OAAO,WAAW,oCAAoC,YAAY,qBAAqB,2BAA2B,KAAK,GAAG,mBAAmB,2BAA2B,2BAA2B,QAAQ,8BAA8B,GAAG,kBAAkB,uBAAuB,wCAAwC,eAAe,oBAAoB,SAAS,IAAI,YAAY,aAAa,gEAAgE,eAAe,GAAG,SAAS;AACje,aAAa,gCAAgC,IAAI,WAAW;AAC5D,eAAe,eAAe,qBAAqB,oCAAoC,gCAAgC,wCAAwC,uCAAuC,6KAA6K,oJAAoJ;AACvgB,iEAAiE,SAAS,eAAe,YAAY,yDAAyD,eAAe,wBAAwB,cAAc,eAAe,0CAA0C,eAAe,uEAAuE,mDAAmD,mBAAmB;AACxa,mBAAmB,oBAAoB,uBAAuB,8CAA8C,kBAAkB,4CAA4C,mCAAmC,qBAAqB,kBAAkB,6BAA6B,kBAAkB,iGAAiG;AACpY,iBAAiB,8CAA8C,kBAAkB,gBAAgB,0BAA0B,wBAAwB,4BAA4B,iBAAiB,gBAAgB,cAAc,wBAAwB,iBAAiB,kBAAkB,2BAA2B;;AAEpT;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,eAAe,0BAA0B,eAAe,WAAW,yBAAyB,OAAO,qCAAqC,kCAAkC,UAAU,8BAA8B,iBAAiB,eAAe,gBAAgB;AACpR,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0GAA0G;;AAE1G;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAI,qOAAqO,KAAK,yKAAyK,KAAK;AACpa,wIAAwI,KAAK;AAC7I,eAAe,gDAAgD,8EAA8E,YAAY,OAAO,kCAAkC,eAAe,eAAe,IAAI,yBAAyB,SAAS,WAAW,cAAc,2DAA2D,KAAK,oBAAoB,kBAAkB,4BAA4B,WAAW,+BAA+B,iBAAiB,gBAAgB,8BAA8B,IAAI,mCAAmC,oBAAoB,QAAQ,mCAAmC,iBAAiB,gFAAgF,iBAAiB,SAAS,SAAS,SAAS,YAAY,4BAA4B,aAAa,SAAS,aAAa,cAAc,YAAY,gBAAgB,UAAU,iBAAiB,OAAO,mCAAmC,cAAc,mBAAmB,yBAAyB,cAAc,aAAa,UAAU,EAAE,+BAA+B,eAAe,WAAW,8BAA8B,UAAU,cAAc,gBAAgB,sDAAsD,SAAS,cAAc,6BAA6B,+BAA+B,SAAS,SAAS,gBAAgB,8BAA8B,8BAA8B,6CAA6C,gDAAgD,eAAe,gFAAgF,YAAY,WAAW,iCAAiC,SAAS,2CAA2C,oCAAoC,iBAAiB,2DAA2D,IAAI;AAC1xD,iBAAiB,yDAAyD,KAAK;AAC/E,4CAA4C,+CAA+C,eAAe,oEAAoE,IAAI,eAAe,WAAW,iCAAiC,SAAS,sCAAsC,4CAA4C,eAAe,sEAAsE,IAAI,2CAA2C,SAAS;AACrd,GAAG,6CAA6C,eAAe,2DAA2D,IAAI,gDAAgD,UAAU,eAAe,GAAG,SAAS,2DAA2D,IAAI,wCAAwC,IAAI,QAAQ,KAAK,qDAAqD,iBAAiB;AACjZ,iBAAiB,UAAU,MAAM,6CAA6C,SAAS,iBAAiB,QAAQ,mBAAmB,wEAAwE,EAAE,eAAe,kDAAkD,eAAe,eAAe,QAAQ,uBAAuB,IAAI,cAAc,SAAS,UAAU,yCAAyC,gBAAgB,aAAa,kDAAkD,qEAAqE,gBAAgB,uBAAuB,iBAAiB,uBAAuB,OAAO,GAAG,mBAAmB,OAAO,oBAAoB,OAAO,MAAM,SAAS,MAAM,cAAc,gBAAgB,iBAAiB,uCAAuC,eAAe,wBAAwB,SAAS,eAAe,QAAQ,GAAG,qBAAqB,SAAS,kHAAkH,gBAAgB,gBAAgB,mBAAmB,KAAK,eAAe,qBAAqB,YAAY,YAAY,qEAAqE,iBAAiB,GAAG,IAAI,8DAA8D,OAAO,0BAA0B,QAAQ,SAAS,UAAU,OAAO,+GAA+G,YAAY,uFAAuF,SAAS,sCAAsC,uDAAuD,+DAA+D;AACzsD,OAAO,iBAAiB,qBAAqB,UAAU,mBAAmB,2BAA2B,eAAe,iCAAiC,aAAa,WAAW,GAAG,eAAe,4DAA4D,iDAAiD,yBAAyB,SAAS,MAAM,kBAAkB,iBAAiB,qBAAqB,UAAU,mBAAmB,2BAA2B,0BAA0B,iCAAiC,0BAA0B,WAAW,GAAG,eAAe,4DAA4D,6EAA6E;AAC/rB,iBAAiB,YAAY,oEAAoE,6BAA6B,4KAA4K,OAAO,2DAA2D,EAAE;AAC9W,UAAU,MAAM,gGAAgG,OAAO,iBAAiB,qBAAqB,UAAU,mBAAmB,2BAA2B,0BAA0B,iCAAiC,eAAe,WAAW,GAAG,eAAe,4DAA4D,kEAAkE,2BAA2B;AACrd,eAAe,4BAA4B,4CAA4C,0CAA0C,oBAAoB,SAAS,OAAO,cAAc,UAAU,UAAU,mBAAmB,2BAA2B,0BAA0B,iCAAiC,gBAAgB,WAAW,GAAG,eAAe,4DAA4D,mEAAmE,4BAA4B,UAAU,eAAe,aAAa,MAAM,SAAS,sBAAsB,cAAc,WAAW,eAAe,wBAAwB,0BAA0B,uBAAuB,iBAAiB,0BAA0B,YAAY,gBAAgB,aAAa,4GAA4G,KAAK,QAAQ,MAAM,KAAK,8BAA8B,iBAAiB,uEAAuE,qBAAqB,wBAAwB,sBAAsB,eAAe,uDAAuD,6CAA6C,6CAA6C,+CAA+C,8CAA8C,gDAAgD,KAAK,UAAU,eAAe,WAAW,SAAS,WAAW,iBAAiB,SAAS,iEAAiE,mNAAmN,cAAc,iBAAiB,+BAA+B;AAC3xD,GAAG,wBAAwB,SAAS,sBAAsB,QAAQ,WAAW,sCAAsC,oCAAoC,QAAQ,WAAW,oCAAoC,6CAA6C,GAAG,qBAAqB,OAAO,YAAY,gCAAgC,cAAc,SAAS,MAAM;AACnW,eAAe,uBAAuB,qGAAqG,UAAU,KAAK,0BAA0B,GAAG,0CAA0C,0CAA0C,wCAAwC,8HAA8H,OAAO,OAAO,YAAY,YAAY,EAAE;AACzd,8BAA8B,IAAI,iDAAiD,UAAU,0BAA0B,eAAe,eAAe,gDAAgD,iBAAiB,mBAAmB,wCAAwC,4MAA4M;AAC7d,QAAQ;AACR,mBAAmB,iDAAiD,6BAA6B,UAAU,yCAAyC,WAAW,iCAAiC,SAAS,OAAO,cAAc,IAAI,YAAY,aAAa,UAAU,wFAAwF,sBAAsB;AACnX,mBAAmB,cAAc,4DAA4D,YAAY,WAAW,KAAK,WAAW,oDAAoD,iBAAiB,YAAY,6DAA6D,0BAA0B,eAAe,iCAAiC,iEAAiE,yCAAyC,UAAU,eAAe,wBAAwB,SAAS,IAAI;AACpgB,cAAc,uBAAuB,8HAA8H,4BAA4B,uBAAuB,MAAM,wCAAwC,sBAAsB,aAAa,SAAS,gBAAgB,UAAU,gHAAgH,gBAAgB,2DAA2D;AACrgB,MAAM,mCAAmC,cAAc,YAAY,uBAAuB,qBAAqB,EAAE,sDAAsD,gBAAgB,KAAK,6BAA6B,oBAAoB,SAAS,WAAW,UAAU,MAAM,mBAAmB,QAAQ,MAAM,SAAS,wBAAwB,mBAAmB,oBAAoB,iBAAiB,SAAS,iBAAiB,YAAY,OAAO,cAAc,iCAAiC,gCAAgC,cAAc,YAAY,mBAAmB,SAAS,wJAAwJ,oBAAoB,cAAc,UAAU,OAAO,EAAE,IAAI,cAAc,SAAS,MAAM,SAAS,OAAO,gBAAgB,UAAU,cAAc,0BAA0B,iBAAiB,aAAa,WAAW,qBAAqB,WAAW,aAAa,0BAA0B,8BAA8B,kCAAkC,UAAU,WAAW,EAAE,SAAS,eAAe,mBAAmB,cAAc,2CAA2C,UAAU,8BAA8B,iCAAiC,WAAW,yBAAyB,cAAc,aAAa,UAAU;AAC1zC,mBAAmB,eAAe,MAAM,MAAM,MAAM,SAAS,cAAc,2BAA2B,gBAAgB,WAAW,SAAS,cAAc,2BAA2B,KAAK,EAAE,mBAAmB,4BAA4B,eAAe,2BAA2B,oBAAoB,6BAA6B,IAAI,OAAO,WAAW,eAAe,KAAK,OAAO,WAAW,2BAA2B,UAAU;AACra,eAAe,yBAAyB,oBAAoB,+BAA+B,IAAI,QAAQ,cAAc,EAAE,gBAAgB,WAAW,OAAO,WAAW,uCAAuC,UAAU,EAAE,iCAAiC,6CAA6C,8BAA8B,cAAc,mBAAmB,YAAY,OAAO,WAAW,aAAa,kBAAkB;AACja,qBAAqB,eAAe,gBAAgB,cAAc,WAAW,SAAS,iBAAiB,mBAAmB,UAAU,QAAQ,gCAAgC,wCAAwC,kBAAkB,gGAAgG,SAAS,gBAAgB,iBAAiB,6BAA6B,qBAAqB;AACla,qBAAqB,yBAAyB,wBAAwB,kBAAkB,IAAI,kBAAkB,KAAK,SAAS,MAAM,GAAG,kBAAkB,IAAI,kBAAkB,sCAAsC,SAAS,MAAM,GAAG,EAAE,QAAQ,QAAQ,WAAW,iBAAiB,UAAU,eAAe,iBAAiB,UAAU;AACvU,mBAAmB,mKAAmK,qBAAqB,sDAAsD,iCAAiC,YAAY,aAAa,iCAAiC,SAAS,sBAAsB;AAC3X,uBAAuB,cAAc,sBAAsB,cAAc,sBAAsB,SAAS,IAAI,cAAc,SAAS,MAAM,eAAe,yBAAyB,eAAe,WAAW,oCAAoC,gBAAgB,SAAS,gBAAgB,UAAU,WAAW,0BAA0B;AACvU,qBAAqB,yBAAyB,OAAO,aAAa,4BAA4B,SAAS,4BAA4B,SAAS,gBAAgB,SAAS,mBAAmB,2CAA2C,iBAAiB,OAAO,cAAc,qBAAqB,EAAE,UAAU,eAAe,eAAe,QAAQ,2BAA2B,cAAc,2BAA2B,gBAAgB,gBAAgB,eAAe,mBAAmB,eAAe,kCAAkC,YAAY,mMAAmM,cAAc,2BAA2B,gBAAgB,eAAe,oBAAoB,kCAAkC,UAAU,wDAAwD,wDAAwD,mCAAmC,YAAY,eAAe,MAAM,EAAE,IAAI,mEAAmE,UAAU,SAAS,GAAG,gBAAgB,YAAY,qBAAqB,yBAAyB,sCAAsC,0BAA0B,iBAAiB,yBAAyB,2CAA2C,kEAAkE,YAAY,uDAAuD,iBAAiB,oBAAoB,YAAY,MAAM,4FAA4F,mCAAmC,SAAS,sBAAsB,OAAO,GAAG,IAAI,eAAe,SAAS,QAAQ,UAAU,KAAK,aAAa;AACpvD,iDAAiD,qBAAqB,sTAAsT,qBAAqB,mBAAmB,uBAAuB,qBAAqB,yBAAyB;AACze,UAAU,8BAA8B,qFAAqF,SAAS,2CAA2C,QAAQ,WAAW,4BAA4B,EAAE,uCAAuC,gCAAgC,aAAa,uCAAuC,gCAAgC,0DAA0D,YAAY,0BAA0B,eAAe,wDAAwD,uBAAuB,gBAAgB,gBAAgB,WAAW,YAAY,iBAAiB,UAAU,cAAc,mBAAmB,eAAe,QAAQ,gBAAgB,aAAa,WAAW,WAAW,eAAe,WAAW,UAAU,SAAS,qCAAqC,mBAAmB,YAAY,6BAA6B,kBAAkB,2EAA2E,UAAU,iBAAiB,aAAa,wEAAwE,qBAAqB,YAAY,WAAW,KAAK,WAAW,0DAA0D,UAAU,gDAAgD,MAAM,uBAAuB,2BAA2B,qCAAqC,WAAW,qBAAqB;AACh4C,yBAAyB,wCAAwC,mCAAmC,uBAAuB,mBAAmB,aAAa,OAAO,UAAU,QAAQ,aAAa,wFAAwF,wDAAwD,yDAAyD,sEAAsE;AAChd,cAAc,0BAA0B,kCAAkC,aAAa,6BAA6B,gBAAgB,SAAS,uBAAuB,gCAAgC,WAAW,qBAAqB;AACpO,sBAAsB,gCAAgC,WAAW,oBAAoB;AACrF,eAAe,kCAAkC,YAAY,sBAAsB,KAAK,uBAAuB,qJAAqJ,KAAK,4DAA4D,eAAe;AACpV,qBAAqB,SAAS,uDAAuD,WAAW,KAAK,WAAW,gDAAgD,SAAS,iBAAiB,+BAA+B,YAAY;AACrO,iBAAiB,iBAAiB,QAAQ,SAAS,qBAAqB,gBAAgB,WAAW,0BAA0B,OAAO,QAAQ,IAAI,IAAI,iBAAiB,KAAK,0CAA0C,GAAG,SAAS,oBAAoB,aAAa,QAAQ,SAAS,KAAK,6CAA6C,KAAK,UAAU,EAAE,yBAAyB,SAAS,iBAAiB,KAAK,KAAK,SAAS,sBAAsB,OAAO,QAAQ,WAAW,sCAAsC,SAAS;AAC1f,gBAAgB,eAAe,QAAQ,8BAA8B,sDAAsD,eAAe,kBAAkB,0BAA0B,wBAAwB,EAAE,cAAc,aAAa,cAAc,oBAAoB,aAAa,aAAa,QAAQ,mBAAmB,+CAA+C,kBAAkB,kDAAkD;AACrb,sCAAsC,gBAAgB,cAAc,EAAE,iBAAiB,UAAU,gBAAgB,oCAAoC,4CAA4C,KAAK,QAAQ,aAAa,OAAO,KAAK,0BAA0B,KAAK,KAAK,eAAe,kBAAkB,QAAQ,kBAAkB,kBAAkB,aAAa,WAAW,iCAAiC;AACjZ,0BAA0B,mBAAmB,WAAW,mBAAmB,cAAc,qBAAqB,WAAW,iBAAiB,cAAc,OAAO,cAAc,uBAAuB,4BAA4B,uBAAuB;AACvP,qBAAqB,mBAAmB,eAAe,aAAa,iBAAiB,WAAW,KAAK,WAAW,2BAA2B,+BAA+B,gBAAgB,uBAAuB,+BAA+B,mBAAmB,uBAAuB,iEAAiE,8CAA8C,oDAAoD,eAAe,WAAW,2BAA2B,gBAAgB,UAAU,IAAI,6CAA6C,iBAAiB,kBAAkB,SAAS,GAAG,eAAe,4CAA4C,0CAA0C,UAAU,4BAA4B,IAAI,iBAAiB,SAAS,KAAK,IAAI,uBAAuB,SAAS,eAAe,4CAA4C,iCAAiC,+BAA+B,SAAS,WAAW,YAAY,IAAI,cAAc,SAAS,KAAK,IAAI,wBAAwB;AACrhC,iBAAiB,+DAA+D,iDAAiD,4CAA4C,IAAI,mCAAmC,iBAAiB,UAAU,UAAU,SAAS,uBAAuB,QAAQ,iDAAiD,YAAY,IAAI,2CAA2C,6CAA6C,WAAW,+BAA+B,iCAAiC,eAAe,eAAe,SAAS,iBAAiB,gBAAgB,8BAA8B,UAAU,eAAe,SAAS;AAC7oB,mBAAmB,UAAU,wBAAwB,eAAe,oBAAoB,gBAAgB,aAAa,EAAE,aAAa,wBAAwB,IAAI,aAAa,oBAAoB,SAAS,UAAU,aAAa,2CAA2C,cAAc,oBAAoB,iCAAiC,oBAAoB,wCAAwC;AAC3Y,wBAAwB,uBAAuB,WAAW,KAAK,yBAAyB,qBAAqB,iBAAiB,kDAAkD,gIAAgI,iBAAiB,MAAM,eAAe,YAAY,WAAW,KAAK,+BAA+B,SAAS,0BAA0B,sBAAsB,YAAY,sDAAsD,iBAAiB,wBAAwB,YAAY,iBAAiB,UAAU,MAAM;AAClmB,iCAAiC,kBAAkB,2BAA2B,aAAa,+HAA+H,EAAE,oDAAoD,0FAA0F,qCAAqC,iCAAiC;AAChb,iCAAiC,2BAA2B,oBAAoB,kBAAkB,sBAAsB,UAAU,eAAe,iBAAiB,+CAA+C,KAAK,2BAA2B,+BAA+B,IAAI,wBAAwB,8BAA8B,0BAA0B,eAAe,iBAAiB,WAAW,EAAE,aAAa;AAC9Z,6CAA6C,cAAc,SAAS,8BAA8B,wBAAwB,aAAa,UAAU,mBAAmB,iBAAiB,gCAAgC,iBAAiB,MAAM,YAAY,mDAAmD,MAAM,cAAc,mBAAmB,wEAAwE,kBAAkB,aAAa,iBAAiB;AAC1c,cAAc,kDAAkD,qBAAqB,0BAA0B,WAAW,WAAW,WAAW,WAAW,SAAS,iBAAiB,yEAAyE,mBAAmB,yFAAyF,EAAE,oBAAoB,eAAe,kBAAkB;AACja,iEAAiE,iBAAiB,mBAAmB,eAAe,WAAW,eAAe,iDAAiD,kDAAkD,GAAG,eAAe,YAAY,2DAA2D,0BAA0B,QAAQ,YAAY,WAAW,KAAK,kBAAkB,sCAAsC,SAAS;AACzc,oBAAoB,SAAS,YAAY,aAAa,oBAAoB,sBAAsB,UAAU,UAAU,aAAa,iBAAiB,MAAM,UAAU,8GAA8G,mBAAmB,mBAAmB,UAAU,iBAAiB,MAAM,UAAU,mBAAmB,wBAAwB,SAAS,6BAA6B,gBAAgB,mBAAmB,OAAO;AAC5d,eAAe,SAAS,2CAA2C,WAAW,uBAAuB,WAAW,iBAAiB,UAAU,gBAAgB,SAAS,SAAS,oEAAoE,KAAK,aAAa,YAAY,WAAW,iBAAiB,UAAU,oBAAoB,SAAS,YAAY,aAAa,2CAA2C,kBAAkB,UAAU;AAClb,oBAAoB,eAAe,YAAY,kCAAkC,mBAAmB,QAAQ,4DAA4D,sBAAsB,wBAAwB,oBAAoB,8BAA8B,WAAW,KAAK,2CAA2C,YAAY,YAAY,WAAW,KAAK,QAAQ,qDAAqD,WAAW;AACnb,eAAe,aAAa,QAAQ,+BAA+B,SAAS,iBAAiB,YAAY,yBAAyB,SAAS,iBAAiB,mDAAmD,sBAAsB,gCAAgC,KAAK,OAAO,eAAe,SAAS,eAAe,kBAAkB;AAC1U,mBAAmB,0BAA0B,KAAK,uBAAuB,qBAAqB,QAAQ,WAAW,YAAY,iBAAiB,IAAI,iCAAiC,YAAY,OAAO,gFAAgF,KAAK,SAAS,GAAG,KAAK,qIAAqI,SAAS,GAAG,QAAQ,iBAAiB,sBAAsB,MAAM;AAClf,4BAA4B,MAAM,iCAAiC,MAAM,+BAA+B,MAAM,kDAAkD,QAAQ,wGAAwG;AAChR,iBAAiB,oCAAoC,YAAY,oEAAoE,SAAS,QAAQ,cAAc,UAAU,6CAA6C,cAAc,qFAAqF,iBAAiB,cAAc,oBAAoB,iBAAiB,kBAAkB,iBAAiB,WAAW,sKAAsK,6BAA6B;AACnnB,cAAc,UAAU,qFAAqF,iCAAiC,eAAe,yBAAyB,qJAAqJ,eAAe,cAAc,IAAI,UAAU;AACtX,mBAAmB,+CAA+C,SAAS,SAAS,uEAAuE,GAAG,4FAA4F,oBAAoB,mDAAmD,uDAAuD,QAAQ,YAAY,EAAE,SAAS,oEAAoE,qBAAqB;AAChf,qBAAqB,qEAAqE,MAAM,sDAAsD,iCAAiC,kBAAkB;AACzM,mLAAmL,sBAAsB,0CAA0C,4IAA4I,0DAA0D,uDAAuD,SAAS,UAAU,UAAU;AAC7gB,eAAe,yBAAyB,aAAa,wBAAwB,oBAAoB,gBAAgB,EAAE,WAAW,EAAE,YAAY,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,sBAAsB,cAAc,WAAW,yBAAyB,oDAAoD,IAAI,sBAAsB,iBAAiB,mBAAmB,SAAS;AAC9W,cAAc,uCAAuC,2BAA2B,yCAAyC,4CAA4C,MAAM,4CAA4C,gBAAgB,IAAI,KAAK,EAAE,iEAAiE,eAAe,SAAS,6FAA6F,cAAc,eAAe,IAAI,sBAAsB,SAAS;AACxe,cAAc,oFAAoF,cAAc,OAAO,qDAAQ,sDAAsD,qDAAQ,gEAAgE,cAAc,WAAW,oCAAoC,cAAc,kBAAkB,IAAI,mHAAmH;AACjd;AACA,eAAe,sBAAsB,2DAA2D,oCAAoC,2CAA2C,6BAA6B,6BAA6B,6BAA6B,wCAAwC,8BAA8B,oHAAoH,kCAAkC;AACle,wBAAwB,eAAe,oBAAoB,cAAc,QAAQ,2CAA2C,iBAAiB,QAAQ,aAAa,GAAG,wBAAwB,QAAQ,WAAW,gEAAgE,SAAS,IAAI,mCAAmC,OAAO,kEAAkE,sCAAsC,aAAa;AAC5b,gBAAgB,eAAe,OAAO,YAAY,wCAAwC,cAAc,wBAAwB,SAAS,cAAc,IAAI,4BAA4B,mEAAmE,SAAS,2BAA2B,SAAS,cAAc,mEAAmE,cAAc,sCAAsC,cAAc;AAC1b,eAAe,SAAS,8BAA8B,eAAe,wCAAwC,eAAe,QAAQ,GAAG,wEAAwE,SAAS,eAAe,iCAAiC,eAAe,oDAAoD,eAAe,SAAS;AACnW,cAAc,eAAe,sHAAsH,cAAc,iBAAiB,iBAAiB,kEAAkE,SAAS,SAAS,MAAM,OAAO;AACpS,4BAA4B,kBAAkB,oKAAoK,cAAc,iBAAiB;AACjP,cAAc,wBAAwB,uCAAuC,aAAa,4DAA4D,4CAA4C,iBAAiB,+CAA+C,SAAS,EAAE,eAAe;AAC5R,eAAe,IAAI,+BAA+B,iEAAiE,UAAU,YAAY,cAAc,+DAA+D,cAAc,kBAAkB,4DAA4D,cAAc,kBAAkB,8CAA8C,6BAA6B,mBAAmB,sBAAsB,eAAe,YAAY,WAAW,UAAU,eAAe,yBAAyB,OAAO,IAAI,UAAU,iCAAiC,sCAAsC,EAAE,iCAAiC,sCAAsC,EAAE,cAAc,SAAS,MAAM,kBAAkB,8BAA8B,sCAAsC,SAAS,gBAAgB,qDAAqD,eAAe,SAAS,OAAO,SAAS,eAAe,QAAQ,GAAG,4CAA4C;AACp/B,iBAAiB,0BAA0B,eAAe,YAAY,WAAW,KAAK,cAAc,yCAAyC,SAAS,eAAe,QAAQ,gCAAgC,qBAAqB,+BAA+B,UAAU;;AAE3Q;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B,gBAAgB,oBAAoB,kCAAkC,WAAW,2CAA2C,2BAA2B,qBAAqB,sFAAsF,0BAA0B,OAAO,sGAAsG,eAAe,IAAI,gBAAgB,SAAS,OAAO;AACze,yEAAyE,eAAe,gBAAgB,4BAA4B,SAAS,0BAA0B,yBAAyB,+BAA+B,UAAU,eAAe,QAAQ,yBAAyB,YAAY,+FAA+F,wFAAwF,cAAc,aAAa;AACvf,wOAAwO,eAAe,OAAO,uDAAuD,qBAAqB,6GAA6G,QAAQ,2GAA2G;AAC1iB,4FAA4F,wJAAwJ,eAAe,IAAI,iBAAiB,SAAS,cAAc,eAAe,YAAY,8DAA8D,2FAA2F,SAAS,mBAAmB,UAAU,YAAY,2BAA2B,QAAQ,YAAY,QAAQ,kCAAkC,SAAS,+HAA+H,WAAW;AACjwB,kIAAkI,eAAe,KAAK,kHAAkH,4FAA4F,sHAAsH,YAAY;AACte,2DAA2D,KAAK,mHAAmH,sHAAsH,QAAQ,+HAA+H,WAAW,QAAQ;AACnc,6GAA6G,eAAe;AAC5H,eAAe,SAAS,kBAAkB,yBAAyB,gFAAgF,kBAAkB,wBAAwB,wCAAwC,UAAU,eAAe,wBAAwB,iBAAiB,0BAA0B,YAAY,YAAY,eAAe,SAAS,iBAAiB,0BAA0B,EAAE,SAAS,iBAAiB,cAAc,KAAK,WAAW,EAAE,4BAA4B,oBAAoB,8EAA8E,SAAS,KAAK,aAAa,EAAE,mCAAmC,wBAAwB,aAAa;AAC3rB,cAAc,QAAQ,MAAM,yHAAyH,IAAI,2CAA2C,WAAW,KAAK,WAAW,6BAA6B,eAAe,YAAY,+DAA+D,SAAS,aAAa,aAAa,KAAK,oEAAoE,2CAA2C,6CAA6C,0BAA0B,eAAe,0BAA0B,eAAe,iCAAiC,eAAe,eAAe,IAAI,iBAAiB,SAAS;AACzsB,eAAe,kBAAkB,eAAe,2BAA2B,OAAO,+BAA+B,IAAI,WAAW,IAAI,yBAAyB,UAAU,aAAa,wMAAwM,IAAI,kDAAkD,KAAK,4CAA4C,KAAK,4CAA4C,KAAK,+CAA+C,KAAK;AAC7kB,eAAe,4CAA4C,aAAa,eAAe,SAAS,qBAAqB,mBAAmB,mBAAmB,oBAAoB,eAAe,IAAI,uCAAuC,+CAA+C,UAAU,YAAY;AAC9S,eAAe,YAAY,cAAc,gBAAgB,gBAAgB,mDAAmD,sCAAsC,KAAK,0GAA0G,uBAAuB,sBAAsB,eAAe,gBAAgB,uBAAuB,GAAG,yBAAyB,GAAG;AACnZ,eAAe,gBAAgB,wEAAwE,SAAS,eAAe,gBAAgB,qEAAqE,0DAA0D,SAAS,eAAe,gBAAgB,sEAAsE;AAC5X,eAAe,gBAAgB,sEAAsE,sCAAsC,SAAS,eAAe,4CAA4C,uBAAuB,oCAAoC,iBAAiB,2FAA2F,8FAA8F,eAAe,eAAe,uBAAuB,4BAA4B,2BAA2B,mCAAmC,0BAA0B,sBAAsB,oBAAoB,gBAAgB,EAAE,oBAAoB,4BAA4B,eAAe,6BAA6B,4BAA4B,4BAA4B,4BAA4B,iBAAiB,0BAA0B,UAAU,gBAAgB,2CAA2C,SAAS,8BAA8B,gBAAgB,uEAAuE;AACvlC,iBAAiB,cAAc,sEAAsE,uBAAuB,yBAAyB,4BAA4B,uBAAuB,6BAA6B,eAAe,YAAY,gBAAgB,6BAA6B,6BAA6B,eAAe,OAAO,gDAAgD,0BAA0B,OAAO;AACjb,eAAe,yFAAyF,2CAA2C,UAAU;AAC7J,mBAAmB,YAAY,gNAAgN,gHAAgH,sEAAsE,uBAAuB;AAC5b,4BAA4B,uBAAuB,6BAA6B,eAAe,YAAY,gBAAgB,6BAA6B,eAAe;AACvK,eAAe,SAAS,kCAAkC,8CAA8C,0CAA0C,0BAA0B,iCAAiC,GAAG,yDAAyD,4CAA4C;AACrT,0BAA0B,OAAO,2DAA2D,4CAA4C,wDAAwD,8CAA8C,iCAAiC,gCAAgC;AAC/S,eAAe,oCAAoC,OAAO,+MAA+M,IAAI,6CAA6C,WAAW,YAAY,iBAAiB,cAAc,QAAQ,gCAAgC,EAAE,WAAW,kBAAkB,WAAW;AAClc,4BAA4B,cAAc,aAAa,eAAe,8HAA8H,mBAAmB,SAAS,eAAe,mBAAmB,UAAU,SAAS,4BAA4B,6BAA6B,aAAa,2BAA2B;AACtX,sCAAsC,MAAM,QAAQ,+EAA+E,IAAI,qCAAqC,oIAAoI,kDAAkD,cAAc,6BAA6B,SAAS,mCAAmC;AACzb,eAAe,uGAAuG,QAAQ,wBAAwB,2BAA2B,cAAc,EAAE,cAAc,2BAA2B,SAAS,iCAAiC;AACpR,eAAe,uGAAuG,QAAQ,wBAAwB,2BAA2B,cAAc,EAAE,cAAc,2BAA2B,mBAAmB,SAAS,iCAAiC,2CAA2C,iBAAiB,QAAQ,oCAAoC,2BAA2B,wBAAwB,EAAE,cAAc;AACld,SAAS,kCAAkC,6CAA6C,iBAAiB,QAAQ,UAAU,gCAAgC,EAAE,mJAAmJ;AAChT,mBAAmB,SAAS,SAAS,gCAAgC,sHAAsH,4BAA4B,+DAA+D,4BAA4B,UAAU,6BAA6B;AACzV,6BAA6B,+DAA+D,sCAAsC,UAAU,uCAAuC,GAAG,6BAA6B,yBAAyB,0BAA0B,OAAO,8DAA8D,eAAe,6EAA6E,cAAc,QAAQ,yCAAyC;AACte,iBAAiB,QAAQ,0DAA0D,qDAAqD,eAAe,QAAQ,yCAAyC,MAAM,uBAAuB,EAAE,MAAM,sCAAsC,EAAE,MAAM,yCAAyC,EAAE,eAAe,2DAA2D,SAAS,6BAA6B,gBAAgB;AACtc,4BAA4B,uBAAuB,6BAA6B,eAAe,YAAY,kBAAkB,6BAA6B,eAAe,qBAAqB,YAAY,gBAAgB,0BAA0B,OAAO,oBAAoB,wCAAwC,0CAA0C,wCAAwC,qCAAqC;AAC9a,eAAe,uGAAuG,SAAS,mFAAmF,kBAAkB,EAAE,iBAAiB,YAAY,eAAe,uBAAuB,yCAAyC,EAAE;AACpV,eAAe,IAAI,UAAU,qDAAQ,QAAQ,SAAS,mPAAmP,QAAQ,sCAAsC;AACvV,8BAA8B,eAAe,sCAAsC,6LAA6L,eAAe,oEAAoE,wCAAwC,aAAa,+BAA+B,gCAAgC,EAAE,0CAA0C;AACngB,CAAC,mHAAmH,kBAAkB,EAAE,UAAU,+BAA+B,EAAE,0BAA0B,uCAAuC,SAAS,aAAa,uCAAuC,SAAS,EAAE,iIAAiI;AAC7b,iBAAiB,6CAA6C,+CAA+C,eAAe,UAAU,EAAE,MAAM,oBAAoB,EAAE,MAAM,6BAA6B;AACvM,eAAe,kDAAkD,qCAAqC,EAAE,sBAAsB,kCAAkC,yGAAyG,IAAI,UAAU,iCAAiC,iCAAiC,+BAA+B,kCAAkC,wEAAwE;AACle,+BAA+B,4BAA4B,mCAAmC,QAAQ,SAAS,aAAa,eAAe,8DAA8D,2BAA2B,SAAS,eAAe,eAAe,eAAe,eAAe,eAAe,eAAe,mBAAmB,oDAAoD,sDAAsD,wCAAwC,+BAA+B,SAAS,eAAe,uBAAuB,uBAAuB,uBAAuB,oBAAoB,0BAA0B;AACtpB,0BAA0B,OAAO,0HAA0H,eAAe,QAAQ,kHAAkH;;AAEpS;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,YAAY,UAAU,YAAY,eAAe,SAAS,YAAY,sBAAsB,YAAY,aAAa,cAAc,wEAAwE,eAAe,4CAA4C,MAAM,MAAM;AAChS,iBAAiB,QAAQ,mBAAmB,iBAAiB,QAAQ,2BAA2B,iCAAiC,gDAAgD,8BAA8B,QAAQ,0BAA0B,OAAO,qCAAqC,iCAAiC,mDAAmD,0CAA0C,2CAA2C,UAAU,UAAU,+BAA+B;AACzf,eAAe,WAAW,iBAAiB,6CAA6C,OAAO,gCAAgC,wBAAwB,yCAAyC,wDAAwD,6BAA6B,aAAa,eAAe,oBAAoB,eAAe,yBAAyB,OAAO,eAAe,SAAS,0BAA0B,eAAe,kDAAkD,0BAA0B,SAAS,4BAA4B;AACtiB,eAAe,gFAAgF,+FAA+F,WAAW,KAAK,WAAW,IAAI,kCAAkC,WAAW,2GAA2G,WAAW,UAAU,eAAe,SAAS,0BAA0B,yBAAyB,kCAAkC,oDAAoD,qCAAqC,0BAA0B;AAC1mB,cAAc,0BAA0B,kBAAkB,6BAA6B,qDAAqD,eAAe,mBAAmB,8BAA8B,+BAA+B,kCAAkC,iCAAiC,eAAe,uBAAuB,iEAAiE;AACrZ,mBAAmB,0CAA0C,kDAAkD,oBAAoB,mBAAmB,gBAAgB,gCAAgC,gCAAgC,6DAA6D,gBAAgB,gBAAgB,oDAAoD,YAAY,gBAAgB,gBAAgB,mCAAmC,YAAY,gBAAgB;AACle,gBAAgB,gBAAgB,YAAY,iBAAiB,eAAe,+CAA+C,mCAAmC,2CAA2C,mBAAmB,gCAAgC,oBAAoB,SAAS,uCAAuC,yBAAyB,QAAQ,eAAe,eAAe,SAAS,0BAA0B,iBAAiB,YAAY,aAAa,iCAAiC,kBAAkB,mGAAmG,eAAe,kBAAkB,sBAAsB,oCAAoC,YAAY,iCAAiC,6FAA6F,EAAE,QAAQ,SAAS;AAC11B,eAAe,sCAAsC,MAAM,eAAe,YAAY,yCAAyC,oBAAoB,YAAY,EAAE,SAAS,MAAM,QAAQ,UAAU,iBAAiB,uBAAuB,eAAe,SAAS,SAAS,0BAA0B,uBAAuB,2BAA2B,kBAAkB,UAAU,GAAG,EAAE,eAAe,aAAa,SAAS,mBAAmB,cAAc,qEAAqE,6BAA6B,mBAAmB,YAAY,aAAa,UAAU,UAAU,mCAAmC,0BAA0B,QAAQ,SAAS;AAC9qB,qBAAqB,gFAAgF,SAAS,SAAS,kBAAkB,UAAU,mBAAmB,8EAA8E,UAAU,OAAO,8DAA8D,cAAc;AACjV,mBAAmB,mCAAmC,mBAAmB,cAAc,8CAA8C,wEAAwE;AAC7M,iBAAiB,6ZAA6Z,eAAe;AAC7b,iBAAiB,WAAW,uDAAuD,eAAe,EAAE,wCAAwC,4BAA4B,+BAA+B,iBAAiB,yDAAyD,iBAAiB,uCAAuC,iBAAiB,aAAa,yEAAyE;AAChb,iBAAiB,0DAA0D,eAAe,SAAS,SAAS,SAAS,MAAM,iCAAiC,oBAAoB,gCAAgC;AAChN,mCAAmC,YAAY,aAAa,gHAAgH,SAAS,KAAK,sCAAsC,QAAQ,6CAA6C,uBAAuB,eAAe,oDAAoD,eAAe,aAAa,oBAAoB,eAAe,UAAU,mBAAmB,wBAAwB,+BAA+B,SAAS,YAAY,UAAU,iBAAiB,QAAQ,UAAU,oCAAoC;AACxmB,uBAAuB,mFAAmF,aAAa,0BAA0B,MAAM,OAAO,MAAM,OAAO,OAAO,uBAAuB,uBAAuB,iCAAiC,IAAI,mEAAmE,SAAS,8CAA8C,QAAQ,OAAO,QAAQ,wBAAwB,sBAAsB,WAAW,EAAE,YAAY;AAC7d,WAAW,yEAAyE,gBAAgB,wBAAwB,6BAA6B,IAAI,4BAA4B,8EAA8E,IAAI,0NAA0N,SAAS;AAC9e,yCAAyC,eAAe,oEAAoE,eAAe,sCAAsC,eAAe,gBAAgB,0JAA0J,iBAAiB,OAAO,iCAAiC,MAAM,MAAM;AAC/a,eAAe,mEAAmE,mBAAmB,mKAAmK,gBAAgB,6EAA6E,qBAAqB,gBAAgB,sDAAsD,gBAAgB;AAChd,eAAe,sHAAsH,mCAAmC,sDAAsD,iCAAiC,OAAO,IAAI,YAAY,YAAY,yEAAyE,QAAQ,aAAa,MAAM,WAAW,MAAM,YAAY,qCAAqC,gCAAgC;AACxe,yBAAyB,iCAAiC,IAAI,4DAA4D,KAAK,IAAI,gCAAgC,SAAS,8CAA8C,qBAAqB,OAAO,QAAQ,QAAQ,iBAAiB,QAAQ,MAAM,2BAA2B,SAAS,SAAS,4BAA4B,IAAI,uBAAuB,SAAS;AAClZ,eAAe,+BAA+B,oCAAoC,eAAe,4BAA4B,eAAe,IAAI,6BAA6B,SAAS,UAAU,eAAe,IAAI,+BAA+B,SAAS;AAC3P,yBAAyB,IAAI,uBAAuB,8CAA8C,eAAe,+CAA+C,6FAA6F,aAAa,gFAAgF,YAAY,SAAS,4DAA4D,iBAAiB,yCAAyC;AACre;AACA;AACA;AACA;AACA,eAAe,SAAS,UAAU,SAAS,eAAe,iBAAiB,cAAc,wBAAwB,SAAS,YAAY,SAAS,gCAAgC,gDAAgD,KAAK,WAAW,aAAa,cAAc,yCAAyC,0CAA0C,kDAAkD,6BAA6B,UAAU,cAAc,mBAAmB,OAAO,MAAM,OAAO;AAC3e,eAAe,QAAQ,wBAAwB,QAAQ,iBAAiB,oBAAoB,qBAAqB,kBAAkB,WAAW,kCAAkC,8BAA8B,IAAI,IAAI,EAAE,sBAAsB,gCAAgC,EAAE,sBAAsB,+BAA+B,eAAe,0BAA0B,gBAAgB;AAC9X,eAAe,oBAAoB,kBAAkB,sCAAsC,MAAM,0BAA0B,MAAM,eAAe,iBAAiB,EAAE,gCAAgC,OAAO,iBAAiB,uBAAuB,0DAA0D,4EAA4E,SAAS,0BAA0B,MAAM,gFAAgF;AACjf,6BAA6B,cAAc,aAAa,QAAQ,kDAAkD,uCAAuC,cAAc,aAAa,QAAQ,6CAA6C,kCAAkC,eAAe,sCAAsC,SAAS,0BAA0B,kBAAkB,eAAe,UAAU,eAAe,QAAQ,sEAAsE,eAAe,oDAAoD,qCAAqC,SAAS,yDAAyD,MAAM,WAAW,YAAY,yCAAyC,wGAAwG,qBAAqB,WAAW;AACn2B,GAAG,MAAM,YAAY,mBAAmB,KAAK,uCAAuC,EAAE,QAAQ,QAAQ,qBAAqB,SAAS,eAAe,MAAM,yFAAyF,cAAc,kBAAkB,cAAc;AAChS,mBAAmB,2BAA2B,YAAY,aAAa,wBAAwB,gCAAgC,6CAA6C,IAAI,cAAc,iBAAiB,qCAAqC,eAAe,eAAe,YAAY,QAAQ,eAAe,SAAS,SAAS,0BAA0B,mBAAmB,0BAA0B;AAC9Y,mBAAmB,SAAS,QAAQ,4EAA4E,gCAAgC,oCAAoC,yFAAyF,gFAAgF,6BAA6B,iCAAiC,+DAA+D,eAAe;AACze,GAAG,qDAAQ,gBAAgB,qDAAQ,8BAA8B,qGAAqG,cAAc,6DAA6D,YAAY,2CAA2C,mDAAmD,wBAAwB,mCAAmC,iBAAiB;AACva,iBAAiB,4LAA4L,iBAAiB,OAAO,WAAW,YAAY,UAAU,QAAQ,UAAU,oBAAoB,iBAAiB,wHAAwH,0BAA0B;AAC/c,2BAA2B,mDAAmD,QAAQ,eAAe;AACrG,qCAAqC,0SAA0S,qBAAqB,MAAM,kBAAkB,4BAA4B,2BAA2B,IAAI,2BAA2B,mBAAmB,WAAW,IAAI;AACpf,2BAA2B,SAAS,OAAO,QAAQ,EAAE,wBAAwB,mBAAmB,SAAS,EAAE,0BAA0B,mBAAmB,SAAS,WAAW,EAAE,eAAe,gEAAgE,OAAO;AACpQ,iBAAiB,oBAAoB,YAAY,cAAc,KAAK,iBAAiB,iBAAiB,YAAY,4CAA4C,aAAa,UAAU,EAAE,oBAAoB,6BAA6B;AACxO,mCAAmC,WAAW,mBAAmB,kCAAkC,kCAAkC,gCAAgC,4BAA4B,sEAAsE,6BAA6B,SAAS,EAAE,gBAAgB,MAAM,OAAO,0CAA0C,EAAE;AACxX,iBAAiB,2BAA2B,gJAAgJ,sHAAsH,mEAAmE;AACrX,2BAA2B,aAAa,eAAe,6BAA6B,eAAe,qDAAqD,2BAA2B,8BAA8B,sBAAsB,2CAA2C,qCAAqC,EAAE,eAAe,UAAU,kEAAkE,eAAe;AACna,iBAAiB,eAAe,sDAAsD,mBAAmB,2BAA2B,EAAE,eAAe,gBAAgB,mBAAmB,+BAA+B,EAAE,cAAc,WAAW,+EAA+E;AACjU,eAAe,oCAAoC,oEAAoE,KAAK,yDAAyD,sDAAsD,2BAA2B,mBAAmB,GAAG,8BAA8B,kBAAkB,kBAAkB,GAAG,8BAA8B,kBAAkB,qBAAqB,GAAG,QAAQ,iDAAiD;AACle,mBAAmB,OAAO,UAAU,MAAM,oBAAoB,WAAW,oCAAoC,EAAE,gCAAgC,qBAAqB,mBAAmB,GAAG,sCAAsC,OAAO,qBAAqB,mBAAmB,GAAG,oCAAoC,OAAO,qBAAqB,mBAAmB,GAAG,sCAAsC,OAAO;AACrZ,qBAAqB,GAAG,4DAA4D,OAAO,qBAAqB,iBAAiB,iBAAiB,iBAAiB,qBAAqB,iBAAiB,kCAAkC,sCAAsC;AACjR,eAAe,0DAA0D,+EAA+E,2EAA2E,iBAAiB,kCAAkC,uCAAuC,EAAE,mBAAmB,eAAe,2BAA2B,EAAE,eAAe;AAC7Y,iBAAiB,8LAA8L;AAC/M,eAAe,WAAW,6RAA6R,aAAa,KAAK,iBAAiB,yBAAyB,iBAAiB,iBAAiB,yBAAyB;AAC9a,iBAAiB,yBAAyB,gBAAgB,iBAAiB,eAAe,kDAAkD,mBAAmB,kBAAkB,wBAAwB,GAAG,iBAAiB,kBAAkB,UAAU,GAAG,iBAAiB,kBAAkB,UAAU;AACzS,QAAQ,8CAA8C,KAAK,4CAA4C,oBAAoB,gGAAgG,MAAM,KAAK,uCAAuC,MAAM,6CAA6C,eAAe,KAAK,8BAA8B,KAAK,uCAAuC,KAAK,uEAAuE;AAC1e,qDAAqD,KAAK,oEAAoE,KAAK,yEAAyE,KAAK,qGAAqG,KAAK,8GAA8G,KAAK,0BAA0B,KAAK;AAC7c,cAAc,+DAA+D,MAAM,gBAAgB,KAAK,4EAA4E,gEAAgE,gBAAgB,KAAK,uFAAuF,2EAA2E,gBAAgB,KAAK,kEAAkE;AAClgB,4CAA4C,MAAM,gBAAgB,KAAK,2CAA2C,KAAK,0DAA0D,uDAAuD,KAAK,6CAA6C,KAAK,wFAAwF,KAAK,kDAAkD,KAAK,sDAAsD,MAAM;AAC/e,CAAC,UAAU,KAAK,uCAAuC,KAAK,0FAA0F,wDAAwD,0EAA0E,gFAAgF,eAAe,uFAAuF,YAAY,KAAK;AAC/d,6EAA6E,gGAAgG,eAAe,yFAAyF,YAAY,KAAK,qDAAqD,KAAK,oDAAoD,kFAAkF;AACte,KAAK,WAAW,KAAK,yCAAyC,MAAM,6CAA6C,iBAAiB,KAAK,2CAA2C,iDAAiD,eAAe,KAAK,wCAAwC,MAAM,8CAA8C,eAAe,KAAK,2CAA2C,KAAK,2CAA2C,4CAA4C,MAAM;AACpf,cAAc,mEAAmE,MAAM,KAAK,IAAI,gCAAgC,4CAA4C,KAAK,yFAAyF,2DAA2D;AACrU,kBAAkB,gDAAgD,8BAA8B,sCAAsC,8BAA8B,4DAA4D,uFAAuF,mBAAmB,IAAI,wBAAwB,4BAA4B,iBAAiB,6CAA6C,cAAc;AAC9c,eAAe,WAAW,OAAO,SAAS,UAAU,sBAAsB;AAC1E,iBAAiB,qDAAqD,aAAa,OAAO,oEAAoE,oCAAoC,+BAA+B,GAAG;AACpO;AACA;AACA;AACA;AACA;AACA,yFAAyF,SAAS,EAAE,kEAAkE,wDAAwD,iBAAiB,kCAAkC,eAAe,SAAS,YAAY;AACrT,eAAe,4BAA4B,2BAA2B,qCAAqC,4GAA4G,OAAO,2DAA2D,cAAc,aAAa,aAAa,gBAAgB,IAAI,MAAM,aAAa,kBAAkB,EAAE,4BAA4B,0BAA0B,WAAW,4BAA4B,0BAA0B,EAAE,EAAE,EAAE;AACzf,iBAAiB,4BAA4B,yBAAyB,mEAAmE,EAAE,EAAE,iBAAiB,qBAAqB,0EAA0E,EAAE,6DAA6D,OAAO;AACnU,cAAc,qCAAqC,aAAa,KAAK,+BAA+B,gCAAgC,KAAK,0BAA0B,kBAAkB,EAAE,gCAAgC,2BAA2B,KAAK,6DAA6D,gBAAgB,8CAA8C,SAAS,SAAS,EAAE,sBAAsB,0BAA0B,GAAG,iBAAiB,QAAQ,SAAS,GAAG,qBAAqB,SAAS,SAAS,SAAS,SAAS,YAAY,+GAA+G,SAAS,0BAA0B,2BAA2B,YAAY,UAAU,iCAAiC,6CAA6C,iDAAiD,gEAAgE;AACr6B,yBAAyB,SAAS,SAAS,SAAS,SAAS,SAAS,0BAA0B,SAAS,mBAAmB,4BAA4B,SAAS;AACjK,iCAAiC,WAAW,oBAAoB,2CAA2C,kDAAkD,qBAAqB,sBAAsB,uBAAuB,2BAA2B,aAAa,IAAI,MAAM,qDAAQ,yBAAyB,SAAS,OAAO,OAAO,oCAAoC,SAAS,WAAW,oCAAoC,OAAO,QAAQ,YAAY,WAAW,KAAK,WAAW,oBAAoB;AAC/e,+BAA+B,qCAAqC,mFAAmF,uDAAuD,+CAA+C,mCAAmC,mFAAmF,uCAAuC,uCAAuC,aAAa,gCAAgC;AAC9e,eAAe,IAAI,OAAO,qDAAQ,oBAAoB,SAAS,UAAU,yBAAyB,SAAS,SAAS,SAAS,SAAS,eAAe,eAAe,0BAA0B,UAAU;AACxM,eAAe,WAAW,8BAA8B,GAAG,iBAAiB,MAAM,YAAY,WAAW,KAAK,WAAW,QAAQ,QAAQ,oMAAoM,MAAM,KAAK,SAAS,KAAK,0BAA0B;AAChY,eAAe,kBAAkB,yBAAyB,SAAS,oDAAoD,MAAM,MAAM,cAAc,iBAAiB,gBAAgB,MAAM,EAAE,WAAW,eAAe,qBAAqB,mFAAmF,iCAAiC,uBAAuB,wBAAwB,EAAE,gBAAgB,kBAAkB,mBAAmB,kBAAkB,mCAAmC,KAAK,EAAE;AAC/f,gBAAgB,UAAU,sBAAsB,gBAAgB;AAChE,+BAA+B,uCAAuC,2CAA2C,MAAM,KAAK,UAAU,8BAA8B,WAAW,8BAA8B,2BAA2B,MAAM,KAAK,SAAS,EAAE,IAAI,SAAS,kBAAkB,MAAM,OAAO,sDAAsD,SAAS,gBAAgB,kDAAkD,SAAS;AACpb,eAAe,iFAAiF,WAAW,uBAAuB,8BAA8B,WAAW,8BAA8B,MAAM,sDAAsD,MAAM,gBAAgB,kDAAkD,SAAS,GAAG,gBAAgB,WAAW,gCAAgC,cAAc,eAAe,SAAS,uCAAuC,GAAG,gBAAgB;AACpf,qCAAqC,sBAAsB,MAAM,MAAM,MAAM,gBAAgB,MAAM,0BAA0B,eAAe,uDAAuD,mBAAmB,SAAS,mBAAmB,SAAS,kBAAkB,QAAQ,aAAa,mBAAmB,KAAK,yBAAyB,YAAY,iBAAiB,YAAY;AAC5X,eAAe,OAAO,0BAA0B,6BAA6B,iBAAiB,mBAAmB,0FAA0F,eAAe,EAAE,iBAAiB,gBAAgB,iBAAiB,sBAAsB,YAAY,GAAG,eAAe,UAAU,qDAAQ,uBAAuB,qDAAQ,mCAAmC,iGAAiG,yBAAyB,eAAe,kBAAkB,6CAA6C,gBAAgB,GAAG,oBAAoB,mCAAmC,gBAAgB,gCAAgC,kBAAkB,kBAAkB,eAAe,SAAS,UAAU,sBAAsB,UAAU,cAAc,qBAAqB,iBAAiB,cAAc,EAAE,OAAO,gBAAgB,WAAW;AACp6B,2BAA2B,oDAAoD,kBAAkB,wBAAwB,iDAAiD,EAAE,SAAS,gBAAgB,2BAA2B,+BAA+B,GAAG,EAAE,uBAAuB,SAAS,gBAAgB,QAAQ,qEAAqE,EAAE,EAAE,gBAAgB,sDAAsD,EAAE,wBAAwB;AACre,uBAAuB,EAAE,IAAI,mBAAmB,6CAA6C,yCAAyC,gBAAgB,eAAe,SAAS,uCAAuC,yBAAyB,eAAe,SAAS,UAAU;AAChR,qBAAqB,aAAa,cAAc,iDAAiD,6EAA6E,2BAA2B,kGAAkG,8BAA8B,mBAAmB,sFAAsF,oBAAoB;AACtc,qJAAqJ,IAAI,6BAA6B,oEAAoE,6BAA6B,gDAAgD,oBAAoB,QAAQ,SAAS,gBAAgB,QAAQ,SAAS;AAC7Y,iBAAiB,MAAM,qCAAqC,8DAA8D,mBAAmB,YAAY,GAAG,8BAA8B,KAAK,gBAAgB,oBAAoB,WAAW,cAAc,gDAAgD,UAAU,UAAU,SAAS,mBAAmB,sBAAsB,iCAAiC,UAAU,YAAY,WAAW,6DAA6D,8BAA8B,8BAA8B,KAAK,EAAE,OAAO,0BAA0B,EAAE,8BAA8B,yBAAyB,yBAAyB,uEAAuE;AAC9uB,sCAAsC,gBAAgB,EAAE,EAAE,OAAO,eAAe,2BAA2B,mDAAmD,uBAAuB,KAAK,sBAAsB,0BAA0B;AAC1O,eAAe,2BAA2B,2CAA2C,sBAAsB,IAAI,mBAAmB,UAAU,0BAA0B,8BAA8B,kBAAkB,IAAI,4CAA4C,oBAAoB,EAAE,SAAS,OAAO,wBAAwB,kBAAkB,+EAA+E,aAAa,mBAAmB,KAAK,gBAAgB,KAAK,GAAG;AACle,eAAe,iBAAiB,WAAW,cAAc,IAAI,oBAAoB,SAAS,UAAU,eAAe,6CAA6C,iBAAiB,wEAAwE,eAAe,2BAA2B,wBAAwB,oCAAoC,sBAAsB,mBAAmB,EAAE;AAC1Y,oBAAoB,kBAAkB,iCAAiC,IAAI,eAAe,oBAAoB,mBAAmB,mBAAmB,mCAAmC,MAAM,KAAK,KAAK,cAAc,UAAU,oBAAoB,kBAAkB,SAAS,eAAe,gBAAgB,SAAS,GAAG,iBAAiB,iDAAiD,MAAM,uBAAuB,gBAAgB;AACxa,kBAAkB,iCAAiC,+BAA+B,mBAAmB,kBAAkB,GAAG,gBAAgB,gBAAgB,iCAAiC,KAAK,MAAM,qCAAqC,kBAAkB,cAAc,eAAe,gBAAgB,SAAS;AACnT,eAAe,8BAA8B,mBAAmB,mDAAmD,0BAA0B,wBAAwB,4DAA4D,sBAAsB,mBAAmB,EAAE,mBAAmB,QAAQ,MAAM,WAAW,QAAQ,WAAW,iCAAiC,YAAY,MAAM,SAAS,EAAE,iBAAiB,2BAA2B;AACrb,iBAAiB,sBAAsB,YAAY,EAAE,4BAA4B,eAAe,aAAa,0BAA0B,2BAA2B,8BAA8B,KAAK,EAAE,kBAAkB,IAAI,gBAAgB,6BAA6B,EAAE,MAAM,MAAM,IAAI,eAAe,8BAA8B,mCAAmC,eAAe,kBAAkB,UAAU,sBAAsB,SAAS,2BAA2B,SAAS,uBAAuB,gBAAgB,KAAK,kCAAkC,gBAAgB,mBAAmB,iDAAiD,cAAc,kBAAkB,SAAS,eAAe,WAAW,EAAE,WAAW,mBAAmB,cAAc,iBAAiB,kBAAkB,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,kBAAkB,+BAA+B,gBAAgB;AACp3B,oBAAoB,+BAA+B,kBAAkB,GAAG,gBAAgB,+BAA+B,cAAc,GAAG,iBAAiB,gBAAgB,iBAAiB,sBAAsB,YAAY,GAAG,cAAc,UAAU,qBAAqB,eAAe,kBAAkB,qBAAqB,oBAAoB,YAAY,YAAY,gBAAgB,iBAAiB,YAAY,kBAAkB,kBAAkB,cAAc,UAAU,sGAAsG,wCAAwC,aAAa,qDAAQ,4BAA4B,yBAAyB,cAAc,IAAI,4BAA4B,sCAAsC,SAAS,SAAS;AACrxB,cAAc,mBAAmB,WAAW,qDAAQ,gBAAgB,qDAAQ,4BAA4B,eAAe,IAAI,uDAAuD,SAAS,UAAU,eAAe,kBAAkB,WAAW,2BAA2B,qBAAqB,aAAa,GAAG,oBAAoB,WAAW,2BAA2B,YAAY,iCAAiC,GAAG,gBAAgB,WAAW,2BAA2B,kBAAkB;AACne,iBAAiB,oCAAoC,iBAAiB,mCAAmC,cAAc,wBAAwB,eAAe,iBAAiB,gBAAgB,iBAAiB,YAAY,eAAe,YAAY,kBAAkB,kBAAkB,cAAc,UAAU,wGAAwG,wCAAwC,aAAa,qDAAQ,8BAA8B,2BAA2B,cAAc,IAAI,8BAA8B,sCAAsC,SAAS,SAAS;AACznB,cAAc,mBAAmB,WAAW,qDAAQ,gBAAgB,qDAAQ,8BAA8B,eAAe,IAAI,uDAAuD,SAAS,UAAU,eAAe,kBAAkB,WAAW,2BAA2B,qBAAqB,aAAa,GAAG,oBAAoB,WAAW,2BAA2B,YAAY,iCAAiC,GAAG,gBAAgB,WAAW,2BAA2B,kBAAkB,GAAG;AACxe,kBAAkB,cAAc,SAAS,aAAa,UAAU,iBAAiB,YAAY,eAAe,WAAW,WAAW,KAAK,WAAW,KAAK,WAAW,KAAK,YAAY,QAAQ,qCAAqC,eAAe,gFAAgF,GAAG,yBAAyB,SAAS,QAAQ,KAAK,mCAAmC,aAAa,4CAA4C,MAAM,kCAAkC,MAAM,0DAA0D,MAAM;AAC3jB,cAAc,yCAAyC,SAAS,SAAS,SAAS,UAAU,gBAAgB,KAAK,IAAI,yEAAyE,SAAS,wBAAwB,IAAI,kBAAkB,SAAS,cAAc,cAAc,uBAAuB,UAAU,OAAO,cAAc,gBAAgB,UAAU,iBAAiB,UAAU,0BAA0B,uBAAuB;AACtb,iBAAiB,sCAAsC,mBAAmB,0BAA0B,mCAAmC,WAAW,IAAI,gCAAgC,UAAU,0DAA0D,2DAA2D,EAAE,eAAe,oBAAoB,kCAAkC,mBAAmB,UAAU,4BAA4B;AACrb,sBAAsB,oCAAoC,kCAAkC,gBAAgB,mBAAmB,yBAAyB,GAAG,8BAA8B,UAAU,8CAA8C,gGAAgG,0BAA0B;AAC3W,iCAAiC,UAAU,qCAAqC,YAAY,yCAAyC,oDAAoD,eAAe,MAAM,2BAA2B,kBAAkB,yCAAyC,0BAA0B,8DAA8D,YAAY,MAAM,eAAe;AAC7Z,iBAAiB,WAAW,cAAc,gCAAgC,gBAAgB,iCAAiC,gCAAgC,gCAAgC,8CAA8C,gEAAgE,gIAAgI,yDAAyD,WAAW,aAAa;AAC1f,2FAA2F,4GAA4G,2BAA2B,iBAAiB,mCAAmC,IAAI,GAAG,eAAe,SAAS,YAAY,QAAQ,4BAA4B,eAAe,wCAAwC,aAAa,GAAG,cAAc,aAAa,cAAc,WAAW,iBAAiB,UAAU,yDAAyD,gBAAgB,UAAU,SAAS,SAAS,iDAAiD,wDAAwD,aAAa,OAAO,SAAS,iCAAiC,MAAM,cAAc,kBAAkB,8BAA8B,gBAAgB;AAC31B,eAAe,4BAA4B,WAAW,mDAAmD,SAAS,KAAK,KAAK,YAAY,WAAW,+GAA+G,WAAW,WAAW,WAAW,2DAA2D,WAAW,QAAQ,KAAK,KAAK,oEAAoE,WAAW;AAC1c,MAAM,gBAAgB,qBAAqB,IAAI,IAAI,IAAI,QAAQ,IAAI,IAAI,IAAI,QAAQ,kBAAkB,kBAAkB,kBAAkB,kBAAkB,kBAAkB,kBAAkB,kBAAkB;AACjN,mBAAmB,yBAAyB,cAAc,4BAA4B,IAAI,gDAAgD,mBAAmB,IAAI,EAAE,aAAa,6FAA6F,WAAW,oBAAoB,oDAAoD,MAAM;AACtW;AACA,iMAAiM,cAAc,mBAAmB,SAAS,gGAAgG,yBAAyB,SAAS,SAAS,SAAS,eAAe,eAAe,SAAS,eAAe,cAAc,sBAAsB,YAAY,UAAU,mBAAmB,eAAe,gDAAgD;AACjkB,gBAAgB,oDAAoD,uHAAuH,2GAA2G,wHAAwH;AAC9Z,CAAC,YAAY,kCAAkC,GAAG,cAAc,kBAAkB,IAAI,mHAAmH,kBAAkB,eAAe,aAAa,QAAQ,KAAK,YAAY,6CAA6C,aAAa,MAAM,wBAAwB,MAAM,UAAU,MAAM,iBAAiB,KAAK,0BAA0B;AAC9a,mBAAmB,wDAAwD,YAAY,gBAAgB,gEAAgE,gBAAgB,UAAU,gBAAgB,UAAU,gBAAgB;AAC3O,uBAAuB,wDAAwD,oDAAoD,kCAAkC,MAAM,aAAa,kBAAkB,qBAAqB,kBAAkB,2BAA2B,aAAa,8CAA8C,IAAI,2BAA2B,2DAA2D,UAAU,QAAQ,aAAa,8BAA8B,uCAAuC;AACrgB,aAAa,WAAW,kCAAkC,gFAAgF,iBAAiB,6BAA6B,SAAS,EAAE,EAAE,gBAAgB,wCAAwC,kDAAkD,cAAc,WAAW,SAAS;AACjV,uBAAuB,6FAA6F,oEAAoE,wCAAwC,uDAAuD,mDAAmD,oEAAoE,wBAAwB,QAAQ,cAAc,iDAAiD,8BAA8B;AAC3gB,IAAI,6BAA6B,kBAAkB,oDAAoD,sEAAsE,WAAW,cAAc,MAAM,4CAA4C,sEAAsE,KAAK,KAAK,mCAAmC,sEAAsE,MAAM;AACvb,oCAAoC,EAAE,EAAE,iBAAiB,YAAY,aAAa,QAAQ,UAAU,WAAW,eAAe,iCAAiC,yBAAyB,cAAc,KAAK,QAAQ,SAAS,QAAQ,MAAM,EAAE,GAAG,WAAW,eAAe,WAAW,gCAAgC,IAAI,MAAM,sBAAsB,kBAAkB,SAAS;AAC/W,eAAe,cAAc,KAAK,cAAc,uBAAuB,QAAQ,gBAAgB,WAAW,YAAY,iMAAiM,OAAO,QAAQ,EAAE,6FAA6F,6BAA6B,WAAW,EAAE,oBAAoB,4BAA4B;AAC/f,8EAA8E,MAAM,EAAE,6BAA6B,KAAK,SAAS,mBAAmB,gBAAgB,MAAM,iBAAiB,eAAe,uBAAuB,gHAAgH,GAAG,iBAAiB,sBAAsB,YAAY,GAAG,eAAe,SAAS,YAAY,QAAQ,oCAAoC,eAAe,iCAAiC,eAAe,sBAAsB,eAAe,wCAAwC,mBAAmB,GAAG,qBAAqB,UAAU,SAAS,SAAS,SAAS,SAAS,SAAS,UAAU,UAAU,sBAAsB,cAAc,cAAc,iCAAiC,UAAU,sBAAsB,gCAAgC,8BAA8B,gCAAgC,6BAA6B,2BAA2B,6BAA6B;AAClgC,uBAAuB,MAAM,qDAAQ,mBAAmB,oDAAoD,8BAA8B,UAAU,kBAAkB,4CAA4C,WAAW,eAAe,0BAA0B,UAAU,8BAA8B,kBAAkB,SAAS;AACzU,eAAe,8BAA8B,4FAA4F,cAAc,EAAE,kBAAkB,iBAAiB,uBAAuB,8BAA8B,0BAA0B,oBAAoB,4FAA4F,cAAc,EAAE,QAAQ,eAAe,MAAM,EAAE,iBAAiB,mBAAmB,YAAY;AAC1d,2BAA2B,wCAAwC,4BAA4B,WAAW,6DAA6D,iBAAiB,gBAAgB,KAAK,gBAAgB,kBAAkB,6EAA6E,KAAK,OAAO,WAAW,UAAU,0CAA0C,2BAA2B;AACla,2BAA2B,+BAA+B,0BAA0B,YAAY,UAAU,QAAQ,eAAe;AACjI,uBAAuB,MAAM,+BAA+B,qCAAqC,oEAAoE,IAAI,+BAA+B,SAAS,EAAE,kBAAkB,kCAAkC,0BAA0B,cAAc,mBAAmB,gBAAgB,EAAE,EAAE,EAAE,uBAAuB,4BAA4B,iBAAiB,WAAW,UAAU,mBAAmB,UAAU,mBAAmB;AACje,qBAAqB,gBAAgB,+BAA+B,aAAa,cAAc,YAAY,UAAU,UAAU,YAAY,iBAAiB,8BAA8B,YAAY;AACtM,6BAA6B,MAAM,aAAa,UAAU,oIAAoI,iBAAiB,oIAAoI,qCAAqC,eAAe,iCAAiC,eAAe;AACvb,mBAAmB,gBAAgB,yDAAyD,4BAA4B,eAAe,gBAAgB,eAAe,EAAE,iBAAiB,eAAe,aAAa,0BAA0B,aAAa,cAAc,iBAAiB,eAAe,aAAa,0BAA0B,aAAa,cAAc,qBAAqB,0BAA0B,UAAU,EAAE,OAAO;AAC9a,2BAA2B,WAAW,2BAA2B,oDAAoD,GAAG,eAAe,uBAAuB,kBAAkB,iCAAiC,8BAA8B,EAAE,eAAe,6BAA6B,MAAM,gBAAgB,kFAAkF;AACrY,iBAAiB,gBAAgB,8CAA8C,iBAAiB,gBAAgB,iBAAiB,GAAG,cAAc,WAAW,sDAAsD,eAAe,eAAe,iBAAiB,UAAU,eAAe,GAAG,iBAAiB,SAAS,2BAA2B,iCAAiC,4BAA4B,kBAAkB,qBAAqB,2CAA2C,mBAAmB,GAAG,eAAe,YAAY,mLAAmL,QAAQ,oSAAoS;AACl/B,CAAC,mBAAmB,eAAe,mFAAmF,SAAS,aAAa,SAAS,sBAAsB,UAAU,WAAW,wBAAwB,uBAAuB,EAAE,sBAAsB,yBAAyB,uBAAuB,2CAA2C,4BAA4B,WAAW,8CAA8C,cAAc,aAAa,aAAa,OAAO,cAAc,GAAG,qBAAqB,8CAA8C,qBAAqB,0BAA0B,QAAQ,mBAAmB,0EAA0E,8CAA8C,UAAU,aAAa,eAAe,gCAAgC,+CAA+C,qBAAqB,+BAA+B,GAAG,WAAW,0CAA0C,KAAK,8BAA8B,EAAE,iBAAiB,EAAE,mBAAmB,+BAA+B,GAAG,wBAAwB,KAAK,8BAA8B,EAAE,iBAAiB,EAAE,eAAe,wBAAwB,SAAS;AAC1sC,eAAe,gBAAgB,yJAAyJ,SAAS,iBAAiB,eAAe,4BAA4B,QAAQ,iBAAiB,SAAS,UAAU,uBAAuB,iCAAiC,SAAS,6FAA6F,gBAAgB,MAAM,qBAAqB,qCAAqC,qEAAqE,qCAAqC,IAAI,YAAY,UAAU,IAAI,YAAY,aAAa,EAAE;AAC1rB,eAAe,SAAS,4BAA4B,qBAAqB,EAAE,SAAS,eAAe,iBAAiB,mBAAmB,iBAAiB,MAAM,yBAAyB,gBAAgB,mCAAmC,sBAAsB,GAAG,mBAAmB,sBAAsB,kCAAkC,mBAAmB,mBAAmB,UAAU,oBAAoB;AAClZ,iBAAiB,oDAAoD,mCAAmC,eAAe,4BAA4B,EAAE,mBAAmB,yBAAyB,gBAAgB,EAAE,QAAQ,UAAU,kCAAkC,8CAA8C,EAAE,GAAG,eAAe,OAAO,aAAa,sCAAsC,aAAa,KAAK,mBAAmB,SAAS,SAAS,SAAS,WAAW,YAAY,YAAY,cAAc,yFAAyF,8BAA8B,cAAc,aAAa,iBAAiB,0BAA0B,MAAM,OAAO,mBAAmB,SAAS,iBAAiB,SAAS,gCAAgC,YAAY,kBAAkB,aAAa,kBAAkB,SAAS,gBAAgB,iBAAiB;AAC33B,6BAA6B,uCAAuC,eAAe,SAAS,mBAAmB,0BAA0B,OAAO,oGAAoG,eAAe,yBAAyB,iBAAiB,qBAAqB,kBAAkB,MAAM,iBAAiB,QAAQ;AACnX,iBAAiB,kCAAkC,uBAAuB,oBAAoB,OAAO,6CAA6C,gBAAgB,8CAA8C,SAAS,EAAE,kCAAkC,MAAM,oGAAoG,gDAAgD,aAAa,kDAAkD,GAAG,iBAAiB,eAAe,eAAe,QAAQ,oDAAoD,EAAE,eAAe,uBAAuB,0BAA0B,OAAO,sCAAsC,yBAAyB,QAAQ,0FAA0F;AAC9yB,mBAAmB,UAAU,gBAAgB,iBAAiB,0BAA0B,MAAM,qDAAQ,gBAAgB,qDAAQ,mBAAmB,+BAA+B,8CAA8C,sBAAsB,eAAe,aAAa,gCAAgC,aAAa,EAAE,aAAa,UAAU,gDAAgD,UAAU,YAAY,gBAAgB,uBAAuB,WAAW,aAAa,oBAAoB;AAC/e,aAAa,oBAAoB,aAAa,YAAY,UAAU,oBAAoB,WAAW,aAAa,sBAAsB,6BAA6B,QAAQ,4BAA4B,UAAU,cAAc,2BAA2B,gBAAgB,iBAAiB,yCAAyC,2CAA2C,iBAAiB,yCAAyC;AACza,iBAAiB,MAAM,OAAO,qDAAQ,gBAAgB,qDAAQ,wBAAwB,2BAA2B,mBAAmB,iBAAiB,sCAAsC,wCAAwC,2BAA2B,0CAA0C,eAAe,IAAI,OAAO,qDAAQ,iBAAiB,SAAS;AACpW,eAAe,yBAAyB,eAAe,aAAa,sDAAsD,YAAY,uBAAuB,eAAe,EAAE,eAAe,2EAA2E,eAAe,wBAAwB,WAAW,iBAAiB,OAAO,cAAc,iBAAiB,mBAAmB,YAAY;AAChZ,eAAe,iBAAiB,aAAa,sBAAsB,6BAA6B,SAAS,EAAE,eAAe,8BAA8B,iBAAiB,KAAK,6QAA6Q,EAAE,iBAAiB;AAC9c,eAAe,eAAe,2BAA2B,mCAAmC,EAAE,eAAe,qCAAqC,oBAAoB,EAAE,iBAAiB,+CAA+C,iBAAiB,8BAA8B,uBAAuB,EAAE,mBAAmB;AACnU,iBAAiB,YAAY,4LAA4L,gGAAgG,QAAQ,uDAAuD,eAAe,oBAAoB,WAAW,uCAAuC,6BAA6B,aAAa,WAAW;AAClgB,eAAe,8BAA8B,oBAAoB,+BAA+B,0BAA0B,SAAS,EAAE,EAAE,iBAAiB,kCAAkC,iBAAiB,GAAG,gBAAgB,WAAW,uCAAuC,uBAAuB,mBAAmB,oCAAoC,mFAAmF,oCAAoC,qBAAqB;AAC1e,iBAAiB,+GAA+G,iBAAiB,iBAAiB,UAAU;AAC5K,iBAAiB,UAAU,+CAA+C,OAAO,SAAS,wMAAwM,EAAE,oBAAoB,WAAW,kBAAkB,qGAAqG,0CAA0C,KAAK;AACze,eAAe,wDAAwD,mFAAmF,KAAK,iBAAiB,kKAAkK;AAClV,iBAAiB,kBAAkB,oDAAoD,QAAQ,2BAA2B,SAAS,kBAAkB,kBAAkB,SAAS,OAAO,iBAAiB,6BAA6B,4CAA4C,wCAAwC,EAAE,EAAE,iBAAiB,8IAA8I;AAC5d,iBAAiB,kBAAkB,oDAAoD,aAAa,mBAAmB,kBAAkB,mBAAmB,iBAAiB,eAAe,kBAAkB,SAAS,IAAI,mBAAmB,WAAW,+CAA+C,+BAA+B,IAAI,mBAAmB,WAAW,kCAAkC,+BAA+B;AAC1a,mBAAmB,YAAY,QAAQ,WAAW,yDAAyD,EAAE,iBAAiB,QAAQ,kCAAkC,SAAS,EAAE,iBAAiB,WAAW,wCAAwC,mBAAmB,mBAAmB,QAAQ,kBAAkB,IAAI,iBAAiB,WAAW,wCAAwC,kBAAkB,mBAAmB,QAAQ,kBAAkB;AAC9b,iBAAiB,WAAW,wCAAwC,mBAAmB,mBAAmB,QAAQ,kBAAkB;AACpI,iBAAiB,+DAA+D,WAAW,wCAAwC,iBAAiB,8CAA8C,EAAE,mBAAmB,QAAQ,wCAAwC,kCAAkC,6BAA6B,yFAAyF,EAAE,aAAa;AAC9a,iBAAiB,WAAW,wCAAwC,kDAAkD,SAAS,qCAAqC,mBAAmB,EAAE,oBAAoB,cAAc,EAAE,2CAA2C,aAAa,wBAAwB,iCAAiC,EAAE;AAChV,oBAAoB,WAAW,wCAAwC,iBAAiB,UAAU,EAAE,kBAAkB,uCAAuC,mBAAmB,YAAY,aAAa,iCAAiC,WAAW,WAAW,WAAW,OAAO,OAAO,MAAM,yBAAyB,eAAe;AACvU,mBAAmB,gMAAgM,uBAAuB;AAC1O,mBAAmB,4OAA4O,iBAAiB,WAAW,2CAA2C,0CAA0C,aAAa,EAAE,MAAM,iBAAiB,6CAA6C,WAAW;AAC9c,uBAAuB,wEAAwE,yBAAyB,gDAAgD,oEAAoE,qDAAQ,0CAA0C,4BAA4B,sBAAsB,MAAM,oCAAoC,EAAE,kBAAkB,sCAAsC,kBAAkB,2BAA2B;AACje,WAAW,MAAM,MAAM,MAAM,oBAAoB,EAAE,mBAAmB,SAAS,oBAAoB,gBAAgB,SAAS,SAAS,EAAE,gBAAgB,iBAAiB,WAAW,8CAA8C,0BAA0B,MAAM,iBAAiB,gDAAgD,WAAW;AAC7U,uBAAuB,wEAAwE,yBAAyB,6BAA6B,sBAAsB,MAAM,oCAAoC,EAAE,kBAAkB,OAAO,aAAa,mBAAmB,uCAAuC,SAAS,kBAAkB,gCAAgC,gBAAgB,IAAI,wBAAwB,SAAS,kBAAkB,cAAc,EAAE;AACzc,eAAe,eAAe,2CAA2C,6CAA6C,uBAAuB,WAAW,sCAAsC,WAAW,4BAA4B,eAAe,8CAA8C,EAAE,mBAAmB,iBAAiB,eAAe,kBAAkB,SAAS,EAAE;AACpX,uBAAuB,WAAW,sCAAsC,iCAAiC,kBAAkB,+CAA+C,SAAS,mBAAmB,2BAA2B,QAAQ,SAAS,kBAAkB,kBAAkB,SAAS,EAAE;AACjS,iBAAiB,kBAAkB,wCAAwC,IAAI,sCAAsC,eAAe,mBAAmB,mBAAmB,mBAAmB,gCAAgC,mBAAmB,IAAI,mBAAmB,kBAAkB,wCAAwC,IAAI,sCAAsC,eAAe,mBAAmB,qBAAqB,mBAAmB,gCAAgC,mBAAmB;AACxe,kBAAkB,gBAAgB,YAAY,gBAAgB,UAAU,EAAE,uBAAuB,WAAW,6EAA6E,YAAY,EAAE,iBAAiB,kBAAkB,kCAAkC,2BAA2B,QAAQ,SAAS,kBAAkB,kBAAkB,SAAS,EAAE;AACvW,mBAAmB,mDAAmD,6HAA6H,SAAS,EAAE,oBAAoB;AAClO,eAAe,OAAO,6TAA6T,sCAAsC,gCAAgC,2BAA2B,EAAE,gBAAgB;AACtc,eAAe,yBAAyB,OAAO,0FAA0F,MAAM,4IAA4I,iBAAiB,oBAAoB,6CAA6C,eAAe,EAAE,4CAA4C;AAC1a,qBAAqB,kBAAkB,YAAY,WAAW,kCAAkC,SAAS,EAAE,qBAAqB,eAAe,0BAA0B,mBAAmB,aAAa,sCAAsC,IAAI,YAAY,WAAW,QAAQ,UAAU,eAAe,SAAS,YAAY,QAAQ,iCAAiC,eAAe,sBAAsB,iBAAiB,wCAAwC,uBAAuB,eAAe,EAAE,GAAG,eAAe,SAAS,YAAY,YAAY,gBAAgB,sDAAsD,0BAA0B,yBAAyB,mBAAmB,2BAA2B,+CAA+C,mBAAmB,0CAA0C,MAAM,EAAE,EAAE,GAAG,iBAAiB,WAAW,qDAAqD,uBAAuB;AAC16B,eAAe,+CAA+C,qCAAqC,sBAAsB,mBAAmB,2CAA2C,2CAA2C,4CAA4C,iBAAiB,EAAE,EAAE,EAAE,mBAAmB,MAAM,iBAAiB,eAAe,aAAa,EAAE,QAAQ,gCAAgC,eAAe,OAAO;AAC3a,4BAA4B,kBAAkB,MAAM,0BAA0B,kDAAkD,IAAI,eAAe,kBAAkB,UAAU,+BAA+B,MAAM,GAAG,eAAe,uBAAuB,6BAA6B,EAAE,iBAAiB,uBAAuB,8BAA8B,EAAE,eAAe,uBAAuB,uBAAuB;AACja,mBAAmB,uBAAuB,yCAAyC,uBAAuB,2BAA2B,eAAe,EAAE,EAAE,EAAE,iBAAiB,kBAAkB,YAAY,eAAe,UAAU,0BAA0B,gBAAgB,6CAA6C,qDAAQ,gBAAgB,qDAAQ,mFAAmF,oCAAoC,UAAU,UAAU,UAAU,QAAQ,qDAAQ,2CAA2C,cAAc,QAAQ,qDAAQ,2CAA2C,cAAc,uDAAuD;AACvrB,gDAAgD,wBAAwB,wBAAwB,WAAW,wBAAwB,wBAAwB,wBAAwB,wBAAwB,wBAAwB,YAAY,SAAS,iBAAiB,4CAA4C,2CAA2C,SAAS,aAAa,SAAS,UAAU,YAAY,QAAQ,eAAe,mCAAmC,SAAS;AACxd,eAAe,qCAAqC,SAAS,QAAQ,eAAe,gCAAgC,SAAS,QAAQ,eAAe,iBAAiB,eAAe,kBAAkB,iBAAiB,2FAA2F,gBAAgB,gBAAgB,gBAAgB,kBAAkB;AACpX,iBAAiB,YAAY,8HAA8H,KAAK,QAAQ,OAAO,oBAAoB,kBAAkB;AACrN,cAAc,mIAAmI,iCAAiC,sCAAsC,gFAAgF,yBAAyB,qBAAqB,kCAAkC,oCAAoC,wBAAwB,qBAAqB,mBAAmB,qBAAqB;AACjf,IAAI,2BAA2B,6CAA6C,+BAA+B,EAAE,iBAAiB,eAAe,UAAU,qDAAQ,gBAAgB,qDAAQ,2BAA2B,oCAAoC,gBAAgB,mBAAmB,iBAAiB,gDAAgD,eAAe;AACzW,eAAe,8BAA8B,eAAe,iBAAiB,iBAAiB,WAAW,eAAe,EAAE,UAAU,8BAA8B,eAAe,gBAAgB,iBAAiB,WAAW,eAAe,EAAE,SAAS,oBAAoB,OAAO,4HAA4H,eAAe;AAC7Z,eAAe,oDAAoD,mCAAmC,SAAS,0BAA0B,UAAU,eAAe,QAAQ,QAAQ,UAAU,aAAa,QAAQ,MAAM,UAAU,QAAQ,MAAM,YAAY,QAAQ,SAAS,YAAY,GAAG,mBAAmB,UAAU,iDAAiD,iDAAiD;AAC1Z,uBAAuB,kJAAkJ,mBAAmB,2FAA2F,uBAAuB,cAAc,gDAAgD,sCAAsC,2BAA2B,uBAAuB;AACpc,iBAAiB,wEAAwE,4CAA4C,6JAA6J,qDAAQ,+CAA+C,4BAA4B,4BAA4B,8CAA8C,kBAAkB,2BAA2B;AAC5e,2CAA2C,MAAM,MAAM,MAAM,mCAAmC,EAAE,mBAAmB,SAAS,oBAAoB,gBAAgB,SAAS,SAAS,EAAE,kBAAkB,iBAAiB,wEAAwE,sCAAsC,eAAe,kBAAkB,kDAAkD,EAAE;AAC5Z,eAAe,wEAAwE,4BAA4B,gBAAgB,mBAAmB,oBAAoB,EAAE,cAAc,gBAAgB,WAAW,iCAAiC,eAAe,SAAS,gBAAgB,eAAe,SAAS;AACtT,iBAAiB,mCAAmC,4DAA4D,gBAAgB,gCAAgC,wCAAwC,uBAAuB,yBAAyB,qCAAqC,8CAA8C,kBAAkB,mDAAmD,QAAQ,MAAM,eAAe,kBAAkB,MAAM;AACrc,iBAAiB,SAAS,6BAA6B,qCAAqC,oBAAoB,4BAA4B,2BAA2B,0BAA0B,mBAAmB,mDAAmD,QAAQ,MAAM,eAAe,kBAAkB,MAAM;AAC5T,iBAAiB,qHAAqH,iHAAiH,qBAAqB,gEAAgE,gBAAgB,oCAAoC,eAAe,oBAAoB,WAAW,+BAA+B,MAAM,EAAE,EAAE;AACvd,eAAe,uDAAuD,kBAAkB,eAAe,EAAE,cAAc,eAAe,sDAAsD,qBAAqB,mBAAmB,kFAAkF,iCAAiC,SAAS,EAAE,gBAAgB,sDAAsD,QAAQ,mBAAmB,cAAc,EAAE;AACnd,eAAe,2BAA2B,aAAa,gBAAgB,kBAAkB,sBAAsB,gBAAgB,kBAAkB,SAAS,QAAQ,UAAU,uCAAuC;AACnN,gBAAgB,WAAW,8DAA8D,SAAS,MAAM,cAAc,WAAW,YAAY,qEAAqE,gCAAgC,6DAA6D,GAAG,iBAAiB,qBAAqB,gBAAgB,SAAS,kBAAkB,gBAAgB,WAAW,gBAAgB;AAC9a,iBAAiB,kBAAkB,8BAA8B,QAAQ,QAAQ,eAAe,aAAa,WAAW,yEAAyE,YAAY,kBAAkB,WAAW,mEAAmE,EAAE,GAAG,iBAAiB,WAAW,8BAA8B,kBAAkB,GAAG,iBAAiB,WAAW,qCAAqC,aAAa;AAC/c,iBAAiB,WAAW,mBAAmB,aAAa,GAAG,qBAAqB,WAAW,2CAA2C,uEAAuE,EAAE,uBAAuB,qBAAqB,WAAW,2CAA2C,eAAe,uEAAuE,EAAE;AAC7Y,iBAAiB,oCAAoC,uCAAuC,OAAO,eAAe,OAAO,EAAE,kBAAkB,iBAAiB,WAAW,8BAA8B,sBAAsB,QAAQ,GAAG,mBAAmB,aAAa,uBAAuB,QAAQ,SAAS,GAAG,mBAAmB,WAAW,8BAA8B,sBAAsB,mBAAmB,GAAG;AAC3Z,mBAAmB,WAAW,8BAA8B,sBAAsB,mBAAmB,GAAG,GAAG,iBAAiB,WAAW,8BAA8B,uBAAuB,GAAG,iBAAiB,4JAA4J;AAC5W,gBAAgB,WAAW,8BAA8B,WAAW,qBAAqB,UAAU,6BAA6B,EAAE,WAAW,mEAAmE,EAAE,uCAAuC,aAAa,uBAAuB,QAAQ,SAAS,EAAE,GAAG,cAAc,aAAa,cAAc,qBAAqB,oBAAoB,mCAAmC,eAAe;AACvb,eAAe,SAAS,YAAY,aAAa,4BAA4B,uDAAuD,aAAa,6BAA6B,iBAAiB,6BAA6B,SAAS,gCAAgC,iBAAiB,WAAW,qBAAqB,YAAY,EAAE,qBAAqB,gCAAgC;AACzX,mCAAmC,WAAW,eAAe,8BAA8B,yBAAyB,IAAI,sCAAsC,sBAAsB,YAAY,GAAG,iBAAiB,YAAY,wBAAwB,6DAA6D;AACrT,oBAAoB,UAAU,YAAY,gBAAgB,oCAAoC,UAAU,+DAA+D,uCAAuC,0BAA0B,gBAAgB,YAAY,gBAAgB,UAAU,EAAE,SAAS,iBAAiB,6BAA6B,iBAAiB;AACxW,mBAAmB,WAAW,kCAAkC,gBAAgB,4FAA4F,aAAa,mBAAmB,mBAAmB,mBAAmB,IAAI,iBAAiB,mCAAmC,oBAAoB,GAAG,mBAAmB,8CAA8C,IAAI,iBAAiB,4CAA4C,iBAAiB;AACpd,iBAAiB,4CAA4C,IAAI,mBAAmB,WAAW,kCAAkC,sCAAsC,eAAe,mBAAmB,mBAAmB,mBAAmB,IAAI,mBAAmB;AACtQ,mBAAmB,WAAW,kCAAkC,wBAAwB,QAAQ,0DAA0D,wDAAwD,eAAe,IAAI,eAAe,iCAAiC,gCAAgC,sCAAsC,kCAAkC,cAAc,UAAU,YAAY,YAAY,kCAAkC,sCAAsC,iBAAiB,+BAA+B,iBAAiB,QAAQ,qCAAqC,qCAAqC,2CAA2C,iCAAiC,6BAA6B,iBAAiB,kCAAkC,eAAe;AACnzB,iBAAiB,UAAU,SAAS,mBAAmB,iCAAiC,aAAa,WAAW,kBAAkB,aAAa,gDAAgD,oCAAoC,SAAS;AAC5O,gCAAgC,SAAS,WAAW,sCAAsC,SAAS,6CAA6C,SAAS,OAAO,UAAU,0BAA0B,SAAS,SAAS,SAAS,IAAI,UAAU,iBAAiB,MAAM,QAAQ,+BAA+B,SAAS,UAAU,qBAAqB,YAAY,0BAA0B,eAAe,4DAA4D,eAAe,0BAA0B,eAAe,0BAA0B,gBAAgB,cAAc,4BAA4B,YAAY,cAAc,+BAA+B,YAAY,wDAAwD,mEAAmE,OAAO,sBAAsB,GAAG;AAChzB,2BAA2B,WAAW,2BAA2B,4BAA4B,mCAAmC,WAAW,iCAAiC,kBAAkB,iBAAiB,MAAM,0BAA0B,kCAAkC,SAAS,MAAM,UAAU,gBAAgB,gBAAgB,gDAAgD,eAAe,aAAa,oBAAoB,EAAE,sBAAsB,gBAAgB,6EAA6E,EAAE;AACjiB,gBAAgB,GAAG,0BAA0B,UAAU,YAAY,2BAA2B,2BAA2B,mBAAmB,UAAU,SAAS,YAAY,gDAAgD,SAAS,WAAW,4BAA4B,UAAU,wJAAwJ,gCAAgC;AAC7c,sJAAsJ,iCAAiC,qBAAqB,aAAa,WAAW,UAAU,iBAAiB,uBAAuB,QAAQ,8BAA8B,6BAA6B,aAAa,8BAA8B,iBAAiB,sBAAsB,WAAW,6BAA6B,6BAA6B;AAChf,OAAO,6BAA6B,+DAA+D,iBAAiB,YAAY,aAAa,QAAQ,UAAU,WAAW,iBAAiB,mBAAmB,YAAY,EAAE,iBAAiB,YAAY,gBAAgB,UAAU,EAAE,SAAS;AAC9R,gBAAgB,WAAW,wDAAwD,2BAA2B,uIAAuI,kBAAkB,oBAAoB,mBAAmB,MAAM,kBAAkB,EAAE,mBAAmB,2BAA2B,gBAAgB,SAAS,SAAS;AACxZ,oBAAoB,SAAS,WAAW,yCAAyC,eAAe,UAAU,SAAS,YAAY,YAAY,iBAAiB,sBAAsB,WAAW,IAAI,oBAAoB,SAAS,WAAW,8CAA8C,yBAAyB,yBAAyB,UAAU,KAAK,kBAAkB,mBAAmB,YAAY,uBAAuB,EAAE,IAAI,mBAAmB,SAAS;AAClc,eAAe,uFAAuF,mBAAmB,SAAS,UAAU,WAAW,YAAY,gBAAgB,uEAAuE,YAAY,aAAa,UAAU,eAAe;AAC5S,mBAAmB,SAAS,IAAI,UAAU,qDAAQ,OAAO,SAAS,wFAAwF,iEAAiE,oCAAoC,kBAAkB,IAAI,qBAAqB,UAAU,IAAI,2DAA2D,UAAU,EAAE,qDAAQ,gBAAgB,qDAAQ,qBAAqB,8BAA8B,IAAI,sBAAsB,SAAS;AACrf,KAAK,SAAS,aAAa,SAAS,qBAAqB,GAAG,gCAAgC,QAAQ,iBAAiB,WAAW,0BAA0B,KAAK,oHAAoH,IAAI,WAAW,8HAA8H,KAAK,QAAQ,WAAW,yDAAyD,OAAO;AACxf,mEAAmE,QAAQ,uEAAuE,QAAQ,QAAQ,oDAAoD,+EAA+E,gBAAgB,OAAO,yDAAyD;AACrX,iBAAiB,OAAO,oDAAoD,6BAA6B,gBAAgB,OAAO,gDAAgD,iBAAiB,OAAO,qDAAqD,8BAA8B,iBAAiB,OAAO,+CAA+C,kBAAkB,cAAc,OAAO,sDAAsD;AAC/b,cAAc,OAAO,uEAAuE,+BAA+B,cAAc,OAAO,qEAAqE,yBAAyB,qDAAQ,YAAY,eAAe,OAAO,iHAAiH,eAAe,2BAA2B;AACnb,cAAc,OAAO,uFAAuF,qBAAqB,cAAc,OAAO,wEAAwE,mFAAmF,iBAAiB,4EAA4E,eAAe;AAC7Z,cAAc,OAAO,gHAAgH,sEAAsE,oBAAoB,OAAO,uDAAuD,yBAAyB,gBAAgB,gBAAgB,gBAAgB,wBAAwB,iBAAiB,gBAAgB,gBAAgB,kCAAkC,mBAAmB,eAAe,6BAA6B,iBAAiB,UAAU,4BAA4B,GAAG,oBAAoB;AAC9lB,mBAAmB,aAAa,4CAA4C,UAAU,uBAAuB,eAAe,cAAc,qBAAqB,mDAAmD,SAAS,eAAe,eAAe,sBAAsB,gBAAgB,IAAI,qCAAqC,KAAK,qCAAqC,KAAK,2DAA2D,KAAK,mEAAmE,KAAK,iDAAiD,KAAK,8BAA8B,KAAK,gDAAgD,KAAK,qGAAqG,KAAK;AACvvB,2EAA2E,KAAK,uHAAuH,KAAK,oEAAoE,KAAK,2CAA2C,KAAK,oDAAoD,KAAK,8BAA8B,KAAK,qCAAqC,KAAK,4CAA4C;AACvf,IAAI,+DAA+D,KAAK,4DAA4D,KAAK,uDAAuD,KAAK,gCAAgC,KAAK,mCAAmC,KAAK,0CAA0C,OAAO,wEAAwE,+BAA+B,iBAAiB,KAAK,oBAAoB,SAAS;AAC7d,KAAK,KAAK,8BAA8B,KAAK,gCAAgC,KAAK,8CAA8C,EAAE,iBAAiB,IAAI,kDAAkD,KAAK,2CAA2C,EAAE,kBAAkB,6BAA6B,iCAAiC;AAC3U,gBAAgB,UAAU,mBAAmB,KAAK,sDAAsD,IAAI,gDAAgD,KAAK,kDAAkD,KAAK,mCAAmC,KAAK,qDAAqD,KAAK,8BAA8B,KAAK,iCAAiC,KAAK,4DAA4D,KAAK,6CAA6C,KAAK;AACtf,0BAA0B,KAAK,wCAAwC,KAAK,2CAA2C,SAAS,mBAAmB,KAAK,2GAA2G,SAAS,6BAA6B,KAAK,gCAAgC,KAAK,kCAAkC,KAAK,wCAAwC,KAAK,yCAAyC,KAAK,sCAAsC;AAC3f,IAAI,yHAAyH,EAAE,gBAAgB,SAAS,eAAe,SAAS,cAAc,QAAQ,aAAa,cAAc,oBAAoB,EAAE,gBAAgB,SAAS,eAAe,SAAS,cAAc,QAAQ,aAAa,cAAc,oBAAoB,EAAE,eAAe,IAAI,eAAe,IAAI,aAAa,OAAO,aAAa;AACtb,iBAAiB,yBAAyB,qFAAqF,EAAE,gBAAgB,SAAS,0CAA0C,EAAE,4BAA4B,sCAAsC,8BAA8B,WAAW,0BAA0B,YAAY,sBAAsB,gCAAgC,mBAAmB,6BAA6B,gBAAgB,GAAG,8BAA8B;AAC9e,gBAAgB,IAAI,+BAA+B,KAAK,2DAA2D,EAAE,2CAA2C,0DAA0D,gBAAgB,IAAI,+BAA+B,KAAK,2DAA2D,EAAE,2CAA2C,gBAAgB,IAAI,+BAA+B,KAAK,2DAA2D;AAC7e,kFAAkF,gBAAgB,IAAI,2DAA2D,EAAE,0DAA0D,gBAAgB,IAAI,+BAA+B,aAAa,yFAAyF,KAAK,2DAA2D,EAAE,gBAAgB,GAAG,8BAA8B;AACze,gBAAgB,GAAG,8BAA8B,EAAE;AACnD,gBAAgB,IAAI,gDAAgD,OAAO,mFAAmF,gSAAgS,8BAA8B;AAC5d,gBAAgB,GAAG,8BAA8B,EAAE,eAAe,QAAQ,8BAA8B,EAAE,gBAAgB,QAAQ,8BAA8B,EAAE,gBAAgB,QAAQ,8BAA8B,EAAE,gBAAgB,QAAQ,8BAA8B,EAAE,gBAAgB,IAAI,+BAA+B;AACrU,gBAAgB,IAAI,uBAAuB,KAAK,2CAA2C,KAAK,sBAAsB,oEAAoE,oCAAoC,EAAE,gBAAgB,OAAO,kBAAkB,SAAS,mBAAmB,SAAS,oBAAoB,EAAE,iCAAiC,6BAA6B,iBAAiB;AACnZ,YAAY,wBAAwB,qDAAQ,EAAE,qDAAQ,WAAW,qDAAQ,6BAA6B,OAAO,gBAAgB,WAAW,uKAAuK,oCAAoC,+BAA+B,kCAAkC,gCAAgC,gCAAgC;AACpd,0CAA0C,6CAA6C,mCAAmC,gGAAgG,2BAA2B,uCAAuC,qDAAQ,6BAA6B,wCAAwC,sCAAsC,iBAAiB,4EAA4E,EAAE,qDAAQ,6BAA6B;AACnhB,4BAA4B,uCAAuC,OAAO,0GAA0G,8DAA8D,EAAE,qDAAQ,4CAA4C,qDAAQ,2BAA2B,QAAQ,EAAE,qDAAqD,4DAA4D,KAAK,iIAAiI;;AAE5kB;;;;;;;;;;;;;;ACnbA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAqF;AAC3C;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,iCAAiC;AACrE;AACA;AACA;AACA,+BAA+B,uDAAQ;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,sDAAQ,EAAE,kDAAkD;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ,mDAAmD,UAAU;AAC/F,yBAAyB,oDAAM;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA,oCAAoC,iCAAiC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA,yDAAyD,sDAAQ;AACjE,4DAA4D,8BAA8B,EAAE;AAC5F;AACA,yDAAyD,kCAAkC,EAAE;AAC7F,4DAA4D,6BAA6B,EAAE;AAC3F;AACA,yDAAyD,0BAA0B,EAAE;AACrF;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAEkD;AACnD;;;;;;;;;;;;;ACvTA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAqC;AAC2D;AACuP;AACnS;AAC0B;;AAE9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,gEAAS;AACvE;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,+DAAQ;AAC3B;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+DAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uDAAM;AAC1B;AACA;AACA,UAAU,mBAAmB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA,oBAAoB,wEAAiB;AACrC,mBAAmB,mDAAI;AACvB;AACA;AACA,WAAW,qDAAM;AACjB;AACA;AACA,WAAW,KAAK;AAChB,YAAY;AACZ;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gEAAS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,WAAW,0BAA0B;AACrC,WAAW,SAAS;AACpB;AACA;AACA,IAAI,6DAAM;AACV;AACA,6BAA6B,yDAAQ;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA,0BAA0B,sDAAQ;AAClC;AACA;AACA;AACA,WAAW,UAAU;AACrB;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA,+EAA+E,sDAAQ;AACvF;AACA;AACA;AACA,WAAW,UAAU;AACrB;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA,4EAA4E,sDAAQ;AACpF;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA,wEAAwE,sDAAQ;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB;AACA;AACA,QAAQ,gEAAS;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,gEAAS;AACpF;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY;AACZ;AACA;AACA;AACA,eAAe,gEAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA,eAAe,gEAAS;AACxB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY,eAAe;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA,IAAI,6DAAM,iDAAiD;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,GAAG;AACtB;AACA;AACA;AACA,mBAAmB,GAAG;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,6CAA6C,KAAK;AAClD;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,YAAY,cAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yBAAyB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,yBAAyB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,yBAAyB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA,+BAA+B,WAAW;AAC1C;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,6BAA6B;AACjE;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,gBAAgB;AAChB;AACA;AACA;AACA,oCAAoC,yBAAyB;AAC7D;AACA;AACA;AACA,gDAAgD,iCAAiC;AACjF;AACA;AACA;AACA;AACA;AACA,2BAA2B,wBAAwB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,uBAAuB,6CAA6C;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,yDAAyD,0BAA0B;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,IAAI;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB;AACA;AACA;AACA,mBAAmB,eAAe;AAClC;AACA,mBAAmB,OAAO;AAC1B;AACA,uBAAuB,wBAAwB;AAC/C,gCAAgC,mEAAY;AAC5C;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mEAAY;AACxC;AACA;AACA;AACA;AACA,4BAA4B,mEAAY;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,mBAAmB;AACtD,wCAAwC,qBAAqB;AAC7D,uDAAuD,uCAAuC;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB;AACA;AACA,QAAQ,6DAAM;AACd,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,EAAE,qBAAqB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,sDAAQ,yCAAyC,UAAU;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,QAAQ,gBAAgB;AAC3C;AACA;AACA;AACA;AACA,iBAAiB,0BAA0B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+DAAQ;AACpB;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA,yBAAyB,kEAAW;AACpC;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,sBAAsB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,mEAAY;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,aAAa;AACxB;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA;AACA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA,wBAAwB,kEAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kEAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kEAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,kEAAW;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kEAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kEAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kEAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kEAAW;AACnC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB,QAAQ,uEAAgB;AACxB,2BAA2B,uDAAQ;AACnC;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA,QAAQ,uEAAgB;AACxB,2BAA2B,uDAAQ;AACnC;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA,QAAQ,uEAAgB;AACxB,2BAA2B,uDAAQ;AACnC;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,mBAAmB;AAClC,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB,2BAA2B,uDAAQ;AACnC;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA,2BAA2B,0BAA0B;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB,2BAA2B,uDAAQ;AACnC;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,aAAa;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB,gBAAgB;AAChB;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mCAAmC;AAC3D;AACA;AACA;AACA;AACA,mBAAmB,QAAQ;AAC3B;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,MAAM;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wCAAwC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,qEAAc;AAC5B;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA,wCAAwC,+DAAQ;AAChD;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA,IAAI,6DAAM;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB,eAAe,gCAAgC;AAC/C;AACA,eAAe,OAAO;AACtB;AACA;AACA,uCAAuC,+DAA+D;AACtG;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6BAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,GAAG;AAClB,eAAe,uBAAuB;AACtC,eAAe,QAAQ;AACvB,eAAe,oBAAoB;AACnC;AACA;AACA,0CAA0C,yBAAyB;AACnE;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,eAAe,SAAS;AACxB,eAAe,2BAA2B;AAC1C,eAAe,2BAA2B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,eAAe,SAAS;AACxB,eAAe,wBAAwB;AACvC,eAAe,wBAAwB;AACvC,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,GAAG;AACnB;AACA;AACA;AACA;AACA;AACA,gBAAgB,GAAG;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,WAAW;AAC1B,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,WAAW;AAC1B,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,eAAe;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,eAAe,WAAW;AAC1B,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,WAAW;AAC1B,gBAAgB,eAAe;AAC/B;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC,eAAe,UAAU;AACzB;AACA;AACA,+BAA+B,8BAA8B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,gBAAgB,kBAAkB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,gBAAgB,kBAAkB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,gBAAgB,GAAG;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,gBAAgB,GAAG;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,GAAG;AACnB;AACA;AACA;AACA;AACA;AACA,gBAAgB,GAAG;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,gBAAgB,4BAA4B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,+CAA+C;AACtF;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,wCAAwC;AACnD,WAAW,yBAAyB;AACpC;AACA,WAAW,yBAAyB;AACpC,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA,kCAAkC,8BAA8B,GAAG,8BAA8B;AACjG;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,wBAAwB,8DAAO;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,+DAAQ;AACvB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ,GAAG;AACrC;AACA,yBAAyB,sDAAQ,GAAG;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,0DAAG;AAC5B,wBAAwB,8DAAO;AAC/B,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,0DAAG;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,MAAM;AACrB,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA,kEAAkE,YAAY,EAAE;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,iBAAiB;AAC5B;AACA,YAAY;AACZ;AACA;AACA,8BAA8B,iBAAiB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,6DAAM;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,6FAA6F,uBAAuB,EAAE;AACtH;AACA;AACA,sFAAsF,8BAA8B,GAAG,8BAA8B;AACrJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,+DAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB;AACA,aAAa;AACb;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,WAAW;AAC1B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE;AAClB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE;AAClB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,cAAc;AAC9B;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB;AACvC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,mBAAmB;AAClC,eAAe,cAAc;AAC7B,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gEAAS;AACrB;AACA;AACA,CAAC;AACD;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC,eAAe,iBAAiB;AAChC,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,eAAe,oDAAoD;AACnE,eAAe,iBAAiB;AAChC,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,+DAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd,kDAAkD,QAAQ;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,eAAe,aAAa;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,iCAAiC;AAChD,eAAe,0BAA0B;AACzC,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC,eAAe,iBAAiB;AAChC,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oDAAoD;AACnE,eAAe,iBAAiB;AAChC,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,qCAAqC;AACpD,eAAe,QAAQ;AACvB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA,QAAQ,uEAAgB;AACxB,QAAQ,4EAAqB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,kCAAkC;AACjD;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uDAAQ;AACnC;AACA,4CAA4C,EAAE;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C,eAAe,SAAS;AACxB,gBAAgB;AAChB;AACA;AACA,+BAA+B,cAAc;AAC7C,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C,eAAe,SAAS;AACxB,gBAAgB;AAChB;AACA;AACA,+BAA+B,cAAc;AAC7C,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,uEAAuE;AACvE,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,0BAA0B;AACzC,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA,YAAY,uEAAgB;AAC5B;AACA,YAAY,4EAAqB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,kEAAW;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,+BAA+B;AAC1C,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,IAAI,6DAAM;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA,IAAI,6DAAM;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC;AACvC;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,yBAAyB;AACxC,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA,YAAY,6DAAM;AAClB,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,wCAAwC;AACvD;AACA;AACA,kCAAkC,4BAA4B;AAC9D;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB;AACpC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,aAAa;AACzE;AACA;AACA,eAAe,MAAM;AACrB,eAAe,oBAAoB;AACnC;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB,EAAE;AAClB;AACA;AACA,gFAAgF,aAAa,EAAE;AAC/F;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,GAAG;AAClB,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB,GAAG;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,eAAe;AAC9B,gBAAgB,eAAe;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yCAAyC;AACxD,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,yCAAyC;AACxD,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,qBAAqB;AACpC,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,WAAW,MAAM;AACjB;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,WAAW,MAAM;AACjB,WAAW,uBAAuB;AAClC;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,WAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,6DAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,qEAAc;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB;AACA;AACA,iDAAiD,gCAAgC;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,iBAAiB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B;AACA;AACA,QAAQ,6DAAM;AACd,QAAQ,6DAAM;AACd;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,WAAW;AAC1B,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6DAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6DAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qEAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,WAAW;AAC1B,eAAe,iBAAiB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,MAAM;AACjE;AACA;AACA,2BAA2B,MAAM;AACjC;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB,eAAe,cAAc;AAC7B,eAAe,qBAAqB;AACpC,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6DAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,6DAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,eAAe,QAAQ;AACvB,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB,eAAe,sBAAsB;AACrC,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,sBAAsB;AACrC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB,eAAe,uBAAuB;AACtC,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,eAAe,QAAQ;AACvB,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB,eAAe,yBAAyB;AACxC,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB,eAAe,cAAc;AAC7B,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,6DAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,MAAM;AACrB,eAAe,4BAA4B;AAC3C,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,QAAQ;AACvB,eAAe,iBAAiB;AAChC,eAAe,4BAA4B;AAC3C,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA,gEAAgE,kCAAkC,EAAE;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA,kBAAkB,qEAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,WAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,OAAO;AACtB,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,2BAA2B,qCAAqC;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,MAAM;AACrB,eAAe,mBAAmB;AAClC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E;AAC9E;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA,SAAS;AACT;AACA,YAAY,6DAAM;AAClB;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA,8BAA8B,sDAAQ,sCAAsC,UAAU;AACtF;AACA;AACA;AACA;AACA,2BAA2B,QAAQ,gBAAgB;AACnD;AACA;AACA;AACA;AACA,yBAAyB,0BAA0B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,mBAAmB;AAClC,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,eAAe,QAAQ;AACvB,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,MAAM;AAC7B,uBAAuB,MAAM;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,mBAAmB;AAClC,eAAe,OAAO;AACtB,iBAAiB,iDAAiD;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,sDAAQ,uCAAuC,UAAU;AACvF,6BAA6B,oDAAM;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ,gBAAgB;AACnD;AACA;AACA;AACA;AACA,yBAAyB,0BAA0B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ,sCAAsC,UAAU;AAClF;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ,sCAAsC,UAAU;AAClF;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ,sCAAsC,UAAU;AAClF;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,eAAe;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6DAAM;AACtB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,wBAAwB;AACvC,eAAe,QAAQ;AACvB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA,uBAAuB,4BAA4B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,gBAAgB;AAC/B,eAAe,SAAS;AACxB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,cAAc;AAC7B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,QAAQ;AACvB,eAAe,WAAW;AAC1B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,8DAAO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,qEAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,WAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,gBAAgB;AAC/B,eAAe,SAAS;AACxB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,WAAW;AAC1B,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,WAAW;AAC1B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gBAAgB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,qBAAqB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8GAA8G,wBAAwB,EAAE;AACxI;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,aAAa;AACb,2BAA2B,0BAA0B;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,YAAY;AAC5C,aAAa,+DAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,eAAe,+DAAQ;AACvB;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,sDAAQ,GAAG;AAC/B;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,+DAAQ;AACrC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA,uBAAuB,0BAA0B;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,eAAe,yBAAyB;AACxC;AACA;AACA;AACA;AACA;AACA,uBAAuB,6BAA6B;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,WAAW,MAAM;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,yBAAyB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,KAAK;AACpB;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA,4BAA4B,sDAAQ;AACpC,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,uCAAuC;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA,SAAS;AACT;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sEAAe;AAC5B;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,WAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,uBAAuB;AACvD;AACA;AACA,yBAAyB,oDAAM;AAC/B;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,gCAAgC,uBAAuB;AACvD;AACA;AACA,yBAAyB,oDAAM;AAC/B;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gEAAS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,sBAAsB,gEAAS;AAC/B;AACA;AACA;AACA,yBAAyB,mEAAY;AACrC;AACA;AACA;AACA;AACA;AACA,uBAAuB,qBAAqB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA,YAAY,gEAAS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA,4BAA4B,gEAAS;AACrC;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,gEAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,gBAAgB;AACjE;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,sCAAsC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,YAAY;AAC3B;AACA;AACA;AACA,YAAY,gEAAS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,QAAQ;AACvB;AACA,eAAe,QAAQ;AACvB,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,aAAa,gEAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gEAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,GAAG,QAAQ,GAAG;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,+DAAQ;AACnC;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,sBAAsB,gEAAS;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,qBAAqB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,sDAAQ,kDAAkD,UAAU;AAClG;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ,gBAAgB;AACnD;AACA;AACA;AACA;AACA,yBAAyB,0BAA0B;AACnD;AACA;AACA;AACA;AACA,gBAAgB,8DAA8D;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,yDAAyD;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,aAAa,eAAe,EAAE,EAAE;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,aAAa,qBAAqB,EAAE,EAAE;AACxE;AACA;AACA;AACA,yBAAyB,aAAa,2BAA2B,EAAE,EAAE;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,qCAAqC;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,aAAa,eAAe,EAAE,EAAE;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB,eAAe,0BAA0B;AACzC,eAAe,QAAQ;AACvB;AACA,iFAAiF;AACjF;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB,eAAe,0BAA0B;AACzC,eAAe,QAAQ;AACvB;AACA,mFAAmF;AACnF;AACA;AACA,eAAe,OAAO;AACtB;AACA,iEAAiE;AACjE;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB,eAAe,0BAA0B;AACzC;AACA,uFAAuF;AACvF;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB,eAAe,0BAA0B;AACzC;AACA,yFAAyF;AACzF;AACA,eAAe,OAAO;AACtB,eAAe,0BAA0B;AACzC;AACA,oFAAoF;AACpF;AACA,eAAe,mBAAmB;AAClC;AACA,4DAA4D;AAC5D;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD,+CAA+C;AAC/C;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,uDAAS;AACb;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,gEAAS;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,kBAAkB,gEAAS;AAC3B,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,sDAAsD,+DAAQ;AAC9D;AACA,2BAA2B,8DAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,eAAe,EAAE;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8DAAO;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,oEAAa;AAC1C,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,wCAAwC,gEAAS;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gEAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6DAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,8DAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,0BAA0B;AAC5D;AACA;AACA,uBAAuB,kCAAkC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,6BAA6B,EAAE;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ,wCAAwC,UAAU;AACpF;AACA;AACA,iDAAiD,sDAAQ,oCAAoC,UAAU;AACvG;AACA;AACA;AACA;AACA,+BAA+B,QAAQ,gBAAgB;AACvD;AACA;AACA;AACA;AACA,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA,uBAAuB,kCAAkC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gEAAS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sEAAe;AAC3B;AACA;AACA,iBAAiB,oEAAa;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,uDAAS;AACb;AACA,eAAe,UAAU;AACzB,eAAe,sCAAsC;AACrD,eAAe,kBAAkB;AACjC,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8DAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,oBAAoB;AACnC,eAAe,uBAAuB;AACtC;AACA;AACA;AACA;AACA,+CAA+C,4BAA4B;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kEAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,+DAAQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gEAAS;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,4FAA4F,uDAAuD,EAAE;AACrJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,aAAa;AACb,wCAAwC;AACxC,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,0DAAG,uBAAuB,4BAA4B,EAAE;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,0DAAG,uBAAuB,4BAA4B,EAAE;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,gDAAgD;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,YAAY,8DAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,mBAAmB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,qCAAqC,qBAAqB;AAC1D;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,eAAe,aAAa;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,eAAe,aAAa;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,6BAA6B;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,eAAe,qBAAqB;AACpC,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,yBAAyB;AAC5D;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,SAAS;AACxB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,SAAS;AACxB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA,sCAAsC,gEAAS;AAC/C;AACA,0CAA0C,gEAAS;AACnD;AACA,qDAAqD,gEAAS;AAC9D;AACA;AACA;AACA,wCAAwC,gEAAS;AACjD;AACA,mDAAmD,gEAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,WAAW;AAC5B;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA,iBAAiB,WAAW;AAC5B;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA,QAAQ,uEAAgB;AACxB,2BAA2B,uDAAQ;AACnC;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA,2BAA2B,0BAA0B;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB,2BAA2B,uDAAQ;AACnC;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,mBAAmB;AAClC,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA,2BAA2B,uDAAQ;AACnC;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,4CAA4C;AAC3D,eAAe,SAAS;AACxB,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA,QAAQ,uEAAgB;AACxB,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uDAAQ;AACnC;AACA,gDAAgD,EAAE;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA,QAAQ,uEAAgB;AACxB,2BAA2B,uDAAQ;AACnC;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,gBAAgB,EAAE;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,EAAE;AACzC;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,MAAM;AACrB,eAAe,UAAU;AACzB;AACA;AACA,+BAA+B,YAAY;AAC3C,iCAAiC,gBAAgB;AACjD,+BAA+B,wBAAwB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,8DAAO;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,GAAG;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,SAAS;AACxB;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,2CAA2C;AAC9E;AACA,eAAe,SAAS;AACxB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA,0BAA0B,+DAAQ;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AAC/C;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,0CAA0C;AACrD,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+DAAQ;AACpB;AACA,8BAA8B,8DAAO;AACrC,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,mBAAmB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,gBAAgB;AAC3B,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4BAA4B;AACvC;AACA;AACA;AACA;AACA;AACA,0BAA0B,mCAAmC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd,yDAAyD,qDAAqD,EAAE;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,qBAAqB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA,oEAAoE,MAAM;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,kBAAkB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,kBAAkB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,MAAM;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+DAAQ;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,6CAA6C,MAAM;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,YAAY,6BAA6B;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4BAA4B;AACvC,YAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,WAAW,4BAA4B;AACvC,WAAW,oBAAoB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,WAAW,6BAA6B;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,qBAAqB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,WAAW,4BAA4B;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA,gBAAgB,6DAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6DAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,iBAAiB;AAClE;AACA,sDAAsD,6BAA6B,EAAE;AACrF;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,uBAAuB,EAAE;AAC7D;AACA;AACA,uCAAuC,4CAA4C,EAAE;AACrF;AACA;AACA;AACA;AACA;AACA,mCAAmC,+CAA+C,EAAE;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F;AAC1F,8EAA8E;AAC9E;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ,2CAA2C,UAAU;AACvF;AACA;AACA,iDAAiD,sDAAQ,qDAAqD,UAAU;AACxH;AACA;AACA;AACA;AACA,+BAA+B,QAAQ,gBAAgB;AACvD;AACA;AACA;AACA;AACA,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ,2CAA2C,UAAU;AACvF;AACA;AACA,iDAAiD,sDAAQ,qDAAqD,UAAU;AACxH;AACA;AACA;AACA;AACA,+BAA+B,QAAQ,gBAAgB;AACvD;AACA;AACA;AACA;AACA,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA,uBAAuB,8DAAO;AAC9B;AACA,yBAAyB,8DAAO;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,aAAa;AAC5B,gBAAgB,MAAM;AACtB;AACA;AACA,uBAAuB,8DAAO;AAC9B;AACA;AACA;AACA;AACA,mBAAmB,8DAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,QAAQ,uDAAS;AAClD,uBAAuB,yDAAW;AAClC;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB,WAAW;AAC3B;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,4DAAQ,sBAAsB,sEAAkB;AAC3E,kCAAkC,6DAAS,+BAA+B,uBAAuB,EAAE;AACnG;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,YAAY;AACvB;AACA;AACA;AACA,2BAA2B,gBAAgB;AAC3C;AACA;AACA,WAAW,EAAE;AACb,WAAW,YAAY;AACvB;AACA;AACA;AACA,8BAA8B,UAAU;AACxC;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,6DAAS;AACrE;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,QAAQ,gEAAS;AACjB;AACA;AACA;AACA,iBAAiB,qDAAQ;;AAEuF;AAChH;;;;;;;;;;;;;;AC9leA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA8F;;AAEhE;;AAEgC;;AAEyF;;AAEZ;;AAEtF;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,uDAAC;AACZ,CAAC,iBAAiB,uDAAC;;AAEnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD,sBAAsB,yDAAC;AACvB;AACA,yBAAyB,4DAAC;AAC1B;AACA;;AAEA;AACA,2BAA2B,sBAAsB;AACjD,sBAAsB,yDAAC;AACvB;AACA,yBAAyB,4DAAC;AAC1B;AACA;;AAEA;AACA,2BAA2B,sBAAsB;AACjD,sBAAsB,yDAAC;AACvB;AACA,wBAAwB,4DAAC;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E;AAC1E;AACA,mBAAmB,OAAO;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,eAAe,6BAA6B,cAAc;AACnE;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mCAAmC,cAAc;AACjD;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,sFAAsF;AACtF;AACA;AACA,yDAAyD,cAAc;AACvE;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,cAAc;AAC9D;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,cAAc;AACrC;AACA;AACA,KAAK;AACL;AACA,kCAAkC,cAAc;AAChD;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,uBAAuB,iBAAiB;AACxC;AACA,KAAK;AACL;AACA,uBAAuB,iBAAiB;AACxC;AACA,KAAK;AACL,mDAAmD,OAAO;AAC1D,KAAK;AACL;AACA,KAAK;AACL,yDAAyD,OAAO;AAChE;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,sBAAsB;AACrD;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,SAAS,cAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB,sBAAsB;AACzC;AACA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,+BAA+B,QAAQ;AACvC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,iCAAiC,QAAQ;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS,MAAM,qBAAqB;AACpC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,QAAQ,gCAAgC,uBAAuB,QAAQ;AAC5G;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,gEAAgE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,wCAAwC,QAAQ;AAChD;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,iEAAiE,QAAQ;AACzE,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,2BAA2B,sBAAsB;AACjD,kCAAkC,cAAc;AAChD;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,iDAAiD,QAAQ;AACzD;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,uBAAuB,cAAc;AACrC;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA,+CAA+C,cAAc;AAC7D;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4IAA4I;AAC5I;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,EAAE;;AAE3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,+DAA+D,8BAA8B;AAC7F;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,mEAAmE,8BAA8B;AACjG;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,kCAAkC,wCAAwC;AAC1E;AACA;AACA;AACA;AACA;AACA,2BAA2B,8BAA8B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,4DAA4D,cAAc;AAC1E;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,kBAAkB,gDAAgD,SAAS,cAAc;AACzF;AACA;AACA;AACA,qBAAqB;AACrB,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG;AAClG;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;AACD;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;;AAED;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK,wBAAwB,cAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;;AAED;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK,wBAAwB,cAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,cAAc;AACtD;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,0CAA0C,cAAc;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,cAAc;AACtE;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;;AAED;AACA;AACA;;AAEA;AACA,kCAAkC,8BAA8B;AAChE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;AACD;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,kBAAkB;AACzD;AACA;AACA;AACA,4CAA4C;AAC5C,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,oCAAoC,kBAAkB;AACtD;AACA;AACA;AACA;AACA;AACA,8DAA8D;AAC9D;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,kCAAkC,cAAc;AAChD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,8FAA8F,mCAAmC,IAAI,0DAA0D;AAC/L,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kCAAkC,cAAc;AAChD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF;AACvF,6CAA6C,cAAc;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iIAAiI;AACjI;AACA;AACA,qCAAqC,cAAc;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF;AAChF;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,YAAY;AACjB;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,sCAAsC,cAAc;AACpD;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;AACA,0CAA0C,cAAc;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uDAAC;AACnB;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC,eAAe;;AAEhB;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,0BAA0B,uBAAuB;AACjD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS,eAAe,cAAc;AACtC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4DAAC;AACvB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,4DAAC;AACzB;AACA,yCAAyC,WAAW,gBAAgB;AACpE;AACA,6CAA6C,aAAa;AAC1D;AACA,8CAA8C;AAC9C;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,yBAAyB;AACzB;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,qBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;AACA,+BAA+B,yDAAC;AAChC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,eAAe,wBAAwB;;AAExE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,2BAA2B;AAC3B;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA,kBAAkB,4DAAC;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,oCAAoC,cAAc;AAClD;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,qCAAqC,cAAc;AACnD;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA;AACA,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,4CAA4C,cAAc;AAC1D;AACA;AACA,4CAA4C,cAAc;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2CAA2C,cAAc;AACzD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,cAAc;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oHAAoH,mCAAmC;AACvJ;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA,oDAAoD,cAAc;AAClE;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,uDAAC;AACxB;AACA,2BAA2B,yDAAC;AAC5B;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA,sCAAsC;AACtC;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK,gCAAgC,iCAAiC;AACtE,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,2BAA2B;AAC5D;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,cAAc;AAC7D;AACA;AACA;AACA;AACA,kDAAkD,cAAc;AAChE;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,cAAc;AAC9D;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,oFAAoF;AACpF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,kCAAkC,cAAc;AAChD;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,kCAAkC,cAAc;AAChD;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,sCAAsC,cAAc,gDAAgD,cAAc;AAClH;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL,wCAAwC,cAAc,yCAAyC,cAAc;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA,6DAA6D,cAAc;AAC3E;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,yEAAyE;AACzE;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,mBAAmB,uDAAC;AACpB;AACA,uBAAuB,yDAAC;AACxB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,gGAAgG;AAChG;AACA,2FAA2F;AAC3F;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,0CAA0C,yDAAC;AAC3C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;;AAEA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,OAAO;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA,aAAa,iBAAiB,cAAc;AAC5C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,4CAA4C,cAAc;AAC1D;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,gCAAgC,oBAAoB;AACpD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,kBAAkB,EAAE;AACpB,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,WAAW,uDAAC;AACZ;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mCAAmC,mDAAmD;AACtF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE;AACrE,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,SAAS,4DAAC,CAAC,4DAAC,CAAC,4DAAC;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,kCAAkC,cAAc;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uDAAC;AACpB,uBAAuB,yDAAC;AACxB;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uDAAC;AACpB,uBAAuB,yDAAC;AACxB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uDAAC;AACpB,uBAAuB,yDAAC;AACxB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;AACrB;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,cAAc;AAC/E;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA,SAAS;AACT,KAAK;AACL,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,qBAAqB;AACrB;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,eAAe,yDAAC;AAChB;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD,oDAAoD;AACpD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,gCAAgC;AACrC;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS,iBAAiB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK,gCAAgC,gCAAgC;AACrE,CAAC;AACD;AACA;AACA;AACA,gFAAgF;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,mBAAmB,uDAAC;AACpB,uBAAuB,yDAAC;AACxB;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,yBAAyB;AAC1C;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL,CAAC,eAAe;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uDAAC;AACpB,uBAAuB,yDAAC;AACxB;AACA;AACA;AACA;AACA,mCAAmC,uDAAC;AACpC;AACA,uCAAuC,yDAAC;AACxC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iCAAiC;AACjC,6BAA6B;AAC7B,yBAAyB;;AAEzB;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,WAAW,uDAAC;AACZ,eAAe,yDAAC;AAChB;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,2BAA2B,uDAAC;AAC5B;AACA,+BAA+B,yDAAC;AAChC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,2BAA2B,uDAAC;AAC5B,+BAA+B,yDAAC;AAChC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,WAAW,uDAAC;AACZ,eAAe,yDAAC;AAChB;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA,4CAA4C,cAAc;AAC1D;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ,eAAe,yDAAC;AAChB;AACA;AACA;AACA,2BAA2B,uDAAC;AAC5B;AACA,+BAA+B,yDAAC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS,4CAA4C,0BAA0B;AAC/E;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,gCAAgC;AACzC;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uDAAC;AAChC;AACA,mCAAmC,yDAAC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;;AAErC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,gDAAgD,cAAc;AAC9D;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,yBAAyB;AACzB;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAoC,cAAc;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,oCAAoC;AAC9C;AACA;AACA;AACA;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;AACA,2BAA2B,uDAAC;AAC5B;AACA,+BAA+B,yDAAC;AAChC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA,6CAA6C;AAC7C,yCAAyC;AACzC,qCAAqC;AACrC,iCAAiC;;AAEjC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kDAAkD,cAAc;AAChE;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uDAAC;AAC5B;AACA,+BAA+B,yDAAC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA,yCAAyC,cAAc;AACvD;AACA;AACA,4EAA4E,cAAc;AAC1F;AACA;AACA;AACA;AACA,8DAA8D,cAAc;AAC5E;AACA;AACA,4EAA4E,cAAc;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,qCAAqC;AACrC,iCAAiC;;AAEjC;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,4CAA4C,cAAc;AAC1D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,2BAA2B,yDAAC;AAC5B;AACA;AACA;AACA;AACA;AACA,6BAA6B;;AAE7B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,kFAAkF,yDAAC;AACnF;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,sBAAsB,yDAAC;AACvB;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,8BAA8B,cAAc;AAC5C;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS,QAAQ;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,wBAAwB,kEAAC;AACzB,yBAAyB,sEAAC;AAC1B;AACA;AACA,2BAA2B,sEAAC;AAC5B;AACA;AACA;;AAEA,2BAA2B,sEAAC;AAC5B;AACA;;AAEA,2BAA2B,sEAAC;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,6BAA6B;AAC7B,yBAAyB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT,KAAK;AACL,2FAA2F,8FAAC;AAC5F;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,sEAAC,MAAM,oEAAC,MAAM,iEAAC,MAAM,2DAAC,MAAM,4DAAC,MAAM,yEAAC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,uEAAC;AAClB;AACA,SAAS,MAAM,uEAAC;AAChB;AACA,SAAS,MAAM,uEAAC;AAChB;AACA,SAAS,MAAM,uEAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,oCAAoC,cAAc;AAClD;AACA;AACA,KAAK;AACL;AACA,oCAAoC,cAAc;AAClD;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA;AACA,+BAA+B,uDAAC;AAChC,mCAAmC,yDAAC;AACpC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,cAAc;AACjC;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,sBAAsB;AACrD;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,WAAW,uDAAC;AACZ,iNAAiN,WAAW;AAC5N;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,mDAAmD;AACnD,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL,oEAAoE;AACpE;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,sCAAsC,sBAAsB;AAC5D,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA,yDAAyD;AACzD,kDAAkD,cAAc;AAChE;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB,cAAc;AACjC;AACA;AACA,kDAAkD,QAAQ;AAC1D;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,cAAc;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,4DAAC;AAC/C,aAAa;AACb;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;AACA,+BAA+B,uDAAC;AAChC;AACA,mCAAmC,yDAAC;AACpC;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,qCAAqC;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD,yEAAyE;AACzE,6CAA6C;AAC7C;AACA;AACA;AACA,6CAA6C;AAC7C,yCAAyC;AACzC;AACA,qCAAqC;AACrC;AACA;AACA,qCAAqC;AACrC;AACA,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,+BAA+B,uDAAC;AAChC;AACA,mCAAmC,yDAAC;AACpC;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,qCAAqC;;AAErC;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK,gCAAgC;AACrC,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,mBAAmB,uDAAC;AACpB;AACA,uBAAuB,yDAAC;AACxB;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;AACrB;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uDAAC;AAC5B;AACA,+BAA+B,yDAAC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uDAAC;AAChC,mCAAmC,yDAAC;AACpC;AACA;AACA;;AAEA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,uBAAuB,uDAAC;AACxB;AACA,2BAA2B,yDAAC;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,mBAAmB,uDAAC;AACpB;AACA,uBAAuB,yDAAC;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,uDAAC;AACxB;AACA,2BAA2B,yDAAC;AAC5B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,6BAA6B;;AAE7B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb;AACA,KAAK;AACL,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA,mCAAmC,uDAAC;AACpC;AACA,uCAAuC,yDAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C,yCAAyC;;AAEzC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iCAAiC;AACjC,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;AACrB;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL,sCAAsC,GAAG,uDAAC;AAC1C;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,6BAA6B;AAC7B;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA,mCAAmC,uDAAC;AACpC;AACA,uCAAuC,yDAAC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iCAAiC;AACjC,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;AACrB;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL,sCAAsC,GAAG,uDAAC;AAC1C;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC,iCAAiC;AACjC;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,6BAA6B;AAC7B;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,uBAAuB,uDAAC;AACxB;AACA,2BAA2B,yDAAC;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,cAAc;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,6BAA6B;;AAE7B;AACA;AACA;AACA;AACA,6BAA6B;;AAE7B;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,mBAAmB,uDAAC;AACpB,uBAAuB,yDAAC;AACxB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA,uBAAuB,uDAAC;AACxB,2BAA2B,yDAAC;AAC5B;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,cAAc;AACjF;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,+BAA+B;AAC/B;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,iEAAiE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,mBAAmB,uDAAC;AACpB;AACA,uBAAuB,yDAAC;AACxB;AACA;AACA;AACA,mCAAmC,uDAAC;AACpC;AACA,uCAAuC,yDAAC;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA,iCAAiC;AACjC,6BAA6B;AAC7B,yBAAyB;;AAEzB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,uDAAC;AACxB,2BAA2B,yDAAC;AAC5B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL,qCAAqC,sBAAsB;AAC3D;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,qCAAqC,sBAAsB;AAC3D;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL,kCAAkC,sBAAsB;AACxD;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,kDAAkD,sBAAsB;AACxE;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,KAAK;AACL;AACA,mCAAmC;AACnC;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,cAAc;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,cAAc;AAChE;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,+BAA+B,sBAAsB;AACrD;AACA;AACA;AACA,KAAK;AACL,+BAA+B,sBAAsB;AACrD;AACA;AACA;AACA,KAAK;AACL,+BAA+B,sBAAsB;AACrD;AACA;AACA;AACA,KAAK;AACL,+BAA+B,sBAAsB;AACrD;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,kDAAkD,sBAAsB;AACxE,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,0IAA0I,8BAA8B;AACxK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,+BAA+B,sBAAsB;AACrD;AACA;AACA,kDAAkD,eAAe,KAAK;AACtE,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,sBAAsB;AACzD;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL,+BAA+B,sBAAsB;AACrD;AACA,mCAAmC,sBAAsB;AACzD;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,6DAAC;AAC1C;AACA;AACA,aAAa;AACb,SAAS,0DAA0D;AACnE,KAAK;AACL;;AAEA,GAAG,qDAAC;;AAEyC;AAC7C;;;;;;;;;;;;;;ACjjfA;AAAA;AAAA;AAAA;AAAqC;AACqB;AACV;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,iBAAiB;AAChE;AACA;AACA,SAAS;AACT;AACA,qDAAqD,4BAA4B,EAAE;AACnF;AACA,aAAa;AACb;AACA;AACA,+DAA+D,sCAAsC,EAAE;AACvG;AACA,aAAa;AACb;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,uDAAS;AACxB,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,yDAAyD;AACxG;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,uBAAuB;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,wBAAwB,EAAE;AACpE;AACA;AACA,iDAAiD,wBAAwB,EAAE;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,wBAAwB,EAAE;AACpE;AACA;AACA,iDAAiD,wBAAwB,EAAE;AAC3E;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,uCAAuC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,oBAAoB;AACnE;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,6DAAS;AACrD;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAQ;AAC1B,qDAAQ;AACR;;;;;;;;;;;;;ACzpBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAqC;AACW;AAC6B;AAChB;AAChC;;AAE7B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC,0GAA0G,WAAW;AACrH;AACA;AACA,kDAAkD,aAAa,6BAA6B,YAAY,EAAE,cAAc,GAAG,eAAe;AAC1I;AACA;AACA;AACA,wBAAwB,2DAAY;AACpC;AACA;AACA,6BAA6B,4DAAa;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,iCAAiC,EAAE;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,sDAAQ;AAC7D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,GAAG;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,sDAAQ,gDAAgD,qBAAqB;AAC5G;AACA;AACA;AACA;AACA,mBAAmB,QAAQ,gBAAgB;AAC3C;AACA;AACA;AACA;AACA,iBAAiB,0BAA0B;AAC3C;AACA;AACA;AACA;AACA;AACA,6BAA6B,qBAAqB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kDAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,iCAAiC,EAAE;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,sBAAsB;AACxD,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,sDAAQ,CAAC,sDAAQ,GAAG,cAAc,aAAa,qCAAqC,EAAE;AACzG;AACA;AACA,KAAK;AACL;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,sDAAQ,CAAC,sDAAQ,GAAG,uBAAuB,uBAAuB;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,sDAAQ,CAAC,sDAAQ,GAAG,uBAAuB,aAAa,qCAAqC,EAAE;AAC9I;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sDAAQ,CAAC,sDAAQ,GAAG,cAAc,iCAAiC;AAC9E;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,sBAAsB;AACxD,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,iCAAiC,EAAE;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sDAAQ,mDAAmD,sBAAsB;AACjH;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,QAAQ,gBAAgB;AAC3C;AACA;AACA;AACA;AACA,iBAAiB,0BAA0B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,6DAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,4BAA4B,EAAE;AAC9D;AACA;AACA,aAAa;AACb,iCAAiC,yCAAyC,EAAE;AAC5E;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,sBAAsB,qDAAQ;;AAEG;AACjC;;;;;;;;;;;;;ACjzCA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA,+DAA+D;AAC/D;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iDAAiD,QAAQ;AACzD,wCAAwC,QAAQ;AAChD,wDAAwD,QAAQ;AAChE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4BAA4B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,uBAAuB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,4CAA4C,YAAY,EAAE;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,6CAA6C,yBAAyB;AACtE;AACA;AACA;AACA;;AAE4D;AAC5D;;;;;;;;;;;;;AC9RA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAiC;AACe;AACF;AAC+B;AACtC;AACF;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB,0GAA0G,WAAW;AACrH;AACA;AACA;AACA;AACA;AACA,yIAAyI,qBAAqB;AAC9J,wHAAwH,WAAW;AACnI;AACA;AACA,yBAAyB,WAAW;AACpC,iHAAiH,WAAW;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,2DAAY;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kCAAkC;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,sDAAQ;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,gBAAgB,EAAE;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,kDAAM,6CAA6C,QAAQ,uDAAS;AAC7G;AACA;AACA,mCAAmC,yDAAW;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB,EAAE,EAAE;AAC7B;AACA;AACA;AACA;AACA,yCAAyC,oDAAQ;AACjD;AACA;AACA;AACA,yCAAyC,oDAAQ;AACjD;AACA;AACA,yCAAyC,oDAAQ;AACjD;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kDAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,sDAAQ,CAAC,sDAAQ,GAAG,kBAAkB,8CAA8C;AAC9H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA,iCAAiC,sDAAQ,GAAG;AAC5C;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA,4CAA4C,sDAAQ,mDAAmD,sBAAsB;AAC7H;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,QAAQ,gBAAgB;AAC3D;AACA;AACA;AACA;AACA,iCAAiC,0BAA0B;AAC3D;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sDAAQ,mDAAmD,sBAAsB;AACjH;AACA;AACA;AACA;AACA,mBAAmB,QAAQ,gBAAgB;AAC3C;AACA;AACA;AACA;AACA,iBAAiB,0BAA0B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2FAA2F;AAC3F;AACA;AACA,4EAA4E;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,uDAAS;AACxB,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,uDAAS;AACxB,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,uDAAS;AACxB,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,4CAA4C,kBAAkB;AAC9D,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,kBAAkB;AAC9D,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sDAAQ,mDAAmD,sBAAsB;AACjH;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,QAAQ,gBAAgB;AAC3C;AACA;AACA;AACA;AACA,iBAAiB,0BAA0B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAQ,gCAAgC,6DAAS;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC9rDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAqC;AACJ;AACgB;AAC8C;AAC3C;AACJ;;AAEhD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC,6DAA6D,WAAW;AACxE,6DAA6D,WAAW;AACxE,mFAAmF,WAAW;AAC9F,gFAAgF,WAAW;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,eAAe;AAChG,oFAAoF,gBAAgB;AACpG,6FAA6F,kBAAkB;AAC/G;AACA;AACA,wBAAwB,2DAAY;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uDAAM;AAC9B,yBAAyB,yDAAQ;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,2EAAoB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,gBAAgB;AACpE;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,0BAA0B,0BAA0B;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0CAA0C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,4BAA4B,EAAE;AAC/D;AACA,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,mDAAmD;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,wBAAwB,EAAE;AACrD,8BAA8B,uBAAuB,EAAE;AACvD,2BAA2B,qCAAqC,EAAE,eAAe,qCAAqC,EAAE;AACxH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,iBAAiB,4DAAc;AAC/B;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA,KAAK,EAAE,EAAE;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4DAAc;AAC9B;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,4DAAc;AAClC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,4DAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,4BAA4B,EAAE,eAAe,4BAA4B,EAAE;AAChI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,sCAAsC,EAAE;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,wDAAwD,EAAE;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gBAAgB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,oCAAoC,sDAAQ,GAAG;AAC/C;AACA;AACA,+DAA+D,gBAAgB;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,kBAAkB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sDAAQ,GAAG;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,yCAAyC,EAAE;AAClH;AACA;AACA;AACA,iFAAiF,oDAAoD,EAAE;AACvI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,yBAAyB,EAAE;AACvD,4BAA4B,+BAA+B,EAAE;AAC7D,4BAA4B,gCAAgC,EAAE;AAC9D;AACA;AACA;AACA;AACA,6CAA6C,yBAAyB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gFAAyB;AACrC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,6DAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,oBAAoB,qDAAQ;;AAEG;AAC/B;;;;;;;;;;;;;ACz6CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAqC;AACJ;AACwB;AAC4B;AACjC;AACJ;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,yBAAyB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6CAA6C;AACrD;AACA,oDAAoD,oCAAoC;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA,iGAAiG,sBAAsB;AACvH,oGAAoG,sBAAsB;AAC1H,kGAAkG,sBAAsB;AACxH,2GAA2G,sBAAsB;AACjI;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA,8EAA8E,uBAAuB;AACrG;AACA,2BAA2B,sBAAsB;AACjD,uGAAuG,YAAY;AACnH;AACA,wBAAwB,2DAAY;AACpC;AACA;AACA,wBAAwB,4DAAa;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,wBAAwB;AACzF;AACA;AACA,uCAAuC,+BAA+B;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,8BAA8B,WAAW,wBAAwB;AACnF;AACA,kBAAkB,4BAA4B,WAAW,oBAAoB;AAC7E;AACA,kBAAkB,6BAA6B;AAC/C;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,+CAA+C,qDAAqD;AACpG;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,mBAAmB,EAAE;AACzE;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,mCAAmC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C,uDAAuD;AACvD;AACA;AACA;AACA,QAAQ,0HAA0H;AAClI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,yDAAQ;AAChD;AACA;AACA,wCAAwC,yDAAQ;AAChD;AACA;AACA,wCAAwC,yDAAQ;AAChD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,kBAAkB,qCAAqC;AACvD,QAAQ,qCAAqC;AAC7C,QAAQ,oCAAoC;AAC5C;AACA;AACA,eAAe,uDAAS;AACxB;AACA;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA,gDAAgD,QAAQ,uDAAS;AACjE,mCAAmC,yDAAW;AAC9C;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB,EAAE,EAAE;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,uDAAS;AACxB,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B,WAAW;AACrC,0BAA0B,WAAW;AACrC,uBAAuB,sDAAQ,CAAC,sDAAQ,GAAG;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,iBAAiB,OAAO,oBAAoB;AAC1F;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,uDAAuD;AACvD,iCAAiC;AACjC;AACA;AACA;AACA,sCAAsC,iCAAiC;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,gCAAgC;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA,6BAA6B;AAC7B;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,uDAAS;AACxB;AACA;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA,6BAA6B;AAC7B;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,uDAAS;AACxB;AACA;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA,6BAA6B;AAC7B;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA,uBAAuB,4DAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,6EAAsB;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,6DAAS;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uDAAM;AAC/B;AACA;AACA,0BAA0B,yDAAQ;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,qDAAQ;;AAEG;AAChC;;;;;;;;;;;;;AC3oCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAqC;AACqC;AAC3B;AACC;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAI,uDAAS;AACb;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,4DAAa;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F;AAC/F;AACA;AACA;AACA,6CAA6C;AAC7C;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8BAA8B;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,+BAA+B,kBAAkB;AACjD;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA,mCAAmC;AACnC;AACA,aAAa,2DAA2D;AACxE;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,6BAA6B,EAAE;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,mBAAmB;AAC/D;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,gBAAgB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,gBAAgB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mCAAmC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA,4CAA4C,uCAAuC,EAAE;AACrF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,8CAA8C,EAAE;AAChD;AACA;AACA;AACA;AACA,kCAAkC,mDAAmD;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,2BAA2B;AAC3D;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,oBAAoB,EAAE;AACvF;AACA;AACA,eAAe,uDAAS;AACxB;AACA;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,4DAAc;AACtE;AACA;AACA;AACA;AACA,wDAAwD,4DAAc;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,qDAAQ,mBAAmB,qDAAQ;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA,gEAAgE,iBAAiB;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,yBAAyB,EAAE;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,0CAA0C,EAAE,eAAe,0CAA0C,EAAE;AAC5J;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,6DAAS;AACrD;AACA;AACA;AACA;AACA,gBAAgB,qDAAQ;;AAEG;AAC3B;;;;;;;;;;;;;ACtlGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAkC;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,oBAAoB,eAAe;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,8BAA8B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC,oCAAoC;AACpC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,EAAE;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,iBAAiB,MAAM,IAAI;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,EAAE;AACd;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,aAAa,WAAW;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,yBAAyB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,4DAA4D,gBAAgB;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,yBAAyB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,SAAS;AACjD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,2BAA2B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,uBAAuB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,0CAA0C;AAC9E,mCAAmC,wCAAwC;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEutB;AACvtB;;;;;;;;;;;;;;AC7tDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,8EAA8E;AACvG;AACA;;AAEA;AACA;AACA,mBAAmB,sBAAsB;AACzC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;;AAEA;;AAEA,wBAAwB;AACxB,eAAe;AACf,gBAAgB,kBAAkB,wEAAwE;AAC1G,gBAAgB,eAAe,qEAAqE;AACpG,eAAe,kBAAkB,sDAAsD;AACvF,gBAAgB,+EAA+E;AAC/F;AACA,sBAAsB,wCAAwC;AAC9D,sBAAsB;AACtB,kBAAkB;AAClB;AACA,wBAAwB,+CAA+C,qCAAqC,sBAAsB;AAClI,CAAC,qBAAqB,8BAA8B,GAAG;AACvD,qBAAqB,8GAA8G,iCAAiC;AACpK,mBAAmB,kDAAkD,qBAAqB,mBAAmB,4BAA4B,yBAAyB,GAAG;AACrK;AACA,kBAAkB,eAAe,EAAE,2BAA2B,mBAAmB,qBAAqB,6BAA6B;AACnI,cAAc,iBAAiB,iBAAiB;AAChD;AACA;AACA,8BAA8B;AAC9B;AACA,CAAC;AACD,6BAA6B;AAC7B,UAAU,eAAe;AACzB,yBAAyB;AACzB,oDAAoD,mDAAmD,EAAE,oBAAoB;AAC7H,yEAAyE,gBAAgB,cAAc;AACvG;AACA,iBAAiB,WAAW,EAAE,qDAAqD,uCAAuC,EAAE,uBAAuB,2EAA2E,OAAO;AACrO,oCAAoC;AACpC,gBAAgB;AAChB;AACA,8EAA8E,OAAO;AACrF;AACA;AACA;AACA;AACA;AACA,CAAC,kEAAkE;AACnE,gBAAgB,oDAAoD;AACpE,gBAAgB,kBAAkB;AAClC,iCAAiC,OAAO;AACxC;AACA;AACA,CAAC,WAAW;AACZ,gBAAgB,8BAA8B;AAC9C,+CAA+C,iBAAiB,EAAE,iBAAiB,oDAAoD;AACvI,kBAAkB,2BAA2B;AAC7C,mBAAmB,mCAAmC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B;AAC1B,gBAAgB,YAAY;AAC5B,gBAAgB,UAAU;AAC1B;AACA,mBAAmB,UAAU,gBAAgB,sBAAsB;AACnE;AACA;AACA;AACA,mBAAmB,eAAe;AAClC;AACA,CAAC;AACD,gBAAgB,YAAY,UAAU;AACtC;AACA,mBAAmB,YAAY,wEAAwE;AACvG;AACA,eAAe,oBAAoB,oCAAoC;AACvE;AACA;AACA,mCAAmC,WAAW;AAC9C,yBAAyB,QAAQ,WAAW;AAC5C,yCAAyC;AACzC,uCAAuC,QAAQ,WAAW;AAC1D,uCAAuC;AACvC,gDAAgD,EAAE;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,CAAC,eAAe,EAAE,EAAE;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE;AACtE,cAAc,yCAAyC,cAAc,mBAAmB,QAAQ,EAAE,EAAE,EAAE;AACtG;AACA;AACA,WAAW,EAAE,UAAU,EAAE;AACzB,kBAAkB,eAAe,0BAA0B,4BAA4B;AACvF,6BAA6B,4BAA4B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,6BAA6B,kBAAkB,gBAAgB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB;AACA,4BAA4B,mBAAmB,mBAAmB,cAAc,eAAe,oBAAoB,aAAa,iBAAiB,sBAAsB;AACvK,gBAAgB,UAAU,mBAAmB,gBAAgB,cAAc,aAAa;AACxF,gBAAgB,cAAc,aAAa,YAAY;AACvD,6CAA6C,sBAAsB,eAAe,qCAAqC,wBAAwB,iGAAiG,UAAU;AAC1P,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA,CAAC;AACD,yBAAyB,gBAAgB,cAAc;AACvD;AACA;AACA;AACA,CAAC,WAAW;AACZ;AACA,4BAA4B;AAC5B,6BAA6B;AAC7B,mBAAmB,cAAc;AACjC;AACA;AACA,CAAC,WAAW,oFAAoF;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC,qCAAqC,EAAE,iBAAiB,kCAAkC;AAC7I,aAAa,GAAG,UAAU;AAC1B,4BAA4B;AAC5B,mBAAmB,cAAc;AACjC;AACA;AACA,CAAC,WAAW,oFAAoF;AAChG,4BAA4B;AAC5B,mBAAmB,cAAc;AACjC;AACA;AACA,wWAAwW;AACxW,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,gBAAgB,2CAA2C;AAC3D,mBAAmB,uCAAuC,cAAc,qBAAqB;AAC7F,mBAAmB;AACnB,cAAc;AACd;AACA;AACA;AACA,kCAAkC,cAAc;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8BAA8B;AAC/B,gBAAgB,WAAW,mCAAmC;AAC9D;AACA,gBAAgB;AAChB,aAAa,iCAAiC,yBAAyB,EAAE,EAAE,cAAc;AACzF,cAAc,cAAc,uBAAuB,eAAe,eAAe;AACjF;AACA;AACA;AACA,4CAA4C,sBAAsB;AAClE,+CAA+C,sBAAsB;AACrE,gCAAgC,mBAAmB;AACnD,gBAAgB,GAAG;AACnB,kBAAkB,YAAY,qBAAqB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,QAAQ;AACT,8BAA8B,QAAQ;AACtC;AACA;AACA,KAAK,aAAa,0BAA0B,0BAA0B;AACtE,eAAe,cAAc;AAC7B,iDAAiD,UAAU;AAC3D,mBAAmB,kBAAkB;AACrC;AACA;AACA,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA,CAAC,eAAe;AAChB,8BAA8B,2CAA2C;AACzE,8BAA8B,2CAA2C;AACzE,yBAAyB,sBAAsB;AAC/C,cAAc,gBAAgB,wBAAwB,cAAc;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,iCAAiC;AAClC;AACA,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO,oFAAoF,UAAU;AAC9I;AACA,CAAC,iBAAiB,eAAe,EAAE,gBAAgB,WAAW,EAAE;AAChE,oCAAoC,kBAAkB,aAAa,uCAAuC,YAAY;AACtH,eAAe,sBAAsB,sEAAsE,UAAU;AACrH,eAAe,oCAAoC;AACnD,oCAAoC,YAAY,YAAY,kBAAkB;AAC9E,kCAAkC,oCAAoC;AACtE,gBAAgB,2BAA2B,SAAS,EAAE,KAAK;AAC3D,mBAAmB,YAAY,uBAAuB,cAAc;AACpE;AACA,eAAe,mCAAmC,mBAAmB,YAAY,GAAG;AACpF;AACA,eAAe,YAAY,UAAU;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,SAAS;AACV,mBAAmB,cAAc,iBAAiB,iBAAiB,2BAA2B,cAAc;AAC5G;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,CAAC;AACD,uBAAuB,cAAc,sEAAsE;AAC3G,gBAAgB,WAAW,4CAA4C;AACvE,mBAAmB,mBAAmB,UAAU,eAAe;AAC/D,sBAAsB;AACtB;AACA;AACA;AACA;AACA,6CAA6C,8DAA8D;AAC3G,gBAAgB,uBAAuB,YAAY,0BAA0B,EAAE,OAAO,aAAa,YAAY,oBAAoB;AACnI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,oBAAoB,iCAAiC;AACxF,kCAAkC,+BAA+B,+EAA+E;AAChJ;AACA,CAAC;AACD,eAAe,cAAc,YAAY,aAAa;AACtD;AACA;AACA,yBAAyB,2DAA2D,gBAAgB,cAAc;AAClH;AACA;AACA;AACA;AACA,CAAC;AACD,gBAAgB,0BAA0B,mCAAmC,EAAE,KAAK,UAAU;AAC9F,6BAA6B,kBAAkB,UAAU;AACzD,uCAAuC,yDAAyD;AAChG,eAAe,aAAa;AAC5B,+BAA+B,qBAAqB;AACpD;AACA;AACA,yCAAyC,cAAc;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,kFAAkF,EAAE,EAAE;AAChG,kCAAkC,qBAAqB,8FAA8F,EAAE,EAAE;AACzJ,wBAAwB,qBAAqB,qEAAqE,EAAE,EAAE;AACtH,mBAAmB,qBAAqB,wBAAwB,EAAE,EAAE;AACpE,iCAAiC;AACjC,mBAAmB;AACnB,aAAa;AACb,gBAAgB;AAChB;AACA;AACA,mBAAmB,cAAc;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,cAAc;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,eAAe,yBAAyB;AACxC,gBAAgB,uCAAuC;AACvD;AACA,eAAe,cAAc,+BAA+B;AAC5D,gBAAgB,8BAA8B;AAC9C;AACA,eAAe,cAAc,+BAA+B;AAC5D,gBAAgB,gCAAgC;AAChD;AACA,kBAAkB;AAClB,8DAA8D,kCAAkC,KAAK,EAAE,KAAK;AAC5G,UAAU;AACV,UAAU;AACV,eAAe;AACf;AACA,gBAAgB,OAAO,2BAA2B,EAAE,UAAU;AAC9D,eAAe;AACf,SAAS;AACT,eAAe,mBAAmB;AAClC;AACA,eAAe,mBAAmB;AAClC;AACA;AACA,eAAe;AACf;AACA;AACA,wBAAwB,YAAY,YAAY,YAAY,iBAAiB,sBAAsB,aAAa,uBAAuB,oBAAoB,eAAe,aAAa,qEAAqE,aAAa,eAAe,YAAY,wBAAwB,aAAa,aAAa,YAAY,eAAe,wCAAwC;AACzZ,sBAAsB;AACtB;AACA,6BAA6B,YAAY;AACzC,sBAAsB,SAAS,gBAAgB,SAAS,UAAU,aAAa;AAC/E,mBAAmB,WAAW,MAAM,cAAc,sBAAsB,uCAAuC,iBAAiB,SAAS,iCAAiC,iDAAiD,wCAAwC,wBAAwB,6JAA6J,MAAM,kCAAkC;AAChe,qBAAqB,cAAc,gBAAgB,qCAAqC;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA,sBAAsB,iBAAiB,wBAAwB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,qDAAqD,gBAAgB,0OAA0O;AAChT,oBAAoB;AACpB;AACA;AACA,CAAC;AACD,mBAAmB,qCAAqC;AACxD,cAAc,+BAA+B;AAC7C,cAAc,QAAQ;AACtB,cAAc,oBAAoB,aAAa,UAAU;AACzD,wBAAwB,aAAa,SAAS;AAC9C,eAAe,iBAAiB,YAAY;AAC5C,mBAAmB;AACnB,2CAA2C,wBAAwB;AACnE,gBAAgB,0CAA0C;AAC1D,oBAAoB,eAAe,aAAa,4HAA4H;AAC5K,gBAAgB,iCAAiC;AACjD,eAAe,OAAO,aAAa,0CAA0C,YAAY,SAAS,SAAS,iDAAiD;AAC5J;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,cAAc;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA,gBAAgB;AAChB,iBAAiB;AACjB,uBAAuB;AACvB,yCAAyC,OAAO;AAChD;AACA;AACA,CAAC,QAAQ,OAAO;AAChB,kBAAkB,cAAc;AAChC,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA,CAAC;AACD,kBAAkB,aAAa,aAAa,YAAY,0BAA0B;AAClF;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA,8BAA8B,cAAc;AAC5C;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,mBAAmB,UAAU,wBAAwB,mBAAmB;AACxE,8BAA8B,UAAU;AACxC,mBAAmB,UAAU,wBAAwB;AACrD,gBAAgB;AAChB,0BAA0B,gBAAgB;AAC1C;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA,CAAC;AACD,yBAAyB,qCAAqC;AAC9D,yBAAyB,4CAA4C,eAAe;AACpF,6BAA6B,8BAA8B,cAAc;AACzE;AACA;AACA,CAAC;AACD,kBAAkB,mDAAmD;AACrE;AACA,mBAAmB;AACnB;AACA,mBAAmB,cAAc;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,kBAAkB,+BAA+B,eAAe,sBAAsB,aAAa;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gRAAgR;AAChR,oCAAoC,wBAAwB,iCAAiC,gBAAgB;AAC7G,4HAA4H,EAAE,8DAA8D;AAC5L,iGAAiG,2CAA2C,wCAAwC,mBAAmB;AACvM,eAAe,iBAAiB;AAChC,sBAAsB,yBAAyB,sCAAsC;AACrF,sBAAsB,yBAAyB;AAC/C,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,sBAAsB,wFAAwF;AAC9G,qBAAqB,eAAe;AACpC,gBAAgB,uIAAuI,UAAU;AACjK,gBAAgB,iDAAiD;AACjE,yBAAyB,6BAA6B,eAAe,eAAe,eAAe,gBAAgB,UAAU;AAC7H,mBAAmB,mFAAmF;AACtG,sBAAsB,uGAAuG,EAAE,wBAAwB;AACvJ,gBAAgB,qBAAqB,iEAAiE;AACtG;AACA,kBAAkB,wBAAwB,oBAAoB,cAAc;AAC5E,eAAe,+DAA+D,qDAAqD,EAAE,GAAG;AACxI;AACA,yBAAyB,SAAS,eAAe,gBAAgB,uBAAuB,4BAA4B,WAAW,aAAa,aAAa;AACzJ,mBAAmB,MAAM,aAAa,oIAAoI;AAC1K,mBAAmB,MAAM,aAAa,oBAAoB;AAC1D,6BAA6B,SAAS,iCAAiC,qBAAqB,uBAAuB,EAAE,QAAQ,EAAE,QAAQ;AACvI,mBAAmB,SAAS,wDAAwD,cAAc;AAClG,6BAA6B,cAAc;AAC3C,qBAAqB,UAAU;AAC/B,oBAAoB,SAAS,YAAY;AACzC;AACA;AACA;AACA,mBAAmB,cAAc;AACjC;AACA,CAAC,UAAU;AACX,yBAAyB,SAAS,eAAe,gBAAgB,iDAAiD,oBAAoB,aAAa,aAAa;AAChK,yBAAyB;AACzB,aAAa,eAAe,wCAAwC;AACpE,sBAAsB,UAAU,wEAAwE;AACxG,0BAA0B;AAC1B,kBAAkB;AAClB,cAAc,wCAAwC,cAAc;AACpE;AACA;AACA,mBAAmB,cAAc;AACjC;AACA;AACA;AACA;AACA,CAAC,6BAA6B;AAC9B,kBAAkB,eAAe,8BAA8B,UAAU;AACzE,mBAAmB,8DAA8D,yBAAyB,yCAAyC,EAAE,MAAM,SAAS;AACpK,mBAAmB,YAAY,YAAY;AAC3C,gBAAgB,kBAAkB,+NAA+N,yBAAyB,eAAe,kCAAkC,eAAe,aAAa;AACvW;AACA,gBAAgB,8CAA8C;AAC9D,gBAAgB,qCAAqC;AACrD,mBAAmB,+CAA+C;AAClE,mBAAmB,4BAA4B;AAC/C,mBAAmB,mEAAmE;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,UAAU;AAC9E;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,UAAU;AAC3E;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,uCAAuC,oCAAoC;AAC3E,mCAAmC,gCAAgC;AACnE,eAAe,iBAAiB;AAChC,sBAAsB,iBAAiB;AACvC,2BAA2B,WAAW,qBAAqB,6CAA6C,EAAE;AAC1G;AACA;AACA;AACA,CAAC;AACD,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,sBAAsB,EAAE;AACxB;AACA;AACA;AACA,UAAU;AACV,4BAA4B;AAC5B;AACA;AACA,WAAW,EAAE;AACb;AACA,eAAe,cAAc,sBAAsB,oBAAoB,aAAa,wBAAwB,aAAa,YAAY,aAAa,wCAAwC,YAAY,eAAe,aAAa,sBAAsB;AACxP;AACA;AACA;AACA;AACA;AACA,2FAA2F;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,aAAa,EAAE;AAC/C;AACA;AACA;AACA,yFAAyF;AACzF,+BAA+B,+BAA+B,EAAE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8EAA8E;AAC9F,gBAAgB,0CAA0C;AAC1D,oBAAoB,2JAA2J;AAC/K,mBAAmB,UAAU,0CAA0C,SAAS,SAAS,OAAO,OAAO;AACvG,gBAAgB,0EAA0E;AAC1F,wBAAwB,qKAAqK;AAC7L,mBAAmB,6FAA6F,kBAAkB;AAClI,oBAAoB,+DAA+D;AACnF,oBAAoB,UAAU;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,CAAC;AACD,gBAAgB,sCAAsC,0CAA0C;AAChG,eAAe,iCAAiC;AAChD,mBAAmB;AACnB;AACA;AACA;AACA;AACA,CAAC;AACD,mBAAmB;AACnB;AACA;AACA;AACA;AACA,CAAC;AACD,qBAAqB;AACrB;AACA;AACA;AACA,CAAC;AACD,oBAAoB,eAAe;AACnC,oBAAoB,6DAA6D;AACjF,gBAAgB,YAAY,wBAAwB,QAAQ,UAAU,QAAQ,aAAa,EAAE,EAAE,UAAU;AACzG,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA,CAAC,qGAAqG;AACtG,sBAAsB,2EAA2E;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,OAAO;AACR,gBAAgB,0CAA0C;AAC1D,gBAAgB,OAAO,0CAA0C,OAAO,cAAc,qEAAqE;AAC3J,mBAAmB,6BAA6B,mBAAmB;AACnE,gBAAgB,oDAAoD;AACpE,mBAAmB;AACnB,cAAc;AACd,qCAAqC;AACrC,cAAc,oCAAoC,OAAO,WAAW;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,mBAAmB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO,yBAAyB,gBAAgB,kBAAkB,gBAAgB,kBAAkB,UAAU,+BAA+B,+BAA+B,6BAA6B,8BAA8B,mBAAmB,6EAA6E,YAAY,aAAa;AACnX,mBAAmB,aAAa,mBAAmB,YAAY,EAAE,EAAE;AACnE,sBAAsB,6BAA6B,wCAAwC,8BAA8B;AACzH;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sBAAsB,SAAS,UAAU;AAC1C,gBAAgB,+CAA+C;AAC/D,gBAAgB;AAChB,cAAc,OAAO,iCAAiC,OAAO,WAAW;AACxE,oBAAoB,eAAe,UAAU;AAC7C;AACA;AACA;AACA,CAAC;AACD,oBAAoB,4LAA4L;AAChN,gBAAgB,kDAAkD;AAClE,gBAAgB,iCAAiC,+BAA+B,WAAW,iBAAiB,oBAAoB,kBAAkB,6BAA6B,kBAAkB,UAAU,yBAAyB,+BAA+B,4BAA4B,aAAa,UAAU,SAAS,gBAAgB,YAAY,UAAU,UAAU;AAC/W,oBAAoB,8DAA8D;AAClF,gBAAgB,kDAAkD;AAClE,mBAAmB,cAAc;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,mBAAmB,iDAAiD,iBAAiB,cAAc;AACnG,kBAAkB,6BAA6B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,SAAS,kBAAkB,OAAO,OAAO;AAClD,qBAAqB,8GAA8G;AACnI,gBAAgB,SAAS,UAAU;AACnC;AACA;AACA;AACA,CAAC;AACD,sBAAsB,eAAe;AACrC;AACA;AACA;AACA;AACA,CAAC,iCAAiC,YAAY,EAAE,EAAE,SAAS,UAAU,sBAAsB,mBAAmB,UAAU,UAAU;AAClI,mBAAmB;AACnB,uEAAuE,iBAAiB,WAAW,UAAU;AAC7G,eAAe;AACf;AACA,oBAAoB;AACpB,oBAAoB;AACpB,oBAAoB;AACpB,oBAAoB;AACpB,oBAAoB;AACpB,eAAe;AACf,gEAAgE;AAChE,kCAAkC,oBAAoB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA,6FAA6F,oCAAoC;AACjI;AACA;AACA,mGAAmG,oDAAoD;AACvJ,mEAAmE,qCAAqC;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,6CAA6C;AACzF,+CAA+C,gDAAgD;AAC/F,oBAAoB,mBAAmB,2BAA2B,kDAAkD,MAAM,UAAU,eAAe,WAAW,yBAAyB,OAAO;AAC9L,uBAAuB,YAAY;AACnC,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,oBAAoB,qDAAqD;AACzE,mBAAmB,iBAAiB,eAAe,YAAY,eAAe,kBAAkB;AAChG,gBAAgB,eAAe,kBAAkB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA,eAAe,eAAe,iBAAiB;AAC/C;AACA,eAAe,YAAY;AAC3B;AACA,8BAA8B,2BAA2B;AACzD,+BAA+B,iCAAiC;AAChE,+BAA+B,iCAAiC;AAChE,8BAA8B,2BAA2B,GAAG;;AAE5D;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,eAAe;AAC5D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe,kEAAG,EAAC;AAC2D;AAC9E;;;;;;;;;;;;;;ACl3CY;;AAEZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kCAAkC,SAAS;AAC3C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0CAA0C,UAAU;AACpD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ,aAAa,mBAAO,CAAC,oDAAW;AAChC,cAAc,mBAAO,CAAC,gDAAS;AAC/B,cAAc,mBAAO,CAAC,gDAAS;;AAE/B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB,mDAAmD;AACxE;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,UAAU;AAC7B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,YAAY;AAC7B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,uCAAuC,SAAS;AAChD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD,EAAE;AAClD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB,eAAe;AACvC;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,wBAAwB,QAAQ;AAChC;AACA,qBAAqB,eAAe;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,YAAY;AAC7B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,mBAAmB,cAAc;AACjC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB;AAClB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,qBAAqB,QAAQ;AAC7B;AACA;AACA,GAAG;AACH;AACA,eAAe,SAAS;AACxB;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,YAAY;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,gBAAgB;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,YAAY;AAC7B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;;AC5vDa;;AAEb,sBAAsB,mBAAO,CAAC,kEAAkB;;AAEhD;AACA;AACA;AACA;AACA;;AAEA,2CAA2C,IAAI;;AAE/C;AACA;AACA,4BAA4B,UAAU;AACtC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA,SAAS,OAAO;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;;;;;;;;;;;;AC1Ga;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA;;AAEA;AACA,4CAA4C,qBAAqB;AACjE;;AAEA;AACA,KAAK;AACL,IAAI;AACJ;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,qBAAqB,iBAAiB;AACtC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,qBAAqB;AACzC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,8BAA8B;;AAE9B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,CAAC;;;AAGD;AACA;AACA;AACA,qDAAqD,cAAc;AACnE;AACA,C;;;;;;;;;;;;AC7FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,sBAAsB;AACvC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA,cAAc;AACd;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,iCAAiC,QAAQ;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,OAAO;AACP;AACA,sCAAsC,QAAQ;AAC9C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;;AAEA;AACA,QAAQ,yBAAyB;AACjC;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,GAAG;AACH;;;;;;;;;;;;;AC3dA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAqC;AACG;AAChB;AACI;AACC;AACA;AACA;AACF;AACI;AACF;AACI;;AAEjC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAQ;;AAER;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0aAA0a,gCAAgC,qDAAqD,8BAA8B,qDAAqD,8BAA8B;AAChnB,qDAAQ;AACR;;;;;;;;;;;;;ACtDa;;AAEb,cAAc,mBAAO,CAAC,kDAAU;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,mBAAmB,iBAAiB;AACpC;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACtGA;AACA,EAAE,KAA4D;AAC9D,EAAE,SACmD;AACrD,CAAC,2BAA2B;;AAE5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,gDAAgD,cAAc;;AAE9D,CAAC;;;;;;;;;;;;AC3TD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,QAAQ,WAAW;;AAEnB;AACA;AACA;AACA,QAAQ,WAAW;;AAEnB;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA,QAAQ,WAAW;;AAEnB;AACA;AACA,QAAQ,UAAU;;AAElB;AACA;;;;;;;;;;;;ACnFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtBA,iBAAiB;;AAEjB;AACA;AACA;;;;;;;;;;;;;ACJA;AACa;;AAEb,iBAAiB,mBAAO,CAAC,mDAAI,K;;;;;;;;;;;;ACH7B;AACa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,8F;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;AC9Ca;;AAEb;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;ACjBA,YAAY,mBAAO,CAAC,wDAAO;AAC3B,eAAe,mBAAO,CAAC,8DAAU;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACXA;AACa;;AAEb,kBAAkB,mBAAO,CAAC,yDAAQ;;AAElC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oC;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,gDAAgD;AAChD;AACA,OAAO;AACP;AACA;AACA;AACA,2DAA2D;AAC3D;AACA,K;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;;;;;;;;;;;;AClEA;AACa;AACb;AACA;AACA;AACA;AACA,eAAe,mBAAO,CAAC,iEAAc;AACrC,eAAe,mBAAO,CAAC,mEAAe;AACtC,eAAe,mBAAO,CAAC,mEAAe;AACtC,YAAY,mBAAO,CAAC,6DAAY;;AAEhC;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,6E;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;;;;;;;;;;;;;ACjFA;AACa;;AAEb;AACA;AACA;AACA,iBAAiB,mBAAO,CAAC,0EAAmB;AAC5C,gBAAgB,mBAAO,CAAC,kEAAW;AACnC,eAAe,mBAAO,CAAC,oEAAgB;;AAEvC;AACA;AACA;AACA;AACA;AACA,mBAAmB,mBAAO,CAAC,0FAA2B;AACtD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,kBAAkB,4BAA4B,EAAE,OAAO,EAAE,4BAA4B;AACrF,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;AC1KA;AACa;;AAEb,eAAe,mBAAO,CAAC,oEAAgB;;AAEvC;AACA;AACA;;AAEA,qBAAqB;AACrB;AACA;;AAEA;AACA;AACA;AACA,gBAAgB,YAAY;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB,YAAY;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;;AAGA;AACA;AACA;AACA,aAAa,OAAO;AACpB,gBAAgB,YAAY;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB,gBAAgB,YAAY;AAC5B;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,KAAK;AAClB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,gBAAgB;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;;AChNA;AACA;AACA;AACA;AACA;;AAEa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH,kCAAkC;AAClC;AACA;AACA;;AAEA;AACA,EAAE;AACF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,gBAAgB,sBAAsB;AACtC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,oBAAoB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;ACzFA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA;AACA;;AAEA,+BAA+B;;AAE/B,8BAA8B;;AAE9B;AACA;AACA;;AAEA;AACA;AACA;;AAEA,4BAA4B;;AAE5B,4BAA4B;;AAE5B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,UAAU;;AAEzB,4BAA4B;;AAE5B,gCAAgC;;AAEhC;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;;;;;;;;;;;AChDA,+CAAa;;AAEb;AACA;AACA;AACA;AACA,oBAAoB;AACpB,CAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;;;;;;;;;;;;;AC3CA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;;AAErC;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;;;;;;;ACvLtC;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;;AAEA,IAAI,IAAqC;AACzC,6BAA6B,mBAAO,CAAC,yFAA4B;AACjE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,UAAU;AACrB;AACA;AACA;AACA,MAAM,IAAqC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4GAA4G;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAqC;AAC3C;AACA;AACA;;AAEA;;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,cAAc,mBAAO,CAAC,kDAAU;AAChC,aAAa,mBAAO,CAAC,4DAAe;;AAEpC,2BAA2B,mBAAO,CAAC,yFAA4B;AAC/D,qBAAqB,mBAAO,CAAC,qEAAkB;;AAE/C;AACA;;AAEA,IAAI,IAAqC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,0CAA0C;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,6BAA6B;AAC7B,QAAQ;AACR;AACA;AACA;AACA;AACA,+BAA+B,KAAK;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,4BAA4B;AAC5B,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,KAAqC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU,IAAqC;AAC/C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB,2BAA2B;AAChD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM,KAAqC,4FAA4F,SAAM;AAC7I;AACA;;AAEA,mBAAmB,gCAAgC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,gCAAgC;AACrD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;AC9kBA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAI,IAAqC;AACzC,gBAAgB,mBAAO,CAAC,kDAAU;;AAElC;AACA;AACA;AACA,mBAAmB,mBAAO,CAAC,uFAA2B;AACtD,CAAC,MAAM,EAIN;;;;;;;;;;;;;AClBD;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;;AAEA;;;;;;;;;;;;;ACXa;;AAEb;AACA;AACA,CAAC;AACD;;AAEA,oCAAoC,mBAAO,CAAC,4CAAO;;AAEnD,8CAA8C,mBAAO,CAAC,oEAAmB;;AAEzE,sCAAsC,uCAAuC,kBAAkB;;AAE/F,uBAAuB,2EAA2E,kCAAkC,mBAAmB,GAAG,EAAE,OAAO,kCAAkC,8HAA8H,GAAG,EAAE,qBAAqB;;AAE7V,0CAA0C,gCAAgC,oCAAoC,oDAAoD,8DAA8D,gEAAgE,EAAE,EAAE,gCAAgC,EAAE,aAAa;;AAEnV,gCAAgC,gBAAgB,sBAAsB,OAAO,uDAAuD,aAAa,+CAA+C,2CAA2C,EAAE,EAAE,EAAE,6CAA6C,2EAA2E,EAAE,OAAO,yCAAyC,kFAAkF,EAAE,EAAE,EAAE,EAAE,eAAe;;AAEpgB,qDAAqD,+BAA+B,8DAA8D,YAAY,oCAAoC,6DAA6D,YAAY,6BAA6B,OAAO,2BAA2B,0CAA0C,wEAAwE,2BAA2B,EAAE,EAAE,eAAe;;AAE1e,0DAA0D,+BAA+B,iBAAiB,sCAAsC,YAAY,YAAY,uBAAuB,OAAO,qBAAqB,0CAA0C,2BAA2B,EAAE,eAAe;;AAEjT,iDAAiD,0CAA0C,0DAA0D,EAAE;;AAEvJ,2CAA2C,gBAAgB,kBAAkB,OAAO,2BAA2B,wDAAwD,gCAAgC,uDAAuD,2DAA2D,EAAE;;AAE3T,6DAA6D,sEAAsE,8DAA8D,oBAAoB;;AAErN,iDAAiD,0EAA0E,aAAa,EAAE,qCAAqC;;AAE/K,6BAA6B,gGAAgG,gDAAgD,GAAG,2BAA2B;;AAE3M,uCAAuC,uBAAuB,uFAAuF,EAAE,aAAa;;AAEpK,0CAA0C,+DAA+D,2EAA2E,EAAE,yEAAyE,eAAe,sDAAsD,EAAE,EAAE,uDAAuD;;AAE/X,gCAAgC,4EAA4E,iBAAiB,UAAU,GAAG,8BAA8B;;AAExK,2CAA2C,kBAAkB,kCAAkC,qEAAqE,EAAE,EAAE,OAAO,kBAAkB,EAAE,YAAY;;AAE/M;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,uEAAuE,aAAa;AACpF;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,OAAO;;;AAGP;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,kEAAkE;AAClE;AACA,OAAO;AACP;AACA,GAAG;;AAEH;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA,CAAC,E;;;;;;;;;;;;AC7GY;;AAEb,eAAe,mBAAO,CAAC,4EAAa;AACpC;;AAEA;AACA,iC;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;;;AAIb,IAAI,IAAqC;AACzC;AACA;;AAEA,YAAY,mBAAO,CAAC,4CAAO;AAC3B,cAAc,mBAAO,CAAC,4DAAe;AACrC,gBAAgB,mBAAO,CAAC,oDAAW;AACnC,qBAAqB,mBAAO,CAAC,8EAA2B;AACxD,cAAc,mBAAO,CAAC,8DAAmB;;AAEzC,oFAAoF;AACpF;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,0FAA0F,aAAa;AACvG;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,8FAA8F,eAAe;AAC7G;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK,EAAE;;AAEP,iDAAiD;AACjD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;;AAEA,0BAA0B;AAC1B;AACA;;AAEA,qCAAqC;AACrC;;AAEA,mFAAmF;AACnF;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,gBAAgB;;AAEhB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,gBAAgB;AAC7B;AACA;AACA;AACA,OAAO;;;AAGP,uEAAuE;;AAEvE;AACA,8DAA8D;AAC9D;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA,OAAO;;;AAGP;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,uBAAuB;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,KAAK;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,KAAK;AAChB;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,mBAAmB,8BAA8B;AACjD;AACA;AACA,OAAO;;;AAGP;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;;AAE/B,iBAAiB;;AAEjB,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;;AAEA,mCAAmC,EAAE;;AAErC;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,6CAA6C;;AAE7C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,0BAA0B;AAC7C;AACA;AACA;AACA;;AAEA,+BAA+B;;AAE/B,qCAAqC;;AAErC,iCAAiC;AACjC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;;AAEA,eAAe;AACf;AACA;AACA;;AAEA,0BAA0B;AAC1B;AACA;;AAEA,gBAAgB;AAChB;AACA;AACA;;AAEA,2BAA2B;AAC3B;;AAEA,gBAAgB;AAChB;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;;;AAGA,oBAAoB;;AAEpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;;AAEH;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,GAAG;;;AAGH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG,EAAE;AACL;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC;AACjC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;AACA;AACA,yDAAyD;AACzD;;AAEA;AACA;AACA;;AAEA,iEAAiE;AACjE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA,mBAAmB,kBAAkB;AACrC;;AAEA;AACA;AACA,OAAO;AACP;AACA,8BAA8B;AAC9B;;;AAGA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;;AAGA,sCAAsC;AACtC;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,qBAAqB;AACrB;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAO;AACP,KAAK;;;AAGL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB,2BAA2B;AAC9C;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB,2BAA2B;AAC9C;AACA;AACA;;AAEA,oBAAoB,qBAAqB;AACzC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA,qBAAqB,sBAAsB;AAC3C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA,mBAAmB;AACnB;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;AAGA,4BAA4B;AAC5B;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,iCAAiC;;AAEjC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mCAAmC;;AAEnC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA,qCAAqC;AACrC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,OAAO;AAClB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,OAAO;AAClB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,8CAA8C;AAC9C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;;;AAGA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA;;AAEA;AACA;AACA;AACA;;AAEA,oEAAoE;;AAEpE;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;;;AAGP;AACA,KAAK;AACL;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO;AACP;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,YAAY,WAAW;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,WAAW,MAAM;AACjB;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,EAAE;AACb;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,eAAe;AAC3B;;AAEA;AACA;AACA;AACA,sEAAsE;;AAEtE;AACA;AACA,GAAG;AACH;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,4CAA4C;AAC5C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,GAAG;AACH;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,EAAE;AACd;AACA;;;AAGA;AACA;;AAEA,iBAAiB,oBAAoB;AACrC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,0CAA0C;AAC1C;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA;AACA,wDAAwD;;AAExD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;;AAEA;AACA;AACA;;AAEA,iBAAiB,yBAAyB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6CAA6C;AAC7C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,yBAAyB;AAC1C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,sCAAsC;;AAEtC,8BAA8B;AAC9B;;AAEA;AACA;AACA,uBAAuB;;AAEvB;AACA,sCAAsC;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,6DAA6D;;AAE7D;AACA;AACA,GAAG,EAAE;;AAEL;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,OAAO;AACP;;AAEA;AACA,yEAAyE;AACzE;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC;;AAEpC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oEAAoE;AACpE;AACA;;AAEA,mBAAmB,iCAAiC;AACpD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,4CAA4C;AAC9D;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iJAAiJ;;AAEjJ,kcAAkc;;AAElc;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,MAAM;AACN;AACA;AACA;AACA,kBAAkB,aAAa;AAC/B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,uBAAuB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,uBAAuB;AACxC;AACA;AACA,CAAC;;;AAGD;AACA;AACA,8FAA8F;;AAE9F;AACA;AACA,mDAAmD;AACnD;AACA;;AAEA;AACA;;AAEA;AACA;AACA,yDAAyD;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;AAGA,oDAAoD;AACpD;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;AAGA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,4CAA4C;AAC5C;;AAEA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,YAAY,OAAO;AACnB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,wBAAwB;AACxB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,8BAA8B;;AAE9B,4CAA4C;AAC5C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,OAAO;AAClB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU,iCAAiC;AAC3C;AACA;AACA;AACA,IAAI;AACJ;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,gCAAgC,KAAK;AAC3C;AACA;AACA,MAAM,gCAAgC,KAAK;AAC3C;AACA,4DAA4D;AAC5D,MAAM,gCAAgC,KAAK;AAC3C;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,4NAA4N;AAC5N;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4EAA4E,YAAY;AACxF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2HAA2H,6BAA6B;AACxJ;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kFAAkF;AAClF;;AAEA;AACA;;AAEA;AACA;AACA,OAAO,0CAA0C;;;AAGjD;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,+FAA+F;AAC/F;;AAEA;AACA;AACA;AACA,OAAO,0CAA0C;;;AAGjD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,6EAA6E;;AAE7E;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sJAAsJ,iBAAiB;AACvK,OAAO;AACP,sJAAsJ,iBAAiB,wDAAwD,mBAAmB,gBAAgB,8BAA8B;AAChS;;AAEA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA,KAAK;;;AAGL;AACA,oGAAoG,GAAG;;AAEvG;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,wEAAwE;AACxE;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA,iIAAiI,mBAAmB,gBAAgB,8BAA8B;AAClM,KAAK;AACL;AACA;AACA,IAAI;AACJ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;;AAGP;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK,qGAAqG,kCAAkC;AAC5I;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,0BAA0B;AAC3C;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,2BAA2B;AAC3B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,4DAA4D;AAC5D;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,+CAA+C;AAC/C;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB,4BAA4B;AACjD;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gDAAgD;AAChD;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gDAAgD;AAChD;;AAEA;AACA;;AAEA;AACA;AACA;AACA,gDAAgD;AAChD;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK,2EAA2E,qGAAqG,kCAAkC;AACvN;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK,qGAAqG;AAC1G;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kEAAkE;;AAElE,8FAA8F;AAC9F;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB,4BAA4B;AACjD;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gDAAgD;AAChD;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gDAAgD;AAChD;;AAEA;AACA;;AAEA;AACA;AACA,gDAAgD;AAChD;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,oBAAoB,wBAAwB;AAC5C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA,qCAAqC;AACrC;AACA,+EAA+E;AAC/E;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;;AAE9C;AACA,aAAa;;;AAGb;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,uBAAuB;AAClC,YAAY;AACZ;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uBAAuB;AAClC,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uBAAuB;AAClC,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,WAAW,WAAW;AACtB,YAAY;AACZ;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAO;;;AAGP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uBAAuB;AAClC,WAAW,OAAO;AAClB;;AAEA;AACA;AACA,6CAA6C;AAC7C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,8EAA8E;AAC9E;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA,0vBAA0vB;;AAE1vB;AACA;AACA;AACA,oCAAoC;;AAEpC,uDAAuD;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iCAAiC;;AAEjC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ,cAAc;AACtB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA,GAAG;;;AAGH;AACA,CAAC;AACD;AACA;;AAEA;AACA,4CAA4C;AAC5C;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,+CAA+C;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,+CAA+C;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW;AACX;AACA;AACA;;;AAGA,yEAAyE;AACzE;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA,yBAAyB,OAAO;AAChC;AACA;;AAEA;;AAEA,yBAAyB,OAAO;AAChC;AACA,GAAG;;;AAGH;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,uBAAuB,SAAS;AAChC;AACA;;AAEA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,qBAAqB;AACtC;AACA;;AAEA,8BAA8B,UAAU;AACxC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,UAAU;AACtB;;;AAGA;AACA,eAAe;AACf,eAAe;;AAEf;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;;AAEA;;AAEA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,OAAO;AAClB,WAAW,eAAe;AAC1B;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B;AAC5B;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uHAAuH;AACvH,yHAAyH;AACzH;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,YAAY,OAAO;AACnB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED,mCAAmC;;AAEnC;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA;;;AAGA,+EAA+E;AAC/E;AACA;;AAEA;AACA;AACA,uDAAuD;;AAEvD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA,CAAC;;;AAGD;AACA;AACA,YAAY,QAAQ;AACpB;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,mCAAmC;AACnC;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;;;AAGA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,0GAA0G;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,gFAAgF;AAChF;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA,oCAAoC;;AAEpC;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;AACA,iDAAiD;AACjD;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,sPAAsP;AACtP;;AAEA,wBAAwB;AACxB;AACA;AACA;;AAEA;AACA,6BAA6B;AAC7B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG,eAAe;AAClB;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,qCAAqC;AACrC;;AAEA,6CAA6C;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,yHAAyH;;AAEzH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,CAAC;;;AAGD,0DAA0D;;AAE1D,oDAAoD;AACpD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mDAAmD;AACnD;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAqB,mBAAmB;AACxC;AACA;;AAEA;AACA;AACA,4CAA4C;AAC5C;AACA;;AAEA,0HAA0H;AAC1H;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;;AAEA;AACA,8CAA8C;;AAE9C;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,0BAA0B;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;;AAE3B;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,kBAAkB;AAChC;;AAEA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;;;AAGP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,mBAAmB;AACnB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc;AACd;;AAEA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA,sCAAsC;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;;AAEA;AACA,8DAA8D;AAC9D,qDAAqD;AACrD,2DAA2D;AAC3D,2CAA2C;AAC3C;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qDAAqD;;AAErD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,8CAA8C;;AAE9C;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;;AAGL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,yBAAyB;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gCAAgC;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,0BAA0B;;AAE1B;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,2BAA2B;;AAE3B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,uEAAuE;;AAEvE;AACA;AACA,WAAW;AACX;;;AAGA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;;;AAGP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mDAAmD,yDAAyD;AAC5G,6BAA6B;;AAE7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;;;AAGP;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH,yCAAyC;;AAEzC;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,SAAS;;;AAGT;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;;AAGT,yBAAyB;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH,kCAAkC;;AAElC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gCAAgC;;AAEhC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA,+BAA+B;;AAE/B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;;;AAGX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;;AAGA,oFAAoF;;AAEpF;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA,uCAAuC;AACvC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,oBAAoB;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;;;AAGH,kGAAkG;AAClG,+CAA+C;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC;;AAEtC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6IAA6I;;AAE7I;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,kEAAkE,4CAA4C;AAC9G;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA,+BAA+B;AAC/B;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA,qDAAqD;AACrD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA,kIAAkI;AAClI;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA,kIAAkI;AAClI;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,oCAAoC;;AAEpC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,8JAA8J,yCAAyC;AACvM;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,CAAC;AACD;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAqB,wBAAwB;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,UAAU,kDAAkD;AAC5D;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,6BAA6B;AACzC;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;;AAGL,uEAAuE;;AAEvE,UAAU,6BAA6B;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO;;;AAGP;AACA;AACA;AACA;;AAEA;AACA,OAAO;AACP;;;AAGA;;AAEA;AACA;;AAEA;;AAEA,cAAc,aAAa;AAC3B;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,UAAU,iCAAiC;AAC3C;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,YAAY;AACxB;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;;AAGL,uEAAuE;;AAEvE,UAAU,YAAY;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;;;AAGT;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,MAAM;AACnD;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yDAAyD;AACzD;;AAEA,8CAA8C;AAC9C;AACA;AACA;AACA;;AAEA;AACA,6DAA6D;;AAE7D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6DAA6D;;AAE7D;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,+BAA+B;AAC/B;AACA;AACA;;AAEA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,2CAA2C;;AAE3C;AACA;AACA,GAAG;;;AAGH;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kCAAkC;AAClC;;AAEA,qCAAqC;AACrC;AACA;AACA;;AAEA;AACA,8BAA8B;AAC9B,mDAAmD;AACnD;AACA;;AAEA;AACA,yBAAyB;;AAEzB,gCAAgC;AAChC;AACA;;AAEA;AACA,iCAAiC;AACjC;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,uBAAuB,8BAA8B;AACrD;AACA;AACA,+CAA+C;AAC/C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,4CAA4C;AAC7D;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iCAAiC;;AAEjC;AACA;;AAEA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA,6CAA6C;;AAE7C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;;;AAGP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL,GAAG;AACH;;;AAGA;;AAEA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B;;AAE5B,oCAAoC;;AAEpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;AAGA,kFAAkF;;AAElF;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC;AACtC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,2CAA2C;AAChD;;;AAGA;AACA;AACA;;AAEA,kCAAkC;AAClC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,yKAAyK,0CAA0C;AACnN;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;;AAEA,8CAA8C;AAC9C;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,qEAAqE;AACrE;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,gBAAgB;AACzB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,4HAA4H;;AAE5H,oCAAoC;AACpC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wBAAwB;AACxB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA,yGAAyG;AACzG;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,+BAA+B;;AAE/B;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mCAAmC;;AAEnC;AACA;AACA;AACA,+CAA+C;;AAE/C;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;AAGA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;;AAEtC;AACA,KAAK;;;AAGL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,0CAA0C;;AAE1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;;AAGA,gDAAgD;;AAEhD;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA,mCAAmC;;AAEnC;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;;AAEpC;AACA;;AAEA,0CAA0C;AAC1C;;AAEA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;;AAEpC;AACA,GAAG;;;AAGH,sCAAsC;AACtC;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;;AAEpC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL,wCAAwC;;AAExC;AACA,sCAAsC;AACtC;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,8CAA8C;;AAE9C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uDAAuD;AACvD,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;AAC3D;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;;;AAGA;;AAEA;AACA;AACA,4DAA4D;AAC5D;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,iIAAiI;AACjI;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;;AAGT;;AAEA;AACA;AACA;AACA,4DAA4D;AAC5D;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mCAAmC;;AAEnC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yNAAyN,GAAG;;AAE5N;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAuB,qBAAqB;AAC5C;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,YAAY;AAC9B;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2CAA2C;;AAE3C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;;;AAGX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;;AAGA;AACA,uCAAuC;;AAEvC;AACA;AACA;AACA,kDAAkD;;AAElD;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;;;AAGA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,6CAA6C;;AAE7C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,+BAA+B;AAC/B;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa;;;AAGb;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf,mHAAmH;AACnH;;AAEA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;;;AAGA;AACA,aAAa;AACb;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,4DAA4D;;AAE5D;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO,oCAAoC;AAC3C;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mDAAmD;AACnD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA;AACA,8CAA8C;AAC9C;AACA;;AAEA,qHAAqH;;AAErH,+CAA+C;AAC/C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;;;AAGA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;;;AAGb;AACA;;AAEA,oDAAoD;AACpD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,sEAAsE;;AAEtE;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,8CAA8C;AAC9C;;AAEA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,+DAA+D;;AAE/D;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;;;AAGA;AACA;AACA;;AAEA,qEAAqE;;AAErE,yEAAyE;AACzE;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;;AAEX,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA,uCAAuC;AACvC;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,oDAAoD;;AAEpD;AACA;AACA;AACA;AACA,oFAAoF;;AAEpF;AACA;AACA,iBAAiB;;;AAGjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E;AACA;AACA;AACA;AACA;AACA,WAAW;;;AAGX;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;;AAEA;;AAEA;AACA;AACA,WAAW;AACX;AACA;;AAEA,+DAA+D;;AAE/D;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,+EAA+E;;AAE/E;AACA;;AAEA;AACA;;AAEA;AACA;AACA,2CAA2C;AAC3C;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;;AAGA,8BAA8B;AAC9B;AACA;AACA;;AAEA;AACA,6BAA6B,2CAA2C;;AAExE;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;;AAEA,4GAA4G;AAC5G;AACA;AACA;;AAEA,sCAAsC;AACtC;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;;AAGF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,aAAa;AACb,yNAAyN,qCAAqC,wFAAwF,2BAA2B,qBAAqB,QAAQ,YAAY;AAC1Z,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,+DAA+D;AAC/D;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW;AACX;AACA;AACA,gEAAgE;AAChE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,CAAC;AACD;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB;AACjB,eAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2DAA2D;AAC3D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;;AAGA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA,qDAAqD;;AAErD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,6BAA6B;;AAE7B;AACA;;AAEA,4CAA4C;AAC5C;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG,+BAA+B;AAClC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG,+BAA+B;AAClC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA,mCAAmC;;AAEnC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,oEAAoE;AACpE;;AAEA;AACA;AACA,OAAO;AACP;AACA,OAAO;;AAEP,KAAK;AACL;AACA;AACA;AACA;AACA,wCAAwC;;AAExC;AACA;AACA;AACA;AACA,KAAK;AACL,6DAA6D;;AAE7D;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oDAAoD;AACpD;AACA;;AAEA;AACA,uCAAuC;;AAEvC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iDAAiD;AACjD;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA,kDAAkD;;AAElD,6BAA6B;AAC7B;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;;AAE9C;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC;;AAEtC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA,qHAAqH;;AAErH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA,kDAAkD;AAClD;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;;;AAGA,4CAA4C;;AAE5C;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,OAAO;AACP;;;AAGA;AACA,KAAK,kCAAkC;AACvC;;;AAGA;AACA,GAAG;AACH;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+DAA+D;;AAE/D;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;;AAEjC,8BAA8B;;AAE9B,0BAA0B;;AAE1B,oCAAoC;;AAEpC,kDAAkD;;AAElD,wCAAwC;AACxC;AACA;AACA;;AAEA;AACA;AACA,mDAAmD;AACnD;;AAEA,yDAAyD;AACzD;AACA;;AAEA,6CAA6C;AAC7C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;;AAE3C;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;;AAEA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,yBAAyB;AACzB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;;;AAGH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;AAGA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,CAAC;AACD,QAAQ;AACR;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;;AAGA;AACA,mFAAmF;AACnF;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,CAAC;AACD;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,6CAA6C;;AAE7C;AACA;AACA,GAAG;AACH;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,0BAA0B;AAC1B;;AAEA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;;AAEP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmF;AACnF;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2FAA2F;;AAE3F;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;;AAGA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,6DAA6D;AAC7D;AACA;;AAEA;AACA;AACA;AACA,WAAW;;;AAGX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,wBAAwB;AACxB;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;;AAGA;AACA;;AAEA,gCAAgC;AAChC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,EAAE;;AAEP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH,4CAA4C;AAC5C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mCAAmC;;AAEnC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;;;AAGL;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+DAA+D;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,4CAA4C;;AAE5C;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,6EAA6E;;AAE7E;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;AAGA,iDAAiD;AACjD;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,6CAA6C;;;AAG7C;AACA;AACA,wEAAwE;;AAExE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;;;AAGL;AACA,GAAG,iCAAiC;;;AAGpC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC;;AAEtC;AACA;AACA;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG,4CAA4C;AAC/C;;;AAGA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA,kDAAkD;;AAElD,uCAAuC;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,yCAAyC;AACzC;AACA;AACA;;AAEA,gCAAgC;AAChC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,sBAAsB;AACtB;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA,gCAAgC;AAChC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA;AACA;;AAEA,uBAAuB,4BAA4B;AACnD;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA,uDAAuD;AACvD;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,sCAAsC;AACtC;;AAEA,6CAA6C;;AAE7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6CAA6C;;AAE7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA,+CAA+C;;AAE/C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,2BAA2B;AAC3B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;;AAE9B;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;;AAEzB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,mDAAmD;;AAEnD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,qEAAqE;;AAErE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO,4CAA4C;AACnD;;;AAGA;AACA,6BAA6B;AAC7B;AACA;;AAEA,wCAAwC;;AAExC;;AAEA;AACA;AACA;AACA,OAAO;;;AAGP;;AAEA;AACA,6CAA6C;AAC7C;;AAEA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8GAA8G;;AAE9G;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA;AACA;AACA;AACA,kNAAkN,IAAI,6BAA6B,mCAAmC,0FAA0F,cAAc,IAAI,gBAAgB,mCAAmC;AACrb;AACA;AACA;AACA;AACA;AACA;AACA,iMAAiM,oDAAoD,EAAE;AACvP;AACA;AACA;;AAEA;AACA;AACA;AACA,4LAA4L,oDAAoD,EAAE;AAClP;AACA;AACA;;AAEA,gFAAgF;;AAEhF,0CAA0C;AAC1C;AACA,0BAA0B;AAC1B;;AAEA;AACA;AACA;AACA;AACA;;AAEA,6PAA6P;AAC7P;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO;AACP,KAAK;AACL,uEAAuE;;AAEvE;AACA;AACA,OAAO;AACP;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,GAAG,EAAE;AACL;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA,4CAA4C;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,gBAAgB,KAAI;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,yDAAyD;AACzD;AACA,iDAAiD;AACjD;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH,+CAA+C;AAC/C;;AAEA,wCAAwC;;AAExC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;;AAExC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wCAAwC;;AAExC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,2EAA2E;;AAE3E;AACA;AACA;AACA;AACA;;AAEA;AACA,sEAAsE;AACtE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;AAGA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA,yEAAyE;AACzE;AACA;;AAEA,4DAA4D;AAC5D;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,+DAA+D,OAAO;;AAEtE;AACA;AACA;;AAEA;AACA;AACA,IAAI;;;AAGJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;;AAEA,sCAAsC;AACtC;AACA;AACA,IAAI;;;AAGJ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,K;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,mFAAmF;;AAEnF;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,iMAAiM,cAAc;AAC/M;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK,EAAE;AACP;;AAEA;AACA,GAAG;AACH;AACA;;AAEA,+EAA+E;;AAE/E;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,8CAA8C;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACn7wBa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAqC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,IAAI,KAAqC,EAAE,EAK1C;AACD,mBAAmB,mBAAO,CAAC,6FAAgC;AAC3D;;;;;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;;;AAIb,IAAI,IAAqC;AACzC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E;AAC1E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;;AAEhD;AACA;AACA;AACA,iDAAiD;;AAEjD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACpLa;;AAEb,IAAI,KAAqC,EAAE,EAE1C;AACD,mBAAmB,mBAAO,CAAC,0FAA+B;AAC1D;;;;;;;;;;;;;ACNA;AAAA;AAAA;AAAA;AAA0B;AACnB;AACP;AACA,4CAAK;;AAEL,IAAI,IAAqC;AACzC;AACA;;AAEe,gFAAiB,E;;;;;;;;;;;;ACThC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAkD;AACf;AACW;AACG;;AAEjD;AACA;AACA;AACA;AACA,qBAAqB,qDAAO;AAC5B,2BAA2B,2DAAY;AACvC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,sBAAsB,qDAAO;AAC7B;AACA,GAAG;AACH,EAAE,uDAAS;AACX;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH,2BAA2B,0DAAiB;AAC5C,SAAS,4CAAK;AACd;AACA,GAAG;AACH;;AAEA,IAAI,IAAqC;AACzC;AACA,WAAW,iDAAS;AACpB,iBAAiB,iDAAS;AAC1B,gBAAgB,iDAAS;AACzB,gBAAgB,iDAAS;AACzB,KAAK;AACL,aAAa,iDAAS;AACtB,cAAc,iDAAS;AACvB;AACA;;AAEe,uEAAQ,E;;;;;;;;;;;;ACnDvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA0D;AAC0C;AACjD;AACoB;AACN;AAChB;AAC8B;AACjC;;AAE9C;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,EAAE,kGAAyB;AAC3B;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,oCAAoC;;AAEpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wCAAwC;;AAExC;AACA,6BAA6B;;AAE7B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;;AAEvC;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,IAAI;;;AAGJ;AACA,8BAA8B;AAC9B;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,0DAAiB;AAC5D,uBAAuB,uGAA6B;;AAEpD,MAAM,IAAqC;AAC3C;AACA;AACA;;AAEA;AACA;AACA;;AAEA,qQAAqQ,UAAU,8BAA8B,UAAU,0CAA0C,oBAAoB;;AAErX;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ,KAAqC,KAAK,mEAAkB;AACpE;AACA;;AAEA;AACA;;AAEA,iCAAiC,kFAAQ,GAAG;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA,KAAK;AACL;AACA;;;AAGA,iCAAiC,6CAAO;AACxC;AACA;;AAEA;AACA,qBAAqB,qDAAO;AAC5B;AACA;AACA;AACA;AACA,2BAA2B,uGAA6B;;AAExD;AACA,OAAO;AACP;AACA;AACA;;AAEA,yBAAyB,qDAAO;AAChC;AACA;AACA,wDAAwD,kEAAiB,CAAC,4CAAK;AAC/E,OAAO,2BAA2B;;AAElC,yBAAyB,wDAAU,eAAe;AAClD;AACA;;AAEA;AACA;;AAEA,UAAU,KAAqC;AAC/C;AACA,OAAO;;;AAGP;AACA,+BAA+B,qDAAO;AACtC;AACA;AACA;AACA,OAAO;;AAEP,sBAAsB,qDAAO;AAC7B,oEAAoE;AACpE;;AAEA,+BAA+B,2DAAY,kEAAkE;AAC7G;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,0CAA0C,oBAAoB,oBAAoB;AAClF;;;AAGA,mCAAmC,qDAAO;AAC1C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;;AAGA,eAAe,kFAAQ,GAAG;AAC1B;AACA,SAAS;AACT,OAAO,uDAAuD;AAC9D;;AAEA,wBAAwB,wDAAU;AAClC;AACA;AACA,wDAAwD;;;AAGxD;AACA;AACA,OAAO;;;AAGP,2BAA2B,oDAAM;AACjC,6BAA6B,oDAAM;AACnC,sCAAsC,oDAAM;AAC5C,8BAA8B,oDAAM;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;;AAGA;AACA,OAAO,oDAAoD;AAC3D;AACA;;AAEA,iMAAiM;;AAEjM,0SAA0S;AAC1S;;AAEA,qCAAqC,qDAAO;AAC5C,eAAe,4CAAK,iCAAiC,kFAAQ,GAAG;AAChE;AACA,SAAS;AACT,OAAO,gEAAgE;AACvE;;AAEA,0BAA0B,qDAAO;AACjC;AACA;AACA;AACA;AACA,iBAAiB,4CAAK;AACtB;AACA,WAAW;AACX;;AAEA;AACA,OAAO;AACP;AACA,KAAK;;;AAGL,yBAAyB,4CAAK;AAC9B;AACA;;AAEA;AACA,sBAAsB,4CAAK;AAC3B,eAAe,4CAAK,wBAAwB,kFAAQ,GAAG;AACvD;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,aAAa,8DAAY;AACzB;;AAEA,WAAW,8DAAY;AACvB;AACA,C;;;;;;;;;;;;AChXA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA0D;AAC0C;AACxC;AACX;AACqB;AACN;AACV;AACC;AACvD;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oCAAoC,QAAQ;AAC5C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;;;AAGO;AACP,kCAAkC;AAClC;AACA,gDAAgD,mEAAe;AAC/D;AACA,oEAAoE,wDAA+B;AACnG;AACA,uEAAuE,2DAAkC;AACzG;AACA,+DAA+D,mDAA0B;AACzF;AACA,0DAA0D,wDAAsB;;AAEhF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,2DAAY;AAC1E;AACA,gEAAgE,2DAAY;AAC5E;AACA,iEAAiE,2DAAY;AAC7E,uBAAuB,uGAA6B;;AAEpD;AACA;AACA;AACA,uCAAuC,kFAAQ;AAC/C;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AAGA,2FAAe,E;;;;;;;;;;;;ACnGf;AAAA;AAAA;AAAA;AAAA;AAAA;AAA2C;AACmC;AACvE;AACP,oDAAoD,0EAAkB;AACtE;AACO;AACP,+BAA+B,8EAAsB;AACrD;AACA;AACA;AACA,GAAG;AACH;AACO;AACP,wEAAwE,8EAAsB;AAC9F,WAAW,gEAAkB;AAC7B,GAAG;AACH;AACe,kKAAmG,E;;;;;;;;;;;;ACjBlH;AAAA;AAAA;AAAA;AAA8E;AACvE;AACP,iDAAiD,0EAAkB;AACnE;AACO;AACP,4BAA4B,8EAAsB;AAClD;AACA,GAAG;AACH;AACe,4HAA6D,E;;;;;;;;;;;;ACT5E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA0D;AACC;AACpD;AACP,SAAS,kFAAQ,GAAG,cAAc,gBAAgB;AAClD;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,YAAY,IAAqC,EAAE,wEAAiB;AACpE;;AAEA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA,GAAG;AACH;AACe,kHAAmD,E;;;;;;;;;;;;ACnClE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAoG;AAC9C;AAC/C;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;AACA,gBAAgB,uGAA6B;;AAE7C;AACA;AACA;;AAEA,MAAM,IAAqC;AAC3C,IAAI,mEAAkB;AACtB;;AAEA;AACA;AACA,C;;;;;;;;;;;;ACtFA;AAAA;AAAA;AAAuC;;AAEvC;AACA;AACA;AACA,GAAG;AACH;AACA,MAAM,8DAAO;AACb;AACA;AACA;;AAEe;AACf;AACA;AACA;AACA,C;;;;;;;;;;;;AChBA;AAAA;AAAA;AAAA;AAAA;AAA2D;AACpD;AACP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEA;AACA;AACA,MAAM;;;AAGN;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,UAAU,IAAqC,EAAE,wEAAiB;AAClE;AACA;;AAEA;AACA;AACA,C;;;;;;;;;;;;AC/DA;AAAA;AAAA;AAAA;AAAA;AAA0D;AACgB;AAC1E;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,SAAS;AACtB;;AAEO;AACP;AACA,cAAc,qEAAiB;AAC/B;;AAEA,6BAA6B,qEAAiB,GAAG,kDAAe,GAAG,iEAAe;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,aAAa;AAC1B;AACA;AACA;AACA,kBAAkB,cAAc;AAChC,WAAW,cAAc;AACzB;AACA,qCAAqC,QAAQ;AAC7C;AACA,yDAAyD,2BAA2B;AACpF;AACA;AACA,gBAAgB,MAAM;AACtB,0BAA0B,gBAAgB;AAC1C;AACA;AACA;AACA;;AAEO;AACP;AACA,qB;;;;;;;;;;;;AC5CA;AAAA;AAAA;AAAA;AAAA;AAAmC;AACuB;AAC1D;AACA;AACA;AACA;AACA,aAAa,IAAI;AACjB;AACA;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B;AACA,qCAAqC,QAAQ;AAC7C,YAAY,QAAQ;AACpB,kBAAkB,iBAAiB;AACnC;AACA;;AAEO;AACP,qBAAqB,wDAAU,CAAC,qEAAiB;;AAEjD,MAAM,KAAqC;AAC3C,8DAA8D;AAC9D;;AAEA;AACA,C;;;;;;;;;;;;AC3BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA+E;AACD;AAC7B;AAC8B;AACrB;;AAE1D;AACA;AACA;;AAEA;AACA,oBAAoB,wDAAU;AAC9B;AACA,GAAG;AACH;;AAEA,qBAAqB,qDAAO;AAC5B,eAAe,2DAAY;AAC3B,GAAG;AACH,wCAAwC,oDAAM;AAC9C,uBAAuB,oDAAM;AAC7B,yBAAyB,oDAAM;AAC/B,4BAA4B,oDAAM;AAClC;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA,EAAE,kGAAyB;AAC3B;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE,kGAAyB;AAC3B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,SAAS;AACtB;;;AAGO;AACP;AACA,cAAc,qEAAiB;AAC/B;;AAEA,oCAAoC,qEAAiB,GAAG,gEAAsB;AAC9E,WAAW,wDAAU;AACrB;AACA;AACA;AACA;AACA;;AAEA,QAAQ,KAAqC;AAC7C;AACA;;AAEA;AACA;AACA;;AAEA;AACA,IAAI,2DAAa;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,UAAU;AACrB;AACA,aAAa,IAAI;AACjB;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;AACA;AACA;AACA,kBAAkB,QAAQ;AAC1B;AACA;;AAEO;AACP;AACA,qB;;;;;;;;;;;;ACxIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAmC;AACuB;AACoB;AAC9E;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,SAAS;AACtB;;AAEO;AACP;AACA,cAAc,qEAAiB;AAC/B;;AAEA,oCAAoC,qEAAiB,GAAG,gEAAsB;AAC9E,WAAW,wDAAU;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,IAAI;AACjB;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB;AACA;AACA;AACA,kBAAkB,iBAAiB;AACnC;AACA;;AAEO;AACP;AACA,kB;;;;;;;;;;;;AC3CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA6C;AACc;AACF;AACjB;AAC8B;AACA;AACT;AACpB;AACsC;AAC/B;AAChD,6DAAQ,CAAC,kFAAK;;;;;;;;;;;;;ACVd;AAAA;AAAA;AAAmC;AACnC;AACA;;AAEA;AACA;AACA;;AAEA;AACA,cAAc,uDAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;;;;;;;;;;;;;ACzHD;AAAA;AAAA;AAAA;AACA;AACA;AACA;;AAEA,6BAA6B;;AAEtB;AACP;AACA,EAAE;;AAEK;AACP;AACA,E;;;;;;;;;;;;ACbA;AAAA;AAAA;AACA,WAAW,IAAI;AACf,aAAa,QAAQ;AACrB;AACe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;;ACfA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEe;AACf;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;;AC1BA;AAAA;AAAA;AAAA;AAAmD;AACnD;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;;AAEO,kKAAkK,qDAAe,GAAG,+CAAS,C;;;;;;;;;;;;ACTpM;AAAA;AAAA;AAAA;AAA4C;AACZ;AACjB;AACf,OAAO,8DAAa;AACpB,IAAI,wDAAO;AACX;AACA,C;;;;;;;;;;;;ACNA;AAAA;AAAA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACe;AACf;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA,C;;;;;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;;;AAIb,IAAI,IAAqC;AACzC;AACA;;AAEA,cAAc,mBAAO,CAAC,4DAAe;AACrC,qBAAqB,mBAAO,CAAC,8EAA2B;;AAExD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,0FAA0F,aAAa;AACvG;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,8FAA8F,eAAe;AAC7G;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK,EAAE;;AAEP,iDAAiD;AACjD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,8MAA8M;;AAE9M;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,aAAa,WAAW;AACxB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,WAAW;AACxB,aAAa,UAAU;AACvB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,WAAW;AACxB,aAAa,OAAO;AACpB,aAAa,UAAU;AACvB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,WAAW;AACxB,aAAa,OAAO;AACpB,aAAa,UAAU;AACvB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA,yBAAyB;;AAEzB,0BAA0B;AAC1B;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B;AACA,WAAW,UAAU;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,yBAAyB;;AAEzB;AACA;AACA;;AAEA;AACA,mDAAmD;;AAEnD;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,EAAE;AACb,WAAW,EAAE;AACb,WAAW,cAAc;AACzB,WAAW,EAAE;AACb,WAAW,EAAE;AACb;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,EAAE;;AAEP;AACA;AACA;AACA;AACA;AACA,KAAK,EAAE;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe;;AAEf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oEAAoE;;AAEpE;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA,mBAAmB,oBAAoB;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;;AAGH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe;;AAEf,wBAAwB,iBAAiB;;;AAGzC;AACA,wBAAwB;;AAExB,2BAA2B;AAC3B;AACA;;AAEA,+BAA+B;;AAE/B;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA,mBAAmB,oBAAoB;AACvC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,WAAW,GAAG;AACd;AACA,YAAY,QAAQ;AACpB;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB;;AAEvB;;AAEA;AACA,mBAAmB,qBAAqB;AACxC;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,sIAAsI,yCAAyC;AAC/K;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,UAAU;AACrB,WAAW,GAAG;AACd,YAAY,QAAQ;AACpB;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,iBAAiB;AAC5B,WAAW,EAAE;AACb;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,iBAAiB;AAC5B,WAAW,EAAE;AACb,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,aAAa;AACzB;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;;AAEN;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK,EAAE;;AAEP;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA,yCAAyC;;AAEzC;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA,mCAAmC;;AAEnC;AACA;AACA,WAAW;AACX;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;;AAGL;AACA,yCAAyC;AACzC;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,EAAE;AACb;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,0DAA0D;AAC1D;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB,WAAW,EAAE;AACb;;;AAGA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,iBAAiB;AACpC;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB;;;AAGA;AACA;AACA;AACA;;AAEA,mBAAmB,iBAAiB;AACpC;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA,qDAAqD;AACrD;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;AAGA;AACA,mBAAmB,sBAAsB;AACzC;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA,iBAAiB,sBAAsB;AACvC;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,uCAAuC;AACvC;AACA,0CAA0C;AAC1C;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACv3Da;;AAEb,IAAI,KAAqC,EAAE,EAE1C;AACD,mBAAmB,mBAAO,CAAC,iFAA4B;AACvD;;;;;;;;;;;;;ACNA;AAAA;AAAA;AAAA;AAC+E;AAC/E,8BAA8B,sEAA2B;AACzD;AACA,8BAA8B,QAAS,kBAAkB,YAAY,gBAAgB,UAAU,YAAY,yBAAyB,6BAA6B,YAAY,mCAAmC,kBAAkB,eAAe,0BAA0B,mCAAmC,uBAAuB,aAAa,uDAAuD,+CAA+C,WAAW,iBAAiB,eAAe,sBAAsB,wBAAwB,OAAO,mWAAmW,YAAY,gBAAgB,UAAU,YAAY,yBAAyB,6BAA6B,YAAY,mCAAmC,kBAAkB,eAAe,0BAA0B,mCAAmC,uBAAuB,aAAa,uDAAuD,+CAA+C,WAAW,iBAAiB,eAAe,sBAAsB,wBAAwB,mBAAmB;AACt2C;AACe,sFAAuB,EAAC;;;;;;;;;;;;;ACNvC;AAAA;AAAA;AAAA;AAAA;AAAA;AAA6G;AAC5E;;AAEjC;AACA;AACA,mBAAmB,sBAAsB;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,EAAE,uDAAS;AACX;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,EAAE,uDAAS;AACX;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,EAAE,uDAAS;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;;AAEF;AACA;AACA;AACA;;AAEA,EAAE,uDAAS;AACX;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,gEAAgE,qDAAe,GAAG,+CAAS;;AAE3F;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,QAAQ,IAAqC;AAC7C;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE;;AAElE,qGAAqG;AACrG;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yBAAyB,wDAAU;AACnC;AACA;AACA;AACA,sDAAsD;AACtD;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD;AACA,kDAAkD;AAClD;AACA,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,sDAAQ;AAC1B;AACA;;AAEA,mBAAmB,oDAAM;AACzB,mBAAmB,oDAAM;AACzB,iBAAiB,oDAAM;AACvB,4BAA4B,oDAAM;AAClC,gBAAgB,oDAAM;AACtB;AACA,gBAAgB,oDAAM;AACtB;AACA;AACA;AACA;AACA,2BAA2B;;AAE3B;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,GAAG,YAAY;;AAEf,EAAE,uDAAS;AACX;AACA,4BAA4B;AAC5B;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6BAA6B;AAC7B;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kGAAkG;AAClG;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,EAAE,iEAAmB;AACrB;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,GAAG,EAAE;;AAEL;AACA;AACA,gQAAgQ;;AAEhQ;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;;;AAGJ,yCAAyC;;AAEzC;AACA;AACA,sHAAsH;AACtH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0BAA0B,4CAAK;AAC/B;;AAEA,wBAAwB,4CAAK;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,wBAAwB;AACxB;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,WAAW,4CAAK,sCAAsC;AACtD;AACA;AACA;AACA,KAAK,wBAAwB,4CAAK;AAClC;AACA;AACA,KAAK,EAAE,4CAAK;AACZ;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP,KAAK,EAAE,4CAAK;AACZ;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,4BAA4B,4CAAK;AACjC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,sBAAsB;AACtB;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH,SAAS,4CAAK,eAAe,4CAAK,4CAA4C,gDAAQ;AACtF,CAAC;;AAEc,oEAAK,EAAC;AACJ;AACjB;;;;;;;;;;;;AC3mBA,iBAAiB,mBAAO,CAAC,qFAAyB;;;;;;;;;;;;;ACAlD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEa;;AAEb;;AAEA,UAAU,mBAAO,CAAC,0EAAsB;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA,yBAAyB,mBAAO,CAAC,6DAAc;AAC/C,gBAAgB,mBAAO,CAAC,6DAAU;AAClC;;AAEA,eAAe,mBAAO,CAAC,kFAAoB;AAC3C,eAAe,mBAAO,CAAC,kFAAoB;;AAE3C;;AAEA;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA,E;;;;;;;;;;;;AClIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEa;;AAEb;;AAEA,gBAAgB,mBAAO,CAAC,oFAAqB;;AAE7C;AACA,yBAAyB,mBAAO,CAAC,6DAAc;AAC/C,gBAAgB,mBAAO,CAAC,6DAAU;AAClC;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,E;;;;;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;;AAEA,UAAU,mBAAO,CAAC,0EAAsB;AACxC;;AAEA;;AAEA;AACA,cAAc,mBAAO,CAAC,gDAAS;AAC/B;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,SAAS,mBAAO,CAAC,+CAAQ;;AAEzB;AACA;AACA;AACA;;AAEA;AACA,aAAa,mBAAO,CAAC,wGAA2B;AAChD;;AAEA;;AAEA,aAAa,mBAAO,CAAC,wDAAa;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,yBAAyB,mBAAO,CAAC,6DAAc;AAC/C,gBAAgB,mBAAO,CAAC,6DAAU;AAClC;;AAEA;AACA,gBAAgB,mBAAO,CAAC,aAAM;AAC9B;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA,iBAAiB,mBAAO,CAAC,wGAA+B;AACxD,kBAAkB,mBAAO,CAAC,kGAA4B;AACtD;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yEAAyE,6EAA6E;AACtJ;;AAEA;AACA,qBAAqB,mBAAO,CAAC,8EAAkB;;AAE/C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,iDAAiD,0FAA0F;;AAE3I;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,wCAAwC,mBAAO,CAAC,4EAAiB;AACjE;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,mBAAO,CAAC,8EAAkB;;AAE/C;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA,kGAAkG;AAClG,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA,4FAA4F;AAC5F,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,gDAAgD;;AAEhD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC,mBAAO,CAAC,4EAAiB;AAC/D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,6DAA6D;AAC7D;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sCAAsC;;AAEtC;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,4CAA4C;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB;;AAEpB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,SAAS;AAC5B;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA,4EAA4E;;AAE5E;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA,iBAAiB,yBAAyB;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mDAAmD;AACnD;AACA,mDAAmD,iEAAiE;AACpH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA,uCAAuC;AACvC,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gCAAgC,OAAO;AACvC;AACA;AACA;AACA,C;;;;;;;;;;;;;AC1/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,YAAY;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;;AAEA,aAAa,mBAAO,CAAC,8EAAkB;;AAEvC;AACA,yBAAyB,mBAAO,CAAC,6DAAc;AAC/C,gBAAgB,mBAAO,CAAC,6DAAU;AAClC;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,C;;;;;;;;;;;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEa;;AAEb;;AAEA,UAAU,mBAAO,CAAC,0EAAsB;AACxC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,yBAAyB,mBAAO,CAAC,6DAAc;AAC/C,gBAAgB,mBAAO,CAAC,6DAAU;AAClC;;AAEA;AACA;AACA,aAAa,mBAAO,CAAC,gEAAgB;AACrC;AACA;;AAEA;AACA,aAAa,mBAAO,CAAC,wGAA2B;AAChD;;AAEA;;AAEA,aAAa,mBAAO,CAAC,wDAAa;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,kBAAkB,mBAAO,CAAC,kGAA4B;;AAEtD;;AAEA;;AAEA;AACA,qBAAqB,mBAAO,CAAC,8EAAkB;;AAE/C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iDAAiD,0FAA0F;;AAE3I;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,mBAAO,CAAC,8EAAkB;;AAE/C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iCAAiC;;AAEjC;;AAEA,2CAA2C;AAC3C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,oDAAoD;AACpD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,E;;;;;;;;;;;;;AC9qBa;;AAEb,iDAAiD,0CAA0C,0DAA0D,EAAE;;AAEvJ,aAAa,mBAAO,CAAC,wDAAa;AAClC,WAAW,mBAAO,CAAC,aAAM;;AAEzB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB;AACjB,gDAAgD;AAChD;AACA;AACA;;AAEA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA,4BAA4B,sBAAsB;AAClD;AACA;AACA,C;;;;;;;;;;;;AC9Ea;;AAEb;;AAEA,UAAU,mBAAO,CAAC,0EAAsB;AACxC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,E;;;;;;;;;;;ACzEA,iBAAiB,mBAAO,CAAC,+CAAQ;;;;;;;;;;;;ACAjC,iBAAiB,mBAAO,CAAC,sEAAY;;;;;;;;;;;;ACArC,2BAA2B,mBAAO,CAAC,yFAA2B;AAC9D;AACA;AACA,mBAAmB,mBAAO,CAAC,yFAA2B;AACtD,iBAAiB,mBAAO,CAAC,qFAAyB;AAClD,oBAAoB,mBAAO,CAAC,2FAA4B;AACxD,sBAAsB,mBAAO,CAAC,+FAA8B;;;;;;;;;;;;ACN5D,iBAAiB,mBAAO,CAAC,sEAAY;;;;;;;;;;;;ACArC,iBAAiB,mBAAO,CAAC,yFAA2B;;;;;;;;;;;;;ACApD;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEe,oEAAK,E;;;;;;;;;;;;ACnBpB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA6C;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,IAAI;AACf,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA,WAAW,IAAI;AACf;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB,eAAe,SAAS;AACxB;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB,eAAe;AACf;;;AAGA;AACA;AACA;AACA;;AAEA,iCAAiC;AACjC;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,WAAW;AAC1B;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA,mBAAmB,aAAa;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,OAAO,yDAAY;AACxB;AACA,KAAK;AACL,GAAG;AACH;AACA;;;AAGA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG,QAAQ,yDAAY;AACvB;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,GAAG,aAAa;;AAEhB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oEAAoE;AACpE;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;;;AAGA;AACA;AACA;;AAEA,iBAAiB,wBAAwB;AACzC;;AAEA,QAAQ,IAAqC;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,oDAAoD;AACpD;;AAEA;;AAEA,MAAM,IAAqC;AAC3C;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,QAAQ,IAAqC;AAC7C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,oBAAoB,8BAA8B;AAClD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA,aAAa,gBAAgB;AAC7B;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA,iBAAiB,sBAAsB;AACvC;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA,sEAAsE,aAAa;AACnF;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,SAAS;AACtB;;AAEA;AACA,4EAA4E,aAAa;AACzF;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,8BAA8B;AAC9B;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAI,KAAqC;AACzC;AACA;;AAEgI;;;;;;;;;;;;ACtpBhI;AACA,aAAa,mBAAO,CAAC,8CAAQ;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;;;AAIb,IAAI,IAAqC;AACzC;AACA;;AAEA,0BAA0B;;AAE1B;AACA,wBAAwB;AACxB;AACA;AACA;;AAEA,iCAAiC;;AAEjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,gCAAgC;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;AC5VA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;;;AAIb,IAAI,IAAqC;AACzC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2DAA2D;;AAE3D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,8BAA8B;;AAE9B;AACA,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,+CAA+C;AAC/C;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG;;AAElG;AACA;AACA;AACA;;AAEA;AACA,wCAAwC;AACxC;;AAEA;AACA;AACA,CAAC;;;AAGD;AACA,gCAAgC;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mCAAmC;;AAEnC,oCAAoC;;AAEpC;AACA;AACA,iCAAiC;;AAEjC,sCAAsC;;AAEtC;AACA,oBAAoB;;AAEpB,sBAAsB;AACtB;AACA,0CAA0C;;AAE1C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA,GAAG;;;AAGH;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;;;AAGP;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACz1Ba;;AAEb,IAAI,KAAqC,EAAE,EAE1C;AACD,mBAAmB,mBAAO,CAAC,6FAAgC;AAC3D;;;;;;;;;;;;;ACNa;;AAEb,IAAI,KAAqC,EAAE,EAE1C;AACD,mBAAmB,mBAAO,CAAC,6GAAwC;AACnE;;;;;;;;;;;;ACNA;AACA;;AAEA;AACA;AACA;;AAEA,uBAAuB;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,iBAAiB;AACtC;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0CAA0C,sBAAsB,EAAE;AAClE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA,KAAK;AACL;AACA;;AAEA,KAAK;AACL;AACA;;AAEA,KAAK;AACL;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;;;;;;;;;;;ACzLD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAAS,mBAAO,CAAC,+CAAQ;AACzB,eAAe,mBAAO,CAAC,6DAAU;;AAEjC;AACA,kBAAkB,mBAAO,CAAC,uFAA6B;AACvD,kBAAkB,mBAAO,CAAC,uFAA6B;AACvD,gBAAgB,mBAAO,CAAC,mFAA2B;AACnD,mBAAmB,mBAAO,CAAC,iFAA8B;AACzD,qBAAqB,mBAAO,CAAC,qFAAgC;;AAE7D;AACA;;;;AAIA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;;;;;;;;;;;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;;AAEA,aAAa,mBAAO,CAAC,wDAAa;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6BAA6B,sCAAsC,sCAAsC;AACzG;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,C;;;;;;;;;;;;ACvSA;AAAA;AAAA;AACqC;;AAErC;;AAEA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA,CAAC,UAAU,IAA6B;AACxC;AACA,CAAC,MAAM,EAEN;;AAED,aAAa,4DAAQ;AACN,qEAAM,EAAC;;;;;;;;;;;;;;AClBtB;AAAA;AAAe;AACf;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;;;;;;;;;;;;AChBA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,mBAAO,CAAC,iEAAc;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,0BAA0B;AAC3C;AACA;;AAEA,yCAAyC;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;ACtCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;;AAEO;AACP;AACA,mBAAmB,sBAAsB;AACzC;AACA;;AAEO;AACP;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,4DAA4D,cAAc;AAC1E;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;;AAEO;AACP,mCAAmC,oCAAoC;AACvE;;AAEO;AACP;AACA;;AAEO;AACP,2BAA2B,+DAA+D,gBAAgB,EAAE,EAAE;AAC9G;AACA,mCAAmC,MAAM,6BAA6B,EAAE,YAAY,WAAW,EAAE;AACjG,kCAAkC,MAAM,iCAAiC,EAAE,YAAY,WAAW,EAAE;AACpG,+BAA+B,qFAAqF;AACpH;AACA,KAAK;AACL;;AAEO;AACP,aAAa,6BAA6B,0BAA0B,aAAa,EAAE,qBAAqB;AACxG,gBAAgB,qDAAqD,oEAAoE,aAAa,EAAE;AACxJ,sBAAsB,sBAAsB,qBAAqB,GAAG;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,kCAAkC,SAAS;AAC3C,kCAAkC,WAAW,UAAU;AACvD,yCAAyC,cAAc;AACvD;AACA,6GAA6G,OAAO,UAAU;AAC9H,gFAAgF,iBAAiB,OAAO;AACxG,wDAAwD,gBAAgB,QAAQ,OAAO;AACvF,8CAA8C,gBAAgB,gBAAgB,OAAO;AACrF;AACA,iCAAiC;AACjC;AACA;AACA,SAAS,YAAY,aAAa,OAAO,EAAE,UAAU,WAAW;AAChE,mCAAmC,SAAS;AAC5C;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAM,gBAAgB;AACzC;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;;AAEO;AACP,4BAA4B,sBAAsB;AAClD;AACA;AACA;;AAEO;AACP,iDAAiD,QAAQ;AACzD,wCAAwC,QAAQ;AAChD,wDAAwD,QAAQ;AAChE;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA,iBAAiB,sFAAsF,aAAa,EAAE;AACtH,sBAAsB,gCAAgC,qCAAqC,0CAA0C,EAAE,EAAE,GAAG;AAC5I,2BAA2B,MAAM,eAAe,EAAE,YAAY,oBAAoB,EAAE;AACpF,sBAAsB,oGAAoG;AAC1H,6BAA6B,uBAAuB;AACpD,4BAA4B,wBAAwB;AACpD,2BAA2B,yDAAyD;AACpF;;AAEO;AACP;AACA,iBAAiB,4CAA4C,SAAS,EAAE,qDAAqD,aAAa,EAAE;AAC5I,yBAAyB,6BAA6B,oBAAoB,gDAAgD,gBAAgB,EAAE,KAAK;AACjJ;;AAEO;AACP;AACA;AACA,2GAA2G,sFAAsF,aAAa,EAAE;AAChN,sBAAsB,8BAA8B,gDAAgD,uDAAuD,EAAE,EAAE,GAAG;AAClK,4CAA4C,sCAAsC,UAAU,oBAAoB,EAAE,EAAE,UAAU;AAC9H;;AAEO;AACP,gCAAgC,uCAAuC,aAAa,EAAE,EAAE,OAAO,kBAAkB;AACjH;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,4CAA4C;AAC5C;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxNA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,SAAS;AACtB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClEA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;;;;;;;;;;ACvBA,e;;;;;;;;;;;ACAA,e","file":"bundle.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 = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./client/index.js\");\n","export const COLLECT_TITLE = 'COLLECT_TITLE'\nexport const COLLECT_DESCRIPTION = 'COLLECT_DESCRIPTION'\nexport const COLLECT_URL = 'COLLECT_URL'\n\nexport const collectTitle = (title) => {\n return {\n type: 'COLLECT_TITLE',\n title: title\n }\n}\n\nexport const collectDescription = (description) => {\n return {\n type: 'COLLECT_DESCRIPTION',\n description: description\n }\n}\n\nexport const collectUrl = (url) => {\n return {\n type: 'COLLECT_URL',\n url: url\n }\n}\n","import React from 'react'\n\nimport Header from './Header'\nimport Url from './Url'\nimport Title from './Title'\nimport Description from './Description'\nimport Preview from './Preview'\nimport PopUp from './PopUp'\nimport LowerSect from './LowerSect'\n\nclass App extends React.Component {\n render () {\n return (\n
\n \n
\n
\n

Enter your meta tags here

\n \n \n <Description />\n </div>\n <Preview />\n <LowerSect />\n </div>\n )\n }\n}\n\nexport default App\n","import React from 'react'\nimport { connect } from 'react-redux'\nimport { collectDescription } from '../actions'\n\nfunction handleChange (e, dispatch) {\n dispatch(collectDescription(e.target.value))\n}\n\nclass Description extends React.Component {\n render () {\n return (\n <div>\n <p className=\"description-label\">Description</p>\n <input \n type=\"text\"\n id=\"description\"\n className=\"description-input\"\n placeholder=\"Start writing your description here\"\n onChange={e => handleChange(e, this.props.dispatch)}\n >\n </input>\n </div>\n )\n }\n}\n\nconst mapStateToProps = state => {\n return {\n description: state.description\n }\n}\n\nexport default connect(mapStateToProps)(Description)\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nconst start = 'Be sure to keep your descriptions within 120-158 characters.'\nconst warning = 'Be sure to keep your descriptions within 120-158 characters. Currently it is:'\nconst perfect = 'Great work, your description is the ideal length!'\n\nlet characterCount = ''\nlet textColor = 'defaultColor'\nlet text = ''\n\nclass DescriptionCharCount extends React.Component {\n render () {\n if (this.props.description) {\n characterCount = this.props.description.length\n } else {\n characterCount = 0\n }\n\n if (characterCount === 0) {\n textColor = 'defaultColor'\n text = start\n } else if (characterCount < 120 || characterCount > 158) {\n textColor = 'warningColor'\n text = warning\n } else {\n textColor = 'optimalColor'\n text = perfect\n }\n return (\n <div>\n <p className={textColor}>{text} {characterCount} characters</p>\n </div>\n )\n }\n}\n\nconst mapStateToProps = state => {\n return {\n description: state.description\n }\n}\n\nexport default connect(mapStateToProps)(DescriptionCharCount)\n","import React from 'react'\n\nclass Header extends React.Component {\n render () {\n return (\n <div className=\"header-container\">\n <h1>Meta Data Checker</h1>\n </div>\n )\n }\n}\n\nexport default Header\n","import React from 'react'\n\nimport db from '../firebase'\n\nimport jsonexport from 'jsonexport'\n\nconst deleteButton = () => {\n deleteUserData()\n}\n\nfunction deleteUserData () {\n db.database().ref('metaData').set(null)\n}\n\nfunction downloadData () {\n const leadsRef = db.database().ref('metaData')\n\n leadsRef.on('value', function (snapshot) {\n snapshot.forEach(function (childSnapshot) {\n const childData = childSnapshot.val()\n jsonexport(childData, function (err, csv) {\n if (err) return console.error(err)\n console.log(csv)\n })\n })\n })\n}\n\nclass LowerSect extends React.Component {\n render () {\n return (\n <div className=\"lower-sect\">\n <button className=\"delete-button\" onClick={() => deleteButton()}>Clear data</button>\n <button className=\"download-button\" onClick={() => downloadData()}>Download data</button>\n </div>\n )\n }\n}\n\nexport default LowerSect\n","import React from 'react'\nimport Popup from 'reactjs-popup'\nimport 'reactjs-popup/dist/index.css'\nimport { connect } from 'react-redux'\n\nclass PopUp extends React.Component {\n render () {\n return (\n <div className=\"popup\">\n <Popup\n trigger={<button className=\"button\"> </> Generate <br></br>Meta Tags </button>}\n modal\n nested\n >\n {close => (\n <div className=\"modal\">\n <button className=\"close\" onClick={close}>\n ×\n </button>\n <div className=\"modal-content\">\n <div className=\"header\"> Your Meta Tags </div>\n <div className=\"content\">\n {' '}\n <!-- Copy this code into the head section of your website -->\n <br />\n <title>{this.props.title}</title>\n <br />\n <meta name="title" content="{this.props.title}">\n <br />\n <meta name="description" content="{this.props.description}"></meta>\n <br />\n </div>\n <div className=\"actions\">\n <button\n className=\"button\"\n onClick={() => {\n console.log('modal closed ')\n close()\n }}\n >\n Exit\n </button>\n </div>\n </div>\n </div>\n )}\n </Popup>\n </div>\n )\n }\n}\n\nconst mapStateToProps = state => {\n return {\n title: state.title,\n description: state.description\n }\n}\n\nexport default connect(mapStateToProps)(PopUp)\n","import React from 'react'\nimport { CopyToClipboard } from 'react-copy-to-clipboard'\nimport { connect } from 'react-redux'\nimport db from '../firebase'\n\nimport TitleCharCount from './TitleCharCount'\nimport DescriptionCharCount from './DescriptionCharCount'\n\nconst carryInfo = (data) => {\n writeUserData(data.url, data.title, data.description)\n}\n\nfunction urlDomain (data) {\n var a = document.createElement('a')\n a.href = data\n return a.hostname\n}\n\nfunction writeUserData (url, title, description) {\n const domain = urlDomain(url)\n const name = domain.split('.').join('')\n db.database().ref('metaData/' + name).set({\n title: title,\n description: description,\n url: url\n })\n}\n\nclass Preview extends React.Component {\n render () {\n return (\n <div className=\"preview-container\">\n <h2>Preview of Your Meta Data</h2>\n <div className=\"google-preview\">\n <h3 className=\"preview-title\">{this.props.title}</h3>\n <p className=\"preview-url\">{this.props.url}</p>\n <p className=\"preview-description\">{this.props.description}</p>\n </div>\n <div className=\"buttons\">\n <CopyToClipboard text={this.props.title} onCopy={this.onCopy}>\n <button>Copy Title</button>\n </CopyToClipboard>\n <CopyToClipboard text={this.props.description} onCopy={this.onCopy}>\n <button>Copy Description</button>\n </CopyToClipboard>\n <button onClick={() => carryInfo(this.props)} className=\"save-button\">Save</button>\n </div>\n <div className=\"count-container\">\n <TitleCharCount />\n <DescriptionCharCount />\n </div>\n </div>\n\n )\n }\n}\n\nconst mapStateToProps = state => {\n return {\n title: state.title,\n description: state.description,\n url: state.url\n }\n}\n\nexport default connect(mapStateToProps)(Preview)\n","import React from 'react'\nimport { connect } from 'react-redux'\nimport { collectTitle } from '../actions'\n\nfunction handleChange (e, dispatch) {\n dispatch(collectTitle(e.target.value))\n}\n\nclass Title extends React.Component {\n render () {\n return (\n <div>\n <p className=\"title-label\">Title</p>\n <input\n type=\"text\"\n id=\"title\"\n className=\"title-input\"\n placeholder=\"Meta Data Checker | Write Your Title Here\"\n onChange={e => handleChange(e, this.props.dispatch)}\n >\n </input>\n </div>\n )\n }\n}\n\nconst mapStateToProps = state => {\n return {\n title: state.title\n }\n}\n\nexport default connect(mapStateToProps)(Title)\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nconst start = 'Be sure to keep your titles within 50-60 characters.'\nconst warning = 'Be sure to keep your titles within 50-60 characters. Currently it is:'\nconst perfect = 'Great work, your title is the ideal length!'\n\nlet characterCount = ''\nlet textColor = 'defaultColor'\nlet text = start\n\nclass TitleCharCount extends React.Component {\n render () {\n if (this.props.title) {\n characterCount = this.props.title.length\n } else {\n characterCount = 0\n }\n\n if (characterCount === 0) {\n textColor = 'defaultColor'\n text = start\n } else if (characterCount < 50 || characterCount > 60) {\n textColor = 'warningColor'\n text = warning\n } else if (characterCount > 50 || characterCount < 60) {\n textColor = 'optimalColor'\n text = perfect\n }\n\n return (\n <div>\n <p className={textColor}>{text} {characterCount} characters</p>\n </div>\n )\n }\n}\n\nconst mapStateToProps = state => {\n return {\n title: state.title\n }\n}\n\nexport default connect(mapStateToProps)(TitleCharCount)\n","import React from 'react'\nimport { connect } from 'react-redux'\nimport { collectUrl } from '../actions'\n\nfunction handleChange (e, dispatch) {\n dispatch(collectUrl(e.target.value))\n}\n\nclass Url extends React.Component {\n render () {\n return (\n <div>\n <p className=\"url-label\">URL</p>\n <div className=\"group\">\n <input\n type=\"text\"\n id=\"url\"\n className=\"url-input\"\n placeholder=\"Write Your URL Here\"\n onChange={e => handleChange(e, this.props.dispatch)}\n >\n </input>\n </div>\n </div>\n )\n }\n}\n\nconst mapStateToProps = state => {\n return {\n url: state.url\n }\n}\n\nexport default connect(mapStateToProps)(Url)\n","import firebase from 'firebase'\n\nconst firebaseConfig = {\n apiKey: 'AIzaSyDlvYyJk13Oa2dIb5TlmuFRvTyfTZ6b-44',\n authDomain: 'meta-data-checker.firebaseapp.com',\n databaseURL: 'https://meta-data-checker.firebaseio.com',\n projectId: 'meta-data-checker',\n storageBucket: 'meta-data-checker.appspot.com',\n messagingSenderId: '275652737293',\n appId: '1:275652737293:web:e32267586219ff64bb1844',\n measurementId: 'G-BP0VV7EMG4'\n}\n\nconst db = firebase.initializeApp(firebaseConfig)\n\nexport default db\n","import React from 'react'\nimport ReactDOM from 'react-dom'\nimport { applyMiddleware, compose, createStore } from 'redux'\nimport { Provider } from 'react-redux'\nimport thunkMiddleware from 'redux-thunk'\n\nimport App from './components/App'\nimport reducers from './reducers'\n\nconst composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose\nconst store = createStore(\n reducers,\n composeEnhancers(applyMiddleware(thunkMiddleware))\n)\n\nReactDOM.render(\n <Provider store={store}>\n <App />\n </Provider>,\n document.getElementById('app')\n)\n","import { COLLECT_DESCRIPTION} from '../actions'\n\nexport default function collectDescription (state = 'Write your meta titles and descriptions here so you can preview how it might look when users see your website in Search Result Pages. ', action) {\n switch (action.type) {\n case COLLECT_DESCRIPTION:\n return action.description\n default:\n return state\n }\n}\n","import { combineReducers } from 'redux'\nimport title from './title'\nimport description from './description'\nimport url from './url'\n\nexport default combineReducers({\n title,\n description,\n url\n})\n","import { COLLECT_TITLE } from '../actions'\n\nexport default function collectTitle (state = 'Meta Data Checker | Preview and Edit Your Tags Here', action) {\n switch (action.type) {\n case COLLECT_TITLE:\n return action.title\n default:\n return state\n }\n}\n","import { COLLECT_URL } from '../actions'\n\nexport default function collectUrl (state = 'http://localhost:3000/', action) {\n switch (action.type) {\n case COLLECT_URL:\n return action.url\n default:\n return state\n }\n}\n","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","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\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","export default function _extends() {\n _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\n return _extends.apply(this, arguments);\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\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\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","import { __awaiter, __generator, __assign } from 'tslib';\nimport firebase from '@firebase/app';\nimport '@firebase/installations';\nimport { Logger } from '@firebase/logger';\nimport { ErrorFactory, calculateBackoffMillis, FirebaseError, validateIndexedDBOpenable, isIndexedDBAvailable, isBrowserExtension, areCookiesEnabled } from '@firebase/util';\nimport { Component } from '@firebase/component';\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// Key to attach FID to in gtag params.\r\nvar GA_FID_KEY = 'firebase_id';\r\nvar ORIGIN_KEY = 'origin';\r\nvar FETCH_TIMEOUT_MILLIS = 60 * 1000;\r\nvar DYNAMIC_CONFIG_URL = 'https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig';\r\nvar GTAG_URL = 'https://www.googletagmanager.com/gtag/js';\r\nvar GtagCommand;\r\n(function (GtagCommand) {\r\n GtagCommand[\"EVENT\"] = \"event\";\r\n GtagCommand[\"SET\"] = \"set\";\r\n GtagCommand[\"CONFIG\"] = \"config\";\r\n})(GtagCommand || (GtagCommand = {}));\r\n/*\r\n * Officially recommended event names for gtag.js\r\n * Any other string is also allowed.\r\n */\r\nvar EventName;\r\n(function (EventName) {\r\n EventName[\"ADD_SHIPPING_INFO\"] = \"add_shipping_info\";\r\n EventName[\"ADD_PAYMENT_INFO\"] = \"add_payment_info\";\r\n EventName[\"ADD_TO_CART\"] = \"add_to_cart\";\r\n EventName[\"ADD_TO_WISHLIST\"] = \"add_to_wishlist\";\r\n EventName[\"BEGIN_CHECKOUT\"] = \"begin_checkout\";\r\n /** @deprecated */\r\n EventName[\"CHECKOUT_PROGRESS\"] = \"checkout_progress\";\r\n EventName[\"EXCEPTION\"] = \"exception\";\r\n EventName[\"GENERATE_LEAD\"] = \"generate_lead\";\r\n EventName[\"LOGIN\"] = \"login\";\r\n EventName[\"PAGE_VIEW\"] = \"page_view\";\r\n EventName[\"PURCHASE\"] = \"purchase\";\r\n EventName[\"REFUND\"] = \"refund\";\r\n EventName[\"REMOVE_FROM_CART\"] = \"remove_from_cart\";\r\n EventName[\"SCREEN_VIEW\"] = \"screen_view\";\r\n EventName[\"SEARCH\"] = \"search\";\r\n EventName[\"SELECT_CONTENT\"] = \"select_content\";\r\n EventName[\"SELECT_ITEM\"] = \"select_item\";\r\n EventName[\"SELECT_PROMOTION\"] = \"select_promotion\";\r\n /** @deprecated */\r\n EventName[\"SET_CHECKOUT_OPTION\"] = \"set_checkout_option\";\r\n EventName[\"SHARE\"] = \"share\";\r\n EventName[\"SIGN_UP\"] = \"sign_up\";\r\n EventName[\"TIMING_COMPLETE\"] = \"timing_complete\";\r\n EventName[\"VIEW_CART\"] = \"view_cart\";\r\n EventName[\"VIEW_ITEM\"] = \"view_item\";\r\n EventName[\"VIEW_ITEM_LIST\"] = \"view_item_list\";\r\n EventName[\"VIEW_PROMOTION\"] = \"view_promotion\";\r\n EventName[\"VIEW_SEARCH_RESULTS\"] = \"view_search_results\";\r\n})(EventName || (EventName = {}));\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Logs an analytics event through the Firebase SDK.\r\n *\r\n * @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event\r\n * @param eventName Google Analytics event name, choose from standard list or use a custom string.\r\n * @param eventParams Analytics event parameters.\r\n */\r\nfunction logEvent(gtagFunction, initializationPromise, eventName, eventParams, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var measurementId, params;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!(options && options.global)) return [3 /*break*/, 1];\r\n gtagFunction(GtagCommand.EVENT, eventName, eventParams);\r\n return [2 /*return*/];\r\n case 1: return [4 /*yield*/, initializationPromise];\r\n case 2:\r\n measurementId = _a.sent();\r\n params = __assign(__assign({}, eventParams), { 'send_to': measurementId });\r\n gtagFunction(GtagCommand.EVENT, eventName, params);\r\n _a.label = 3;\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Set screen_name parameter for this Google Analytics ID.\r\n *\r\n * @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event\r\n * @param screenName Screen name string to set.\r\n */\r\nfunction setCurrentScreen(gtagFunction, initializationPromise, screenName, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var measurementId;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!(options && options.global)) return [3 /*break*/, 1];\r\n gtagFunction(GtagCommand.SET, { 'screen_name': screenName });\r\n return [2 /*return*/, Promise.resolve()];\r\n case 1: return [4 /*yield*/, initializationPromise];\r\n case 2:\r\n measurementId = _a.sent();\r\n gtagFunction(GtagCommand.CONFIG, measurementId, {\r\n update: true,\r\n 'screen_name': screenName\r\n });\r\n _a.label = 3;\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Set user_id parameter for this Google Analytics ID.\r\n *\r\n * @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event\r\n * @param id User ID string to set\r\n */\r\nfunction setUserId(gtagFunction, initializationPromise, id, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var measurementId;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!(options && options.global)) return [3 /*break*/, 1];\r\n gtagFunction(GtagCommand.SET, { 'user_id': id });\r\n return [2 /*return*/, Promise.resolve()];\r\n case 1: return [4 /*yield*/, initializationPromise];\r\n case 2:\r\n measurementId = _a.sent();\r\n gtagFunction(GtagCommand.CONFIG, measurementId, {\r\n update: true,\r\n 'user_id': id\r\n });\r\n _a.label = 3;\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Set all other user properties other than user_id and screen_name.\r\n *\r\n * @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event\r\n * @param properties Map of user properties to set\r\n */\r\nfunction setUserProperties(gtagFunction, initializationPromise, properties, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var flatProperties, _i, _a, key, measurementId;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n if (!(options && options.global)) return [3 /*break*/, 1];\r\n flatProperties = {};\r\n for (_i = 0, _a = Object.keys(properties); _i < _a.length; _i++) {\r\n key = _a[_i];\r\n // use dot notation for merge behavior in gtag.js\r\n flatProperties[\"user_properties.\" + key] = properties[key];\r\n }\r\n gtagFunction(GtagCommand.SET, flatProperties);\r\n return [2 /*return*/, Promise.resolve()];\r\n case 1: return [4 /*yield*/, initializationPromise];\r\n case 2:\r\n measurementId = _b.sent();\r\n gtagFunction(GtagCommand.CONFIG, measurementId, {\r\n update: true,\r\n 'user_properties': properties\r\n });\r\n _b.label = 3;\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Set whether collection is enabled for this ID.\r\n *\r\n * @param enabled If true, collection is enabled for this ID.\r\n */\r\nfunction setAnalyticsCollectionEnabled(initializationPromise, enabled) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var measurementId;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, initializationPromise];\r\n case 1:\r\n measurementId = _a.sent();\r\n window[\"ga-disable-\" + measurementId] = !enabled;\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar logger = new Logger('@firebase/analytics');\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Inserts gtag script tag into the page to asynchronously download gtag.\r\n * @param dataLayerName Name of datalayer (most often the default, \"_dataLayer\").\r\n */\r\nfunction insertScriptTag(dataLayerName) {\r\n var script = document.createElement('script');\r\n // We are not providing an analyticsId in the URL because it would trigger a `page_view`\r\n // without fid. We will initialize ga-id using gtag (config) command together with fid.\r\n script.src = GTAG_URL + \"?l=\" + dataLayerName;\r\n script.async = true;\r\n document.head.appendChild(script);\r\n}\r\n/**\r\n * Get reference to, or create, global datalayer.\r\n * @param dataLayerName Name of datalayer (most often the default, \"_dataLayer\").\r\n */\r\nfunction getOrCreateDataLayer(dataLayerName) {\r\n // Check for existing dataLayer and create if needed.\r\n var dataLayer = [];\r\n if (Array.isArray(window[dataLayerName])) {\r\n dataLayer = window[dataLayerName];\r\n }\r\n else {\r\n window[dataLayerName] = dataLayer;\r\n }\r\n return dataLayer;\r\n}\r\n/**\r\n * Wrapped gtag logic when gtag is called with 'config' command.\r\n *\r\n * @param gtagCore Basic gtag function that just appends to dataLayer.\r\n * @param initializationPromisesMap Map of appIds to their initialization promises.\r\n * @param dynamicConfigPromisesList Array of dynamic config fetch promises.\r\n * @param measurementIdToAppId Map of GA measurementIDs to corresponding Firebase appId.\r\n * @param measurementId GA Measurement ID to set config for.\r\n * @param gtagParams Gtag config params to set.\r\n */\r\nfunction gtagOnConfig(gtagCore, initializationPromisesMap, dynamicConfigPromisesList, measurementIdToAppId, measurementId, gtagParams) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var correspondingAppId, dynamicConfigResults, foundConfig, e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n correspondingAppId = measurementIdToAppId[measurementId];\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 7, , 8]);\r\n if (!correspondingAppId) return [3 /*break*/, 3];\r\n return [4 /*yield*/, initializationPromisesMap[correspondingAppId]];\r\n case 2:\r\n _a.sent();\r\n return [3 /*break*/, 6];\r\n case 3: return [4 /*yield*/, Promise.all(dynamicConfigPromisesList)];\r\n case 4:\r\n dynamicConfigResults = _a.sent();\r\n foundConfig = dynamicConfigResults.find(function (config) { return config.measurementId === measurementId; });\r\n if (!foundConfig) return [3 /*break*/, 6];\r\n return [4 /*yield*/, initializationPromisesMap[foundConfig.appId]];\r\n case 5:\r\n _a.sent();\r\n _a.label = 6;\r\n case 6: return [3 /*break*/, 8];\r\n case 7:\r\n e_1 = _a.sent();\r\n logger.error(e_1);\r\n return [3 /*break*/, 8];\r\n case 8:\r\n gtagCore(GtagCommand.CONFIG, measurementId, gtagParams);\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Wrapped gtag logic when gtag is called with 'event' command.\r\n *\r\n * @param gtagCore Basic gtag function that just appends to dataLayer.\r\n * @param initializationPromisesMap Map of appIds to their initialization promises.\r\n * @param dynamicConfigPromisesList Array of dynamic config fetch promises.\r\n * @param measurementId GA Measurement ID to log event to.\r\n * @param gtagParams Params to log with this event.\r\n */\r\nfunction gtagOnEvent(gtagCore, initializationPromisesMap, dynamicConfigPromisesList, measurementId, gtagParams) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var initializationPromisesToWaitFor, gaSendToList, dynamicConfigResults, _loop_1, _i, gaSendToList_1, sendToId, state_1, e_2;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 4, , 5]);\r\n initializationPromisesToWaitFor = [];\r\n if (!(gtagParams && gtagParams['send_to'])) return [3 /*break*/, 2];\r\n gaSendToList = gtagParams['send_to'];\r\n // Make it an array if is isn't, so it can be dealt with the same way.\r\n if (!Array.isArray(gaSendToList)) {\r\n gaSendToList = [gaSendToList];\r\n }\r\n return [4 /*yield*/, Promise.all(dynamicConfigPromisesList)];\r\n case 1:\r\n dynamicConfigResults = _a.sent();\r\n _loop_1 = function (sendToId) {\r\n // Any fetched dynamic measurement ID that matches this 'send_to' ID\r\n var foundConfig = dynamicConfigResults.find(function (config) { return config.measurementId === sendToId; });\r\n var initializationPromise = foundConfig && initializationPromisesMap[foundConfig.appId];\r\n if (initializationPromise) {\r\n initializationPromisesToWaitFor.push(initializationPromise);\r\n }\r\n else {\r\n // Found an item in 'send_to' that is not associated\r\n // directly with an FID, possibly a group. Empty this array,\r\n // exit the loop early, and let it get populated below.\r\n initializationPromisesToWaitFor = [];\r\n return \"break\";\r\n }\r\n };\r\n for (_i = 0, gaSendToList_1 = gaSendToList; _i < gaSendToList_1.length; _i++) {\r\n sendToId = gaSendToList_1[_i];\r\n state_1 = _loop_1(sendToId);\r\n if (state_1 === \"break\")\r\n break;\r\n }\r\n _a.label = 2;\r\n case 2:\r\n // This will be unpopulated if there was no 'send_to' field , or\r\n // if not all entries in the 'send_to' field could be mapped to\r\n // a FID. In these cases, wait on all pending initialization promises.\r\n if (initializationPromisesToWaitFor.length === 0) {\r\n initializationPromisesToWaitFor = Object.values(initializationPromisesMap);\r\n }\r\n // Run core gtag function with args after all relevant initialization\r\n // promises have been resolved.\r\n return [4 /*yield*/, Promise.all(initializationPromisesToWaitFor)];\r\n case 3:\r\n // Run core gtag function with args after all relevant initialization\r\n // promises have been resolved.\r\n _a.sent();\r\n // Workaround for http://b/141370449 - third argument cannot be undefined.\r\n gtagCore(GtagCommand.EVENT, measurementId, gtagParams || {});\r\n return [3 /*break*/, 5];\r\n case 4:\r\n e_2 = _a.sent();\r\n logger.error(e_2);\r\n return [3 /*break*/, 5];\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Wraps a standard gtag function with extra code to wait for completion of\r\n * relevant initialization promises before sending requests.\r\n *\r\n * @param gtagCore Basic gtag function that just appends to dataLayer.\r\n * @param initializationPromisesMap Map of appIds to their initialization promises.\r\n * @param dynamicConfigPromisesList Array of dynamic config fetch promises.\r\n * @param measurementIdToAppId Map of GA measurementIDs to corresponding Firebase appId.\r\n */\r\nfunction wrapGtag(gtagCore, \r\n/**\r\n * Allows wrapped gtag calls to wait on whichever intialization promises are required,\r\n * depending on the contents of the gtag params' `send_to` field, if any.\r\n */\r\ninitializationPromisesMap, \r\n/**\r\n * Wrapped gtag calls sometimes require all dynamic config fetches to have returned\r\n * before determining what initialization promises (which include FIDs) to wait for.\r\n */\r\ndynamicConfigPromisesList, \r\n/**\r\n * Wrapped gtag config calls can narrow down which initialization promise (with FID)\r\n * to wait for if the measurementId is already fetched, by getting the corresponding appId,\r\n * which is the key for the initialization promises map.\r\n */\r\nmeasurementIdToAppId) {\r\n /**\r\n * Wrapper around gtag that ensures FID is sent with gtag calls.\r\n * @param command Gtag command type.\r\n * @param idOrNameOrParams Measurement ID if command is EVENT/CONFIG, params if command is SET.\r\n * @param gtagParams Params if event is EVENT/CONFIG.\r\n */\r\n function gtagWrapper(command, idOrNameOrParams, gtagParams) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var e_3;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 6, , 7]);\r\n if (!(command === GtagCommand.EVENT)) return [3 /*break*/, 2];\r\n // If EVENT, second arg must be measurementId.\r\n return [4 /*yield*/, gtagOnEvent(gtagCore, initializationPromisesMap, dynamicConfigPromisesList, idOrNameOrParams, gtagParams)];\r\n case 1:\r\n // If EVENT, second arg must be measurementId.\r\n _a.sent();\r\n return [3 /*break*/, 5];\r\n case 2:\r\n if (!(command === GtagCommand.CONFIG)) return [3 /*break*/, 4];\r\n // If CONFIG, second arg must be measurementId.\r\n return [4 /*yield*/, gtagOnConfig(gtagCore, initializationPromisesMap, dynamicConfigPromisesList, measurementIdToAppId, idOrNameOrParams, gtagParams)];\r\n case 3:\r\n // If CONFIG, second arg must be measurementId.\r\n _a.sent();\r\n return [3 /*break*/, 5];\r\n case 4:\r\n // If SET, second arg must be params.\r\n gtagCore(GtagCommand.SET, idOrNameOrParams);\r\n _a.label = 5;\r\n case 5: return [3 /*break*/, 7];\r\n case 6:\r\n e_3 = _a.sent();\r\n logger.error(e_3);\r\n return [3 /*break*/, 7];\r\n case 7: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n }\r\n return gtagWrapper;\r\n}\r\n/**\r\n * Creates global gtag function or wraps existing one if found.\r\n * This wrapped function attaches Firebase instance ID (FID) to gtag 'config' and\r\n * 'event' calls that belong to the GAID associated with this Firebase instance.\r\n *\r\n * @param initializationPromisesMap Map of appIds to their initialization promises.\r\n * @param dynamicConfigPromisesList Array of dynamic config fetch promises.\r\n * @param measurementIdToAppId Map of GA measurementIDs to corresponding Firebase appId.\r\n * @param dataLayerName Name of global GA datalayer array.\r\n * @param gtagFunctionName Name of global gtag function (\"gtag\" if not user-specified).\r\n */\r\nfunction wrapOrCreateGtag(initializationPromisesMap, dynamicConfigPromisesList, measurementIdToAppId, dataLayerName, gtagFunctionName) {\r\n // Create a basic core gtag function\r\n var gtagCore = function () {\r\n var _args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n _args[_i] = arguments[_i];\r\n }\r\n // Must push IArguments object, not an array.\r\n window[dataLayerName].push(arguments);\r\n };\r\n // Replace it with existing one if found\r\n if (window[gtagFunctionName] &&\r\n typeof window[gtagFunctionName] === 'function') {\r\n // @ts-ignore\r\n gtagCore = window[gtagFunctionName];\r\n }\r\n window[gtagFunctionName] = wrapGtag(gtagCore, initializationPromisesMap, dynamicConfigPromisesList, measurementIdToAppId);\r\n return {\r\n gtagCore: gtagCore,\r\n wrappedGtag: window[gtagFunctionName]\r\n };\r\n}\r\n/**\r\n * Returns first script tag in DOM matching our gtag url pattern.\r\n */\r\nfunction findGtagScriptOnPage() {\r\n var scriptTags = window.document.getElementsByTagName('script');\r\n for (var _i = 0, _a = Object.values(scriptTags); _i < _a.length; _i++) {\r\n var tag = _a[_i];\r\n if (tag.src && tag.src.includes(GTAG_URL)) {\r\n return tag;\r\n }\r\n }\r\n return null;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar _a;\r\nvar ERRORS = (_a = {},\r\n _a[\"already-exists\" /* ALREADY_EXISTS */] = 'A Firebase Analytics instance with the appId {$id} ' +\r\n ' already exists. ' +\r\n 'Only one Firebase Analytics instance can be created for each appId.',\r\n _a[\"already-initialized\" /* ALREADY_INITIALIZED */] = 'Firebase Analytics has already been initialized.' +\r\n 'settings() must be called before initializing any Analytics instance' +\r\n 'or it will have no effect.',\r\n _a[\"interop-component-reg-failed\" /* INTEROP_COMPONENT_REG_FAILED */] = 'Firebase Analytics Interop Component failed to instantiate: {$reason}',\r\n _a[\"invalid-analytics-context\" /* INVALID_ANALYTICS_CONTEXT */] = 'Firebase Analytics is not supported in this environment. ' +\r\n 'Wrap initialization of analytics in analytics.isSupported() ' +\r\n 'to prevent initialization in unsupported environments. Details: {$errorInfo}',\r\n _a[\"indexeddb-unavailable\" /* INDEXEDDB_UNAVAILABLE */] = 'IndexedDB unavailable or restricted in this environment. ' +\r\n 'Wrap initialization of analytics in analytics.isSupported() ' +\r\n 'to prevent initialization in unsupported environments. Details: {$errorInfo}',\r\n _a[\"fetch-throttle\" /* FETCH_THROTTLE */] = 'The config fetch request timed out while in an exponential backoff state.' +\r\n ' Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.',\r\n _a[\"config-fetch-failed\" /* CONFIG_FETCH_FAILED */] = 'Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}',\r\n _a[\"no-api-key\" /* NO_API_KEY */] = 'The \"apiKey\" field is empty in the local Firebase config. Firebase Analytics requires this field to' +\r\n 'contain a valid API key.',\r\n _a[\"no-app-id\" /* NO_APP_ID */] = 'The \"appId\" field is empty in the local Firebase config. Firebase Analytics requires this field to' +\r\n 'contain a valid app ID.',\r\n _a);\r\nvar ERROR_FACTORY = new ErrorFactory('analytics', 'Analytics', ERRORS);\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Backoff factor for 503 errors, which we want to be conservative about\r\n * to avoid overloading servers. Each retry interval will be\r\n * BASE_INTERVAL_MILLIS * LONG_RETRY_FACTOR ^ retryCount, so the second one\r\n * will be ~30 seconds (with fuzzing).\r\n */\r\nvar LONG_RETRY_FACTOR = 30;\r\n/**\r\n * Base wait interval to multiplied by backoffFactor^backoffCount.\r\n */\r\nvar BASE_INTERVAL_MILLIS = 1000;\r\n/**\r\n * Stubbable retry data storage class.\r\n */\r\nvar RetryData = /** @class */ (function () {\r\n function RetryData(throttleMetadata, intervalMillis) {\r\n if (throttleMetadata === void 0) { throttleMetadata = {}; }\r\n if (intervalMillis === void 0) { intervalMillis = BASE_INTERVAL_MILLIS; }\r\n this.throttleMetadata = throttleMetadata;\r\n this.intervalMillis = intervalMillis;\r\n }\r\n RetryData.prototype.getThrottleMetadata = function (appId) {\r\n return this.throttleMetadata[appId];\r\n };\r\n RetryData.prototype.setThrottleMetadata = function (appId, metadata) {\r\n this.throttleMetadata[appId] = metadata;\r\n };\r\n RetryData.prototype.deleteThrottleMetadata = function (appId) {\r\n delete this.throttleMetadata[appId];\r\n };\r\n return RetryData;\r\n}());\r\nvar defaultRetryData = new RetryData();\r\n/**\r\n * Set GET request headers.\r\n * @param apiKey App API key.\r\n */\r\nfunction getHeaders(apiKey) {\r\n return new Headers({\r\n Accept: 'application/json',\r\n 'x-goog-api-key': apiKey\r\n });\r\n}\r\n/**\r\n * Fetches dynamic config from backend.\r\n * @param app Firebase app to fetch config for.\r\n */\r\nfunction fetchDynamicConfig(appFields) {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var appId, apiKey, request, appUrl, response, errorMessage, jsonResponse, _ignored_1;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n appId = appFields.appId, apiKey = appFields.apiKey;\r\n request = {\r\n method: 'GET',\r\n headers: getHeaders(apiKey)\r\n };\r\n appUrl = DYNAMIC_CONFIG_URL.replace('{app-id}', appId);\r\n return [4 /*yield*/, fetch(appUrl, request)];\r\n case 1:\r\n response = _b.sent();\r\n if (!(response.status !== 200 && response.status !== 304)) return [3 /*break*/, 6];\r\n errorMessage = '';\r\n _b.label = 2;\r\n case 2:\r\n _b.trys.push([2, 4, , 5]);\r\n return [4 /*yield*/, response.json()];\r\n case 3:\r\n jsonResponse = (_b.sent());\r\n if ((_a = jsonResponse.error) === null || _a === void 0 ? void 0 : _a.message) {\r\n errorMessage = jsonResponse.error.message;\r\n }\r\n return [3 /*break*/, 5];\r\n case 4:\r\n _ignored_1 = _b.sent();\r\n return [3 /*break*/, 5];\r\n case 5: throw ERROR_FACTORY.create(\"config-fetch-failed\" /* CONFIG_FETCH_FAILED */, {\r\n httpStatus: response.status,\r\n responseMessage: errorMessage\r\n });\r\n case 6: return [2 /*return*/, response.json()];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Fetches dynamic config from backend, retrying if failed.\r\n * @param app Firebase app to fetch config for.\r\n */\r\nfunction fetchDynamicConfigWithRetry(app, \r\n// retryData and timeoutMillis are parameterized to allow passing a different value for testing.\r\nretryData, timeoutMillis) {\r\n if (retryData === void 0) { retryData = defaultRetryData; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _a, appId, apiKey, measurementId, throttleMetadata, signal;\r\n var _this = this;\r\n return __generator(this, function (_b) {\r\n _a = app.options, appId = _a.appId, apiKey = _a.apiKey, measurementId = _a.measurementId;\r\n if (!appId) {\r\n throw ERROR_FACTORY.create(\"no-app-id\" /* NO_APP_ID */);\r\n }\r\n if (!apiKey) {\r\n if (measurementId) {\r\n return [2 /*return*/, {\r\n measurementId: measurementId,\r\n appId: appId\r\n }];\r\n }\r\n throw ERROR_FACTORY.create(\"no-api-key\" /* NO_API_KEY */);\r\n }\r\n throttleMetadata = retryData.getThrottleMetadata(appId) || {\r\n backoffCount: 0,\r\n throttleEndTimeMillis: Date.now()\r\n };\r\n signal = new AnalyticsAbortSignal();\r\n setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n // Note a very low delay, eg < 10ms, can elapse before listeners are initialized.\r\n signal.abort();\r\n return [2 /*return*/];\r\n });\r\n }); }, timeoutMillis !== undefined ? timeoutMillis : FETCH_TIMEOUT_MILLIS);\r\n return [2 /*return*/, attemptFetchDynamicConfigWithRetry({ appId: appId, apiKey: apiKey, measurementId: measurementId }, throttleMetadata, signal, retryData)];\r\n });\r\n });\r\n}\r\n/**\r\n * Runs one retry attempt.\r\n * @param appFields Necessary app config fields.\r\n * @param throttleMetadata Ongoing metadata to determine throttling times.\r\n * @param signal Abort signal.\r\n */\r\nfunction attemptFetchDynamicConfigWithRetry(appFields, _a, signal, retryData // for testing\r\n) {\r\n var throttleEndTimeMillis = _a.throttleEndTimeMillis, backoffCount = _a.backoffCount;\r\n if (retryData === void 0) { retryData = defaultRetryData; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var appId, measurementId, e_1, response, e_2, backoffMillis, throttleMetadata;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n appId = appFields.appId, measurementId = appFields.measurementId;\r\n _b.label = 1;\r\n case 1:\r\n _b.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, setAbortableTimeout(signal, throttleEndTimeMillis)];\r\n case 2:\r\n _b.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n e_1 = _b.sent();\r\n if (measurementId) {\r\n logger.warn(\"Timed out fetching this Firebase app's measurement ID from the server.\" +\r\n (\" Falling back to the measurement ID \" + measurementId) +\r\n (\" provided in the \\\"measurementId\\\" field in the local Firebase config. [\" + e_1.message + \"]\"));\r\n return [2 /*return*/, { appId: appId, measurementId: measurementId }];\r\n }\r\n throw e_1;\r\n case 4:\r\n _b.trys.push([4, 6, , 7]);\r\n return [4 /*yield*/, fetchDynamicConfig(appFields)];\r\n case 5:\r\n response = _b.sent();\r\n // Note the SDK only clears throttle state if response is success or non-retriable.\r\n retryData.deleteThrottleMetadata(appId);\r\n return [2 /*return*/, response];\r\n case 6:\r\n e_2 = _b.sent();\r\n if (!isRetriableError(e_2)) {\r\n retryData.deleteThrottleMetadata(appId);\r\n if (measurementId) {\r\n logger.warn(\"Failed to fetch this Firebase app's measurement ID from the server.\" +\r\n (\" Falling back to the measurement ID \" + measurementId) +\r\n (\" provided in the \\\"measurementId\\\" field in the local Firebase config. [\" + e_2.message + \"]\"));\r\n return [2 /*return*/, { appId: appId, measurementId: measurementId }];\r\n }\r\n else {\r\n throw e_2;\r\n }\r\n }\r\n backoffMillis = Number(e_2.customData.httpStatus) === 503\r\n ? calculateBackoffMillis(backoffCount, retryData.intervalMillis, LONG_RETRY_FACTOR)\r\n : calculateBackoffMillis(backoffCount, retryData.intervalMillis);\r\n throttleMetadata = {\r\n throttleEndTimeMillis: Date.now() + backoffMillis,\r\n backoffCount: backoffCount + 1\r\n };\r\n // Persists state.\r\n retryData.setThrottleMetadata(appId, throttleMetadata);\r\n logger.debug(\"Calling attemptFetch again in \" + backoffMillis + \" millis\");\r\n return [2 /*return*/, attemptFetchDynamicConfigWithRetry(appFields, throttleMetadata, signal, retryData)];\r\n case 7: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Supports waiting on a backoff by:\r\n *\r\n * <ul>\r\n * <li>Promisifying setTimeout, so we can set a timeout in our Promise chain</li>\r\n * <li>Listening on a signal bus for abort events, just like the Fetch API</li>\r\n * <li>Failing in the same way the Fetch API fails, so timing out a live request and a throttled\r\n * request appear the same.</li>\r\n * </ul>\r\n *\r\n * <p>Visible for testing.\r\n */\r\nfunction setAbortableTimeout(signal, throttleEndTimeMillis) {\r\n return new Promise(function (resolve, reject) {\r\n // Derives backoff from given end time, normalizing negative numbers to zero.\r\n var backoffMillis = Math.max(throttleEndTimeMillis - Date.now(), 0);\r\n var timeout = setTimeout(resolve, backoffMillis);\r\n // Adds listener, rather than sets onabort, because signal is a shared object.\r\n signal.addEventListener(function () {\r\n clearTimeout(timeout);\r\n // If the request completes before this timeout, the rejection has no effect.\r\n reject(ERROR_FACTORY.create(\"fetch-throttle\" /* FETCH_THROTTLE */, {\r\n throttleEndTimeMillis: throttleEndTimeMillis\r\n }));\r\n });\r\n });\r\n}\r\n/**\r\n * Returns true if the {@link Error} indicates a fetch request may succeed later.\r\n */\r\nfunction isRetriableError(e) {\r\n if (!(e instanceof FirebaseError) || !e.customData) {\r\n return false;\r\n }\r\n // Uses string index defined by ErrorData, which FirebaseError implements.\r\n var httpStatus = Number(e.customData['httpStatus']);\r\n return (httpStatus === 429 ||\r\n httpStatus === 500 ||\r\n httpStatus === 503 ||\r\n httpStatus === 504);\r\n}\r\n/**\r\n * Shims a minimal AbortSignal (copied from Remote Config).\r\n *\r\n * <p>AbortController's AbortSignal conveniently decouples fetch timeout logic from other aspects\r\n * of networking, such as retries. Firebase doesn't use AbortController enough to justify a\r\n * polyfill recommendation, like we do with the Fetch API, but this minimal shim can easily be\r\n * swapped out if/when we do.\r\n */\r\nvar AnalyticsAbortSignal = /** @class */ (function () {\r\n function AnalyticsAbortSignal() {\r\n this.listeners = [];\r\n }\r\n AnalyticsAbortSignal.prototype.addEventListener = function (listener) {\r\n this.listeners.push(listener);\r\n };\r\n AnalyticsAbortSignal.prototype.abort = function () {\r\n this.listeners.forEach(function (listener) { return listener(); });\r\n };\r\n return AnalyticsAbortSignal;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction validateIndexedDB() {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!!isIndexedDBAvailable()) return [3 /*break*/, 1];\r\n logger.warn(ERROR_FACTORY.create(\"indexeddb-unavailable\" /* INDEXEDDB_UNAVAILABLE */, {\r\n errorInfo: 'IndexedDB is not available in this environment.'\r\n }).message);\r\n return [2 /*return*/, false];\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, validateIndexedDBOpenable()];\r\n case 2:\r\n _a.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n e_1 = _a.sent();\r\n logger.warn(ERROR_FACTORY.create(\"indexeddb-unavailable\" /* INDEXEDDB_UNAVAILABLE */, {\r\n errorInfo: e_1\r\n }).message);\r\n return [2 /*return*/, false];\r\n case 4: return [2 /*return*/, true];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Initialize the analytics instance in gtag.js by calling config command with fid.\r\n *\r\n * NOTE: We combine analytics initialization and setting fid together because we want fid to be\r\n * part of the `page_view` event that's sent during the initialization\r\n * @param app Firebase app\r\n * @param gtagCore The gtag function that's not wrapped.\r\n * @param dynamicConfigPromisesList Array of all dynamic config promises.\r\n * @param measurementIdToAppId Maps measurementID to appID.\r\n * @param installations FirebaseInstallations instance.\r\n *\r\n * @returns Measurement ID.\r\n */\r\nfunction initializeIds(app, dynamicConfigPromisesList, measurementIdToAppId, installations, gtagCore) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var dynamicConfigPromise, fidPromise, _a, dynamicConfig, fid, configProperties;\r\n var _b;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n dynamicConfigPromise = fetchDynamicConfigWithRetry(app);\r\n // Once fetched, map measurementIds to appId, for ease of lookup in wrapped gtag function.\r\n dynamicConfigPromise\r\n .then(function (config) {\r\n measurementIdToAppId[config.measurementId] = config.appId;\r\n if (app.options.measurementId &&\r\n config.measurementId !== app.options.measurementId) {\r\n logger.warn(\"The measurement ID in the local Firebase config (\" + app.options.measurementId + \")\" +\r\n (\" does not match the measurement ID fetched from the server (\" + config.measurementId + \").\") +\r\n \" To ensure analytics events are always sent to the correct Analytics property,\" +\r\n \" update the\" +\r\n \" measurement ID field in the local config or remove it from the local config.\");\r\n }\r\n })\r\n .catch(function (e) { return logger.error(e); });\r\n // Add to list to track state of all dynamic config promises.\r\n dynamicConfigPromisesList.push(dynamicConfigPromise);\r\n fidPromise = validateIndexedDB().then(function (envIsValid) {\r\n if (envIsValid) {\r\n return installations.getId();\r\n }\r\n else {\r\n return undefined;\r\n }\r\n });\r\n return [4 /*yield*/, Promise.all([\r\n dynamicConfigPromise,\r\n fidPromise\r\n ])];\r\n case 1:\r\n _a = _c.sent(), dynamicConfig = _a[0], fid = _a[1];\r\n // This command initializes gtag.js and only needs to be called once for the entire web app,\r\n // but since it is idempotent, we can call it multiple times.\r\n // We keep it together with other initialization logic for better code structure.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n gtagCore('js', new Date());\r\n configProperties = (_b = {},\r\n // guard against developers accidentally setting properties with prefix `firebase_`\r\n _b[ORIGIN_KEY] = 'firebase',\r\n _b.update = true,\r\n _b);\r\n if (fid != null) {\r\n configProperties[GA_FID_KEY] = fid;\r\n }\r\n // It should be the first config command called on this GA-ID\r\n // Initialize this GA-ID and set FID on it using the gtag config API.\r\n gtagCore(GtagCommand.CONFIG, dynamicConfig.measurementId, configProperties);\r\n return [2 /*return*/, dynamicConfig.measurementId];\r\n }\r\n });\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Maps appId to full initialization promise. Wrapped gtag calls must wait on\r\n * all or some of these, depending on the call's `send_to` param and the status\r\n * of the dynamic config fetches (see below).\r\n */\r\nvar initializationPromisesMap = {};\r\n/**\r\n * List of dynamic config fetch promises. In certain cases, wrapped gtag calls\r\n * wait on all these to be complete in order to determine if it can selectively\r\n * wait for only certain initialization (FID) promises or if it must wait for all.\r\n */\r\nvar dynamicConfigPromisesList = [];\r\n/**\r\n * Maps fetched measurementIds to appId. Populated when the app's dynamic config\r\n * fetch completes. If already populated, gtag config calls can use this to\r\n * selectively wait for only this app's initialization promise (FID) instead of all\r\n * initialization promises.\r\n */\r\nvar measurementIdToAppId = {};\r\n/**\r\n * Name for window global data layer array used by GA: defaults to 'dataLayer'.\r\n */\r\nvar dataLayerName = 'dataLayer';\r\n/**\r\n * Name for window global gtag function used by GA: defaults to 'gtag'.\r\n */\r\nvar gtagName = 'gtag';\r\n/**\r\n * Reproduction of standard gtag function or reference to existing\r\n * gtag function on window object.\r\n */\r\nvar gtagCoreFunction;\r\n/**\r\n * Wrapper around gtag function that ensures FID is sent with all\r\n * relevant event and config calls.\r\n */\r\nvar wrappedGtagFunction;\r\n/**\r\n * Flag to ensure page initialization steps (creation or wrapping of\r\n * dataLayer and gtag script) are only run once per page load.\r\n */\r\nvar globalInitDone = false;\r\n/**\r\n * For testing\r\n */\r\nfunction resetGlobalVars(newGlobalInitDone, newInitializationPromisesMap, newDynamicPromises) {\r\n if (newGlobalInitDone === void 0) { newGlobalInitDone = false; }\r\n if (newInitializationPromisesMap === void 0) { newInitializationPromisesMap = {}; }\r\n if (newDynamicPromises === void 0) { newDynamicPromises = []; }\r\n globalInitDone = newGlobalInitDone;\r\n initializationPromisesMap = newInitializationPromisesMap;\r\n dynamicConfigPromisesList = newDynamicPromises;\r\n dataLayerName = 'dataLayer';\r\n gtagName = 'gtag';\r\n}\r\n/**\r\n * For testing\r\n */\r\nfunction getGlobalVars() {\r\n return {\r\n initializationPromisesMap: initializationPromisesMap,\r\n dynamicConfigPromisesList: dynamicConfigPromisesList\r\n };\r\n}\r\n/**\r\n * This must be run before calling firebase.analytics() or it won't\r\n * have any effect.\r\n * @param options Custom gtag and dataLayer names.\r\n */\r\nfunction settings(options) {\r\n if (globalInitDone) {\r\n throw ERROR_FACTORY.create(\"already-initialized\" /* ALREADY_INITIALIZED */);\r\n }\r\n if (options.dataLayerName) {\r\n dataLayerName = options.dataLayerName;\r\n }\r\n if (options.gtagName) {\r\n gtagName = options.gtagName;\r\n }\r\n}\r\n/**\r\n * Returns true if no environment mismatch is found.\r\n * If environment mismatches are found, throws an INVALID_ANALYTICS_CONTEXT\r\n * error that also lists details for each mismatch found.\r\n */\r\nfunction warnOnBrowserContextMismatch() {\r\n var mismatchedEnvMessages = [];\r\n if (isBrowserExtension()) {\r\n mismatchedEnvMessages.push('This is a browser extension environment.');\r\n }\r\n if (!areCookiesEnabled()) {\r\n mismatchedEnvMessages.push('Cookies are not available.');\r\n }\r\n if (mismatchedEnvMessages.length > 0) {\r\n var details = mismatchedEnvMessages\r\n .map(function (message, index) { return \"(\" + (index + 1) + \") \" + message; })\r\n .join(' ');\r\n var err = ERROR_FACTORY.create(\"invalid-analytics-context\" /* INVALID_ANALYTICS_CONTEXT */, {\r\n errorInfo: details\r\n });\r\n logger.warn(err.message);\r\n }\r\n}\r\nfunction factory(app, installations) {\r\n warnOnBrowserContextMismatch();\r\n var appId = app.options.appId;\r\n if (!appId) {\r\n throw ERROR_FACTORY.create(\"no-app-id\" /* NO_APP_ID */);\r\n }\r\n if (!app.options.apiKey) {\r\n if (app.options.measurementId) {\r\n logger.warn(\"The \\\"apiKey\\\" field is empty in the local Firebase config. This is needed to fetch the latest\" +\r\n (\" measurement ID for this Firebase app. Falling back to the measurement ID \" + app.options.measurementId) +\r\n \" provided in the \\\"measurementId\\\" field in the local Firebase config.\");\r\n }\r\n else {\r\n throw ERROR_FACTORY.create(\"no-api-key\" /* NO_API_KEY */);\r\n }\r\n }\r\n if (initializationPromisesMap[appId] != null) {\r\n throw ERROR_FACTORY.create(\"already-exists\" /* ALREADY_EXISTS */, {\r\n id: appId\r\n });\r\n }\r\n if (!globalInitDone) {\r\n // Steps here should only be done once per page: creation or wrapping\r\n // of dataLayer and global gtag function.\r\n // Detect if user has already put the gtag <script> tag on this page.\r\n if (!findGtagScriptOnPage()) {\r\n insertScriptTag(dataLayerName);\r\n }\r\n getOrCreateDataLayer(dataLayerName);\r\n var _a = wrapOrCreateGtag(initializationPromisesMap, dynamicConfigPromisesList, measurementIdToAppId, dataLayerName, gtagName), wrappedGtag = _a.wrappedGtag, gtagCore = _a.gtagCore;\r\n wrappedGtagFunction = wrappedGtag;\r\n gtagCoreFunction = gtagCore;\r\n globalInitDone = true;\r\n }\r\n // Async but non-blocking.\r\n // This map reflects the completion state of all promises for each appId.\r\n initializationPromisesMap[appId] = initializeIds(app, dynamicConfigPromisesList, measurementIdToAppId, installations, gtagCoreFunction);\r\n var analyticsInstance = {\r\n app: app,\r\n // Public methods return void for API simplicity and to better match gtag,\r\n // while internal implementations return promises.\r\n logEvent: function (eventName, eventParams, options) {\r\n logEvent(wrappedGtagFunction, initializationPromisesMap[appId], eventName, eventParams, options).catch(function (e) { return logger.error(e); });\r\n },\r\n setCurrentScreen: function (screenName, options) {\r\n setCurrentScreen(wrappedGtagFunction, initializationPromisesMap[appId], screenName, options).catch(function (e) { return logger.error(e); });\r\n },\r\n setUserId: function (id, options) {\r\n setUserId(wrappedGtagFunction, initializationPromisesMap[appId], id, options).catch(function (e) { return logger.error(e); });\r\n },\r\n setUserProperties: function (properties, options) {\r\n setUserProperties(wrappedGtagFunction, initializationPromisesMap[appId], properties, options).catch(function (e) { return logger.error(e); });\r\n },\r\n setAnalyticsCollectionEnabled: function (enabled) {\r\n setAnalyticsCollectionEnabled(initializationPromisesMap[appId], enabled).catch(function (e) { return logger.error(e); });\r\n },\r\n INTERNAL: {\r\n delete: function () {\r\n delete initializationPromisesMap[appId];\r\n return Promise.resolve();\r\n }\r\n }\r\n };\r\n return analyticsInstance;\r\n}\n\nvar name = \"@firebase/analytics\";\nvar version = \"0.6.1\";\n\n/**\r\n * Type constant for Firebase Analytics.\r\n */\r\nvar ANALYTICS_TYPE = 'analytics';\r\nfunction registerAnalytics(instance) {\r\n instance.INTERNAL.registerComponent(new Component(ANALYTICS_TYPE, function (container) {\r\n // getImmediate for FirebaseApp will always succeed\r\n var app = container.getProvider('app').getImmediate();\r\n var installations = container\r\n .getProvider('installations')\r\n .getImmediate();\r\n return factory(app, installations);\r\n }, \"PUBLIC\" /* PUBLIC */).setServiceProps({\r\n settings: settings,\r\n EventName: EventName,\r\n isSupported: isSupported\r\n }));\r\n instance.INTERNAL.registerComponent(new Component('analytics-internal', internalFactory, \"PRIVATE\" /* PRIVATE */));\r\n instance.registerVersion(name, version);\r\n function internalFactory(container) {\r\n try {\r\n var analytics = container.getProvider(ANALYTICS_TYPE).getImmediate();\r\n return {\r\n logEvent: analytics.logEvent\r\n };\r\n }\r\n catch (e) {\r\n throw ERROR_FACTORY.create(\"interop-component-reg-failed\" /* INTEROP_COMPONENT_REG_FAILED */, {\r\n reason: e\r\n });\r\n }\r\n }\r\n}\r\nregisterAnalytics(firebase);\r\n/**\r\n * this is a public static method provided to users that wraps four different checks:\r\n *\r\n * 1. check if it's not a browser extension environment.\r\n * 1. check if cookie is enabled in current browser.\r\n * 3. check if IndexedDB is supported by the browser environment.\r\n * 4. check if the current browser context is valid for using IndexedDB.\r\n *\r\n */\r\nfunction isSupported() {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var isDBOpenable, error_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (isBrowserExtension()) {\r\n return [2 /*return*/, false];\r\n }\r\n if (!areCookiesEnabled()) {\r\n return [2 /*return*/, false];\r\n }\r\n if (!isIndexedDBAvailable()) {\r\n return [2 /*return*/, false];\r\n }\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, validateIndexedDBOpenable()];\r\n case 2:\r\n isDBOpenable = _a.sent();\r\n return [2 /*return*/, isDBOpenable];\r\n case 3:\r\n error_1 = _a.sent();\r\n return [2 /*return*/, false];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\n\nexport { factory, getGlobalVars, registerAnalytics, resetGlobalVars, settings };\n//# sourceMappingURL=index.esm.js.map\n","import { __values, __assign } from 'tslib';\nimport { ErrorFactory, deepCopy, contains, deepExtend, createSubscribe, isBrowser, isNode } from '@firebase/util';\nimport { ComponentContainer, Component } from '@firebase/component';\nimport { Logger, setLogLevel, setUserLogHandler } from '@firebase/logger';\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar _a;\r\nvar ERRORS = (_a = {},\r\n _a[\"no-app\" /* NO_APP */] = \"No Firebase App '{$appName}' has been created - \" +\r\n 'call Firebase App.initializeApp()',\r\n _a[\"bad-app-name\" /* BAD_APP_NAME */] = \"Illegal App name: '{$appName}\",\r\n _a[\"duplicate-app\" /* DUPLICATE_APP */] = \"Firebase App named '{$appName}' already exists\",\r\n _a[\"app-deleted\" /* APP_DELETED */] = \"Firebase App named '{$appName}' already deleted\",\r\n _a[\"invalid-app-argument\" /* INVALID_APP_ARGUMENT */] = 'firebase.{$appName}() takes either no argument or a ' +\r\n 'Firebase App instance.',\r\n _a[\"invalid-log-argument\" /* INVALID_LOG_ARGUMENT */] = 'First argument to `onLog` must be null or a function.',\r\n _a);\r\nvar ERROR_FACTORY = new ErrorFactory('app', 'Firebase', ERRORS);\n\nvar name$1 = \"@firebase/app\";\nvar version = \"0.6.12\";\n\nvar name$2 = \"@firebase/analytics\";\n\nvar name$3 = \"@firebase/auth\";\n\nvar name$4 = \"@firebase/database\";\n\nvar name$5 = \"@firebase/functions\";\n\nvar name$6 = \"@firebase/installations\";\n\nvar name$7 = \"@firebase/messaging\";\n\nvar name$8 = \"@firebase/performance\";\n\nvar name$9 = \"@firebase/remote-config\";\n\nvar name$a = \"@firebase/storage\";\n\nvar name$b = \"@firebase/firestore\";\n\nvar name$c = \"firebase-wrapper\";\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar _a$1;\r\nvar DEFAULT_ENTRY_NAME = '[DEFAULT]';\r\nvar PLATFORM_LOG_STRING = (_a$1 = {},\r\n _a$1[name$1] = 'fire-core',\r\n _a$1[name$2] = 'fire-analytics',\r\n _a$1[name$3] = 'fire-auth',\r\n _a$1[name$4] = 'fire-rtdb',\r\n _a$1[name$5] = 'fire-fn',\r\n _a$1[name$6] = 'fire-iid',\r\n _a$1[name$7] = 'fire-fcm',\r\n _a$1[name$8] = 'fire-perf',\r\n _a$1[name$9] = 'fire-rc',\r\n _a$1[name$a] = 'fire-gcs',\r\n _a$1[name$b] = 'fire-fst',\r\n _a$1['fire-js'] = 'fire-js',\r\n _a$1[name$c] = 'fire-js-all',\r\n _a$1);\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar logger = new Logger('@firebase/app');\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Global context object for a collection of services using\r\n * a shared authentication state.\r\n */\r\nvar FirebaseAppImpl = /** @class */ (function () {\r\n function FirebaseAppImpl(options, config, firebase_) {\r\n var e_1, _a;\r\n var _this = this;\r\n this.firebase_ = firebase_;\r\n this.isDeleted_ = false;\r\n this.name_ = config.name;\r\n this.automaticDataCollectionEnabled_ =\r\n config.automaticDataCollectionEnabled || false;\r\n this.options_ = deepCopy(options);\r\n this.container = new ComponentContainer(config.name);\r\n // add itself to container\r\n this._addComponent(new Component('app', function () { return _this; }, \"PUBLIC\" /* PUBLIC */));\r\n try {\r\n // populate ComponentContainer with existing components\r\n for (var _b = __values(this.firebase_.INTERNAL.components.values()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var component = _c.value;\r\n this._addComponent(component);\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n }\r\n Object.defineProperty(FirebaseAppImpl.prototype, \"automaticDataCollectionEnabled\", {\r\n get: function () {\r\n this.checkDestroyed_();\r\n return this.automaticDataCollectionEnabled_;\r\n },\r\n set: function (val) {\r\n this.checkDestroyed_();\r\n this.automaticDataCollectionEnabled_ = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(FirebaseAppImpl.prototype, \"name\", {\r\n get: function () {\r\n this.checkDestroyed_();\r\n return this.name_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(FirebaseAppImpl.prototype, \"options\", {\r\n get: function () {\r\n this.checkDestroyed_();\r\n return this.options_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n FirebaseAppImpl.prototype.delete = function () {\r\n var _this = this;\r\n return new Promise(function (resolve) {\r\n _this.checkDestroyed_();\r\n resolve();\r\n })\r\n .then(function () {\r\n _this.firebase_.INTERNAL.removeApp(_this.name_);\r\n return Promise.all(_this.container.getProviders().map(function (provider) { return provider.delete(); }));\r\n })\r\n .then(function () {\r\n _this.isDeleted_ = true;\r\n });\r\n };\r\n /**\r\n * Return a service instance associated with this app (creating it\r\n * on demand), identified by the passed instanceIdentifier.\r\n *\r\n * NOTE: Currently storage and functions are the only ones that are leveraging this\r\n * functionality. They invoke it by calling:\r\n *\r\n * ```javascript\r\n * firebase.app().storage('STORAGE BUCKET ID')\r\n * ```\r\n *\r\n * The service name is passed to this already\r\n * @internal\r\n */\r\n FirebaseAppImpl.prototype._getService = function (name, instanceIdentifier) {\r\n if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }\r\n this.checkDestroyed_();\r\n // getImmediate will always succeed because _getService is only called for registered components.\r\n return this.container.getProvider(name).getImmediate({\r\n identifier: instanceIdentifier\r\n });\r\n };\r\n /**\r\n * Remove a service instance from the cache, so we will create a new instance for this service\r\n * when people try to get this service again.\r\n *\r\n * NOTE: currently only firestore is using this functionality to support firestore shutdown.\r\n *\r\n * @param name The service name\r\n * @param instanceIdentifier instance identifier in case multiple instances are allowed\r\n * @internal\r\n */\r\n FirebaseAppImpl.prototype._removeServiceInstance = function (name, instanceIdentifier) {\r\n if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n this.container.getProvider(name).clearInstance(instanceIdentifier);\r\n };\r\n /**\r\n * @param component the component being added to this app's container\r\n */\r\n FirebaseAppImpl.prototype._addComponent = function (component) {\r\n try {\r\n this.container.addComponent(component);\r\n }\r\n catch (e) {\r\n logger.debug(\"Component \" + component.name + \" failed to register with FirebaseApp \" + this.name, e);\r\n }\r\n };\r\n FirebaseAppImpl.prototype._addOrOverwriteComponent = function (component) {\r\n this.container.addOrOverwriteComponent(component);\r\n };\r\n /**\r\n * This function will throw an Error if the App has already been deleted -\r\n * use before performing API actions on the App.\r\n */\r\n FirebaseAppImpl.prototype.checkDestroyed_ = function () {\r\n if (this.isDeleted_) {\r\n throw ERROR_FACTORY.create(\"app-deleted\" /* APP_DELETED */, { appName: this.name_ });\r\n }\r\n };\r\n return FirebaseAppImpl;\r\n}());\r\n// Prevent dead-code elimination of these methods w/o invalid property\r\n// copying.\r\n(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||\r\n FirebaseAppImpl.prototype.delete ||\r\n console.log('dc');\n\nvar version$1 = \"8.0.0\";\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Because auth can't share code with other components, we attach the utility functions\r\n * in an internal namespace to share code.\r\n * This function return a firebase namespace object without\r\n * any utility functions, so it can be shared between the regular firebaseNamespace and\r\n * the lite version.\r\n */\r\nfunction createFirebaseNamespaceCore(firebaseAppImpl) {\r\n var apps = {};\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n var components = new Map();\r\n // A namespace is a plain JavaScript Object.\r\n var namespace = {\r\n // Hack to prevent Babel from modifying the object returned\r\n // as the firebase namespace.\r\n // @ts-ignore\r\n __esModule: true,\r\n initializeApp: initializeApp,\r\n // @ts-ignore\r\n app: app,\r\n registerVersion: registerVersion,\r\n setLogLevel: setLogLevel,\r\n onLog: onLog,\r\n // @ts-ignore\r\n apps: null,\r\n SDK_VERSION: version$1,\r\n INTERNAL: {\r\n registerComponent: registerComponent,\r\n removeApp: removeApp,\r\n components: components,\r\n useAsService: useAsService\r\n }\r\n };\r\n // Inject a circular default export to allow Babel users who were previously\r\n // using:\r\n //\r\n // import firebase from 'firebase';\r\n // which becomes: var firebase = require('firebase').default;\r\n //\r\n // instead of\r\n //\r\n // import * as firebase from 'firebase';\r\n // which becomes: var firebase = require('firebase');\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n namespace['default'] = namespace;\r\n // firebase.apps is a read-only getter.\r\n Object.defineProperty(namespace, 'apps', {\r\n get: getApps\r\n });\r\n /**\r\n * Called by App.delete() - but before any services associated with the App\r\n * are deleted.\r\n */\r\n function removeApp(name) {\r\n delete apps[name];\r\n }\r\n /**\r\n * Get the App object for a given name (or DEFAULT).\r\n */\r\n function app(name) {\r\n name = name || DEFAULT_ENTRY_NAME;\r\n if (!contains(apps, name)) {\r\n throw ERROR_FACTORY.create(\"no-app\" /* NO_APP */, { appName: name });\r\n }\r\n return apps[name];\r\n }\r\n // @ts-ignore\r\n app['App'] = firebaseAppImpl;\r\n function initializeApp(options, rawConfig) {\r\n if (rawConfig === void 0) { rawConfig = {}; }\r\n if (typeof rawConfig !== 'object' || rawConfig === null) {\r\n var name_1 = rawConfig;\r\n rawConfig = { name: name_1 };\r\n }\r\n var config = rawConfig;\r\n if (config.name === undefined) {\r\n config.name = DEFAULT_ENTRY_NAME;\r\n }\r\n var name = config.name;\r\n if (typeof name !== 'string' || !name) {\r\n throw ERROR_FACTORY.create(\"bad-app-name\" /* BAD_APP_NAME */, {\r\n appName: String(name)\r\n });\r\n }\r\n if (contains(apps, name)) {\r\n throw ERROR_FACTORY.create(\"duplicate-app\" /* DUPLICATE_APP */, { appName: name });\r\n }\r\n var app = new firebaseAppImpl(options, config, namespace);\r\n apps[name] = app;\r\n return app;\r\n }\r\n /*\r\n * Return an array of all the non-deleted FirebaseApps.\r\n */\r\n function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps).map(function (name) { return apps[name]; });\r\n }\r\n function registerComponent(component) {\r\n var e_1, _a;\r\n var componentName = component.name;\r\n if (components.has(componentName)) {\r\n logger.debug(\"There were multiple attempts to register component \" + componentName + \".\");\r\n return component.type === \"PUBLIC\" /* PUBLIC */\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n namespace[componentName]\r\n : null;\r\n }\r\n components.set(componentName, component);\r\n // create service namespace for public components\r\n if (component.type === \"PUBLIC\" /* PUBLIC */) {\r\n // The Service namespace is an accessor function ...\r\n var serviceNamespace = function (appArg) {\r\n if (appArg === void 0) { appArg = app(); }\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n if (typeof appArg[componentName] !== 'function') {\r\n // Invalid argument.\r\n // This happens in the following case: firebase.storage('gs:/')\r\n throw ERROR_FACTORY.create(\"invalid-app-argument\" /* INVALID_APP_ARGUMENT */, {\r\n appName: componentName\r\n });\r\n }\r\n // Forward service instance lookup to the FirebaseApp.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return appArg[componentName]();\r\n };\r\n // ... and a container for service-level properties.\r\n if (component.serviceProps !== undefined) {\r\n deepExtend(serviceNamespace, component.serviceProps);\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n namespace[componentName] = serviceNamespace;\r\n // Patch the FirebaseAppImpl prototype\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n firebaseAppImpl.prototype[componentName] =\r\n // TODO: The eslint disable can be removed and the 'ignoreRestArgs'\r\n // option added to the no-explicit-any rule when ESlint releases it.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var serviceFxn = this._getService.bind(this, componentName);\r\n return serviceFxn.apply(this, component.multipleInstances ? args : []);\r\n };\r\n }\r\n try {\r\n // add the component to existing app instances\r\n for (var _b = __values(Object.keys(apps)), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var appName = _c.value;\r\n apps[appName]._addComponent(component);\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n return component.type === \"PUBLIC\" /* PUBLIC */\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n namespace[componentName]\r\n : null;\r\n }\r\n function registerVersion(libraryKeyOrName, version, variant) {\r\n var _a;\r\n // TODO: We can use this check to whitelist strings when/if we set up\r\n // a good whitelist system.\r\n var library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName]) !== null && _a !== void 0 ? _a : libraryKeyOrName;\r\n if (variant) {\r\n library += \"-\" + variant;\r\n }\r\n var libraryMismatch = library.match(/\\s|\\//);\r\n var versionMismatch = version.match(/\\s|\\//);\r\n if (libraryMismatch || versionMismatch) {\r\n var warning = [\r\n \"Unable to register library \\\"\" + library + \"\\\" with version \\\"\" + version + \"\\\":\"\r\n ];\r\n if (libraryMismatch) {\r\n warning.push(\"library name \\\"\" + library + \"\\\" contains illegal characters (whitespace or \\\"/\\\")\");\r\n }\r\n if (libraryMismatch && versionMismatch) {\r\n warning.push('and');\r\n }\r\n if (versionMismatch) {\r\n warning.push(\"version name \\\"\" + version + \"\\\" contains illegal characters (whitespace or \\\"/\\\")\");\r\n }\r\n logger.warn(warning.join(' '));\r\n return;\r\n }\r\n registerComponent(new Component(library + \"-version\", function () { return ({ library: library, version: version }); }, \"VERSION\" /* VERSION */));\r\n }\r\n function onLog(logCallback, options) {\r\n if (logCallback !== null && typeof logCallback !== 'function') {\r\n throw ERROR_FACTORY.create(\"invalid-log-argument\" /* INVALID_LOG_ARGUMENT */, {\r\n appName: name\r\n });\r\n }\r\n setUserLogHandler(logCallback, options);\r\n }\r\n // Map the requested service to a registered service name\r\n // (used to map auth to serverAuth service when needed).\r\n function useAsService(app, name) {\r\n if (name === 'serverAuth') {\r\n return null;\r\n }\r\n var useService = name;\r\n return useService;\r\n }\r\n return namespace;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Return a firebase namespace object.\r\n *\r\n * In production, this will be called exactly once and the result\r\n * assigned to the 'firebase' global. It may be called multiple times\r\n * in unit tests.\r\n */\r\nfunction createFirebaseNamespace() {\r\n var namespace = createFirebaseNamespaceCore(FirebaseAppImpl);\r\n namespace.INTERNAL = __assign(__assign({}, namespace.INTERNAL), { createFirebaseNamespace: createFirebaseNamespace,\r\n extendNamespace: extendNamespace,\r\n createSubscribe: createSubscribe,\r\n ErrorFactory: ErrorFactory,\r\n deepExtend: deepExtend });\r\n /**\r\n * Patch the top-level firebase namespace with additional properties.\r\n *\r\n * firebase.INTERNAL.extendNamespace()\r\n */\r\n function extendNamespace(props) {\r\n deepExtend(namespace, props);\r\n }\r\n return namespace;\r\n}\r\nvar firebase = createFirebaseNamespace();\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar PlatformLoggerService = /** @class */ (function () {\r\n function PlatformLoggerService(container) {\r\n this.container = container;\r\n }\r\n // In initial implementation, this will be called by installations on\r\n // auth token refresh, and installations will send this string.\r\n PlatformLoggerService.prototype.getPlatformInfoString = function () {\r\n var providers = this.container.getProviders();\r\n // Loop through providers and get library/version pairs from any that are\r\n // version components.\r\n return providers\r\n .map(function (provider) {\r\n if (isVersionServiceProvider(provider)) {\r\n var service = provider.getImmediate();\r\n return service.library + \"/\" + service.version;\r\n }\r\n else {\r\n return null;\r\n }\r\n })\r\n .filter(function (logString) { return logString; })\r\n .join(' ');\r\n };\r\n return PlatformLoggerService;\r\n}());\r\n/**\r\n *\r\n * @param provider check if this provider provides a VersionService\r\n *\r\n * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider\r\n * provides VersionService. The provider is not necessarily a 'app-version'\r\n * provider.\r\n */\r\nfunction isVersionServiceProvider(provider) {\r\n var component = provider.getComponent();\r\n return (component === null || component === void 0 ? void 0 : component.type) === \"VERSION\" /* VERSION */;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction registerCoreComponents(firebase, variant) {\r\n firebase.INTERNAL.registerComponent(new Component('platform-logger', function (container) { return new PlatformLoggerService(container); }, \"PRIVATE\" /* PRIVATE */));\r\n // Register `app` package.\r\n firebase.registerVersion(name$1, version, variant);\r\n // Register platform SDK identifier (no version).\r\n firebase.registerVersion('fire-js', '');\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// Firebase Lite detection test\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nif (isBrowser() && self.firebase !== undefined) {\r\n logger.warn(\"\\n Warning: Firebase is already defined in the global scope. Please make sure\\n Firebase library is only loaded once.\\n \");\r\n // eslint-disable-next-line\r\n var sdkVersion = self.firebase.SDK_VERSION;\r\n if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {\r\n logger.warn(\"\\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\\n \");\r\n }\r\n}\r\nvar initializeApp = firebase.initializeApp;\r\n// TODO: This disable can be removed and the 'ignoreRestArgs' option added to\r\n// the no-explicit-any rule when ESlint releases it.\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nfirebase.initializeApp = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n // Environment check before initializing app\r\n // Do the check in initializeApp, so people have a chance to disable it by setting logLevel\r\n // in @firebase/logger\r\n if (isNode()) {\r\n logger.warn(\"\\n Warning: This is a browser-targeted Firebase bundle but it appears it is being\\n run in a Node environment. If running in a Node environment, make sure you\\n are using the bundle specified by the \\\"main\\\" field in package.json.\\n \\n If you are using Webpack, you can specify \\\"main\\\" as the first item in\\n \\\"resolve.mainFields\\\":\\n https://webpack.js.org/configuration/resolve/#resolvemainfields\\n \\n If using Rollup, use the @rollup/plugin-node-resolve plugin and specify \\\"main\\\"\\n as the first item in \\\"mainFields\\\", e.g. ['main', 'module'].\\n https://github.com/rollup/@rollup/plugin-node-resolve\\n \");\r\n }\r\n return initializeApp.apply(undefined, args);\r\n};\r\nvar firebase$1 = firebase;\r\nregisterCoreComponents(firebase$1);\n\nexport default firebase$1;\nexport { firebase$1 as firebase };\n//# sourceMappingURL=index.esm.js.map\n","import firebase from '@firebase/app';(function() {/*\n\n Copyright The Closure Library Authors.\n SPDX-License-Identifier: Apache-2.0\n*/\nvar k,aa=\"function\"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};function ba(a){a=[\"object\"==typeof window&&window,\"object\"==typeof self&&self,\"object\"==typeof global&&global,a];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}return globalThis}var ca=ba(this);\nfunction da(a,b){if(b){var c=ca;a=a.split(\".\");for(var d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&aa(c,a,{configurable:!0,writable:!0,value:b})}}function ea(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function fa(a){var b=\"undefined\"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:ea(a)}}\nda(\"Promise\",function(a){function b(g){this.b=0;this.c=void 0;this.a=[];var h=this.f();try{g(h.resolve,h.reject)}catch(m){h.reject(m)}}function c(){this.a=null}function d(g){return g instanceof b?g:new b(function(h){h(g)})}if(a)return a;c.prototype.b=function(g){if(null==this.a){this.a=[];var h=this;this.c(function(){h.g()})}this.a.push(g)};var e=ca.setTimeout;c.prototype.c=function(g){e(g,0)};c.prototype.g=function(){for(;this.a&&this.a.length;){var g=this.a;this.a=[];for(var h=0;h<g.length;++h){var m=\ng[h];g[h]=null;try{m()}catch(p){this.f(p)}}}this.a=null};c.prototype.f=function(g){this.c(function(){throw g;})};b.prototype.f=function(){function g(p){return function(v){m||(m=!0,p.call(h,v))}}var h=this,m=!1;return{resolve:g(this.v),reject:g(this.g)}};b.prototype.v=function(g){if(g===this)this.g(new TypeError(\"A Promise cannot resolve to itself\"));else if(g instanceof b)this.o(g);else{a:switch(typeof g){case \"object\":var h=null!=g;break a;case \"function\":h=!0;break a;default:h=!1}h?this.m(g):this.h(g)}};\nb.prototype.m=function(g){var h=void 0;try{h=g.then}catch(m){this.g(m);return}\"function\"==typeof h?this.u(h,g):this.h(g)};b.prototype.g=function(g){this.i(2,g)};b.prototype.h=function(g){this.i(1,g)};b.prototype.i=function(g,h){if(0!=this.b)throw Error(\"Cannot settle(\"+g+\", \"+h+\"): Promise already settled in state\"+this.b);this.b=g;this.c=h;this.l()};b.prototype.l=function(){if(null!=this.a){for(var g=0;g<this.a.length;++g)f.b(this.a[g]);this.a=null}};var f=new c;b.prototype.o=function(g){var h=this.f();\ng.Pa(h.resolve,h.reject)};b.prototype.u=function(g,h){var m=this.f();try{g.call(h,m.resolve,m.reject)}catch(p){m.reject(p)}};b.prototype.then=function(g,h){function m(A,Q){return\"function\"==typeof A?function(xa){try{p(A(xa))}catch(yd){v(yd)}}:Q}var p,v,B=new b(function(A,Q){p=A;v=Q});this.Pa(m(g,p),m(h,v));return B};b.prototype.catch=function(g){return this.then(void 0,g)};b.prototype.Pa=function(g,h){function m(){switch(p.b){case 1:g(p.c);break;case 2:h(p.c);break;default:throw Error(\"Unexpected state: \"+\np.b);}}var p=this;null==this.a?f.b(m):this.a.push(m)};b.resolve=d;b.reject=function(g){return new b(function(h,m){m(g)})};b.race=function(g){return new b(function(h,m){for(var p=fa(g),v=p.next();!v.done;v=p.next())d(v.value).Pa(h,m)})};b.all=function(g){var h=fa(g),m=h.next();return m.done?d([]):new b(function(p,v){function B(xa){return function(yd){A[xa]=yd;Q--;0==Q&&p(A)}}var A=[],Q=0;do A.push(void 0),Q++,d(m.value).Pa(B(A.length-1),v),m=h.next();while(!m.done)})};return b});\nvar ha=ha||{},l=this||self,ia=/^[\\w+/_-]+[=]{0,2}$/,ja=null;function ka(){}\nfunction la(a){var b=typeof a;if(\"object\"==b)if(a){if(a instanceof Array)return\"array\";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if(\"[object Window]\"==c)return\"object\";if(\"[object Array]\"==c||\"number\"==typeof a.length&&\"undefined\"!=typeof a.splice&&\"undefined\"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable(\"splice\"))return\"array\";if(\"[object Function]\"==c||\"undefined\"!=typeof a.call&&\"undefined\"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable(\"call\"))return\"function\"}else return\"null\";\nelse if(\"function\"==b&&\"undefined\"==typeof a.call)return\"object\";return b}function ma(a){var b=la(a);return\"array\"==b||\"object\"==b&&\"number\"==typeof a.length}function na(a){return\"function\"==la(a)}function n(a){var b=typeof a;return\"object\"==b&&null!=a||\"function\"==b}function oa(a){return Object.prototype.hasOwnProperty.call(a,pa)&&a[pa]||(a[pa]=++qa)}var pa=\"closure_uid_\"+(1E9*Math.random()>>>0),qa=0;function ra(a,b,c){return a.call.apply(a.bind,arguments)}\nfunction sa(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}function q(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf(\"native code\")?q=ra:q=sa;return q.apply(null,arguments)}\nfunction ta(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}var ua=Date.now||function(){return+new Date};function r(a,b){function c(){}c.prototype=b.prototype;a.$a=b.prototype;a.prototype=new c;a.prototype.constructor=a};/*\n\n Copyright 2017 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\nfunction t(a,b,c){this.code=va+a;this.message=b||wa[a]||\"\";this.a=c||null}r(t,Error);t.prototype.w=function(){var a={code:this.code,message:this.message};this.a&&(a.serverResponse=this.a);return a};t.prototype.toJSON=function(){return this.w()};function ya(a){var b=a&&a.code;return b?new t(b.substring(va.length),a.message,a.serverResponse):null}\nvar va=\"auth/\",wa={\"admin-restricted-operation\":\"This operation is restricted to administrators only.\",\"argument-error\":\"\",\"app-not-authorized\":\"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.\",\"app-not-installed\":\"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.\",\n\"captcha-check-failed\":\"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.\",\"code-expired\":\"The SMS code has expired. Please re-send the verification code to try again.\",\"cordova-not-ready\":\"Cordova framework is not ready.\",\"cors-unsupported\":\"This browser is not supported.\",\"credential-already-in-use\":\"This credential is already associated with a different user account.\",\"custom-token-mismatch\":\"The custom token corresponds to a different audience.\",\n\"requires-recent-login\":\"This operation is sensitive and requires recent authentication. Log in again before retrying this request.\",\"dynamic-link-not-activated\":\"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.\",\"email-change-needs-verification\":\"Multi-factor users must always have a verified email.\",\"email-already-in-use\":\"The email address is already in use by another account.\",\"expired-action-code\":\"The action code has expired. \",\"cancelled-popup-request\":\"This operation has been cancelled due to another conflicting popup being opened.\",\n\"internal-error\":\"An internal error has occurred.\",\"invalid-app-credential\":\"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.\",\"invalid-app-id\":\"The mobile app identifier is not registed for the current project.\",\"invalid-user-token\":\"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.\",\"invalid-auth-event\":\"An internal error has occurred.\",\n\"invalid-verification-code\":\"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure use the verification code provided by the user.\",\"invalid-continue-uri\":\"The continue URL provided in the request is invalid.\",\"invalid-cordova-configuration\":\"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.\",\n\"invalid-custom-token\":\"The custom token format is incorrect. Please check the documentation.\",\"invalid-dynamic-link-domain\":\"The provided dynamic link domain is not configured or authorized for the current project.\",\"invalid-email\":\"The email address is badly formatted.\",\"invalid-api-key\":\"Your API key is invalid, please check you have copied it correctly.\",\"invalid-cert-hash\":\"The SHA-1 certificate hash provided is invalid.\",\"invalid-credential\":\"The supplied auth credential is malformed or has expired.\",\n\"invalid-message-payload\":\"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.\",\"invalid-multi-factor-session\":\"The request does not contain a valid proof of first factor successful sign-in.\",\"invalid-oauth-provider\":\"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.\",\"invalid-oauth-client-id\":\"The OAuth client ID provided is either invalid or does not match the specified API key.\",\n\"unauthorized-domain\":\"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.\",\"invalid-action-code\":\"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.\",\"wrong-password\":\"The password is invalid or the user does not have a password.\",\"invalid-persistence-type\":\"The specified persistence type is invalid. It can only be local, session or none.\",\"invalid-phone-number\":\"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].\",\n\"invalid-provider-id\":\"The specified provider ID is invalid.\",\"invalid-recipient-email\":\"The email corresponding to this action failed to send as the provided recipient email address is invalid.\",\"invalid-sender\":\"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.\",\"invalid-verification-id\":\"The verification ID used to create the phone auth credential is invalid.\",\"invalid-tenant-id\":\"The Auth instance's tenant ID is invalid.\",\n\"multi-factor-info-not-found\":\"The user does not have a second factor matching the identifier provided.\",\"multi-factor-auth-required\":\"Proof of ownership of a second factor is required to complete sign-in.\",\"missing-android-pkg-name\":\"An Android Package Name must be provided if the Android App is required to be installed.\",\"auth-domain-config-required\":\"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.\",\"missing-app-credential\":\"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.\",\n\"missing-verification-code\":\"The phone auth credential was created with an empty SMS verification code.\",\"missing-continue-uri\":\"A continue URL must be provided in the request.\",\"missing-iframe-start\":\"An internal error has occurred.\",\"missing-ios-bundle-id\":\"An iOS Bundle ID must be provided if an App Store ID is provided.\",\"missing-multi-factor-info\":\"No second factor identifier is provided.\",\"missing-multi-factor-session\":\"The request is missing proof of first factor successful sign-in.\",\"missing-or-invalid-nonce\":\"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.\",\n\"missing-phone-number\":\"To send verification codes, provide a phone number for the recipient.\",\"missing-verification-id\":\"The phone auth credential was created with an empty verification ID.\",\"app-deleted\":\"This instance of FirebaseApp has been deleted.\",\"account-exists-with-different-credential\":\"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.\",\"network-request-failed\":\"A network error (such as timeout, interrupted connection or unreachable host) has occurred.\",\n\"no-auth-event\":\"An internal error has occurred.\",\"no-such-provider\":\"User was not linked to an account with the given provider.\",\"null-user\":\"A null user object was provided as the argument for an operation which requires a non-null user object.\",\"operation-not-allowed\":\"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.\",\"operation-not-supported-in-this-environment\":'This operation is not supported in the environment this application is running on. \"location.protocol\" must be http, https or chrome-extension and web storage must be enabled.',\n\"popup-blocked\":\"Unable to establish a connection with the popup. It may have been blocked by the browser.\",\"popup-closed-by-user\":\"The popup has been closed by the user before finalizing the operation.\",\"provider-already-linked\":\"User can only be linked to one identity for the given provider.\",\"quota-exceeded\":\"The project's quota for this operation has been exceeded.\",\"redirect-cancelled-by-user\":\"The redirect operation has been cancelled by the user before finalizing.\",\"redirect-operation-pending\":\"A redirect sign-in operation is already pending.\",\n\"rejected-credential\":\"The request contains malformed or mismatching credentials.\",\"second-factor-already-in-use\":\"The second factor is already enrolled on this account.\",\"maximum-second-factor-count-exceeded\":\"The maximum allowed number of second factors on a user has been exceeded.\",\"tenant-id-mismatch\":\"The provided tenant ID does not match the Auth instance's tenant ID\",timeout:\"The operation has timed out.\",\"user-token-expired\":\"The user's credential is no longer valid. The user must sign in again.\",\n\"too-many-requests\":\"We have blocked all requests from this device due to unusual activity. Try again later.\",\"unauthorized-continue-uri\":\"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.\",\"unsupported-first-factor\":\"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.\",\"unsupported-persistence-type\":\"The current environment does not support the specified persistence type.\",\"unsupported-tenant-operation\":\"This operation is not supported in a multi-tenant context.\",\n\"unverified-email\":\"The operation requires a verified email.\",\"user-cancelled\":\"The user did not grant your application the permissions it requested.\",\"user-not-found\":\"There is no user record corresponding to this identifier. The user may have been deleted.\",\"user-disabled\":\"The user account has been disabled by an administrator.\",\"user-mismatch\":\"The supplied credentials do not correspond to the previously signed in user.\",\"user-signed-out\":\"\",\"weak-password\":\"The password must be 6 characters long or more.\",\n\"web-storage-unsupported\":\"This browser is not supported or 3rd party cookies and data may be disabled.\"};/*\n\n Copyright 2017 Google LLC\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\nvar za={kd:{Sa:\"https://staging-identitytoolkit.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/\",Ya:\"https://staging-securetoken.sandbox.googleapis.com/v1/token\",Va:\"https://staging-identitytoolkit.sandbox.googleapis.com/v2/\",id:\"b\"},rd:{Sa:\"https://www.googleapis.com/identitytoolkit/v3/relyingparty/\",Ya:\"https://securetoken.googleapis.com/v1/token\",Va:\"https://identitytoolkit.googleapis.com/v2/\",id:\"p\"},td:{Sa:\"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/\",\nYa:\"https://staging-securetoken.sandbox.googleapis.com/v1/token\",Va:\"https://staging-identitytoolkit.sandbox.googleapis.com/v2/\",id:\"s\"},ud:{Sa:\"https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/\",Ya:\"https://test-securetoken.sandbox.googleapis.com/v1/token\",Va:\"https://test-identitytoolkit.sandbox.googleapis.com/v2/\",id:\"t\"}};\nfunction Aa(a){for(var b in za)if(za[b].id===a)return a=za[b],{firebaseEndpoint:a.Sa,secureTokenEndpoint:a.Ya,identityPlatformEndpoint:a.Va};return null}var Ba;Ba=Aa(\"__EID__\")?\"__EID__\":void 0;function Ca(a){if(!a)return!1;try{return!!a.$goog_Thenable}catch(b){return!1}};function u(a){if(Error.captureStackTrace)Error.captureStackTrace(this,u);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))}r(u,Error);u.prototype.name=\"CustomError\";function Da(a,b){a=a.split(\"%s\");for(var c=\"\",d=a.length-1,e=0;e<d;e++)c+=a[e]+(e<b.length?b[e]:\"%s\");u.call(this,c+a[d])}r(Da,u);Da.prototype.name=\"AssertionError\";function Ea(a,b){throw new Da(\"Failure\"+(a?\": \"+a:\"\"),Array.prototype.slice.call(arguments,1));};function Fa(a,b){this.c=a;this.f=b;this.b=0;this.a=null}Fa.prototype.get=function(){if(0<this.b){this.b--;var a=this.a;this.a=a.next;a.next=null}else a=this.c();return a};function Ga(a,b){a.f(b);100>a.b&&(a.b++,b.next=a.a,a.a=b)};function Ha(){this.b=this.a=null}var Ja=new Fa(function(){return new Ia},function(a){a.reset()});Ha.prototype.add=function(a,b){var c=Ja.get();c.set(a,b);this.b?this.b.next=c:this.a=c;this.b=c};function Ka(){var a=La,b=null;a.a&&(b=a.a,a.a=a.a.next,a.a||(a.b=null),b.next=null);return b}function Ia(){this.next=this.b=this.a=null}Ia.prototype.set=function(a,b){this.a=a;this.b=b;this.next=null};Ia.prototype.reset=function(){this.next=this.b=this.a=null};var Ma=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(\"string\"===typeof a)return\"string\"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},w=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=\"string\"===typeof a?a.split(\"\"):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)};\nfunction Na(a,b){for(var c=\"string\"===typeof a?a.split(\"\"):a,d=a.length-1;0<=d;--d)d in c&&b.call(void 0,c[d],d,a)}\nvar Oa=Array.prototype.filter?function(a,b){return Array.prototype.filter.call(a,b,void 0)}:function(a,b){for(var c=a.length,d=[],e=0,f=\"string\"===typeof a?a.split(\"\"):a,g=0;g<c;g++)if(g in f){var h=f[g];b.call(void 0,h,g,a)&&(d[e++]=h)}return d},Pa=Array.prototype.map?function(a,b){return Array.prototype.map.call(a,b,void 0)}:function(a,b){for(var c=a.length,d=Array(c),e=\"string\"===typeof a?a.split(\"\"):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d},Qa=Array.prototype.some?function(a,\nb){return Array.prototype.some.call(a,b,void 0)}:function(a,b){for(var c=a.length,d=\"string\"===typeof a?a.split(\"\"):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1};function Ra(a){a:{var b=Sa;for(var c=a.length,d=\"string\"===typeof a?a.split(\"\"):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1}return 0>b?null:\"string\"===typeof a?a.charAt(b):a[b]}function Ta(a,b){return 0<=Ma(a,b)}\nfunction Ua(a,b){b=Ma(a,b);var c;(c=0<=b)&&Array.prototype.splice.call(a,b,1);return c}function Va(a,b){var c=0;Na(a,function(d,e){b.call(void 0,d,e,a)&&1==Array.prototype.splice.call(a,e,1).length&&c++})}function Wa(a){return Array.prototype.concat.apply([],arguments)}function Xa(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]};var Ya=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\\s\\xa0]*([\\s\\S]*?)[\\s\\xa0]*$/.exec(a)[1]},Za=/&/g,$a=/</g,ab=/>/g,bb=/\"/g,cb=/'/g,db=/\\x00/g,eb=/[\\x00&<>\"']/;function x(a,b){return-1!=a.indexOf(b)}function fb(a,b){return a<b?-1:a>b?1:0};var gb;a:{var hb=l.navigator;if(hb){var ib=hb.userAgent;if(ib){gb=ib;break a}}gb=\"\"}function y(a){return x(gb,a)};function jb(a,b){for(var c in a)b.call(void 0,a[c],c,a)}function kb(a){for(var b in a)return!1;return!0}function lb(a){var b={},c;for(c in a)b[c]=a[c];return b}var mb=\"constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf\".split(\" \");function z(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<mb.length;f++)c=mb[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};function nb(a,b){a:{try{var c=a&&a.ownerDocument,d=c&&(c.defaultView||c.parentWindow);d=d||l;if(d.Element&&d.Location){var e=d;break a}}catch(g){}e=null}if(e&&\"undefined\"!=typeof e[b]&&(!a||!(a instanceof e[b])&&(a instanceof e.Location||a instanceof e.Element))){if(n(a))try{var f=a.constructor.displayName||a.constructor.name||Object.prototype.toString.call(a)}catch(g){f=\"<object could not be stringified>\"}else f=void 0===a?\"undefined\":null===a?\"null\":typeof a;Ea(\"Argument is not a %s (or a non-Element, non-Location mock); got: %s\",\nb,f)}};function ob(a,b){this.a=a===pb&&b||\"\";this.b=qb}ob.prototype.sa=!0;ob.prototype.ra=function(){return this.a};ob.prototype.toString=function(){return\"Const{\"+this.a+\"}\"};function rb(a){if(a instanceof ob&&a.constructor===ob&&a.b===qb)return a.a;Ea(\"expected object of type Const, got '\"+a+\"'\");return\"type_error:Const\"}var qb={},pb={},sb=new ob(pb,\"\");function tb(a,b){this.a=a===ub&&b||\"\";this.b=vb}tb.prototype.sa=!0;tb.prototype.ra=function(){return this.a.toString()};tb.prototype.toString=function(){return\"TrustedResourceUrl{\"+this.a+\"}\"};function wb(a){if(a instanceof tb&&a.constructor===tb&&a.b===vb)return a.a;Ea(\"expected object of type TrustedResourceUrl, got '\"+a+\"' of type \"+la(a));return\"type_error:TrustedResourceUrl\"}\nfunction xb(a,b){var c=rb(a);if(!yb.test(c))throw Error(\"Invalid TrustedResourceUrl format: \"+c);a=c.replace(zb,function(d,e){if(!Object.prototype.hasOwnProperty.call(b,e))throw Error('Found marker, \"'+e+'\", in format string, \"'+c+'\", but no valid label mapping found in args: '+JSON.stringify(b));d=b[e];return d instanceof ob?rb(d):encodeURIComponent(String(d))});return new tb(ub,a)}\nvar zb=/%{(\\w+)}/g,yb=/^((https:)?\\/\\/[0-9a-z.:[\\]-]+\\/|\\/[^/\\\\]|[^:/\\\\%]+\\/|[^:/\\\\%]*[?#]|about:blank#)/i,vb={},ub={};function Ab(a,b){this.a=a===Bb&&b||\"\";this.b=Cb}Ab.prototype.sa=!0;Ab.prototype.ra=function(){return this.a.toString()};Ab.prototype.toString=function(){return\"SafeUrl{\"+this.a+\"}\"};function Db(a){if(a instanceof Ab&&a.constructor===Ab&&a.b===Cb)return a.a;Ea(\"expected object of type SafeUrl, got '\"+a+\"' of type \"+la(a));return\"type_error:SafeUrl\"}var Eb=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;\nfunction Fb(a){if(a instanceof Ab)return a;a=\"object\"==typeof a&&a.sa?a.ra():String(a);Eb.test(a)||(a=\"about:invalid#zClosurez\");return new Ab(Bb,a)}var Cb={},Bb={};function Gb(){this.a=\"\";this.b=Hb}Gb.prototype.sa=!0;Gb.prototype.ra=function(){return this.a.toString()};Gb.prototype.toString=function(){return\"SafeHtml{\"+this.a+\"}\"};function Ib(a){if(a instanceof Gb&&a.constructor===Gb&&a.b===Hb)return a.a;Ea(\"expected object of type SafeHtml, got '\"+a+\"' of type \"+la(a));return\"type_error:SafeHtml\"}var Hb={};function Jb(a){var b=new Gb;b.a=a;return b}Jb(\"<!DOCTYPE html>\");var Kb=Jb(\"\");Jb(\"<br>\");function Lb(a){var b=new tb(ub,rb(sb));nb(a,\"HTMLIFrameElement\");a.src=wb(b).toString()}function Mb(a,b){nb(a,\"HTMLScriptElement\");a.src=wb(b);if(null===ja)b:{b=l.document;if((b=b.querySelector&&b.querySelector(\"script[nonce]\"))&&(b=b.nonce||b.getAttribute(\"nonce\"))&&ia.test(b)){ja=b;break b}ja=\"\"}b=ja;b&&a.setAttribute(\"nonce\",b)};function Nb(a,b){for(var c=a.split(\"%s\"),d=\"\",e=Array.prototype.slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join(\"%s\")}function Ob(a){eb.test(a)&&(-1!=a.indexOf(\"&\")&&(a=a.replace(Za,\"&\")),-1!=a.indexOf(\"<\")&&(a=a.replace($a,\"<\")),-1!=a.indexOf(\">\")&&(a=a.replace(ab,\">\")),-1!=a.indexOf('\"')&&(a=a.replace(bb,\""\")),-1!=a.indexOf(\"'\")&&(a=a.replace(cb,\"'\")),-1!=a.indexOf(\"\\x00\")&&(a=a.replace(db,\"�\")));return a};function Pb(a){Pb[\" \"](a);return a}Pb[\" \"]=ka;function Qb(a,b){var c=Rb;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var Sb=y(\"Opera\"),Tb=y(\"Trident\")||y(\"MSIE\"),Ub=y(\"Edge\"),Vb=Ub||Tb,Wb=y(\"Gecko\")&&!(x(gb.toLowerCase(),\"webkit\")&&!y(\"Edge\"))&&!(y(\"Trident\")||y(\"MSIE\"))&&!y(\"Edge\"),Xb=x(gb.toLowerCase(),\"webkit\")&&!y(\"Edge\");function Yb(){var a=l.document;return a?a.documentMode:void 0}var Zb;\na:{var $b=\"\",ac=function(){var a=gb;if(Wb)return/rv:([^\\);]+)(\\)|;)/.exec(a);if(Ub)return/Edge\\/([\\d\\.]+)/.exec(a);if(Tb)return/\\b(?:MSIE|rv)[: ]([^\\);]+)(\\)|;)/.exec(a);if(Xb)return/WebKit\\/(\\S+)/.exec(a);if(Sb)return/(?:Version)[ \\/]?(\\S+)/.exec(a)}();ac&&($b=ac?ac[1]:\"\");if(Tb){var bc=Yb();if(null!=bc&&bc>parseFloat($b)){Zb=String(bc);break a}}Zb=$b}var Rb={};\nfunction cc(a){return Qb(a,function(){for(var b=0,c=Ya(String(Zb)).split(\".\"),d=Ya(String(a)).split(\".\"),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var g=c[f]||\"\",h=d[f]||\"\";do{g=/(\\d*)(\\D*)(.*)/.exec(g)||[\"\",\"\",\"\",\"\"];h=/(\\d*)(\\D*)(.*)/.exec(h)||[\"\",\"\",\"\",\"\"];if(0==g[0].length&&0==h[0].length)break;b=fb(0==g[1].length?0:parseInt(g[1],10),0==h[1].length?0:parseInt(h[1],10))||fb(0==g[2].length,0==h[2].length)||fb(g[2],h[2]);g=g[3];h=h[3]}while(0==b)}return 0<=b})}var dc;\ndc=l.document&&Tb?Yb():void 0;try{(new self.OffscreenCanvas(0,0)).getContext(\"2d\")}catch(a){}var ec=!Tb||9<=Number(dc);function fc(a){var b=document;return\"string\"===typeof a?b.getElementById(a):a}function gc(a,b){jb(b,function(c,d){c&&\"object\"==typeof c&&c.sa&&(c=c.ra());\"style\"==d?a.style.cssText=c:\"class\"==d?a.className=c:\"for\"==d?a.htmlFor=c:hc.hasOwnProperty(d)?a.setAttribute(hc[d],c):0==d.lastIndexOf(\"aria-\",0)||0==d.lastIndexOf(\"data-\",0)?a.setAttribute(d,c):a[d]=c})}\nvar hc={cellpadding:\"cellPadding\",cellspacing:\"cellSpacing\",colspan:\"colSpan\",frameborder:\"frameBorder\",height:\"height\",maxlength:\"maxLength\",nonce:\"nonce\",role:\"role\",rowspan:\"rowSpan\",type:\"type\",usemap:\"useMap\",valign:\"vAlign\",width:\"width\"};\nfunction ic(a,b,c){var d=arguments,e=document,f=String(d[0]),g=d[1];if(!ec&&g&&(g.name||g.type)){f=[\"<\",f];g.name&&f.push(' name=\"',Ob(g.name),'\"');if(g.type){f.push(' type=\"',Ob(g.type),'\"');var h={};z(h,g);delete h.type;g=h}f.push(\">\");f=f.join(\"\")}f=jc(e,f);g&&(\"string\"===typeof g?f.className=g:Array.isArray(g)?f.className=g.join(\" \"):gc(f,g));2<d.length&&kc(e,f,d);return f}\nfunction kc(a,b,c){function d(g){g&&b.appendChild(\"string\"===typeof g?a.createTextNode(g):g)}for(var e=2;e<c.length;e++){var f=c[e];!ma(f)||n(f)&&0<f.nodeType?d(f):w(lc(f)?Xa(f):f,d)}}function jc(a,b){b=String(b);\"application/xhtml+xml\"===a.contentType&&(b=b.toLowerCase());return a.createElement(b)}function lc(a){if(a&&\"number\"==typeof a.length){if(n(a))return\"function\"==typeof a.item||\"string\"==typeof a.item;if(na(a))return\"function\"==typeof a.item}return!1};function mc(a){l.setTimeout(function(){throw a;},0)}var nc;\nfunction oc(){var a=l.MessageChannel;\"undefined\"===typeof a&&\"undefined\"!==typeof window&&window.postMessage&&window.addEventListener&&!y(\"Presto\")&&(a=function(){var e=jc(document,\"IFRAME\");e.style.display=\"none\";Lb(e);document.documentElement.appendChild(e);var f=e.contentWindow;e=f.document;e.open();e.write(Ib(Kb));e.close();var g=\"callImmediate\"+Math.random(),h=\"file:\"==f.location.protocol?\"*\":f.location.protocol+\"//\"+f.location.host;e=q(function(m){if((\"*\"==h||m.origin==h)&&m.data==g)this.port1.onmessage()},\nthis);f.addEventListener(\"message\",e,!1);this.port1={};this.port2={postMessage:function(){f.postMessage(g,h)}}});if(\"undefined\"!==typeof a&&!y(\"Trident\")&&!y(\"MSIE\")){var b=new a,c={},d=c;b.port1.onmessage=function(){if(void 0!==c.next){c=c.next;var e=c.Fb;c.Fb=null;e()}};return function(e){d.next={Fb:e};d=d.next;b.port2.postMessage(0)}}return function(e){l.setTimeout(e,0)}};function pc(a,b){qc||rc();sc||(qc(),sc=!0);La.add(a,b)}var qc;function rc(){if(l.Promise&&l.Promise.resolve){var a=l.Promise.resolve(void 0);qc=function(){a.then(tc)}}else qc=function(){var b=tc;!na(l.setImmediate)||l.Window&&l.Window.prototype&&!y(\"Edge\")&&l.Window.prototype.setImmediate==l.setImmediate?(nc||(nc=oc()),nc(b)):l.setImmediate(b)}}var sc=!1,La=new Ha;function tc(){for(var a;a=Ka();){try{a.a.call(a.b)}catch(b){mc(b)}Ga(Ja,a)}sc=!1};function C(a,b){this.a=uc;this.i=void 0;this.f=this.b=this.c=null;this.g=this.h=!1;if(a!=ka)try{var c=this;a.call(b,function(d){vc(c,wc,d)},function(d){if(!(d instanceof xc))try{if(d instanceof Error)throw d;throw Error(\"Promise rejected.\");}catch(e){}vc(c,yc,d)})}catch(d){vc(this,yc,d)}}var uc=0,wc=2,yc=3;function zc(){this.next=this.f=this.b=this.g=this.a=null;this.c=!1}zc.prototype.reset=function(){this.f=this.b=this.g=this.a=null;this.c=!1};var Ac=new Fa(function(){return new zc},function(a){a.reset()});\nfunction Bc(a,b,c){var d=Ac.get();d.g=a;d.b=b;d.f=c;return d}function D(a){if(a instanceof C)return a;var b=new C(ka);vc(b,wc,a);return b}function E(a){return new C(function(b,c){c(a)})}function Cc(a,b,c){Dc(a,b,c,null)||pc(ta(b,a))}function Ec(a){return new C(function(b,c){var d=a.length,e=[];if(d)for(var f=function(p,v){d--;e[p]=v;0==d&&b(e)},g=function(p){c(p)},h=0,m;h<a.length;h++)m=a[h],Cc(m,ta(f,h),g);else b(e)})}\nfunction Fc(a){return new C(function(b){var c=a.length,d=[];if(c)for(var e=function(h,m,p){c--;d[h]=m?{Ob:!0,value:p}:{Ob:!1,reason:p};0==c&&b(d)},f=0,g;f<a.length;f++)g=a[f],Cc(g,ta(e,f,!0),ta(e,f,!1));else b(d)})}C.prototype.then=function(a,b,c){return Gc(this,na(a)?a:null,na(b)?b:null,c)};C.prototype.$goog_Thenable=!0;k=C.prototype;k.na=function(a,b){a=Bc(a,a,b);a.c=!0;Hc(this,a);return this};k.s=function(a,b){return Gc(this,null,a,b)};\nk.cancel=function(a){if(this.a==uc){var b=new xc(a);pc(function(){Ic(this,b)},this)}};function Ic(a,b){if(a.a==uc)if(a.c){var c=a.c;if(c.b){for(var d=0,e=null,f=null,g=c.b;g&&(g.c||(d++,g.a==a&&(e=g),!(e&&1<d)));g=g.next)e||(f=g);e&&(c.a==uc&&1==d?Ic(c,b):(f?(d=f,d.next==c.f&&(c.f=d),d.next=d.next.next):Jc(c),Kc(c,e,yc,b)))}a.c=null}else vc(a,yc,b)}function Hc(a,b){a.b||a.a!=wc&&a.a!=yc||Lc(a);a.f?a.f.next=b:a.b=b;a.f=b}\nfunction Gc(a,b,c,d){var e=Bc(null,null,null);e.a=new C(function(f,g){e.g=b?function(h){try{var m=b.call(d,h);f(m)}catch(p){g(p)}}:f;e.b=c?function(h){try{var m=c.call(d,h);void 0===m&&h instanceof xc?g(h):f(m)}catch(p){g(p)}}:g});e.a.c=a;Hc(a,e);return e.a}k.Zc=function(a){this.a=uc;vc(this,wc,a)};k.$c=function(a){this.a=uc;vc(this,yc,a)};\nfunction vc(a,b,c){a.a==uc&&(a===c&&(b=yc,c=new TypeError(\"Promise cannot resolve to itself\")),a.a=1,Dc(c,a.Zc,a.$c,a)||(a.i=c,a.a=b,a.c=null,Lc(a),b!=yc||c instanceof xc||Mc(a,c)))}function Dc(a,b,c,d){if(a instanceof C)return Hc(a,Bc(b||ka,c||null,d)),!0;if(Ca(a))return a.then(b,c,d),!0;if(n(a))try{var e=a.then;if(na(e))return Nc(a,e,b,c,d),!0}catch(f){return c.call(d,f),!0}return!1}\nfunction Nc(a,b,c,d,e){function f(m){h||(h=!0,d.call(e,m))}function g(m){h||(h=!0,c.call(e,m))}var h=!1;try{b.call(a,g,f)}catch(m){f(m)}}function Lc(a){a.h||(a.h=!0,pc(a.fc,a))}function Jc(a){var b=null;a.b&&(b=a.b,a.b=b.next,b.next=null);a.b||(a.f=null);return b}k.fc=function(){for(var a;a=Jc(this);)Kc(this,a,this.a,this.i);this.h=!1};\nfunction Kc(a,b,c,d){if(c==yc&&b.b&&!b.c)for(;a&&a.g;a=a.c)a.g=!1;if(b.a)b.a.c=null,Oc(b,c,d);else try{b.c?b.g.call(b.f):Oc(b,c,d)}catch(e){Pc.call(null,e)}Ga(Ac,b)}function Oc(a,b,c){b==wc?a.g.call(a.f,c):a.b&&a.b.call(a.f,c)}function Mc(a,b){a.g=!0;pc(function(){a.g&&Pc.call(null,b)})}var Pc=mc;function xc(a){u.call(this,a)}r(xc,u);xc.prototype.name=\"cancel\";function Qc(){0!=Rc&&(Sc[oa(this)]=this);this.xa=this.xa;this.oa=this.oa}var Rc=0,Sc={};Qc.prototype.xa=!1;function Tc(a){if(!a.xa&&(a.xa=!0,a.Da(),0!=Rc)){var b=oa(a);if(0!=Rc&&a.oa&&0<a.oa.length)throw Error(a+\" did not empty its onDisposeCallbacks queue. This probably means it overrode dispose() or disposeInternal() without calling the superclass' method.\");delete Sc[b]}}Qc.prototype.Da=function(){if(this.oa)for(;this.oa.length;)this.oa.shift()()};var Uc=Object.freeze||function(a){return a};var Vc=!Tb||9<=Number(dc),Wc=Tb&&!cc(\"9\"),Xc=function(){if(!l.addEventListener||!Object.defineProperty)return!1;var a=!1,b=Object.defineProperty({},\"passive\",{get:function(){a=!0}});try{l.addEventListener(\"test\",ka,b),l.removeEventListener(\"test\",ka,b)}catch(c){}return a}();function F(a,b){this.type=a;this.b=this.target=b;this.defaultPrevented=!1}F.prototype.preventDefault=function(){this.defaultPrevented=!0};function Yc(a,b){F.call(this,a?a.type:\"\");this.relatedTarget=this.b=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.key=\"\";this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.pointerId=0;this.pointerType=\"\";this.a=null;if(a){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.b=b;if(b=a.relatedTarget){if(Wb){a:{try{Pb(b.nodeName);var e=!0;break a}catch(f){}e=!1}e||(b=null)}}else\"mouseover\"==\nc?b=a.fromElement:\"mouseout\"==c&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0):(this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.key=a.key||\"\";this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=\na.metaKey;this.pointerId=a.pointerId||0;this.pointerType=\"string\"===typeof a.pointerType?a.pointerType:Zc[a.pointerType]||\"\";this.a=a;a.defaultPrevented&&this.preventDefault()}}r(Yc,F);var Zc=Uc({2:\"touch\",3:\"pen\",4:\"mouse\"});Yc.prototype.preventDefault=function(){Yc.$a.preventDefault.call(this);var a=this.a;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,Wc)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};Yc.prototype.g=function(){return this.a};var $c=\"closure_listenable_\"+(1E6*Math.random()|0),ad=0;function bd(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.Ua=e;this.key=++ad;this.va=this.Oa=!1}function cd(a){a.va=!0;a.listener=null;a.proxy=null;a.src=null;a.Ua=null};function dd(a){this.src=a;this.a={};this.b=0}dd.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.a[f];a||(a=this.a[f]=[],this.b++);var g=ed(a,b,d,e);-1<g?(b=a[g],c||(b.Oa=!1)):(b=new bd(b,this.src,f,!!d,e),b.Oa=c,a.push(b));return b};function fd(a,b){var c=b.type;c in a.a&&Ua(a.a[c],b)&&(cd(b),0==a.a[c].length&&(delete a.a[c],a.b--))}function ed(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.va&&f.listener==b&&f.capture==!!c&&f.Ua==d)return e}return-1};var gd=\"closure_lm_\"+(1E6*Math.random()|0),hd={},id=0;function jd(a,b,c,d,e){if(d&&d.once)kd(a,b,c,d,e);else if(Array.isArray(b))for(var f=0;f<b.length;f++)jd(a,b[f],c,d,e);else c=ld(c),a&&a[$c]?md(a,b,c,n(d)?!!d.capture:!!d,e):nd(a,b,c,!1,d,e)}\nfunction nd(a,b,c,d,e,f){if(!b)throw Error(\"Invalid event type\");var g=n(e)?!!e.capture:!!e,h=od(a);h||(a[gd]=h=new dd(a));c=h.add(b,c,d,g,f);if(!c.proxy){d=pd();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)Xc||(e=g),void 0===e&&(e=!1),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(qd(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error(\"addEventListener and attachEvent are unavailable.\");id++}}\nfunction pd(){var a=rd,b=Vc?function(c){return a.call(b.src,b.listener,c)}:function(c){c=a.call(b.src,b.listener,c);if(!c)return c};return b}function kd(a,b,c,d,e){if(Array.isArray(b))for(var f=0;f<b.length;f++)kd(a,b[f],c,d,e);else c=ld(c),a&&a[$c]?sd(a,b,c,n(d)?!!d.capture:!!d,e):nd(a,b,c,!0,d,e)}\nfunction G(a,b,c,d,e){if(Array.isArray(b))for(var f=0;f<b.length;f++)G(a,b[f],c,d,e);else(d=n(d)?!!d.capture:!!d,c=ld(c),a&&a[$c])?(a=a.v,b=String(b).toString(),b in a.a&&(f=a.a[b],c=ed(f,c,d,e),-1<c&&(cd(f[c]),Array.prototype.splice.call(f,c,1),0==f.length&&(delete a.a[b],a.b--)))):a&&(a=od(a))&&(b=a.a[b.toString()],a=-1,b&&(a=ed(b,c,d,e)),(c=-1<a?b[a]:null)&&td(c))}\nfunction td(a){if(\"number\"!==typeof a&&a&&!a.va){var b=a.src;if(b&&b[$c])fd(b.v,a);else{var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(qd(c),d):b.addListener&&b.removeListener&&b.removeListener(d);id--;(c=od(b))?(fd(c,a),0==c.b&&(c.src=null,b[gd]=null)):cd(a)}}}function qd(a){return a in hd?hd[a]:hd[a]=\"on\"+a}\nfunction ud(a,b,c,d){var e=!0;if(a=od(a))if(b=a.a[b.toString()])for(b=b.concat(),a=0;a<b.length;a++){var f=b[a];f&&f.capture==c&&!f.va&&(f=vd(f,d),e=e&&!1!==f)}return e}function vd(a,b){var c=a.listener,d=a.Ua||a.src;a.Oa&&td(a);return c.call(d,b)}\nfunction rd(a,b){if(a.va)return!0;if(!Vc){if(!b)a:{b=[\"window\",\"event\"];for(var c=l,d=0;d<b.length;d++)if(c=c[b[d]],null==c){b=null;break a}b=c}d=b;b=new Yc(d,this);c=!0;if(!(0>d.keyCode||void 0!=d.returnValue)){a:{var e=!1;if(0==d.keyCode)try{d.keyCode=-1;break a}catch(g){e=!0}if(e||void 0==d.returnValue)d.returnValue=!0}d=[];for(e=b.b;e;e=e.parentNode)d.push(e);a=a.type;for(e=d.length-1;0<=e;e--){b.b=d[e];var f=ud(d[e],a,!0,b);c=c&&f}for(e=0;e<d.length;e++)b.b=d[e],f=ud(d[e],a,!1,b),c=c&&f}return c}return vd(a,\nnew Yc(b,this))}function od(a){a=a[gd];return a instanceof dd?a:null}var wd=\"__closure_events_fn_\"+(1E9*Math.random()>>>0);function ld(a){if(na(a))return a;a[wd]||(a[wd]=function(b){return a.handleEvent(b)});return a[wd]};function H(){Qc.call(this);this.v=new dd(this);this.$b=this;this.fb=null}r(H,Qc);H.prototype[$c]=!0;H.prototype.addEventListener=function(a,b,c,d){jd(this,a,b,c,d)};H.prototype.removeEventListener=function(a,b,c,d){G(this,a,b,c,d)};\nH.prototype.dispatchEvent=function(a){var b,c=this.fb;if(c)for(b=[];c;c=c.fb)b.push(c);c=this.$b;var d=a.type||a;if(\"string\"===typeof a)a=new F(a,c);else if(a instanceof F)a.target=a.target||c;else{var e=a;a=new F(d,c);z(a,e)}e=!0;if(b)for(var f=b.length-1;0<=f;f--){var g=a.b=b[f];e=xd(g,d,!0,a)&&e}g=a.b=c;e=xd(g,d,!0,a)&&e;e=xd(g,d,!1,a)&&e;if(b)for(f=0;f<b.length;f++)g=a.b=b[f],e=xd(g,d,!1,a)&&e;return e};\nH.prototype.Da=function(){H.$a.Da.call(this);if(this.v){var a=this.v,b=0,c;for(c in a.a){for(var d=a.a[c],e=0;e<d.length;e++)++b,cd(d[e]);delete a.a[c];a.b--}}this.fb=null};function md(a,b,c,d,e){a.v.add(String(b),c,!1,d,e)}function sd(a,b,c,d,e){a.v.add(String(b),c,!0,d,e)}\nfunction xd(a,b,c,d){b=a.v.a[String(b)];if(!b)return!0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var g=b[f];if(g&&!g.va&&g.capture==c){var h=g.listener,m=g.Ua||g.src;g.Oa&&fd(a.v,g);e=!1!==h.call(m,d)&&e}}return e&&!d.defaultPrevented};function zd(a,b,c){if(na(a))c&&(a=q(a,c));else if(a&&\"function\"==typeof a.handleEvent)a=q(a.handleEvent,a);else throw Error(\"Invalid listener argument\");return 2147483647<Number(b)?-1:l.setTimeout(a,b||0)}function Ad(a){var b=null;return(new C(function(c,d){b=zd(function(){c(void 0)},a);-1==b&&d(Error(\"Failed to schedule timer.\"))})).s(function(c){l.clearTimeout(b);throw c;})};function Bd(a){if(a.V&&\"function\"==typeof a.V)return a.V();if(\"string\"===typeof a)return a.split(\"\");if(ma(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}b=[];c=0;for(d in a)b[c++]=a[d];return b}function Cd(a){if(a.Y&&\"function\"==typeof a.Y)return a.Y();if(!a.V||\"function\"!=typeof a.V){if(ma(a)||\"string\"===typeof a){var b=[];a=a.length;for(var c=0;c<a;c++)b.push(c);return b}b=[];c=0;for(var d in a)b[c++]=d;return b}}\nfunction Dd(a,b){if(a.forEach&&\"function\"==typeof a.forEach)a.forEach(b,void 0);else if(ma(a)||\"string\"===typeof a)w(a,b,void 0);else for(var c=Cd(a),d=Bd(a),e=d.length,f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a)};function Ed(a,b){this.b={};this.a=[];this.c=0;var c=arguments.length;if(1<c){if(c%2)throw Error(\"Uneven number of arguments\");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else if(a)if(a instanceof Ed)for(c=a.Y(),d=0;d<c.length;d++)this.set(c[d],a.get(c[d]));else for(d in a)this.set(d,a[d])}k=Ed.prototype;k.V=function(){Fd(this);for(var a=[],b=0;b<this.a.length;b++)a.push(this.b[this.a[b]]);return a};k.Y=function(){Fd(this);return this.a.concat()};\nk.clear=function(){this.b={};this.c=this.a.length=0};function Fd(a){if(a.c!=a.a.length){for(var b=0,c=0;b<a.a.length;){var d=a.a[b];Gd(a.b,d)&&(a.a[c++]=d);b++}a.a.length=c}if(a.c!=a.a.length){var e={};for(c=b=0;b<a.a.length;)d=a.a[b],Gd(e,d)||(a.a[c++]=d,e[d]=1),b++;a.a.length=c}}k.get=function(a,b){return Gd(this.b,a)?this.b[a]:b};k.set=function(a,b){Gd(this.b,a)||(this.c++,this.a.push(a));this.b[a]=b};\nk.forEach=function(a,b){for(var c=this.Y(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};function Gd(a,b){return Object.prototype.hasOwnProperty.call(a,b)};var Hd=/^(?:([^:/?#.]+):)?(?:\\/\\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/\\\\#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$/;function Id(a,b){if(a){a=a.split(\"&\");for(var c=0;c<a.length;c++){var d=a[c].indexOf(\"=\"),e=null;if(0<=d){var f=a[c].substring(0,d);e=a[c].substring(d+1)}else f=a[c];b(f,e?decodeURIComponent(e.replace(/\\+/g,\" \")):\"\")}}};function Jd(a,b){this.a=this.l=this.f=\"\";this.g=null;this.h=this.c=\"\";this.i=!1;var c;a instanceof Jd?(this.i=void 0!==b?b:a.i,Kd(this,a.f),this.l=a.l,this.a=a.a,Ld(this,a.g),this.c=a.c,Md(this,Nd(a.b)),this.h=a.h):a&&(c=String(a).match(Hd))?(this.i=!!b,Kd(this,c[1]||\"\",!0),this.l=Od(c[2]||\"\"),this.a=Od(c[3]||\"\",!0),Ld(this,c[4]),this.c=Od(c[5]||\"\",!0),Md(this,c[6]||\"\",!0),this.h=Od(c[7]||\"\")):(this.i=!!b,this.b=new Pd(null,this.i))}\nJd.prototype.toString=function(){var a=[],b=this.f;b&&a.push(Qd(b,Rd,!0),\":\");var c=this.a;if(c||\"file\"==b)a.push(\"//\"),(b=this.l)&&a.push(Qd(b,Rd,!0),\"@\"),a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g,\"%$1\")),c=this.g,null!=c&&a.push(\":\",String(c));if(c=this.c)this.a&&\"/\"!=c.charAt(0)&&a.push(\"/\"),a.push(Qd(c,\"/\"==c.charAt(0)?Sd:Td,!0));(c=this.b.toString())&&a.push(\"?\",c);(c=this.h)&&a.push(\"#\",Qd(c,Ud));return a.join(\"\")};\nJd.prototype.resolve=function(a){var b=new Jd(this),c=!!a.f;c?Kd(b,a.f):c=!!a.l;c?b.l=a.l:c=!!a.a;c?b.a=a.a:c=null!=a.g;var d=a.c;if(c)Ld(b,a.g);else if(c=!!a.c){if(\"/\"!=d.charAt(0))if(this.a&&!this.c)d=\"/\"+d;else{var e=b.c.lastIndexOf(\"/\");-1!=e&&(d=b.c.substr(0,e+1)+d)}e=d;if(\"..\"==e||\".\"==e)d=\"\";else if(x(e,\"./\")||x(e,\"/.\")){d=0==e.lastIndexOf(\"/\",0);e=e.split(\"/\");for(var f=[],g=0;g<e.length;){var h=e[g++];\".\"==h?d&&g==e.length&&f.push(\"\"):\"..\"==h?((1<f.length||1==f.length&&\"\"!=f[0])&&f.pop(),\nd&&g==e.length&&f.push(\"\")):(f.push(h),d=!0)}d=f.join(\"/\")}else d=e}c?b.c=d:c=\"\"!==a.b.toString();c?Md(b,Nd(a.b)):c=!!a.h;c&&(b.h=a.h);return b};function Kd(a,b,c){a.f=c?Od(b,!0):b;a.f&&(a.f=a.f.replace(/:$/,\"\"))}function Ld(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error(\"Bad port number \"+b);a.g=b}else a.g=null}function Md(a,b,c){b instanceof Pd?(a.b=b,Vd(a.b,a.i)):(c||(b=Qd(b,Wd)),a.b=new Pd(b,a.i))}function I(a,b,c){a.b.set(b,c)}function Xd(a,b){return a.b.get(b)}\nfunction J(a){return a instanceof Jd?new Jd(a):new Jd(a,void 0)}function Yd(a,b,c,d){var e=new Jd(null,void 0);a&&Kd(e,a);b&&(e.a=b);c&&Ld(e,c);d&&(e.c=d);return e}function Od(a,b){return a?b?decodeURI(a.replace(/%25/g,\"%2525\")):decodeURIComponent(a):\"\"}function Qd(a,b,c){return\"string\"===typeof a?(a=encodeURI(a).replace(b,Zd),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,\"%$1\")),a):null}function Zd(a){a=a.charCodeAt(0);return\"%\"+(a>>4&15).toString(16)+(a&15).toString(16)}\nvar Rd=/[#\\/\\?@]/g,Td=/[#\\?:]/g,Sd=/[#\\?]/g,Wd=/[#\\?@]/g,Ud=/#/g;function Pd(a,b){this.b=this.a=null;this.c=a||null;this.f=!!b}function $d(a){a.a||(a.a=new Ed,a.b=0,a.c&&Id(a.c,function(b,c){a.add(decodeURIComponent(b.replace(/\\+/g,\" \")),c)}))}function ae(a){var b=Cd(a);if(\"undefined\"==typeof b)throw Error(\"Keys are undefined\");var c=new Pd(null,void 0);a=Bd(a);for(var d=0;d<b.length;d++){var e=b[d],f=a[d];Array.isArray(f)?be(c,e,f):c.add(e,f)}return c}k=Pd.prototype;\nk.add=function(a,b){$d(this);this.c=null;a=ce(this,a);var c=this.a.get(a);c||this.a.set(a,c=[]);c.push(b);this.b+=1;return this};function de(a,b){$d(a);b=ce(a,b);Gd(a.a.b,b)&&(a.c=null,a.b-=a.a.get(b).length,a=a.a,Gd(a.b,b)&&(delete a.b[b],a.c--,a.a.length>2*a.c&&Fd(a)))}k.clear=function(){this.a=this.c=null;this.b=0};function ee(a,b){$d(a);b=ce(a,b);return Gd(a.a.b,b)}k.forEach=function(a,b){$d(this);this.a.forEach(function(c,d){w(c,function(e){a.call(b,e,d,this)},this)},this)};\nk.Y=function(){$d(this);for(var a=this.a.V(),b=this.a.Y(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};k.V=function(a){$d(this);var b=[];if(\"string\"===typeof a)ee(this,a)&&(b=Wa(b,this.a.get(ce(this,a))));else{a=this.a.V();for(var c=0;c<a.length;c++)b=Wa(b,a[c])}return b};k.set=function(a,b){$d(this);this.c=null;a=ce(this,a);ee(this,a)&&(this.b-=this.a.get(a).length);this.a.set(a,[b]);this.b+=1;return this};\nk.get=function(a,b){if(!a)return b;a=this.V(a);return 0<a.length?String(a[0]):b};function be(a,b,c){de(a,b);0<c.length&&(a.c=null,a.a.set(ce(a,b),Xa(c)),a.b+=c.length)}k.toString=function(){if(this.c)return this.c;if(!this.a)return\"\";for(var a=[],b=this.a.Y(),c=0;c<b.length;c++){var d=b[c],e=encodeURIComponent(String(d));d=this.V(d);for(var f=0;f<d.length;f++){var g=e;\"\"!==d[f]&&(g+=\"=\"+encodeURIComponent(String(d[f])));a.push(g)}}return this.c=a.join(\"&\")};\nfunction Nd(a){var b=new Pd;b.c=a.c;a.a&&(b.a=new Ed(a.a),b.b=a.b);return b}function ce(a,b){b=String(b);a.f&&(b=b.toLowerCase());return b}function Vd(a,b){b&&!a.f&&($d(a),a.c=null,a.a.forEach(function(c,d){var e=d.toLowerCase();d!=e&&(de(this,d),be(this,e,c))},a));a.f=b};function fe(a){var b=[];ge(new he,a,b);return b.join(\"\")}function he(){}\nfunction ge(a,b,c){if(null==b)c.push(\"null\");else{if(\"object\"==typeof b){if(Array.isArray(b)){var d=b;b=d.length;c.push(\"[\");for(var e=\"\",f=0;f<b;f++)c.push(e),ge(a,d[f],c),e=\",\";c.push(\"]\");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push(\"{\");e=\"\";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],\"function\"!=typeof f&&(c.push(e),ie(d,c),c.push(\":\"),ge(a,f,c),e=\",\"));c.push(\"}\");return}}switch(typeof b){case \"string\":ie(b,c);break;case \"number\":c.push(isFinite(b)&&\n!isNaN(b)?String(b):\"null\");break;case \"boolean\":c.push(String(b));break;case \"function\":c.push(\"null\");break;default:throw Error(\"Unknown type: \"+typeof b);}}}var je={'\"':'\\\\\"',\"\\\\\":\"\\\\\\\\\",\"/\":\"\\\\/\",\"\\b\":\"\\\\b\",\"\\f\":\"\\\\f\",\"\\n\":\"\\\\n\",\"\\r\":\"\\\\r\",\"\\t\":\"\\\\t\",\"\\x0B\":\"\\\\u000b\"},ke=/\\uffff/.test(\"\\uffff\")?/[\\\\\"\\x00-\\x1f\\x7f-\\uffff]/g:/[\\\\\"\\x00-\\x1f\\x7f-\\xff]/g;\nfunction ie(a,b){b.push('\"',a.replace(ke,function(c){var d=je[c];d||(d=\"\\\\u\"+(c.charCodeAt(0)|65536).toString(16).substr(1),je[c]=d);return d}),'\"')};function le(){var a=K();return Tb&&!!dc&&11==dc||/Edge\\/\\d+/.test(a)}function me(){return l.window&&l.window.location.href||self&&self.location&&self.location.href||\"\"}function ne(a,b){b=b||l.window;var c=\"about:blank\";a&&(c=Db(Fb(a)));b.location.href=c}function oe(a,b){var c=[],d;for(d in a)d in b?typeof a[d]!=typeof b[d]?c.push(d):\"object\"==typeof a[d]&&null!=a[d]&&null!=b[d]?0<oe(a[d],b[d]).length&&c.push(d):a[d]!==b[d]&&c.push(d):c.push(d);for(d in b)d in a||c.push(d);return c}\nfunction pe(){var a=K();a=qe(a)!=re?null:(a=a.match(/\\sChrome\\/(\\d+)/i))&&2==a.length?parseInt(a[1],10):null;return a&&30>a?!1:!Tb||!dc||9<dc}function se(a){a=(a||K()).toLowerCase();return a.match(/android/)||a.match(/webos/)||a.match(/iphone|ipad|ipod/)||a.match(/blackberry/)||a.match(/windows phone/)||a.match(/iemobile/)?!0:!1}function te(a){a=a||l.window;try{a.close()}catch(b){}}\nfunction ue(a,b,c){var d=Math.floor(1E9*Math.random()).toString();b=b||500;c=c||600;var e=(window.screen.availHeight-c)/2,f=(window.screen.availWidth-b)/2;b={width:b,height:c,top:0<e?e:0,left:0<f?f:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1};c=K().toLowerCase();d&&(b.target=d,x(c,\"crios/\")&&(b.target=\"_blank\"));qe(K())==ve&&(a=a||\"http://localhost\",b.scrollbars=!0);c=a||\"\";(a=b)||(a={});d=window;b=c instanceof Ab?c:Fb(\"undefined\"!=typeof c.href?c.href:String(c));c=a.target||c.target;e=[];\nfor(g in a)switch(g){case \"width\":case \"height\":case \"top\":case \"left\":e.push(g+\"=\"+a[g]);break;case \"target\":case \"noopener\":case \"noreferrer\":break;default:e.push(g+\"=\"+(a[g]?1:0))}var g=e.join(\",\");if((y(\"iPhone\")&&!y(\"iPod\")&&!y(\"iPad\")||y(\"iPad\")||y(\"iPod\"))&&d.navigator&&d.navigator.standalone&&c&&\"_self\"!=c)g=jc(document,\"A\"),nb(g,\"HTMLAnchorElement\"),b instanceof Ab||b instanceof Ab||(b=\"object\"==typeof b&&b.sa?b.ra():String(b),Eb.test(b)||(b=\"about:invalid#zClosurez\"),b=new Ab(Bb,b)),g.href=\nDb(b),g.setAttribute(\"target\",c),a.noreferrer&&g.setAttribute(\"rel\",\"noreferrer\"),a=document.createEvent(\"MouseEvent\"),a.initMouseEvent(\"click\",!0,!0,d,1),g.dispatchEvent(a),g={};else if(a.noreferrer){if(g=d.open(\"\",c,g),a=Db(b),g&&(Vb&&x(a,\";\")&&(a=\"'\"+a.replace(/'/g,\"%27\")+\"'\"),g.opener=null,a=Jb('<meta name=\"referrer\" content=\"no-referrer\"><meta http-equiv=\"refresh\" content=\"0; url='+Ob(a)+'\">'),d=g.document))d.write(Ib(a)),d.close()}else(g=d.open(Db(b),c,g))&&a.noopener&&(g.opener=null);if(g)try{g.focus()}catch(h){}return g}\nfunction we(a){return new C(function(b){function c(){Ad(2E3).then(function(){if(!a||a.closed)b();else return c()})}return c()})}var xe=/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/,ye=/^[^@]+@[^@]+$/;function ze(){var a=null;return(new C(function(b){\"complete\"==l.document.readyState?b():(a=function(){b()},kd(window,\"load\",a))})).s(function(b){G(window,\"load\",a);throw b;})}\nfunction Ae(){return Be(void 0)?ze().then(function(){return new C(function(a,b){var c=l.document,d=setTimeout(function(){b(Error(\"Cordova framework is not ready.\"))},1E3);c.addEventListener(\"deviceready\",function(){clearTimeout(d);a()},!1)})}):E(Error(\"Cordova must run in an Android or iOS file scheme.\"))}function Be(a){a=a||K();return!(\"file:\"!==Ce()&&\"ionic:\"!==Ce()||!a.toLowerCase().match(/iphone|ipad|ipod|android/))}function De(){var a=l.window;try{return!(!a||a==a.top)}catch(b){return!1}}\nfunction Ee(){return\"undefined\"!==typeof l.WorkerGlobalScope&&\"function\"===typeof l.importScripts}function Fe(){return firebase.INTERNAL.hasOwnProperty(\"reactNative\")?\"ReactNative\":firebase.INTERNAL.hasOwnProperty(\"node\")?\"Node\":Ee()?\"Worker\":\"Browser\"}function Ge(){var a=Fe();return\"ReactNative\"===a||\"Node\"===a}function He(){for(var a=50,b=[];0<a;)b.push(\"1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\".charAt(Math.floor(62*Math.random()))),a--;return b.join(\"\")}\nvar ve=\"Firefox\",re=\"Chrome\";\nfunction qe(a){var b=a.toLowerCase();if(x(b,\"opera/\")||x(b,\"opr/\")||x(b,\"opios/\"))return\"Opera\";if(x(b,\"iemobile\"))return\"IEMobile\";if(x(b,\"msie\")||x(b,\"trident/\"))return\"IE\";if(x(b,\"edge/\"))return\"Edge\";if(x(b,\"firefox/\"))return ve;if(x(b,\"silk/\"))return\"Silk\";if(x(b,\"blackberry\"))return\"Blackberry\";if(x(b,\"webos\"))return\"Webos\";if(!x(b,\"safari/\")||x(b,\"chrome/\")||x(b,\"crios/\")||x(b,\"android\"))if(!x(b,\"chrome/\")&&!x(b,\"crios/\")||x(b,\"edge/\")){if(x(b,\"android\"))return\"Android\";if((a=a.match(/([a-zA-Z\\d\\.]+)\\/[a-zA-Z\\d\\.]*$/))&&\n2==a.length)return a[1]}else return re;else return\"Safari\";return\"Other\"}var Ie={ld:\"FirebaseCore-web\",nd:\"FirebaseUI-web\"};function Je(a,b){b=b||[];var c=[],d={},e;for(e in Ie)d[Ie[e]]=!0;for(e=0;e<b.length;e++)\"undefined\"!==typeof d[b[e]]&&(delete d[b[e]],c.push(b[e]));c.sort();b=c;b.length||(b=[\"FirebaseCore-web\"]);c=Fe();\"Browser\"===c?(d=K(),c=qe(d)):\"Worker\"===c&&(d=K(),c=qe(d)+\"-\"+c);return c+\"/JsCore/\"+a+\"/\"+b.join(\",\")}function K(){return l.navigator&&l.navigator.userAgent||\"\"}\nfunction L(a,b){a=a.split(\".\");b=b||l;for(var c=0;c<a.length&&\"object\"==typeof b&&null!=b;c++)b=b[a[c]];c!=a.length&&(b=void 0);return b}function Ke(){try{var a=l.localStorage,b=Le();if(a)return a.setItem(b,\"1\"),a.removeItem(b),le()?!!l.indexedDB:!0}catch(c){return Ee()&&!!l.indexedDB}return!1}function Me(){return(Ne()||\"chrome-extension:\"===Ce()||Be())&&!Ge()&&Ke()&&!Ee()}function Ne(){return\"http:\"===Ce()||\"https:\"===Ce()}function Ce(){return l.location&&l.location.protocol||null}\nfunction Oe(a){a=a||K();return se(a)||qe(a)==ve?!1:!0}function Pe(a){return\"undefined\"===typeof a?null:fe(a)}function Qe(a){var b={},c;for(c in a)a.hasOwnProperty(c)&&null!==a[c]&&void 0!==a[c]&&(b[c]=a[c]);return b}function Re(a){if(null!==a)return JSON.parse(a)}function Le(a){return a?a:Math.floor(1E9*Math.random()).toString()}function Se(a){a=a||K();return\"Safari\"==qe(a)||a.toLowerCase().match(/iphone|ipad|ipod/)?!1:!0}\nfunction Te(){var a=l.___jsl;if(a&&a.H)for(var b in a.H)if(a.H[b].r=a.H[b].r||[],a.H[b].L=a.H[b].L||[],a.H[b].r=a.H[b].L.concat(),a.CP)for(var c=0;c<a.CP.length;c++)a.CP[c]=null}function Ue(a,b){if(a>b)throw Error(\"Short delay should be less than long delay!\");this.a=a;this.c=b;a=K();b=Fe();this.b=se(a)||\"ReactNative\"===b}\nUe.prototype.get=function(){var a=l.navigator;return(a&&\"boolean\"===typeof a.onLine&&(Ne()||\"chrome-extension:\"===Ce()||\"undefined\"!==typeof a.connection)?a.onLine:1)?this.b?this.c:this.a:Math.min(5E3,this.a)};function Ve(){var a=l.document;return a&&\"undefined\"!==typeof a.visibilityState?\"visible\"==a.visibilityState:!0}\nfunction We(){var a=l.document,b=null;return Ve()||!a?D():(new C(function(c){b=function(){Ve()&&(a.removeEventListener(\"visibilitychange\",b,!1),c())};a.addEventListener(\"visibilitychange\",b,!1)})).s(function(c){a.removeEventListener(\"visibilitychange\",b,!1);throw c;})}function Xe(a){\"undefined\"!==typeof console&&\"function\"===typeof console.warn&&console.warn(a)}\nfunction Ye(a){try{var b=new Date(parseInt(a,10));if(!isNaN(b.getTime())&&!/[^0-9]/.test(a))return b.toUTCString()}catch(c){}return null}function Ze(){return!(!L(\"fireauth.oauthhelper\",l)&&!L(\"fireauth.iframe\",l))}function $e(){var a=l.navigator;return a&&a.serviceWorker&&a.serviceWorker.controller||null}function af(){var a=l.navigator;return a&&a.serviceWorker?D().then(function(){return a.serviceWorker.ready}).then(function(b){return b.active||null}).s(function(){return null}):D(null)};var bf={};function cf(a){bf[a]||(bf[a]=!0,Xe(a))};var df;try{var ef={};Object.defineProperty(ef,\"abcd\",{configurable:!0,enumerable:!0,value:1});Object.defineProperty(ef,\"abcd\",{configurable:!0,enumerable:!0,value:2});df=2==ef.abcd}catch(a){df=!1}function M(a,b,c){df?Object.defineProperty(a,b,{configurable:!0,enumerable:!0,value:c}):a[b]=c}function N(a,b){if(b)for(var c in b)b.hasOwnProperty(c)&&M(a,c,b[c])}function ff(a){var b={};N(b,a);return b}function gf(a){var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}\nfunction hf(a,b){if(!b||!b.length)return!0;if(!a)return!1;for(var c=0;c<b.length;c++){var d=a[b[c]];if(void 0===d||null===d||\"\"===d)return!1}return!0}function jf(a){var b=a;if(\"object\"==typeof a&&null!=a){b=\"length\"in a?[]:{};for(var c in a)M(b,c,jf(a[c]))}return b};/*\n\n Copyright 2019 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\nfunction kf(a){var b=a&&(a[lf]?\"phone\":null);if(b&&a&&a[mf]){M(this,\"uid\",a[mf]);M(this,\"displayName\",a[nf]||null);var c=null;a[of]&&(c=(new Date(a[of])).toUTCString());M(this,\"enrollmentTime\",c);M(this,\"factorId\",b)}else throw new t(\"internal-error\",\"Internal assert: invalid MultiFactorInfo object\");}kf.prototype.w=function(){return{uid:this.uid,displayName:this.displayName,factorId:this.factorId,enrollmentTime:this.enrollmentTime}};function pf(a){try{var b=new qf(a)}catch(c){b=null}return b}\nvar nf=\"displayName\",of=\"enrolledAt\",mf=\"mfaEnrollmentId\",lf=\"phoneInfo\";function qf(a){kf.call(this,a);M(this,\"phoneNumber\",a[lf])}r(qf,kf);qf.prototype.w=function(){var a=qf.$a.w.call(this);a.phoneNumber=this.phoneNumber;return a};function rf(a){var b={},c=a[sf],d=a[tf],e=a[uf];a=pf(a[vf]);if(!e||e!=wf&&e!=xf&&!c||e==xf&&!d||e==yf&&!a)throw Error(\"Invalid checkActionCode response!\");e==xf?(b[zf]=c||null,b[Af]=c||null,b[Bf]=d):(b[zf]=d||null,b[Af]=d||null,b[Bf]=c||null);b[Cf]=a||null;M(this,Df,e);M(this,Ef,jf(b))}\nvar yf=\"REVERT_SECOND_FACTOR_ADDITION\",wf=\"EMAIL_SIGNIN\",xf=\"VERIFY_AND_CHANGE_EMAIL\",sf=\"email\",vf=\"mfaInfo\",tf=\"newEmail\",uf=\"requestType\",Bf=\"email\",zf=\"fromEmail\",Cf=\"multiFactorInfo\",Af=\"previousEmail\",Ef=\"data\",Df=\"operation\";function Ff(a){a=J(a);var b=Xd(a,Gf)||null,c=Xd(a,Hf)||null,d=Xd(a,If)||null;d=d?Jf[d]||null:null;if(!b||!c||!d)throw new t(\"argument-error\",Gf+\", \"+Hf+\"and \"+If+\" are required in a valid action code URL.\");N(this,{apiKey:b,operation:d,code:c,continueUrl:Xd(a,Kf)||null,languageCode:Xd(a,Lf)||null,tenantId:Xd(a,Mf)||null})}\nvar Gf=\"apiKey\",Hf=\"oobCode\",Kf=\"continueUrl\",Lf=\"languageCode\",If=\"mode\",Mf=\"tenantId\",Jf={recoverEmail:\"RECOVER_EMAIL\",resetPassword:\"PASSWORD_RESET\",revertSecondFactorAddition:yf,signIn:wf,verifyAndChangeEmail:xf,verifyEmail:\"VERIFY_EMAIL\"};function Nf(a){try{return new Ff(a)}catch(b){return null}};function Of(a){var b=a[Pf];if(\"undefined\"===typeof b)throw new t(\"missing-continue-uri\");if(\"string\"!==typeof b||\"string\"===typeof b&&!b.length)throw new t(\"invalid-continue-uri\");this.h=b;this.b=this.a=null;this.g=!1;var c=a[Qf];if(c&&\"object\"===typeof c){b=c[Rf];var d=c[Sf];c=c[Tf];if(\"string\"===typeof b&&b.length){this.a=b;if(\"undefined\"!==typeof d&&\"boolean\"!==typeof d)throw new t(\"argument-error\",Sf+\" property must be a boolean when specified.\");this.g=!!d;if(\"undefined\"!==typeof c&&(\"string\"!==\ntypeof c||\"string\"===typeof c&&!c.length))throw new t(\"argument-error\",Tf+\" property must be a non empty string when specified.\");this.b=c||null}else{if(\"undefined\"!==typeof b)throw new t(\"argument-error\",Rf+\" property must be a non empty string when specified.\");if(\"undefined\"!==typeof d||\"undefined\"!==typeof c)throw new t(\"missing-android-pkg-name\");}}else if(\"undefined\"!==typeof c)throw new t(\"argument-error\",Qf+\" property must be a non null object when specified.\");this.f=null;if((b=a[Uf])&&\"object\"===\ntypeof b)if(b=b[Vf],\"string\"===typeof b&&b.length)this.f=b;else{if(\"undefined\"!==typeof b)throw new t(\"argument-error\",Vf+\" property must be a non empty string when specified.\");}else if(\"undefined\"!==typeof b)throw new t(\"argument-error\",Uf+\" property must be a non null object when specified.\");b=a[Wf];if(\"undefined\"!==typeof b&&\"boolean\"!==typeof b)throw new t(\"argument-error\",Wf+\" property must be a boolean when specified.\");this.c=!!b;a=a[Xf];if(\"undefined\"!==typeof a&&(\"string\"!==typeof a||\"string\"===\ntypeof a&&!a.length))throw new t(\"argument-error\",Xf+\" property must be a non empty string when specified.\");this.i=a||null}var Qf=\"android\",Xf=\"dynamicLinkDomain\",Wf=\"handleCodeInApp\",Uf=\"iOS\",Pf=\"url\",Sf=\"installApp\",Tf=\"minimumVersion\",Rf=\"packageName\",Vf=\"bundleId\";\nfunction Yf(a){var b={};b.continueUrl=a.h;b.canHandleCodeInApp=a.c;if(b.androidPackageName=a.a)b.androidMinimumVersion=a.b,b.androidInstallApp=a.g;b.iOSBundleId=a.f;b.dynamicLinkDomain=a.i;for(var c in b)null===b[c]&&delete b[c];return b};function Zf(a){return Pa(a,function(b){b=b.toString(16);return 1<b.length?b:\"0\"+b}).join(\"\")};var $f=null;function ag(a){var b=\"\";bg(a,function(c){b+=String.fromCharCode(c)});return b}function bg(a,b){function c(m){for(;d<a.length;){var p=a.charAt(d++),v=$f[p];if(null!=v)return v;if(!/^[\\s\\xa0]*$/.test(p))throw Error(\"Unknown base64 encoding at char: \"+p);}return m}cg();for(var d=0;;){var e=c(-1),f=c(0),g=c(64),h=c(64);if(64===h&&-1===e)break;b(e<<2|f>>4);64!=g&&(b(f<<4&240|g>>2),64!=h&&b(g<<6&192|h))}}\nfunction cg(){if(!$f){$f={};for(var a=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\".split(\"\"),b=[\"+/=\",\"+/\",\"-_=\",\"-_.\",\"-_\"],c=0;5>c;c++)for(var d=a.concat(b[c].split(\"\")),e=0;e<d.length;e++){var f=d[e];void 0===$f[f]&&($f[f]=e)}}};function dg(a){var b=eg(a);if(!(b&&b.sub&&b.iss&&b.aud&&b.exp))throw Error(\"Invalid JWT\");this.g=a;this.c=b.exp;this.h=b.sub;ua();this.a=b.provider_id||b.firebase&&b.firebase.sign_in_provider||null;this.f=b.firebase&&b.firebase.tenant||null;this.b=!!b.is_anonymous||\"anonymous\"==this.a}dg.prototype.S=function(){return this.f};dg.prototype.i=function(){return this.b};dg.prototype.toString=function(){return this.g};function fg(a){try{return new dg(a)}catch(b){return null}}\nfunction eg(a){if(!a)return null;a=a.split(\".\");if(3!=a.length)return null;a=a[1];for(var b=(4-a.length%4)%4,c=0;c<b;c++)a+=\".\";try{return JSON.parse(ag(a))}catch(d){}return null};var gg=\"oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version\".split(\" \"),hg=[\"client_id\",\"response_type\",\"scope\",\"redirect_uri\",\"state\"],ig={md:{Ja:\"locale\",ua:700,ta:600,fa:\"facebook.com\",Wa:hg},od:{Ja:null,ua:500,ta:750,fa:\"github.com\",Wa:hg},pd:{Ja:\"hl\",ua:515,ta:680,fa:\"google.com\",Wa:hg},vd:{Ja:\"lang\",ua:485,ta:705,fa:\"twitter.com\",Wa:gg},jd:{Ja:\"locale\",ua:640,ta:600,fa:\"apple.com\",Wa:[]}};\nfunction jg(a){for(var b in ig)if(ig[b].fa==a)return ig[b];return null};function kg(a){var b={};b[\"facebook.com\"]=lg;b[\"google.com\"]=mg;b[\"github.com\"]=ng;b[\"twitter.com\"]=og;var c=a&&a[pg];try{if(c)return b[c]?new b[c](a):new qg(a);if(\"undefined\"!==typeof a[rg])return new sg(a)}catch(d){}return null}var rg=\"idToken\",pg=\"providerId\";\nfunction sg(a){var b=a[pg];if(!b&&a[rg]){var c=fg(a[rg]);c&&c.a&&(b=c.a)}if(!b)throw Error(\"Invalid additional user info!\");if(\"anonymous\"==b||\"custom\"==b)b=null;c=!1;\"undefined\"!==typeof a.isNewUser?c=!!a.isNewUser:\"identitytoolkit#SignupNewUserResponse\"===a.kind&&(c=!0);M(this,\"providerId\",b);M(this,\"isNewUser\",c)}function qg(a){sg.call(this,a);a=Re(a.rawUserInfo||\"{}\");M(this,\"profile\",jf(a||{}))}r(qg,sg);\nfunction lg(a){qg.call(this,a);if(\"facebook.com\"!=this.providerId)throw Error(\"Invalid provider ID!\");}r(lg,qg);function ng(a){qg.call(this,a);if(\"github.com\"!=this.providerId)throw Error(\"Invalid provider ID!\");M(this,\"username\",this.profile&&this.profile.login||null)}r(ng,qg);function mg(a){qg.call(this,a);if(\"google.com\"!=this.providerId)throw Error(\"Invalid provider ID!\");}r(mg,qg);\nfunction og(a){qg.call(this,a);if(\"twitter.com\"!=this.providerId)throw Error(\"Invalid provider ID!\");M(this,\"username\",a.screenName||null)}r(og,qg);function tg(a){var b=J(a),c=Xd(b,\"link\"),d=Xd(J(c),\"link\");b=Xd(b,\"deep_link_id\");return Xd(J(b),\"link\")||b||d||c||a};function ug(a,b){if(!a&&!b)throw new t(\"internal-error\",\"Internal assert: no raw session string available\");if(a&&b)throw new t(\"internal-error\",\"Internal assert: unable to determine the session type\");this.a=a||null;this.b=b||null;this.type=this.a?vg:wg}var vg=\"enroll\",wg=\"signin\";ug.prototype.Ha=function(){return this.a?D(this.a):D(this.b)};ug.prototype.w=function(){return this.type==vg?{multiFactorSession:{idToken:this.a}}:{multiFactorSession:{pendingCredential:this.b}}};function xg(){}xg.prototype.ja=function(){};xg.prototype.b=function(){};xg.prototype.c=function(){};xg.prototype.w=function(){};function yg(a,b){return a.then(function(c){if(c[zg]){var d=fg(c[zg]);if(!d||b!=d.h)throw new t(\"user-mismatch\");return c}throw new t(\"user-mismatch\");}).s(function(c){throw c&&c.code&&c.code==va+\"user-not-found\"?new t(\"user-mismatch\"):c;})}\nfunction Ag(a,b){if(b)this.a=b;else throw new t(\"internal-error\",\"failed to construct a credential\");M(this,\"providerId\",a);M(this,\"signInMethod\",a)}Ag.prototype.ja=function(a){return Bg(a,Cg(this))};Ag.prototype.b=function(a,b){var c=Cg(this);c.idToken=b;return Dg(a,c)};Ag.prototype.c=function(a,b){return yg(Eg(a,Cg(this)),b)};function Cg(a){return{pendingToken:a.a,requestUri:\"http://localhost\"}}Ag.prototype.w=function(){return{providerId:this.providerId,signInMethod:this.signInMethod,pendingToken:this.a}};\nfunction Fg(a){if(a&&a.providerId&&a.signInMethod&&0==a.providerId.indexOf(\"saml.\")&&a.pendingToken)try{return new Ag(a.providerId,a.pendingToken)}catch(b){}return null}\nfunction Gg(a,b,c){this.a=null;if(b.idToken||b.accessToken)b.idToken&&M(this,\"idToken\",b.idToken),b.accessToken&&M(this,\"accessToken\",b.accessToken),b.nonce&&!b.pendingToken&&M(this,\"nonce\",b.nonce),b.pendingToken&&(this.a=b.pendingToken);else if(b.oauthToken&&b.oauthTokenSecret)M(this,\"accessToken\",b.oauthToken),M(this,\"secret\",b.oauthTokenSecret);else throw new t(\"internal-error\",\"failed to construct a credential\");M(this,\"providerId\",a);M(this,\"signInMethod\",c)}\nGg.prototype.ja=function(a){return Bg(a,Hg(this))};Gg.prototype.b=function(a,b){var c=Hg(this);c.idToken=b;return Dg(a,c)};Gg.prototype.c=function(a,b){var c=Hg(this);return yg(Eg(a,c),b)};\nfunction Hg(a){var b={};a.idToken&&(b.id_token=a.idToken);a.accessToken&&(b.access_token=a.accessToken);a.secret&&(b.oauth_token_secret=a.secret);b.providerId=a.providerId;a.nonce&&!a.a&&(b.nonce=a.nonce);b={postBody:ae(b).toString(),requestUri:\"http://localhost\"};a.a&&(delete b.postBody,b.pendingToken=a.a);return b}\nGg.prototype.w=function(){var a={providerId:this.providerId,signInMethod:this.signInMethod};this.idToken&&(a.oauthIdToken=this.idToken);this.accessToken&&(a.oauthAccessToken=this.accessToken);this.secret&&(a.oauthTokenSecret=this.secret);this.nonce&&(a.nonce=this.nonce);this.a&&(a.pendingToken=this.a);return a};\nfunction Ig(a){if(a&&a.providerId&&a.signInMethod){var b={idToken:a.oauthIdToken,accessToken:a.oauthTokenSecret?null:a.oauthAccessToken,oauthTokenSecret:a.oauthTokenSecret,oauthToken:a.oauthTokenSecret&&a.oauthAccessToken,nonce:a.nonce,pendingToken:a.pendingToken};try{return new Gg(a.providerId,b,a.signInMethod)}catch(c){}}return null}function Jg(a,b){this.Pc=b||[];N(this,{providerId:a,isOAuthProvider:!0});this.Hb={};this.ob=(jg(a)||{}).Ja||null;this.nb=null}\nJg.prototype.Ka=function(a){this.Hb=lb(a);return this};function Kg(a){if(\"string\"!==typeof a||0!=a.indexOf(\"saml.\"))throw new t(\"argument-error\",'SAML provider IDs must be prefixed with \"saml.\"');Jg.call(this,a,[])}r(Kg,Jg);function Lg(a){Jg.call(this,a,hg);this.a=[]}r(Lg,Jg);Lg.prototype.Ca=function(a){Ta(this.a,a)||this.a.push(a);return this};Lg.prototype.Pb=function(){return Xa(this.a)};\nLg.prototype.credential=function(a,b){var c;n(a)?c={idToken:a.idToken||null,accessToken:a.accessToken||null,nonce:a.rawNonce||null}:c={idToken:a||null,accessToken:b||null};if(!c.idToken&&!c.accessToken)throw new t(\"argument-error\",\"credential failed: must provide the ID token and/or the access token.\");return new Gg(this.providerId,c,this.providerId)};function Mg(){Lg.call(this,\"facebook.com\")}r(Mg,Lg);M(Mg,\"PROVIDER_ID\",\"facebook.com\");M(Mg,\"FACEBOOK_SIGN_IN_METHOD\",\"facebook.com\");\nfunction Ng(a){if(!a)throw new t(\"argument-error\",\"credential failed: expected 1 argument (the OAuth access token).\");var b=a;n(a)&&(b=a.accessToken);return(new Mg).credential({accessToken:b})}function Og(){Lg.call(this,\"github.com\")}r(Og,Lg);M(Og,\"PROVIDER_ID\",\"github.com\");M(Og,\"GITHUB_SIGN_IN_METHOD\",\"github.com\");\nfunction Pg(a){if(!a)throw new t(\"argument-error\",\"credential failed: expected 1 argument (the OAuth access token).\");var b=a;n(a)&&(b=a.accessToken);return(new Og).credential({accessToken:b})}function Qg(){Lg.call(this,\"google.com\");this.Ca(\"profile\")}r(Qg,Lg);M(Qg,\"PROVIDER_ID\",\"google.com\");M(Qg,\"GOOGLE_SIGN_IN_METHOD\",\"google.com\");function Rg(a,b){var c=a;n(a)&&(c=a.idToken,b=a.accessToken);return(new Qg).credential({idToken:c,accessToken:b})}function Sg(){Jg.call(this,\"twitter.com\",gg)}\nr(Sg,Jg);M(Sg,\"PROVIDER_ID\",\"twitter.com\");M(Sg,\"TWITTER_SIGN_IN_METHOD\",\"twitter.com\");function Tg(a,b){var c=a;n(c)||(c={oauthToken:a,oauthTokenSecret:b});if(!c.oauthToken||!c.oauthTokenSecret)throw new t(\"argument-error\",\"credential failed: expected 2 arguments (the OAuth access token and secret).\");return new Gg(\"twitter.com\",c,\"twitter.com\")}\nfunction Ug(a,b,c){this.a=a;this.f=b;M(this,\"providerId\",\"password\");M(this,\"signInMethod\",c===Vg.EMAIL_LINK_SIGN_IN_METHOD?Vg.EMAIL_LINK_SIGN_IN_METHOD:Vg.EMAIL_PASSWORD_SIGN_IN_METHOD)}Ug.prototype.ja=function(a){return this.signInMethod==Vg.EMAIL_LINK_SIGN_IN_METHOD?O(a,Wg,{email:this.a,oobCode:this.f}):O(a,Xg,{email:this.a,password:this.f})};\nUg.prototype.b=function(a,b){return this.signInMethod==Vg.EMAIL_LINK_SIGN_IN_METHOD?O(a,Yg,{idToken:b,email:this.a,oobCode:this.f}):O(a,Zg,{idToken:b,email:this.a,password:this.f})};Ug.prototype.c=function(a,b){return yg(this.ja(a),b)};Ug.prototype.w=function(){return{email:this.a,password:this.f,signInMethod:this.signInMethod}};function $g(a){return a&&a.email&&a.password?new Ug(a.email,a.password,a.signInMethod):null}function Vg(){N(this,{providerId:\"password\",isOAuthProvider:!1})}\nfunction ah(a,b){b=bh(b);if(!b)throw new t(\"argument-error\",\"Invalid email link!\");return new Ug(a,b.code,Vg.EMAIL_LINK_SIGN_IN_METHOD)}function bh(a){a=tg(a);return(a=Nf(a))&&a.operation===wf?a:null}N(Vg,{PROVIDER_ID:\"password\"});N(Vg,{EMAIL_LINK_SIGN_IN_METHOD:\"emailLink\"});N(Vg,{EMAIL_PASSWORD_SIGN_IN_METHOD:\"password\"});function ch(a){if(!(a.cb&&a.bb||a.La&&a.ea))throw new t(\"internal-error\");this.a=a;M(this,\"providerId\",\"phone\");this.fa=\"phone\";M(this,\"signInMethod\",\"phone\")}\nch.prototype.ja=function(a){return a.eb(dh(this))};ch.prototype.b=function(a,b){var c=dh(this);c.idToken=b;return O(a,eh,c)};ch.prototype.c=function(a,b){var c=dh(this);c.operation=\"REAUTH\";a=O(a,fh,c);return yg(a,b)};ch.prototype.w=function(){var a={providerId:\"phone\"};this.a.cb&&(a.verificationId=this.a.cb);this.a.bb&&(a.verificationCode=this.a.bb);this.a.La&&(a.temporaryProof=this.a.La);this.a.ea&&(a.phoneNumber=this.a.ea);return a};\nfunction gh(a){if(a&&\"phone\"===a.providerId&&(a.verificationId&&a.verificationCode||a.temporaryProof&&a.phoneNumber)){var b={};w([\"verificationId\",\"verificationCode\",\"temporaryProof\",\"phoneNumber\"],function(c){a[c]&&(b[c]=a[c])});return new ch(b)}return null}function dh(a){return a.a.La&&a.a.ea?{temporaryProof:a.a.La,phoneNumber:a.a.ea}:{sessionInfo:a.a.cb,code:a.a.bb}}\nfunction hh(a){try{this.a=a||firebase.auth()}catch(b){throw new t(\"argument-error\",\"Either an instance of firebase.auth.Auth must be passed as an argument to the firebase.auth.PhoneAuthProvider constructor, or the default firebase App instance must be initialized via firebase.initializeApp().\");}N(this,{providerId:\"phone\",isOAuthProvider:!1})}\nhh.prototype.eb=function(a,b){var c=this.a.a;return D(b.verify()).then(function(d){if(\"string\"!==typeof d)throw new t(\"argument-error\",\"An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.\");switch(b.type){case \"recaptcha\":var e=n(a)?a.session:null,f=n(a)?a.phoneNumber:a,g;e&&e.type==vg?g=e.Ha().then(function(h){return ih(c,{idToken:h,phoneEnrollmentInfo:{phoneNumber:f,recaptchaToken:d}})}):e&&e.type==wg?g=e.Ha().then(function(h){return jh(c,\n{mfaPendingCredential:h,mfaEnrollmentId:a.multiFactorHint&&a.multiFactorHint.uid||a.multiFactorUid,phoneSignInInfo:{recaptchaToken:d}})}):g=kh(c,{phoneNumber:f,recaptchaToken:d});return g.then(function(h){\"function\"===typeof b.reset&&b.reset();return h},function(h){\"function\"===typeof b.reset&&b.reset();throw h;});default:throw new t(\"argument-error\",'Only firebase.auth.ApplicationVerifiers with type=\"recaptcha\" are currently supported.');}})};\nfunction lh(a,b){if(!a)throw new t(\"missing-verification-id\");if(!b)throw new t(\"missing-verification-code\");return new ch({cb:a,bb:b})}N(hh,{PROVIDER_ID:\"phone\"});N(hh,{PHONE_SIGN_IN_METHOD:\"phone\"});\nfunction mh(a){if(a.temporaryProof&&a.phoneNumber)return new ch({La:a.temporaryProof,ea:a.phoneNumber});var b=a&&a.providerId;if(!b||\"password\"===b)return null;var c=a&&a.oauthAccessToken,d=a&&a.oauthTokenSecret,e=a&&a.nonce,f=a&&a.oauthIdToken,g=a&&a.pendingToken;try{switch(b){case \"google.com\":return Rg(f,c);case \"facebook.com\":return Ng(c);case \"github.com\":return Pg(c);case \"twitter.com\":return Tg(c,d);default:return c||d||f||g?g?0==b.indexOf(\"saml.\")?new Ag(b,g):new Gg(b,{pendingToken:g,idToken:a.oauthIdToken,\naccessToken:a.oauthAccessToken},b):(new Lg(b)).credential({idToken:f,accessToken:c,rawNonce:e}):null}}catch(h){return null}}function nh(a){if(!a.isOAuthProvider)throw new t(\"invalid-oauth-provider\");};function oh(a,b,c,d,e,f,g){this.c=a;this.b=b||null;this.g=c||null;this.f=d||null;this.i=f||null;this.h=g||null;this.a=e||null;if(this.g||this.a){if(this.g&&this.a)throw new t(\"invalid-auth-event\");if(this.g&&!this.f)throw new t(\"invalid-auth-event\");}else throw new t(\"invalid-auth-event\");}oh.prototype.getUid=function(){var a=[];a.push(this.c);this.b&&a.push(this.b);this.f&&a.push(this.f);this.h&&a.push(this.h);return a.join(\"-\")};oh.prototype.S=function(){return this.h};\noh.prototype.w=function(){return{type:this.c,eventId:this.b,urlResponse:this.g,sessionId:this.f,postBody:this.i,tenantId:this.h,error:this.a&&this.a.w()}};function ph(a){a=a||{};return a.type?new oh(a.type,a.eventId,a.urlResponse,a.sessionId,a.error&&ya(a.error),a.postBody,a.tenantId):null};/*\n\n Copyright 2018 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\nfunction qh(){this.b=null;this.a=[]}var rh=null;function sh(a){var b=rh;b.a.push(a);b.b||(b.b=function(c){for(var d=0;d<b.a.length;d++)b.a[d](c)},a=L(\"universalLinks.subscribe\",l),\"function\"===typeof a&&a(null,b.b))};function th(a){var b=\"unauthorized-domain\",c=void 0,d=J(a);a=d.a;d=d.f;\"chrome-extension\"==d?c=Nb(\"This chrome extension ID (chrome-extension://%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.\",a):\"http\"==d||\"https\"==d?c=Nb(\"This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.\",a):b=\"operation-not-supported-in-this-environment\";\nt.call(this,b,c)}r(th,t);function uh(a,b,c){t.call(this,a,c);a=b||{};a.Ib&&M(this,\"email\",a.Ib);a.ea&&M(this,\"phoneNumber\",a.ea);a.credential&&M(this,\"credential\",a.credential);a.Yb&&M(this,\"tenantId\",a.Yb)}r(uh,t);uh.prototype.w=function(){var a={code:this.code,message:this.message};this.email&&(a.email=this.email);this.phoneNumber&&(a.phoneNumber=this.phoneNumber);this.tenantId&&(a.tenantId=this.tenantId);var b=this.credential&&this.credential.w();b&&z(a,b);return a};uh.prototype.toJSON=function(){return this.w()};\nfunction vh(a){if(a.code){var b=a.code||\"\";0==b.indexOf(va)&&(b=b.substring(va.length));var c={credential:mh(a),Yb:a.tenantId};if(a.email)c.Ib=a.email;else if(a.phoneNumber)c.ea=a.phoneNumber;else if(!c.credential)return new t(b,a.message||void 0);return new uh(b,c,a.message)}return null};function wh(){}wh.prototype.c=null;function xh(a){return a.c||(a.c=a.b())};var yh;function zh(){}r(zh,wh);zh.prototype.a=function(){var a=Ah(this);return a?new ActiveXObject(a):new XMLHttpRequest};zh.prototype.b=function(){var a={};Ah(this)&&(a[0]=!0,a[1]=!0);return a};\nfunction Ah(a){if(!a.f&&\"undefined\"==typeof XMLHttpRequest&&\"undefined\"!=typeof ActiveXObject){for(var b=[\"MSXML2.XMLHTTP.6.0\",\"MSXML2.XMLHTTP.3.0\",\"MSXML2.XMLHTTP\",\"Microsoft.XMLHTTP\"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.f=d}catch(e){}}throw Error(\"Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed\");}return a.f}yh=new zh;function Bh(){}r(Bh,wh);Bh.prototype.a=function(){var a=new XMLHttpRequest;if(\"withCredentials\"in a)return a;if(\"undefined\"!=typeof XDomainRequest)return new Ch;throw Error(\"Unsupported browser\");};Bh.prototype.b=function(){return{}};\nfunction Ch(){this.a=new XDomainRequest;this.readyState=0;this.onreadystatechange=null;this.responseType=this.responseText=this.response=\"\";this.status=-1;this.statusText=\"\";this.a.onload=q(this.pc,this);this.a.onerror=q(this.Rb,this);this.a.onprogress=q(this.qc,this);this.a.ontimeout=q(this.uc,this)}k=Ch.prototype;k.open=function(a,b,c){if(null!=c&&!c)throw Error(\"Only async requests are supported.\");this.a.open(a,b)};\nk.send=function(a){if(a)if(\"string\"==typeof a)this.a.send(a);else throw Error(\"Only string data is supported\");else this.a.send()};k.abort=function(){this.a.abort()};k.setRequestHeader=function(){};k.getResponseHeader=function(a){return\"content-type\"==a.toLowerCase()?this.a.contentType:\"\"};k.pc=function(){this.status=200;this.response=this.responseText=this.a.responseText;Dh(this,4)};k.Rb=function(){this.status=500;this.response=this.responseText=\"\";Dh(this,4)};k.uc=function(){this.Rb()};\nk.qc=function(){this.status=200;Dh(this,1)};function Dh(a,b){a.readyState=b;if(a.onreadystatechange)a.onreadystatechange()}k.getAllResponseHeaders=function(){return\"content-type: \"+this.a.contentType};function Eh(a,b,c){this.reset(a,b,c,void 0,void 0)}Eh.prototype.a=null;var Fh=0;Eh.prototype.reset=function(a,b,c,d,e){\"number\"==typeof e||Fh++;d||ua();delete this.a};function Gh(a){this.f=a;this.b=this.c=this.a=null}function Hh(a,b){this.name=a;this.value=b}Hh.prototype.toString=function(){return this.name};var Ih=new Hh(\"SEVERE\",1E3),Jh=new Hh(\"WARNING\",900),Kh=new Hh(\"CONFIG\",700),Lh=new Hh(\"FINE\",500);function Mh(a){if(a.c)return a.c;if(a.a)return Mh(a.a);Ea(\"Root logger has no level set.\");return null}Gh.prototype.log=function(a,b,c){if(a.value>=Mh(this).value)for(na(b)&&(b=b()),a=new Eh(a,String(b),this.f),c&&(a.a=c),c=this;c;)c=c.a};var Nh={},Oh=null;\nfunction Ph(a){Oh||(Oh=new Gh(\"\"),Nh[\"\"]=Oh,Oh.c=Kh);var b;if(!(b=Nh[a])){b=new Gh(a);var c=a.lastIndexOf(\".\"),d=a.substr(c+1);c=Ph(a.substr(0,c));c.b||(c.b={});c.b[d]=b;b.a=c;Nh[a]=b}return b};function Qh(a,b){a&&a.log(Lh,b,void 0)};function Rh(a){this.f=a}r(Rh,wh);Rh.prototype.a=function(){return new Sh(this.f)};Rh.prototype.b=function(a){return function(){return a}}({});function Sh(a){H.call(this);this.o=a;this.readyState=Th;this.status=0;this.responseType=this.responseText=this.response=this.statusText=\"\";this.onreadystatechange=null;this.i=new Headers;this.b=null;this.m=\"GET\";this.g=\"\";this.a=!1;this.h=Ph(\"goog.net.FetchXmlHttp\");this.l=this.c=this.f=null}r(Sh,H);var Th=0;k=Sh.prototype;\nk.open=function(a,b){if(this.readyState!=Th)throw this.abort(),Error(\"Error reopening a connection\");this.m=a;this.g=b;this.readyState=1;Uh(this)};k.send=function(a){if(1!=this.readyState)throw this.abort(),Error(\"need to call open() first. \");this.a=!0;var b={headers:this.i,method:this.m,credentials:void 0,cache:void 0};a&&(b.body=a);this.o.fetch(new Request(this.g,b)).then(this.tc.bind(this),this.Ta.bind(this))};\nk.abort=function(){this.response=this.responseText=\"\";this.i=new Headers;this.status=0;this.c&&this.c.cancel(\"Request was aborted.\");1<=this.readyState&&this.a&&4!=this.readyState&&(this.a=!1,Vh(this,!1));this.readyState=Th};\nk.tc=function(a){this.a&&(this.f=a,this.b||(this.b=a.headers,this.readyState=2,Uh(this)),this.a&&(this.readyState=3,Uh(this),this.a&&(\"arraybuffer\"===this.responseType?a.arrayBuffer().then(this.rc.bind(this),this.Ta.bind(this)):\"undefined\"!==typeof l.ReadableStream&&\"body\"in a?(this.response=this.responseText=\"\",this.c=a.body.getReader(),this.l=new TextDecoder,Wh(this)):a.text().then(this.sc.bind(this),this.Ta.bind(this)))))};function Wh(a){a.c.read().then(a.oc.bind(a)).catch(a.Ta.bind(a))}\nk.oc=function(a){if(this.a){var b=this.l.decode(a.value?a.value:new Uint8Array(0),{stream:!a.done});b&&(this.response=this.responseText+=b);a.done?Vh(this,!0):Uh(this);3==this.readyState&&Wh(this)}};k.sc=function(a){this.a&&(this.response=this.responseText=a,Vh(this,!0))};k.rc=function(a){this.a&&(this.response=a,Vh(this,!0))};k.Ta=function(a){var b=this.h;b&&b.log(Jh,\"Failed to fetch url \"+this.g,a instanceof Error?a:Error(a));this.a&&Vh(this,!0)};\nfunction Vh(a,b){b&&a.f&&(a.status=a.f.status,a.statusText=a.f.statusText);a.readyState=4;a.f=null;a.c=null;a.l=null;Uh(a)}k.setRequestHeader=function(a,b){this.i.append(a,b)};k.getResponseHeader=function(a){return this.b?this.b.get(a.toLowerCase())||\"\":((a=this.h)&&a.log(Jh,\"Attempting to get response header but no headers have been received for url: \"+this.g,void 0),\"\")};\nk.getAllResponseHeaders=function(){if(!this.b){var a=this.h;a&&a.log(Jh,\"Attempting to get all response headers but no headers have been received for url: \"+this.g,void 0);return\"\"}a=[];for(var b=this.b.entries(),c=b.next();!c.done;)c=c.value,a.push(c[0]+\": \"+c[1]),c=b.next();return a.join(\"\\r\\n\")};function Uh(a){a.onreadystatechange&&a.onreadystatechange.call(a)};function Xh(a){H.call(this);this.headers=new Ed;this.O=a||null;this.c=!1;this.A=this.a=null;this.h=this.P=this.l=\"\";this.f=this.N=this.i=this.G=!1;this.g=0;this.o=null;this.m=Yh;this.u=this.R=!1}r(Xh,H);var Yh=\"\";Xh.prototype.b=Ph(\"goog.net.XhrIo\");var Zh=/^https?$/i,$h=[\"POST\",\"PUT\"];\nfunction ai(a,b,c,d,e){if(a.a)throw Error(\"[goog.net.XhrIo] Object is active with another request=\"+a.l+\"; newUri=\"+b);c=c?c.toUpperCase():\"GET\";a.l=b;a.h=\"\";a.P=c;a.G=!1;a.c=!0;a.a=a.O?a.O.a():yh.a();a.A=a.O?xh(a.O):xh(yh);a.a.onreadystatechange=q(a.Ub,a);try{Qh(a.b,bi(a,\"Opening Xhr\")),a.N=!0,a.a.open(c,String(b),!0),a.N=!1}catch(g){Qh(a.b,bi(a,\"Error opening Xhr: \"+g.message));ci(a,g);return}b=d||\"\";var f=new Ed(a.headers);e&&Dd(e,function(g,h){f.set(h,g)});e=Ra(f.Y());d=l.FormData&&b instanceof\nl.FormData;!Ta($h,c)||e||d||f.set(\"Content-Type\",\"application/x-www-form-urlencoded;charset=utf-8\");f.forEach(function(g,h){this.a.setRequestHeader(h,g)},a);a.m&&(a.a.responseType=a.m);\"withCredentials\"in a.a&&a.a.withCredentials!==a.R&&(a.a.withCredentials=a.R);try{di(a),0<a.g&&(a.u=ei(a.a),Qh(a.b,bi(a,\"Will abort after \"+a.g+\"ms if incomplete, xhr2 \"+a.u)),a.u?(a.a.timeout=a.g,a.a.ontimeout=q(a.Ma,a)):a.o=zd(a.Ma,a.g,a)),Qh(a.b,bi(a,\"Sending request\")),a.i=!0,a.a.send(b),a.i=!1}catch(g){Qh(a.b,\nbi(a,\"Send error: \"+g.message)),ci(a,g)}}function ei(a){return Tb&&cc(9)&&\"number\"===typeof a.timeout&&void 0!==a.ontimeout}function Sa(a){return\"content-type\"==a.toLowerCase()}k=Xh.prototype;k.Ma=function(){\"undefined\"!=typeof ha&&this.a&&(this.h=\"Timed out after \"+this.g+\"ms, aborting\",Qh(this.b,bi(this,this.h)),this.dispatchEvent(\"timeout\"),this.abort(8))};function ci(a,b){a.c=!1;a.a&&(a.f=!0,a.a.abort(),a.f=!1);a.h=b;fi(a);gi(a)}\nfunction fi(a){a.G||(a.G=!0,a.dispatchEvent(\"complete\"),a.dispatchEvent(\"error\"))}k.abort=function(){this.a&&this.c&&(Qh(this.b,bi(this,\"Aborting\")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent(\"complete\"),this.dispatchEvent(\"abort\"),gi(this))};k.Da=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),gi(this,!0));Xh.$a.Da.call(this)};k.Ub=function(){this.xa||(this.N||this.i||this.f?hi(this):this.Ic())};k.Ic=function(){hi(this)};\nfunction hi(a){if(a.c&&\"undefined\"!=typeof ha)if(a.A[1]&&4==ii(a)&&2==ji(a))Qh(a.b,bi(a,\"Local request error detected and ignored\"));else if(a.i&&4==ii(a))zd(a.Ub,0,a);else if(a.dispatchEvent(\"readystatechange\"),4==ii(a)){Qh(a.b,bi(a,\"Request complete\"));a.c=!1;try{var b=ji(a);a:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var c=!0;break a;default:c=!1}var d;if(!(d=c)){var e;if(e=0===b){var f=String(a.l).match(Hd)[1]||null;if(!f&&l.self&&l.self.location){var g=l.self.location.protocol;\nf=g.substr(0,g.length-1)}e=!Zh.test(f?f.toLowerCase():\"\")}d=e}if(d)a.dispatchEvent(\"complete\"),a.dispatchEvent(\"success\");else{try{var h=2<ii(a)?a.a.statusText:\"\"}catch(m){Qh(a.b,\"Can not get status: \"+m.message),h=\"\"}a.h=h+\" [\"+ji(a)+\"]\";fi(a)}}finally{gi(a)}}}function gi(a,b){if(a.a){di(a);var c=a.a,d=a.A[0]?ka:null;a.a=null;a.A=null;b||a.dispatchEvent(\"ready\");try{c.onreadystatechange=d}catch(e){(a=a.b)&&a.log(Ih,\"Problem encountered resetting onreadystatechange: \"+e.message,void 0)}}}\nfunction di(a){a.a&&a.u&&(a.a.ontimeout=null);a.o&&(l.clearTimeout(a.o),a.o=null)}function ii(a){return a.a?a.a.readyState:0}function ji(a){try{return 2<ii(a)?a.a.status:-1}catch(b){return-1}}function ki(a){try{return a.a?a.a.responseText:\"\"}catch(b){return Qh(a.b,\"Can not get responseText: \"+b.message),\"\"}}\nk.getResponse=function(){try{if(!this.a)return null;if(\"response\"in this.a)return this.a.response;switch(this.m){case Yh:case \"text\":return this.a.responseText;case \"arraybuffer\":if(\"mozResponseArrayBuffer\"in this.a)return this.a.mozResponseArrayBuffer}var a=this.b;a&&a.log(Ih,\"Response type \"+this.m+\" is not supported on this browser\",void 0);return null}catch(b){return Qh(this.b,\"Can not get response: \"+b.message),null}};function bi(a,b){return b+\" [\"+a.P+\" \"+a.l+\" \"+ji(a)+\"]\"};/*\n Portions of this code are from MochiKit, received by\n The Closure Authors under the MIT license. All other code is Copyright\n 2005-2009 The Closure Authors. All Rights Reserved.\n*/\nfunction li(a){var b=mi;this.g=[];this.u=b;this.o=a||null;this.f=this.a=!1;this.c=void 0;this.m=this.A=this.i=!1;this.h=0;this.b=null;this.l=0}li.prototype.cancel=function(a){if(this.a)this.c instanceof li&&this.c.cancel();else{if(this.b){var b=this.b;delete this.b;a?b.cancel(a):(b.l--,0>=b.l&&b.cancel())}this.u?this.u.call(this.o,this):this.m=!0;this.a||(a=new ni(this),oi(this),pi(this,!1,a))}};li.prototype.v=function(a,b){this.i=!1;pi(this,a,b)};function pi(a,b,c){a.a=!0;a.c=c;a.f=!b;qi(a)}\nfunction oi(a){if(a.a){if(!a.m)throw new ri(a);a.m=!1}}function si(a,b){ti(a,null,b,void 0)}function ti(a,b,c,d){a.g.push([b,c,d]);a.a&&qi(a)}li.prototype.then=function(a,b,c){var d,e,f=new C(function(g,h){d=g;e=h});ti(this,d,function(g){g instanceof ni?f.cancel():e(g)});return f.then(a,b,c)};li.prototype.$goog_Thenable=!0;function ui(a){return Qa(a.g,function(b){return na(b[1])})}\nfunction qi(a){if(a.h&&a.a&&ui(a)){var b=a.h,c=vi[b];c&&(l.clearTimeout(c.a),delete vi[b]);a.h=0}a.b&&(a.b.l--,delete a.b);b=a.c;for(var d=c=!1;a.g.length&&!a.i;){var e=a.g.shift(),f=e[0],g=e[1];e=e[2];if(f=a.f?g:f)try{var h=f.call(e||a.o,b);void 0!==h&&(a.f=a.f&&(h==b||h instanceof Error),a.c=b=h);if(Ca(b)||\"function\"===typeof l.Promise&&b instanceof l.Promise)d=!0,a.i=!0}catch(m){b=m,a.f=!0,ui(a)||(c=!0)}}a.c=b;d&&(h=q(a.v,a,!0),d=q(a.v,a,!1),b instanceof li?(ti(b,h,d),b.A=!0):b.then(h,d));c&&(b=\nnew wi(b),vi[b.a]=b,a.h=b.a)}function ri(){u.call(this)}r(ri,u);ri.prototype.message=\"Deferred has already fired\";ri.prototype.name=\"AlreadyCalledError\";function ni(){u.call(this)}r(ni,u);ni.prototype.message=\"Deferred was canceled\";ni.prototype.name=\"CanceledError\";function wi(a){this.a=l.setTimeout(q(this.c,this),0);this.b=a}wi.prototype.c=function(){delete vi[this.a];throw this.b;};var vi={};function xi(a){var b={},c=b.document||document,d=wb(a).toString(),e=jc(document,\"SCRIPT\"),f={Vb:e,Ma:void 0},g=new li(f),h=null,m=null!=b.timeout?b.timeout:5E3;0<m&&(h=window.setTimeout(function(){yi(e,!0);var p=new zi(Ai,\"Timeout reached for loading script \"+d);oi(g);pi(g,!1,p)},m),f.Ma=h);e.onload=e.onreadystatechange=function(){e.readyState&&\"loaded\"!=e.readyState&&\"complete\"!=e.readyState||(yi(e,b.wd||!1,h),oi(g),pi(g,!0,null))};e.onerror=function(){yi(e,!0,h);var p=new zi(Bi,\"Error while loading script \"+\nd);oi(g);pi(g,!1,p)};f=b.attributes||{};z(f,{type:\"text/javascript\",charset:\"UTF-8\"});gc(e,f);Mb(e,a);Ci(c).appendChild(e);return g}function Ci(a){var b;return(b=(a||document).getElementsByTagName(\"HEAD\"))&&0!=b.length?b[0]:a.documentElement}function mi(){if(this&&this.Vb){var a=this.Vb;a&&\"SCRIPT\"==a.tagName&&yi(a,!0,this.Ma)}}\nfunction yi(a,b,c){null!=c&&l.clearTimeout(c);a.onload=ka;a.onerror=ka;a.onreadystatechange=ka;b&&window.setTimeout(function(){a&&a.parentNode&&a.parentNode.removeChild(a)},0)}var Bi=0,Ai=1;function zi(a,b){var c=\"Jsloader error (code #\"+a+\")\";b&&(c+=\": \"+b);u.call(this,c);this.code=a}r(zi,u);function Di(a){this.f=a}r(Di,wh);Di.prototype.a=function(){return new this.f};Di.prototype.b=function(){return{}};\nfunction Ei(a,b,c){this.c=a;a=b||{};this.l=a.secureTokenEndpoint||\"https://securetoken.googleapis.com/v1/token\";this.v=a.secureTokenTimeout||Fi;this.g=lb(a.secureTokenHeaders||Gi);this.h=a.firebaseEndpoint||\"https://www.googleapis.com/identitytoolkit/v3/relyingparty/\";this.i=a.identityPlatformEndpoint||\"https://identitytoolkit.googleapis.com/v2/\";this.m=a.firebaseTimeout||Hi;this.a=lb(a.firebaseHeaders||Ii);c&&(this.a[\"X-Client-Version\"]=c,this.g[\"X-Client-Version\"]=c);c=\"Node\"==Fe();c=l.XMLHttpRequest||\nc&&firebase.INTERNAL.node&&firebase.INTERNAL.node.XMLHttpRequest;if(!c&&!Ee())throw new t(\"internal-error\",\"The XMLHttpRequest compatibility library was not found.\");this.f=void 0;Ee()?this.f=new Rh(self):Ge()?this.f=new Di(c):this.f=new Bh;this.b=null}var Ji,zg=\"idToken\",Fi=new Ue(3E4,6E4),Gi={\"Content-Type\":\"application/x-www-form-urlencoded\"},Hi=new Ue(3E4,6E4),Ii={\"Content-Type\":\"application/json\"};function Ki(a,b){b?a.a[\"X-Firebase-Locale\"]=b:delete a.a[\"X-Firebase-Locale\"]}\nfunction Li(a,b){b&&(a.l=Mi(\"https://securetoken.googleapis.com/v1/token\",b),a.h=Mi(\"https://www.googleapis.com/identitytoolkit/v3/relyingparty/\",b),a.i=Mi(\"https://identitytoolkit.googleapis.com/v2/\",b))}function Mi(a,b){a=J(a);b=J(b.url);a.c=a.a+a.c;Kd(a,b.f);a.a=b.a;Ld(a,b.g);return a.toString()}function Ni(a,b){b?(a.a[\"X-Client-Version\"]=b,a.g[\"X-Client-Version\"]=b):(delete a.a[\"X-Client-Version\"],delete a.g[\"X-Client-Version\"])}Ei.prototype.S=function(){return this.b};\nfunction Oi(a,b,c,d,e,f,g){pe()||Ee()?a=q(a.u,a):(Ji||(Ji=new C(function(h,m){Pi(h,m)})),a=q(a.o,a));a(b,c,d,e,f,g)}\nEi.prototype.u=function(a,b,c,d,e,f){if(Ee()&&(\"undefined\"===typeof l.fetch||\"undefined\"===typeof l.Headers||\"undefined\"===typeof l.Request))throw new t(\"operation-not-supported-in-this-environment\",\"fetch, Headers and Request native APIs or equivalent Polyfills must be available to support HTTP requests from a Worker environment.\");var g=new Xh(this.f);if(f){g.g=Math.max(0,f);var h=setTimeout(function(){g.dispatchEvent(\"timeout\")},f)}md(g,\"complete\",function(){h&&clearTimeout(h);var m=null;try{m=\nJSON.parse(ki(this))||null}catch(p){m=null}b&&b(m)});sd(g,\"ready\",function(){h&&clearTimeout(h);Tc(this)});sd(g,\"timeout\",function(){h&&clearTimeout(h);Tc(this);b&&b(null)});ai(g,a,c,d,e)};var Qi=new ob(pb,\"https://apis.google.com/js/client.js?onload=%{onload}\"),Ri=\"__fcb\"+Math.floor(1E6*Math.random()).toString();\nfunction Pi(a,b){if(((window.gapi||{}).client||{}).request)a();else{l[Ri]=function(){((window.gapi||{}).client||{}).request?a():b(Error(\"CORS_UNSUPPORTED\"))};var c=xb(Qi,{onload:Ri});si(xi(c),function(){b(Error(\"CORS_UNSUPPORTED\"))})}}\nEi.prototype.o=function(a,b,c,d,e){var f=this;Ji.then(function(){window.gapi.client.setApiKey(f.c);var g=window.gapi.auth.getToken();window.gapi.auth.setToken(null);window.gapi.client.request({path:a,method:c,body:d,headers:e,authType:\"none\",callback:function(h){window.gapi.auth.setToken(g);b&&b(h)}})}).s(function(g){b&&b({error:{message:g&&g.message||\"CORS_UNSUPPORTED\"}})})};\nfunction Si(a,b){return new C(function(c,d){\"refresh_token\"==b.grant_type&&b.refresh_token||\"authorization_code\"==b.grant_type&&b.code?Oi(a,a.l+\"?key=\"+encodeURIComponent(a.c),function(e){e?e.error?d(Ti(e)):e.access_token&&e.refresh_token?c(e):d(new t(\"internal-error\")):d(new t(\"network-request-failed\"))},\"POST\",ae(b).toString(),a.g,a.v.get()):d(new t(\"internal-error\"))})}\nfunction Ui(a,b,c,d,e,f,g){var h=J(b+c);I(h,\"key\",a.c);g&&I(h,\"cb\",ua().toString());var m=\"GET\"==d;if(m)for(var p in e)e.hasOwnProperty(p)&&I(h,p,e[p]);return new C(function(v,B){Oi(a,h.toString(),function(A){A?A.error?B(Ti(A,f||{})):v(A):B(new t(\"network-request-failed\"))},d,m?void 0:fe(Qe(e)),a.a,a.m.get())})}function Vi(a){a=a.email;if(\"string\"!==typeof a||!ye.test(a))throw new t(\"invalid-email\");}function Wi(a){\"email\"in a&&Vi(a)}\nfunction Xi(a,b){return O(a,Yi,{identifier:b,continueUri:Ne()?me():\"http://localhost\"}).then(function(c){return c.signinMethods||[]})}function Zi(a){return O(a,$i,{}).then(function(b){return b.authorizedDomains||[]})}function P(a){if(!a[zg]){if(a.mfaPendingCredential)throw new t(\"multi-factor-auth-required\",null,lb(a));throw new t(\"internal-error\");}}\nfunction aj(a){if(a.phoneNumber||a.temporaryProof){if(!a.phoneNumber||!a.temporaryProof)throw new t(\"internal-error\");}else{if(!a.sessionInfo)throw new t(\"missing-verification-id\");if(!a.code)throw new t(\"missing-verification-code\");}}Ei.prototype.yb=function(){return O(this,bj,{})};Ei.prototype.Ab=function(a,b){return O(this,cj,{idToken:a,email:b})};Ei.prototype.Bb=function(a,b){return O(this,Zg,{idToken:a,password:b})};var dj={displayName:\"DISPLAY_NAME\",photoUrl:\"PHOTO_URL\"};k=Ei.prototype;\nk.Cb=function(a,b){var c={idToken:a},d=[];jb(dj,function(e,f){var g=b[f];null===g?d.push(e):f in b&&(c[f]=g)});d.length&&(c.deleteAttribute=d);return O(this,cj,c)};k.ub=function(a,b){a={requestType:\"PASSWORD_RESET\",email:a};z(a,b);return O(this,ej,a)};k.vb=function(a,b){a={requestType:\"EMAIL_SIGNIN\",email:a};z(a,b);return O(this,fj,a)};k.tb=function(a,b){a={requestType:\"VERIFY_EMAIL\",idToken:a};z(a,b);return O(this,gj,a)};\nk.Db=function(a,b,c){a={requestType:\"VERIFY_AND_CHANGE_EMAIL\",idToken:a,newEmail:b};z(a,c);return O(this,hj,a)};function kh(a,b){return O(a,ij,b)}k.eb=function(a){return O(this,jj,a)};function ih(a,b){return O(a,kj,b).then(function(c){return c.phoneSessionInfo.sessionInfo})}\nfunction lj(a){if(!a.phoneVerificationInfo)throw new t(\"internal-error\");if(!a.phoneVerificationInfo.sessionInfo)throw new t(\"missing-verification-id\");if(!a.phoneVerificationInfo.code)throw new t(\"missing-verification-code\");}function jh(a,b){return O(a,mj,b).then(function(c){return c.phoneResponseInfo.sessionInfo})}function nj(a,b,c){return O(a,oj,{idToken:b,deleteProvider:c})}function pj(a){if(!a.requestUri||!a.sessionId&&!a.postBody&&!a.pendingToken)throw new t(\"internal-error\");}\nfunction qj(a,b){b.oauthIdToken&&b.providerId&&0==b.providerId.indexOf(\"oidc.\")&&!b.pendingToken&&(a.sessionId?b.nonce=a.sessionId:a.postBody&&(a=new Pd(a.postBody),ee(a,\"nonce\")&&(b.nonce=a.get(\"nonce\"))));return b}\nfunction rj(a){var b=null;a.needConfirmation?(a.code=\"account-exists-with-different-credential\",b=vh(a)):\"FEDERATED_USER_ID_ALREADY_LINKED\"==a.errorMessage?(a.code=\"credential-already-in-use\",b=vh(a)):\"EMAIL_EXISTS\"==a.errorMessage?(a.code=\"email-already-in-use\",b=vh(a)):a.errorMessage&&(b=sj(a.errorMessage));if(b)throw b;P(a)}function Bg(a,b){b.returnIdpCredential=!0;return O(a,tj,b)}function Dg(a,b){b.returnIdpCredential=!0;return O(a,uj,b)}\nfunction Eg(a,b){b.returnIdpCredential=!0;b.autoCreate=!1;return O(a,vj,b)}function wj(a){if(!a.oobCode)throw new t(\"invalid-action-code\");}k.mb=function(a,b){return O(this,xj,{oobCode:a,newPassword:b})};k.Qa=function(a){return O(this,yj,{oobCode:a})};k.ib=function(a){return O(this,zj,{oobCode:a})};\nvar zj={endpoint:\"setAccountInfo\",B:wj,Z:\"email\",C:!0},yj={endpoint:\"resetPassword\",B:wj,F:function(a){var b=a.requestType;if(!b||!a.email&&\"EMAIL_SIGNIN\"!=b&&\"VERIFY_AND_CHANGE_EMAIL\"!=b)throw new t(\"internal-error\");},C:!0},Aj={endpoint:\"signupNewUser\",B:function(a){Vi(a);if(!a.password)throw new t(\"weak-password\");},F:P,U:!0,C:!0},Yi={endpoint:\"createAuthUri\",C:!0},Bj={endpoint:\"deleteAccount\",M:[\"idToken\"]},oj={endpoint:\"setAccountInfo\",M:[\"idToken\",\"deleteProvider\"],B:function(a){if(\"array\"!=\nla(a.deleteProvider))throw new t(\"internal-error\");}},Wg={endpoint:\"emailLinkSignin\",M:[\"email\",\"oobCode\"],B:Vi,F:P,U:!0,C:!0},Yg={endpoint:\"emailLinkSignin\",M:[\"idToken\",\"email\",\"oobCode\"],B:Vi,F:P,U:!0},Cj={endpoint:\"accounts/mfaEnrollment:finalize\",M:[\"idToken\",\"phoneVerificationInfo\"],B:lj,F:P,C:!0,Na:!0},Dj={endpoint:\"accounts/mfaSignIn:finalize\",M:[\"mfaPendingCredential\",\"phoneVerificationInfo\"],B:lj,F:P,C:!0,Na:!0},Ej={endpoint:\"getAccountInfo\"},fj={endpoint:\"getOobConfirmationCode\",M:[\"requestType\"],\nB:function(a){if(\"EMAIL_SIGNIN\"!=a.requestType)throw new t(\"internal-error\");Vi(a)},Z:\"email\",C:!0},gj={endpoint:\"getOobConfirmationCode\",M:[\"idToken\",\"requestType\"],B:function(a){if(\"VERIFY_EMAIL\"!=a.requestType)throw new t(\"internal-error\");},Z:\"email\",C:!0},hj={endpoint:\"getOobConfirmationCode\",M:[\"idToken\",\"newEmail\",\"requestType\"],B:function(a){if(\"VERIFY_AND_CHANGE_EMAIL\"!=a.requestType)throw new t(\"internal-error\");},Z:\"email\",C:!0},ej={endpoint:\"getOobConfirmationCode\",M:[\"requestType\"],B:function(a){if(\"PASSWORD_RESET\"!=\na.requestType)throw new t(\"internal-error\");Vi(a)},Z:\"email\",C:!0},$i={kb:!0,endpoint:\"getProjectConfig\",Tb:\"GET\"},Fj={kb:!0,endpoint:\"getRecaptchaParam\",Tb:\"GET\",F:function(a){if(!a.recaptchaSiteKey)throw new t(\"internal-error\");}},xj={endpoint:\"resetPassword\",B:wj,Z:\"email\",C:!0},ij={endpoint:\"sendVerificationCode\",M:[\"phoneNumber\",\"recaptchaToken\"],Z:\"sessionInfo\",C:!0},cj={endpoint:\"setAccountInfo\",M:[\"idToken\"],B:Wi,U:!0},Zg={endpoint:\"setAccountInfo\",M:[\"idToken\"],B:function(a){Wi(a);if(!a.password)throw new t(\"weak-password\");\n},F:P,U:!0},bj={endpoint:\"signupNewUser\",F:P,U:!0,C:!0},kj={endpoint:\"accounts/mfaEnrollment:start\",M:[\"idToken\",\"phoneEnrollmentInfo\"],B:function(a){if(!a.phoneEnrollmentInfo)throw new t(\"internal-error\");if(!a.phoneEnrollmentInfo.phoneNumber)throw new t(\"missing-phone-number\");if(!a.phoneEnrollmentInfo.recaptchaToken)throw new t(\"missing-app-credential\");},F:function(a){if(!a.phoneSessionInfo||!a.phoneSessionInfo.sessionInfo)throw new t(\"internal-error\");},C:!0,Na:!0},mj={endpoint:\"accounts/mfaSignIn:start\",\nM:[\"mfaPendingCredential\",\"mfaEnrollmentId\",\"phoneSignInInfo\"],B:function(a){if(!a.phoneSignInInfo||!a.phoneSignInInfo.recaptchaToken)throw new t(\"missing-app-credential\");},F:function(a){if(!a.phoneResponseInfo||!a.phoneResponseInfo.sessionInfo)throw new t(\"internal-error\");},C:!0,Na:!0},tj={endpoint:\"verifyAssertion\",B:pj,Xa:qj,F:rj,U:!0,C:!0},vj={endpoint:\"verifyAssertion\",B:pj,Xa:qj,F:function(a){if(a.errorMessage&&\"USER_NOT_FOUND\"==a.errorMessage)throw new t(\"user-not-found\");if(a.errorMessage)throw sj(a.errorMessage);\nP(a)},U:!0,C:!0},uj={endpoint:\"verifyAssertion\",B:function(a){pj(a);if(!a.idToken)throw new t(\"internal-error\");},Xa:qj,F:rj,U:!0},Gj={endpoint:\"verifyCustomToken\",B:function(a){if(!a.token)throw new t(\"invalid-custom-token\");},F:P,U:!0,C:!0},Xg={endpoint:\"verifyPassword\",B:function(a){Vi(a);if(!a.password)throw new t(\"wrong-password\");},F:P,U:!0,C:!0},jj={endpoint:\"verifyPhoneNumber\",B:aj,F:P,C:!0},eh={endpoint:\"verifyPhoneNumber\",B:function(a){if(!a.idToken)throw new t(\"internal-error\");aj(a)},\nF:function(a){if(a.temporaryProof)throw a.code=\"credential-already-in-use\",vh(a);P(a)}},fh={Gb:{USER_NOT_FOUND:\"user-not-found\"},endpoint:\"verifyPhoneNumber\",B:aj,F:P,C:!0},Hj={endpoint:\"accounts/mfaEnrollment:withdraw\",M:[\"idToken\",\"mfaEnrollmentId\"],F:function(a){if(!!a[zg]^!!a.refreshToken)throw new t(\"internal-error\");},C:!0,Na:!0};\nfunction O(a,b,c){if(!hf(c,b.M))return E(new t(\"internal-error\"));var d=!!b.Na,e=b.Tb||\"POST\",f;return D(c).then(b.B).then(function(){b.U&&(c.returnSecureToken=!0);b.C&&a.b&&\"undefined\"===typeof c.tenantId&&(c.tenantId=a.b);return d?Ui(a,a.i,b.endpoint,e,c,b.Gb,b.kb||!1):Ui(a,a.h,b.endpoint,e,c,b.Gb,b.kb||!1)}).then(function(g){f=g;return b.Xa?b.Xa(c,f):f}).then(b.F).then(function(){if(!b.Z)return f;if(!(b.Z in f))throw new t(\"internal-error\");return f[b.Z]})}\nfunction sj(a){return Ti({error:{errors:[{message:a}],code:400,message:a}})}\nfunction Ti(a,b){var c=(a.error&&a.error.errors&&a.error.errors[0]||{}).reason||\"\";var d={keyInvalid:\"invalid-api-key\",ipRefererBlocked:\"app-not-authorized\"};if(c=d[c]?new t(d[c]):null)return c;c=a.error&&a.error.message||\"\";d={INVALID_CUSTOM_TOKEN:\"invalid-custom-token\",CREDENTIAL_MISMATCH:\"custom-token-mismatch\",MISSING_CUSTOM_TOKEN:\"internal-error\",INVALID_IDENTIFIER:\"invalid-email\",MISSING_CONTINUE_URI:\"internal-error\",INVALID_EMAIL:\"invalid-email\",INVALID_PASSWORD:\"wrong-password\",USER_DISABLED:\"user-disabled\",\nMISSING_PASSWORD:\"internal-error\",EMAIL_EXISTS:\"email-already-in-use\",PASSWORD_LOGIN_DISABLED:\"operation-not-allowed\",INVALID_IDP_RESPONSE:\"invalid-credential\",INVALID_PENDING_TOKEN:\"invalid-credential\",FEDERATED_USER_ID_ALREADY_LINKED:\"credential-already-in-use\",MISSING_OR_INVALID_NONCE:\"missing-or-invalid-nonce\",INVALID_MESSAGE_PAYLOAD:\"invalid-message-payload\",INVALID_RECIPIENT_EMAIL:\"invalid-recipient-email\",INVALID_SENDER:\"invalid-sender\",EMAIL_NOT_FOUND:\"user-not-found\",RESET_PASSWORD_EXCEED_LIMIT:\"too-many-requests\",\nEXPIRED_OOB_CODE:\"expired-action-code\",INVALID_OOB_CODE:\"invalid-action-code\",MISSING_OOB_CODE:\"internal-error\",INVALID_PROVIDER_ID:\"invalid-provider-id\",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:\"requires-recent-login\",INVALID_ID_TOKEN:\"invalid-user-token\",TOKEN_EXPIRED:\"user-token-expired\",USER_NOT_FOUND:\"user-token-expired\",CORS_UNSUPPORTED:\"cors-unsupported\",DYNAMIC_LINK_NOT_ACTIVATED:\"dynamic-link-not-activated\",INVALID_APP_ID:\"invalid-app-id\",TOO_MANY_ATTEMPTS_TRY_LATER:\"too-many-requests\",WEAK_PASSWORD:\"weak-password\",\nOPERATION_NOT_ALLOWED:\"operation-not-allowed\",USER_CANCELLED:\"user-cancelled\",CAPTCHA_CHECK_FAILED:\"captcha-check-failed\",INVALID_APP_CREDENTIAL:\"invalid-app-credential\",INVALID_CODE:\"invalid-verification-code\",INVALID_PHONE_NUMBER:\"invalid-phone-number\",INVALID_SESSION_INFO:\"invalid-verification-id\",INVALID_TEMPORARY_PROOF:\"invalid-credential\",MISSING_APP_CREDENTIAL:\"missing-app-credential\",MISSING_CODE:\"missing-verification-code\",MISSING_PHONE_NUMBER:\"missing-phone-number\",MISSING_SESSION_INFO:\"missing-verification-id\",\nQUOTA_EXCEEDED:\"quota-exceeded\",SESSION_EXPIRED:\"code-expired\",REJECTED_CREDENTIAL:\"rejected-credential\",INVALID_CONTINUE_URI:\"invalid-continue-uri\",MISSING_ANDROID_PACKAGE_NAME:\"missing-android-pkg-name\",MISSING_IOS_BUNDLE_ID:\"missing-ios-bundle-id\",UNAUTHORIZED_DOMAIN:\"unauthorized-continue-uri\",INVALID_DYNAMIC_LINK_DOMAIN:\"invalid-dynamic-link-domain\",INVALID_OAUTH_CLIENT_ID:\"invalid-oauth-client-id\",INVALID_CERT_HASH:\"invalid-cert-hash\",UNSUPPORTED_TENANT_OPERATION:\"unsupported-tenant-operation\",\nINVALID_TENANT_ID:\"invalid-tenant-id\",TENANT_ID_MISMATCH:\"tenant-id-mismatch\",ADMIN_ONLY_OPERATION:\"admin-restricted-operation\",INVALID_MFA_PENDING_CREDENTIAL:\"invalid-multi-factor-session\",MFA_ENROLLMENT_NOT_FOUND:\"multi-factor-info-not-found\",MISSING_MFA_PENDING_CREDENTIAL:\"missing-multi-factor-session\",MISSING_MFA_ENROLLMENT_ID:\"missing-multi-factor-info\",EMAIL_CHANGE_NEEDS_VERIFICATION:\"email-change-needs-verification\",SECOND_FACTOR_EXISTS:\"second-factor-already-in-use\",SECOND_FACTOR_LIMIT_EXCEEDED:\"maximum-second-factor-count-exceeded\",\nUNSUPPORTED_FIRST_FACTOR:\"unsupported-first-factor\",UNVERIFIED_EMAIL:\"unverified-email\"};z(d,b||{});b=(b=c.match(/^[^\\s]+\\s*:\\s*([\\s\\S]*)$/))&&1<b.length?b[1]:void 0;for(var e in d)if(0===c.indexOf(e))return new t(d[e],b);!b&&a&&(b=Pe(a));return new t(\"internal-error\",b)};function Ij(a){this.b=a;this.a=null;this.qb=Jj(this)}\nfunction Jj(a){return Kj().then(function(){return new C(function(b,c){L(\"gapi.iframes.getContext\")().open({where:document.body,url:a.b,messageHandlersFilter:L(\"gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER\"),attributes:{style:{position:\"absolute\",top:\"-100px\",width:\"1px\",height:\"1px\"}},dontclear:!0},function(d){function e(){clearTimeout(f);b()}a.a=d;a.a.restyle({setHideOnLeave:!1});var f=setTimeout(function(){c(Error(\"Network Error\"))},Lj.get());d.ping(e).then(e,function(){c(Error(\"Network Error\"))})})})})}\nfunction Mj(a,b){return a.qb.then(function(){return new C(function(c){a.a.send(b.type,b,c,L(\"gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER\"))})})}function Nj(a,b){a.qb.then(function(){a.a.register(\"authEvent\",b,L(\"gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER\"))})}var Oj=new ob(pb,\"https://apis.google.com/js/api.js?onload=%{onload}\"),Pj=new Ue(3E4,6E4),Lj=new Ue(5E3,15E3),Qj=null;\nfunction Kj(){return Qj?Qj:Qj=(new C(function(a,b){function c(){Te();L(\"gapi.load\")(\"gapi.iframes\",{callback:a,ontimeout:function(){Te();b(Error(\"Network Error\"))},timeout:Pj.get()})}if(L(\"gapi.iframes.Iframe\"))a();else if(L(\"gapi.load\"))c();else{var d=\"__iframefcb\"+Math.floor(1E6*Math.random()).toString();l[d]=function(){L(\"gapi.load\")?c():b(Error(\"Network Error\"))};d=xb(Oj,{onload:d});D(xi(d)).s(function(){b(Error(\"Network Error\"))})}})).s(function(a){Qj=null;throw a;})};function Rj(a,b,c,d){this.l=a;this.h=b;this.i=c;this.g=d;this.f=null;this.g?(a=J(this.g.url),a=Yd(a.f,a.a,a.g,\"/emulator/auth/iframe\")):a=Yd(\"https\",this.l,null,\"/__/auth/iframe\");this.a=a;I(this.a,\"apiKey\",this.h);I(this.a,\"appName\",this.i);this.b=null;this.c=[]}Rj.prototype.toString=function(){this.f?I(this.a,\"v\",this.f):de(this.a.b,\"v\");this.b?I(this.a,\"eid\",this.b):de(this.a.b,\"eid\");this.c.length?I(this.a,\"fw\",this.c.join(\",\")):de(this.a.b,\"fw\");return this.a.toString()};\nfunction Sj(a,b,c,d,e,f){this.u=a;this.o=b;this.c=c;this.v=d;this.m=f;this.i=this.g=this.l=null;this.a=e;this.h=this.f=null}Sj.prototype.xb=function(a){this.h=a;return this};\nSj.prototype.toString=function(){if(this.m){var a=J(this.m.url);a=Yd(a.f,a.a,a.g,\"/emulator/auth/handler\")}else a=Yd(\"https\",this.u,null,\"/__/auth/handler\");I(a,\"apiKey\",this.o);I(a,\"appName\",this.c);I(a,\"authType\",this.v);if(this.a.isOAuthProvider){var b=this.a;try{var c=firebase.app(this.c).auth().ka()}catch(h){c=null}b.nb=c;I(a,\"providerId\",this.a.providerId);c=this.a;b=Qe(c.Hb);for(var d in b)b[d]=b[d].toString();d=c.Pc;b=lb(b);for(var e=0;e<d.length;e++){var f=d[e];f in b&&delete b[f]}c.ob&&\nc.nb&&!b[c.ob]&&(b[c.ob]=c.nb);kb(b)||I(a,\"customParameters\",Pe(b))}\"function\"===typeof this.a.Pb&&(c=this.a.Pb(),c.length&&I(a,\"scopes\",c.join(\",\")));this.l?I(a,\"redirectUrl\",this.l):de(a.b,\"redirectUrl\");this.g?I(a,\"eventId\",this.g):de(a.b,\"eventId\");this.i?I(a,\"v\",this.i):de(a.b,\"v\");if(this.b)for(var g in this.b)this.b.hasOwnProperty(g)&&!Xd(a,g)&&I(a,g,this.b[g]);this.h?I(a,\"tid\",this.h):de(a.b,\"tid\");this.f?I(a,\"eid\",this.f):de(a.b,\"eid\");g=Tj(this.c);g.length&&I(a,\"fw\",g.join(\",\"));return a.toString()};\nfunction Tj(a){try{return firebase.app(a).auth().Ga()}catch(b){return[]}}function Uj(a,b,c,d,e,f){this.o=a;this.g=b;this.b=c;this.f=f;this.c=d||null;this.i=e||null;this.l=this.u=this.A=null;this.h=[];this.v=this.a=null}\nfunction Vj(a){var b=me();return Zi(a).then(function(c){a:{var d=J(b),e=d.f;d=d.a;for(var f=0;f<c.length;f++){var g=c[f];var h=d;var m=e;0==g.indexOf(\"chrome-extension://\")?h=J(g).a==h&&\"chrome-extension\"==m:\"http\"!=m&&\"https\"!=m?h=!1:xe.test(g)?h=h==g:(g=g.split(\".\").join(\"\\\\.\"),h=(new RegExp(\"^(.+\\\\.\"+g+\"|\"+g+\")$\",\"i\")).test(h));if(h){c=!0;break a}}c=!1}if(!c)throw new th(me());})}\nfunction Wj(a){if(a.v)return a.v;a.v=ze().then(function(){if(!a.u){var b=a.c,c=a.i,d=Tj(a.b),e=new Rj(a.o,a.g,a.b,a.f);e.f=b;e.b=c;e.c=Xa(d||[]);a.u=e.toString()}a.m=new Ij(a.u);Xj(a)});return a.v}k=Uj.prototype;k.Nb=function(a,b,c){var d=new t(\"popup-closed-by-user\"),e=new t(\"web-storage-unsupported\"),f=this,g=!1;return this.la().then(function(){Yj(f).then(function(h){h||(a&&te(a),b(e),g=!0)})}).s(function(){}).then(function(){if(!g)return we(a)}).then(function(){if(!g)return Ad(c).then(function(){b(d)})})};\nk.Wb=function(){var a=K();return!Oe(a)&&!Se(a)};k.Sb=function(){return!1};\nk.Lb=function(a,b,c,d,e,f,g,h){if(!a)return E(new t(\"popup-blocked\"));if(g&&!Oe())return this.la().s(function(p){te(a);e(p)}),d(),D();this.a||(this.a=Vj(Zj(this)));var m=this;return this.a.then(function(){var p=m.la().s(function(v){te(a);e(v);throw v;});d();return p}).then(function(){nh(c);if(!g){var p=ak(m.o,m.g,m.b,b,c,null,f,m.c,void 0,m.i,h,m.f);ne(p,a)}}).s(function(p){\"auth/network-request-failed\"==p.code&&(m.a=null);throw p;})};\nfunction Zj(a){a.l||(a.A=a.c?Je(a.c,Tj(a.b)):null,a.l=new Ei(a.g,Aa(a.i),a.A),a.f&&Li(a.l,a.f));return a.l}k.Mb=function(a,b,c,d){this.a||(this.a=Vj(Zj(this)));var e=this;return this.a.then(function(){nh(b);var f=ak(e.o,e.g,e.b,a,b,me(),c,e.c,void 0,e.i,d,e.f);ne(f)}).s(function(f){\"auth/network-request-failed\"==f.code&&(e.a=null);throw f;})};k.la=function(){var a=this;return Wj(this).then(function(){return a.m.qb}).s(function(){a.a=null;throw new t(\"network-request-failed\");})};k.Zb=function(){return!0};\nfunction ak(a,b,c,d,e,f,g,h,m,p,v,B){a=new Sj(a,b,c,d,e,B);a.l=f;a.g=g;a.i=h;a.b=lb(m||null);a.f=p;return a.xb(v).toString()}function Xj(a){if(!a.m)throw Error(\"IfcHandler must be initialized!\");Nj(a.m,function(b){var c={};if(b&&b.authEvent){var d=!1;b=ph(b.authEvent);for(c=0;c<a.h.length;c++)d=a.h[c](b)||d;c={};c.status=d?\"ACK\":\"ERROR\";return D(c)}c.status=\"ERROR\";return D(c)})}\nfunction Yj(a){var b={type:\"webStorageSupport\"};return Wj(a).then(function(){return Mj(a.m,b)}).then(function(c){if(c&&c.length&&\"undefined\"!==typeof c[0].webStorageSupport)return c[0].webStorageSupport;throw Error();})}k.Ea=function(a){this.h.push(a)};k.Ra=function(a){Va(this.h,function(b){return b==a})};function bk(a){this.a=a||firebase.INTERNAL.reactNative&&firebase.INTERNAL.reactNative.AsyncStorage;if(!this.a)throw new t(\"internal-error\",\"The React Native compatibility library was not found.\");this.type=\"asyncStorage\"}k=bk.prototype;k.get=function(a){return D(this.a.getItem(a)).then(function(b){return b&&Re(b)})};k.set=function(a,b){return D(this.a.setItem(a,Pe(b)))};k.T=function(a){return D(this.a.removeItem(a))};k.ca=function(){};k.ia=function(){};function ck(a){this.b=a;this.a={};this.f=q(this.c,this)}var dk=[];function ek(){var a=Ee()?self:null;w(dk,function(c){c.b==a&&(b=c)});if(!b){var b=new ck(a);dk.push(b)}return b}\nck.prototype.c=function(a){var b=a.data.eventType,c=a.data.eventId,d=this.a[b];if(d&&0<d.length){a.ports[0].postMessage({status:\"ack\",eventId:c,eventType:b,response:null});var e=[];w(d,function(f){e.push(D().then(function(){return f(a.origin,a.data.data)}))});Fc(e).then(function(f){var g=[];w(f,function(h){g.push({fulfilled:h.Ob,value:h.value,reason:h.reason?h.reason.message:void 0})});w(g,function(h){for(var m in h)\"undefined\"===typeof h[m]&&delete h[m]});a.ports[0].postMessage({status:\"done\",eventId:c,\neventType:b,response:g})})}};function fk(a,b,c){kb(a.a)&&a.b.addEventListener(\"message\",a.f);\"undefined\"===typeof a.a[b]&&(a.a[b]=[]);a.a[b].push(c)};function gk(a){this.a=a}gk.prototype.postMessage=function(a,b){this.a.postMessage(a,b)};function hk(a){this.c=a;this.b=!1;this.a=[]}\nfunction ik(a,b,c,d){var e,f=c||{},g,h,m,p=null;if(a.b)return E(Error(\"connection_unavailable\"));var v=d?800:50,B=\"undefined\"!==typeof MessageChannel?new MessageChannel:null;return(new C(function(A,Q){B?(e=Math.floor(Math.random()*Math.pow(10,20)).toString(),B.port1.start(),h=setTimeout(function(){Q(Error(\"unsupported_event\"))},v),g=function(xa){xa.data.eventId===e&&(\"ack\"===xa.data.status?(clearTimeout(h),m=setTimeout(function(){Q(Error(\"timeout\"))},3E3)):\"done\"===xa.data.status?(clearTimeout(m),\n\"undefined\"!==typeof xa.data.response?A(xa.data.response):Q(Error(\"unknown_error\"))):(clearTimeout(h),clearTimeout(m),Q(Error(\"invalid_response\"))))},p={messageChannel:B,onMessage:g},a.a.push(p),B.port1.addEventListener(\"message\",g),a.c.postMessage({eventType:b,eventId:e,data:f},[B.port2])):Q(Error(\"connection_unavailable\"))})).then(function(A){jk(a,p);return A}).s(function(A){jk(a,p);throw A;})}\nfunction jk(a,b){if(b){var c=b.messageChannel,d=b.onMessage;c&&(c.port1.removeEventListener(\"message\",d),c.port1.close());Va(a.a,function(e){return e==b})}}hk.prototype.close=function(){for(;0<this.a.length;)jk(this,this.a[0]);this.b=!0};function kk(){if(!lk())throw new t(\"web-storage-unsupported\");this.c={};this.a=[];this.b=0;this.m=l.indexedDB;this.type=\"indexedDB\";this.g=this.l=this.f=this.i=null;this.o=!1;this.h=null;var a=this;Ee()&&self?(this.l=ek(),fk(this.l,\"keyChanged\",function(b,c){return mk(a).then(function(d){0<d.length&&w(a.a,function(e){e(d)});return{keyProcessed:Ta(d,c.key)}})}),fk(this.l,\"ping\",function(){return D([\"keyChanged\"])})):af().then(function(b){if(a.h=b)a.g=new hk(new gk(b)),ik(a.g,\"ping\",null,!0).then(function(c){c[0].fulfilled&&\nTa(c[0].value,\"keyChanged\")&&(a.o=!0)}).s(function(){})})}var nk;function ok(a){return new C(function(b,c){var d=a.m.deleteDatabase(\"firebaseLocalStorageDb\");d.onsuccess=function(){b()};d.onerror=function(e){c(Error(e.target.error))}})}\nfunction pk(a){return new C(function(b,c){var d=a.m.open(\"firebaseLocalStorageDb\",1);d.onerror=function(e){try{e.preventDefault()}catch(f){}c(Error(e.target.error))};d.onupgradeneeded=function(e){e=e.target.result;try{e.createObjectStore(\"firebaseLocalStorage\",{keyPath:\"fbase_key\"})}catch(f){c(f)}};d.onsuccess=function(e){e=e.target.result;e.objectStoreNames.contains(\"firebaseLocalStorage\")?b(e):ok(a).then(function(){return pk(a)}).then(function(f){b(f)}).s(function(f){c(f)})}})}\nfunction qk(a){a.v||(a.v=pk(a));return a.v}function lk(){try{return!!l.indexedDB}catch(a){return!1}}function rk(a){return a.objectStore(\"firebaseLocalStorage\")}function sk(a,b){return a.transaction([\"firebaseLocalStorage\"],b?\"readwrite\":\"readonly\")}function tk(a){return new C(function(b,c){a.onsuccess=function(d){d&&d.target?b(d.target.result):b()};a.onerror=function(d){c(d.target.error)}})}k=kk.prototype;\nk.set=function(a,b){var c=!1,d,e=this;return qk(this).then(function(f){d=f;f=rk(sk(d,!0));return tk(f.get(a))}).then(function(f){var g=rk(sk(d,!0));if(f)return f.value=b,tk(g.put(f));e.b++;c=!0;f={};f.fbase_key=a;f.value=b;return tk(g.add(f))}).then(function(){e.c[a]=b;return uk(e,a)}).na(function(){c&&e.b--})};function uk(a,b){return a.g&&a.h&&$e()===a.h?ik(a.g,\"keyChanged\",{key:b},a.o).then(function(){}).s(function(){}):D()}\nk.get=function(a){return qk(this).then(function(b){return tk(rk(sk(b,!1)).get(a))}).then(function(b){return b&&b.value})};k.T=function(a){var b=!1,c=this;return qk(this).then(function(d){b=!0;c.b++;return tk(rk(sk(d,!0))[\"delete\"](a))}).then(function(){delete c.c[a];return uk(c,a)}).na(function(){b&&c.b--})};\nfunction mk(a){return qk(a).then(function(b){var c=rk(sk(b,!1));return c.getAll?tk(c.getAll()):new C(function(d,e){var f=[],g=c.openCursor();g.onsuccess=function(h){(h=h.target.result)?(f.push(h.value),h[\"continue\"]()):d(f)};g.onerror=function(h){e(h.target.error)}})}).then(function(b){var c={},d=[];if(0==a.b){for(d=0;d<b.length;d++)c[b[d].fbase_key]=b[d].value;d=oe(a.c,c);a.c=c}return d})}k.ca=function(a){0==this.a.length&&vk(this);this.a.push(a)};\nk.ia=function(a){Va(this.a,function(b){return b==a});0==this.a.length&&wk(this)};function vk(a){function b(){a.f=setTimeout(function(){a.i=mk(a).then(function(c){0<c.length&&w(a.a,function(d){d(c)})}).then(function(){b()}).s(function(c){\"STOP_EVENT\"!=c.message&&b()})},800)}wk(a);b()}function wk(a){a.i&&a.i.cancel(\"STOP_EVENT\");a.f&&(clearTimeout(a.f),a.f=null)};function xk(a){var b=this,c=null;this.a=[];this.type=\"indexedDB\";this.c=a;this.b=D().then(function(){if(lk()){var d=Le(),e=\"__sak\"+d;nk||(nk=new kk);c=nk;return c.set(e,d).then(function(){return c.get(e)}).then(function(f){if(f!==d)throw Error(\"indexedDB not supported!\");return c.T(e)}).then(function(){return c}).s(function(){return b.c})}return b.c}).then(function(d){b.type=d.type;d.ca(function(e){w(b.a,function(f){f(e)})});return d})}k=xk.prototype;k.get=function(a){return this.b.then(function(b){return b.get(a)})};\nk.set=function(a,b){return this.b.then(function(c){return c.set(a,b)})};k.T=function(a){return this.b.then(function(b){return b.T(a)})};k.ca=function(a){this.a.push(a)};k.ia=function(a){Va(this.a,function(b){return b==a})};function yk(){this.a={};this.type=\"inMemory\"}k=yk.prototype;k.get=function(a){return D(this.a[a])};k.set=function(a,b){this.a[a]=b;return D()};k.T=function(a){delete this.a[a];return D()};k.ca=function(){};k.ia=function(){};function zk(){if(!Ak()){if(\"Node\"==Fe())throw new t(\"internal-error\",\"The LocalStorage compatibility library was not found.\");throw new t(\"web-storage-unsupported\");}this.a=Bk()||firebase.INTERNAL.node.localStorage;this.type=\"localStorage\"}function Bk(){try{var a=l.localStorage,b=Le();a&&(a.setItem(b,\"1\"),a.removeItem(b));return a}catch(c){return null}}\nfunction Ak(){var a=\"Node\"==Fe();a=Bk()||a&&firebase.INTERNAL.node&&firebase.INTERNAL.node.localStorage;if(!a)return!1;try{return a.setItem(\"__sak\",\"1\"),a.removeItem(\"__sak\"),!0}catch(b){return!1}}k=zk.prototype;k.get=function(a){var b=this;return D().then(function(){var c=b.a.getItem(a);return Re(c)})};k.set=function(a,b){var c=this;return D().then(function(){var d=Pe(b);null===d?c.T(a):c.a.setItem(a,d)})};k.T=function(a){var b=this;return D().then(function(){b.a.removeItem(a)})};\nk.ca=function(a){l.window&&jd(l.window,\"storage\",a)};k.ia=function(a){l.window&&G(l.window,\"storage\",a)};function Ck(){this.type=\"nullStorage\"}k=Ck.prototype;k.get=function(){return D(null)};k.set=function(){return D()};k.T=function(){return D()};k.ca=function(){};k.ia=function(){};function Dk(){if(!Ek()){if(\"Node\"==Fe())throw new t(\"internal-error\",\"The SessionStorage compatibility library was not found.\");throw new t(\"web-storage-unsupported\");}this.a=Fk()||firebase.INTERNAL.node.sessionStorage;this.type=\"sessionStorage\"}function Fk(){try{var a=l.sessionStorage,b=Le();a&&(a.setItem(b,\"1\"),a.removeItem(b));return a}catch(c){return null}}\nfunction Ek(){var a=\"Node\"==Fe();a=Fk()||a&&firebase.INTERNAL.node&&firebase.INTERNAL.node.sessionStorage;if(!a)return!1;try{return a.setItem(\"__sak\",\"1\"),a.removeItem(\"__sak\"),!0}catch(b){return!1}}k=Dk.prototype;k.get=function(a){var b=this;return D().then(function(){var c=b.a.getItem(a);return Re(c)})};k.set=function(a,b){var c=this;return D().then(function(){var d=Pe(b);null===d?c.T(a):c.a.setItem(a,d)})};k.T=function(a){var b=this;return D().then(function(){b.a.removeItem(a)})};k.ca=function(){};\nk.ia=function(){};function Gk(){var a={};a.Browser=Hk;a.Node=Ik;a.ReactNative=Jk;a.Worker=Kk;this.a=a[Fe()]}var Lk,Hk={D:zk,ab:Dk},Ik={D:zk,ab:Dk},Jk={D:bk,ab:Ck},Kk={D:zk,ab:Ck};var Mk={qd:\"local\",NONE:\"none\",sd:\"session\"};function Nk(a){var b=new t(\"invalid-persistence-type\"),c=new t(\"unsupported-persistence-type\");a:{for(d in Mk)if(Mk[d]==a){var d=!0;break a}d=!1}if(!d||\"string\"!==typeof a)throw b;switch(Fe()){case \"ReactNative\":if(\"session\"===a)throw c;break;case \"Node\":if(\"none\"!==a)throw c;break;case \"Worker\":if(\"session\"===a||!lk()&&\"none\"!==a)throw c;break;default:if(!Ke()&&\"none\"!==a)throw c;}}\nfunction Ok(){var a=!Se(K())&&De()?!0:!1,b=Oe(),c=Ke();this.v=a;this.h=b;this.l=c;this.a={};Lk||(Lk=new Gk);a=Lk;try{this.g=!le()&&Ze()||!l.indexedDB?new a.a.D:new xk(Ee()?new yk:new a.a.D)}catch(d){this.g=new yk,this.h=!0}try{this.i=new a.a.ab}catch(d){this.i=new yk}this.m=new yk;this.f=q(this.Xb,this);this.b={}}var Pk;function Qk(){Pk||(Pk=new Ok);return Pk}function Rk(a,b){switch(b){case \"session\":return a.i;case \"none\":return a.m;default:return a.g}}\nfunction Sk(a,b){return\"firebase:\"+a.name+(b?\":\"+b:\"\")}function Tk(a,b,c){var d=Sk(b,c),e=Rk(a,b.D);return a.get(b,c).then(function(f){var g=null;try{g=Re(l.localStorage.getItem(d))}catch(h){}if(g&&!f)return l.localStorage.removeItem(d),a.set(b,g,c);g&&f&&\"localStorage\"!=e.type&&l.localStorage.removeItem(d)})}k=Ok.prototype;k.get=function(a,b){return Rk(this,a.D).get(Sk(a,b))};function Uk(a,b,c){c=Sk(b,c);\"local\"==b.D&&(a.b[c]=null);return Rk(a,b.D).T(c)}\nk.set=function(a,b,c){var d=Sk(a,c),e=this,f=Rk(this,a.D);return f.set(d,b).then(function(){return f.get(d)}).then(function(g){\"local\"==a.D&&(e.b[d]=g)})};k.addListener=function(a,b,c){a=Sk(a,b);this.l&&(this.b[a]=l.localStorage.getItem(a));kb(this.a)&&(Rk(this,\"local\").ca(this.f),this.h||(le()||!Ze())&&l.indexedDB||!this.l||Vk(this));this.a[a]||(this.a[a]=[]);this.a[a].push(c)};\nk.removeListener=function(a,b,c){a=Sk(a,b);this.a[a]&&(Va(this.a[a],function(d){return d==c}),0==this.a[a].length&&delete this.a[a]);kb(this.a)&&(Rk(this,\"local\").ia(this.f),Wk(this))};function Vk(a){Wk(a);a.c=setInterval(function(){for(var b in a.a){var c=l.localStorage.getItem(b),d=a.b[b];c!=d&&(a.b[b]=c,c=new Yc({type:\"storage\",key:b,target:window,oldValue:d,newValue:c,a:!0}),a.Xb(c))}},1E3)}function Wk(a){a.c&&(clearInterval(a.c),a.c=null)}\nk.Xb=function(a){if(a&&a.g){var b=a.a.key;if(null==b)for(var c in this.a){var d=this.b[c];\"undefined\"===typeof d&&(d=null);var e=l.localStorage.getItem(c);e!==d&&(this.b[c]=e,this.lb(c))}else if(0==b.indexOf(\"firebase:\")&&this.a[b]){\"undefined\"!==typeof a.a.a?Rk(this,\"local\").ia(this.f):Wk(this);if(this.v)if(c=l.localStorage.getItem(b),d=a.a.newValue,d!==c)null!==d?l.localStorage.setItem(b,d):l.localStorage.removeItem(b);else if(this.b[b]===d&&\"undefined\"===typeof a.a.a)return;var f=this;c=function(){if(\"undefined\"!==\ntypeof a.a.a||f.b[b]!==l.localStorage.getItem(b))f.b[b]=l.localStorage.getItem(b),f.lb(b)};Tb&&dc&&10==dc&&l.localStorage.getItem(b)!==a.a.newValue&&a.a.newValue!==a.a.oldValue?setTimeout(c,10):c()}}else w(a,q(this.lb,this))};k.lb=function(a){this.a[a]&&w(this.a[a],function(b){b()})};function Xk(a){this.a=a;this.b=Qk()}var Yk={name:\"authEvent\",D:\"local\"};function Zk(a){return a.b.get(Yk,a.a).then(function(b){return ph(b)})};function $k(){this.a=Qk()};function al(){this.b=-1};function bl(a,b){this.b=cl;this.f=l.Uint8Array?new Uint8Array(this.b):Array(this.b);this.g=this.c=0;this.a=[];this.i=a;this.h=b;this.l=l.Int32Array?new Int32Array(64):Array(64);void 0===dl&&(l.Int32Array?dl=new Int32Array(el):dl=el);this.reset()}var dl;r(bl,al);for(var cl=64,fl=cl-1,gl=[],hl=0;hl<fl;hl++)gl[hl]=0;var il=Wa(128,gl);bl.prototype.reset=function(){this.g=this.c=0;this.a=l.Int32Array?new Int32Array(this.h):Xa(this.h)};\nfunction jl(a){for(var b=a.f,c=a.l,d=0,e=0;e<b.length;)c[d++]=b[e]<<24|b[e+1]<<16|b[e+2]<<8|b[e+3],e=4*d;for(b=16;64>b;b++){e=c[b-15]|0;d=c[b-2]|0;var f=(c[b-16]|0)+((e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3)|0,g=(c[b-7]|0)+((d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10)|0;c[b]=f+g|0}d=a.a[0]|0;e=a.a[1]|0;var h=a.a[2]|0,m=a.a[3]|0,p=a.a[4]|0,v=a.a[5]|0,B=a.a[6]|0;f=a.a[7]|0;for(b=0;64>b;b++){var A=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&e^d&h^e&h)|0;g=p&v^~p&B;f=f+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<\n7))|0;g=g+(dl[b]|0)|0;g=f+(g+(c[b]|0)|0)|0;f=B;B=v;v=p;p=m+g|0;m=h;h=e;e=d;d=g+A|0}a.a[0]=a.a[0]+d|0;a.a[1]=a.a[1]+e|0;a.a[2]=a.a[2]+h|0;a.a[3]=a.a[3]+m|0;a.a[4]=a.a[4]+p|0;a.a[5]=a.a[5]+v|0;a.a[6]=a.a[6]+B|0;a.a[7]=a.a[7]+f|0}\nfunction kl(a,b,c){void 0===c&&(c=b.length);var d=0,e=a.c;if(\"string\"===typeof b)for(;d<c;)a.f[e++]=b.charCodeAt(d++),e==a.b&&(jl(a),e=0);else if(ma(b))for(;d<c;){var f=b[d++];if(!(\"number\"==typeof f&&0<=f&&255>=f&&f==(f|0)))throw Error(\"message must be a byte array\");a.f[e++]=f;e==a.b&&(jl(a),e=0)}else throw Error(\"message must be string or array\");a.c=e;a.g+=c}\nvar el=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,\n4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function ll(){bl.call(this,8,ml)}r(ll,bl);var ml=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function nl(a,b,c,d,e,f){this.m=a;this.i=b;this.l=c;this.v=d||null;this.u=e||null;this.o=f;this.h=b+\":\"+c;this.A=new $k;this.g=new Xk(this.h);this.f=null;this.b=[];this.a=this.c=null}function ol(a){return new t(\"invalid-cordova-configuration\",a)}k=nl.prototype;\nk.la=function(){return this.Ia?this.Ia:this.Ia=Ae().then(function(){if(\"function\"!==typeof L(\"universalLinks.subscribe\",l))throw ol(\"cordova-universal-links-plugin-fix is not installed\");if(\"undefined\"===typeof L(\"BuildInfo.packageName\",l))throw ol(\"cordova-plugin-buildinfo is not installed\");if(\"function\"!==typeof L(\"cordova.plugins.browsertab.openUrl\",l))throw ol(\"cordova-plugin-browsertab is not installed\");if(\"function\"!==typeof L(\"cordova.InAppBrowser.open\",l))throw ol(\"cordova-plugin-inappbrowser is not installed\");\n},function(){throw new t(\"cordova-not-ready\");})};function pl(){for(var a=20,b=[];0<a;)b.push(\"1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\".charAt(Math.floor(62*Math.random()))),a--;return b.join(\"\")}function ql(a){var b=new ll;kl(b,a);a=[];var c=8*b.g;56>b.c?kl(b,il,56-b.c):kl(b,il,b.b-(b.c-56));for(var d=63;56<=d;d--)b.f[d]=c&255,c/=256;jl(b);for(d=c=0;d<b.i;d++)for(var e=24;0<=e;e-=8)a[c++]=b.a[d]>>e&255;return Zf(a)}\nk.Nb=function(a,b){b(new t(\"operation-not-supported-in-this-environment\"));return D()};k.Lb=function(){return E(new t(\"operation-not-supported-in-this-environment\"))};k.Zb=function(){return!1};k.Wb=function(){return!0};k.Sb=function(){return!0};\nk.Mb=function(a,b,c,d){if(this.c)return E(new t(\"redirect-operation-pending\"));var e=this,f=l.document,g=null,h=null,m=null,p=null;return this.c=D().then(function(){nh(b);return rl(e)}).then(function(){return sl(e,a,b,c,d)}).then(function(){return(new C(function(v,B){h=function(){var A=L(\"cordova.plugins.browsertab.close\",l);v();\"function\"===typeof A&&A();e.a&&\"function\"===typeof e.a.close&&(e.a.close(),e.a=null);return!1};e.Ea(h);m=function(){g||(g=Ad(2E3).then(function(){B(new t(\"redirect-cancelled-by-user\"))}))};\np=function(){Ve()&&m()};f.addEventListener(\"resume\",m,!1);K().toLowerCase().match(/android/)||f.addEventListener(\"visibilitychange\",p,!1)})).s(function(v){return tl(e).then(function(){throw v;})})}).na(function(){m&&f.removeEventListener(\"resume\",m,!1);p&&f.removeEventListener(\"visibilitychange\",p,!1);g&&g.cancel();h&&e.Ra(h);e.c=null})};\nfunction sl(a,b,c,d,e){var f=pl(),g=new oh(b,d,null,f,new t(\"no-auth-event\"),null,e),h=L(\"BuildInfo.packageName\",l);if(\"string\"!==typeof h)throw new t(\"invalid-cordova-configuration\");var m=L(\"BuildInfo.displayName\",l),p={};if(K().toLowerCase().match(/iphone|ipad|ipod/))p.ibi=h;else if(K().toLowerCase().match(/android/))p.apn=h;else return E(new t(\"operation-not-supported-in-this-environment\"));m&&(p.appDisplayName=m);f=ql(f);p.sessionId=f;var v=ak(a.m,a.i,a.l,b,c,null,d,a.v,p,a.u,e,a.o);return a.la().then(function(){var B=\na.h;return a.A.a.set(Yk,g.w(),B)}).then(function(){var B=L(\"cordova.plugins.browsertab.isAvailable\",l);if(\"function\"!==typeof B)throw new t(\"invalid-cordova-configuration\");var A=null;B(function(Q){if(Q){A=L(\"cordova.plugins.browsertab.openUrl\",l);if(\"function\"!==typeof A)throw new t(\"invalid-cordova-configuration\");A(v)}else{A=L(\"cordova.InAppBrowser.open\",l);if(\"function\"!==typeof A)throw new t(\"invalid-cordova-configuration\");Q=K();a.a=A(v,Q.match(/(iPad|iPhone|iPod).*OS 7_\\d/i)||Q.match(/(iPad|iPhone|iPod).*OS 8_\\d/i)?\n\"_blank\":\"_system\",\"location=yes\")}})})}function ul(a,b){for(var c=0;c<a.b.length;c++)try{a.b[c](b)}catch(d){}}function rl(a){a.f||(a.f=a.la().then(function(){return new C(function(b){function c(d){b(d);a.Ra(c);return!1}a.Ea(c);vl(a)})}));return a.f}function tl(a){var b=null;return Zk(a.g).then(function(c){b=c;c=a.g;return Uk(c.b,Yk,c.a)}).then(function(){return b})}\nfunction vl(a){function b(g){d=!0;e&&e.cancel();tl(a).then(function(h){var m=c;if(h&&g&&g.url){var p=null;m=tg(g.url);-1!=m.indexOf(\"/__/auth/callback\")&&(p=J(m),p=Re(Xd(p,\"firebaseError\")||null),p=(p=\"object\"===typeof p?ya(p):null)?new oh(h.c,h.b,null,null,p,null,h.S()):new oh(h.c,h.b,m,h.f,null,null,h.S()));m=p||c}ul(a,m)})}var c=new oh(\"unknown\",null,null,null,new t(\"no-auth-event\")),d=!1,e=Ad(500).then(function(){return tl(a).then(function(){d||ul(a,c)})}),f=l.handleOpenURL;l.handleOpenURL=function(g){0==\ng.toLowerCase().indexOf(L(\"BuildInfo.packageName\",l).toLowerCase()+\"://\")&&b({url:g});if(\"function\"===typeof f)try{f(g)}catch(h){console.error(h)}};rh||(rh=new qh);sh(b)}k.Ea=function(a){this.b.push(a);rl(this).s(function(b){\"auth/invalid-cordova-configuration\"===b.code&&(b=new oh(\"unknown\",null,null,null,new t(\"no-auth-event\")),a(b))})};k.Ra=function(a){Va(this.b,function(b){return b==a})};function wl(a){this.a=a;this.b=Qk()}var xl={name:\"pendingRedirect\",D:\"session\"};function yl(a){return a.b.set(xl,\"pending\",a.a)}function zl(a){return Uk(a.b,xl,a.a)}function Al(a){return a.b.get(xl,a.a).then(function(b){return\"pending\"==b})};function Bl(a,b,c,d){this.i={};this.u=0;this.O=a;this.m=b;this.v=c;this.G=d;this.h=[];this.f=!1;this.l=q(this.o,this);this.b=new Cl;this.A=new Dl;this.g=new wl(El(this.m,this.v));this.c={};this.c.unknown=this.b;this.c.signInViaRedirect=this.b;this.c.linkViaRedirect=this.b;this.c.reauthViaRedirect=this.b;this.c.signInViaPopup=this.A;this.c.linkViaPopup=this.A;this.c.reauthViaPopup=this.A;this.a=Fl(this.O,this.m,this.v,Ba,this.G)}\nfunction Fl(a,b,c,d,e){var f=firebase.SDK_VERSION||null;return Be()?new nl(a,b,c,f,d,e):new Uj(a,b,c,f,d,e)}Bl.prototype.reset=function(){this.f=!1;this.a.Ra(this.l);this.a=Fl(this.O,this.m,this.v,null,this.G);this.i={}};function Gl(a){a.f||(a.f=!0,a.a.Ea(a.l));var b=a.a;return a.a.la().s(function(c){a.a==b&&a.reset();throw c;})}\nfunction Hl(a){a.a.Wb()&&Gl(a).s(function(b){var c=new oh(\"unknown\",null,null,null,new t(\"operation-not-supported-in-this-environment\"));Il(b)&&a.o(c)});a.a.Sb()||Jl(a.b)}function Kl(a,b){Ta(a.h,b)||a.h.push(b);a.f||Al(a.g).then(function(c){c?zl(a.g).then(function(){Gl(a).s(function(d){var e=new oh(\"unknown\",null,null,null,new t(\"operation-not-supported-in-this-environment\"));Il(d)&&a.o(e)})}):Hl(a)}).s(function(){Hl(a)})}function Ll(a,b){Va(a.h,function(c){return c==b})}\nBl.prototype.o=function(a){if(!a)throw new t(\"invalid-auth-event\");6E5<=ua()-this.u&&(this.i={},this.u=0);if(a&&a.getUid()&&this.i.hasOwnProperty(a.getUid()))return!1;for(var b=!1,c=0;c<this.h.length;c++){var d=this.h[c];if(d.Eb(a.c,a.b)){if(b=this.c[a.c])b.h(a,d),a&&(a.f||a.b)&&(this.i[a.getUid()]=!0,this.u=ua());b=!0;break}}Jl(this.b);return b};var Ml=new Ue(2E3,1E4),Nl=new Ue(3E4,6E4);Bl.prototype.qa=function(){return this.b.qa()};\nfunction Ol(a,b,c,d,e,f,g){return a.a.Lb(b,c,d,function(){a.f||(a.f=!0,a.a.Ea(a.l))},function(){a.reset()},e,f,g)}function Il(a){return a&&\"auth/cordova-not-ready\"==a.code?!0:!1}\nfunction Pl(a,b,c,d,e){var f;return yl(a.g).then(function(){return a.a.Mb(b,c,d,e).s(function(g){if(Il(g))throw new t(\"operation-not-supported-in-this-environment\");f=g;return zl(a.g).then(function(){throw f;})}).then(function(){return a.a.Zb()?new C(function(){}):zl(a.g).then(function(){return a.qa()}).then(function(){}).s(function(){})})})}function Ql(a,b,c,d,e){return a.a.Nb(d,function(f){b.ma(c,null,f,e)},Ml.get())}var Rl={};function El(a,b,c){a=a+\":\"+b;c&&(a=a+\":\"+c.url);return a}\nfunction Sl(a,b,c,d){var e=El(b,c,d);Rl[e]||(Rl[e]=new Bl(a,b,c,d));return Rl[e]}function Cl(){this.b=null;this.f=[];this.c=[];this.a=null;this.i=this.g=!1}Cl.prototype.reset=function(){this.b=null;this.a&&(this.a.cancel(),this.a=null)};\nCl.prototype.h=function(a,b){if(a){this.reset();this.g=!0;var c=a.c,d=a.b,e=a.a&&\"auth/web-storage-unsupported\"==a.a.code,f=a.a&&\"auth/operation-not-supported-in-this-environment\"==a.a.code;this.i=!(!e&&!f);\"unknown\"!=c||e||f?a.a?(Tl(this,!0,null,a.a),D()):b.Fa(c,d)?Ul(this,a,b):E(new t(\"invalid-auth-event\")):(Tl(this,!1,null,null),D())}else E(new t(\"invalid-auth-event\"))};function Jl(a){a.g||(a.g=!0,Tl(a,!1,null,null))}function Vl(a){a.g&&!a.i&&Tl(a,!1,null,null)}\nfunction Ul(a,b,c){c=c.Fa(b.c,b.b);var d=b.g,e=b.f,f=b.i,g=b.S(),h=!!b.c.match(/Redirect$/);c(d,e,g,f).then(function(m){Tl(a,h,m,null)}).s(function(m){Tl(a,h,null,m)})}function Wl(a,b){a.b=function(){return E(b)};if(a.c.length)for(var c=0;c<a.c.length;c++)a.c[c](b)}function Xl(a,b){a.b=function(){return D(b)};if(a.f.length)for(var c=0;c<a.f.length;c++)a.f[c](b)}function Tl(a,b,c,d){b?d?Wl(a,d):Xl(a,c):Xl(a,{user:null});a.f=[];a.c=[]}\nCl.prototype.qa=function(){var a=this;return new C(function(b,c){a.b?a.b().then(b,c):(a.f.push(b),a.c.push(c),Yl(a))})};function Yl(a){var b=new t(\"timeout\");a.a&&a.a.cancel();a.a=Ad(Nl.get()).then(function(){a.b||(a.g=!0,Tl(a,!0,null,b))})}function Dl(){}Dl.prototype.h=function(a,b){if(a){var c=a.c,d=a.b;a.a?(b.ma(a.c,null,a.a,a.b),D()):b.Fa(c,d)?Zl(a,b):E(new t(\"invalid-auth-event\"))}else E(new t(\"invalid-auth-event\"))};\nfunction Zl(a,b){var c=a.b,d=a.c;b.Fa(d,c)(a.g,a.f,a.S(),a.i).then(function(e){b.ma(d,e,null,c)}).s(function(e){b.ma(d,null,e,c)})};function $l(){this.hb=!1;Object.defineProperty(this,\"appVerificationDisabled\",{get:function(){return this.hb},set:function(a){this.hb=a},enumerable:!1})};function am(a,b){this.a=b;M(this,\"verificationId\",a)}am.prototype.confirm=function(a){a=lh(this.verificationId,a);return this.a(a)};function bm(a,b,c,d){return(new hh(a)).eb(b,c).then(function(e){return new am(e,d)})};function cm(a){var b=eg(a);if(!(b&&b.exp&&b.auth_time&&b.iat))throw new t(\"internal-error\",\"An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation.\");N(this,{token:a,expirationTime:Ye(1E3*b.exp),authTime:Ye(1E3*b.auth_time),issuedAtTime:Ye(1E3*b.iat),signInProvider:b.firebase&&b.firebase.sign_in_provider?b.firebase.sign_in_provider:null,signInSecondFactor:b.firebase&&b.firebase.sign_in_second_factor?b.firebase.sign_in_second_factor:null,claims:b})}\n;function dm(a,b,c){var d=b&&b[em];if(!d)throw new t(\"argument-error\",\"Internal assert: Invalid MultiFactorResolver\");this.a=a;this.f=lb(b);this.g=c;this.c=new ug(null,d);this.b=[];var e=this;w(b[fm]||[],function(f){(f=pf(f))&&e.b.push(f)});M(this,\"auth\",this.a);M(this,\"session\",this.c);M(this,\"hints\",this.b)}var fm=\"mfaInfo\",em=\"mfaPendingCredential\";dm.prototype.Qc=function(a){var b=this;return a.rb(this.a.a,this.c).then(function(c){var d=lb(b.f);delete d[fm];delete d[em];z(d,c);return b.g(d)})};function gm(a,b,c,d){t.call(this,\"multi-factor-auth-required\",d,b);this.b=new dm(a,b,c);M(this,\"resolver\",this.b)}r(gm,t);function hm(a,b,c){if(a&&n(a.serverResponse)&&\"auth/multi-factor-auth-required\"===a.code)try{return new gm(b,a.serverResponse,c,a.message)}catch(d){}return null};function im(){}im.prototype.rb=function(a,b,c){return b.type==vg?jm(this,a,b,c):km(this,a,b)};function jm(a,b,c,d){return c.Ha().then(function(e){e={idToken:e};\"undefined\"!==typeof d&&(e.displayName=d);z(e,{phoneVerificationInfo:dh(a.a)});return O(b,Cj,e)})}function km(a,b,c){return c.Ha().then(function(d){d={mfaPendingCredential:d};z(d,{phoneVerificationInfo:dh(a.a)});return O(b,Dj,d)})}function lm(a){M(this,\"factorId\",a.fa);this.a=a}r(lm,im);\nfunction mm(a){lm.call(this,a);if(this.a.fa!=hh.PROVIDER_ID)throw new t(\"argument-error\",\"firebase.auth.PhoneMultiFactorAssertion requires a valid firebase.auth.PhoneAuthCredential\");}r(mm,lm);function nm(a,b){F.call(this,a);for(var c in b)this[c]=b[c]}r(nm,F);function om(a,b){this.a=a;this.b=[];this.c=q(this.xc,this);jd(this.a,\"userReloaded\",this.c);var c=[];b&&b.multiFactor&&b.multiFactor.enrolledFactors&&w(b.multiFactor.enrolledFactors,function(d){var e=null,f={};if(d){d.uid&&(f[mf]=d.uid);d.displayName&&(f[nf]=d.displayName);d.enrollmentTime&&(f[of]=(new Date(d.enrollmentTime)).toISOString());d.phoneNumber&&(f[lf]=d.phoneNumber);try{e=new qf(f)}catch(g){}d=e}else d=null;d&&c.push(d)});pm(this,c)}\nfunction qm(a){var b=[];w(a.mfaInfo||[],function(c){(c=pf(c))&&b.push(c)});return b}k=om.prototype;k.xc=function(a){pm(this,qm(a.gd))};function pm(a,b){a.b=b;M(a,\"enrolledFactors\",b)}k.Qb=function(){return this.a.I().then(function(a){return new ug(a,null)})};k.ec=function(a,b){var c=this,d=this.a.a;return this.Qb().then(function(e){return a.rb(d,e,b)}).then(function(e){rm(c.a,e);return c.a.reload()})};\nk.ad=function(a){var b=this,c=\"string\"===typeof a?a:a.uid,d=this.a.a;return this.a.I().then(function(e){return O(d,Hj,{idToken:e,mfaEnrollmentId:c})}).then(function(e){var f=Oa(b.b,function(g){return g.uid!=c});pm(b,f);rm(b.a,e);return b.a.reload().s(function(g){if(\"auth/user-token-expired\"!=g.code)throw g;})})};k.w=function(){return{multiFactor:{enrolledFactors:Pa(this.b,function(a){return a.w()})}}};function sm(a,b,c){this.h=a;this.i=b;this.g=c;this.c=3E4;this.f=96E4;this.b=null;this.a=this.c;if(this.f<this.c)throw Error(\"Proactive refresh lower bound greater than upper bound!\");}sm.prototype.start=function(){this.a=this.c;tm(this,!0)};function um(a,b){if(b)return a.a=a.c,a.g();b=a.a;a.a*=2;a.a>a.f&&(a.a=a.f);return b}function tm(a,b){a.stop();a.b=Ad(um(a,b)).then(function(){return We()}).then(function(){return a.h()}).then(function(){tm(a,!0)}).s(function(c){a.i(c)&&tm(a,!1)})}\nsm.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)};function vm(a){this.c=a;this.b=this.a=null}vm.prototype.w=function(){return{apiKey:this.c.c,refreshToken:this.a,accessToken:this.b&&this.b.toString(),expirationTime:wm(this)}};function wm(a){return a.b&&1E3*a.b.c||0}function xm(a,b){var c=b.refreshToken;a.b=fg(b[zg]||\"\");a.a=c}function ym(a,b){a.b=b.b;a.a=b.a}\nfunction zm(a,b){return Si(a.c,b).then(function(c){a.b=fg(c.access_token);a.a=c.refresh_token;return{accessToken:a.b.toString(),refreshToken:a.a}}).s(function(c){\"auth/user-token-expired\"==c.code&&(a.a=null);throw c;})}vm.prototype.getToken=function(a){a=!!a;return this.b&&!this.a?E(new t(\"user-token-expired\")):a||!this.b||ua()>wm(this)-3E4?this.a?zm(this,{grant_type:\"refresh_token\",refresh_token:this.a}):D(null):D({accessToken:this.b.toString(),refreshToken:this.a})};function Am(a,b){this.a=a||null;this.b=b||null;N(this,{lastSignInTime:Ye(b||null),creationTime:Ye(a||null)})}function Bm(a){return new Am(a.a,a.b)}Am.prototype.w=function(){return{lastLoginAt:this.b,createdAt:this.a}};function Cm(a,b,c,d,e,f){N(this,{uid:a,displayName:d||null,photoURL:e||null,email:c||null,phoneNumber:f||null,providerId:b})}\nfunction Dm(a,b,c){this.G=[];this.l=a.apiKey;this.m=a.appName;this.o=a.authDomain||null;var d=firebase.SDK_VERSION?Je(firebase.SDK_VERSION):null;this.a=new Ei(this.l,Aa(Ba),d);a.emulatorConfig&&Li(this.a,a.emulatorConfig);this.b=new vm(this.a);Em(this,b[zg]);xm(this.b,b);M(this,\"refreshToken\",this.b.a);Fm(this,c||{});H.call(this);this.P=!1;this.o&&Me()&&(this.i=Sl(this.o,this.l,this.m));this.R=[];this.f=null;this.u=Gm(this);this.$=q(this.gb,this);var e=this;this.pa=null;this.Ba=function(f){e.wa(f.h)};\nthis.ba=null;this.za=function(f){Li(e.a,f.c)};this.W=null;this.X=[];this.Aa=function(f){Hm(e,f.f)};this.aa=null;this.N=new om(this,c);M(this,\"multiFactor\",this.N)}r(Dm,H);Dm.prototype.wa=function(a){this.pa=a;Ki(this.a,a)};Dm.prototype.ka=function(){return this.pa};function Im(a,b){a.ba&&G(a.ba,\"languageCodeChanged\",a.Ba);(a.ba=b)&&jd(b,\"languageCodeChanged\",a.Ba)}function Jm(a,b){a.W&&G(a.W,\"emulatorConfigChanged\",a.za);(a.W=b)&&jd(b,\"emulatorConfigChanged\",a.za)}\nfunction Hm(a,b){a.X=b;Ni(a.a,firebase.SDK_VERSION?Je(firebase.SDK_VERSION,a.X):null)}Dm.prototype.Ga=function(){return Xa(this.X)};function Km(a,b){a.aa&&G(a.aa,\"frameworkChanged\",a.Aa);(a.aa=b)&&jd(b,\"frameworkChanged\",a.Aa)}Dm.prototype.gb=function(){this.u.b&&(this.u.stop(),this.u.start())};function Lm(a){try{return firebase.app(a.m).auth()}catch(b){throw new t(\"internal-error\",\"No firebase.auth.Auth instance is available for the Firebase App '\"+a.m+\"'!\");}}\nfunction Gm(a){return new sm(function(){return a.I(!0)},function(b){return b&&\"auth/network-request-failed\"==b.code?!0:!1},function(){var b=wm(a.b)-ua()-3E5;return 0<b?b:0})}function Mm(a){a.A||a.u.b||(a.u.start(),G(a,\"tokenChanged\",a.$),jd(a,\"tokenChanged\",a.$))}function Nm(a){G(a,\"tokenChanged\",a.$);a.u.stop()}function Em(a,b){a.ya=b;M(a,\"_lat\",b)}function Om(a,b){Va(a.R,function(c){return c==b})}\nfunction Pm(a){for(var b=[],c=0;c<a.R.length;c++)b.push(a.R[c](a));return Fc(b).then(function(){return a})}function Qm(a){a.i&&!a.P&&(a.P=!0,Kl(a.i,a))}function Fm(a,b){N(a,{uid:b.uid,displayName:b.displayName||null,photoURL:b.photoURL||null,email:b.email||null,emailVerified:b.emailVerified||!1,phoneNumber:b.phoneNumber||null,isAnonymous:b.isAnonymous||!1,tenantId:b.tenantId||null,metadata:new Am(b.createdAt,b.lastLoginAt),providerData:[]});a.a.b=a.tenantId}M(Dm.prototype,\"providerId\",\"firebase\");\nfunction Rm(){}function Sm(a){return D().then(function(){if(a.A)throw new t(\"app-deleted\");})}function Tm(a){return Pa(a.providerData,function(b){return b.providerId})}function Um(a,b){b&&(Vm(a,b.providerId),a.providerData.push(b))}function Vm(a,b){Va(a.providerData,function(c){return c.providerId==b})}function Wm(a,b,c){(\"uid\"!=b||c)&&a.hasOwnProperty(b)&&M(a,b,c)}\nfunction Xm(a,b){a!=b&&(N(a,{uid:b.uid,displayName:b.displayName,photoURL:b.photoURL,email:b.email,emailVerified:b.emailVerified,phoneNumber:b.phoneNumber,isAnonymous:b.isAnonymous,tenantId:b.tenantId,providerData:[]}),b.metadata?M(a,\"metadata\",Bm(b.metadata)):M(a,\"metadata\",new Am),w(b.providerData,function(c){Um(a,c)}),ym(a.b,b.b),M(a,\"refreshToken\",a.b.a),pm(a.N,b.N.b))}k=Dm.prototype;k.reload=function(){var a=this;return R(this,Sm(this).then(function(){return Ym(a).then(function(){return Pm(a)}).then(Rm)}))};\nfunction Ym(a){return a.I().then(function(b){var c=a.isAnonymous;return Zm(a,b).then(function(){c||Wm(a,\"isAnonymous\",!1);return b})})}k.nc=function(a){return this.I(a).then(function(b){return new cm(b)})};k.I=function(a){var b=this;return R(this,Sm(this).then(function(){return b.b.getToken(a)}).then(function(c){if(!c)throw new t(\"internal-error\");c.accessToken!=b.ya&&(Em(b,c.accessToken),b.dispatchEvent(new nm(\"tokenChanged\")));Wm(b,\"refreshToken\",c.refreshToken);return c.accessToken}))};\nfunction rm(a,b){b[zg]&&a.ya!=b[zg]&&(xm(a.b,b),a.dispatchEvent(new nm(\"tokenChanged\")),Em(a,b[zg]),Wm(a,\"refreshToken\",a.b.a))}function Zm(a,b){return O(a.a,Ej,{idToken:b}).then(q(a.Jc,a))}\nk.Jc=function(a){a=a.users;if(!a||!a.length)throw new t(\"internal-error\");a=a[0];Fm(this,{uid:a.localId,displayName:a.displayName,photoURL:a.photoUrl,email:a.email,emailVerified:!!a.emailVerified,phoneNumber:a.phoneNumber,lastLoginAt:a.lastLoginAt,createdAt:a.createdAt,tenantId:a.tenantId});for(var b=$m(a),c=0;c<b.length;c++)Um(this,b[c]);Wm(this,\"isAnonymous\",!(this.email&&a.passwordHash)&&!(this.providerData&&this.providerData.length));this.dispatchEvent(new nm(\"userReloaded\",{gd:a}))};\nfunction $m(a){return(a=a.providerUserInfo)&&a.length?Pa(a,function(b){return new Cm(b.rawId,b.providerId,b.email,b.displayName,b.photoUrl,b.phoneNumber)}):[]}k.Kc=function(a){cf(\"firebase.User.prototype.reauthenticateAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.reauthenticateWithCredential instead.\");return this.sb(a)};\nk.sb=function(a){var b=this,c=null;return R(this,a.c(this.a,this.uid).then(function(d){rm(b,d);c=an(b,d,\"reauthenticate\");b.f=null;return b.reload()}).then(function(){return c}),!0)};function bn(a,b){return Ym(a).then(function(){if(Ta(Tm(a),b))return Pm(a).then(function(){throw new t(\"provider-already-linked\");})})}k.Bc=function(a){cf(\"firebase.User.prototype.linkAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.linkWithCredential instead.\");return this.pb(a)};\nk.pb=function(a){var b=this,c=null;return R(this,bn(this,a.providerId).then(function(){return b.I()}).then(function(d){return a.b(b.a,d)}).then(function(d){c=an(b,d,\"link\");return cn(b,d)}).then(function(){return c}))};k.Cc=function(a,b){var c=this;return R(this,bn(this,\"phone\").then(function(){return bm(Lm(c),a,b,q(c.pb,c))}))};k.Lc=function(a,b){var c=this;return R(this,D().then(function(){return bm(Lm(c),a,b,q(c.sb,c))}),!0)};\nfunction an(a,b,c){var d=mh(b);b=kg(b);return ff({user:a,credential:d,additionalUserInfo:b,operationType:c})}function cn(a,b){rm(a,b);return a.reload().then(function(){return a})}k.Ab=function(a){var b=this;return R(this,this.I().then(function(c){return b.a.Ab(c,a)}).then(function(c){rm(b,c);return b.reload()}))};k.dd=function(a){var b=this;return R(this,this.I().then(function(c){return a.b(b.a,c)}).then(function(c){rm(b,c);return b.reload()}))};\nk.Bb=function(a){var b=this;return R(this,this.I().then(function(c){return b.a.Bb(c,a)}).then(function(c){rm(b,c);return b.reload()}))};\nk.Cb=function(a){if(void 0===a.displayName&&void 0===a.photoURL)return Sm(this);var b=this;return R(this,this.I().then(function(c){return b.a.Cb(c,{displayName:a.displayName,photoUrl:a.photoURL})}).then(function(c){rm(b,c);Wm(b,\"displayName\",c.displayName||null);Wm(b,\"photoURL\",c.photoUrl||null);w(b.providerData,function(d){\"password\"===d.providerId&&(M(d,\"displayName\",b.displayName),M(d,\"photoURL\",b.photoURL))});return Pm(b)}).then(Rm))};\nk.bd=function(a){var b=this;return R(this,Ym(this).then(function(c){return Ta(Tm(b),a)?nj(b.a,c,[a]).then(function(d){var e={};w(d.providerUserInfo||[],function(f){e[f.providerId]=!0});w(Tm(b),function(f){e[f]||Vm(b,f)});e[hh.PROVIDER_ID]||M(b,\"phoneNumber\",null);return Pm(b)}):Pm(b).then(function(){throw new t(\"no-such-provider\");})}))};\nk.delete=function(){var a=this;return R(this,this.I().then(function(b){return O(a.a,Bj,{idToken:b})}).then(function(){a.dispatchEvent(new nm(\"userDeleted\"))})).then(function(){for(var b=0;b<a.G.length;b++)a.G[b].cancel(\"app-deleted\");Im(a,null);Jm(a,null);Km(a,null);a.G=[];a.A=!0;Nm(a);M(a,\"refreshToken\",null);a.i&&Ll(a.i,a)})};\nk.Eb=function(a,b){return\"linkViaPopup\"==a&&(this.h||null)==b&&this.g||\"reauthViaPopup\"==a&&(this.h||null)==b&&this.g||\"linkViaRedirect\"==a&&(this.ga||null)==b||\"reauthViaRedirect\"==a&&(this.ga||null)==b?!0:!1};k.ma=function(a,b,c,d){\"linkViaPopup\"!=a&&\"reauthViaPopup\"!=a||d!=(this.h||null)||(c&&this.O?this.O(c):b&&!c&&this.g&&this.g(b),this.c&&(this.c.cancel(),this.c=null),delete this.g,delete this.O)};\nk.Fa=function(a,b){return\"linkViaPopup\"==a&&b==(this.h||null)?q(this.Jb,this):\"reauthViaPopup\"==a&&b==(this.h||null)?q(this.Kb,this):\"linkViaRedirect\"==a&&(this.ga||null)==b?q(this.Jb,this):\"reauthViaRedirect\"==a&&(this.ga||null)==b?q(this.Kb,this):null};k.Dc=function(a){var b=this;return dn(this,\"linkViaPopup\",a,function(){return bn(b,a.providerId).then(function(){return Pm(b)})},!1)};k.Mc=function(a){return dn(this,\"reauthViaPopup\",a,function(){return D()},!0)};\nfunction dn(a,b,c,d,e){if(!Me())return E(new t(\"operation-not-supported-in-this-environment\"));if(a.f&&!e)return E(a.f);var f=jg(c.providerId),g=Le(a.uid+\":::\"),h=null;(!Oe()||De())&&a.o&&c.isOAuthProvider&&(h=ak(a.o,a.l,a.m,b,c,null,g,firebase.SDK_VERSION||null,null,null,a.tenantId));var m=ue(h,f&&f.ua,f&&f.ta);d=d().then(function(){en(a);if(!e)return a.I().then(function(){})}).then(function(){return Ol(a.i,m,b,c,g,!!h,a.tenantId)}).then(function(){return new C(function(p,v){a.ma(b,null,new t(\"cancelled-popup-request\"),\na.h||null);a.g=p;a.O=v;a.h=g;a.c=Ql(a.i,a,b,m,g)})}).then(function(p){m&&te(m);return p?ff(p):null}).s(function(p){m&&te(m);throw p;});return R(a,d,e)}k.Ec=function(a){var b=this;return fn(this,\"linkViaRedirect\",a,function(){return bn(b,a.providerId)},!1)};k.Nc=function(a){return fn(this,\"reauthViaRedirect\",a,function(){return D()},!0)};\nfunction fn(a,b,c,d,e){if(!Me())return E(new t(\"operation-not-supported-in-this-environment\"));if(a.f&&!e)return E(a.f);var f=null,g=Le(a.uid+\":::\");d=d().then(function(){en(a);if(!e)return a.I().then(function(){})}).then(function(){a.ga=g;return Pm(a)}).then(function(h){a.ha&&(h=a.ha,h=h.b.set(gn,a.w(),h.a));return h}).then(function(){return Pl(a.i,b,c,g,a.tenantId)}).s(function(h){f=h;if(a.ha)return hn(a.ha);throw f;}).then(function(){if(f)throw f;});return R(a,d,e)}\nfunction en(a){if(!a.i||!a.P){if(a.i&&!a.P)throw new t(\"internal-error\");throw new t(\"auth-domain-config-required\");}}k.Jb=function(a,b,c,d){var e=this;this.c&&(this.c.cancel(),this.c=null);var f=null;c=this.I().then(function(g){return Dg(e.a,{requestUri:a,postBody:d,sessionId:b,idToken:g})}).then(function(g){f=an(e,g,\"link\");return cn(e,g)}).then(function(){return f});return R(this,c)};\nk.Kb=function(a,b,c,d){var e=this;this.c&&(this.c.cancel(),this.c=null);var f=null,g=D().then(function(){return yg(Eg(e.a,{requestUri:a,sessionId:b,postBody:d,tenantId:c}),e.uid)}).then(function(h){f=an(e,h,\"reauthenticate\");rm(e,h);e.f=null;return e.reload()}).then(function(){return f});return R(this,g,!0)};\nk.tb=function(a){var b=this,c=null;return R(this,this.I().then(function(d){c=d;return\"undefined\"===typeof a||kb(a)?{}:Yf(new Of(a))}).then(function(d){return b.a.tb(c,d)}).then(function(d){if(b.email!=d)return b.reload()}).then(function(){}))};k.Db=function(a,b){var c=this,d=null;return R(this,this.I().then(function(e){d=e;return\"undefined\"===typeof b||kb(b)?{}:Yf(new Of(b))}).then(function(e){return c.a.Db(d,a,e)}).then(function(e){if(c.email!=e)return c.reload()}).then(function(){}))};\nfunction R(a,b,c){var d=jn(a,b,c);a.G.push(d);d.na(function(){Ua(a.G,d)});return d.s(function(e){var f=null;e&&\"auth/multi-factor-auth-required\"===e.code&&(f=hm(e.w(),Lm(a),q(a.ic,a)));throw f||e;})}k.ic=function(a){var b=null,c=this;a=yg(D(a),c.uid).then(function(d){b=an(c,d,\"reauthenticate\");rm(c,d);c.f=null;return c.reload()}).then(function(){return b});return R(this,a,!0)};\nfunction jn(a,b,c){return a.f&&!c?(b.cancel(),E(a.f)):b.s(function(d){!d||\"auth/user-disabled\"!=d.code&&\"auth/user-token-expired\"!=d.code||(a.f||a.dispatchEvent(new nm(\"userInvalidated\")),a.f=d);throw d;})}k.toJSON=function(){return this.w()};\nk.w=function(){var a={uid:this.uid,displayName:this.displayName,photoURL:this.photoURL,email:this.email,emailVerified:this.emailVerified,phoneNumber:this.phoneNumber,isAnonymous:this.isAnonymous,tenantId:this.tenantId,providerData:[],apiKey:this.l,appName:this.m,authDomain:this.o,stsTokenManager:this.b.w(),redirectEventId:this.ga||null};this.metadata&&z(a,this.metadata.w());w(this.providerData,function(b){a.providerData.push(gf(b))});z(a,this.N.w());return a};\nfunction kn(a){if(!a.apiKey)return null;var b={apiKey:a.apiKey,authDomain:a.authDomain,appName:a.appName,emulatorConfig:a.emulatorConfig},c={};if(a.stsTokenManager&&a.stsTokenManager.accessToken)c[zg]=a.stsTokenManager.accessToken,c.refreshToken=a.stsTokenManager.refreshToken||null;else return null;var d=new Dm(b,c,a);a.providerData&&w(a.providerData,function(e){e&&Um(d,ff(e))});a.redirectEventId&&(d.ga=a.redirectEventId);return d}\nfunction ln(a,b,c,d){var e=new Dm(a,b);c&&(e.ha=c);d&&Hm(e,d);return e.reload().then(function(){return e})}function mn(a,b,c,d){var e=a.b,f={};f[zg]=e.b&&e.b.toString();f.refreshToken=e.a;b=new Dm(b||{apiKey:a.l,authDomain:a.o,appName:a.m},f);c&&(b.ha=c);d&&Hm(b,d);Xm(b,a);return b};function nn(a){this.a=a;this.b=Qk()}var gn={name:\"redirectUser\",D:\"session\"};function hn(a){return Uk(a.b,gn,a.a)}function on(a,b){return a.b.get(gn,a.a).then(function(c){c&&b&&(c.authDomain=b);return kn(c||{})})};function pn(a){this.a=a;this.b=Qk();this.c=null;this.f=qn(this);this.b.addListener(rn(\"local\"),this.a,q(this.g,this))}pn.prototype.g=function(){var a=this,b=rn(\"local\");sn(this,function(){return D().then(function(){return a.c&&\"local\"!=a.c.D?a.b.get(b,a.a):null}).then(function(c){if(c)return tn(a,\"local\").then(function(){a.c=b})})})};function tn(a,b){var c=[],d;for(d in Mk)Mk[d]!==b&&c.push(Uk(a.b,rn(Mk[d]),a.a));c.push(Uk(a.b,un,a.a));return Ec(c)}\nfunction qn(a){var b=rn(\"local\"),c=rn(\"session\"),d=rn(\"none\");return Tk(a.b,b,a.a).then(function(){return a.b.get(c,a.a)}).then(function(e){return e?c:a.b.get(d,a.a).then(function(f){return f?d:a.b.get(b,a.a).then(function(g){return g?b:a.b.get(un,a.a).then(function(h){return h?rn(h):b})})})}).then(function(e){a.c=e;return tn(a,e.D)}).s(function(){a.c||(a.c=b)})}var un={name:\"persistence\",D:\"session\"};function rn(a){return{name:\"authUser\",D:a}}\npn.prototype.wb=function(a){var b=null,c=this;Nk(a);return sn(this,function(){return a!=c.c.D?c.b.get(c.c,c.a).then(function(d){b=d;return tn(c,a)}).then(function(){c.c=rn(a);if(b)return c.b.set(c.c,b,c.a)}):D()})};function vn(a){return sn(a,function(){return a.b.set(un,a.c.D,a.a)})}function wn(a,b){return sn(a,function(){return a.b.set(a.c,b.w(),a.a)})}function xn(a){return sn(a,function(){return Uk(a.b,a.c,a.a)})}\nfunction yn(a,b,c){return sn(a,function(){return a.b.get(a.c,a.a).then(function(d){d&&b&&(d.authDomain=b);d&&c&&(d.emulatorConfig=c);return kn(d||{})})})}function sn(a,b){a.f=a.f.then(b,b);return a.f};function zn(a){this.m=!1;M(this,\"settings\",new $l);M(this,\"app\",a);if(S(this).options&&S(this).options.apiKey)a=firebase.SDK_VERSION?Je(firebase.SDK_VERSION):null,this.a=new Ei(S(this).options&&S(this).options.apiKey,Aa(Ba),a);else throw new t(\"invalid-api-key\");this.R=[];this.u=[];this.P=[];this.ac=firebase.INTERNAL.createSubscribe(q(this.yc,this));this.X=void 0;this.bc=firebase.INTERNAL.createSubscribe(q(this.zc,this));An(this,null);this.l=new pn(S(this).options.apiKey+\":\"+S(this).name);this.G=\nnew nn(S(this).options.apiKey+\":\"+S(this).name);this.$=T(this,Bn(this));this.i=T(this,Cn(this));this.ba=!1;this.pa=q(this.Yc,this);this.Ba=q(this.da,this);this.ya=q(this.kc,this);this.za=q(this.vc,this);this.Aa=q(this.wc,this);this.b=null;Dn(this);this.INTERNAL={};this.INTERNAL[\"delete\"]=q(this.delete,this);this.INTERNAL.logFramework=q(this.Fc,this);this.A=0;H.call(this);En(this);this.N=[];this.f=null}r(zn,H);function Fn(a){F.call(this,\"languageCodeChanged\");this.h=a}r(Fn,F);\nfunction Gn(a){F.call(this,\"emulatorConfigChanged\");this.c=a}r(Gn,F);function Hn(a){F.call(this,\"frameworkChanged\");this.f=a}r(Hn,F);k=zn.prototype;k.wb=function(a){a=this.l.wb(a);return T(this,a)};k.wa=function(a){this.aa===a||this.m||(this.aa=a,Ki(this.a,this.aa),this.dispatchEvent(new Fn(this.ka())))};k.ka=function(){return this.aa};k.ed=function(){var a=l.navigator;this.wa(a?a.languages&&a.languages[0]||a.language||a.userLanguage||null:null)};\nk.fd=function(a){if(!this.f){if(!/^https?:\\/\\//.test(a))throw new t(\"argument-error\",\"Emulator URL must start with a valid scheme (http:// or https://).\");In();this.f={url:a};this.settings.hb=!0;Li(this.a,this.f);this.dispatchEvent(new Gn(this.f))}};\nfunction In(){Xe(\"WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials.\");l.document&&ze().then(function(){var a=l.document.createElement(\"div\");a.innerText=\"Running in emulator mode. Do not use with production credentials.\";a.style.position=\"fixed\";a.style.width=\"100%\";a.style.backgroundColor=\"#ffffff\";a.style.border=\".1em solid #000000\";a.style.color=\"#ff0000\";a.style.bottom=\"0px\";a.style.left=\"0px\";a.style.margin=\"0px\";a.style.zIndex=\n1E4;a.style.textAlign=\"center\";a.classList.add(\"firebase-emulator-warning\");l.document.body.appendChild(a)})}k.Fc=function(a){this.N.push(a);Ni(this.a,firebase.SDK_VERSION?Je(firebase.SDK_VERSION,this.N):null);this.dispatchEvent(new Hn(this.N))};k.Ga=function(){return Xa(this.N)};k.xb=function(a){this.W===a||this.m||(this.W=a,this.a.b=this.W)};k.S=function(){return this.W};\nfunction En(a){Object.defineProperty(a,\"lc\",{get:function(){return this.ka()},set:function(b){this.wa(b)},enumerable:!1});a.aa=null;Object.defineProperty(a,\"ti\",{get:function(){return this.S()},set:function(b){this.xb(b)},enumerable:!1});a.W=null}k.toJSON=function(){return{apiKey:S(this).options.apiKey,authDomain:S(this).options.authDomain,appName:S(this).name,currentUser:U(this)&&U(this).w()}};function Jn(a){return a.gb||E(new t(\"auth-domain-config-required\"))}\nfunction Dn(a){var b=S(a).options.authDomain,c=S(a).options.apiKey;b&&Me()&&(a.gb=a.$.then(function(){if(!a.m){a.b=Sl(b,c,S(a).name,a.f);Kl(a.b,a);U(a)&&Qm(U(a));if(a.o){Qm(a.o);var d=a.o;d.wa(a.ka());Im(d,a);d=a.o;Hm(d,a.N);Km(d,a);d=a.o;Li(d.a,a.f);Jm(d,a);a.o=null}return a.b}}))}k.Eb=function(a,b){switch(a){case \"unknown\":case \"signInViaRedirect\":return!0;case \"signInViaPopup\":return this.h==b&&!!this.g;default:return!1}};\nk.ma=function(a,b,c,d){\"signInViaPopup\"==a&&this.h==d&&(c&&this.O?this.O(c):b&&!c&&this.g&&this.g(b),this.c&&(this.c.cancel(),this.c=null),delete this.g,delete this.O)};k.Fa=function(a,b){return\"signInViaRedirect\"==a||\"signInViaPopup\"==a&&this.h==b&&this.g?q(this.hc,this):null};k.hc=function(a,b,c,d){var e=this,f={requestUri:a,postBody:d,sessionId:b,tenantId:c};this.c&&(this.c.cancel(),this.c=null);return e.$.then(function(){return Kn(e,Bg(e.a,f))})};\nk.Wc=function(a){if(!Me())return E(new t(\"operation-not-supported-in-this-environment\"));var b=this,c=jg(a.providerId),d=Le(),e=null;(!Oe()||De())&&S(this).options.authDomain&&a.isOAuthProvider&&(e=ak(S(this).options.authDomain,S(this).options.apiKey,S(this).name,\"signInViaPopup\",a,null,d,firebase.SDK_VERSION||null,null,null,this.S(),this.f));var f=ue(e,c&&c.ua,c&&c.ta);c=Jn(this).then(function(g){return Ol(g,f,\"signInViaPopup\",a,d,!!e,b.S())}).then(function(){return new C(function(g,h){b.ma(\"signInViaPopup\",\nnull,new t(\"cancelled-popup-request\"),b.h);b.g=g;b.O=h;b.h=d;b.c=Ql(b.b,b,\"signInViaPopup\",f,d)})}).then(function(g){f&&te(f);return g?ff(g):null}).s(function(g){f&&te(f);throw g;});return T(this,c)};k.Xc=function(a){if(!Me())return E(new t(\"operation-not-supported-in-this-environment\"));var b=this,c=Jn(this).then(function(){return vn(b.l)}).then(function(){return Pl(b.b,\"signInViaRedirect\",a,void 0,b.S())});return T(this,c)};\nfunction Ln(a){if(!Me())return E(new t(\"operation-not-supported-in-this-environment\"));var b=Jn(a).then(function(){return a.b.qa()}).then(function(c){return c?ff(c):null});return T(a,b)}k.qa=function(){var a=this;return Ln(this).then(function(b){a.b&&Vl(a.b.b);return b}).s(function(b){a.b&&Vl(a.b.b);throw b;})};\nk.cd=function(a){if(!a)return E(new t(\"null-user\"));if(this.W!=a.tenantId)return E(new t(\"tenant-id-mismatch\"));var b=this,c={};c.apiKey=S(this).options.apiKey;c.authDomain=S(this).options.authDomain;c.appName=S(this).name;var d=mn(a,c,b.G,b.Ga());return T(this,this.i.then(function(){if(S(b).options.apiKey!=a.l)return d.reload()}).then(function(){if(U(b)&&a.uid==U(b).uid)return Xm(U(b),a),b.da(a);An(b,d);Qm(d);return b.da(d)}).then(function(){Mn(b)}))};\nfunction Nn(a,b){var c={};c.apiKey=S(a).options.apiKey;c.authDomain=S(a).options.authDomain;c.appName=S(a).name;a.f&&(c.emulatorConfig=a.f);return a.$.then(function(){return ln(c,b,a.G,a.Ga())}).then(function(d){if(U(a)&&d.uid==U(a).uid)return Xm(U(a),d),a.da(d);An(a,d);Qm(d);return a.da(d)}).then(function(){Mn(a)})}\nfunction An(a,b){U(a)&&(Om(U(a),a.Ba),G(U(a),\"tokenChanged\",a.ya),G(U(a),\"userDeleted\",a.za),G(U(a),\"userInvalidated\",a.Aa),Nm(U(a)));b&&(b.R.push(a.Ba),jd(b,\"tokenChanged\",a.ya),jd(b,\"userDeleted\",a.za),jd(b,\"userInvalidated\",a.Aa),0<a.A&&Mm(b));M(a,\"currentUser\",b);b&&(b.wa(a.ka()),Im(b,a),Hm(b,a.N),Km(b,a),Li(b.a,a.f),Jm(b,a))}k.zb=function(){var a=this,b=this.i.then(function(){a.b&&Vl(a.b.b);if(!U(a))return D();An(a,null);return xn(a.l).then(function(){Mn(a)})});return T(this,b)};\nfunction On(a){var b=on(a.G,S(a).options.authDomain).then(function(c){if(a.o=c)c.ha=a.G;return hn(a.G)});return T(a,b)}function Bn(a){var b=S(a).options.authDomain,c=On(a).then(function(){return yn(a.l,b,a.f)}).then(function(d){return d?(d.ha=a.G,a.o&&(a.o.ga||null)==(d.ga||null)?d:d.reload().then(function(){return wn(a.l,d).then(function(){return d})}).s(function(e){return\"auth/network-request-failed\"==e.code?d:xn(a.l)})):null}).then(function(d){An(a,d||null)});return T(a,c)}\nfunction Cn(a){return a.$.then(function(){return Ln(a)}).s(function(){}).then(function(){if(!a.m)return a.pa()}).s(function(){}).then(function(){if(!a.m){a.ba=!0;var b=a.l;b.b.addListener(rn(\"local\"),b.a,a.pa)}})}\nk.Yc=function(){var a=this;return yn(this.l,S(this).options.authDomain).then(function(b){if(!a.m){var c;if(c=U(a)&&b){c=U(a).uid;var d=b.uid;c=void 0===c||null===c||\"\"===c||void 0===d||null===d||\"\"===d?!1:c==d}if(c)return Xm(U(a),b),U(a).I();if(U(a)||b)An(a,b),b&&(Qm(b),b.ha=a.G),a.b&&Kl(a.b,a),Mn(a)}})};k.da=function(a){return wn(this.l,a)};k.kc=function(){Mn(this);this.da(U(this))};k.vc=function(){this.zb()};k.wc=function(){this.zb()};\nfunction Kn(a,b){var c=null,d=null;return T(a,b.then(function(e){c=mh(e);d=kg(e);return Nn(a,e)},function(e){var f=null;e&&\"auth/multi-factor-auth-required\"===e.code&&(f=hm(e.w(),a,q(a.jc,a)));throw f||e;}).then(function(){return ff({user:U(a),credential:c,additionalUserInfo:d,operationType:\"signIn\"})}))}k.jc=function(a){var b=this;return this.i.then(function(){return Kn(b,D(a))})};k.yc=function(a){var b=this;this.addAuthTokenListener(function(){a.next(U(b))})};\nk.zc=function(a){var b=this;Pn(this,function(){a.next(U(b))})};k.Hc=function(a,b,c){var d=this;this.ba&&Promise.resolve().then(function(){\"function\"===typeof a?a(U(d)):\"function\"===typeof a.next&&a.next(U(d))});return this.ac(a,b,c)};k.Gc=function(a,b,c){var d=this;this.ba&&Promise.resolve().then(function(){d.X=d.getUid();\"function\"===typeof a?a(U(d)):\"function\"===typeof a.next&&a.next(U(d))});return this.bc(a,b,c)};\nk.mc=function(a){var b=this,c=this.i.then(function(){return U(b)?U(b).I(a).then(function(d){return{accessToken:d}}):null});return T(this,c)};k.Sc=function(a){var b=this;return this.i.then(function(){return Kn(b,O(b.a,Gj,{token:a}))}).then(function(c){var d=c.user;Wm(d,\"isAnonymous\",!1);b.da(d);return c})};k.Tc=function(a,b){var c=this;return this.i.then(function(){return Kn(c,O(c.a,Xg,{email:a,password:b}))})};\nk.dc=function(a,b){var c=this;return this.i.then(function(){return Kn(c,O(c.a,Aj,{email:a,password:b}))})};k.Za=function(a){var b=this;return this.i.then(function(){return Kn(b,a.ja(b.a))})};k.Rc=function(a){cf(\"firebase.auth.Auth.prototype.signInAndRetrieveDataWithCredential is deprecated. Please use firebase.auth.Auth.prototype.signInWithCredential instead.\");return this.Za(a)};\nk.yb=function(){var a=this;return this.i.then(function(){var b=U(a);if(b&&b.isAnonymous){var c=ff({providerId:null,isNewUser:!1});return ff({user:b,credential:null,additionalUserInfo:c,operationType:\"signIn\"})}return Kn(a,a.a.yb()).then(function(d){var e=d.user;Wm(e,\"isAnonymous\",!0);a.da(e);return d})})};function S(a){return a.app}function U(a){return a.currentUser}k.getUid=function(){return U(this)&&U(this).uid||null};function Qn(a){return U(a)&&U(a)._lat||null}\nfunction Mn(a){if(a.ba){for(var b=0;b<a.u.length;b++)if(a.u[b])a.u[b](Qn(a));if(a.X!==a.getUid()&&a.P.length)for(a.X=a.getUid(),b=0;b<a.P.length;b++)if(a.P[b])a.P[b](Qn(a))}}k.cc=function(a){this.addAuthTokenListener(a);this.A++;0<this.A&&U(this)&&Mm(U(this))};k.Oc=function(a){var b=this;w(this.u,function(c){c==a&&b.A--});0>this.A&&(this.A=0);0==this.A&&U(this)&&Nm(U(this));this.removeAuthTokenListener(a)};\nk.addAuthTokenListener=function(a){var b=this;this.u.push(a);T(this,this.i.then(function(){b.m||Ta(b.u,a)&&a(Qn(b))}))};k.removeAuthTokenListener=function(a){Va(this.u,function(b){return b==a})};function Pn(a,b){a.P.push(b);T(a,a.i.then(function(){!a.m&&Ta(a.P,b)&&a.X!==a.getUid()&&(a.X=a.getUid(),b(Qn(a)))}))}\nk.delete=function(){this.m=!0;for(var a=0;a<this.R.length;a++)this.R[a].cancel(\"app-deleted\");this.R=[];this.l&&(a=this.l,a.b.removeListener(rn(\"local\"),a.a,this.pa));this.b&&(Ll(this.b,this),Vl(this.b.b));return Promise.resolve()};function T(a,b){a.R.push(b);b.na(function(){Ua(a.R,b)});return b}k.gc=function(a){return T(this,Xi(this.a,a))};k.Ac=function(a){return!!bh(a)};\nk.vb=function(a,b){var c=this;return T(this,D().then(function(){var d=new Of(b);if(!d.c)throw new t(\"argument-error\",Wf+\" must be true when sending sign in link to email\");return Yf(d)}).then(function(d){return c.a.vb(a,d)}).then(function(){}))};k.hd=function(a){return this.Qa(a).then(function(b){return b.data.email})};k.mb=function(a,b){return T(this,this.a.mb(a,b).then(function(){}))};k.Qa=function(a){return T(this,this.a.Qa(a).then(function(b){return new rf(b)}))};\nk.ib=function(a){return T(this,this.a.ib(a).then(function(){}))};k.ub=function(a,b){var c=this;return T(this,D().then(function(){return\"undefined\"===typeof b||kb(b)?{}:Yf(new Of(b))}).then(function(d){return c.a.ub(a,d)}).then(function(){}))};k.Vc=function(a,b){return T(this,bm(this,a,b,q(this.Za,this)))};\nk.Uc=function(a,b){var c=this;return T(this,D().then(function(){var d=b||me(),e=ah(a,d);d=bh(d);if(!d)throw new t(\"argument-error\",\"Invalid email link!\");if(d.tenantId!==c.S())throw new t(\"tenant-id-mismatch\");return c.Za(e)}))};function Rn(){}Rn.prototype.render=function(){};Rn.prototype.reset=function(){};Rn.prototype.getResponse=function(){};Rn.prototype.execute=function(){};function Sn(){this.a={};this.b=1E12}var Tn=null;Sn.prototype.render=function(a,b){this.a[this.b.toString()]=new Un(a,b);return this.b++};Sn.prototype.reset=function(a){var b=Vn(this,a);a=Wn(a);b&&a&&(b.delete(),delete this.a[a])};Sn.prototype.getResponse=function(a){return(a=Vn(this,a))?a.getResponse():null};Sn.prototype.execute=function(a){(a=Vn(this,a))&&a.execute()};function Vn(a,b){return(b=Wn(b))?a.a[b]||null:null}function Wn(a){return(a=\"undefined\"===typeof a?1E12:a)?a.toString():null}\nfunction Un(a,b){this.g=!1;this.c=b;this.a=this.b=null;this.h=\"invisible\"!==this.c.size;this.f=fc(a);var c=this;this.i=function(){c.execute()};this.h?this.execute():jd(this.f,\"click\",this.i)}Un.prototype.getResponse=function(){Xn(this);return this.b};\nUn.prototype.execute=function(){Xn(this);var a=this;this.a||(this.a=setTimeout(function(){a.b=He();var b=a.c.callback,c=a.c[\"expired-callback\"];if(b)try{b(a.b)}catch(d){}a.a=setTimeout(function(){a.a=null;a.b=null;if(c)try{c()}catch(d){}a.h&&a.execute()},6E4)},500))};Un.prototype.delete=function(){Xn(this);this.g=!0;clearTimeout(this.a);this.a=null;G(this.f,\"click\",this.i)};function Xn(a){if(a.g)throw Error(\"reCAPTCHA mock was already deleted!\");};function Yn(){}M(Yn,\"FACTOR_ID\",\"phone\");function Zn(){}Zn.prototype.g=function(){Tn||(Tn=new Sn);return D(Tn)};Zn.prototype.c=function(){};var $n=null;function ao(){this.b=l.grecaptcha?Infinity:0;this.f=null;this.a=\"__rcb\"+Math.floor(1E6*Math.random()).toString()}var bo=new ob(pb,\"https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}\"),co=new Ue(3E4,6E4);\nao.prototype.g=function(a){var b=this;return new C(function(c,d){var e=setTimeout(function(){d(new t(\"network-request-failed\"))},co.get());if(!l.grecaptcha||a!==b.f&&!b.b){l[b.a]=function(){if(l.grecaptcha){b.f=a;var g=l.grecaptcha.render;l.grecaptcha.render=function(h,m){h=g(h,m);b.b++;return h};clearTimeout(e);c(l.grecaptcha)}else clearTimeout(e),d(new t(\"internal-error\"));delete l[b.a]};var f=xb(bo,{onload:b.a,hl:a||\"\"});D(xi(f)).s(function(){clearTimeout(e);d(new t(\"internal-error\",\"Unable to load external reCAPTCHA dependencies!\"))})}else clearTimeout(e),\nc(l.grecaptcha)})};ao.prototype.c=function(){this.b--};var eo=null;function fo(a,b,c,d,e,f,g){M(this,\"type\",\"recaptcha\");this.c=this.f=null;this.A=!1;this.m=b;this.g=null;g?($n||($n=new Zn),g=$n):(eo||(eo=new ao),g=eo);this.v=g;this.a=c||{theme:\"light\",type:\"image\"};this.h=[];if(this.a[go])throw new t(\"argument-error\",\"sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.\");this.i=\"invisible\"===this.a[ho];if(!l.document)throw new t(\"operation-not-supported-in-this-environment\",\"RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.\");\nif(!fc(b)||!this.i&&fc(b).hasChildNodes())throw new t(\"argument-error\",\"reCAPTCHA container is either not found or already contains inner elements!\");this.o=new Ei(a,f||null,e||null);this.u=d||function(){return null};var h=this;this.l=[];var m=this.a[io];this.a[io]=function(v){jo(h,v);if(\"function\"===typeof m)m(v);else if(\"string\"===typeof m){var B=L(m,l);\"function\"===typeof B&&B(v)}};var p=this.a[ko];this.a[ko]=function(){jo(h,null);if(\"function\"===typeof p)p();else if(\"string\"===typeof p){var v=\nL(p,l);\"function\"===typeof v&&v()}}}var io=\"callback\",ko=\"expired-callback\",go=\"sitekey\",ho=\"size\";function jo(a,b){for(var c=0;c<a.l.length;c++)try{a.l[c](b)}catch(d){}}function lo(a,b){Va(a.l,function(c){return c==b})}function mo(a,b){a.h.push(b);b.na(function(){Ua(a.h,b)});return b}k=fo.prototype;\nk.Ia=function(){var a=this;return this.f?this.f:this.f=mo(this,D().then(function(){if(Ne()&&!Ee())return ze();throw new t(\"operation-not-supported-in-this-environment\",\"RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.\");}).then(function(){return a.v.g(a.u())}).then(function(b){a.g=b;return O(a.o,Fj,{})}).then(function(b){a.a[go]=b.recaptchaSiteKey}).s(function(b){a.f=null;throw b;}))};\nk.render=function(){no(this);var a=this;return mo(this,this.Ia().then(function(){if(null===a.c){var b=a.m;if(!a.i){var c=fc(b);b=ic(\"DIV\");c.appendChild(b)}a.c=a.g.render(b,a.a)}return a.c}))};k.verify=function(){no(this);var a=this;return mo(this,this.render().then(function(b){return new C(function(c){var d=a.g.getResponse(b);if(d)c(d);else{var e=function(f){f&&(lo(a,e),c(f))};a.l.push(e);a.i&&a.g.execute(a.c)}})}))};k.reset=function(){no(this);null!==this.c&&this.g.reset(this.c)};\nfunction no(a){if(a.A)throw new t(\"internal-error\",\"RecaptchaVerifier instance has been destroyed.\");}k.clear=function(){no(this);this.A=!0;this.v.c();for(var a=0;a<this.h.length;a++)this.h[a].cancel(\"RecaptchaVerifier instance has been destroyed.\");if(!this.i){a=fc(this.m);for(var b;b=a.firstChild;)a.removeChild(b)}};\nfunction oo(a,b,c){var d=!1;try{this.b=c||firebase.app()}catch(g){throw new t(\"argument-error\",\"No firebase.app.App instance is currently initialized.\");}if(this.b.options&&this.b.options.apiKey)c=this.b.options.apiKey;else throw new t(\"invalid-api-key\");var e=this,f=null;try{f=this.b.auth().Ga()}catch(g){}try{d=this.b.auth().settings.appVerificationDisabledForTesting}catch(g){}f=firebase.SDK_VERSION?Je(firebase.SDK_VERSION,f):null;fo.call(this,c,a,b,function(){try{var g=e.b.auth().ka()}catch(h){g=\nnull}return g},f,Aa(Ba),d)}r(oo,fo);function po(a,b,c,d){a:{c=Array.prototype.slice.call(c);var e=0;for(var f=!1,g=0;g<b.length;g++)if(b[g].optional)f=!0;else{if(f)throw new t(\"internal-error\",\"Argument validator encountered a required argument after an optional argument.\");e++}f=b.length;if(c.length<e||f<c.length)d=\"Expected \"+(e==f?1==e?\"1 argument\":e+\" arguments\":e+\"-\"+f+\" arguments\")+\" but got \"+c.length+\".\";else{for(e=0;e<c.length;e++)if(f=b[e].optional&&void 0===c[e],!b[e].K(c[e])&&!f){b=b[e];if(0>e||e>=qo.length)throw new t(\"internal-error\",\n\"Argument validator received an unsupported number of arguments.\");c=qo[e];d=(d?\"\":c+\" argument \")+(b.name?'\"'+b.name+'\" ':\"\")+\"must be \"+b.J+\".\";break a}d=null}}if(d)throw new t(\"argument-error\",a+\" failed: \"+d);}var qo=\"First Second Third Fourth Fifth Sixth Seventh Eighth Ninth\".split(\" \");function V(a,b){return{name:a||\"\",J:\"a valid string\",optional:!!b,K:function(c){return\"string\"===typeof c}}}\nfunction ro(a,b){return{name:a||\"\",J:\"a boolean\",optional:!!b,K:function(c){return\"boolean\"===typeof c}}}function W(a,b){return{name:a||\"\",J:\"a valid object\",optional:!!b,K:n}}function so(a,b){return{name:a||\"\",J:\"a function\",optional:!!b,K:function(c){return\"function\"===typeof c}}}function to(a,b){return{name:a||\"\",J:\"null\",optional:!!b,K:function(c){return null===c}}}function uo(){return{name:\"\",J:\"an HTML element\",optional:!1,K:function(a){return!!(a&&a instanceof Element)}}}\nfunction vo(){return{name:\"auth\",J:\"an instance of Firebase Auth\",optional:!0,K:function(a){return!!(a&&a instanceof zn)}}}function wo(){return{name:\"app\",J:\"an instance of Firebase App\",optional:!0,K:function(a){return!!(a&&a instanceof firebase.app.App)}}}function xo(a){return{name:a?a+\"Credential\":\"credential\",J:a?\"a valid \"+a+\" credential\":\"a valid credential\",optional:!1,K:function(b){if(!b)return!1;var c=!a||b.providerId===a;return!(!b.ja||!c)}}}\nfunction yo(){return{name:\"multiFactorAssertion\",J:\"a valid multiFactorAssertion\",optional:!1,K:function(a){return a?!!a.rb:!1}}}function zo(){return{name:\"authProvider\",J:\"a valid Auth provider\",optional:!1,K:function(a){return!!(a&&a.providerId&&a.hasOwnProperty&&a.hasOwnProperty(\"isOAuthProvider\"))}}}function Ao(a,b){return n(a)&&\"string\"===typeof a.type&&a.type===b&&\"function\"===typeof a.Ha}function Bo(a){return n(a)&&\"string\"===typeof a.uid}\nfunction Co(){return{name:\"applicationVerifier\",J:\"an implementation of firebase.auth.ApplicationVerifier\",optional:!1,K:function(a){return!(!a||\"string\"!==typeof a.type||\"function\"!==typeof a.verify)}}}function X(a,b,c,d){return{name:c||\"\",J:a.J+\" or \"+b.J,optional:!!d,K:function(e){return a.K(e)||b.K(e)}}};function Y(a,b){for(var c in b){var d=b[c].name;a[d]=Do(d,a[c],b[c].j)}}function Eo(a,b){for(var c in b){var d=b[c].name;d!==c&&Object.defineProperty(a,d,{get:ta(function(e){return this[e]},c),set:ta(function(e,f,g,h){po(e,[g],[h],!0);this[f]=h},d,c,b[c].jb),enumerable:!0})}}function Z(a,b,c,d){a[b]=Do(b,c,d)}\nfunction Do(a,b,c){function d(){var g=Array.prototype.slice.call(arguments);po(e,c,g);return b.apply(this,g)}if(!c)return b;var e=Fo(a),f;for(f in b)d[f]=b[f];for(f in b.prototype)d.prototype[f]=b.prototype[f];return d}function Fo(a){a=a.split(\".\");return a[a.length-1]};Y(zn.prototype,{ib:{name:\"applyActionCode\",j:[V(\"code\")]},Qa:{name:\"checkActionCode\",j:[V(\"code\")]},mb:{name:\"confirmPasswordReset\",j:[V(\"code\"),V(\"newPassword\")]},dc:{name:\"createUserWithEmailAndPassword\",j:[V(\"email\"),V(\"password\")]},gc:{name:\"fetchSignInMethodsForEmail\",j:[V(\"email\")]},qa:{name:\"getRedirectResult\",j:[]},Ac:{name:\"isSignInWithEmailLink\",j:[V(\"emailLink\")]},Gc:{name:\"onAuthStateChanged\",j:[X(W(),so(),\"nextOrObserver\"),so(\"opt_error\",!0),so(\"opt_completed\",!0)]},Hc:{name:\"onIdTokenChanged\",\nj:[X(W(),so(),\"nextOrObserver\"),so(\"opt_error\",!0),so(\"opt_completed\",!0)]},ub:{name:\"sendPasswordResetEmail\",j:[V(\"email\"),X(W(\"opt_actionCodeSettings\",!0),to(null,!0),\"opt_actionCodeSettings\",!0)]},vb:{name:\"sendSignInLinkToEmail\",j:[V(\"email\"),W(\"actionCodeSettings\")]},wb:{name:\"setPersistence\",j:[V(\"persistence\")]},Rc:{name:\"signInAndRetrieveDataWithCredential\",j:[xo()]},yb:{name:\"signInAnonymously\",j:[]},Za:{name:\"signInWithCredential\",j:[xo()]},Sc:{name:\"signInWithCustomToken\",j:[V(\"token\")]},\nTc:{name:\"signInWithEmailAndPassword\",j:[V(\"email\"),V(\"password\")]},Uc:{name:\"signInWithEmailLink\",j:[V(\"email\"),V(\"emailLink\",!0)]},Vc:{name:\"signInWithPhoneNumber\",j:[V(\"phoneNumber\"),Co()]},Wc:{name:\"signInWithPopup\",j:[zo()]},Xc:{name:\"signInWithRedirect\",j:[zo()]},cd:{name:\"updateCurrentUser\",j:[X(function(a){return{name:\"user\",J:\"an instance of Firebase User\",optional:!!a,K:function(b){return!!(b&&b instanceof Dm)}}}(),to(),\"user\")]},zb:{name:\"signOut\",j:[]},toJSON:{name:\"toJSON\",j:[V(null,\n!0)]},ed:{name:\"useDeviceLanguage\",j:[]},fd:{name:\"useEmulator\",j:[V(\"url\")]},hd:{name:\"verifyPasswordResetCode\",j:[V(\"code\")]}});Eo(zn.prototype,{lc:{name:\"languageCode\",jb:X(V(),to(),\"languageCode\")},ti:{name:\"tenantId\",jb:X(V(),to(),\"tenantId\")}});zn.Persistence=Mk;zn.Persistence.LOCAL=\"local\";zn.Persistence.SESSION=\"session\";zn.Persistence.NONE=\"none\";\nY(Dm.prototype,{\"delete\":{name:\"delete\",j:[]},nc:{name:\"getIdTokenResult\",j:[ro(\"opt_forceRefresh\",!0)]},I:{name:\"getIdToken\",j:[ro(\"opt_forceRefresh\",!0)]},Bc:{name:\"linkAndRetrieveDataWithCredential\",j:[xo()]},pb:{name:\"linkWithCredential\",j:[xo()]},Cc:{name:\"linkWithPhoneNumber\",j:[V(\"phoneNumber\"),Co()]},Dc:{name:\"linkWithPopup\",j:[zo()]},Ec:{name:\"linkWithRedirect\",j:[zo()]},Kc:{name:\"reauthenticateAndRetrieveDataWithCredential\",j:[xo()]},sb:{name:\"reauthenticateWithCredential\",j:[xo()]},Lc:{name:\"reauthenticateWithPhoneNumber\",\nj:[V(\"phoneNumber\"),Co()]},Mc:{name:\"reauthenticateWithPopup\",j:[zo()]},Nc:{name:\"reauthenticateWithRedirect\",j:[zo()]},reload:{name:\"reload\",j:[]},tb:{name:\"sendEmailVerification\",j:[X(W(\"opt_actionCodeSettings\",!0),to(null,!0),\"opt_actionCodeSettings\",!0)]},toJSON:{name:\"toJSON\",j:[V(null,!0)]},bd:{name:\"unlink\",j:[V(\"provider\")]},Ab:{name:\"updateEmail\",j:[V(\"email\")]},Bb:{name:\"updatePassword\",j:[V(\"password\")]},dd:{name:\"updatePhoneNumber\",j:[xo(\"phone\")]},Cb:{name:\"updateProfile\",j:[W(\"profile\")]},\nDb:{name:\"verifyBeforeUpdateEmail\",j:[V(\"email\"),X(W(\"opt_actionCodeSettings\",!0),to(null,!0),\"opt_actionCodeSettings\",!0)]}});Y(Sn.prototype,{execute:{name:\"execute\"},render:{name:\"render\"},reset:{name:\"reset\"},getResponse:{name:\"getResponse\"}});Y(Rn.prototype,{execute:{name:\"execute\"},render:{name:\"render\"},reset:{name:\"reset\"},getResponse:{name:\"getResponse\"}});Y(C.prototype,{na:{name:\"finally\"},s:{name:\"catch\"},then:{name:\"then\"}});\nEo($l.prototype,{appVerificationDisabled:{name:\"appVerificationDisabledForTesting\",jb:ro(\"appVerificationDisabledForTesting\")}});Y(am.prototype,{confirm:{name:\"confirm\",j:[V(\"verificationCode\")]}});Z(xg,\"fromJSON\",function(a){a=\"string\"===typeof a?JSON.parse(a):a;for(var b,c=[Ig,$g,gh,Fg],d=0;d<c.length;d++)if(b=c[d](a))return b;return null},[X(V(),W(),\"json\")]);Z(Vg,\"credential\",function(a,b){return new Ug(a,b)},[V(\"email\"),V(\"password\")]);Y(Ug.prototype,{w:{name:\"toJSON\",j:[V(null,!0)]}});\nY(Mg.prototype,{Ca:{name:\"addScope\",j:[V(\"scope\")]},Ka:{name:\"setCustomParameters\",j:[W(\"customOAuthParameters\")]}});Z(Mg,\"credential\",Ng,[X(V(),W(),\"token\")]);Z(Vg,\"credentialWithLink\",ah,[V(\"email\"),V(\"emailLink\")]);Y(Og.prototype,{Ca:{name:\"addScope\",j:[V(\"scope\")]},Ka:{name:\"setCustomParameters\",j:[W(\"customOAuthParameters\")]}});Z(Og,\"credential\",Pg,[X(V(),W(),\"token\")]);Y(Qg.prototype,{Ca:{name:\"addScope\",j:[V(\"scope\")]},Ka:{name:\"setCustomParameters\",j:[W(\"customOAuthParameters\")]}});\nZ(Qg,\"credential\",Rg,[X(V(),X(W(),to()),\"idToken\"),X(V(),to(),\"accessToken\",!0)]);Y(Sg.prototype,{Ka:{name:\"setCustomParameters\",j:[W(\"customOAuthParameters\")]}});Z(Sg,\"credential\",Tg,[X(V(),W(),\"token\"),V(\"secret\",!0)]);Y(Lg.prototype,{Ca:{name:\"addScope\",j:[V(\"scope\")]},credential:{name:\"credential\",j:[X(V(),X(W(),to()),\"optionsOrIdToken\"),X(V(),to(),\"accessToken\",!0)]},Ka:{name:\"setCustomParameters\",j:[W(\"customOAuthParameters\")]}});Y(Gg.prototype,{w:{name:\"toJSON\",j:[V(null,!0)]}});\nY(Ag.prototype,{w:{name:\"toJSON\",j:[V(null,!0)]}});Z(hh,\"credential\",lh,[V(\"verificationId\"),V(\"verificationCode\")]);\nY(hh.prototype,{eb:{name:\"verifyPhoneNumber\",j:[X(V(),function(a,b){return{name:a||\"phoneInfoOptions\",J:\"valid phone info options\",optional:!!b,K:function(c){return c?c.session&&c.phoneNumber?Ao(c.session,vg)&&\"string\"===typeof c.phoneNumber:c.session&&c.multiFactorHint?Ao(c.session,wg)&&Bo(c.multiFactorHint):c.session&&c.multiFactorUid?Ao(c.session,wg)&&\"string\"===typeof c.multiFactorUid:c.phoneNumber?\"string\"===typeof c.phoneNumber:!1:!1}}}(),\"phoneInfoOptions\"),Co()]}});\nY(ch.prototype,{w:{name:\"toJSON\",j:[V(null,!0)]}});Y(t.prototype,{toJSON:{name:\"toJSON\",j:[V(null,!0)]}});Y(uh.prototype,{toJSON:{name:\"toJSON\",j:[V(null,!0)]}});Y(th.prototype,{toJSON:{name:\"toJSON\",j:[V(null,!0)]}});Y(gm.prototype,{toJSON:{name:\"toJSON\",j:[V(null,!0)]}});Y(dm.prototype,{Qc:{name:\"resolveSignIn\",j:[yo()]}});\nY(om.prototype,{Qb:{name:\"getSession\",j:[]},ec:{name:\"enroll\",j:[yo(),V(\"displayName\",!0)]},ad:{name:\"unenroll\",j:[X({name:\"multiFactorInfo\",J:\"a valid multiFactorInfo\",optional:!1,K:Bo},V(),\"multiFactorInfoIdentifier\")]}});Y(oo.prototype,{clear:{name:\"clear\",j:[]},render:{name:\"render\",j:[]},verify:{name:\"verify\",j:[]}});Z(Ff,\"parseLink\",Nf,[V(\"link\")]);Z(Yn,\"assertion\",function(a){return new mm(a)},[xo(\"phone\")]);\n(function(){if(\"undefined\"!==typeof firebase&&firebase.INTERNAL&&firebase.INTERNAL.registerComponent){var a={ActionCodeInfo:{Operation:{EMAIL_SIGNIN:wf,PASSWORD_RESET:\"PASSWORD_RESET\",RECOVER_EMAIL:\"RECOVER_EMAIL\",REVERT_SECOND_FACTOR_ADDITION:yf,VERIFY_AND_CHANGE_EMAIL:xf,VERIFY_EMAIL:\"VERIFY_EMAIL\"}},Auth:zn,AuthCredential:xg,Error:t};Z(a,\"EmailAuthProvider\",Vg,[]);Z(a,\"FacebookAuthProvider\",Mg,[]);Z(a,\"GithubAuthProvider\",Og,[]);Z(a,\"GoogleAuthProvider\",Qg,[]);Z(a,\"TwitterAuthProvider\",Sg,[]);\nZ(a,\"OAuthProvider\",Lg,[V(\"providerId\")]);Z(a,\"SAMLAuthProvider\",Kg,[V(\"providerId\")]);Z(a,\"PhoneAuthProvider\",hh,[vo()]);Z(a,\"RecaptchaVerifier\",oo,[X(V(),uo(),\"recaptchaContainer\"),W(\"recaptchaParameters\",!0),wo()]);Z(a,\"ActionCodeURL\",Ff,[]);Z(a,\"PhoneMultiFactorGenerator\",Yn,[]);firebase.INTERNAL.registerComponent({name:\"auth\",instanceFactory:function(b){b=b.getProvider(\"app\").getImmediate();return new zn(b)},multipleInstances:!1,serviceProps:a,instantiationMode:\"LAZY\",type:\"PUBLIC\"});firebase.INTERNAL.registerComponent({name:\"auth-internal\",\ninstanceFactory:function(b){b=b.getProvider(\"auth\").getImmediate();return{getUid:q(b.getUid,b),getToken:q(b.mc,b),addAuthTokenListener:q(b.cc,b),removeAuthTokenListener:q(b.Oc,b)}},multipleInstances:!1,instantiationMode:\"LAZY\",type:\"PRIVATE\"});firebase.registerVersion(\"@firebase/auth\",\"0.15.1\");firebase.INTERNAL.extendNamespace({User:Dm})}else throw Error(\"Cannot find the firebase namespace; be sure to include firebase-app.js before this library.\");})();}).apply(typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : {});\n\n//# sourceMappingURL=auth.esm.js.map\n","import { __assign, __values, __read, __awaiter, __generator, __spread } from 'tslib';\nimport { Deferred } from '@firebase/util';\n\n/**\r\n * Component for service name T, e.g. `auth`, `auth-internal`\r\n */\r\nvar Component = /** @class */ (function () {\r\n /**\r\n *\r\n * @param name The public service name, e.g. app, auth, firestore, database\r\n * @param instanceFactory Service factory responsible for creating the public interface\r\n * @param type whether the service provided by the component is public or private\r\n */\r\n function Component(name, instanceFactory, type) {\r\n this.name = name;\r\n this.instanceFactory = instanceFactory;\r\n this.type = type;\r\n this.multipleInstances = false;\r\n /**\r\n * Properties to be added to the service namespace\r\n */\r\n this.serviceProps = {};\r\n this.instantiationMode = \"LAZY\" /* LAZY */;\r\n }\r\n Component.prototype.setInstantiationMode = function (mode) {\r\n this.instantiationMode = mode;\r\n return this;\r\n };\r\n Component.prototype.setMultipleInstances = function (multipleInstances) {\r\n this.multipleInstances = multipleInstances;\r\n return this;\r\n };\r\n Component.prototype.setServiceProps = function (props) {\r\n this.serviceProps = props;\r\n return this;\r\n };\r\n return Component;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DEFAULT_ENTRY_NAME = '[DEFAULT]';\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Provider for instance for service name T, e.g. 'auth', 'auth-internal'\r\n * NameServiceMapping[T] is an alias for the type of the instance\r\n */\r\nvar Provider = /** @class */ (function () {\r\n function Provider(name, container) {\r\n this.name = name;\r\n this.container = container;\r\n this.component = null;\r\n this.instances = new Map();\r\n this.instancesDeferred = new Map();\r\n }\r\n /**\r\n * @param identifier A provider can provide mulitple instances of a service\r\n * if this.component.multipleInstances is true.\r\n */\r\n Provider.prototype.get = function (identifier) {\r\n if (identifier === void 0) { identifier = DEFAULT_ENTRY_NAME; }\r\n // if multipleInstances is not supported, use the default name\r\n var normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\r\n if (!this.instancesDeferred.has(normalizedIdentifier)) {\r\n var deferred = new Deferred();\r\n this.instancesDeferred.set(normalizedIdentifier, deferred);\r\n // If the service instance is available, resolve the promise with it immediately\r\n try {\r\n var instance = this.getOrInitializeService(normalizedIdentifier);\r\n if (instance) {\r\n deferred.resolve(instance);\r\n }\r\n }\r\n catch (e) {\r\n // when the instance factory throws an exception during get(), it should not cause\r\n // a fatal error. We just return the unresolved promise in this case.\r\n }\r\n }\r\n return this.instancesDeferred.get(normalizedIdentifier).promise;\r\n };\r\n Provider.prototype.getImmediate = function (options) {\r\n var _a = __assign({ identifier: DEFAULT_ENTRY_NAME, optional: false }, options), identifier = _a.identifier, optional = _a.optional;\r\n // if multipleInstances is not supported, use the default name\r\n var normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\r\n try {\r\n var instance = this.getOrInitializeService(normalizedIdentifier);\r\n if (!instance) {\r\n if (optional) {\r\n return null;\r\n }\r\n throw Error(\"Service \" + this.name + \" is not available\");\r\n }\r\n return instance;\r\n }\r\n catch (e) {\r\n if (optional) {\r\n return null;\r\n }\r\n else {\r\n throw e;\r\n }\r\n }\r\n };\r\n Provider.prototype.getComponent = function () {\r\n return this.component;\r\n };\r\n Provider.prototype.setComponent = function (component) {\r\n var e_1, _a;\r\n if (component.name !== this.name) {\r\n throw Error(\"Mismatching Component \" + component.name + \" for Provider \" + this.name + \".\");\r\n }\r\n if (this.component) {\r\n throw Error(\"Component for \" + this.name + \" has already been provided\");\r\n }\r\n this.component = component;\r\n // if the service is eager, initialize the default instance\r\n if (isComponentEager(component)) {\r\n try {\r\n this.getOrInitializeService(DEFAULT_ENTRY_NAME);\r\n }\r\n catch (e) {\r\n // when the instance factory for an eager Component throws an exception during the eager\r\n // initialization, it should not cause a fatal error.\r\n // TODO: Investigate if we need to make it configurable, because some component may want to cause\r\n // a fatal error in this case?\r\n }\r\n }\r\n try {\r\n // Create service instances for the pending promises and resolve them\r\n // NOTE: if this.multipleInstances is false, only the default instance will be created\r\n // and all promises with resolve with it regardless of the identifier.\r\n for (var _b = __values(this.instancesDeferred.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var _d = __read(_c.value, 2), instanceIdentifier = _d[0], instanceDeferred = _d[1];\r\n var normalizedIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\r\n try {\r\n // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy.\r\n var instance = this.getOrInitializeService(normalizedIdentifier);\r\n instanceDeferred.resolve(instance);\r\n }\r\n catch (e) {\r\n // when the instance factory throws an exception, it should not cause\r\n // a fatal error. We just leave the promise unresolved.\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n };\r\n Provider.prototype.clearInstance = function (identifier) {\r\n if (identifier === void 0) { identifier = DEFAULT_ENTRY_NAME; }\r\n this.instancesDeferred.delete(identifier);\r\n this.instances.delete(identifier);\r\n };\r\n // app.delete() will call this method on every provider to delete the services\r\n // TODO: should we mark the provider as deleted?\r\n Provider.prototype.delete = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var services;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n services = Array.from(this.instances.values());\r\n return [4 /*yield*/, Promise.all(__spread(services\r\n .filter(function (service) { return 'INTERNAL' in service; }) // legacy services\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map(function (service) { return service.INTERNAL.delete(); }), services\r\n .filter(function (service) { return '_delete' in service; }) // modularized services\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map(function (service) { return service._delete(); })))];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n Provider.prototype.isComponentSet = function () {\r\n return this.component != null;\r\n };\r\n Provider.prototype.getOrInitializeService = function (identifier) {\r\n var instance = this.instances.get(identifier);\r\n if (!instance && this.component) {\r\n instance = this.component.instanceFactory(this.container, normalizeIdentifierForFactory(identifier));\r\n this.instances.set(identifier, instance);\r\n }\r\n return instance || null;\r\n };\r\n Provider.prototype.normalizeInstanceIdentifier = function (identifier) {\r\n if (this.component) {\r\n return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME;\r\n }\r\n else {\r\n return identifier; // assume multiple instances are supported before the component is provided.\r\n }\r\n };\r\n return Provider;\r\n}());\r\n// undefined should be passed to the service factory for the default instance\r\nfunction normalizeIdentifierForFactory(identifier) {\r\n return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier;\r\n}\r\nfunction isComponentEager(component) {\r\n return component.instantiationMode === \"EAGER\" /* EAGER */;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`\r\n */\r\nvar ComponentContainer = /** @class */ (function () {\r\n function ComponentContainer(name) {\r\n this.name = name;\r\n this.providers = new Map();\r\n }\r\n /**\r\n *\r\n * @param component Component being added\r\n * @param overwrite When a component with the same name has already been registered,\r\n * if overwrite is true: overwrite the existing component with the new component and create a new\r\n * provider with the new component. It can be useful in tests where you want to use different mocks\r\n * for different tests.\r\n * if overwrite is false: throw an exception\r\n */\r\n ComponentContainer.prototype.addComponent = function (component) {\r\n var provider = this.getProvider(component.name);\r\n if (provider.isComponentSet()) {\r\n throw new Error(\"Component \" + component.name + \" has already been registered with \" + this.name);\r\n }\r\n provider.setComponent(component);\r\n };\r\n ComponentContainer.prototype.addOrOverwriteComponent = function (component) {\r\n var provider = this.getProvider(component.name);\r\n if (provider.isComponentSet()) {\r\n // delete the existing provider from the container, so we can register the new component\r\n this.providers.delete(component.name);\r\n }\r\n this.addComponent(component);\r\n };\r\n /**\r\n * getProvider provides a type safe interface where it can only be called with a field name\r\n * present in NameServiceMapping interface.\r\n *\r\n * Firebase SDKs providing services should extend NameServiceMapping interface to register\r\n * themselves.\r\n */\r\n ComponentContainer.prototype.getProvider = function (name) {\r\n if (this.providers.has(name)) {\r\n return this.providers.get(name);\r\n }\r\n // create a Provider for a service that hasn't registered with Firebase\r\n var provider = new Provider(name, this);\r\n this.providers.set(name, provider);\r\n return provider;\r\n };\r\n ComponentContainer.prototype.getProviders = function () {\r\n return Array.from(this.providers.values());\r\n };\r\n return ComponentContainer;\r\n}());\n\nexport { Component, ComponentContainer, Provider };\n//# sourceMappingURL=index.esm.js.map\n","import firebase from '@firebase/app';\nimport { __spread, __values, __extends, __assign, __read, __awaiter, __generator } from 'tslib';\nimport { stringify, jsonEval, contains, assert, base64, stringToByteArray, Sha1, isNodeSdk, stringLength, errorPrefix, validateArgCount, validateCallback, Deferred, assertionError, safeGet, map, validateContextObject, deepCopy, isMobileCordova, base64Encode, isAdmin, isValidFormat, isEmpty, isReactNative, querystring } from '@firebase/util';\nimport { Logger, LogLevel } from '@firebase/logger';\nimport { Provider, ComponentContainer, Component } from '@firebase/component';\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Wraps a DOM Storage object and:\r\n * - automatically encode objects as JSON strings before storing them to allow us to store arbitrary types.\r\n * - prefixes names with \"firebase:\" to avoid collisions with app data.\r\n *\r\n * We automatically (see storage.js) create two such wrappers, one for sessionStorage,\r\n * and one for localStorage.\r\n *\r\n * @constructor\r\n */\r\nvar DOMStorageWrapper = /** @class */ (function () {\r\n /**\r\n * @param {Storage} domStorage_ The underlying storage object (e.g. localStorage or sessionStorage)\r\n */\r\n function DOMStorageWrapper(domStorage_) {\r\n this.domStorage_ = domStorage_;\r\n // Use a prefix to avoid collisions with other stuff saved by the app.\r\n this.prefix_ = 'firebase:';\r\n }\r\n /**\r\n * @param {string} key The key to save the value under\r\n * @param {?Object} value The value being stored, or null to remove the key.\r\n */\r\n DOMStorageWrapper.prototype.set = function (key, value) {\r\n if (value == null) {\r\n this.domStorage_.removeItem(this.prefixedName_(key));\r\n }\r\n else {\r\n this.domStorage_.setItem(this.prefixedName_(key), stringify(value));\r\n }\r\n };\r\n /**\r\n * @param {string} key\r\n * @return {*} The value that was stored under this key, or null\r\n */\r\n DOMStorageWrapper.prototype.get = function (key) {\r\n var storedVal = this.domStorage_.getItem(this.prefixedName_(key));\r\n if (storedVal == null) {\r\n return null;\r\n }\r\n else {\r\n return jsonEval(storedVal);\r\n }\r\n };\r\n /**\r\n * @param {string} key\r\n */\r\n DOMStorageWrapper.prototype.remove = function (key) {\r\n this.domStorage_.removeItem(this.prefixedName_(key));\r\n };\r\n /**\r\n * @param {string} name\r\n * @return {string}\r\n */\r\n DOMStorageWrapper.prototype.prefixedName_ = function (name) {\r\n return this.prefix_ + name;\r\n };\r\n DOMStorageWrapper.prototype.toString = function () {\r\n return this.domStorage_.toString();\r\n };\r\n return DOMStorageWrapper;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An in-memory storage implementation that matches the API of DOMStorageWrapper\r\n * (TODO: create interface for both to implement).\r\n *\r\n * @constructor\r\n */\r\nvar MemoryStorage = /** @class */ (function () {\r\n function MemoryStorage() {\r\n this.cache_ = {};\r\n this.isInMemoryStorage = true;\r\n }\r\n MemoryStorage.prototype.set = function (key, value) {\r\n if (value == null) {\r\n delete this.cache_[key];\r\n }\r\n else {\r\n this.cache_[key] = value;\r\n }\r\n };\r\n MemoryStorage.prototype.get = function (key) {\r\n if (contains(this.cache_, key)) {\r\n return this.cache_[key];\r\n }\r\n return null;\r\n };\r\n MemoryStorage.prototype.remove = function (key) {\r\n delete this.cache_[key];\r\n };\r\n return MemoryStorage;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Helper to create a DOMStorageWrapper or else fall back to MemoryStorage.\r\n * TODO: Once MemoryStorage and DOMStorageWrapper have a shared interface this method annotation should change\r\n * to reflect this type\r\n *\r\n * @param {string} domStorageName Name of the underlying storage object\r\n * (e.g. 'localStorage' or 'sessionStorage').\r\n * @return {?} Turning off type information until a common interface is defined.\r\n */\r\nvar createStoragefor = function (domStorageName) {\r\n try {\r\n // NOTE: just accessing \"localStorage\" or \"window['localStorage']\" may throw a security exception,\r\n // so it must be inside the try/catch.\r\n if (typeof window !== 'undefined' &&\r\n typeof window[domStorageName] !== 'undefined') {\r\n // Need to test cache. Just because it's here doesn't mean it works\r\n var domStorage = window[domStorageName];\r\n domStorage.setItem('firebase:sentinel', 'cache');\r\n domStorage.removeItem('firebase:sentinel');\r\n return new DOMStorageWrapper(domStorage);\r\n }\r\n }\r\n catch (e) { }\r\n // Failed to create wrapper. Just return in-memory storage.\r\n // TODO: log?\r\n return new MemoryStorage();\r\n};\r\n/** A storage object that lasts across sessions */\r\nvar PersistentStorage = createStoragefor('localStorage');\r\n/** A storage object that only lasts one session */\r\nvar SessionStorage = createStoragefor('sessionStorage');\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar logClient = new Logger('@firebase/database');\r\n/**\r\n * Returns a locally-unique ID (generated by just incrementing up from 0 each time its called).\r\n * @type {function(): number} Generated ID.\r\n */\r\nvar LUIDGenerator = (function () {\r\n var id = 1;\r\n return function () {\r\n return id++;\r\n };\r\n})();\r\n/**\r\n * Sha1 hash of the input string\r\n * @param {!string} str The string to hash\r\n * @return {!string} The resulting hash\r\n */\r\nvar sha1 = function (str) {\r\n var utf8Bytes = stringToByteArray(str);\r\n var sha1 = new Sha1();\r\n sha1.update(utf8Bytes);\r\n var sha1Bytes = sha1.digest();\r\n return base64.encodeByteArray(sha1Bytes);\r\n};\r\n/**\r\n * @param {...*} varArgs\r\n * @return {string}\r\n * @private\r\n */\r\nvar buildLogMessage_ = function () {\r\n var varArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n varArgs[_i] = arguments[_i];\r\n }\r\n var message = '';\r\n for (var i = 0; i < varArgs.length; i++) {\r\n var arg = varArgs[i];\r\n if (Array.isArray(arg) ||\r\n (arg &&\r\n typeof arg === 'object' &&\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n typeof arg.length === 'number')) {\r\n message += buildLogMessage_.apply(null, arg);\r\n }\r\n else if (typeof arg === 'object') {\r\n message += stringify(arg);\r\n }\r\n else {\r\n message += arg;\r\n }\r\n message += ' ';\r\n }\r\n return message;\r\n};\r\n/**\r\n * Use this for all debug messages in Firebase.\r\n * @type {?function(string)}\r\n */\r\nvar logger = null;\r\n/**\r\n * Flag to check for log availability on first log message\r\n * @type {boolean}\r\n * @private\r\n */\r\nvar firstLog_ = true;\r\n/**\r\n * The implementation of Firebase.enableLogging (defined here to break dependencies)\r\n * @param {boolean|?function(string)} logger_ A flag to turn on logging, or a custom logger\r\n * @param {boolean=} persistent Whether or not to persist logging settings across refreshes\r\n */\r\nvar enableLogging = function (logger_, persistent) {\r\n assert(!persistent || logger_ === true || logger_ === false, \"Can't turn on custom loggers persistently.\");\r\n if (logger_ === true) {\r\n logClient.logLevel = LogLevel.VERBOSE;\r\n logger = logClient.log.bind(logClient);\r\n if (persistent) {\r\n SessionStorage.set('logging_enabled', true);\r\n }\r\n }\r\n else if (typeof logger_ === 'function') {\r\n logger = logger_;\r\n }\r\n else {\r\n logger = null;\r\n SessionStorage.remove('logging_enabled');\r\n }\r\n};\r\n/**\r\n *\r\n * @param {...(string|Arguments)} varArgs\r\n */\r\nvar log = function () {\r\n var varArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n varArgs[_i] = arguments[_i];\r\n }\r\n if (firstLog_ === true) {\r\n firstLog_ = false;\r\n if (logger === null && SessionStorage.get('logging_enabled') === true) {\r\n enableLogging(true);\r\n }\r\n }\r\n if (logger) {\r\n var message = buildLogMessage_.apply(null, varArgs);\r\n logger(message);\r\n }\r\n};\r\n/**\r\n * @param {!string} prefix\r\n * @return {function(...[*])}\r\n */\r\nvar logWrapper = function (prefix) {\r\n return function () {\r\n var varArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n varArgs[_i] = arguments[_i];\r\n }\r\n log.apply(void 0, __spread([prefix], varArgs));\r\n };\r\n};\r\n/**\r\n * @param {...string} varArgs\r\n */\r\nvar error = function () {\r\n var varArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n varArgs[_i] = arguments[_i];\r\n }\r\n var message = 'FIREBASE INTERNAL ERROR: ' + buildLogMessage_.apply(void 0, __spread(varArgs));\r\n logClient.error(message);\r\n};\r\n/**\r\n * @param {...string} varArgs\r\n */\r\nvar fatal = function () {\r\n var varArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n varArgs[_i] = arguments[_i];\r\n }\r\n var message = \"FIREBASE FATAL ERROR: \" + buildLogMessage_.apply(void 0, __spread(varArgs));\r\n logClient.error(message);\r\n throw new Error(message);\r\n};\r\n/**\r\n * @param {...*} varArgs\r\n */\r\nvar warn = function () {\r\n var varArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n varArgs[_i] = arguments[_i];\r\n }\r\n var message = 'FIREBASE WARNING: ' + buildLogMessage_.apply(void 0, __spread(varArgs));\r\n logClient.warn(message);\r\n};\r\n/**\r\n * Logs a warning if the containing page uses https. Called when a call to new Firebase\r\n * does not use https.\r\n */\r\nvar warnIfPageIsSecure = function () {\r\n // Be very careful accessing browser globals. Who knows what may or may not exist.\r\n if (typeof window !== 'undefined' &&\r\n window.location &&\r\n window.location.protocol &&\r\n window.location.protocol.indexOf('https:') !== -1) {\r\n warn('Insecure Firebase access from a secure page. ' +\r\n 'Please use https in calls to new Firebase().');\r\n }\r\n};\r\n/**\r\n * Returns true if data is NaN, or +/- Infinity.\r\n * @param {*} data\r\n * @return {boolean}\r\n */\r\nvar isInvalidJSONNumber = function (data) {\r\n return (typeof data === 'number' &&\r\n (data !== data || // NaN\r\n data === Number.POSITIVE_INFINITY ||\r\n data === Number.NEGATIVE_INFINITY));\r\n};\r\n/**\r\n * @param {function()} fn\r\n */\r\nvar executeWhenDOMReady = function (fn) {\r\n if (isNodeSdk() || document.readyState === 'complete') {\r\n fn();\r\n }\r\n else {\r\n // Modeled after jQuery. Try DOMContentLoaded and onreadystatechange (which\r\n // fire before onload), but fall back to onload.\r\n var called_1 = false;\r\n var wrappedFn_1 = function () {\r\n if (!document.body) {\r\n setTimeout(wrappedFn_1, Math.floor(10));\r\n return;\r\n }\r\n if (!called_1) {\r\n called_1 = true;\r\n fn();\r\n }\r\n };\r\n if (document.addEventListener) {\r\n document.addEventListener('DOMContentLoaded', wrappedFn_1, false);\r\n // fallback to onload.\r\n window.addEventListener('load', wrappedFn_1, false);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n }\r\n else if (document.attachEvent) {\r\n // IE.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n document.attachEvent('onreadystatechange', function () {\r\n if (document.readyState === 'complete') {\r\n wrappedFn_1();\r\n }\r\n });\r\n // fallback to onload.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n window.attachEvent('onload', wrappedFn_1);\r\n // jQuery has an extra hack for IE that we could employ (based on\r\n // http://javascript.nwbox.com/IEContentLoaded/) But it looks really old.\r\n // I'm hoping we don't need it.\r\n }\r\n }\r\n};\r\n/**\r\n * Minimum key name. Invalid for actual data, used as a marker to sort before any valid names\r\n * @type {!string}\r\n */\r\nvar MIN_NAME = '[MIN_NAME]';\r\n/**\r\n * Maximum key name. Invalid for actual data, used as a marker to sort above any valid names\r\n * @type {!string}\r\n */\r\nvar MAX_NAME = '[MAX_NAME]';\r\n/**\r\n * Compares valid Firebase key names, plus min and max name\r\n * @param {!string} a\r\n * @param {!string} b\r\n * @return {!number}\r\n */\r\nvar nameCompare = function (a, b) {\r\n if (a === b) {\r\n return 0;\r\n }\r\n else if (a === MIN_NAME || b === MAX_NAME) {\r\n return -1;\r\n }\r\n else if (b === MIN_NAME || a === MAX_NAME) {\r\n return 1;\r\n }\r\n else {\r\n var aAsInt = tryParseInt(a), bAsInt = tryParseInt(b);\r\n if (aAsInt !== null) {\r\n if (bAsInt !== null) {\r\n return aAsInt - bAsInt === 0 ? a.length - b.length : aAsInt - bAsInt;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n else if (bAsInt !== null) {\r\n return 1;\r\n }\r\n else {\r\n return a < b ? -1 : 1;\r\n }\r\n }\r\n};\r\n/**\r\n * @param {!string} a\r\n * @param {!string} b\r\n * @return {!number} comparison result.\r\n */\r\nvar stringCompare = function (a, b) {\r\n if (a === b) {\r\n return 0;\r\n }\r\n else if (a < b) {\r\n return -1;\r\n }\r\n else {\r\n return 1;\r\n }\r\n};\r\n/**\r\n * @param {string} key\r\n * @param {Object} obj\r\n * @return {*}\r\n */\r\nvar requireKey = function (key, obj) {\r\n if (obj && key in obj) {\r\n return obj[key];\r\n }\r\n else {\r\n throw new Error('Missing required key (' + key + ') in object: ' + stringify(obj));\r\n }\r\n};\r\n/**\r\n * @param {*} obj\r\n * @return {string}\r\n */\r\nvar ObjectToUniqueKey = function (obj) {\r\n if (typeof obj !== 'object' || obj === null) {\r\n return stringify(obj);\r\n }\r\n var keys = [];\r\n // eslint-disable-next-line guard-for-in\r\n for (var k in obj) {\r\n keys.push(k);\r\n }\r\n // Export as json, but with the keys sorted.\r\n keys.sort();\r\n var key = '{';\r\n for (var i = 0; i < keys.length; i++) {\r\n if (i !== 0) {\r\n key += ',';\r\n }\r\n key += stringify(keys[i]);\r\n key += ':';\r\n key += ObjectToUniqueKey(obj[keys[i]]);\r\n }\r\n key += '}';\r\n return key;\r\n};\r\n/**\r\n * Splits a string into a number of smaller segments of maximum size\r\n * @param {!string} str The string\r\n * @param {!number} segsize The maximum number of chars in the string.\r\n * @return {Array.<string>} The string, split into appropriately-sized chunks\r\n */\r\nvar splitStringBySize = function (str, segsize) {\r\n var len = str.length;\r\n if (len <= segsize) {\r\n return [str];\r\n }\r\n var dataSegs = [];\r\n for (var c = 0; c < len; c += segsize) {\r\n if (c + segsize > len) {\r\n dataSegs.push(str.substring(c, len));\r\n }\r\n else {\r\n dataSegs.push(str.substring(c, c + segsize));\r\n }\r\n }\r\n return dataSegs;\r\n};\r\n/**\r\n * Apply a function to each (key, value) pair in an object or\r\n * apply a function to each (index, value) pair in an array\r\n * @param obj The object or array to iterate over\r\n * @param fn The function to apply\r\n */\r\nfunction each(obj, fn) {\r\n for (var key in obj) {\r\n if (obj.hasOwnProperty(key)) {\r\n fn(key, obj[key]);\r\n }\r\n }\r\n}\r\n/**\r\n * Borrowed from http://hg.secondlife.com/llsd/src/tip/js/typedarray.js (MIT License)\r\n * I made one modification at the end and removed the NaN / Infinity\r\n * handling (since it seemed broken [caused an overflow] and we don't need it). See MJL comments.\r\n * @param {!number} v A double\r\n * @return {string}\r\n */\r\nvar doubleToIEEE754String = function (v) {\r\n assert(!isInvalidJSONNumber(v), 'Invalid JSON number'); // MJL\r\n var ebits = 11, fbits = 52;\r\n var bias = (1 << (ebits - 1)) - 1;\r\n var s, e, f, ln, i;\r\n // Compute sign, exponent, fraction\r\n // Skip NaN / Infinity handling --MJL.\r\n if (v === 0) {\r\n e = 0;\r\n f = 0;\r\n s = 1 / v === -Infinity ? 1 : 0;\r\n }\r\n else {\r\n s = v < 0;\r\n v = Math.abs(v);\r\n if (v >= Math.pow(2, 1 - bias)) {\r\n // Normalized\r\n ln = Math.min(Math.floor(Math.log(v) / Math.LN2), bias);\r\n e = ln + bias;\r\n f = Math.round(v * Math.pow(2, fbits - ln) - Math.pow(2, fbits));\r\n }\r\n else {\r\n // Denormalized\r\n e = 0;\r\n f = Math.round(v / Math.pow(2, 1 - bias - fbits));\r\n }\r\n }\r\n // Pack sign, exponent, fraction\r\n var bits = [];\r\n for (i = fbits; i; i -= 1) {\r\n bits.push(f % 2 ? 1 : 0);\r\n f = Math.floor(f / 2);\r\n }\r\n for (i = ebits; i; i -= 1) {\r\n bits.push(e % 2 ? 1 : 0);\r\n e = Math.floor(e / 2);\r\n }\r\n bits.push(s ? 1 : 0);\r\n bits.reverse();\r\n var str = bits.join('');\r\n // Return the data as a hex string. --MJL\r\n var hexByteString = '';\r\n for (i = 0; i < 64; i += 8) {\r\n var hexByte = parseInt(str.substr(i, 8), 2).toString(16);\r\n if (hexByte.length === 1) {\r\n hexByte = '0' + hexByte;\r\n }\r\n hexByteString = hexByteString + hexByte;\r\n }\r\n return hexByteString.toLowerCase();\r\n};\r\n/**\r\n * Used to detect if we're in a Chrome content script (which executes in an\r\n * isolated environment where long-polling doesn't work).\r\n * @return {boolean}\r\n */\r\nvar isChromeExtensionContentScript = function () {\r\n return !!(typeof window === 'object' &&\r\n window['chrome'] &&\r\n window['chrome']['extension'] &&\r\n !/^chrome/.test(window.location.href));\r\n};\r\n/**\r\n * Used to detect if we're in a Windows 8 Store app.\r\n * @return {boolean}\r\n */\r\nvar isWindowsStoreApp = function () {\r\n // Check for the presence of a couple WinRT globals\r\n return typeof Windows === 'object' && typeof Windows.UI === 'object';\r\n};\r\n/**\r\n * Converts a server error code to a Javascript Error\r\n * @param {!string} code\r\n * @param {!Query} query\r\n * @return {Error}\r\n */\r\nvar errorForServerCode = function (code, query) {\r\n var reason = 'Unknown Error';\r\n if (code === 'too_big') {\r\n reason =\r\n 'The data requested exceeds the maximum size ' +\r\n 'that can be accessed with a single request.';\r\n }\r\n else if (code === 'permission_denied') {\r\n reason = \"Client doesn't have permission to access the desired data.\";\r\n }\r\n else if (code === 'unavailable') {\r\n reason = 'The service is unavailable';\r\n }\r\n var error = new Error(code + ' at ' + query.path.toString() + ': ' + reason);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n error.code = code.toUpperCase();\r\n return error;\r\n};\r\n/**\r\n * Used to test for integer-looking strings\r\n * @type {RegExp}\r\n * @private\r\n */\r\nvar INTEGER_REGEXP_ = new RegExp('^-?(0*)\\\\d{1,10}$');\r\n/**\r\n * If the string contains a 32-bit integer, return it. Else return null.\r\n * @param {!string} str\r\n * @return {?number}\r\n */\r\nvar tryParseInt = function (str) {\r\n if (INTEGER_REGEXP_.test(str)) {\r\n var intVal = Number(str);\r\n if (intVal >= -2147483648 && intVal <= 2147483647) {\r\n return intVal;\r\n }\r\n }\r\n return null;\r\n};\r\n/**\r\n * Helper to run some code but catch any exceptions and re-throw them later.\r\n * Useful for preventing user callbacks from breaking internal code.\r\n *\r\n * Re-throwing the exception from a setTimeout is a little evil, but it's very\r\n * convenient (we don't have to try to figure out when is a safe point to\r\n * re-throw it), and the behavior seems reasonable:\r\n *\r\n * * If you aren't pausing on exceptions, you get an error in the console with\r\n * the correct stack trace.\r\n * * If you're pausing on all exceptions, the debugger will pause on your\r\n * exception and then again when we rethrow it.\r\n * * If you're only pausing on uncaught exceptions, the debugger will only pause\r\n * on us re-throwing it.\r\n *\r\n * @param {!function()} fn The code to guard.\r\n */\r\nvar exceptionGuard = function (fn) {\r\n try {\r\n fn();\r\n }\r\n catch (e) {\r\n // Re-throw exception when it's safe.\r\n setTimeout(function () {\r\n // It used to be that \"throw e\" would result in a good console error with\r\n // relevant context, but as of Chrome 39, you just get the firebase.js\r\n // file/line number where we re-throw it, which is useless. So we log\r\n // e.stack explicitly.\r\n var stack = e.stack || '';\r\n warn('Exception was thrown by user callback.', stack);\r\n throw e;\r\n }, Math.floor(0));\r\n }\r\n};\r\n/**\r\n * @return {boolean} true if we think we're currently being crawled.\r\n */\r\nvar beingCrawled = function () {\r\n var userAgent = (typeof window === 'object' &&\r\n window['navigator'] &&\r\n window['navigator']['userAgent']) ||\r\n '';\r\n // For now we whitelist the most popular crawlers. We should refine this to be the set of crawlers we\r\n // believe to support JavaScript/AJAX rendering.\r\n // NOTE: Google Webmaster Tools doesn't really belong, but their \"This is how a visitor to your website\r\n // would have seen the page\" is flaky if we don't treat it as a crawler.\r\n return (userAgent.search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i) >= 0);\r\n};\r\n/**\r\n * Same as setTimeout() except on Node.JS it will /not/ prevent the process from exiting.\r\n *\r\n * It is removed with clearTimeout() as normal.\r\n *\r\n * @param {Function} fn Function to run.\r\n * @param {number} time Milliseconds to wait before running.\r\n * @return {number|Object} The setTimeout() return value.\r\n */\r\nvar setTimeoutNonBlocking = function (fn, time) {\r\n var timeout = setTimeout(fn, time);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n if (typeof timeout === 'object' && timeout['unref']) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n timeout['unref']();\r\n }\r\n return timeout;\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An immutable object representing a parsed path. It's immutable so that you\r\n * can pass them around to other functions without worrying about them changing\r\n * it.\r\n */\r\nvar Path = /** @class */ (function () {\r\n /**\r\n * @param {string|Array.<string>} pathOrString Path string to parse,\r\n * or another path, or the raw tokens array\r\n * @param {number=} pieceNum\r\n */\r\n function Path(pathOrString, pieceNum) {\r\n if (pieceNum === void 0) {\r\n this.pieces_ = pathOrString.split('/');\r\n // Remove empty pieces.\r\n var copyTo = 0;\r\n for (var i = 0; i < this.pieces_.length; i++) {\r\n if (this.pieces_[i].length > 0) {\r\n this.pieces_[copyTo] = this.pieces_[i];\r\n copyTo++;\r\n }\r\n }\r\n this.pieces_.length = copyTo;\r\n this.pieceNum_ = 0;\r\n }\r\n else {\r\n this.pieces_ = pathOrString;\r\n this.pieceNum_ = pieceNum;\r\n }\r\n }\r\n Object.defineProperty(Path, \"Empty\", {\r\n /**\r\n * Singleton to represent an empty path\r\n *\r\n * @const\r\n */\r\n get: function () {\r\n return new Path('');\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Path.prototype.getFront = function () {\r\n if (this.pieceNum_ >= this.pieces_.length) {\r\n return null;\r\n }\r\n return this.pieces_[this.pieceNum_];\r\n };\r\n /**\r\n * @return {number} The number of segments in this path\r\n */\r\n Path.prototype.getLength = function () {\r\n return this.pieces_.length - this.pieceNum_;\r\n };\r\n /**\r\n * @return {!Path}\r\n */\r\n Path.prototype.popFront = function () {\r\n var pieceNum = this.pieceNum_;\r\n if (pieceNum < this.pieces_.length) {\r\n pieceNum++;\r\n }\r\n return new Path(this.pieces_, pieceNum);\r\n };\r\n /**\r\n * @return {?string}\r\n */\r\n Path.prototype.getBack = function () {\r\n if (this.pieceNum_ < this.pieces_.length) {\r\n return this.pieces_[this.pieces_.length - 1];\r\n }\r\n return null;\r\n };\r\n Path.prototype.toString = function () {\r\n var pathString = '';\r\n for (var i = this.pieceNum_; i < this.pieces_.length; i++) {\r\n if (this.pieces_[i] !== '') {\r\n pathString += '/' + this.pieces_[i];\r\n }\r\n }\r\n return pathString || '/';\r\n };\r\n Path.prototype.toUrlEncodedString = function () {\r\n var pathString = '';\r\n for (var i = this.pieceNum_; i < this.pieces_.length; i++) {\r\n if (this.pieces_[i] !== '') {\r\n pathString += '/' + encodeURIComponent(String(this.pieces_[i]));\r\n }\r\n }\r\n return pathString || '/';\r\n };\r\n /**\r\n * Shallow copy of the parts of the path.\r\n *\r\n * @param {number=} begin\r\n * @return {!Array<string>}\r\n */\r\n Path.prototype.slice = function (begin) {\r\n if (begin === void 0) { begin = 0; }\r\n return this.pieces_.slice(this.pieceNum_ + begin);\r\n };\r\n /**\r\n * @return {?Path}\r\n */\r\n Path.prototype.parent = function () {\r\n if (this.pieceNum_ >= this.pieces_.length) {\r\n return null;\r\n }\r\n var pieces = [];\r\n for (var i = this.pieceNum_; i < this.pieces_.length - 1; i++) {\r\n pieces.push(this.pieces_[i]);\r\n }\r\n return new Path(pieces, 0);\r\n };\r\n /**\r\n * @param {string|!Path} childPathObj\r\n * @return {!Path}\r\n */\r\n Path.prototype.child = function (childPathObj) {\r\n var pieces = [];\r\n for (var i = this.pieceNum_; i < this.pieces_.length; i++) {\r\n pieces.push(this.pieces_[i]);\r\n }\r\n if (childPathObj instanceof Path) {\r\n for (var i = childPathObj.pieceNum_; i < childPathObj.pieces_.length; i++) {\r\n pieces.push(childPathObj.pieces_[i]);\r\n }\r\n }\r\n else {\r\n var childPieces = childPathObj.split('/');\r\n for (var i = 0; i < childPieces.length; i++) {\r\n if (childPieces[i].length > 0) {\r\n pieces.push(childPieces[i]);\r\n }\r\n }\r\n }\r\n return new Path(pieces, 0);\r\n };\r\n /**\r\n * @return {boolean} True if there are no segments in this path\r\n */\r\n Path.prototype.isEmpty = function () {\r\n return this.pieceNum_ >= this.pieces_.length;\r\n };\r\n /**\r\n * @param {!Path} outerPath\r\n * @param {!Path} innerPath\r\n * @return {!Path} The path from outerPath to innerPath\r\n */\r\n Path.relativePath = function (outerPath, innerPath) {\r\n var outer = outerPath.getFront(), inner = innerPath.getFront();\r\n if (outer === null) {\r\n return innerPath;\r\n }\r\n else if (outer === inner) {\r\n return Path.relativePath(outerPath.popFront(), innerPath.popFront());\r\n }\r\n else {\r\n throw new Error('INTERNAL ERROR: innerPath (' +\r\n innerPath +\r\n ') is not within ' +\r\n 'outerPath (' +\r\n outerPath +\r\n ')');\r\n }\r\n };\r\n /**\r\n * @param {!Path} left\r\n * @param {!Path} right\r\n * @return {number} -1, 0, 1 if left is less, equal, or greater than the right.\r\n */\r\n Path.comparePaths = function (left, right) {\r\n var leftKeys = left.slice();\r\n var rightKeys = right.slice();\r\n for (var i = 0; i < leftKeys.length && i < rightKeys.length; i++) {\r\n var cmp = nameCompare(leftKeys[i], rightKeys[i]);\r\n if (cmp !== 0) {\r\n return cmp;\r\n }\r\n }\r\n if (leftKeys.length === rightKeys.length) {\r\n return 0;\r\n }\r\n return leftKeys.length < rightKeys.length ? -1 : 1;\r\n };\r\n /**\r\n *\r\n * @param {Path} other\r\n * @return {boolean} true if paths are the same.\r\n */\r\n Path.prototype.equals = function (other) {\r\n if (this.getLength() !== other.getLength()) {\r\n return false;\r\n }\r\n for (var i = this.pieceNum_, j = other.pieceNum_; i <= this.pieces_.length; i++, j++) {\r\n if (this.pieces_[i] !== other.pieces_[j]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n /**\r\n *\r\n * @param {!Path} other\r\n * @return {boolean} True if this path is a parent (or the same as) other\r\n */\r\n Path.prototype.contains = function (other) {\r\n var i = this.pieceNum_;\r\n var j = other.pieceNum_;\r\n if (this.getLength() > other.getLength()) {\r\n return false;\r\n }\r\n while (i < this.pieces_.length) {\r\n if (this.pieces_[i] !== other.pieces_[j]) {\r\n return false;\r\n }\r\n ++i;\r\n ++j;\r\n }\r\n return true;\r\n };\r\n return Path;\r\n}()); // end Path\r\n/**\r\n * Dynamic (mutable) path used to count path lengths.\r\n *\r\n * This class is used to efficiently check paths for valid\r\n * length (in UTF8 bytes) and depth (used in path validation).\r\n *\r\n * Throws Error exception if path is ever invalid.\r\n *\r\n * The definition of a path always begins with '/'.\r\n */\r\nvar ValidationPath = /** @class */ (function () {\r\n /**\r\n * @param {!Path} path Initial Path.\r\n * @param {string} errorPrefix_ Prefix for any error messages.\r\n */\r\n function ValidationPath(path, errorPrefix_) {\r\n this.errorPrefix_ = errorPrefix_;\r\n /** @type {!Array<string>} */\r\n this.parts_ = path.slice();\r\n /** @type {number} Initialize to number of '/' chars needed in path. */\r\n this.byteLength_ = Math.max(1, this.parts_.length);\r\n for (var i = 0; i < this.parts_.length; i++) {\r\n this.byteLength_ += stringLength(this.parts_[i]);\r\n }\r\n this.checkValid_();\r\n }\r\n Object.defineProperty(ValidationPath, \"MAX_PATH_DEPTH\", {\r\n /** @const {number} Maximum key depth. */\r\n get: function () {\r\n return 32;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValidationPath, \"MAX_PATH_LENGTH_BYTES\", {\r\n /** @const {number} Maximum number of (UTF8) bytes in a Firebase path. */\r\n get: function () {\r\n return 768;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /** @param {string} child */\r\n ValidationPath.prototype.push = function (child) {\r\n // Count the needed '/'\r\n if (this.parts_.length > 0) {\r\n this.byteLength_ += 1;\r\n }\r\n this.parts_.push(child);\r\n this.byteLength_ += stringLength(child);\r\n this.checkValid_();\r\n };\r\n ValidationPath.prototype.pop = function () {\r\n var last = this.parts_.pop();\r\n this.byteLength_ -= stringLength(last);\r\n // Un-count the previous '/'\r\n if (this.parts_.length > 0) {\r\n this.byteLength_ -= 1;\r\n }\r\n };\r\n ValidationPath.prototype.checkValid_ = function () {\r\n if (this.byteLength_ > ValidationPath.MAX_PATH_LENGTH_BYTES) {\r\n throw new Error(this.errorPrefix_ +\r\n 'has a key path longer than ' +\r\n ValidationPath.MAX_PATH_LENGTH_BYTES +\r\n ' bytes (' +\r\n this.byteLength_ +\r\n ').');\r\n }\r\n if (this.parts_.length > ValidationPath.MAX_PATH_DEPTH) {\r\n throw new Error(this.errorPrefix_ +\r\n 'path specified exceeds the maximum depth that can be written (' +\r\n ValidationPath.MAX_PATH_DEPTH +\r\n ') or object contains a cycle ' +\r\n this.toErrorString());\r\n }\r\n };\r\n /**\r\n * String for use in error messages - uses '.' notation for path.\r\n *\r\n * @return {string}\r\n */\r\n ValidationPath.prototype.toErrorString = function () {\r\n if (this.parts_.length === 0) {\r\n return '';\r\n }\r\n return \"in property '\" + this.parts_.join('.') + \"'\";\r\n };\r\n return ValidationPath;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar PROTOCOL_VERSION = '5';\r\nvar VERSION_PARAM = 'v';\r\nvar TRANSPORT_SESSION_PARAM = 's';\r\nvar REFERER_PARAM = 'r';\r\nvar FORGE_REF = 'f';\r\nvar FORGE_DOMAIN = 'firebaseio.com';\r\nvar LAST_SESSION_PARAM = 'ls';\r\nvar APPLICATION_ID_PARAM = 'p';\r\nvar WEBSOCKET = 'websocket';\r\nvar LONG_POLLING = 'long_polling';\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A class that holds metadata about a Repo object\r\n *\r\n * @constructor\r\n */\r\nvar RepoInfo = /** @class */ (function () {\r\n /**\r\n * @param host Hostname portion of the url for the repo\r\n * @param secure Whether or not this repo is accessed over ssl\r\n * @param namespace The namespace represented by the repo\r\n * @param webSocketOnly Whether to prefer websockets over all other transports (used by Nest).\r\n * @param nodeAdmin Whether this instance uses Admin SDK credentials\r\n * @param persistenceKey Override the default session persistence storage key\r\n */\r\n function RepoInfo(host, secure, namespace, webSocketOnly, nodeAdmin, persistenceKey, includeNamespaceInQueryParams) {\r\n if (nodeAdmin === void 0) { nodeAdmin = false; }\r\n if (persistenceKey === void 0) { persistenceKey = ''; }\r\n if (includeNamespaceInQueryParams === void 0) { includeNamespaceInQueryParams = false; }\r\n this.secure = secure;\r\n this.namespace = namespace;\r\n this.webSocketOnly = webSocketOnly;\r\n this.nodeAdmin = nodeAdmin;\r\n this.persistenceKey = persistenceKey;\r\n this.includeNamespaceInQueryParams = includeNamespaceInQueryParams;\r\n this.host = host.toLowerCase();\r\n this.domain = this.host.substr(this.host.indexOf('.') + 1);\r\n this.internalHost =\r\n PersistentStorage.get('host:' + host) || this.host;\r\n }\r\n RepoInfo.prototype.needsQueryParam = function () {\r\n return (this.host !== this.internalHost ||\r\n this.isCustomHost() ||\r\n this.includeNamespaceInQueryParams);\r\n };\r\n RepoInfo.prototype.isCacheableHost = function () {\r\n return this.internalHost.substr(0, 2) === 's-';\r\n };\r\n RepoInfo.prototype.isDemoHost = function () {\r\n return this.domain === 'firebaseio-demo.com';\r\n };\r\n RepoInfo.prototype.isCustomHost = function () {\r\n return (this.domain !== 'firebaseio.com' && this.domain !== 'firebaseio-demo.com');\r\n };\r\n RepoInfo.prototype.updateHost = function (newHost) {\r\n if (newHost !== this.internalHost) {\r\n this.internalHost = newHost;\r\n if (this.isCacheableHost()) {\r\n PersistentStorage.set('host:' + this.host, this.internalHost);\r\n }\r\n }\r\n };\r\n /**\r\n * Returns the websocket URL for this repo\r\n * @param {string} type of connection\r\n * @param {Object} params list\r\n * @return {string} The URL for this repo\r\n */\r\n RepoInfo.prototype.connectionURL = function (type, params) {\r\n assert(typeof type === 'string', 'typeof type must == string');\r\n assert(typeof params === 'object', 'typeof params must == object');\r\n var connURL;\r\n if (type === WEBSOCKET) {\r\n connURL =\r\n (this.secure ? 'wss://' : 'ws://') + this.internalHost + '/.ws?';\r\n }\r\n else if (type === LONG_POLLING) {\r\n connURL =\r\n (this.secure ? 'https://' : 'http://') + this.internalHost + '/.lp?';\r\n }\r\n else {\r\n throw new Error('Unknown connection type: ' + type);\r\n }\r\n if (this.needsQueryParam()) {\r\n params['ns'] = this.namespace;\r\n }\r\n var pairs = [];\r\n each(params, function (key, value) {\r\n pairs.push(key + '=' + value);\r\n });\r\n return connURL + pairs.join('&');\r\n };\r\n /** @return {string} */\r\n RepoInfo.prototype.toString = function () {\r\n var str = this.toURLString();\r\n if (this.persistenceKey) {\r\n str += '<' + this.persistenceKey + '>';\r\n }\r\n return str;\r\n };\r\n /** @return {string} */\r\n RepoInfo.prototype.toURLString = function () {\r\n return (this.secure ? 'https://' : 'http://') + this.host;\r\n };\r\n return RepoInfo;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @param {!string} pathString\r\n * @return {string}\r\n */\r\nfunction decodePath(pathString) {\r\n var pathStringDecoded = '';\r\n var pieces = pathString.split('/');\r\n for (var i = 0; i < pieces.length; i++) {\r\n if (pieces[i].length > 0) {\r\n var piece = pieces[i];\r\n try {\r\n piece = decodeURIComponent(piece.replace(/\\+/g, ' '));\r\n }\r\n catch (e) { }\r\n pathStringDecoded += '/' + piece;\r\n }\r\n }\r\n return pathStringDecoded;\r\n}\r\n/**\r\n * @param {!string} queryString\r\n * @return {!{[key:string]:string}} key value hash\r\n */\r\nfunction decodeQuery(queryString) {\r\n var e_1, _a;\r\n var results = {};\r\n if (queryString.charAt(0) === '?') {\r\n queryString = queryString.substring(1);\r\n }\r\n try {\r\n for (var _b = __values(queryString.split('&')), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var segment = _c.value;\r\n if (segment.length === 0) {\r\n continue;\r\n }\r\n var kv = segment.split('=');\r\n if (kv.length === 2) {\r\n results[decodeURIComponent(kv[0])] = decodeURIComponent(kv[1]);\r\n }\r\n else {\r\n warn(\"Invalid query segment '\" + segment + \"' in query '\" + queryString + \"'\");\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n return results;\r\n}\r\nvar parseRepoInfo = function (dataURL, nodeAdmin) {\r\n var parsedUrl = parseDatabaseURL(dataURL), namespace = parsedUrl.namespace;\r\n if (parsedUrl.domain === 'firebase.com') {\r\n fatal(parsedUrl.host +\r\n ' is no longer supported. ' +\r\n 'Please use <YOUR FIREBASE>.firebaseio.com instead');\r\n }\r\n // Catch common error of uninitialized namespace value.\r\n if ((!namespace || namespace === 'undefined') &&\r\n parsedUrl.domain !== 'localhost') {\r\n fatal('Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com');\r\n }\r\n if (!parsedUrl.secure) {\r\n warnIfPageIsSecure();\r\n }\r\n var webSocketOnly = parsedUrl.scheme === 'ws' || parsedUrl.scheme === 'wss';\r\n return {\r\n repoInfo: new RepoInfo(parsedUrl.host, parsedUrl.secure, namespace, nodeAdmin, webSocketOnly, \r\n /*persistenceKey=*/ '', \r\n /*includeNamespaceInQueryParams=*/ namespace !== parsedUrl.subdomain),\r\n path: new Path(parsedUrl.pathString)\r\n };\r\n};\r\n/**\r\n *\r\n * @param {!string} dataURL\r\n * @return {{host: string, port: number, domain: string, subdomain: string, secure: boolean, scheme: string, pathString: string, namespace: string}}\r\n */\r\nvar parseDatabaseURL = function (dataURL) {\r\n // Default to empty strings in the event of a malformed string.\r\n var host = '', domain = '', subdomain = '', pathString = '', namespace = '';\r\n // Always default to SSL, unless otherwise specified.\r\n var secure = true, scheme = 'https', port = 443;\r\n // Don't do any validation here. The caller is responsible for validating the result of parsing.\r\n if (typeof dataURL === 'string') {\r\n // Parse scheme.\r\n var colonInd = dataURL.indexOf('//');\r\n if (colonInd >= 0) {\r\n scheme = dataURL.substring(0, colonInd - 1);\r\n dataURL = dataURL.substring(colonInd + 2);\r\n }\r\n // Parse host, path, and query string.\r\n var slashInd = dataURL.indexOf('/');\r\n if (slashInd === -1) {\r\n slashInd = dataURL.length;\r\n }\r\n var questionMarkInd = dataURL.indexOf('?');\r\n if (questionMarkInd === -1) {\r\n questionMarkInd = dataURL.length;\r\n }\r\n host = dataURL.substring(0, Math.min(slashInd, questionMarkInd));\r\n if (slashInd < questionMarkInd) {\r\n // For pathString, questionMarkInd will always come after slashInd\r\n pathString = decodePath(dataURL.substring(slashInd, questionMarkInd));\r\n }\r\n var queryParams = decodeQuery(dataURL.substring(Math.min(dataURL.length, questionMarkInd)));\r\n // If we have a port, use scheme for determining if it's secure.\r\n colonInd = host.indexOf(':');\r\n if (colonInd >= 0) {\r\n secure = scheme === 'https' || scheme === 'wss';\r\n port = parseInt(host.substring(colonInd + 1), 10);\r\n }\r\n else {\r\n colonInd = host.length;\r\n }\r\n var hostWithoutPort = host.slice(0, colonInd);\r\n if (hostWithoutPort.toLowerCase() === 'localhost') {\r\n domain = 'localhost';\r\n }\r\n else if (hostWithoutPort.split('.').length <= 2) {\r\n domain = hostWithoutPort;\r\n }\r\n else {\r\n // Interpret the subdomain of a 3 or more component URL as the namespace name.\r\n var dotInd = host.indexOf('.');\r\n subdomain = host.substring(0, dotInd).toLowerCase();\r\n domain = host.substring(dotInd + 1);\r\n // Normalize namespaces to lowercase to share storage / connection.\r\n namespace = subdomain;\r\n }\r\n // Always treat the value of the `ns` as the namespace name if it is present.\r\n if ('ns' in queryParams) {\r\n namespace = queryParams['ns'];\r\n }\r\n }\r\n return {\r\n host: host,\r\n port: port,\r\n domain: domain,\r\n subdomain: subdomain,\r\n secure: secure,\r\n scheme: scheme,\r\n pathString: pathString,\r\n namespace: namespace\r\n };\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * True for invalid Firebase keys\r\n * @type {RegExp}\r\n * @private\r\n */\r\nvar INVALID_KEY_REGEX_ = /[\\[\\].#$\\/\\u0000-\\u001F\\u007F]/;\r\n/**\r\n * True for invalid Firebase paths.\r\n * Allows '/' in paths.\r\n * @type {RegExp}\r\n * @private\r\n */\r\nvar INVALID_PATH_REGEX_ = /[\\[\\].#$\\u0000-\\u001F\\u007F]/;\r\n/**\r\n * Maximum number of characters to allow in leaf value\r\n * @type {number}\r\n * @private\r\n */\r\nvar MAX_LEAF_SIZE_ = 10 * 1024 * 1024;\r\n/**\r\n * @param {*} key\r\n * @return {boolean}\r\n */\r\nvar isValidKey = function (key) {\r\n return (typeof key === 'string' && key.length !== 0 && !INVALID_KEY_REGEX_.test(key));\r\n};\r\n/**\r\n * @param {string} pathString\r\n * @return {boolean}\r\n */\r\nvar isValidPathString = function (pathString) {\r\n return (typeof pathString === 'string' &&\r\n pathString.length !== 0 &&\r\n !INVALID_PATH_REGEX_.test(pathString));\r\n};\r\n/**\r\n * @param {string} pathString\r\n * @return {boolean}\r\n */\r\nvar isValidRootPathString = function (pathString) {\r\n if (pathString) {\r\n // Allow '/.info/' at the beginning.\r\n pathString = pathString.replace(/^\\/*\\.info(\\/|$)/, '/');\r\n }\r\n return isValidPathString(pathString);\r\n};\r\n/**\r\n * @param {*} priority\r\n * @return {boolean}\r\n */\r\nvar isValidPriority = function (priority) {\r\n return (priority === null ||\r\n typeof priority === 'string' ||\r\n (typeof priority === 'number' && !isInvalidJSONNumber(priority)) ||\r\n (priority &&\r\n typeof priority === 'object' &&\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n contains(priority, '.sv')));\r\n};\r\n/**\r\n * Pre-validate a datum passed as an argument to Firebase function.\r\n *\r\n * @param {string} fnName\r\n * @param {number} argumentNumber\r\n * @param {*} data\r\n * @param {!Path} path\r\n * @param {boolean} optional\r\n */\r\nvar validateFirebaseDataArg = function (fnName, argumentNumber, data, path, optional) {\r\n if (optional && data === undefined) {\r\n return;\r\n }\r\n validateFirebaseData(errorPrefix(fnName, argumentNumber, optional), data, path);\r\n};\r\n/**\r\n * Validate a data object client-side before sending to server.\r\n *\r\n * @param {string} errorPrefix\r\n * @param {*} data\r\n * @param {!Path|!ValidationPath} path_\r\n */\r\nvar validateFirebaseData = function (errorPrefix, data, path_) {\r\n var path = path_ instanceof Path ? new ValidationPath(path_, errorPrefix) : path_;\r\n if (data === undefined) {\r\n throw new Error(errorPrefix + 'contains undefined ' + path.toErrorString());\r\n }\r\n if (typeof data === 'function') {\r\n throw new Error(errorPrefix +\r\n 'contains a function ' +\r\n path.toErrorString() +\r\n ' with contents = ' +\r\n data.toString());\r\n }\r\n if (isInvalidJSONNumber(data)) {\r\n throw new Error(errorPrefix + 'contains ' + data.toString() + ' ' + path.toErrorString());\r\n }\r\n // Check max leaf size, but try to avoid the utf8 conversion if we can.\r\n if (typeof data === 'string' &&\r\n data.length > MAX_LEAF_SIZE_ / 3 &&\r\n stringLength(data) > MAX_LEAF_SIZE_) {\r\n throw new Error(errorPrefix +\r\n 'contains a string greater than ' +\r\n MAX_LEAF_SIZE_ +\r\n ' utf8 bytes ' +\r\n path.toErrorString() +\r\n \" ('\" +\r\n data.substring(0, 50) +\r\n \"...')\");\r\n }\r\n // TODO = Perf = Consider combining the recursive validation of keys into NodeFromJSON\r\n // to save extra walking of large objects.\r\n if (data && typeof data === 'object') {\r\n var hasDotValue_1 = false;\r\n var hasActualChild_1 = false;\r\n each(data, function (key, value) {\r\n if (key === '.value') {\r\n hasDotValue_1 = true;\r\n }\r\n else if (key !== '.priority' && key !== '.sv') {\r\n hasActualChild_1 = true;\r\n if (!isValidKey(key)) {\r\n throw new Error(errorPrefix +\r\n ' contains an invalid key (' +\r\n key +\r\n ') ' +\r\n path.toErrorString() +\r\n '. Keys must be non-empty strings ' +\r\n 'and can\\'t contain \".\", \"#\", \"$\", \"/\", \"[\", or \"]\"');\r\n }\r\n }\r\n path.push(key);\r\n validateFirebaseData(errorPrefix, value, path);\r\n path.pop();\r\n });\r\n if (hasDotValue_1 && hasActualChild_1) {\r\n throw new Error(errorPrefix +\r\n ' contains \".value\" child ' +\r\n path.toErrorString() +\r\n ' in addition to actual children.');\r\n }\r\n }\r\n};\r\n/**\r\n * Pre-validate paths passed in the firebase function.\r\n *\r\n * @param {string} errorPrefix\r\n * @param {Array<!Path>} mergePaths\r\n */\r\nvar validateFirebaseMergePaths = function (errorPrefix, mergePaths) {\r\n var i, curPath;\r\n for (i = 0; i < mergePaths.length; i++) {\r\n curPath = mergePaths[i];\r\n var keys = curPath.slice();\r\n for (var j = 0; j < keys.length; j++) {\r\n if (keys[j] === '.priority' && j === keys.length - 1) ;\r\n else if (!isValidKey(keys[j])) {\r\n throw new Error(errorPrefix +\r\n 'contains an invalid key (' +\r\n keys[j] +\r\n ') in path ' +\r\n curPath.toString() +\r\n '. Keys must be non-empty strings ' +\r\n 'and can\\'t contain \".\", \"#\", \"$\", \"/\", \"[\", or \"]\"');\r\n }\r\n }\r\n }\r\n // Check that update keys are not descendants of each other.\r\n // We rely on the property that sorting guarantees that ancestors come\r\n // right before descendants.\r\n mergePaths.sort(Path.comparePaths);\r\n var prevPath = null;\r\n for (i = 0; i < mergePaths.length; i++) {\r\n curPath = mergePaths[i];\r\n if (prevPath !== null && prevPath.contains(curPath)) {\r\n throw new Error(errorPrefix +\r\n 'contains a path ' +\r\n prevPath.toString() +\r\n ' that is ancestor of another path ' +\r\n curPath.toString());\r\n }\r\n prevPath = curPath;\r\n }\r\n};\r\n/**\r\n * pre-validate an object passed as an argument to firebase function (\r\n * must be an object - e.g. for firebase.update()).\r\n *\r\n * @param {string} fnName\r\n * @param {number} argumentNumber\r\n * @param {*} data\r\n * @param {!Path} path\r\n * @param {boolean} optional\r\n */\r\nvar validateFirebaseMergeDataArg = function (fnName, argumentNumber, data, path, optional) {\r\n if (optional && data === undefined) {\r\n return;\r\n }\r\n var errorPrefix$1 = errorPrefix(fnName, argumentNumber, optional);\r\n if (!(data && typeof data === 'object') || Array.isArray(data)) {\r\n throw new Error(errorPrefix$1 + ' must be an object containing the children to replace.');\r\n }\r\n var mergePaths = [];\r\n each(data, function (key, value) {\r\n var curPath = new Path(key);\r\n validateFirebaseData(errorPrefix$1, value, path.child(curPath));\r\n if (curPath.getBack() === '.priority') {\r\n if (!isValidPriority(value)) {\r\n throw new Error(errorPrefix$1 +\r\n \"contains an invalid value for '\" +\r\n curPath.toString() +\r\n \"', which must be a valid \" +\r\n 'Firebase priority (a string, finite number, server value, or null).');\r\n }\r\n }\r\n mergePaths.push(curPath);\r\n });\r\n validateFirebaseMergePaths(errorPrefix$1, mergePaths);\r\n};\r\nvar validatePriority = function (fnName, argumentNumber, priority, optional) {\r\n if (optional && priority === undefined) {\r\n return;\r\n }\r\n if (isInvalidJSONNumber(priority)) {\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) +\r\n 'is ' +\r\n priority.toString() +\r\n ', but must be a valid Firebase priority (a string, finite number, ' +\r\n 'server value, or null).');\r\n }\r\n // Special case to allow importing data with a .sv.\r\n if (!isValidPriority(priority)) {\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) +\r\n 'must be a valid Firebase priority ' +\r\n '(a string, finite number, server value, or null).');\r\n }\r\n};\r\nvar validateEventType = function (fnName, argumentNumber, eventType, optional) {\r\n if (optional && eventType === undefined) {\r\n return;\r\n }\r\n switch (eventType) {\r\n case 'value':\r\n case 'child_added':\r\n case 'child_removed':\r\n case 'child_changed':\r\n case 'child_moved':\r\n break;\r\n default:\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) +\r\n 'must be a valid event type = \"value\", \"child_added\", \"child_removed\", ' +\r\n '\"child_changed\", or \"child_moved\".');\r\n }\r\n};\r\nvar validateKey = function (fnName, argumentNumber, key, optional) {\r\n if (optional && key === undefined) {\r\n return;\r\n }\r\n if (!isValidKey(key)) {\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) +\r\n 'was an invalid key = \"' +\r\n key +\r\n '\". Firebase keys must be non-empty strings and ' +\r\n 'can\\'t contain \".\", \"#\", \"$\", \"/\", \"[\", or \"]\").');\r\n }\r\n};\r\nvar validatePathString = function (fnName, argumentNumber, pathString, optional) {\r\n if (optional && pathString === undefined) {\r\n return;\r\n }\r\n if (!isValidPathString(pathString)) {\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) +\r\n 'was an invalid path = \"' +\r\n pathString +\r\n '\". Paths must be non-empty strings and ' +\r\n 'can\\'t contain \".\", \"#\", \"$\", \"[\", or \"]\"');\r\n }\r\n};\r\nvar validateRootPathString = function (fnName, argumentNumber, pathString, optional) {\r\n if (pathString) {\r\n // Allow '/.info/' at the beginning.\r\n pathString = pathString.replace(/^\\/*\\.info(\\/|$)/, '/');\r\n }\r\n validatePathString(fnName, argumentNumber, pathString, optional);\r\n};\r\nvar validateWritablePath = function (fnName, path) {\r\n if (path.getFront() === '.info') {\r\n throw new Error(fnName + \" failed = Can't modify data under /.info/\");\r\n }\r\n};\r\nvar validateUrl = function (fnName, argumentNumber, parsedUrl) {\r\n // TODO = Validate server better.\r\n var pathString = parsedUrl.path.toString();\r\n if (!(typeof parsedUrl.repoInfo.host === 'string') ||\r\n parsedUrl.repoInfo.host.length === 0 ||\r\n (!isValidKey(parsedUrl.repoInfo.namespace) &&\r\n parsedUrl.repoInfo.host.split(':')[0] !== 'localhost') ||\r\n (pathString.length !== 0 && !isValidRootPathString(pathString))) {\r\n throw new Error(errorPrefix(fnName, argumentNumber, false) +\r\n 'must be a valid firebase URL and ' +\r\n 'the path can\\'t contain \".\", \"#\", \"$\", \"[\", or \"]\".');\r\n }\r\n};\r\nvar validateBoolean = function (fnName, argumentNumber, bool, optional) {\r\n if (optional && bool === undefined) {\r\n return;\r\n }\r\n if (typeof bool !== 'boolean') {\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) + 'must be a boolean.');\r\n }\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @constructor\r\n */\r\nvar OnDisconnect = /** @class */ (function () {\r\n /**\r\n * @param {!Repo} repo_\r\n * @param {!Path} path_\r\n */\r\n function OnDisconnect(repo_, path_) {\r\n this.repo_ = repo_;\r\n this.path_ = path_;\r\n }\r\n /**\r\n * @param {function(?Error)=} onComplete\r\n * @return {!firebase.Promise}\r\n */\r\n OnDisconnect.prototype.cancel = function (onComplete) {\r\n validateArgCount('OnDisconnect.cancel', 0, 1, arguments.length);\r\n validateCallback('OnDisconnect.cancel', 1, onComplete, true);\r\n var deferred = new Deferred();\r\n this.repo_.onDisconnectCancel(this.path_, deferred.wrapCallback(onComplete));\r\n return deferred.promise;\r\n };\r\n /**\r\n * @param {function(?Error)=} onComplete\r\n * @return {!firebase.Promise}\r\n */\r\n OnDisconnect.prototype.remove = function (onComplete) {\r\n validateArgCount('OnDisconnect.remove', 0, 1, arguments.length);\r\n validateWritablePath('OnDisconnect.remove', this.path_);\r\n validateCallback('OnDisconnect.remove', 1, onComplete, true);\r\n var deferred = new Deferred();\r\n this.repo_.onDisconnectSet(this.path_, null, deferred.wrapCallback(onComplete));\r\n return deferred.promise;\r\n };\r\n /**\r\n * @param {*} value\r\n * @param {function(?Error)=} onComplete\r\n * @return {!firebase.Promise}\r\n */\r\n OnDisconnect.prototype.set = function (value, onComplete) {\r\n validateArgCount('OnDisconnect.set', 1, 2, arguments.length);\r\n validateWritablePath('OnDisconnect.set', this.path_);\r\n validateFirebaseDataArg('OnDisconnect.set', 1, value, this.path_, false);\r\n validateCallback('OnDisconnect.set', 2, onComplete, true);\r\n var deferred = new Deferred();\r\n this.repo_.onDisconnectSet(this.path_, value, deferred.wrapCallback(onComplete));\r\n return deferred.promise;\r\n };\r\n /**\r\n * @param {*} value\r\n * @param {number|string|null} priority\r\n * @param {function(?Error)=} onComplete\r\n * @return {!firebase.Promise}\r\n */\r\n OnDisconnect.prototype.setWithPriority = function (value, priority, onComplete) {\r\n validateArgCount('OnDisconnect.setWithPriority', 2, 3, arguments.length);\r\n validateWritablePath('OnDisconnect.setWithPriority', this.path_);\r\n validateFirebaseDataArg('OnDisconnect.setWithPriority', 1, value, this.path_, false);\r\n validatePriority('OnDisconnect.setWithPriority', 2, priority, false);\r\n validateCallback('OnDisconnect.setWithPriority', 3, onComplete, true);\r\n var deferred = new Deferred();\r\n this.repo_.onDisconnectSetWithPriority(this.path_, value, priority, deferred.wrapCallback(onComplete));\r\n return deferred.promise;\r\n };\r\n /**\r\n * @param {!Object} objectToMerge\r\n * @param {function(?Error)=} onComplete\r\n * @return {!firebase.Promise}\r\n */\r\n OnDisconnect.prototype.update = function (objectToMerge, onComplete) {\r\n validateArgCount('OnDisconnect.update', 1, 2, arguments.length);\r\n validateWritablePath('OnDisconnect.update', this.path_);\r\n if (Array.isArray(objectToMerge)) {\r\n var newObjectToMerge = {};\r\n for (var i = 0; i < objectToMerge.length; ++i) {\r\n newObjectToMerge['' + i] = objectToMerge[i];\r\n }\r\n objectToMerge = newObjectToMerge;\r\n warn('Passing an Array to firebase.database.onDisconnect().update() is deprecated. Use set() if you want to overwrite the ' +\r\n 'existing data, or an Object with integer keys if you really do want to only update some of the children.');\r\n }\r\n validateFirebaseMergeDataArg('OnDisconnect.update', 1, objectToMerge, this.path_, false);\r\n validateCallback('OnDisconnect.update', 2, onComplete, true);\r\n var deferred = new Deferred();\r\n this.repo_.onDisconnectUpdate(this.path_, objectToMerge, deferred.wrapCallback(onComplete));\r\n return deferred.promise;\r\n };\r\n return OnDisconnect;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar TransactionResult = /** @class */ (function () {\r\n /**\r\n * A type for the resolve value of Firebase.transaction.\r\n * @constructor\r\n * @dict\r\n * @param {boolean} committed\r\n * @param {DataSnapshot} snapshot\r\n */\r\n function TransactionResult(committed, snapshot) {\r\n this.committed = committed;\r\n this.snapshot = snapshot;\r\n }\r\n // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary\r\n // for end-users\r\n TransactionResult.prototype.toJSON = function () {\r\n validateArgCount('TransactionResult.toJSON', 0, 1, arguments.length);\r\n return { committed: this.committed, snapshot: this.snapshot.toJSON() };\r\n };\r\n return TransactionResult;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Fancy ID generator that creates 20-character string identifiers with the\r\n * following properties:\r\n *\r\n * 1. They're based on timestamp so that they sort *after* any existing ids.\r\n * 2. They contain 72-bits of random data after the timestamp so that IDs won't\r\n * collide with other clients' IDs.\r\n * 3. They sort *lexicographically* (so the timestamp is converted to characters\r\n * that will sort properly).\r\n * 4. They're monotonically increasing. Even if you generate more than one in\r\n * the same timestamp, the latter ones will sort after the former ones. We do\r\n * this by using the previous random bits but \"incrementing\" them by 1 (only\r\n * in the case of a timestamp collision).\r\n */\r\nvar nextPushId = (function () {\r\n // Modeled after base64 web-safe chars, but ordered by ASCII.\r\n var PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz';\r\n // Timestamp of last push, used to prevent local collisions if you push twice\r\n // in one ms.\r\n var lastPushTime = 0;\r\n // We generate 72-bits of randomness which get turned into 12 characters and\r\n // appended to the timestamp to prevent collisions with other clients. We\r\n // store the last characters we generated because in the event of a collision,\r\n // we'll use those same characters except \"incremented\" by one.\r\n var lastRandChars = [];\r\n return function (now) {\r\n var duplicateTime = now === lastPushTime;\r\n lastPushTime = now;\r\n var i;\r\n var timeStampChars = new Array(8);\r\n for (i = 7; i >= 0; i--) {\r\n timeStampChars[i] = PUSH_CHARS.charAt(now % 64);\r\n // NOTE: Can't use << here because javascript will convert to int and lose\r\n // the upper bits.\r\n now = Math.floor(now / 64);\r\n }\r\n assert(now === 0, 'Cannot push at time == 0');\r\n var id = timeStampChars.join('');\r\n if (!duplicateTime) {\r\n for (i = 0; i < 12; i++) {\r\n lastRandChars[i] = Math.floor(Math.random() * 64);\r\n }\r\n }\r\n else {\r\n // If the timestamp hasn't changed since last push, use the same random\r\n // number, except incremented by 1.\r\n for (i = 11; i >= 0 && lastRandChars[i] === 63; i--) {\r\n lastRandChars[i] = 0;\r\n }\r\n lastRandChars[i]++;\r\n }\r\n for (i = 0; i < 12; i++) {\r\n id += PUSH_CHARS.charAt(lastRandChars[i]);\r\n }\r\n assert(id.length === 20, 'nextPushId: Length should be 20.');\r\n return id;\r\n };\r\n})();\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n *\r\n * @param {!string} name\r\n * @param {!Node} node\r\n * @constructor\r\n * @struct\r\n */\r\nvar NamedNode = /** @class */ (function () {\r\n function NamedNode(name, node) {\r\n this.name = name;\r\n this.node = node;\r\n }\r\n /**\r\n *\r\n * @param {!string} name\r\n * @param {!Node} node\r\n * @return {NamedNode}\r\n */\r\n NamedNode.Wrap = function (name, node) {\r\n return new NamedNode(name, node);\r\n };\r\n return NamedNode;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n *\r\n * @constructor\r\n */\r\nvar Index = /** @class */ (function () {\r\n function Index() {\r\n }\r\n /**\r\n * @return {function(!NamedNode, !NamedNode):number} A standalone comparison function for\r\n * this index\r\n */\r\n Index.prototype.getCompare = function () {\r\n return this.compare.bind(this);\r\n };\r\n /**\r\n * Given a before and after value for a node, determine if the indexed value has changed. Even if they are different,\r\n * it's possible that the changes are isolated to parts of the snapshot that are not indexed.\r\n *\r\n * @param {!Node} oldNode\r\n * @param {!Node} newNode\r\n * @return {boolean} True if the portion of the snapshot being indexed changed between oldNode and newNode\r\n */\r\n Index.prototype.indexedValueChanged = function (oldNode, newNode) {\r\n var oldWrapped = new NamedNode(MIN_NAME, oldNode);\r\n var newWrapped = new NamedNode(MIN_NAME, newNode);\r\n return this.compare(oldWrapped, newWrapped) !== 0;\r\n };\r\n /**\r\n * @return {!NamedNode} a node wrapper that will sort equal to or less than\r\n * any other node wrapper, using this index\r\n */\r\n Index.prototype.minPost = function () {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return NamedNode.MIN;\r\n };\r\n return Index;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __EMPTY_NODE;\r\nvar KeyIndex = /** @class */ (function (_super) {\r\n __extends(KeyIndex, _super);\r\n function KeyIndex() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Object.defineProperty(KeyIndex, \"__EMPTY_NODE\", {\r\n get: function () {\r\n return __EMPTY_NODE;\r\n },\r\n set: function (val) {\r\n __EMPTY_NODE = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * @inheritDoc\r\n */\r\n KeyIndex.prototype.compare = function (a, b) {\r\n return nameCompare(a.name, b.name);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n KeyIndex.prototype.isDefinedOn = function (node) {\r\n // We could probably return true here (since every node has a key), but it's never called\r\n // so just leaving unimplemented for now.\r\n throw assertionError('KeyIndex.isDefinedOn not expected to be called.');\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n KeyIndex.prototype.indexedValueChanged = function (oldNode, newNode) {\r\n return false; // The key for a node never changes.\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n KeyIndex.prototype.minPost = function () {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return NamedNode.MIN;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n KeyIndex.prototype.maxPost = function () {\r\n // TODO: This should really be created once and cached in a static property, but\r\n // NamedNode isn't defined yet, so I can't use it in a static. Bleh.\r\n return new NamedNode(MAX_NAME, __EMPTY_NODE);\r\n };\r\n /**\r\n * @param {*} indexValue\r\n * @param {string} name\r\n * @return {!NamedNode}\r\n */\r\n KeyIndex.prototype.makePost = function (indexValue, name) {\r\n assert(typeof indexValue === 'string', 'KeyIndex indexValue must always be a string.');\r\n // We just use empty node, but it'll never be compared, since our comparator only looks at name.\r\n return new NamedNode(indexValue, __EMPTY_NODE);\r\n };\r\n /**\r\n * @return {!string} String representation for inclusion in a query spec\r\n */\r\n KeyIndex.prototype.toString = function () {\r\n return '.key';\r\n };\r\n return KeyIndex;\r\n}(Index));\r\nvar KEY_INDEX = new KeyIndex();\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar MAX_NODE;\r\nfunction setMaxNode(val) {\r\n MAX_NODE = val;\r\n}\r\n/**\r\n * @param {(!string|!number)} priority\r\n * @return {!string}\r\n */\r\nvar priorityHashText = function (priority) {\r\n if (typeof priority === 'number') {\r\n return 'number:' + doubleToIEEE754String(priority);\r\n }\r\n else {\r\n return 'string:' + priority;\r\n }\r\n};\r\n/**\r\n * Validates that a priority snapshot Node is valid.\r\n *\r\n * @param {!Node} priorityNode\r\n */\r\nvar validatePriorityNode = function (priorityNode) {\r\n if (priorityNode.isLeafNode()) {\r\n var val = priorityNode.val();\r\n assert(typeof val === 'string' ||\r\n typeof val === 'number' ||\r\n (typeof val === 'object' && contains(val, '.sv')), 'Priority must be a string or number.');\r\n }\r\n else {\r\n assert(priorityNode === MAX_NODE || priorityNode.isEmpty(), 'priority of unexpected type.');\r\n }\r\n // Don't call getPriority() on MAX_NODE to avoid hitting assertion.\r\n assert(priorityNode === MAX_NODE || priorityNode.getPriority().isEmpty(), \"Priority nodes can't have a priority of their own.\");\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __childrenNodeConstructor;\r\n/**\r\n * LeafNode is a class for storing leaf nodes in a DataSnapshot. It\r\n * implements Node and stores the value of the node (a string,\r\n * number, or boolean) accessible via getValue().\r\n */\r\nvar LeafNode = /** @class */ (function () {\r\n /**\r\n * @implements {Node}\r\n * @param {!(string|number|boolean|Object)} value_ The value to store in this leaf node.\r\n * The object type is possible in the event of a deferred value\r\n * @param {!Node=} priorityNode_ The priority of this node.\r\n */\r\n function LeafNode(value_, priorityNode_) {\r\n if (priorityNode_ === void 0) { priorityNode_ = LeafNode.__childrenNodeConstructor.EMPTY_NODE; }\r\n this.value_ = value_;\r\n this.priorityNode_ = priorityNode_;\r\n this.lazyHash_ = null;\r\n assert(this.value_ !== undefined && this.value_ !== null, \"LeafNode shouldn't be created with null/undefined value.\");\r\n validatePriorityNode(this.priorityNode_);\r\n }\r\n Object.defineProperty(LeafNode, \"__childrenNodeConstructor\", {\r\n get: function () {\r\n return __childrenNodeConstructor;\r\n },\r\n set: function (val) {\r\n __childrenNodeConstructor = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /** @inheritDoc */\r\n LeafNode.prototype.isLeafNode = function () {\r\n return true;\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.getPriority = function () {\r\n return this.priorityNode_;\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.updatePriority = function (newPriorityNode) {\r\n return new LeafNode(this.value_, newPriorityNode);\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.getImmediateChild = function (childName) {\r\n // Hack to treat priority as a regular child\r\n if (childName === '.priority') {\r\n return this.priorityNode_;\r\n }\r\n else {\r\n return LeafNode.__childrenNodeConstructor.EMPTY_NODE;\r\n }\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.getChild = function (path) {\r\n if (path.isEmpty()) {\r\n return this;\r\n }\r\n else if (path.getFront() === '.priority') {\r\n return this.priorityNode_;\r\n }\r\n else {\r\n return LeafNode.__childrenNodeConstructor.EMPTY_NODE;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LeafNode.prototype.hasChild = function () {\r\n return false;\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.getPredecessorChildName = function (childName, childNode) {\r\n return null;\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.updateImmediateChild = function (childName, newChildNode) {\r\n if (childName === '.priority') {\r\n return this.updatePriority(newChildNode);\r\n }\r\n else if (newChildNode.isEmpty() && childName !== '.priority') {\r\n return this;\r\n }\r\n else {\r\n return LeafNode.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(childName, newChildNode).updatePriority(this.priorityNode_);\r\n }\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.updateChild = function (path, newChildNode) {\r\n var front = path.getFront();\r\n if (front === null) {\r\n return newChildNode;\r\n }\r\n else if (newChildNode.isEmpty() && front !== '.priority') {\r\n return this;\r\n }\r\n else {\r\n assert(front !== '.priority' || path.getLength() === 1, '.priority must be the last token in a path');\r\n return this.updateImmediateChild(front, LeafNode.__childrenNodeConstructor.EMPTY_NODE.updateChild(path.popFront(), newChildNode));\r\n }\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.isEmpty = function () {\r\n return false;\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.numChildren = function () {\r\n return 0;\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.forEachChild = function (index, action) {\r\n return false;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LeafNode.prototype.val = function (exportFormat) {\r\n if (exportFormat && !this.getPriority().isEmpty()) {\r\n return {\r\n '.value': this.getValue(),\r\n '.priority': this.getPriority().val()\r\n };\r\n }\r\n else {\r\n return this.getValue();\r\n }\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.hash = function () {\r\n if (this.lazyHash_ === null) {\r\n var toHash = '';\r\n if (!this.priorityNode_.isEmpty()) {\r\n toHash +=\r\n 'priority:' +\r\n priorityHashText(this.priorityNode_.val()) +\r\n ':';\r\n }\r\n var type = typeof this.value_;\r\n toHash += type + ':';\r\n if (type === 'number') {\r\n toHash += doubleToIEEE754String(this.value_);\r\n }\r\n else {\r\n toHash += this.value_;\r\n }\r\n this.lazyHash_ = sha1(toHash);\r\n }\r\n return this.lazyHash_;\r\n };\r\n /**\r\n * Returns the value of the leaf node.\r\n * @return {Object|string|number|boolean} The value of the node.\r\n */\r\n LeafNode.prototype.getValue = function () {\r\n return this.value_;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LeafNode.prototype.compareTo = function (other) {\r\n if (other === LeafNode.__childrenNodeConstructor.EMPTY_NODE) {\r\n return 1;\r\n }\r\n else if (other instanceof LeafNode.__childrenNodeConstructor) {\r\n return -1;\r\n }\r\n else {\r\n assert(other.isLeafNode(), 'Unknown node type');\r\n return this.compareToLeafNode_(other);\r\n }\r\n };\r\n /**\r\n * Comparison specifically for two leaf nodes\r\n * @param {!LeafNode} otherLeaf\r\n * @return {!number}\r\n * @private\r\n */\r\n LeafNode.prototype.compareToLeafNode_ = function (otherLeaf) {\r\n var otherLeafType = typeof otherLeaf.value_;\r\n var thisLeafType = typeof this.value_;\r\n var otherIndex = LeafNode.VALUE_TYPE_ORDER.indexOf(otherLeafType);\r\n var thisIndex = LeafNode.VALUE_TYPE_ORDER.indexOf(thisLeafType);\r\n assert(otherIndex >= 0, 'Unknown leaf type: ' + otherLeafType);\r\n assert(thisIndex >= 0, 'Unknown leaf type: ' + thisLeafType);\r\n if (otherIndex === thisIndex) {\r\n // Same type, compare values\r\n if (thisLeafType === 'object') {\r\n // Deferred value nodes are all equal, but we should also never get to this point...\r\n return 0;\r\n }\r\n else {\r\n // Note that this works because true > false, all others are number or string comparisons\r\n if (this.value_ < otherLeaf.value_) {\r\n return -1;\r\n }\r\n else if (this.value_ === otherLeaf.value_) {\r\n return 0;\r\n }\r\n else {\r\n return 1;\r\n }\r\n }\r\n }\r\n else {\r\n return thisIndex - otherIndex;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LeafNode.prototype.withIndex = function () {\r\n return this;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LeafNode.prototype.isIndexed = function () {\r\n return true;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LeafNode.prototype.equals = function (other) {\r\n /**\r\n * @inheritDoc\r\n */\r\n if (other === this) {\r\n return true;\r\n }\r\n else if (other.isLeafNode()) {\r\n var otherLeaf = other;\r\n return (this.value_ === otherLeaf.value_ &&\r\n this.priorityNode_.equals(otherLeaf.priorityNode_));\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n /**\r\n * The sort order for comparing leaf nodes of different types. If two leaf nodes have\r\n * the same type, the comparison falls back to their value\r\n * @type {Array.<!string>}\r\n * @const\r\n */\r\n LeafNode.VALUE_TYPE_ORDER = ['object', 'boolean', 'number', 'string'];\r\n return LeafNode;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar nodeFromJSON;\r\nvar MAX_NODE$1;\r\nfunction setNodeFromJSON(val) {\r\n nodeFromJSON = val;\r\n}\r\nfunction setMaxNode$1(val) {\r\n MAX_NODE$1 = val;\r\n}\r\n/**\r\n * @constructor\r\n * @extends {Index}\r\n * @private\r\n */\r\nvar PriorityIndex = /** @class */ (function (_super) {\r\n __extends(PriorityIndex, _super);\r\n function PriorityIndex() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n PriorityIndex.prototype.compare = function (a, b) {\r\n var aPriority = a.node.getPriority();\r\n var bPriority = b.node.getPriority();\r\n var indexCmp = aPriority.compareTo(bPriority);\r\n if (indexCmp === 0) {\r\n return nameCompare(a.name, b.name);\r\n }\r\n else {\r\n return indexCmp;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PriorityIndex.prototype.isDefinedOn = function (node) {\r\n return !node.getPriority().isEmpty();\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PriorityIndex.prototype.indexedValueChanged = function (oldNode, newNode) {\r\n return !oldNode.getPriority().equals(newNode.getPriority());\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PriorityIndex.prototype.minPost = function () {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return NamedNode.MIN;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PriorityIndex.prototype.maxPost = function () {\r\n return new NamedNode(MAX_NAME, new LeafNode('[PRIORITY-POST]', MAX_NODE$1));\r\n };\r\n /**\r\n * @param {*} indexValue\r\n * @param {string} name\r\n * @return {!NamedNode}\r\n */\r\n PriorityIndex.prototype.makePost = function (indexValue, name) {\r\n var priorityNode = nodeFromJSON(indexValue);\r\n return new NamedNode(name, new LeafNode('[PRIORITY-POST]', priorityNode));\r\n };\r\n /**\r\n * @return {!string} String representation for inclusion in a query spec\r\n */\r\n PriorityIndex.prototype.toString = function () {\r\n return '.priority';\r\n };\r\n return PriorityIndex;\r\n}(Index));\r\nvar PRIORITY_INDEX = new PriorityIndex();\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An iterator over an LLRBNode.\r\n */\r\nvar SortedMapIterator = /** @class */ (function () {\r\n /**\r\n * @template K, V, T\r\n * @param {LLRBNode|LLRBEmptyNode} node Node to iterate.\r\n * @param {?K} startKey\r\n * @param {function(K, K): number} comparator\r\n * @param {boolean} isReverse_ Whether or not to iterate in reverse\r\n * @param {(function(K, V):T)=} resultGenerator_\r\n */\r\n function SortedMapIterator(node, startKey, comparator, isReverse_, resultGenerator_) {\r\n if (resultGenerator_ === void 0) { resultGenerator_ = null; }\r\n this.isReverse_ = isReverse_;\r\n this.resultGenerator_ = resultGenerator_;\r\n /** @private\r\n * @type {Array.<!LLRBNode>}\r\n */\r\n this.nodeStack_ = [];\r\n var cmp = 1;\r\n while (!node.isEmpty()) {\r\n node = node;\r\n cmp = startKey ? comparator(node.key, startKey) : 1;\r\n // flip the comparison if we're going in reverse\r\n if (isReverse_) {\r\n cmp *= -1;\r\n }\r\n if (cmp < 0) {\r\n // This node is less than our start key. ignore it\r\n if (this.isReverse_) {\r\n node = node.left;\r\n }\r\n else {\r\n node = node.right;\r\n }\r\n }\r\n else if (cmp === 0) {\r\n // This node is exactly equal to our start key. Push it on the stack, but stop iterating;\r\n this.nodeStack_.push(node);\r\n break;\r\n }\r\n else {\r\n // This node is greater than our start key, add it to the stack and move to the next one\r\n this.nodeStack_.push(node);\r\n if (this.isReverse_) {\r\n node = node.right;\r\n }\r\n else {\r\n node = node.left;\r\n }\r\n }\r\n }\r\n }\r\n SortedMapIterator.prototype.getNext = function () {\r\n if (this.nodeStack_.length === 0) {\r\n return null;\r\n }\r\n var node = this.nodeStack_.pop();\r\n var result;\r\n if (this.resultGenerator_) {\r\n result = this.resultGenerator_(node.key, node.value);\r\n }\r\n else {\r\n result = { key: node.key, value: node.value };\r\n }\r\n if (this.isReverse_) {\r\n node = node.left;\r\n while (!node.isEmpty()) {\r\n this.nodeStack_.push(node);\r\n node = node.right;\r\n }\r\n }\r\n else {\r\n node = node.right;\r\n while (!node.isEmpty()) {\r\n this.nodeStack_.push(node);\r\n node = node.left;\r\n }\r\n }\r\n return result;\r\n };\r\n SortedMapIterator.prototype.hasNext = function () {\r\n return this.nodeStack_.length > 0;\r\n };\r\n SortedMapIterator.prototype.peek = function () {\r\n if (this.nodeStack_.length === 0) {\r\n return null;\r\n }\r\n var node = this.nodeStack_[this.nodeStack_.length - 1];\r\n if (this.resultGenerator_) {\r\n return this.resultGenerator_(node.key, node.value);\r\n }\r\n else {\r\n return { key: node.key, value: node.value };\r\n }\r\n };\r\n return SortedMapIterator;\r\n}());\r\n/**\r\n * Represents a node in a Left-leaning Red-Black tree.\r\n */\r\nvar LLRBNode = /** @class */ (function () {\r\n /**\r\n * @template K, V\r\n * @param {!K} key Key associated with this node.\r\n * @param {!V} value Value associated with this node.\r\n * @param {?boolean} color Whether this node is red.\r\n * @param {?(LLRBNode|LLRBEmptyNode)=} left Left child.\r\n * @param {?(LLRBNode|LLRBEmptyNode)=} right Right child.\r\n */\r\n function LLRBNode(key, value, color, left, right) {\r\n this.key = key;\r\n this.value = value;\r\n this.color = color != null ? color : LLRBNode.RED;\r\n this.left =\r\n left != null ? left : SortedMap.EMPTY_NODE;\r\n this.right =\r\n right != null ? right : SortedMap.EMPTY_NODE;\r\n }\r\n /**\r\n * Returns a copy of the current node, optionally replacing pieces of it.\r\n *\r\n * @param {?K} key New key for the node, or null.\r\n * @param {?V} value New value for the node, or null.\r\n * @param {?boolean} color New color for the node, or null.\r\n * @param {?LLRBNode|LLRBEmptyNode} left New left child for the node, or null.\r\n * @param {?LLRBNode|LLRBEmptyNode} right New right child for the node, or null.\r\n * @return {!LLRBNode} The node copy.\r\n */\r\n LLRBNode.prototype.copy = function (key, value, color, left, right) {\r\n return new LLRBNode(key != null ? key : this.key, value != null ? value : this.value, color != null ? color : this.color, left != null ? left : this.left, right != null ? right : this.right);\r\n };\r\n /**\r\n * @return {number} The total number of nodes in the tree.\r\n */\r\n LLRBNode.prototype.count = function () {\r\n return this.left.count() + 1 + this.right.count();\r\n };\r\n /**\r\n * @return {boolean} True if the tree is empty.\r\n */\r\n LLRBNode.prototype.isEmpty = function () {\r\n return false;\r\n };\r\n /**\r\n * Traverses the tree in key order and calls the specified action function\r\n * for each node.\r\n *\r\n * @param {function(!K, !V):*} action Callback function to be called for each\r\n * node. If it returns true, traversal is aborted.\r\n * @return {*} The first truthy value returned by action, or the last falsey\r\n * value returned by action\r\n */\r\n LLRBNode.prototype.inorderTraversal = function (action) {\r\n return (this.left.inorderTraversal(action) ||\r\n !!action(this.key, this.value) ||\r\n this.right.inorderTraversal(action));\r\n };\r\n /**\r\n * Traverses the tree in reverse key order and calls the specified action function\r\n * for each node.\r\n *\r\n * @param {function(!Object, !Object)} action Callback function to be called for each\r\n * node. If it returns true, traversal is aborted.\r\n * @return {*} True if traversal was aborted.\r\n */\r\n LLRBNode.prototype.reverseTraversal = function (action) {\r\n return (this.right.reverseTraversal(action) ||\r\n action(this.key, this.value) ||\r\n this.left.reverseTraversal(action));\r\n };\r\n /**\r\n * @return {!Object} The minimum node in the tree.\r\n * @private\r\n */\r\n LLRBNode.prototype.min_ = function () {\r\n if (this.left.isEmpty()) {\r\n return this;\r\n }\r\n else {\r\n return this.left.min_();\r\n }\r\n };\r\n /**\r\n * @return {!K} The maximum key in the tree.\r\n */\r\n LLRBNode.prototype.minKey = function () {\r\n return this.min_().key;\r\n };\r\n /**\r\n * @return {!K} The maximum key in the tree.\r\n */\r\n LLRBNode.prototype.maxKey = function () {\r\n if (this.right.isEmpty()) {\r\n return this.key;\r\n }\r\n else {\r\n return this.right.maxKey();\r\n }\r\n };\r\n /**\r\n *\r\n * @param {!Object} key Key to insert.\r\n * @param {!Object} value Value to insert.\r\n * @param {Comparator} comparator Comparator.\r\n * @return {!LLRBNode} New tree, with the key/value added.\r\n */\r\n LLRBNode.prototype.insert = function (key, value, comparator) {\r\n var n = this;\r\n var cmp = comparator(key, n.key);\r\n if (cmp < 0) {\r\n n = n.copy(null, null, null, n.left.insert(key, value, comparator), null);\r\n }\r\n else if (cmp === 0) {\r\n n = n.copy(null, value, null, null, null);\r\n }\r\n else {\r\n n = n.copy(null, null, null, null, n.right.insert(key, value, comparator));\r\n }\r\n return n.fixUp_();\r\n };\r\n /**\r\n * @private\r\n * @return {!LLRBNode|LLRBEmptyNode} New tree, with the minimum key removed.\r\n */\r\n LLRBNode.prototype.removeMin_ = function () {\r\n if (this.left.isEmpty()) {\r\n return SortedMap.EMPTY_NODE;\r\n }\r\n var n = this;\r\n if (!n.left.isRed_() && !n.left.left.isRed_()) {\r\n n = n.moveRedLeft_();\r\n }\r\n n = n.copy(null, null, null, n.left.removeMin_(), null);\r\n return n.fixUp_();\r\n };\r\n /**\r\n * @param {!Object} key The key of the item to remove.\r\n * @param {Comparator} comparator Comparator.\r\n * @return {!LLRBNode|LLRBEmptyNode} New tree, with the specified item removed.\r\n */\r\n LLRBNode.prototype.remove = function (key, comparator) {\r\n var n, smallest;\r\n n = this;\r\n if (comparator(key, n.key) < 0) {\r\n if (!n.left.isEmpty() && !n.left.isRed_() && !n.left.left.isRed_()) {\r\n n = n.moveRedLeft_();\r\n }\r\n n = n.copy(null, null, null, n.left.remove(key, comparator), null);\r\n }\r\n else {\r\n if (n.left.isRed_()) {\r\n n = n.rotateRight_();\r\n }\r\n if (!n.right.isEmpty() && !n.right.isRed_() && !n.right.left.isRed_()) {\r\n n = n.moveRedRight_();\r\n }\r\n if (comparator(key, n.key) === 0) {\r\n if (n.right.isEmpty()) {\r\n return SortedMap.EMPTY_NODE;\r\n }\r\n else {\r\n smallest = n.right.min_();\r\n n = n.copy(smallest.key, smallest.value, null, null, n.right.removeMin_());\r\n }\r\n }\r\n n = n.copy(null, null, null, null, n.right.remove(key, comparator));\r\n }\r\n return n.fixUp_();\r\n };\r\n /**\r\n * @private\r\n * @return {boolean} Whether this is a RED node.\r\n */\r\n LLRBNode.prototype.isRed_ = function () {\r\n return this.color;\r\n };\r\n /**\r\n * @private\r\n * @return {!LLRBNode} New tree after performing any needed rotations.\r\n */\r\n LLRBNode.prototype.fixUp_ = function () {\r\n var n = this;\r\n if (n.right.isRed_() && !n.left.isRed_()) {\r\n n = n.rotateLeft_();\r\n }\r\n if (n.left.isRed_() && n.left.left.isRed_()) {\r\n n = n.rotateRight_();\r\n }\r\n if (n.left.isRed_() && n.right.isRed_()) {\r\n n = n.colorFlip_();\r\n }\r\n return n;\r\n };\r\n /**\r\n * @private\r\n * @return {!LLRBNode} New tree, after moveRedLeft.\r\n */\r\n LLRBNode.prototype.moveRedLeft_ = function () {\r\n var n = this.colorFlip_();\r\n if (n.right.left.isRed_()) {\r\n n = n.copy(null, null, null, null, n.right.rotateRight_());\r\n n = n.rotateLeft_();\r\n n = n.colorFlip_();\r\n }\r\n return n;\r\n };\r\n /**\r\n * @private\r\n * @return {!LLRBNode} New tree, after moveRedRight.\r\n */\r\n LLRBNode.prototype.moveRedRight_ = function () {\r\n var n = this.colorFlip_();\r\n if (n.left.left.isRed_()) {\r\n n = n.rotateRight_();\r\n n = n.colorFlip_();\r\n }\r\n return n;\r\n };\r\n /**\r\n * @private\r\n * @return {!LLRBNode} New tree, after rotateLeft.\r\n */\r\n LLRBNode.prototype.rotateLeft_ = function () {\r\n var nl = this.copy(null, null, LLRBNode.RED, null, this.right.left);\r\n return this.right.copy(null, null, this.color, nl, null);\r\n };\r\n /**\r\n * @private\r\n * @return {!LLRBNode} New tree, after rotateRight.\r\n */\r\n LLRBNode.prototype.rotateRight_ = function () {\r\n var nr = this.copy(null, null, LLRBNode.RED, this.left.right, null);\r\n return this.left.copy(null, null, this.color, null, nr);\r\n };\r\n /**\r\n * @private\r\n * @return {!LLRBNode} New tree, after colorFlip.\r\n */\r\n LLRBNode.prototype.colorFlip_ = function () {\r\n var left = this.left.copy(null, null, !this.left.color, null, null);\r\n var right = this.right.copy(null, null, !this.right.color, null, null);\r\n return this.copy(null, null, !this.color, left, right);\r\n };\r\n /**\r\n * For testing.\r\n *\r\n * @private\r\n * @return {boolean} True if all is well.\r\n */\r\n LLRBNode.prototype.checkMaxDepth_ = function () {\r\n var blackDepth = this.check_();\r\n return Math.pow(2.0, blackDepth) <= this.count() + 1;\r\n };\r\n /**\r\n * @private\r\n * @return {number} Not sure what this returns exactly. :-).\r\n */\r\n LLRBNode.prototype.check_ = function () {\r\n if (this.isRed_() && this.left.isRed_()) {\r\n throw new Error('Red node has red child(' + this.key + ',' + this.value + ')');\r\n }\r\n if (this.right.isRed_()) {\r\n throw new Error('Right child of (' + this.key + ',' + this.value + ') is red');\r\n }\r\n var blackDepth = this.left.check_();\r\n if (blackDepth !== this.right.check_()) {\r\n throw new Error('Black depths differ');\r\n }\r\n else {\r\n return blackDepth + (this.isRed_() ? 0 : 1);\r\n }\r\n };\r\n LLRBNode.RED = true;\r\n LLRBNode.BLACK = false;\r\n return LLRBNode;\r\n}());\r\n/**\r\n * Represents an empty node (a leaf node in the Red-Black Tree).\r\n */\r\nvar LLRBEmptyNode = /** @class */ (function () {\r\n function LLRBEmptyNode() {\r\n }\r\n /**\r\n * Returns a copy of the current node.\r\n *\r\n * @return {!LLRBEmptyNode} The node copy.\r\n */\r\n LLRBEmptyNode.prototype.copy = function (key, value, color, left, right) {\r\n return this;\r\n };\r\n /**\r\n * Returns a copy of the tree, with the specified key/value added.\r\n *\r\n * @param {!K} key Key to be added.\r\n * @param {!V} value Value to be added.\r\n * @param {Comparator} comparator Comparator.\r\n * @return {!LLRBNode} New tree, with item added.\r\n */\r\n LLRBEmptyNode.prototype.insert = function (key, value, comparator) {\r\n return new LLRBNode(key, value, null);\r\n };\r\n /**\r\n * Returns a copy of the tree, with the specified key removed.\r\n *\r\n * @param {!K} key The key to remove.\r\n * @param {Comparator} comparator Comparator.\r\n * @return {!LLRBEmptyNode} New tree, with item removed.\r\n */\r\n LLRBEmptyNode.prototype.remove = function (key, comparator) {\r\n return this;\r\n };\r\n /**\r\n * @return {number} The total number of nodes in the tree.\r\n */\r\n LLRBEmptyNode.prototype.count = function () {\r\n return 0;\r\n };\r\n /**\r\n * @return {boolean} True if the tree is empty.\r\n */\r\n LLRBEmptyNode.prototype.isEmpty = function () {\r\n return true;\r\n };\r\n /**\r\n * Traverses the tree in key order and calls the specified action function\r\n * for each node.\r\n *\r\n * @param {function(!K, !V):*} action Callback function to be called for each\r\n * node. If it returns true, traversal is aborted.\r\n * @return {boolean} True if traversal was aborted.\r\n */\r\n LLRBEmptyNode.prototype.inorderTraversal = function (action) {\r\n return false;\r\n };\r\n /**\r\n * Traverses the tree in reverse key order and calls the specified action function\r\n * for each node.\r\n *\r\n * @param {function(!K, !V)} action Callback function to be called for each\r\n * node. If it returns true, traversal is aborted.\r\n * @return {boolean} True if traversal was aborted.\r\n */\r\n LLRBEmptyNode.prototype.reverseTraversal = function (action) {\r\n return false;\r\n };\r\n /**\r\n * @return {null}\r\n */\r\n LLRBEmptyNode.prototype.minKey = function () {\r\n return null;\r\n };\r\n /**\r\n * @return {null}\r\n */\r\n LLRBEmptyNode.prototype.maxKey = function () {\r\n return null;\r\n };\r\n /**\r\n * @private\r\n * @return {number} Not sure what this returns exactly. :-).\r\n */\r\n LLRBEmptyNode.prototype.check_ = function () {\r\n return 0;\r\n };\r\n /**\r\n * @private\r\n * @return {boolean} Whether this node is red.\r\n */\r\n LLRBEmptyNode.prototype.isRed_ = function () {\r\n return false;\r\n };\r\n return LLRBEmptyNode;\r\n}());\r\n/**\r\n * An immutable sorted map implementation, based on a Left-leaning Red-Black\r\n * tree.\r\n */\r\nvar SortedMap = /** @class */ (function () {\r\n /**\r\n * @template K, V\r\n * @param {function(K, K):number} comparator_ Key comparator.\r\n * @param {LLRBNode=} root_ (Optional) Root node for the map.\r\n */\r\n function SortedMap(comparator_, root_) {\r\n if (root_ === void 0) { root_ = SortedMap.EMPTY_NODE; }\r\n this.comparator_ = comparator_;\r\n this.root_ = root_;\r\n }\r\n /**\r\n * Returns a copy of the map, with the specified key/value added or replaced.\r\n * (TODO: We should perhaps rename this method to 'put')\r\n *\r\n * @param {!K} key Key to be added.\r\n * @param {!V} value Value to be added.\r\n * @return {!SortedMap.<K, V>} New map, with item added.\r\n */\r\n SortedMap.prototype.insert = function (key, value) {\r\n return new SortedMap(this.comparator_, this.root_\r\n .insert(key, value, this.comparator_)\r\n .copy(null, null, LLRBNode.BLACK, null, null));\r\n };\r\n /**\r\n * Returns a copy of the map, with the specified key removed.\r\n *\r\n * @param {!K} key The key to remove.\r\n * @return {!SortedMap.<K, V>} New map, with item removed.\r\n */\r\n SortedMap.prototype.remove = function (key) {\r\n return new SortedMap(this.comparator_, this.root_\r\n .remove(key, this.comparator_)\r\n .copy(null, null, LLRBNode.BLACK, null, null));\r\n };\r\n /**\r\n * Returns the value of the node with the given key, or null.\r\n *\r\n * @param {!K} key The key to look up.\r\n * @return {?V} The value of the node with the given key, or null if the\r\n * key doesn't exist.\r\n */\r\n SortedMap.prototype.get = function (key) {\r\n var cmp;\r\n var node = this.root_;\r\n while (!node.isEmpty()) {\r\n cmp = this.comparator_(key, node.key);\r\n if (cmp === 0) {\r\n return node.value;\r\n }\r\n else if (cmp < 0) {\r\n node = node.left;\r\n }\r\n else if (cmp > 0) {\r\n node = node.right;\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * Returns the key of the item *before* the specified key, or null if key is the first item.\r\n * @param {K} key The key to find the predecessor of\r\n * @return {?K} The predecessor key.\r\n */\r\n SortedMap.prototype.getPredecessorKey = function (key) {\r\n var cmp, node = this.root_, rightParent = null;\r\n while (!node.isEmpty()) {\r\n cmp = this.comparator_(key, node.key);\r\n if (cmp === 0) {\r\n if (!node.left.isEmpty()) {\r\n node = node.left;\r\n while (!node.right.isEmpty()) {\r\n node = node.right;\r\n }\r\n return node.key;\r\n }\r\n else if (rightParent) {\r\n return rightParent.key;\r\n }\r\n else {\r\n return null; // first item.\r\n }\r\n }\r\n else if (cmp < 0) {\r\n node = node.left;\r\n }\r\n else if (cmp > 0) {\r\n rightParent = node;\r\n node = node.right;\r\n }\r\n }\r\n throw new Error('Attempted to find predecessor key for a nonexistent key. What gives?');\r\n };\r\n /**\r\n * @return {boolean} True if the map is empty.\r\n */\r\n SortedMap.prototype.isEmpty = function () {\r\n return this.root_.isEmpty();\r\n };\r\n /**\r\n * @return {number} The total number of nodes in the map.\r\n */\r\n SortedMap.prototype.count = function () {\r\n return this.root_.count();\r\n };\r\n /**\r\n * @return {?K} The minimum key in the map.\r\n */\r\n SortedMap.prototype.minKey = function () {\r\n return this.root_.minKey();\r\n };\r\n /**\r\n * @return {?K} The maximum key in the map.\r\n */\r\n SortedMap.prototype.maxKey = function () {\r\n return this.root_.maxKey();\r\n };\r\n /**\r\n * Traverses the map in key order and calls the specified action function\r\n * for each key/value pair.\r\n *\r\n * @param {function(!K, !V):*} action Callback function to be called\r\n * for each key/value pair. If action returns true, traversal is aborted.\r\n * @return {*} The first truthy value returned by action, or the last falsey\r\n * value returned by action\r\n */\r\n SortedMap.prototype.inorderTraversal = function (action) {\r\n return this.root_.inorderTraversal(action);\r\n };\r\n /**\r\n * Traverses the map in reverse key order and calls the specified action function\r\n * for each key/value pair.\r\n *\r\n * @param {function(!Object, !Object)} action Callback function to be called\r\n * for each key/value pair. If action returns true, traversal is aborted.\r\n * @return {*} True if the traversal was aborted.\r\n */\r\n SortedMap.prototype.reverseTraversal = function (action) {\r\n return this.root_.reverseTraversal(action);\r\n };\r\n /**\r\n * Returns an iterator over the SortedMap.\r\n * @template T\r\n * @param {(function(K, V):T)=} resultGenerator\r\n * @return {SortedMapIterator.<K, V, T>} The iterator.\r\n */\r\n SortedMap.prototype.getIterator = function (resultGenerator) {\r\n return new SortedMapIterator(this.root_, null, this.comparator_, false, resultGenerator);\r\n };\r\n SortedMap.prototype.getIteratorFrom = function (key, resultGenerator) {\r\n return new SortedMapIterator(this.root_, key, this.comparator_, false, resultGenerator);\r\n };\r\n SortedMap.prototype.getReverseIteratorFrom = function (key, resultGenerator) {\r\n return new SortedMapIterator(this.root_, key, this.comparator_, true, resultGenerator);\r\n };\r\n SortedMap.prototype.getReverseIterator = function (resultGenerator) {\r\n return new SortedMapIterator(this.root_, null, this.comparator_, true, resultGenerator);\r\n };\r\n /**\r\n * Always use the same empty node, to reduce memory.\r\n * @const\r\n */\r\n SortedMap.EMPTY_NODE = new LLRBEmptyNode();\r\n return SortedMap;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar LOG_2 = Math.log(2);\r\n/**\r\n * @constructor\r\n */\r\nvar Base12Num = /** @class */ (function () {\r\n /**\r\n * @param {number} length\r\n */\r\n function Base12Num(length) {\r\n var logBase2 = function (num) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return parseInt((Math.log(num) / LOG_2), 10);\r\n };\r\n var bitMask = function (bits) { return parseInt(Array(bits + 1).join('1'), 2); };\r\n this.count = logBase2(length + 1);\r\n this.current_ = this.count - 1;\r\n var mask = bitMask(this.count);\r\n this.bits_ = (length + 1) & mask;\r\n }\r\n /**\r\n * @return {boolean}\r\n */\r\n Base12Num.prototype.nextBitIsOne = function () {\r\n //noinspection JSBitwiseOperatorUsage\r\n var result = !(this.bits_ & (0x1 << this.current_));\r\n this.current_--;\r\n return result;\r\n };\r\n return Base12Num;\r\n}());\r\n/**\r\n * Takes a list of child nodes and constructs a SortedSet using the given comparison\r\n * function\r\n *\r\n * Uses the algorithm described in the paper linked here:\r\n * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.46.1458\r\n *\r\n * @template K, V\r\n * @param {Array.<!NamedNode>} childList Unsorted list of children\r\n * @param {function(!NamedNode, !NamedNode):number} cmp The comparison method to be used\r\n * @param {(function(NamedNode):K)=} keyFn An optional function to extract K from a node wrapper, if K's\r\n * type is not NamedNode\r\n * @param {(function(K, K):number)=} mapSortFn An optional override for comparator used by the generated sorted map\r\n * @return {SortedMap.<K, V>}\r\n */\r\nvar buildChildSet = function (childList, cmp, keyFn, mapSortFn) {\r\n childList.sort(cmp);\r\n var buildBalancedTree = function (low, high) {\r\n var length = high - low;\r\n var namedNode;\r\n var key;\r\n if (length === 0) {\r\n return null;\r\n }\r\n else if (length === 1) {\r\n namedNode = childList[low];\r\n key = keyFn ? keyFn(namedNode) : namedNode;\r\n return new LLRBNode(key, namedNode.node, LLRBNode.BLACK, null, null);\r\n }\r\n else {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n var middle = parseInt((length / 2), 10) + low;\r\n var left = buildBalancedTree(low, middle);\r\n var right = buildBalancedTree(middle + 1, high);\r\n namedNode = childList[middle];\r\n key = keyFn ? keyFn(namedNode) : namedNode;\r\n return new LLRBNode(key, namedNode.node, LLRBNode.BLACK, left, right);\r\n }\r\n };\r\n var buildFrom12Array = function (base12) {\r\n var node = null;\r\n var root = null;\r\n var index = childList.length;\r\n var buildPennant = function (chunkSize, color) {\r\n var low = index - chunkSize;\r\n var high = index;\r\n index -= chunkSize;\r\n var childTree = buildBalancedTree(low + 1, high);\r\n var namedNode = childList[low];\r\n var key = keyFn ? keyFn(namedNode) : namedNode;\r\n attachPennant(new LLRBNode(key, namedNode.node, color, null, childTree));\r\n };\r\n var attachPennant = function (pennant) {\r\n if (node) {\r\n node.left = pennant;\r\n node = pennant;\r\n }\r\n else {\r\n root = pennant;\r\n node = pennant;\r\n }\r\n };\r\n for (var i = 0; i < base12.count; ++i) {\r\n var isOne = base12.nextBitIsOne();\r\n // The number of nodes taken in each slice is 2^(arr.length - (i + 1))\r\n var chunkSize = Math.pow(2, base12.count - (i + 1));\r\n if (isOne) {\r\n buildPennant(chunkSize, LLRBNode.BLACK);\r\n }\r\n else {\r\n // current == 2\r\n buildPennant(chunkSize, LLRBNode.BLACK);\r\n buildPennant(chunkSize, LLRBNode.RED);\r\n }\r\n }\r\n return root;\r\n };\r\n var base12 = new Base12Num(childList.length);\r\n var root = buildFrom12Array(base12);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return new SortedMap(mapSortFn || cmp, root);\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar _defaultIndexMap;\r\nvar fallbackObject = {};\r\nvar IndexMap = /** @class */ (function () {\r\n function IndexMap(indexes_, indexSet_) {\r\n this.indexes_ = indexes_;\r\n this.indexSet_ = indexSet_;\r\n }\r\n Object.defineProperty(IndexMap, \"Default\", {\r\n /**\r\n * The default IndexMap for nodes without a priority\r\n */\r\n get: function () {\r\n assert(fallbackObject && PRIORITY_INDEX, 'ChildrenNode.ts has not been loaded');\r\n _defaultIndexMap =\r\n _defaultIndexMap ||\r\n new IndexMap({ '.priority': fallbackObject }, { '.priority': PRIORITY_INDEX });\r\n return _defaultIndexMap;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n IndexMap.prototype.get = function (indexKey) {\r\n var sortedMap = safeGet(this.indexes_, indexKey);\r\n if (!sortedMap) {\r\n throw new Error('No index defined for ' + indexKey);\r\n }\r\n if (sortedMap instanceof SortedMap) {\r\n return sortedMap;\r\n }\r\n else {\r\n // The index exists, but it falls back to just name comparison. Return null so that the calling code uses the\r\n // regular child map\r\n return null;\r\n }\r\n };\r\n IndexMap.prototype.hasIndex = function (indexDefinition) {\r\n return contains(this.indexSet_, indexDefinition.toString());\r\n };\r\n IndexMap.prototype.addIndex = function (indexDefinition, existingChildren) {\r\n assert(indexDefinition !== KEY_INDEX, \"KeyIndex always exists and isn't meant to be added to the IndexMap.\");\r\n var childList = [];\r\n var sawIndexedValue = false;\r\n var iter = existingChildren.getIterator(NamedNode.Wrap);\r\n var next = iter.getNext();\r\n while (next) {\r\n sawIndexedValue =\r\n sawIndexedValue || indexDefinition.isDefinedOn(next.node);\r\n childList.push(next);\r\n next = iter.getNext();\r\n }\r\n var newIndex;\r\n if (sawIndexedValue) {\r\n newIndex = buildChildSet(childList, indexDefinition.getCompare());\r\n }\r\n else {\r\n newIndex = fallbackObject;\r\n }\r\n var indexName = indexDefinition.toString();\r\n var newIndexSet = __assign({}, this.indexSet_);\r\n newIndexSet[indexName] = indexDefinition;\r\n var newIndexes = __assign({}, this.indexes_);\r\n newIndexes[indexName] = newIndex;\r\n return new IndexMap(newIndexes, newIndexSet);\r\n };\r\n /**\r\n * Ensure that this node is properly tracked in any indexes that we're maintaining\r\n */\r\n IndexMap.prototype.addToIndexes = function (namedNode, existingChildren) {\r\n var _this = this;\r\n var newIndexes = map(this.indexes_, function (indexedChildren, indexName) {\r\n var index = safeGet(_this.indexSet_, indexName);\r\n assert(index, 'Missing index implementation for ' + indexName);\r\n if (indexedChildren === fallbackObject) {\r\n // Check to see if we need to index everything\r\n if (index.isDefinedOn(namedNode.node)) {\r\n // We need to build this index\r\n var childList = [];\r\n var iter = existingChildren.getIterator(NamedNode.Wrap);\r\n var next = iter.getNext();\r\n while (next) {\r\n if (next.name !== namedNode.name) {\r\n childList.push(next);\r\n }\r\n next = iter.getNext();\r\n }\r\n childList.push(namedNode);\r\n return buildChildSet(childList, index.getCompare());\r\n }\r\n else {\r\n // No change, this remains a fallback\r\n return fallbackObject;\r\n }\r\n }\r\n else {\r\n var existingSnap = existingChildren.get(namedNode.name);\r\n var newChildren = indexedChildren;\r\n if (existingSnap) {\r\n newChildren = newChildren.remove(new NamedNode(namedNode.name, existingSnap));\r\n }\r\n return newChildren.insert(namedNode, namedNode.node);\r\n }\r\n });\r\n return new IndexMap(newIndexes, this.indexSet_);\r\n };\r\n /**\r\n * Create a new IndexMap instance with the given value removed\r\n */\r\n IndexMap.prototype.removeFromIndexes = function (namedNode, existingChildren) {\r\n var newIndexes = map(this.indexes_, function (indexedChildren) {\r\n if (indexedChildren === fallbackObject) {\r\n // This is the fallback. Just return it, nothing to do in this case\r\n return indexedChildren;\r\n }\r\n else {\r\n var existingSnap = existingChildren.get(namedNode.name);\r\n if (existingSnap) {\r\n return indexedChildren.remove(new NamedNode(namedNode.name, existingSnap));\r\n }\r\n else {\r\n // No record of this child\r\n return indexedChildren;\r\n }\r\n }\r\n });\r\n return new IndexMap(newIndexes, this.indexSet_);\r\n };\r\n return IndexMap;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction NAME_ONLY_COMPARATOR(left, right) {\r\n return nameCompare(left.name, right.name);\r\n}\r\nfunction NAME_COMPARATOR(left, right) {\r\n return nameCompare(left, right);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// TODO: For memory savings, don't store priorityNode_ if it's empty.\r\nvar EMPTY_NODE;\r\n/**\r\n * ChildrenNode is a class for storing internal nodes in a DataSnapshot\r\n * (i.e. nodes with children). It implements Node and stores the\r\n * list of children in the children property, sorted by child name.\r\n *\r\n * @constructor\r\n * @implements {Node}\r\n */\r\nvar ChildrenNode = /** @class */ (function () {\r\n /**\r\n *\r\n * @param {!SortedMap.<string, !Node>} children_ List of children\r\n * of this node..\r\n * @param {?Node} priorityNode_ The priority of this node (as a snapshot node).\r\n * @param {!IndexMap} indexMap_\r\n */\r\n function ChildrenNode(children_, priorityNode_, indexMap_) {\r\n this.children_ = children_;\r\n this.priorityNode_ = priorityNode_;\r\n this.indexMap_ = indexMap_;\r\n this.lazyHash_ = null;\r\n /**\r\n * Note: The only reason we allow null priority is for EMPTY_NODE, since we can't use\r\n * EMPTY_NODE as the priority of EMPTY_NODE. We might want to consider making EMPTY_NODE its own\r\n * class instead of an empty ChildrenNode.\r\n */\r\n if (this.priorityNode_) {\r\n validatePriorityNode(this.priorityNode_);\r\n }\r\n if (this.children_.isEmpty()) {\r\n assert(!this.priorityNode_ || this.priorityNode_.isEmpty(), 'An empty node cannot have a priority');\r\n }\r\n }\r\n Object.defineProperty(ChildrenNode, \"EMPTY_NODE\", {\r\n get: function () {\r\n return (EMPTY_NODE ||\r\n (EMPTY_NODE = new ChildrenNode(new SortedMap(NAME_COMPARATOR), null, IndexMap.Default)));\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.isLeafNode = function () {\r\n return false;\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.getPriority = function () {\r\n return this.priorityNode_ || EMPTY_NODE;\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.updatePriority = function (newPriorityNode) {\r\n if (this.children_.isEmpty()) {\r\n // Don't allow priorities on empty nodes\r\n return this;\r\n }\r\n else {\r\n return new ChildrenNode(this.children_, newPriorityNode, this.indexMap_);\r\n }\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.getImmediateChild = function (childName) {\r\n // Hack to treat priority as a regular child\r\n if (childName === '.priority') {\r\n return this.getPriority();\r\n }\r\n else {\r\n var child = this.children_.get(childName);\r\n return child === null ? EMPTY_NODE : child;\r\n }\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.getChild = function (path) {\r\n var front = path.getFront();\r\n if (front === null) {\r\n return this;\r\n }\r\n return this.getImmediateChild(front).getChild(path.popFront());\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.hasChild = function (childName) {\r\n return this.children_.get(childName) !== null;\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.updateImmediateChild = function (childName, newChildNode) {\r\n assert(newChildNode, 'We should always be passing snapshot nodes');\r\n if (childName === '.priority') {\r\n return this.updatePriority(newChildNode);\r\n }\r\n else {\r\n var namedNode = new NamedNode(childName, newChildNode);\r\n var newChildren = void 0, newIndexMap = void 0;\r\n if (newChildNode.isEmpty()) {\r\n newChildren = this.children_.remove(childName);\r\n newIndexMap = this.indexMap_.removeFromIndexes(namedNode, this.children_);\r\n }\r\n else {\r\n newChildren = this.children_.insert(childName, newChildNode);\r\n newIndexMap = this.indexMap_.addToIndexes(namedNode, this.children_);\r\n }\r\n var newPriority = newChildren.isEmpty()\r\n ? EMPTY_NODE\r\n : this.priorityNode_;\r\n return new ChildrenNode(newChildren, newPriority, newIndexMap);\r\n }\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.updateChild = function (path, newChildNode) {\r\n var front = path.getFront();\r\n if (front === null) {\r\n return newChildNode;\r\n }\r\n else {\r\n assert(path.getFront() !== '.priority' || path.getLength() === 1, '.priority must be the last token in a path');\r\n var newImmediateChild = this.getImmediateChild(front).updateChild(path.popFront(), newChildNode);\r\n return this.updateImmediateChild(front, newImmediateChild);\r\n }\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.isEmpty = function () {\r\n return this.children_.isEmpty();\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.numChildren = function () {\r\n return this.children_.count();\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.val = function (exportFormat) {\r\n if (this.isEmpty()) {\r\n return null;\r\n }\r\n var obj = {};\r\n var numKeys = 0, maxKey = 0, allIntegerKeys = true;\r\n this.forEachChild(PRIORITY_INDEX, function (key, childNode) {\r\n obj[key] = childNode.val(exportFormat);\r\n numKeys++;\r\n if (allIntegerKeys && ChildrenNode.INTEGER_REGEXP_.test(key)) {\r\n maxKey = Math.max(maxKey, Number(key));\r\n }\r\n else {\r\n allIntegerKeys = false;\r\n }\r\n });\r\n if (!exportFormat && allIntegerKeys && maxKey < 2 * numKeys) {\r\n // convert to array.\r\n var array = [];\r\n // eslint-disable-next-line guard-for-in\r\n for (var key in obj) {\r\n array[key] = obj[key];\r\n }\r\n return array;\r\n }\r\n else {\r\n if (exportFormat && !this.getPriority().isEmpty()) {\r\n obj['.priority'] = this.getPriority().val();\r\n }\r\n return obj;\r\n }\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.hash = function () {\r\n if (this.lazyHash_ === null) {\r\n var toHash_1 = '';\r\n if (!this.getPriority().isEmpty()) {\r\n toHash_1 +=\r\n 'priority:' +\r\n priorityHashText(this.getPriority().val()) +\r\n ':';\r\n }\r\n this.forEachChild(PRIORITY_INDEX, function (key, childNode) {\r\n var childHash = childNode.hash();\r\n if (childHash !== '') {\r\n toHash_1 += ':' + key + ':' + childHash;\r\n }\r\n });\r\n this.lazyHash_ = toHash_1 === '' ? '' : sha1(toHash_1);\r\n }\r\n return this.lazyHash_;\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.getPredecessorChildName = function (childName, childNode, index) {\r\n var idx = this.resolveIndex_(index);\r\n if (idx) {\r\n var predecessor = idx.getPredecessorKey(new NamedNode(childName, childNode));\r\n return predecessor ? predecessor.name : null;\r\n }\r\n else {\r\n return this.children_.getPredecessorKey(childName);\r\n }\r\n };\r\n /**\r\n * @param {!Index} indexDefinition\r\n * @return {?string}\r\n */\r\n ChildrenNode.prototype.getFirstChildName = function (indexDefinition) {\r\n var idx = this.resolveIndex_(indexDefinition);\r\n if (idx) {\r\n var minKey = idx.minKey();\r\n return minKey && minKey.name;\r\n }\r\n else {\r\n return this.children_.minKey();\r\n }\r\n };\r\n /**\r\n * @param {!Index} indexDefinition\r\n * @return {?NamedNode}\r\n */\r\n ChildrenNode.prototype.getFirstChild = function (indexDefinition) {\r\n var minKey = this.getFirstChildName(indexDefinition);\r\n if (minKey) {\r\n return new NamedNode(minKey, this.children_.get(minKey));\r\n }\r\n else {\r\n return null;\r\n }\r\n };\r\n /**\r\n * Given an index, return the key name of the largest value we have, according to that index\r\n * @param {!Index} indexDefinition\r\n * @return {?string}\r\n */\r\n ChildrenNode.prototype.getLastChildName = function (indexDefinition) {\r\n var idx = this.resolveIndex_(indexDefinition);\r\n if (idx) {\r\n var maxKey = idx.maxKey();\r\n return maxKey && maxKey.name;\r\n }\r\n else {\r\n return this.children_.maxKey();\r\n }\r\n };\r\n /**\r\n * @param {!Index} indexDefinition\r\n * @return {?NamedNode}\r\n */\r\n ChildrenNode.prototype.getLastChild = function (indexDefinition) {\r\n var maxKey = this.getLastChildName(indexDefinition);\r\n if (maxKey) {\r\n return new NamedNode(maxKey, this.children_.get(maxKey));\r\n }\r\n else {\r\n return null;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildrenNode.prototype.forEachChild = function (index, action) {\r\n var idx = this.resolveIndex_(index);\r\n if (idx) {\r\n return idx.inorderTraversal(function (wrappedNode) {\r\n return action(wrappedNode.name, wrappedNode.node);\r\n });\r\n }\r\n else {\r\n return this.children_.inorderTraversal(action);\r\n }\r\n };\r\n /**\r\n * @param {!Index} indexDefinition\r\n * @return {SortedMapIterator}\r\n */\r\n ChildrenNode.prototype.getIterator = function (indexDefinition) {\r\n return this.getIteratorFrom(indexDefinition.minPost(), indexDefinition);\r\n };\r\n /**\r\n *\r\n * @param {!NamedNode} startPost\r\n * @param {!Index} indexDefinition\r\n * @return {!SortedMapIterator}\r\n */\r\n ChildrenNode.prototype.getIteratorFrom = function (startPost, indexDefinition) {\r\n var idx = this.resolveIndex_(indexDefinition);\r\n if (idx) {\r\n return idx.getIteratorFrom(startPost, function (key) { return key; });\r\n }\r\n else {\r\n var iterator = this.children_.getIteratorFrom(startPost.name, NamedNode.Wrap);\r\n var next = iterator.peek();\r\n while (next != null && indexDefinition.compare(next, startPost) < 0) {\r\n iterator.getNext();\r\n next = iterator.peek();\r\n }\r\n return iterator;\r\n }\r\n };\r\n /**\r\n * @param {!Index} indexDefinition\r\n * @return {!SortedMapIterator}\r\n */\r\n ChildrenNode.prototype.getReverseIterator = function (indexDefinition) {\r\n return this.getReverseIteratorFrom(indexDefinition.maxPost(), indexDefinition);\r\n };\r\n /**\r\n * @param {!NamedNode} endPost\r\n * @param {!Index} indexDefinition\r\n * @return {!SortedMapIterator}\r\n */\r\n ChildrenNode.prototype.getReverseIteratorFrom = function (endPost, indexDefinition) {\r\n var idx = this.resolveIndex_(indexDefinition);\r\n if (idx) {\r\n return idx.getReverseIteratorFrom(endPost, function (key) {\r\n return key;\r\n });\r\n }\r\n else {\r\n var iterator = this.children_.getReverseIteratorFrom(endPost.name, NamedNode.Wrap);\r\n var next = iterator.peek();\r\n while (next != null && indexDefinition.compare(next, endPost) > 0) {\r\n iterator.getNext();\r\n next = iterator.peek();\r\n }\r\n return iterator;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildrenNode.prototype.compareTo = function (other) {\r\n if (this.isEmpty()) {\r\n if (other.isEmpty()) {\r\n return 0;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n else if (other.isLeafNode() || other.isEmpty()) {\r\n return 1;\r\n }\r\n else if (other === MAX_NODE$2) {\r\n return -1;\r\n }\r\n else {\r\n // Must be another node with children.\r\n return 0;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildrenNode.prototype.withIndex = function (indexDefinition) {\r\n if (indexDefinition === KEY_INDEX ||\r\n this.indexMap_.hasIndex(indexDefinition)) {\r\n return this;\r\n }\r\n else {\r\n var newIndexMap = this.indexMap_.addIndex(indexDefinition, this.children_);\r\n return new ChildrenNode(this.children_, this.priorityNode_, newIndexMap);\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildrenNode.prototype.isIndexed = function (index) {\r\n return index === KEY_INDEX || this.indexMap_.hasIndex(index);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildrenNode.prototype.equals = function (other) {\r\n if (other === this) {\r\n return true;\r\n }\r\n else if (other.isLeafNode()) {\r\n return false;\r\n }\r\n else {\r\n var otherChildrenNode = other;\r\n if (!this.getPriority().equals(otherChildrenNode.getPriority())) {\r\n return false;\r\n }\r\n else if (this.children_.count() === otherChildrenNode.children_.count()) {\r\n var thisIter = this.getIterator(PRIORITY_INDEX);\r\n var otherIter = otherChildrenNode.getIterator(PRIORITY_INDEX);\r\n var thisCurrent = thisIter.getNext();\r\n var otherCurrent = otherIter.getNext();\r\n while (thisCurrent && otherCurrent) {\r\n if (thisCurrent.name !== otherCurrent.name ||\r\n !thisCurrent.node.equals(otherCurrent.node)) {\r\n return false;\r\n }\r\n thisCurrent = thisIter.getNext();\r\n otherCurrent = otherIter.getNext();\r\n }\r\n return thisCurrent === null && otherCurrent === null;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n };\r\n /**\r\n * Returns a SortedMap ordered by index, or null if the default (by-key) ordering can be used\r\n * instead.\r\n *\r\n * @private\r\n * @param {!Index} indexDefinition\r\n * @return {?SortedMap.<NamedNode, Node>}\r\n */\r\n ChildrenNode.prototype.resolveIndex_ = function (indexDefinition) {\r\n if (indexDefinition === KEY_INDEX) {\r\n return null;\r\n }\r\n else {\r\n return this.indexMap_.get(indexDefinition.toString());\r\n }\r\n };\r\n /**\r\n * @private\r\n * @type {RegExp}\r\n */\r\n ChildrenNode.INTEGER_REGEXP_ = /^(0|[1-9]\\d*)$/;\r\n return ChildrenNode;\r\n}());\r\n/**\r\n * @constructor\r\n * @extends {ChildrenNode}\r\n * @private\r\n */\r\nvar MaxNode = /** @class */ (function (_super) {\r\n __extends(MaxNode, _super);\r\n function MaxNode() {\r\n return _super.call(this, new SortedMap(NAME_COMPARATOR), ChildrenNode.EMPTY_NODE, IndexMap.Default) || this;\r\n }\r\n MaxNode.prototype.compareTo = function (other) {\r\n if (other === this) {\r\n return 0;\r\n }\r\n else {\r\n return 1;\r\n }\r\n };\r\n MaxNode.prototype.equals = function (other) {\r\n // Not that we every compare it, but MAX_NODE is only ever equal to itself\r\n return other === this;\r\n };\r\n MaxNode.prototype.getPriority = function () {\r\n return this;\r\n };\r\n MaxNode.prototype.getImmediateChild = function (childName) {\r\n return ChildrenNode.EMPTY_NODE;\r\n };\r\n MaxNode.prototype.isEmpty = function () {\r\n return false;\r\n };\r\n return MaxNode;\r\n}(ChildrenNode));\r\n/**\r\n * Marker that will sort higher than any other snapshot.\r\n * @type {!MAX_NODE}\r\n * @const\r\n */\r\nvar MAX_NODE$2 = new MaxNode();\r\nObject.defineProperties(NamedNode, {\r\n MIN: {\r\n value: new NamedNode(MIN_NAME, ChildrenNode.EMPTY_NODE)\r\n },\r\n MAX: {\r\n value: new NamedNode(MAX_NAME, MAX_NODE$2)\r\n }\r\n});\r\n/**\r\n * Reference Extensions\r\n */\r\nKeyIndex.__EMPTY_NODE = ChildrenNode.EMPTY_NODE;\r\nLeafNode.__childrenNodeConstructor = ChildrenNode;\r\nsetMaxNode(MAX_NODE$2);\r\nsetMaxNode$1(MAX_NODE$2);\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar USE_HINZE = true;\r\n/**\r\n * Constructs a snapshot node representing the passed JSON and returns it.\r\n * @param {*} json JSON to create a node for.\r\n * @param {?string|?number=} priority Optional priority to use. This will be ignored if the\r\n * passed JSON contains a .priority property.\r\n * @return {!Node}\r\n */\r\nfunction nodeFromJSON$1(json, priority) {\r\n if (priority === void 0) { priority = null; }\r\n if (json === null) {\r\n return ChildrenNode.EMPTY_NODE;\r\n }\r\n if (typeof json === 'object' && '.priority' in json) {\r\n priority = json['.priority'];\r\n }\r\n assert(priority === null ||\r\n typeof priority === 'string' ||\r\n typeof priority === 'number' ||\r\n (typeof priority === 'object' && '.sv' in priority), 'Invalid priority type found: ' + typeof priority);\r\n if (typeof json === 'object' && '.value' in json && json['.value'] !== null) {\r\n json = json['.value'];\r\n }\r\n // Valid leaf nodes include non-objects or server-value wrapper objects\r\n if (typeof json !== 'object' || '.sv' in json) {\r\n var jsonLeaf = json;\r\n return new LeafNode(jsonLeaf, nodeFromJSON$1(priority));\r\n }\r\n if (!(json instanceof Array) && USE_HINZE) {\r\n var children_1 = [];\r\n var childrenHavePriority_1 = false;\r\n var hinzeJsonObj = json;\r\n each(hinzeJsonObj, function (key, child) {\r\n if (key.substring(0, 1) !== '.') {\r\n // Ignore metadata nodes\r\n var childNode = nodeFromJSON$1(child);\r\n if (!childNode.isEmpty()) {\r\n childrenHavePriority_1 =\r\n childrenHavePriority_1 || !childNode.getPriority().isEmpty();\r\n children_1.push(new NamedNode(key, childNode));\r\n }\r\n }\r\n });\r\n if (children_1.length === 0) {\r\n return ChildrenNode.EMPTY_NODE;\r\n }\r\n var childSet = buildChildSet(children_1, NAME_ONLY_COMPARATOR, function (namedNode) { return namedNode.name; }, NAME_COMPARATOR);\r\n if (childrenHavePriority_1) {\r\n var sortedChildSet = buildChildSet(children_1, PRIORITY_INDEX.getCompare());\r\n return new ChildrenNode(childSet, nodeFromJSON$1(priority), new IndexMap({ '.priority': sortedChildSet }, { '.priority': PRIORITY_INDEX }));\r\n }\r\n else {\r\n return new ChildrenNode(childSet, nodeFromJSON$1(priority), IndexMap.Default);\r\n }\r\n }\r\n else {\r\n var node_1 = ChildrenNode.EMPTY_NODE;\r\n each(json, function (key, childData) {\r\n if (contains(json, key)) {\r\n if (key.substring(0, 1) !== '.') {\r\n // ignore metadata nodes.\r\n var childNode = nodeFromJSON$1(childData);\r\n if (childNode.isLeafNode() || !childNode.isEmpty()) {\r\n node_1 = node_1.updateImmediateChild(key, childNode);\r\n }\r\n }\r\n }\r\n });\r\n return node_1.updatePriority(nodeFromJSON$1(priority));\r\n }\r\n}\r\nsetNodeFromJSON(nodeFromJSON$1);\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @constructor\r\n * @extends {Index}\r\n * @private\r\n */\r\nvar ValueIndex = /** @class */ (function (_super) {\r\n __extends(ValueIndex, _super);\r\n function ValueIndex() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueIndex.prototype.compare = function (a, b) {\r\n var indexCmp = a.node.compareTo(b.node);\r\n if (indexCmp === 0) {\r\n return nameCompare(a.name, b.name);\r\n }\r\n else {\r\n return indexCmp;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueIndex.prototype.isDefinedOn = function (node) {\r\n return true;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueIndex.prototype.indexedValueChanged = function (oldNode, newNode) {\r\n return !oldNode.equals(newNode);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueIndex.prototype.minPost = function () {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return NamedNode.MIN;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueIndex.prototype.maxPost = function () {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return NamedNode.MAX;\r\n };\r\n /**\r\n * @param {*} indexValue\r\n * @param {string} name\r\n * @return {!NamedNode}\r\n */\r\n ValueIndex.prototype.makePost = function (indexValue, name) {\r\n var valueNode = nodeFromJSON$1(indexValue);\r\n return new NamedNode(name, valueNode);\r\n };\r\n /**\r\n * @return {!string} String representation for inclusion in a query spec\r\n */\r\n ValueIndex.prototype.toString = function () {\r\n return '.value';\r\n };\r\n return ValueIndex;\r\n}(Index));\r\nvar VALUE_INDEX = new ValueIndex();\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @param {!Path} indexPath\r\n * @constructor\r\n * @extends {Index}\r\n */\r\nvar PathIndex = /** @class */ (function (_super) {\r\n __extends(PathIndex, _super);\r\n function PathIndex(indexPath_) {\r\n var _this = _super.call(this) || this;\r\n _this.indexPath_ = indexPath_;\r\n assert(!indexPath_.isEmpty() && indexPath_.getFront() !== '.priority', \"Can't create PathIndex with empty path or .priority key\");\r\n return _this;\r\n }\r\n /**\r\n * @param {!Node} snap\r\n * @return {!Node}\r\n * @protected\r\n */\r\n PathIndex.prototype.extractChild = function (snap) {\r\n return snap.getChild(this.indexPath_);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PathIndex.prototype.isDefinedOn = function (node) {\r\n return !node.getChild(this.indexPath_).isEmpty();\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PathIndex.prototype.compare = function (a, b) {\r\n var aChild = this.extractChild(a.node);\r\n var bChild = this.extractChild(b.node);\r\n var indexCmp = aChild.compareTo(bChild);\r\n if (indexCmp === 0) {\r\n return nameCompare(a.name, b.name);\r\n }\r\n else {\r\n return indexCmp;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PathIndex.prototype.makePost = function (indexValue, name) {\r\n var valueNode = nodeFromJSON$1(indexValue);\r\n var node = ChildrenNode.EMPTY_NODE.updateChild(this.indexPath_, valueNode);\r\n return new NamedNode(name, node);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PathIndex.prototype.maxPost = function () {\r\n var node = ChildrenNode.EMPTY_NODE.updateChild(this.indexPath_, MAX_NODE$2);\r\n return new NamedNode(MAX_NAME, node);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PathIndex.prototype.toString = function () {\r\n return this.indexPath_.slice().join('/');\r\n };\r\n return PathIndex;\r\n}(Index));\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Class representing a firebase data snapshot. It wraps a SnapshotNode and\r\n * surfaces the public methods (val, forEach, etc.) we want to expose.\r\n */\r\nvar DataSnapshot = /** @class */ (function () {\r\n /**\r\n * @param {!Node} node_ A SnapshotNode to wrap.\r\n * @param {!Reference} ref_ The ref of the location this snapshot came from.\r\n * @param {!Index} index_ The iteration order for this snapshot\r\n */\r\n function DataSnapshot(node_, ref_, index_) {\r\n this.node_ = node_;\r\n this.ref_ = ref_;\r\n this.index_ = index_;\r\n }\r\n /**\r\n * Retrieves the snapshot contents as JSON. Returns null if the snapshot is\r\n * empty.\r\n *\r\n * @return {*} JSON representation of the DataSnapshot contents, or null if empty.\r\n */\r\n DataSnapshot.prototype.val = function () {\r\n validateArgCount('DataSnapshot.val', 0, 0, arguments.length);\r\n return this.node_.val();\r\n };\r\n /**\r\n * Returns the snapshot contents as JSON, including priorities of node. Suitable for exporting\r\n * the entire node contents.\r\n * @return {*} JSON representation of the DataSnapshot contents, or null if empty.\r\n */\r\n DataSnapshot.prototype.exportVal = function () {\r\n validateArgCount('DataSnapshot.exportVal', 0, 0, arguments.length);\r\n return this.node_.val(true);\r\n };\r\n // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary\r\n // for end-users\r\n DataSnapshot.prototype.toJSON = function () {\r\n // Optional spacer argument is unnecessary because we're depending on recursion rather than stringifying the content\r\n validateArgCount('DataSnapshot.toJSON', 0, 1, arguments.length);\r\n return this.exportVal();\r\n };\r\n /**\r\n * Returns whether the snapshot contains a non-null value.\r\n *\r\n * @return {boolean} Whether the snapshot contains a non-null value, or is empty.\r\n */\r\n DataSnapshot.prototype.exists = function () {\r\n validateArgCount('DataSnapshot.exists', 0, 0, arguments.length);\r\n return !this.node_.isEmpty();\r\n };\r\n /**\r\n * Returns a DataSnapshot of the specified child node's contents.\r\n *\r\n * @param {!string} childPathString Path to a child.\r\n * @return {!DataSnapshot} DataSnapshot for child node.\r\n */\r\n DataSnapshot.prototype.child = function (childPathString) {\r\n validateArgCount('DataSnapshot.child', 0, 1, arguments.length);\r\n // Ensure the childPath is a string (can be a number)\r\n childPathString = String(childPathString);\r\n validatePathString('DataSnapshot.child', 1, childPathString, false);\r\n var childPath = new Path(childPathString);\r\n var childRef = this.ref_.child(childPath);\r\n return new DataSnapshot(this.node_.getChild(childPath), childRef, PRIORITY_INDEX);\r\n };\r\n /**\r\n * Returns whether the snapshot contains a child at the specified path.\r\n *\r\n * @param {!string} childPathString Path to a child.\r\n * @return {boolean} Whether the child exists.\r\n */\r\n DataSnapshot.prototype.hasChild = function (childPathString) {\r\n validateArgCount('DataSnapshot.hasChild', 1, 1, arguments.length);\r\n validatePathString('DataSnapshot.hasChild', 1, childPathString, false);\r\n var childPath = new Path(childPathString);\r\n return !this.node_.getChild(childPath).isEmpty();\r\n };\r\n /**\r\n * Returns the priority of the object, or null if no priority was set.\r\n *\r\n * @return {string|number|null} The priority.\r\n */\r\n DataSnapshot.prototype.getPriority = function () {\r\n validateArgCount('DataSnapshot.getPriority', 0, 0, arguments.length);\r\n // typecast here because we never return deferred values or internal priorities (MAX_PRIORITY)\r\n return this.node_.getPriority().val();\r\n };\r\n /**\r\n * Iterates through child nodes and calls the specified action for each one.\r\n *\r\n * @param {function(!DataSnapshot)} action Callback function to be called\r\n * for each child.\r\n * @return {boolean} True if forEach was canceled by action returning true for\r\n * one of the child nodes.\r\n */\r\n DataSnapshot.prototype.forEach = function (action) {\r\n var _this = this;\r\n validateArgCount('DataSnapshot.forEach', 1, 1, arguments.length);\r\n validateCallback('DataSnapshot.forEach', 1, action, false);\r\n if (this.node_.isLeafNode()) {\r\n return false;\r\n }\r\n var childrenNode = this.node_;\r\n // Sanitize the return value to a boolean. ChildrenNode.forEachChild has a weird return type...\r\n return !!childrenNode.forEachChild(this.index_, function (key, node) {\r\n return action(new DataSnapshot(node, _this.ref_.child(key), PRIORITY_INDEX));\r\n });\r\n };\r\n /**\r\n * Returns whether this DataSnapshot has children.\r\n * @return {boolean} True if the DataSnapshot contains 1 or more child nodes.\r\n */\r\n DataSnapshot.prototype.hasChildren = function () {\r\n validateArgCount('DataSnapshot.hasChildren', 0, 0, arguments.length);\r\n if (this.node_.isLeafNode()) {\r\n return false;\r\n }\r\n else {\r\n return !this.node_.isEmpty();\r\n }\r\n };\r\n Object.defineProperty(DataSnapshot.prototype, \"key\", {\r\n get: function () {\r\n return this.ref_.getKey();\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns the number of children for this DataSnapshot.\r\n * @return {number} The number of children that this DataSnapshot contains.\r\n */\r\n DataSnapshot.prototype.numChildren = function () {\r\n validateArgCount('DataSnapshot.numChildren', 0, 0, arguments.length);\r\n return this.node_.numChildren();\r\n };\r\n /**\r\n * @return {Reference} The Firebase reference for the location this snapshot's data came from.\r\n */\r\n DataSnapshot.prototype.getRef = function () {\r\n validateArgCount('DataSnapshot.ref', 0, 0, arguments.length);\r\n return this.ref_;\r\n };\r\n Object.defineProperty(DataSnapshot.prototype, \"ref\", {\r\n get: function () {\r\n return this.getRef();\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return DataSnapshot;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Encapsulates the data needed to raise an event\r\n * @implements {Event}\r\n */\r\nvar DataEvent = /** @class */ (function () {\r\n /**\r\n * @param {!string} eventType One of: value, child_added, child_changed, child_moved, child_removed\r\n * @param {!EventRegistration} eventRegistration The function to call to with the event data. User provided\r\n * @param {!DataSnapshot} snapshot The data backing the event\r\n * @param {?string=} prevName Optional, the name of the previous child for child_* events.\r\n */\r\n function DataEvent(eventType, eventRegistration, snapshot, prevName) {\r\n this.eventType = eventType;\r\n this.eventRegistration = eventRegistration;\r\n this.snapshot = snapshot;\r\n this.prevName = prevName;\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n DataEvent.prototype.getPath = function () {\r\n var ref = this.snapshot.getRef();\r\n if (this.eventType === 'value') {\r\n return ref.path;\r\n }\r\n else {\r\n return ref.getParent().path;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n DataEvent.prototype.getEventType = function () {\r\n return this.eventType;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n DataEvent.prototype.getEventRunner = function () {\r\n return this.eventRegistration.getEventRunner(this);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n DataEvent.prototype.toString = function () {\r\n return (this.getPath().toString() +\r\n ':' +\r\n this.eventType +\r\n ':' +\r\n stringify(this.snapshot.exportVal()));\r\n };\r\n return DataEvent;\r\n}());\r\nvar CancelEvent = /** @class */ (function () {\r\n /**\r\n * @param {EventRegistration} eventRegistration\r\n * @param {Error} error\r\n * @param {!Path} path\r\n */\r\n function CancelEvent(eventRegistration, error, path) {\r\n this.eventRegistration = eventRegistration;\r\n this.error = error;\r\n this.path = path;\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n CancelEvent.prototype.getPath = function () {\r\n return this.path;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n CancelEvent.prototype.getEventType = function () {\r\n return 'cancel';\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n CancelEvent.prototype.getEventRunner = function () {\r\n return this.eventRegistration.getEventRunner(this);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n CancelEvent.prototype.toString = function () {\r\n return this.path.toString() + ':cancel';\r\n };\r\n return CancelEvent;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Represents registration for 'value' events.\r\n */\r\nvar ValueEventRegistration = /** @class */ (function () {\r\n /**\r\n * @param {?function(!DataSnapshot)} callback_\r\n * @param {?function(Error)} cancelCallback_\r\n * @param {?Object} context_\r\n */\r\n function ValueEventRegistration(callback_, cancelCallback_, context_) {\r\n this.callback_ = callback_;\r\n this.cancelCallback_ = cancelCallback_;\r\n this.context_ = context_;\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueEventRegistration.prototype.respondsTo = function (eventType) {\r\n return eventType === 'value';\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueEventRegistration.prototype.createEvent = function (change, query) {\r\n var index = query.getQueryParams().getIndex();\r\n return new DataEvent('value', this, new DataSnapshot(change.snapshotNode, query.getRef(), index));\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueEventRegistration.prototype.getEventRunner = function (eventData) {\r\n var ctx = this.context_;\r\n if (eventData.getEventType() === 'cancel') {\r\n assert(this.cancelCallback_, 'Raising a cancel event on a listener with no cancel callback');\r\n var cancelCB_1 = this.cancelCallback_;\r\n return function () {\r\n // We know that error exists, we checked above that this is a cancel event\r\n cancelCB_1.call(ctx, eventData.error);\r\n };\r\n }\r\n else {\r\n var cb_1 = this.callback_;\r\n return function () {\r\n cb_1.call(ctx, eventData.snapshot);\r\n };\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueEventRegistration.prototype.createCancelEvent = function (error, path) {\r\n if (this.cancelCallback_) {\r\n return new CancelEvent(this, error, path);\r\n }\r\n else {\r\n return null;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueEventRegistration.prototype.matches = function (other) {\r\n if (!(other instanceof ValueEventRegistration)) {\r\n return false;\r\n }\r\n else if (!other.callback_ || !this.callback_) {\r\n // If no callback specified, we consider it to match any callback.\r\n return true;\r\n }\r\n else {\r\n return (other.callback_ === this.callback_ && other.context_ === this.context_);\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueEventRegistration.prototype.hasAnyCallback = function () {\r\n return this.callback_ !== null;\r\n };\r\n return ValueEventRegistration;\r\n}());\r\n/**\r\n * Represents the registration of 1 or more child_xxx events.\r\n *\r\n * Currently, it is always exactly 1 child_xxx event, but the idea is we might let you\r\n * register a group of callbacks together in the future.\r\n *\r\n * @constructor\r\n * @implements {EventRegistration}\r\n */\r\nvar ChildEventRegistration = /** @class */ (function () {\r\n /**\r\n * @param {?Object.<string, function(!DataSnapshot, ?string=)>} callbacks_\r\n * @param {?function(Error)} cancelCallback_\r\n * @param {Object=} context_\r\n */\r\n function ChildEventRegistration(callbacks_, cancelCallback_, context_) {\r\n this.callbacks_ = callbacks_;\r\n this.cancelCallback_ = cancelCallback_;\r\n this.context_ = context_;\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildEventRegistration.prototype.respondsTo = function (eventType) {\r\n var eventToCheck = eventType === 'children_added' ? 'child_added' : eventType;\r\n eventToCheck =\r\n eventToCheck === 'children_removed' ? 'child_removed' : eventToCheck;\r\n return contains(this.callbacks_, eventToCheck);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildEventRegistration.prototype.createCancelEvent = function (error, path) {\r\n if (this.cancelCallback_) {\r\n return new CancelEvent(this, error, path);\r\n }\r\n else {\r\n return null;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildEventRegistration.prototype.createEvent = function (change, query) {\r\n assert(change.childName != null, 'Child events should have a childName.');\r\n var ref = query.getRef().child(/** @type {!string} */ change.childName);\r\n var index = query.getQueryParams().getIndex();\r\n return new DataEvent(change.type, this, new DataSnapshot(change.snapshotNode, ref, index), change.prevName);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildEventRegistration.prototype.getEventRunner = function (eventData) {\r\n var ctx = this.context_;\r\n if (eventData.getEventType() === 'cancel') {\r\n assert(this.cancelCallback_, 'Raising a cancel event on a listener with no cancel callback');\r\n var cancelCB_2 = this.cancelCallback_;\r\n return function () {\r\n // We know that error exists, we checked above that this is a cancel event\r\n cancelCB_2.call(ctx, eventData.error);\r\n };\r\n }\r\n else {\r\n var cb_2 = this.callbacks_[eventData.eventType];\r\n return function () {\r\n cb_2.call(ctx, eventData.snapshot, eventData.prevName);\r\n };\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildEventRegistration.prototype.matches = function (other) {\r\n var _this = this;\r\n if (other instanceof ChildEventRegistration) {\r\n if (!this.callbacks_ || !other.callbacks_) {\r\n return true;\r\n }\r\n else if (this.context_ === other.context_) {\r\n var otherKeys = Object.keys(other.callbacks_);\r\n var thisKeys = Object.keys(this.callbacks_);\r\n var otherCount = otherKeys.length;\r\n var thisCount = thisKeys.length;\r\n if (otherCount === thisCount) {\r\n // If count is 1, do an exact match on eventType, if either is defined but null, it's a match.\r\n // If event types don't match, not a match\r\n // If count is not 1, exact match across all\r\n if (otherCount === 1) {\r\n var otherKey = otherKeys[0];\r\n var thisKey = thisKeys[0];\r\n return (thisKey === otherKey &&\r\n (!other.callbacks_[otherKey] ||\r\n !this.callbacks_[thisKey] ||\r\n other.callbacks_[otherKey] === this.callbacks_[thisKey]));\r\n }\r\n else {\r\n // Exact match on each key.\r\n return thisKeys.every(function (eventType) {\r\n return other.callbacks_[eventType] === _this.callbacks_[eventType];\r\n });\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildEventRegistration.prototype.hasAnyCallback = function () {\r\n return this.callbacks_ !== null;\r\n };\r\n return ChildEventRegistration;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __referenceConstructor;\r\n/**\r\n * A Query represents a filter to be applied to a firebase location. This object purely represents the\r\n * query expression (and exposes our public API to build the query). The actual query logic is in ViewBase.js.\r\n *\r\n * Since every Firebase reference is a query, Firebase inherits from this object.\r\n */\r\nvar Query = /** @class */ (function () {\r\n function Query(repo, path, queryParams_, orderByCalled_) {\r\n this.repo = repo;\r\n this.path = path;\r\n this.queryParams_ = queryParams_;\r\n this.orderByCalled_ = orderByCalled_;\r\n }\r\n Object.defineProperty(Query, \"__referenceConstructor\", {\r\n get: function () {\r\n assert(__referenceConstructor, 'Reference.ts has not been loaded');\r\n return __referenceConstructor;\r\n },\r\n set: function (val) {\r\n __referenceConstructor = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Validates start/end values for queries.\r\n * @param {!QueryParams} params\r\n * @private\r\n */\r\n Query.validateQueryEndpoints_ = function (params) {\r\n var startNode = null;\r\n var endNode = null;\r\n if (params.hasStart()) {\r\n startNode = params.getIndexStartValue();\r\n }\r\n if (params.hasEnd()) {\r\n endNode = params.getIndexEndValue();\r\n }\r\n if (params.getIndex() === KEY_INDEX) {\r\n var tooManyArgsError = 'Query: When ordering by key, you may only pass one argument to ' +\r\n 'startAt(), endAt(), or equalTo().';\r\n var wrongArgTypeError = 'Query: When ordering by key, the argument passed to startAt(), endAt(),' +\r\n 'or equalTo() must be a string.';\r\n if (params.hasStart()) {\r\n var startName = params.getIndexStartName();\r\n if (startName !== MIN_NAME) {\r\n throw new Error(tooManyArgsError);\r\n }\r\n else if (typeof startNode !== 'string') {\r\n throw new Error(wrongArgTypeError);\r\n }\r\n }\r\n if (params.hasEnd()) {\r\n var endName = params.getIndexEndName();\r\n if (endName !== MAX_NAME) {\r\n throw new Error(tooManyArgsError);\r\n }\r\n else if (typeof endNode !== 'string') {\r\n throw new Error(wrongArgTypeError);\r\n }\r\n }\r\n }\r\n else if (params.getIndex() === PRIORITY_INDEX) {\r\n if ((startNode != null && !isValidPriority(startNode)) ||\r\n (endNode != null && !isValidPriority(endNode))) {\r\n throw new Error('Query: When ordering by priority, the first argument passed to startAt(), ' +\r\n 'endAt(), or equalTo() must be a valid priority value (null, a number, or a string).');\r\n }\r\n }\r\n else {\r\n assert(params.getIndex() instanceof PathIndex ||\r\n params.getIndex() === VALUE_INDEX, 'unknown index type.');\r\n if ((startNode != null && typeof startNode === 'object') ||\r\n (endNode != null && typeof endNode === 'object')) {\r\n throw new Error('Query: First argument passed to startAt(), endAt(), or equalTo() cannot be ' +\r\n 'an object.');\r\n }\r\n }\r\n };\r\n /**\r\n * Validates that limit* has been called with the correct combination of parameters\r\n * @param {!QueryParams} params\r\n * @private\r\n */\r\n Query.validateLimit_ = function (params) {\r\n if (params.hasStart() &&\r\n params.hasEnd() &&\r\n params.hasLimit() &&\r\n !params.hasAnchoredLimit()) {\r\n throw new Error(\"Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.\");\r\n }\r\n };\r\n /**\r\n * Validates that no other order by call has been made\r\n * @param {!string} fnName\r\n * @private\r\n */\r\n Query.prototype.validateNoPreviousOrderByCall_ = function (fnName) {\r\n if (this.orderByCalled_ === true) {\r\n throw new Error(fnName + \": You can't combine multiple orderBy calls.\");\r\n }\r\n };\r\n /**\r\n * @return {!QueryParams}\r\n */\r\n Query.prototype.getQueryParams = function () {\r\n return this.queryParams_;\r\n };\r\n /**\r\n * @return {!Reference}\r\n */\r\n Query.prototype.getRef = function () {\r\n validateArgCount('Query.ref', 0, 0, arguments.length);\r\n // This is a slight hack. We cannot goog.require('fb.api.Firebase'), since Firebase requires fb.api.Query.\r\n // However, we will always export 'Firebase' to the global namespace, so it's guaranteed to exist by the time this\r\n // method gets called.\r\n return new Query.__referenceConstructor(this.repo, this.path);\r\n };\r\n /**\r\n * @param {!string} eventType\r\n * @param {!function(DataSnapshot, string=)} callback\r\n * @param {(function(Error)|Object)=} cancelCallbackOrContext\r\n * @param {Object=} context\r\n * @return {!function(DataSnapshot, string=)}\r\n */\r\n Query.prototype.on = function (eventType, callback, cancelCallbackOrContext, context) {\r\n validateArgCount('Query.on', 2, 4, arguments.length);\r\n validateEventType('Query.on', 1, eventType, false);\r\n validateCallback('Query.on', 2, callback, false);\r\n var ret = Query.getCancelAndContextArgs_('Query.on', cancelCallbackOrContext, context);\r\n if (eventType === 'value') {\r\n this.onValueEvent(callback, ret.cancel, ret.context);\r\n }\r\n else {\r\n var callbacks = {};\r\n callbacks[eventType] = callback;\r\n this.onChildEvent(callbacks, ret.cancel, ret.context);\r\n }\r\n return callback;\r\n };\r\n /**\r\n * @param {!function(!DataSnapshot)} callback\r\n * @param {?function(Error)} cancelCallback\r\n * @param {?Object} context\r\n * @protected\r\n */\r\n Query.prototype.onValueEvent = function (callback, cancelCallback, context) {\r\n var container = new ValueEventRegistration(callback, cancelCallback || null, context || null);\r\n this.repo.addEventCallbackForQuery(this, container);\r\n };\r\n /**\r\n * @param {!Object.<string, !function(!DataSnapshot, ?string)>} callbacks\r\n * @param {?function(Error)} cancelCallback\r\n * @param {?Object} context\r\n * @protected\r\n */\r\n Query.prototype.onChildEvent = function (callbacks, cancelCallback, context) {\r\n var container = new ChildEventRegistration(callbacks, cancelCallback, context);\r\n this.repo.addEventCallbackForQuery(this, container);\r\n };\r\n /**\r\n * @param {string=} eventType\r\n * @param {(function(!DataSnapshot, ?string=))=} callback\r\n * @param {Object=} context\r\n */\r\n Query.prototype.off = function (eventType, callback, context) {\r\n validateArgCount('Query.off', 0, 3, arguments.length);\r\n validateEventType('Query.off', 1, eventType, true);\r\n validateCallback('Query.off', 2, callback, true);\r\n validateContextObject('Query.off', 3, context, true);\r\n var container = null;\r\n var callbacks = null;\r\n if (eventType === 'value') {\r\n var valueCallback = callback || null;\r\n container = new ValueEventRegistration(valueCallback, null, context || null);\r\n }\r\n else if (eventType) {\r\n if (callback) {\r\n callbacks = {};\r\n callbacks[eventType] = callback;\r\n }\r\n container = new ChildEventRegistration(callbacks, null, context || null);\r\n }\r\n this.repo.removeEventCallbackForQuery(this, container);\r\n };\r\n /**\r\n * Attaches a listener, waits for the first event, and then removes the listener\r\n * @param {!string} eventType\r\n * @param {!function(!DataSnapshot, string=)} userCallback\r\n * @param failureCallbackOrContext\r\n * @param context\r\n * @return {!firebase.Promise}\r\n */\r\n Query.prototype.once = function (eventType, userCallback, failureCallbackOrContext, context) {\r\n var _this = this;\r\n validateArgCount('Query.once', 1, 4, arguments.length);\r\n validateEventType('Query.once', 1, eventType, false);\r\n validateCallback('Query.once', 2, userCallback, true);\r\n var ret = Query.getCancelAndContextArgs_('Query.once', failureCallbackOrContext, context);\r\n // TODO: Implement this more efficiently (in particular, use 'get' wire protocol for 'value' event)\r\n // TODO: consider actually wiring the callbacks into the promise. We cannot do this without a breaking change\r\n // because the API currently expects callbacks will be called synchronously if the data is cached, but this is\r\n // against the Promise specification.\r\n var firstCall = true;\r\n var deferred = new Deferred();\r\n // A dummy error handler in case a user wasn't expecting promises\r\n deferred.promise.catch(function () { });\r\n var onceCallback = function (snapshot) {\r\n // NOTE: Even though we unsubscribe, we may get called multiple times if a single action (e.g. set() with JSON)\r\n // triggers multiple events (e.g. child_added or child_changed).\r\n if (firstCall) {\r\n firstCall = false;\r\n _this.off(eventType, onceCallback);\r\n if (userCallback) {\r\n userCallback.bind(ret.context)(snapshot);\r\n }\r\n deferred.resolve(snapshot);\r\n }\r\n };\r\n this.on(eventType, onceCallback, \r\n /*cancel=*/ function (err) {\r\n _this.off(eventType, onceCallback);\r\n if (ret.cancel) {\r\n ret.cancel.bind(ret.context)(err);\r\n }\r\n deferred.reject(err);\r\n });\r\n return deferred.promise;\r\n };\r\n /**\r\n * Set a limit and anchor it to the start of the window.\r\n * @param {!number} limit\r\n * @return {!Query}\r\n */\r\n Query.prototype.limitToFirst = function (limit) {\r\n validateArgCount('Query.limitToFirst', 1, 1, arguments.length);\r\n if (typeof limit !== 'number' ||\r\n Math.floor(limit) !== limit ||\r\n limit <= 0) {\r\n throw new Error('Query.limitToFirst: First argument must be a positive integer.');\r\n }\r\n if (this.queryParams_.hasLimit()) {\r\n throw new Error('Query.limitToFirst: Limit was already set (by another call to limit, ' +\r\n 'limitToFirst, or limitToLast).');\r\n }\r\n return new Query(this.repo, this.path, this.queryParams_.limitToFirst(limit), this.orderByCalled_);\r\n };\r\n /**\r\n * Set a limit and anchor it to the end of the window.\r\n * @param {!number} limit\r\n * @return {!Query}\r\n */\r\n Query.prototype.limitToLast = function (limit) {\r\n validateArgCount('Query.limitToLast', 1, 1, arguments.length);\r\n if (typeof limit !== 'number' ||\r\n Math.floor(limit) !== limit ||\r\n limit <= 0) {\r\n throw new Error('Query.limitToLast: First argument must be a positive integer.');\r\n }\r\n if (this.queryParams_.hasLimit()) {\r\n throw new Error('Query.limitToLast: Limit was already set (by another call to limit, ' +\r\n 'limitToFirst, or limitToLast).');\r\n }\r\n return new Query(this.repo, this.path, this.queryParams_.limitToLast(limit), this.orderByCalled_);\r\n };\r\n /**\r\n * Given a child path, return a new query ordered by the specified grandchild path.\r\n * @param {!string} path\r\n * @return {!Query}\r\n */\r\n Query.prototype.orderByChild = function (path) {\r\n validateArgCount('Query.orderByChild', 1, 1, arguments.length);\r\n if (path === '$key') {\r\n throw new Error('Query.orderByChild: \"$key\" is invalid. Use Query.orderByKey() instead.');\r\n }\r\n else if (path === '$priority') {\r\n throw new Error('Query.orderByChild: \"$priority\" is invalid. Use Query.orderByPriority() instead.');\r\n }\r\n else if (path === '$value') {\r\n throw new Error('Query.orderByChild: \"$value\" is invalid. Use Query.orderByValue() instead.');\r\n }\r\n validatePathString('Query.orderByChild', 1, path, false);\r\n this.validateNoPreviousOrderByCall_('Query.orderByChild');\r\n var parsedPath = new Path(path);\r\n if (parsedPath.isEmpty()) {\r\n throw new Error('Query.orderByChild: cannot pass in empty path. Use Query.orderByValue() instead.');\r\n }\r\n var index = new PathIndex(parsedPath);\r\n var newParams = this.queryParams_.orderBy(index);\r\n Query.validateQueryEndpoints_(newParams);\r\n return new Query(this.repo, this.path, newParams, /*orderByCalled=*/ true);\r\n };\r\n /**\r\n * Return a new query ordered by the KeyIndex\r\n * @return {!Query}\r\n */\r\n Query.prototype.orderByKey = function () {\r\n validateArgCount('Query.orderByKey', 0, 0, arguments.length);\r\n this.validateNoPreviousOrderByCall_('Query.orderByKey');\r\n var newParams = this.queryParams_.orderBy(KEY_INDEX);\r\n Query.validateQueryEndpoints_(newParams);\r\n return new Query(this.repo, this.path, newParams, /*orderByCalled=*/ true);\r\n };\r\n /**\r\n * Return a new query ordered by the PriorityIndex\r\n * @return {!Query}\r\n */\r\n Query.prototype.orderByPriority = function () {\r\n validateArgCount('Query.orderByPriority', 0, 0, arguments.length);\r\n this.validateNoPreviousOrderByCall_('Query.orderByPriority');\r\n var newParams = this.queryParams_.orderBy(PRIORITY_INDEX);\r\n Query.validateQueryEndpoints_(newParams);\r\n return new Query(this.repo, this.path, newParams, /*orderByCalled=*/ true);\r\n };\r\n /**\r\n * Return a new query ordered by the ValueIndex\r\n * @return {!Query}\r\n */\r\n Query.prototype.orderByValue = function () {\r\n validateArgCount('Query.orderByValue', 0, 0, arguments.length);\r\n this.validateNoPreviousOrderByCall_('Query.orderByValue');\r\n var newParams = this.queryParams_.orderBy(VALUE_INDEX);\r\n Query.validateQueryEndpoints_(newParams);\r\n return new Query(this.repo, this.path, newParams, /*orderByCalled=*/ true);\r\n };\r\n /**\r\n * @param {number|string|boolean|null} value\r\n * @param {?string=} name\r\n * @return {!Query}\r\n */\r\n Query.prototype.startAt = function (value, name) {\r\n if (value === void 0) { value = null; }\r\n validateArgCount('Query.startAt', 0, 2, arguments.length);\r\n validateFirebaseDataArg('Query.startAt', 1, value, this.path, true);\r\n validateKey('Query.startAt', 2, name, true);\r\n var newParams = this.queryParams_.startAt(value, name);\r\n Query.validateLimit_(newParams);\r\n Query.validateQueryEndpoints_(newParams);\r\n if (this.queryParams_.hasStart()) {\r\n throw new Error('Query.startAt: Starting point was already set (by another call to startAt ' +\r\n 'or equalTo).');\r\n }\r\n // Calling with no params tells us to start at the beginning.\r\n if (value === undefined) {\r\n value = null;\r\n name = null;\r\n }\r\n return new Query(this.repo, this.path, newParams, this.orderByCalled_);\r\n };\r\n /**\r\n * @param {number|string|boolean|null} value\r\n * @param {?string=} name\r\n * @return {!Query}\r\n */\r\n Query.prototype.endAt = function (value, name) {\r\n if (value === void 0) { value = null; }\r\n validateArgCount('Query.endAt', 0, 2, arguments.length);\r\n validateFirebaseDataArg('Query.endAt', 1, value, this.path, true);\r\n validateKey('Query.endAt', 2, name, true);\r\n var newParams = this.queryParams_.endAt(value, name);\r\n Query.validateLimit_(newParams);\r\n Query.validateQueryEndpoints_(newParams);\r\n if (this.queryParams_.hasEnd()) {\r\n throw new Error('Query.endAt: Ending point was already set (by another call to endAt or ' +\r\n 'equalTo).');\r\n }\r\n return new Query(this.repo, this.path, newParams, this.orderByCalled_);\r\n };\r\n /**\r\n * Load the selection of children with exactly the specified value, and, optionally,\r\n * the specified name.\r\n * @param {number|string|boolean|null} value\r\n * @param {string=} name\r\n * @return {!Query}\r\n */\r\n Query.prototype.equalTo = function (value, name) {\r\n validateArgCount('Query.equalTo', 1, 2, arguments.length);\r\n validateFirebaseDataArg('Query.equalTo', 1, value, this.path, false);\r\n validateKey('Query.equalTo', 2, name, true);\r\n if (this.queryParams_.hasStart()) {\r\n throw new Error('Query.equalTo: Starting point was already set (by another call to startAt or ' +\r\n 'equalTo).');\r\n }\r\n if (this.queryParams_.hasEnd()) {\r\n throw new Error('Query.equalTo: Ending point was already set (by another call to endAt or ' +\r\n 'equalTo).');\r\n }\r\n return this.startAt(value, name).endAt(value, name);\r\n };\r\n /**\r\n * @return {!string} URL for this location.\r\n */\r\n Query.prototype.toString = function () {\r\n validateArgCount('Query.toString', 0, 0, arguments.length);\r\n return this.repo.toString() + this.path.toUrlEncodedString();\r\n };\r\n // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary\r\n // for end-users.\r\n Query.prototype.toJSON = function () {\r\n // An optional spacer argument is unnecessary for a string.\r\n validateArgCount('Query.toJSON', 0, 1, arguments.length);\r\n return this.toString();\r\n };\r\n /**\r\n * An object representation of the query parameters used by this Query.\r\n * @return {!Object}\r\n */\r\n Query.prototype.queryObject = function () {\r\n return this.queryParams_.getQueryObject();\r\n };\r\n /**\r\n * @return {!string}\r\n */\r\n Query.prototype.queryIdentifier = function () {\r\n var obj = this.queryObject();\r\n var id = ObjectToUniqueKey(obj);\r\n return id === '{}' ? 'default' : id;\r\n };\r\n /**\r\n * Return true if this query and the provided query are equivalent; otherwise, return false.\r\n * @param {Query} other\r\n * @return {boolean}\r\n */\r\n Query.prototype.isEqual = function (other) {\r\n validateArgCount('Query.isEqual', 1, 1, arguments.length);\r\n if (!(other instanceof Query)) {\r\n var error = 'Query.isEqual failed: First argument must be an instance of firebase.database.Query.';\r\n throw new Error(error);\r\n }\r\n var sameRepo = this.repo === other.repo;\r\n var samePath = this.path.equals(other.path);\r\n var sameQueryIdentifier = this.queryIdentifier() === other.queryIdentifier();\r\n return sameRepo && samePath && sameQueryIdentifier;\r\n };\r\n /**\r\n * Helper used by .on and .once to extract the context and or cancel arguments.\r\n * @param {!string} fnName The function name (on or once)\r\n * @param {(function(Error)|Object)=} cancelOrContext\r\n * @param {Object=} context\r\n * @return {{cancel: ?function(Error), context: ?Object}}\r\n * @private\r\n */\r\n Query.getCancelAndContextArgs_ = function (fnName, cancelOrContext, context) {\r\n var ret = { cancel: null, context: null };\r\n if (cancelOrContext && context) {\r\n ret.cancel = cancelOrContext;\r\n validateCallback(fnName, 3, ret.cancel, true);\r\n ret.context = context;\r\n validateContextObject(fnName, 4, ret.context, true);\r\n }\r\n else if (cancelOrContext) {\r\n // we have either a cancel callback or a context.\r\n if (typeof cancelOrContext === 'object' && cancelOrContext !== null) {\r\n // it's a context!\r\n ret.context = cancelOrContext;\r\n }\r\n else if (typeof cancelOrContext === 'function') {\r\n ret.cancel = cancelOrContext;\r\n }\r\n else {\r\n throw new Error(errorPrefix(fnName, 3, true) +\r\n ' must either be a cancel callback or a context object.');\r\n }\r\n }\r\n return ret;\r\n };\r\n Object.defineProperty(Query.prototype, \"ref\", {\r\n get: function () {\r\n return this.getRef();\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return Query;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar ExistingValueProvider = /** @class */ (function () {\r\n function ExistingValueProvider(node_) {\r\n this.node_ = node_;\r\n }\r\n ExistingValueProvider.prototype.getImmediateChild = function (childName) {\r\n var child = this.node_.getImmediateChild(childName);\r\n return new ExistingValueProvider(child);\r\n };\r\n ExistingValueProvider.prototype.node = function () {\r\n return this.node_;\r\n };\r\n return ExistingValueProvider;\r\n}());\r\nvar DeferredValueProvider = /** @class */ (function () {\r\n function DeferredValueProvider(syncTree, path) {\r\n this.syncTree_ = syncTree;\r\n this.path_ = path;\r\n }\r\n DeferredValueProvider.prototype.getImmediateChild = function (childName) {\r\n var childPath = this.path_.child(childName);\r\n return new DeferredValueProvider(this.syncTree_, childPath);\r\n };\r\n DeferredValueProvider.prototype.node = function () {\r\n return this.syncTree_.calcCompleteEventCache(this.path_);\r\n };\r\n return DeferredValueProvider;\r\n}());\r\n/**\r\n * Generate placeholders for deferred values.\r\n * @param {?Object} values\r\n * @return {!Object}\r\n */\r\nvar generateWithValues = function (values) {\r\n values = values || {};\r\n values['timestamp'] = values['timestamp'] || new Date().getTime();\r\n return values;\r\n};\r\n/**\r\n * Value to use when firing local events. When writing server values, fire\r\n * local events with an approximate value, otherwise return value as-is.\r\n * @param {(Object|string|number|boolean)} value\r\n * @param {!Object} serverValues\r\n * @return {!(string|number|boolean)}\r\n */\r\nvar resolveDeferredLeafValue = function (value, existingVal, serverValues) {\r\n if (!value || typeof value !== 'object') {\r\n return value;\r\n }\r\n assert('.sv' in value, 'Unexpected leaf node or priority contents');\r\n if (typeof value['.sv'] === 'string') {\r\n return resolveScalarDeferredValue(value['.sv'], existingVal, serverValues);\r\n }\r\n else if (typeof value['.sv'] === 'object') {\r\n return resolveComplexDeferredValue(value['.sv'], existingVal);\r\n }\r\n else {\r\n assert(false, 'Unexpected server value: ' + JSON.stringify(value, null, 2));\r\n }\r\n};\r\nvar resolveScalarDeferredValue = function (op, existing, serverValues) {\r\n switch (op) {\r\n case 'timestamp':\r\n return serverValues['timestamp'];\r\n default:\r\n assert(false, 'Unexpected server value: ' + op);\r\n }\r\n};\r\nvar resolveComplexDeferredValue = function (op, existing, unused) {\r\n if (!op.hasOwnProperty('increment')) {\r\n assert(false, 'Unexpected server value: ' + JSON.stringify(op, null, 2));\r\n }\r\n var delta = op['increment'];\r\n if (typeof delta !== 'number') {\r\n assert(false, 'Unexpected increment value: ' + delta);\r\n }\r\n var existingNode = existing.node();\r\n assert(existingNode !== null && typeof existingNode !== 'undefined', 'Expected ChildrenNode.EMPTY_NODE for nulls');\r\n // Incrementing a non-number sets the value to the incremented amount\r\n if (!existingNode.isLeafNode()) {\r\n return delta;\r\n }\r\n var leaf = existingNode;\r\n var existingVal = leaf.getValue();\r\n if (typeof existingVal !== 'number') {\r\n return delta;\r\n }\r\n // No need to do over/underflow arithmetic here because JS only handles floats under the covers\r\n return existingVal + delta;\r\n};\r\n/**\r\n * Recursively replace all deferred values and priorities in the tree with the\r\n * specified generated replacement values.\r\n * @param {!Path} path path to which write is relative\r\n * @param {!Node} node new data written at path\r\n * @param {!SyncTree} syncTree current data\r\n * @param {!Object} serverValues\r\n * @return {!SparseSnapshotTree}\r\n */\r\nvar resolveDeferredValueTree = function (path, node, syncTree, serverValues) {\r\n return resolveDeferredValue(node, new DeferredValueProvider(syncTree, path), serverValues);\r\n};\r\n/**\r\n * Recursively replace all deferred values and priorities in the node with the\r\n * specified generated replacement values. If there are no server values in the node,\r\n * it'll be returned as-is.\r\n * @param {!Node} node\r\n * @param {!Object} serverValues\r\n * @return {!Node}\r\n */\r\nvar resolveDeferredValueSnapshot = function (node, existing, serverValues) {\r\n return resolveDeferredValue(node, new ExistingValueProvider(existing), serverValues);\r\n};\r\nfunction resolveDeferredValue(node, existingVal, serverValues) {\r\n var rawPri = node.getPriority().val();\r\n var priority = resolveDeferredLeafValue(rawPri, existingVal.getImmediateChild('.priority'), serverValues);\r\n var newNode;\r\n if (node.isLeafNode()) {\r\n var leafNode = node;\r\n var value = resolveDeferredLeafValue(leafNode.getValue(), existingVal, serverValues);\r\n if (value !== leafNode.getValue() ||\r\n priority !== leafNode.getPriority().val()) {\r\n return new LeafNode(value, nodeFromJSON$1(priority));\r\n }\r\n else {\r\n return node;\r\n }\r\n }\r\n else {\r\n var childrenNode = node;\r\n newNode = childrenNode;\r\n if (priority !== childrenNode.getPriority().val()) {\r\n newNode = newNode.updatePriority(new LeafNode(priority));\r\n }\r\n childrenNode.forEachChild(PRIORITY_INDEX, function (childName, childNode) {\r\n var newChildNode = resolveDeferredValue(childNode, existingVal.getImmediateChild(childName), serverValues);\r\n if (newChildNode !== childNode) {\r\n newNode = newNode.updateImmediateChild(childName, newChildNode);\r\n }\r\n });\r\n return newNode;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Helper class to store a sparse set of snapshots.\r\n */\r\nvar SparseSnapshotTree = /** @class */ (function () {\r\n function SparseSnapshotTree() {\r\n this.value = null;\r\n this.children = new Map();\r\n }\r\n /**\r\n * Gets the node stored at the given path if one exists.\r\n *\r\n * @param path Path to look up snapshot for.\r\n * @return The retrieved node, or null.\r\n */\r\n SparseSnapshotTree.prototype.find = function (path) {\r\n if (this.value != null) {\r\n return this.value.getChild(path);\r\n }\r\n else if (!path.isEmpty() && this.children.size > 0) {\r\n var childKey = path.getFront();\r\n path = path.popFront();\r\n if (this.children.has(childKey)) {\r\n var childTree = this.children.get(childKey);\r\n return childTree.find(path);\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n return null;\r\n }\r\n };\r\n /**\r\n * Stores the given node at the specified path. If there is already a node\r\n * at a shallower path, it merges the new data into that snapshot node.\r\n *\r\n * @param path Path to look up snapshot for.\r\n * @param data The new data, or null.\r\n */\r\n SparseSnapshotTree.prototype.remember = function (path, data) {\r\n if (path.isEmpty()) {\r\n this.value = data;\r\n this.children.clear();\r\n }\r\n else if (this.value !== null) {\r\n this.value = this.value.updateChild(path, data);\r\n }\r\n else {\r\n var childKey = path.getFront();\r\n if (!this.children.has(childKey)) {\r\n this.children.set(childKey, new SparseSnapshotTree());\r\n }\r\n var child = this.children.get(childKey);\r\n path = path.popFront();\r\n child.remember(path, data);\r\n }\r\n };\r\n /**\r\n * Purge the data at path from the cache.\r\n *\r\n * @param path Path to look up snapshot for.\r\n * @return True if this node should now be removed.\r\n */\r\n SparseSnapshotTree.prototype.forget = function (path) {\r\n if (path.isEmpty()) {\r\n this.value = null;\r\n this.children.clear();\r\n return true;\r\n }\r\n else {\r\n if (this.value !== null) {\r\n if (this.value.isLeafNode()) {\r\n // We're trying to forget a node that doesn't exist\r\n return false;\r\n }\r\n else {\r\n var value = this.value;\r\n this.value = null;\r\n var self_1 = this;\r\n value.forEachChild(PRIORITY_INDEX, function (key, tree) {\r\n self_1.remember(new Path(key), tree);\r\n });\r\n return this.forget(path);\r\n }\r\n }\r\n else if (this.children.size > 0) {\r\n var childKey = path.getFront();\r\n path = path.popFront();\r\n if (this.children.has(childKey)) {\r\n var safeToRemove = this.children.get(childKey).forget(path);\r\n if (safeToRemove) {\r\n this.children.delete(childKey);\r\n }\r\n }\r\n return this.children.size === 0;\r\n }\r\n else {\r\n return true;\r\n }\r\n }\r\n };\r\n /**\r\n * Recursively iterates through all of the stored tree and calls the\r\n * callback on each one.\r\n *\r\n * @param prefixPath Path to look up node for.\r\n * @param func The function to invoke for each tree.\r\n */\r\n SparseSnapshotTree.prototype.forEachTree = function (prefixPath, func) {\r\n if (this.value !== null) {\r\n func(prefixPath, this.value);\r\n }\r\n else {\r\n this.forEachChild(function (key, tree) {\r\n var path = new Path(prefixPath.toString() + '/' + key);\r\n tree.forEachTree(path, func);\r\n });\r\n }\r\n };\r\n /**\r\n * Iterates through each immediate child and triggers the callback.\r\n *\r\n * @param func The function to invoke for each child.\r\n */\r\n SparseSnapshotTree.prototype.forEachChild = function (func) {\r\n this.children.forEach(function (tree, key) {\r\n func(key, tree);\r\n });\r\n };\r\n return SparseSnapshotTree;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n *\r\n * @enum\r\n */\r\nvar OperationType;\r\n(function (OperationType) {\r\n OperationType[OperationType[\"OVERWRITE\"] = 0] = \"OVERWRITE\";\r\n OperationType[OperationType[\"MERGE\"] = 1] = \"MERGE\";\r\n OperationType[OperationType[\"ACK_USER_WRITE\"] = 2] = \"ACK_USER_WRITE\";\r\n OperationType[OperationType[\"LISTEN_COMPLETE\"] = 3] = \"LISTEN_COMPLETE\";\r\n})(OperationType || (OperationType = {}));\r\n/**\r\n * @param {boolean} fromUser\r\n * @param {boolean} fromServer\r\n * @param {?string} queryId\r\n * @param {boolean} tagged\r\n * @constructor\r\n */\r\nvar OperationSource = /** @class */ (function () {\r\n function OperationSource(fromUser, fromServer, queryId, tagged) {\r\n this.fromUser = fromUser;\r\n this.fromServer = fromServer;\r\n this.queryId = queryId;\r\n this.tagged = tagged;\r\n assert(!tagged || fromServer, 'Tagged queries must be from server.');\r\n }\r\n /**\r\n * @const\r\n * @type {!OperationSource}\r\n */\r\n OperationSource.User = new OperationSource(\r\n /*fromUser=*/ true, false, null, \r\n /*tagged=*/ false);\r\n /**\r\n * @const\r\n * @type {!OperationSource}\r\n */\r\n OperationSource.Server = new OperationSource(false, \r\n /*fromServer=*/ true, null, \r\n /*tagged=*/ false);\r\n /**\r\n * @param {string} queryId\r\n * @return {!OperationSource}\r\n */\r\n OperationSource.forServerTaggedQuery = function (queryId) {\r\n return new OperationSource(false, \r\n /*fromServer=*/ true, queryId, \r\n /*tagged=*/ true);\r\n };\r\n return OperationSource;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar AckUserWrite = /** @class */ (function () {\r\n /**\r\n *\r\n * @param {!Path} path\r\n * @param {!ImmutableTree<!boolean>} affectedTree A tree containing true for each affected path. Affected paths can't overlap.\r\n * @param {!boolean} revert\r\n */\r\n function AckUserWrite(\r\n /** @inheritDoc */ path, \r\n /** @inheritDoc */ affectedTree, \r\n /** @inheritDoc */ revert) {\r\n this.path = path;\r\n this.affectedTree = affectedTree;\r\n this.revert = revert;\r\n /** @inheritDoc */\r\n this.type = OperationType.ACK_USER_WRITE;\r\n /** @inheritDoc */\r\n this.source = OperationSource.User;\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n AckUserWrite.prototype.operationForChild = function (childName) {\r\n if (!this.path.isEmpty()) {\r\n assert(this.path.getFront() === childName, 'operationForChild called for unrelated child.');\r\n return new AckUserWrite(this.path.popFront(), this.affectedTree, this.revert);\r\n }\r\n else if (this.affectedTree.value != null) {\r\n assert(this.affectedTree.children.isEmpty(), 'affectedTree should not have overlapping affected paths.');\r\n // All child locations are affected as well; just return same operation.\r\n return this;\r\n }\r\n else {\r\n var childTree = this.affectedTree.subtree(new Path(childName));\r\n return new AckUserWrite(Path.Empty, childTree, this.revert);\r\n }\r\n };\r\n return AckUserWrite;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar emptyChildrenSingleton;\r\n/**\r\n * Singleton empty children collection.\r\n *\r\n * @const\r\n * @type {!SortedMap.<string, !ImmutableTree.<?>>}\r\n */\r\nvar EmptyChildren = function () {\r\n if (!emptyChildrenSingleton) {\r\n emptyChildrenSingleton = new SortedMap(stringCompare);\r\n }\r\n return emptyChildrenSingleton;\r\n};\r\n/**\r\n * A tree with immutable elements.\r\n */\r\nvar ImmutableTree = /** @class */ (function () {\r\n /**\r\n * @template T\r\n * @param {?T} value\r\n * @param {SortedMap.<string, !ImmutableTree.<T>>=} children\r\n */\r\n function ImmutableTree(value, children) {\r\n if (children === void 0) { children = EmptyChildren(); }\r\n this.value = value;\r\n this.children = children;\r\n }\r\n /**\r\n * @template T\r\n * @param {!Object.<string, !T>} obj\r\n * @return {!ImmutableTree.<!T>}\r\n */\r\n ImmutableTree.fromObject = function (obj) {\r\n var tree = ImmutableTree.Empty;\r\n each(obj, function (childPath, childSnap) {\r\n tree = tree.set(new Path(childPath), childSnap);\r\n });\r\n return tree;\r\n };\r\n /**\r\n * True if the value is empty and there are no children\r\n * @return {boolean}\r\n */\r\n ImmutableTree.prototype.isEmpty = function () {\r\n return this.value === null && this.children.isEmpty();\r\n };\r\n /**\r\n * Given a path and predicate, return the first node and the path to that node\r\n * where the predicate returns true.\r\n *\r\n * TODO Do a perf test -- If we're creating a bunch of {path: value:} objects\r\n * on the way back out, it may be better to pass down a pathSoFar obj.\r\n *\r\n * @param {!Path} relativePath The remainder of the path\r\n * @param {function(T):boolean} predicate The predicate to satisfy to return a\r\n * node\r\n * @return {?{path:!Path, value:!T}}\r\n */\r\n ImmutableTree.prototype.findRootMostMatchingPathAndValue = function (relativePath, predicate) {\r\n if (this.value != null && predicate(this.value)) {\r\n return { path: Path.Empty, value: this.value };\r\n }\r\n else {\r\n if (relativePath.isEmpty()) {\r\n return null;\r\n }\r\n else {\r\n var front = relativePath.getFront();\r\n var child = this.children.get(front);\r\n if (child !== null) {\r\n var childExistingPathAndValue = child.findRootMostMatchingPathAndValue(relativePath.popFront(), predicate);\r\n if (childExistingPathAndValue != null) {\r\n var fullPath = new Path(front).child(childExistingPathAndValue.path);\r\n return { path: fullPath, value: childExistingPathAndValue.value };\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Find, if it exists, the shortest subpath of the given path that points a defined\r\n * value in the tree\r\n * @param {!Path} relativePath\r\n * @return {?{path: !Path, value: !T}}\r\n */\r\n ImmutableTree.prototype.findRootMostValueAndPath = function (relativePath) {\r\n return this.findRootMostMatchingPathAndValue(relativePath, function () { return true; });\r\n };\r\n /**\r\n * @param {!Path} relativePath\r\n * @return {!ImmutableTree.<T>} The subtree at the given path\r\n */\r\n ImmutableTree.prototype.subtree = function (relativePath) {\r\n if (relativePath.isEmpty()) {\r\n return this;\r\n }\r\n else {\r\n var front = relativePath.getFront();\r\n var childTree = this.children.get(front);\r\n if (childTree !== null) {\r\n return childTree.subtree(relativePath.popFront());\r\n }\r\n else {\r\n return ImmutableTree.Empty;\r\n }\r\n }\r\n };\r\n /**\r\n * Sets a value at the specified path.\r\n *\r\n * @param {!Path} relativePath Path to set value at.\r\n * @param {?T} toSet Value to set.\r\n * @return {!ImmutableTree.<T>} Resulting tree.\r\n */\r\n ImmutableTree.prototype.set = function (relativePath, toSet) {\r\n if (relativePath.isEmpty()) {\r\n return new ImmutableTree(toSet, this.children);\r\n }\r\n else {\r\n var front = relativePath.getFront();\r\n var child = this.children.get(front) || ImmutableTree.Empty;\r\n var newChild = child.set(relativePath.popFront(), toSet);\r\n var newChildren = this.children.insert(front, newChild);\r\n return new ImmutableTree(this.value, newChildren);\r\n }\r\n };\r\n /**\r\n * Removes the value at the specified path.\r\n *\r\n * @param {!Path} relativePath Path to value to remove.\r\n * @return {!ImmutableTree.<T>} Resulting tree.\r\n */\r\n ImmutableTree.prototype.remove = function (relativePath) {\r\n if (relativePath.isEmpty()) {\r\n if (this.children.isEmpty()) {\r\n return ImmutableTree.Empty;\r\n }\r\n else {\r\n return new ImmutableTree(null, this.children);\r\n }\r\n }\r\n else {\r\n var front = relativePath.getFront();\r\n var child = this.children.get(front);\r\n if (child) {\r\n var newChild = child.remove(relativePath.popFront());\r\n var newChildren = void 0;\r\n if (newChild.isEmpty()) {\r\n newChildren = this.children.remove(front);\r\n }\r\n else {\r\n newChildren = this.children.insert(front, newChild);\r\n }\r\n if (this.value === null && newChildren.isEmpty()) {\r\n return ImmutableTree.Empty;\r\n }\r\n else {\r\n return new ImmutableTree(this.value, newChildren);\r\n }\r\n }\r\n else {\r\n return this;\r\n }\r\n }\r\n };\r\n /**\r\n * Gets a value from the tree.\r\n *\r\n * @param {!Path} relativePath Path to get value for.\r\n * @return {?T} Value at path, or null.\r\n */\r\n ImmutableTree.prototype.get = function (relativePath) {\r\n if (relativePath.isEmpty()) {\r\n return this.value;\r\n }\r\n else {\r\n var front = relativePath.getFront();\r\n var child = this.children.get(front);\r\n if (child) {\r\n return child.get(relativePath.popFront());\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n };\r\n /**\r\n * Replace the subtree at the specified path with the given new tree.\r\n *\r\n * @param {!Path} relativePath Path to replace subtree for.\r\n * @param {!ImmutableTree} newTree New tree.\r\n * @return {!ImmutableTree} Resulting tree.\r\n */\r\n ImmutableTree.prototype.setTree = function (relativePath, newTree) {\r\n if (relativePath.isEmpty()) {\r\n return newTree;\r\n }\r\n else {\r\n var front = relativePath.getFront();\r\n var child = this.children.get(front) || ImmutableTree.Empty;\r\n var newChild = child.setTree(relativePath.popFront(), newTree);\r\n var newChildren = void 0;\r\n if (newChild.isEmpty()) {\r\n newChildren = this.children.remove(front);\r\n }\r\n else {\r\n newChildren = this.children.insert(front, newChild);\r\n }\r\n return new ImmutableTree(this.value, newChildren);\r\n }\r\n };\r\n /**\r\n * Performs a depth first fold on this tree. Transforms a tree into a single\r\n * value, given a function that operates on the path to a node, an optional\r\n * current value, and a map of child names to folded subtrees\r\n * @template V\r\n * @param {function(Path, ?T, Object.<string, V>):V} fn\r\n * @return {V}\r\n */\r\n ImmutableTree.prototype.fold = function (fn) {\r\n return this.fold_(Path.Empty, fn);\r\n };\r\n /**\r\n * Recursive helper for public-facing fold() method\r\n * @template V\r\n * @param {!Path} pathSoFar\r\n * @param {function(Path, ?T, Object.<string, V>):V} fn\r\n * @return {V}\r\n * @private\r\n */\r\n ImmutableTree.prototype.fold_ = function (pathSoFar, fn) {\r\n var accum = {};\r\n this.children.inorderTraversal(function (childKey, childTree) {\r\n accum[childKey] = childTree.fold_(pathSoFar.child(childKey), fn);\r\n });\r\n return fn(pathSoFar, this.value, accum);\r\n };\r\n /**\r\n * Find the first matching value on the given path. Return the result of applying f to it.\r\n * @template V\r\n * @param {!Path} path\r\n * @param {!function(!Path, !T):?V} f\r\n * @return {?V}\r\n */\r\n ImmutableTree.prototype.findOnPath = function (path, f) {\r\n return this.findOnPath_(path, Path.Empty, f);\r\n };\r\n ImmutableTree.prototype.findOnPath_ = function (pathToFollow, pathSoFar, f) {\r\n var result = this.value ? f(pathSoFar, this.value) : false;\r\n if (result) {\r\n return result;\r\n }\r\n else {\r\n if (pathToFollow.isEmpty()) {\r\n return null;\r\n }\r\n else {\r\n var front = pathToFollow.getFront();\r\n var nextChild = this.children.get(front);\r\n if (nextChild) {\r\n return nextChild.findOnPath_(pathToFollow.popFront(), pathSoFar.child(front), f);\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n *\r\n * @param {!Path} path\r\n * @param {!function(!Path, !T)} f\r\n * @returns {!ImmutableTree.<T>}\r\n */\r\n ImmutableTree.prototype.foreachOnPath = function (path, f) {\r\n return this.foreachOnPath_(path, Path.Empty, f);\r\n };\r\n ImmutableTree.prototype.foreachOnPath_ = function (pathToFollow, currentRelativePath, f) {\r\n if (pathToFollow.isEmpty()) {\r\n return this;\r\n }\r\n else {\r\n if (this.value) {\r\n f(currentRelativePath, this.value);\r\n }\r\n var front = pathToFollow.getFront();\r\n var nextChild = this.children.get(front);\r\n if (nextChild) {\r\n return nextChild.foreachOnPath_(pathToFollow.popFront(), currentRelativePath.child(front), f);\r\n }\r\n else {\r\n return ImmutableTree.Empty;\r\n }\r\n }\r\n };\r\n /**\r\n * Calls the given function for each node in the tree that has a value.\r\n *\r\n * @param {function(!Path, !T)} f A function to be called with\r\n * the path from the root of the tree to a node, and the value at that node.\r\n * Called in depth-first order.\r\n */\r\n ImmutableTree.prototype.foreach = function (f) {\r\n this.foreach_(Path.Empty, f);\r\n };\r\n ImmutableTree.prototype.foreach_ = function (currentRelativePath, f) {\r\n this.children.inorderTraversal(function (childName, childTree) {\r\n childTree.foreach_(currentRelativePath.child(childName), f);\r\n });\r\n if (this.value) {\r\n f(currentRelativePath, this.value);\r\n }\r\n };\r\n /**\r\n *\r\n * @param {function(string, !T)} f\r\n */\r\n ImmutableTree.prototype.foreachChild = function (f) {\r\n this.children.inorderTraversal(function (childName, childTree) {\r\n if (childTree.value) {\r\n f(childName, childTree.value);\r\n }\r\n });\r\n };\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n ImmutableTree.Empty = new ImmutableTree(null);\r\n return ImmutableTree;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @param {!OperationSource} source\r\n * @param {!Path} path\r\n * @constructor\r\n * @implements {Operation}\r\n */\r\nvar ListenComplete = /** @class */ (function () {\r\n function ListenComplete(source, path) {\r\n this.source = source;\r\n this.path = path;\r\n /** @inheritDoc */\r\n this.type = OperationType.LISTEN_COMPLETE;\r\n }\r\n ListenComplete.prototype.operationForChild = function (childName) {\r\n if (this.path.isEmpty()) {\r\n return new ListenComplete(this.source, Path.Empty);\r\n }\r\n else {\r\n return new ListenComplete(this.source, this.path.popFront());\r\n }\r\n };\r\n return ListenComplete;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @param {!OperationSource} source\r\n * @param {!Path} path\r\n * @param {!Node} snap\r\n * @constructor\r\n * @implements {Operation}\r\n */\r\nvar Overwrite = /** @class */ (function () {\r\n function Overwrite(source, path, snap) {\r\n this.source = source;\r\n this.path = path;\r\n this.snap = snap;\r\n /** @inheritDoc */\r\n this.type = OperationType.OVERWRITE;\r\n }\r\n Overwrite.prototype.operationForChild = function (childName) {\r\n if (this.path.isEmpty()) {\r\n return new Overwrite(this.source, Path.Empty, this.snap.getImmediateChild(childName));\r\n }\r\n else {\r\n return new Overwrite(this.source, this.path.popFront(), this.snap);\r\n }\r\n };\r\n return Overwrite;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @param {!OperationSource} source\r\n * @param {!Path} path\r\n * @param {!ImmutableTree.<!Node>} children\r\n * @constructor\r\n * @implements {Operation}\r\n */\r\nvar Merge = /** @class */ (function () {\r\n function Merge(\r\n /** @inheritDoc */ source, \r\n /** @inheritDoc */ path, \r\n /** @inheritDoc */ children) {\r\n this.source = source;\r\n this.path = path;\r\n this.children = children;\r\n /** @inheritDoc */\r\n this.type = OperationType.MERGE;\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n Merge.prototype.operationForChild = function (childName) {\r\n if (this.path.isEmpty()) {\r\n var childTree = this.children.subtree(new Path(childName));\r\n if (childTree.isEmpty()) {\r\n // This child is unaffected\r\n return null;\r\n }\r\n else if (childTree.value) {\r\n // We have a snapshot for the child in question. This becomes an overwrite of the child.\r\n return new Overwrite(this.source, Path.Empty, childTree.value);\r\n }\r\n else {\r\n // This is a merge at a deeper level\r\n return new Merge(this.source, Path.Empty, childTree);\r\n }\r\n }\r\n else {\r\n assert(this.path.getFront() === childName, \"Can't get a merge for a child not on the path of the operation\");\r\n return new Merge(this.source, this.path.popFront(), this.children);\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n Merge.prototype.toString = function () {\r\n return ('Operation(' +\r\n this.path +\r\n ': ' +\r\n this.source.toString() +\r\n ' merge: ' +\r\n this.children.toString() +\r\n ')');\r\n };\r\n return Merge;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A cache node only stores complete children. Additionally it holds a flag whether the node can be considered fully\r\n * initialized in the sense that we know at one point in time this represented a valid state of the world, e.g.\r\n * initialized with data from the server, or a complete overwrite by the client. The filtered flag also tracks\r\n * whether a node potentially had children removed due to a filter.\r\n */\r\nvar CacheNode = /** @class */ (function () {\r\n /**\r\n * @param {!Node} node_\r\n * @param {boolean} fullyInitialized_\r\n * @param {boolean} filtered_\r\n */\r\n function CacheNode(node_, fullyInitialized_, filtered_) {\r\n this.node_ = node_;\r\n this.fullyInitialized_ = fullyInitialized_;\r\n this.filtered_ = filtered_;\r\n }\r\n /**\r\n * Returns whether this node was fully initialized with either server data or a complete overwrite by the client\r\n * @return {boolean}\r\n */\r\n CacheNode.prototype.isFullyInitialized = function () {\r\n return this.fullyInitialized_;\r\n };\r\n /**\r\n * Returns whether this node is potentially missing children due to a filter applied to the node\r\n * @return {boolean}\r\n */\r\n CacheNode.prototype.isFiltered = function () {\r\n return this.filtered_;\r\n };\r\n /**\r\n * @param {!Path} path\r\n * @return {boolean}\r\n */\r\n CacheNode.prototype.isCompleteForPath = function (path) {\r\n if (path.isEmpty()) {\r\n return this.isFullyInitialized() && !this.filtered_;\r\n }\r\n var childKey = path.getFront();\r\n return this.isCompleteForChild(childKey);\r\n };\r\n /**\r\n * @param {!string} key\r\n * @return {boolean}\r\n */\r\n CacheNode.prototype.isCompleteForChild = function (key) {\r\n return ((this.isFullyInitialized() && !this.filtered_) || this.node_.hasChild(key));\r\n };\r\n /**\r\n * @return {!Node}\r\n */\r\n CacheNode.prototype.getNode = function () {\r\n return this.node_;\r\n };\r\n return CacheNode;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Stores the data we have cached for a view.\r\n *\r\n * serverSnap is the cached server data, eventSnap is the cached event data (server data plus any local writes).\r\n *\r\n * @constructor\r\n */\r\nvar ViewCache = /** @class */ (function () {\r\n /**\r\n *\r\n * @param {!CacheNode} eventCache_\r\n * @param {!CacheNode} serverCache_\r\n */\r\n function ViewCache(eventCache_, serverCache_) {\r\n this.eventCache_ = eventCache_;\r\n this.serverCache_ = serverCache_;\r\n }\r\n /**\r\n * @param {!Node} eventSnap\r\n * @param {boolean} complete\r\n * @param {boolean} filtered\r\n * @return {!ViewCache}\r\n */\r\n ViewCache.prototype.updateEventSnap = function (eventSnap, complete, filtered) {\r\n return new ViewCache(new CacheNode(eventSnap, complete, filtered), this.serverCache_);\r\n };\r\n /**\r\n * @param {!Node} serverSnap\r\n * @param {boolean} complete\r\n * @param {boolean} filtered\r\n * @return {!ViewCache}\r\n */\r\n ViewCache.prototype.updateServerSnap = function (serverSnap, complete, filtered) {\r\n return new ViewCache(this.eventCache_, new CacheNode(serverSnap, complete, filtered));\r\n };\r\n /**\r\n * @return {!CacheNode}\r\n */\r\n ViewCache.prototype.getEventCache = function () {\r\n return this.eventCache_;\r\n };\r\n /**\r\n * @return {?Node}\r\n */\r\n ViewCache.prototype.getCompleteEventSnap = function () {\r\n return this.eventCache_.isFullyInitialized()\r\n ? this.eventCache_.getNode()\r\n : null;\r\n };\r\n /**\r\n * @return {!CacheNode}\r\n */\r\n ViewCache.prototype.getServerCache = function () {\r\n return this.serverCache_;\r\n };\r\n /**\r\n * @return {?Node}\r\n */\r\n ViewCache.prototype.getCompleteServerSnap = function () {\r\n return this.serverCache_.isFullyInitialized()\r\n ? this.serverCache_.getNode()\r\n : null;\r\n };\r\n /**\r\n * @const\r\n * @type {ViewCache}\r\n */\r\n ViewCache.Empty = new ViewCache(new CacheNode(ChildrenNode.EMPTY_NODE, \r\n /*fullyInitialized=*/ false, \r\n /*filtered=*/ false), new CacheNode(ChildrenNode.EMPTY_NODE, \r\n /*fullyInitialized=*/ false, \r\n /*filtered=*/ false));\r\n return ViewCache;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @constructor\r\n * @struct\r\n * @param {!string} type The event type\r\n * @param {!Node} snapshotNode The data\r\n * @param {string=} childName The name for this child, if it's a child event\r\n * @param {Node=} oldSnap Used for intermediate processing of child changed events\r\n * @param {string=} prevName The name for the previous child, if applicable\r\n */\r\nvar Change = /** @class */ (function () {\r\n function Change(type, snapshotNode, childName, oldSnap, prevName) {\r\n this.type = type;\r\n this.snapshotNode = snapshotNode;\r\n this.childName = childName;\r\n this.oldSnap = oldSnap;\r\n this.prevName = prevName;\r\n }\r\n /**\r\n * @param {!Node} snapshot\r\n * @return {!Change}\r\n */\r\n Change.valueChange = function (snapshot) {\r\n return new Change(Change.VALUE, snapshot);\r\n };\r\n /**\r\n * @param {string} childKey\r\n * @param {!Node} snapshot\r\n * @return {!Change}\r\n */\r\n Change.childAddedChange = function (childKey, snapshot) {\r\n return new Change(Change.CHILD_ADDED, snapshot, childKey);\r\n };\r\n /**\r\n * @param {string} childKey\r\n * @param {!Node} snapshot\r\n * @return {!Change}\r\n */\r\n Change.childRemovedChange = function (childKey, snapshot) {\r\n return new Change(Change.CHILD_REMOVED, snapshot, childKey);\r\n };\r\n /**\r\n * @param {string} childKey\r\n * @param {!Node} newSnapshot\r\n * @param {!Node} oldSnapshot\r\n * @return {!Change}\r\n */\r\n Change.childChangedChange = function (childKey, newSnapshot, oldSnapshot) {\r\n return new Change(Change.CHILD_CHANGED, newSnapshot, childKey, oldSnapshot);\r\n };\r\n /**\r\n * @param {string} childKey\r\n * @param {!Node} snapshot\r\n * @return {!Change}\r\n */\r\n Change.childMovedChange = function (childKey, snapshot) {\r\n return new Change(Change.CHILD_MOVED, snapshot, childKey);\r\n };\r\n //event types\r\n /** Event type for a child added */\r\n Change.CHILD_ADDED = 'child_added';\r\n /** Event type for a child removed */\r\n Change.CHILD_REMOVED = 'child_removed';\r\n /** Event type for a child changed */\r\n Change.CHILD_CHANGED = 'child_changed';\r\n /** Event type for a child moved */\r\n Change.CHILD_MOVED = 'child_moved';\r\n /** Event type for a value change */\r\n Change.VALUE = 'value';\r\n return Change;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Doesn't really filter nodes but applies an index to the node and keeps track of any changes\r\n *\r\n * @constructor\r\n * @implements {NodeFilter}\r\n * @param {!Index} index\r\n */\r\nvar IndexedFilter = /** @class */ (function () {\r\n function IndexedFilter(index_) {\r\n this.index_ = index_;\r\n }\r\n IndexedFilter.prototype.updateChild = function (snap, key, newChild, affectedPath, source, optChangeAccumulator) {\r\n assert(snap.isIndexed(this.index_), 'A node must be indexed if only a child is updated');\r\n var oldChild = snap.getImmediateChild(key);\r\n // Check if anything actually changed.\r\n if (oldChild.getChild(affectedPath).equals(newChild.getChild(affectedPath))) {\r\n // There's an edge case where a child can enter or leave the view because affectedPath was set to null.\r\n // In this case, affectedPath will appear null in both the old and new snapshots. So we need\r\n // to avoid treating these cases as \"nothing changed.\"\r\n if (oldChild.isEmpty() === newChild.isEmpty()) {\r\n // Nothing changed.\r\n // This assert should be valid, but it's expensive (can dominate perf testing) so don't actually do it.\r\n //assert(oldChild.equals(newChild), 'Old and new snapshots should be equal.');\r\n return snap;\r\n }\r\n }\r\n if (optChangeAccumulator != null) {\r\n if (newChild.isEmpty()) {\r\n if (snap.hasChild(key)) {\r\n optChangeAccumulator.trackChildChange(Change.childRemovedChange(key, oldChild));\r\n }\r\n else {\r\n assert(snap.isLeafNode(), 'A child remove without an old child only makes sense on a leaf node');\r\n }\r\n }\r\n else if (oldChild.isEmpty()) {\r\n optChangeAccumulator.trackChildChange(Change.childAddedChange(key, newChild));\r\n }\r\n else {\r\n optChangeAccumulator.trackChildChange(Change.childChangedChange(key, newChild, oldChild));\r\n }\r\n }\r\n if (snap.isLeafNode() && newChild.isEmpty()) {\r\n return snap;\r\n }\r\n else {\r\n // Make sure the node is indexed\r\n return snap.updateImmediateChild(key, newChild).withIndex(this.index_);\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n IndexedFilter.prototype.updateFullNode = function (oldSnap, newSnap, optChangeAccumulator) {\r\n if (optChangeAccumulator != null) {\r\n if (!oldSnap.isLeafNode()) {\r\n oldSnap.forEachChild(PRIORITY_INDEX, function (key, childNode) {\r\n if (!newSnap.hasChild(key)) {\r\n optChangeAccumulator.trackChildChange(Change.childRemovedChange(key, childNode));\r\n }\r\n });\r\n }\r\n if (!newSnap.isLeafNode()) {\r\n newSnap.forEachChild(PRIORITY_INDEX, function (key, childNode) {\r\n if (oldSnap.hasChild(key)) {\r\n var oldChild = oldSnap.getImmediateChild(key);\r\n if (!oldChild.equals(childNode)) {\r\n optChangeAccumulator.trackChildChange(Change.childChangedChange(key, childNode, oldChild));\r\n }\r\n }\r\n else {\r\n optChangeAccumulator.trackChildChange(Change.childAddedChange(key, childNode));\r\n }\r\n });\r\n }\r\n }\r\n return newSnap.withIndex(this.index_);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n IndexedFilter.prototype.updatePriority = function (oldSnap, newPriority) {\r\n if (oldSnap.isEmpty()) {\r\n return ChildrenNode.EMPTY_NODE;\r\n }\r\n else {\r\n return oldSnap.updatePriority(newPriority);\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n IndexedFilter.prototype.filtersNodes = function () {\r\n return false;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n IndexedFilter.prototype.getIndexedFilter = function () {\r\n return this;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n IndexedFilter.prototype.getIndex = function () {\r\n return this.index_;\r\n };\r\n return IndexedFilter;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar ChildChangeAccumulator = /** @class */ (function () {\r\n function ChildChangeAccumulator() {\r\n this.changeMap = new Map();\r\n }\r\n ChildChangeAccumulator.prototype.trackChildChange = function (change) {\r\n var type = change.type;\r\n var childKey = change.childName;\r\n assert(type === Change.CHILD_ADDED ||\r\n type === Change.CHILD_CHANGED ||\r\n type === Change.CHILD_REMOVED, 'Only child changes supported for tracking');\r\n assert(childKey !== '.priority', 'Only non-priority child changes can be tracked.');\r\n var oldChange = this.changeMap.get(childKey);\r\n if (oldChange) {\r\n var oldType = oldChange.type;\r\n if (type === Change.CHILD_ADDED && oldType === Change.CHILD_REMOVED) {\r\n this.changeMap.set(childKey, Change.childChangedChange(childKey, change.snapshotNode, oldChange.snapshotNode));\r\n }\r\n else if (type === Change.CHILD_REMOVED &&\r\n oldType === Change.CHILD_ADDED) {\r\n this.changeMap.delete(childKey);\r\n }\r\n else if (type === Change.CHILD_REMOVED &&\r\n oldType === Change.CHILD_CHANGED) {\r\n this.changeMap.set(childKey, Change.childRemovedChange(childKey, oldChange.oldSnap));\r\n }\r\n else if (type === Change.CHILD_CHANGED &&\r\n oldType === Change.CHILD_ADDED) {\r\n this.changeMap.set(childKey, Change.childAddedChange(childKey, change.snapshotNode));\r\n }\r\n else if (type === Change.CHILD_CHANGED &&\r\n oldType === Change.CHILD_CHANGED) {\r\n this.changeMap.set(childKey, Change.childChangedChange(childKey, change.snapshotNode, oldChange.oldSnap));\r\n }\r\n else {\r\n throw assertionError('Illegal combination of changes: ' +\r\n change +\r\n ' occurred after ' +\r\n oldChange);\r\n }\r\n }\r\n else {\r\n this.changeMap.set(childKey, change);\r\n }\r\n };\r\n ChildChangeAccumulator.prototype.getChanges = function () {\r\n return Array.from(this.changeMap.values());\r\n };\r\n return ChildChangeAccumulator;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An implementation of CompleteChildSource that never returns any additional children\r\n *\r\n * @private\r\n * @constructor\r\n * @implements CompleteChildSource\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nvar NoCompleteChildSource_ = /** @class */ (function () {\r\n function NoCompleteChildSource_() {\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n NoCompleteChildSource_.prototype.getCompleteChild = function (childKey) {\r\n return null;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n NoCompleteChildSource_.prototype.getChildAfterChild = function (index, child, reverse) {\r\n return null;\r\n };\r\n return NoCompleteChildSource_;\r\n}());\r\n/**\r\n * Singleton instance.\r\n * @const\r\n * @type {!CompleteChildSource}\r\n */\r\nvar NO_COMPLETE_CHILD_SOURCE = new NoCompleteChildSource_();\r\n/**\r\n * An implementation of CompleteChildSource that uses a WriteTree in addition to any other server data or\r\n * old event caches available to calculate complete children.\r\n *\r\n *\r\n * @implements CompleteChildSource\r\n */\r\nvar WriteTreeCompleteChildSource = /** @class */ (function () {\r\n /**\r\n * @param {!WriteTreeRef} writes_\r\n * @param {!ViewCache} viewCache_\r\n * @param {?Node} optCompleteServerCache_\r\n */\r\n function WriteTreeCompleteChildSource(writes_, viewCache_, optCompleteServerCache_) {\r\n if (optCompleteServerCache_ === void 0) { optCompleteServerCache_ = null; }\r\n this.writes_ = writes_;\r\n this.viewCache_ = viewCache_;\r\n this.optCompleteServerCache_ = optCompleteServerCache_;\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n WriteTreeCompleteChildSource.prototype.getCompleteChild = function (childKey) {\r\n var node = this.viewCache_.getEventCache();\r\n if (node.isCompleteForChild(childKey)) {\r\n return node.getNode().getImmediateChild(childKey);\r\n }\r\n else {\r\n var serverNode = this.optCompleteServerCache_ != null\r\n ? new CacheNode(this.optCompleteServerCache_, true, false)\r\n : this.viewCache_.getServerCache();\r\n return this.writes_.calcCompleteChild(childKey, serverNode);\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n WriteTreeCompleteChildSource.prototype.getChildAfterChild = function (index, child, reverse) {\r\n var completeServerData = this.optCompleteServerCache_ != null\r\n ? this.optCompleteServerCache_\r\n : this.viewCache_.getCompleteServerSnap();\r\n var nodes = this.writes_.calcIndexedSlice(completeServerData, child, 1, reverse, index);\r\n if (nodes.length === 0) {\r\n return null;\r\n }\r\n else {\r\n return nodes[0];\r\n }\r\n };\r\n return WriteTreeCompleteChildSource;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @constructor\r\n * @struct\r\n */\r\nvar ProcessorResult = /** @class */ (function () {\r\n /**\r\n * @param {!ViewCache} viewCache\r\n * @param {!Array.<!Change>} changes\r\n */\r\n function ProcessorResult(viewCache, changes) {\r\n this.viewCache = viewCache;\r\n this.changes = changes;\r\n }\r\n return ProcessorResult;\r\n}());\r\n/**\r\n * @constructor\r\n */\r\nvar ViewProcessor = /** @class */ (function () {\r\n /**\r\n * @param {!NodeFilter} filter_\r\n */\r\n function ViewProcessor(filter_) {\r\n this.filter_ = filter_;\r\n }\r\n /**\r\n * @param {!ViewCache} viewCache\r\n */\r\n ViewProcessor.prototype.assertIndexed = function (viewCache) {\r\n assert(viewCache.getEventCache().getNode().isIndexed(this.filter_.getIndex()), 'Event snap not indexed');\r\n assert(viewCache.getServerCache().getNode().isIndexed(this.filter_.getIndex()), 'Server snap not indexed');\r\n };\r\n /**\r\n * @param {!ViewCache} oldViewCache\r\n * @param {!Operation} operation\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {?Node} completeCache\r\n * @return {!ProcessorResult}\r\n */\r\n ViewProcessor.prototype.applyOperation = function (oldViewCache, operation, writesCache, completeCache) {\r\n var accumulator = new ChildChangeAccumulator();\r\n var newViewCache, filterServerNode;\r\n if (operation.type === OperationType.OVERWRITE) {\r\n var overwrite = operation;\r\n if (overwrite.source.fromUser) {\r\n newViewCache = this.applyUserOverwrite_(oldViewCache, overwrite.path, overwrite.snap, writesCache, completeCache, accumulator);\r\n }\r\n else {\r\n assert(overwrite.source.fromServer, 'Unknown source.');\r\n // We filter the node if it's a tagged update or the node has been previously filtered and the\r\n // update is not at the root in which case it is ok (and necessary) to mark the node unfiltered\r\n // again\r\n filterServerNode =\r\n overwrite.source.tagged ||\r\n (oldViewCache.getServerCache().isFiltered() &&\r\n !overwrite.path.isEmpty());\r\n newViewCache = this.applyServerOverwrite_(oldViewCache, overwrite.path, overwrite.snap, writesCache, completeCache, filterServerNode, accumulator);\r\n }\r\n }\r\n else if (operation.type === OperationType.MERGE) {\r\n var merge = operation;\r\n if (merge.source.fromUser) {\r\n newViewCache = this.applyUserMerge_(oldViewCache, merge.path, merge.children, writesCache, completeCache, accumulator);\r\n }\r\n else {\r\n assert(merge.source.fromServer, 'Unknown source.');\r\n // We filter the node if it's a tagged update or the node has been previously filtered\r\n filterServerNode =\r\n merge.source.tagged || oldViewCache.getServerCache().isFiltered();\r\n newViewCache = this.applyServerMerge_(oldViewCache, merge.path, merge.children, writesCache, completeCache, filterServerNode, accumulator);\r\n }\r\n }\r\n else if (operation.type === OperationType.ACK_USER_WRITE) {\r\n var ackUserWrite = operation;\r\n if (!ackUserWrite.revert) {\r\n newViewCache = this.ackUserWrite_(oldViewCache, ackUserWrite.path, ackUserWrite.affectedTree, writesCache, completeCache, accumulator);\r\n }\r\n else {\r\n newViewCache = this.revertUserWrite_(oldViewCache, ackUserWrite.path, writesCache, completeCache, accumulator);\r\n }\r\n }\r\n else if (operation.type === OperationType.LISTEN_COMPLETE) {\r\n newViewCache = this.listenComplete_(oldViewCache, operation.path, writesCache, accumulator);\r\n }\r\n else {\r\n throw assertionError('Unknown operation type: ' + operation.type);\r\n }\r\n var changes = accumulator.getChanges();\r\n ViewProcessor.maybeAddValueEvent_(oldViewCache, newViewCache, changes);\r\n return new ProcessorResult(newViewCache, changes);\r\n };\r\n /**\r\n * @param {!ViewCache} oldViewCache\r\n * @param {!ViewCache} newViewCache\r\n * @param {!Array.<!Change>} accumulator\r\n * @private\r\n */\r\n ViewProcessor.maybeAddValueEvent_ = function (oldViewCache, newViewCache, accumulator) {\r\n var eventSnap = newViewCache.getEventCache();\r\n if (eventSnap.isFullyInitialized()) {\r\n var isLeafOrEmpty = eventSnap.getNode().isLeafNode() || eventSnap.getNode().isEmpty();\r\n var oldCompleteSnap = oldViewCache.getCompleteEventSnap();\r\n if (accumulator.length > 0 ||\r\n !oldViewCache.getEventCache().isFullyInitialized() ||\r\n (isLeafOrEmpty &&\r\n !eventSnap.getNode().equals(/** @type {!Node} */ oldCompleteSnap)) ||\r\n !eventSnap.getNode().getPriority().equals(oldCompleteSnap.getPriority())) {\r\n accumulator.push(Change.valueChange(\r\n /** @type {!Node} */ newViewCache.getCompleteEventSnap()));\r\n }\r\n }\r\n };\r\n /**\r\n * @param {!ViewCache} viewCache\r\n * @param {!Path} changePath\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {!CompleteChildSource} source\r\n * @param {!ChildChangeAccumulator} accumulator\r\n * @return {!ViewCache}\r\n * @private\r\n */\r\n ViewProcessor.prototype.generateEventCacheAfterServerEvent_ = function (viewCache, changePath, writesCache, source, accumulator) {\r\n var oldEventSnap = viewCache.getEventCache();\r\n if (writesCache.shadowingWrite(changePath) != null) {\r\n // we have a shadowing write, ignore changes\r\n return viewCache;\r\n }\r\n else {\r\n var newEventCache = void 0, serverNode = void 0;\r\n if (changePath.isEmpty()) {\r\n // TODO: figure out how this plays with \"sliding ack windows\"\r\n assert(viewCache.getServerCache().isFullyInitialized(), 'If change path is empty, we must have complete server data');\r\n if (viewCache.getServerCache().isFiltered()) {\r\n // We need to special case this, because we need to only apply writes to complete children, or\r\n // we might end up raising events for incomplete children. If the server data is filtered deep\r\n // writes cannot be guaranteed to be complete\r\n var serverCache = viewCache.getCompleteServerSnap();\r\n var completeChildren = serverCache instanceof ChildrenNode\r\n ? serverCache\r\n : ChildrenNode.EMPTY_NODE;\r\n var completeEventChildren = writesCache.calcCompleteEventChildren(completeChildren);\r\n newEventCache = this.filter_.updateFullNode(viewCache.getEventCache().getNode(), completeEventChildren, accumulator);\r\n }\r\n else {\r\n var completeNode = writesCache.calcCompleteEventCache(viewCache.getCompleteServerSnap());\r\n newEventCache = this.filter_.updateFullNode(viewCache.getEventCache().getNode(), completeNode, accumulator);\r\n }\r\n }\r\n else {\r\n var childKey = changePath.getFront();\r\n if (childKey === '.priority') {\r\n assert(changePath.getLength() === 1, \"Can't have a priority with additional path components\");\r\n var oldEventNode = oldEventSnap.getNode();\r\n serverNode = viewCache.getServerCache().getNode();\r\n // we might have overwrites for this priority\r\n var updatedPriority = writesCache.calcEventCacheAfterServerOverwrite(changePath, oldEventNode, serverNode);\r\n if (updatedPriority != null) {\r\n newEventCache = this.filter_.updatePriority(oldEventNode, updatedPriority);\r\n }\r\n else {\r\n // priority didn't change, keep old node\r\n newEventCache = oldEventSnap.getNode();\r\n }\r\n }\r\n else {\r\n var childChangePath = changePath.popFront();\r\n // update child\r\n var newEventChild = void 0;\r\n if (oldEventSnap.isCompleteForChild(childKey)) {\r\n serverNode = viewCache.getServerCache().getNode();\r\n var eventChildUpdate = writesCache.calcEventCacheAfterServerOverwrite(changePath, oldEventSnap.getNode(), serverNode);\r\n if (eventChildUpdate != null) {\r\n newEventChild = oldEventSnap\r\n .getNode()\r\n .getImmediateChild(childKey)\r\n .updateChild(childChangePath, eventChildUpdate);\r\n }\r\n else {\r\n // Nothing changed, just keep the old child\r\n newEventChild = oldEventSnap\r\n .getNode()\r\n .getImmediateChild(childKey);\r\n }\r\n }\r\n else {\r\n newEventChild = writesCache.calcCompleteChild(childKey, viewCache.getServerCache());\r\n }\r\n if (newEventChild != null) {\r\n newEventCache = this.filter_.updateChild(oldEventSnap.getNode(), childKey, newEventChild, childChangePath, source, accumulator);\r\n }\r\n else {\r\n // no complete child available or no change\r\n newEventCache = oldEventSnap.getNode();\r\n }\r\n }\r\n }\r\n return viewCache.updateEventSnap(newEventCache, oldEventSnap.isFullyInitialized() || changePath.isEmpty(), this.filter_.filtersNodes());\r\n }\r\n };\r\n /**\r\n * @param {!ViewCache} oldViewCache\r\n * @param {!Path} changePath\r\n * @param {!Node} changedSnap\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {?Node} completeCache\r\n * @param {boolean} filterServerNode\r\n * @param {!ChildChangeAccumulator} accumulator\r\n * @return {!ViewCache}\r\n * @private\r\n */\r\n ViewProcessor.prototype.applyServerOverwrite_ = function (oldViewCache, changePath, changedSnap, writesCache, completeCache, filterServerNode, accumulator) {\r\n var oldServerSnap = oldViewCache.getServerCache();\r\n var newServerCache;\r\n var serverFilter = filterServerNode\r\n ? this.filter_\r\n : this.filter_.getIndexedFilter();\r\n if (changePath.isEmpty()) {\r\n newServerCache = serverFilter.updateFullNode(oldServerSnap.getNode(), changedSnap, null);\r\n }\r\n else if (serverFilter.filtersNodes() && !oldServerSnap.isFiltered()) {\r\n // we want to filter the server node, but we didn't filter the server node yet, so simulate a full update\r\n var newServerNode = oldServerSnap\r\n .getNode()\r\n .updateChild(changePath, changedSnap);\r\n newServerCache = serverFilter.updateFullNode(oldServerSnap.getNode(), newServerNode, null);\r\n }\r\n else {\r\n var childKey = changePath.getFront();\r\n if (!oldServerSnap.isCompleteForPath(changePath) &&\r\n changePath.getLength() > 1) {\r\n // We don't update incomplete nodes with updates intended for other listeners\r\n return oldViewCache;\r\n }\r\n var childChangePath = changePath.popFront();\r\n var childNode = oldServerSnap.getNode().getImmediateChild(childKey);\r\n var newChildNode = childNode.updateChild(childChangePath, changedSnap);\r\n if (childKey === '.priority') {\r\n newServerCache = serverFilter.updatePriority(oldServerSnap.getNode(), newChildNode);\r\n }\r\n else {\r\n newServerCache = serverFilter.updateChild(oldServerSnap.getNode(), childKey, newChildNode, childChangePath, NO_COMPLETE_CHILD_SOURCE, null);\r\n }\r\n }\r\n var newViewCache = oldViewCache.updateServerSnap(newServerCache, oldServerSnap.isFullyInitialized() || changePath.isEmpty(), serverFilter.filtersNodes());\r\n var source = new WriteTreeCompleteChildSource(writesCache, newViewCache, completeCache);\r\n return this.generateEventCacheAfterServerEvent_(newViewCache, changePath, writesCache, source, accumulator);\r\n };\r\n /**\r\n * @param {!ViewCache} oldViewCache\r\n * @param {!Path} changePath\r\n * @param {!Node} changedSnap\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {?Node} completeCache\r\n * @param {!ChildChangeAccumulator} accumulator\r\n * @return {!ViewCache}\r\n * @private\r\n */\r\n ViewProcessor.prototype.applyUserOverwrite_ = function (oldViewCache, changePath, changedSnap, writesCache, completeCache, accumulator) {\r\n var oldEventSnap = oldViewCache.getEventCache();\r\n var newViewCache, newEventCache;\r\n var source = new WriteTreeCompleteChildSource(writesCache, oldViewCache, completeCache);\r\n if (changePath.isEmpty()) {\r\n newEventCache = this.filter_.updateFullNode(oldViewCache.getEventCache().getNode(), changedSnap, accumulator);\r\n newViewCache = oldViewCache.updateEventSnap(newEventCache, true, this.filter_.filtersNodes());\r\n }\r\n else {\r\n var childKey = changePath.getFront();\r\n if (childKey === '.priority') {\r\n newEventCache = this.filter_.updatePriority(oldViewCache.getEventCache().getNode(), changedSnap);\r\n newViewCache = oldViewCache.updateEventSnap(newEventCache, oldEventSnap.isFullyInitialized(), oldEventSnap.isFiltered());\r\n }\r\n else {\r\n var childChangePath = changePath.popFront();\r\n var oldChild = oldEventSnap.getNode().getImmediateChild(childKey);\r\n var newChild = void 0;\r\n if (childChangePath.isEmpty()) {\r\n // Child overwrite, we can replace the child\r\n newChild = changedSnap;\r\n }\r\n else {\r\n var childNode = source.getCompleteChild(childKey);\r\n if (childNode != null) {\r\n if (childChangePath.getBack() === '.priority' &&\r\n childNode.getChild(childChangePath.parent()).isEmpty()) {\r\n // This is a priority update on an empty node. If this node exists on the server, the\r\n // server will send down the priority in the update, so ignore for now\r\n newChild = childNode;\r\n }\r\n else {\r\n newChild = childNode.updateChild(childChangePath, changedSnap);\r\n }\r\n }\r\n else {\r\n // There is no complete child node available\r\n newChild = ChildrenNode.EMPTY_NODE;\r\n }\r\n }\r\n if (!oldChild.equals(newChild)) {\r\n var newEventSnap = this.filter_.updateChild(oldEventSnap.getNode(), childKey, newChild, childChangePath, source, accumulator);\r\n newViewCache = oldViewCache.updateEventSnap(newEventSnap, oldEventSnap.isFullyInitialized(), this.filter_.filtersNodes());\r\n }\r\n else {\r\n newViewCache = oldViewCache;\r\n }\r\n }\r\n }\r\n return newViewCache;\r\n };\r\n /**\r\n * @param {!ViewCache} viewCache\r\n * @param {string} childKey\r\n * @return {boolean}\r\n * @private\r\n */\r\n ViewProcessor.cacheHasChild_ = function (viewCache, childKey) {\r\n return viewCache.getEventCache().isCompleteForChild(childKey);\r\n };\r\n /**\r\n * @param {!ViewCache} viewCache\r\n * @param {!Path} path\r\n * @param {ImmutableTree.<!Node>} changedChildren\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {?Node} serverCache\r\n * @param {!ChildChangeAccumulator} accumulator\r\n * @return {!ViewCache}\r\n * @private\r\n */\r\n ViewProcessor.prototype.applyUserMerge_ = function (viewCache, path, changedChildren, writesCache, serverCache, accumulator) {\r\n var _this = this;\r\n // HACK: In the case of a limit query, there may be some changes that bump things out of the\r\n // window leaving room for new items. It's important we process these changes first, so we\r\n // iterate the changes twice, first processing any that affect items currently in view.\r\n // TODO: I consider an item \"in view\" if cacheHasChild is true, which checks both the server\r\n // and event snap. I'm not sure if this will result in edge cases when a child is in one but\r\n // not the other.\r\n var curViewCache = viewCache;\r\n changedChildren.foreach(function (relativePath, childNode) {\r\n var writePath = path.child(relativePath);\r\n if (ViewProcessor.cacheHasChild_(viewCache, writePath.getFront())) {\r\n curViewCache = _this.applyUserOverwrite_(curViewCache, writePath, childNode, writesCache, serverCache, accumulator);\r\n }\r\n });\r\n changedChildren.foreach(function (relativePath, childNode) {\r\n var writePath = path.child(relativePath);\r\n if (!ViewProcessor.cacheHasChild_(viewCache, writePath.getFront())) {\r\n curViewCache = _this.applyUserOverwrite_(curViewCache, writePath, childNode, writesCache, serverCache, accumulator);\r\n }\r\n });\r\n return curViewCache;\r\n };\r\n /**\r\n * @param {!Node} node\r\n * @param {ImmutableTree.<!Node>} merge\r\n * @return {!Node}\r\n * @private\r\n */\r\n ViewProcessor.prototype.applyMerge_ = function (node, merge) {\r\n merge.foreach(function (relativePath, childNode) {\r\n node = node.updateChild(relativePath, childNode);\r\n });\r\n return node;\r\n };\r\n /**\r\n * @param {!ViewCache} viewCache\r\n * @param {!Path} path\r\n * @param {!ImmutableTree.<!Node>} changedChildren\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {?Node} serverCache\r\n * @param {boolean} filterServerNode\r\n * @param {!ChildChangeAccumulator} accumulator\r\n * @return {!ViewCache}\r\n * @private\r\n */\r\n ViewProcessor.prototype.applyServerMerge_ = function (viewCache, path, changedChildren, writesCache, serverCache, filterServerNode, accumulator) {\r\n var _this = this;\r\n // If we don't have a cache yet, this merge was intended for a previously listen in the same location. Ignore it and\r\n // wait for the complete data update coming soon.\r\n if (viewCache.getServerCache().getNode().isEmpty() &&\r\n !viewCache.getServerCache().isFullyInitialized()) {\r\n return viewCache;\r\n }\r\n // HACK: In the case of a limit query, there may be some changes that bump things out of the\r\n // window leaving room for new items. It's important we process these changes first, so we\r\n // iterate the changes twice, first processing any that affect items currently in view.\r\n // TODO: I consider an item \"in view\" if cacheHasChild is true, which checks both the server\r\n // and event snap. I'm not sure if this will result in edge cases when a child is in one but\r\n // not the other.\r\n var curViewCache = viewCache;\r\n var viewMergeTree;\r\n if (path.isEmpty()) {\r\n viewMergeTree = changedChildren;\r\n }\r\n else {\r\n viewMergeTree = ImmutableTree.Empty.setTree(path, changedChildren);\r\n }\r\n var serverNode = viewCache.getServerCache().getNode();\r\n viewMergeTree.children.inorderTraversal(function (childKey, childTree) {\r\n if (serverNode.hasChild(childKey)) {\r\n var serverChild = viewCache\r\n .getServerCache()\r\n .getNode()\r\n .getImmediateChild(childKey);\r\n var newChild = _this.applyMerge_(serverChild, childTree);\r\n curViewCache = _this.applyServerOverwrite_(curViewCache, new Path(childKey), newChild, writesCache, serverCache, filterServerNode, accumulator);\r\n }\r\n });\r\n viewMergeTree.children.inorderTraversal(function (childKey, childMergeTree) {\r\n var isUnknownDeepMerge = !viewCache.getServerCache().isCompleteForChild(childKey) &&\r\n childMergeTree.value == null;\r\n if (!serverNode.hasChild(childKey) && !isUnknownDeepMerge) {\r\n var serverChild = viewCache\r\n .getServerCache()\r\n .getNode()\r\n .getImmediateChild(childKey);\r\n var newChild = _this.applyMerge_(serverChild, childMergeTree);\r\n curViewCache = _this.applyServerOverwrite_(curViewCache, new Path(childKey), newChild, writesCache, serverCache, filterServerNode, accumulator);\r\n }\r\n });\r\n return curViewCache;\r\n };\r\n /**\r\n * @param {!ViewCache} viewCache\r\n * @param {!Path} ackPath\r\n * @param {!ImmutableTree<!boolean>} affectedTree\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {?Node} completeCache\r\n * @param {!ChildChangeAccumulator} accumulator\r\n * @return {!ViewCache}\r\n * @private\r\n */\r\n ViewProcessor.prototype.ackUserWrite_ = function (viewCache, ackPath, affectedTree, writesCache, completeCache, accumulator) {\r\n if (writesCache.shadowingWrite(ackPath) != null) {\r\n return viewCache;\r\n }\r\n // Only filter server node if it is currently filtered\r\n var filterServerNode = viewCache.getServerCache().isFiltered();\r\n // Essentially we'll just get our existing server cache for the affected paths and re-apply it as a server update\r\n // now that it won't be shadowed.\r\n var serverCache = viewCache.getServerCache();\r\n if (affectedTree.value != null) {\r\n // This is an overwrite.\r\n if ((ackPath.isEmpty() && serverCache.isFullyInitialized()) ||\r\n serverCache.isCompleteForPath(ackPath)) {\r\n return this.applyServerOverwrite_(viewCache, ackPath, serverCache.getNode().getChild(ackPath), writesCache, completeCache, filterServerNode, accumulator);\r\n }\r\n else if (ackPath.isEmpty()) {\r\n // This is a goofy edge case where we are acking data at this location but don't have full data. We\r\n // should just re-apply whatever we have in our cache as a merge.\r\n var changedChildren_1 = ImmutableTree.Empty;\r\n serverCache.getNode().forEachChild(KEY_INDEX, function (name, node) {\r\n changedChildren_1 = changedChildren_1.set(new Path(name), node);\r\n });\r\n return this.applyServerMerge_(viewCache, ackPath, changedChildren_1, writesCache, completeCache, filterServerNode, accumulator);\r\n }\r\n else {\r\n return viewCache;\r\n }\r\n }\r\n else {\r\n // This is a merge.\r\n var changedChildren_2 = ImmutableTree.Empty;\r\n affectedTree.foreach(function (mergePath, value) {\r\n var serverCachePath = ackPath.child(mergePath);\r\n if (serverCache.isCompleteForPath(serverCachePath)) {\r\n changedChildren_2 = changedChildren_2.set(mergePath, serverCache.getNode().getChild(serverCachePath));\r\n }\r\n });\r\n return this.applyServerMerge_(viewCache, ackPath, changedChildren_2, writesCache, completeCache, filterServerNode, accumulator);\r\n }\r\n };\r\n /**\r\n * @param {!ViewCache} viewCache\r\n * @param {!Path} path\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {!ChildChangeAccumulator} accumulator\r\n * @return {!ViewCache}\r\n * @private\r\n */\r\n ViewProcessor.prototype.listenComplete_ = function (viewCache, path, writesCache, accumulator) {\r\n var oldServerNode = viewCache.getServerCache();\r\n var newViewCache = viewCache.updateServerSnap(oldServerNode.getNode(), oldServerNode.isFullyInitialized() || path.isEmpty(), oldServerNode.isFiltered());\r\n return this.generateEventCacheAfterServerEvent_(newViewCache, path, writesCache, NO_COMPLETE_CHILD_SOURCE, accumulator);\r\n };\r\n /**\r\n * @param {!ViewCache} viewCache\r\n * @param {!Path} path\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {?Node} completeServerCache\r\n * @param {!ChildChangeAccumulator} accumulator\r\n * @return {!ViewCache}\r\n * @private\r\n */\r\n ViewProcessor.prototype.revertUserWrite_ = function (viewCache, path, writesCache, completeServerCache, accumulator) {\r\n var complete;\r\n if (writesCache.shadowingWrite(path) != null) {\r\n return viewCache;\r\n }\r\n else {\r\n var source = new WriteTreeCompleteChildSource(writesCache, viewCache, completeServerCache);\r\n var oldEventCache = viewCache.getEventCache().getNode();\r\n var newEventCache = void 0;\r\n if (path.isEmpty() || path.getFront() === '.priority') {\r\n var newNode = void 0;\r\n if (viewCache.getServerCache().isFullyInitialized()) {\r\n newNode = writesCache.calcCompleteEventCache(viewCache.getCompleteServerSnap());\r\n }\r\n else {\r\n var serverChildren = viewCache.getServerCache().getNode();\r\n assert(serverChildren instanceof ChildrenNode, 'serverChildren would be complete if leaf node');\r\n newNode = writesCache.calcCompleteEventChildren(serverChildren);\r\n }\r\n newNode = newNode;\r\n newEventCache = this.filter_.updateFullNode(oldEventCache, newNode, accumulator);\r\n }\r\n else {\r\n var childKey = path.getFront();\r\n var newChild = writesCache.calcCompleteChild(childKey, viewCache.getServerCache());\r\n if (newChild == null &&\r\n viewCache.getServerCache().isCompleteForChild(childKey)) {\r\n newChild = oldEventCache.getImmediateChild(childKey);\r\n }\r\n if (newChild != null) {\r\n newEventCache = this.filter_.updateChild(oldEventCache, childKey, newChild, path.popFront(), source, accumulator);\r\n }\r\n else if (viewCache.getEventCache().getNode().hasChild(childKey)) {\r\n // No complete child available, delete the existing one, if any\r\n newEventCache = this.filter_.updateChild(oldEventCache, childKey, ChildrenNode.EMPTY_NODE, path.popFront(), source, accumulator);\r\n }\r\n else {\r\n newEventCache = oldEventCache;\r\n }\r\n if (newEventCache.isEmpty() &&\r\n viewCache.getServerCache().isFullyInitialized()) {\r\n // We might have reverted all child writes. Maybe the old event was a leaf node\r\n complete = writesCache.calcCompleteEventCache(viewCache.getCompleteServerSnap());\r\n if (complete.isLeafNode()) {\r\n newEventCache = this.filter_.updateFullNode(newEventCache, complete, accumulator);\r\n }\r\n }\r\n }\r\n complete =\r\n viewCache.getServerCache().isFullyInitialized() ||\r\n writesCache.shadowingWrite(Path.Empty) != null;\r\n return viewCache.updateEventSnap(newEventCache, complete, this.filter_.filtersNodes());\r\n }\r\n };\r\n return ViewProcessor;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An EventGenerator is used to convert \"raw\" changes (Change) as computed by the\r\n * CacheDiffer into actual events (Event) that can be raised. See generateEventsForChanges()\r\n * for details.\r\n *\r\n * @constructor\r\n */\r\nvar EventGenerator = /** @class */ (function () {\r\n /**\r\n *\r\n * @param {!Query} query_\r\n */\r\n function EventGenerator(query_) {\r\n this.query_ = query_;\r\n /**\r\n * @private\r\n * @type {!Index}\r\n */\r\n this.index_ = this.query_.getQueryParams().getIndex();\r\n }\r\n /**\r\n * Given a set of raw changes (no moved events and prevName not specified yet), and a set of\r\n * EventRegistrations that should be notified of these changes, generate the actual events to be raised.\r\n *\r\n * Notes:\r\n * - child_moved events will be synthesized at this time for any child_changed events that affect\r\n * our index.\r\n * - prevName will be calculated based on the index ordering.\r\n *\r\n * @param {!Array.<!Change>} changes\r\n * @param {!Node} eventCache\r\n * @param {!Array.<!EventRegistration>} eventRegistrations\r\n * @return {!Array.<!Event>}\r\n */\r\n EventGenerator.prototype.generateEventsForChanges = function (changes, eventCache, eventRegistrations) {\r\n var _this = this;\r\n var events = [];\r\n var moves = [];\r\n changes.forEach(function (change) {\r\n if (change.type === Change.CHILD_CHANGED &&\r\n _this.index_.indexedValueChanged(change.oldSnap, change.snapshotNode)) {\r\n moves.push(Change.childMovedChange(change.childName, change.snapshotNode));\r\n }\r\n });\r\n this.generateEventsForType_(events, Change.CHILD_REMOVED, changes, eventRegistrations, eventCache);\r\n this.generateEventsForType_(events, Change.CHILD_ADDED, changes, eventRegistrations, eventCache);\r\n this.generateEventsForType_(events, Change.CHILD_MOVED, moves, eventRegistrations, eventCache);\r\n this.generateEventsForType_(events, Change.CHILD_CHANGED, changes, eventRegistrations, eventCache);\r\n this.generateEventsForType_(events, Change.VALUE, changes, eventRegistrations, eventCache);\r\n return events;\r\n };\r\n /**\r\n * Given changes of a single change type, generate the corresponding events.\r\n *\r\n * @param {!Array.<!Event>} events\r\n * @param {!string} eventType\r\n * @param {!Array.<!Change>} changes\r\n * @param {!Array.<!EventRegistration>} registrations\r\n * @param {!Node} eventCache\r\n * @private\r\n */\r\n EventGenerator.prototype.generateEventsForType_ = function (events, eventType, changes, registrations, eventCache) {\r\n var _this = this;\r\n var filteredChanges = changes.filter(function (change) { return change.type === eventType; });\r\n filteredChanges.sort(this.compareChanges_.bind(this));\r\n filteredChanges.forEach(function (change) {\r\n var materializedChange = _this.materializeSingleChange_(change, eventCache);\r\n registrations.forEach(function (registration) {\r\n if (registration.respondsTo(change.type)) {\r\n events.push(registration.createEvent(materializedChange, _this.query_));\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * @param {!Change} change\r\n * @param {!Node} eventCache\r\n * @return {!Change}\r\n * @private\r\n */\r\n EventGenerator.prototype.materializeSingleChange_ = function (change, eventCache) {\r\n if (change.type === 'value' || change.type === 'child_removed') {\r\n return change;\r\n }\r\n else {\r\n change.prevName = eventCache.getPredecessorChildName(\r\n /** @type {!string} */\r\n change.childName, change.snapshotNode, this.index_);\r\n return change;\r\n }\r\n };\r\n /**\r\n * @param {!Change} a\r\n * @param {!Change} b\r\n * @return {number}\r\n * @private\r\n */\r\n EventGenerator.prototype.compareChanges_ = function (a, b) {\r\n if (a.childName == null || b.childName == null) {\r\n throw assertionError('Should only compare child_ events.');\r\n }\r\n var aWrapped = new NamedNode(a.childName, a.snapshotNode);\r\n var bWrapped = new NamedNode(b.childName, b.snapshotNode);\r\n return this.index_.compare(aWrapped, bWrapped);\r\n };\r\n return EventGenerator;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A view represents a specific location and query that has 1 or more event registrations.\r\n *\r\n * It does several things:\r\n * - Maintains the list of event registrations for this location/query.\r\n * - Maintains a cache of the data visible for this location/query.\r\n * - Applies new operations (via applyOperation), updates the cache, and based on the event\r\n * registrations returns the set of events to be raised.\r\n * @constructor\r\n */\r\nvar View = /** @class */ (function () {\r\n /**\r\n *\r\n * @param {!Query} query_\r\n * @param {!ViewCache} initialViewCache\r\n */\r\n function View(query_, initialViewCache) {\r\n this.query_ = query_;\r\n this.eventRegistrations_ = [];\r\n var params = this.query_.getQueryParams();\r\n var indexFilter = new IndexedFilter(params.getIndex());\r\n var filter = params.getNodeFilter();\r\n /**\r\n * @type {ViewProcessor}\r\n * @private\r\n */\r\n this.processor_ = new ViewProcessor(filter);\r\n var initialServerCache = initialViewCache.getServerCache();\r\n var initialEventCache = initialViewCache.getEventCache();\r\n // Don't filter server node with other filter than index, wait for tagged listen\r\n var serverSnap = indexFilter.updateFullNode(ChildrenNode.EMPTY_NODE, initialServerCache.getNode(), null);\r\n var eventSnap = filter.updateFullNode(ChildrenNode.EMPTY_NODE, initialEventCache.getNode(), null);\r\n var newServerCache = new CacheNode(serverSnap, initialServerCache.isFullyInitialized(), indexFilter.filtersNodes());\r\n var newEventCache = new CacheNode(eventSnap, initialEventCache.isFullyInitialized(), filter.filtersNodes());\r\n /**\r\n * @type {!ViewCache}\r\n * @private\r\n */\r\n this.viewCache_ = new ViewCache(newEventCache, newServerCache);\r\n /**\r\n * @type {!EventGenerator}\r\n * @private\r\n */\r\n this.eventGenerator_ = new EventGenerator(this.query_);\r\n }\r\n /**\r\n * @return {!Query}\r\n */\r\n View.prototype.getQuery = function () {\r\n return this.query_;\r\n };\r\n /**\r\n * @return {?Node}\r\n */\r\n View.prototype.getServerCache = function () {\r\n return this.viewCache_.getServerCache().getNode();\r\n };\r\n /**\r\n * @param {!Path} path\r\n * @return {?Node}\r\n */\r\n View.prototype.getCompleteServerCache = function (path) {\r\n var cache = this.viewCache_.getCompleteServerSnap();\r\n if (cache) {\r\n // If this isn't a \"loadsAllData\" view, then cache isn't actually a complete cache and\r\n // we need to see if it contains the child we're interested in.\r\n if (this.query_.getQueryParams().loadsAllData() ||\r\n (!path.isEmpty() && !cache.getImmediateChild(path.getFront()).isEmpty())) {\r\n return cache.getChild(path);\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * @return {boolean}\r\n */\r\n View.prototype.isEmpty = function () {\r\n return this.eventRegistrations_.length === 0;\r\n };\r\n /**\r\n * @param {!EventRegistration} eventRegistration\r\n */\r\n View.prototype.addEventRegistration = function (eventRegistration) {\r\n this.eventRegistrations_.push(eventRegistration);\r\n };\r\n /**\r\n * @param {?EventRegistration} eventRegistration If null, remove all callbacks.\r\n * @param {Error=} cancelError If a cancelError is provided, appropriate cancel events will be returned.\r\n * @return {!Array.<!Event>} Cancel events, if cancelError was provided.\r\n */\r\n View.prototype.removeEventRegistration = function (eventRegistration, cancelError) {\r\n var cancelEvents = [];\r\n if (cancelError) {\r\n assert(eventRegistration == null, 'A cancel should cancel all event registrations.');\r\n var path_1 = this.query_.path;\r\n this.eventRegistrations_.forEach(function (registration) {\r\n cancelError /** @type {!Error} */ = cancelError;\r\n var maybeEvent = registration.createCancelEvent(cancelError, path_1);\r\n if (maybeEvent) {\r\n cancelEvents.push(maybeEvent);\r\n }\r\n });\r\n }\r\n if (eventRegistration) {\r\n var remaining = [];\r\n for (var i = 0; i < this.eventRegistrations_.length; ++i) {\r\n var existing = this.eventRegistrations_[i];\r\n if (!existing.matches(eventRegistration)) {\r\n remaining.push(existing);\r\n }\r\n else if (eventRegistration.hasAnyCallback()) {\r\n // We're removing just this one\r\n remaining = remaining.concat(this.eventRegistrations_.slice(i + 1));\r\n break;\r\n }\r\n }\r\n this.eventRegistrations_ = remaining;\r\n }\r\n else {\r\n this.eventRegistrations_ = [];\r\n }\r\n return cancelEvents;\r\n };\r\n /**\r\n * Applies the given Operation, updates our cache, and returns the appropriate events.\r\n *\r\n * @param {!Operation} operation\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {?Node} completeServerCache\r\n * @return {!Array.<!Event>}\r\n */\r\n View.prototype.applyOperation = function (operation, writesCache, completeServerCache) {\r\n if (operation.type === OperationType.MERGE &&\r\n operation.source.queryId !== null) {\r\n assert(this.viewCache_.getCompleteServerSnap(), 'We should always have a full cache before handling merges');\r\n assert(this.viewCache_.getCompleteEventSnap(), 'Missing event cache, even though we have a server cache');\r\n }\r\n var oldViewCache = this.viewCache_;\r\n var result = this.processor_.applyOperation(oldViewCache, operation, writesCache, completeServerCache);\r\n this.processor_.assertIndexed(result.viewCache);\r\n assert(result.viewCache.getServerCache().isFullyInitialized() ||\r\n !oldViewCache.getServerCache().isFullyInitialized(), 'Once a server snap is complete, it should never go back');\r\n this.viewCache_ = result.viewCache;\r\n return this.generateEventsForChanges_(result.changes, result.viewCache.getEventCache().getNode(), null);\r\n };\r\n /**\r\n * @param {!EventRegistration} registration\r\n * @return {!Array.<!Event>}\r\n */\r\n View.prototype.getInitialEvents = function (registration) {\r\n var eventSnap = this.viewCache_.getEventCache();\r\n var initialChanges = [];\r\n if (!eventSnap.getNode().isLeafNode()) {\r\n var eventNode = eventSnap.getNode();\r\n eventNode.forEachChild(PRIORITY_INDEX, function (key, childNode) {\r\n initialChanges.push(Change.childAddedChange(key, childNode));\r\n });\r\n }\r\n if (eventSnap.isFullyInitialized()) {\r\n initialChanges.push(Change.valueChange(eventSnap.getNode()));\r\n }\r\n return this.generateEventsForChanges_(initialChanges, eventSnap.getNode(), registration);\r\n };\r\n /**\r\n * @private\r\n * @param {!Array.<!Change>} changes\r\n * @param {!Node} eventCache\r\n * @param {EventRegistration=} eventRegistration\r\n * @return {!Array.<!Event>}\r\n */\r\n View.prototype.generateEventsForChanges_ = function (changes, eventCache, eventRegistration) {\r\n var registrations = eventRegistration\r\n ? [eventRegistration]\r\n : this.eventRegistrations_;\r\n return this.eventGenerator_.generateEventsForChanges(changes, eventCache, registrations);\r\n };\r\n return View;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __referenceConstructor$1;\r\n/**\r\n * SyncPoint represents a single location in a SyncTree with 1 or more event registrations, meaning we need to\r\n * maintain 1 or more Views at this location to cache server data and raise appropriate events for server changes\r\n * and user writes (set, transaction, update).\r\n *\r\n * It's responsible for:\r\n * - Maintaining the set of 1 or more views necessary at this location (a SyncPoint with 0 views should be removed).\r\n * - Proxying user / server operations to the views as appropriate (i.e. applyServerOverwrite,\r\n * applyUserOverwrite, etc.)\r\n */\r\nvar SyncPoint = /** @class */ (function () {\r\n function SyncPoint() {\r\n /**\r\n * The Views being tracked at this location in the tree, stored as a map where the key is a\r\n * queryId and the value is the View for that query.\r\n *\r\n * NOTE: This list will be quite small (usually 1, but perhaps 2 or 3; any more is an odd use case).\r\n */\r\n this.views = new Map();\r\n }\r\n Object.defineProperty(SyncPoint, \"__referenceConstructor\", {\r\n get: function () {\r\n assert(__referenceConstructor$1, 'Reference.ts has not been loaded');\r\n return __referenceConstructor$1;\r\n },\r\n set: function (val) {\r\n assert(!__referenceConstructor$1, '__referenceConstructor has already been defined');\r\n __referenceConstructor$1 = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n SyncPoint.prototype.isEmpty = function () {\r\n return this.views.size === 0;\r\n };\r\n SyncPoint.prototype.applyOperation = function (operation, writesCache, optCompleteServerCache) {\r\n var e_1, _a;\r\n var queryId = operation.source.queryId;\r\n if (queryId !== null) {\r\n var view = this.views.get(queryId);\r\n assert(view != null, 'SyncTree gave us an op for an invalid query.');\r\n return view.applyOperation(operation, writesCache, optCompleteServerCache);\r\n }\r\n else {\r\n var events = [];\r\n try {\r\n for (var _b = __values(this.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var view = _c.value;\r\n events = events.concat(view.applyOperation(operation, writesCache, optCompleteServerCache));\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n return events;\r\n }\r\n };\r\n /**\r\n * Add an event callback for the specified query.\r\n *\r\n * @param {!Query} query\r\n * @param {!EventRegistration} eventRegistration\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {?Node} serverCache Complete server cache, if we have it.\r\n * @param {boolean} serverCacheComplete\r\n * @return {!Array.<!Event>} Events to raise.\r\n */\r\n SyncPoint.prototype.addEventRegistration = function (query, eventRegistration, writesCache, serverCache, serverCacheComplete) {\r\n var queryId = query.queryIdentifier();\r\n var view = this.views.get(queryId);\r\n if (!view) {\r\n // TODO: make writesCache take flag for complete server node\r\n var eventCache = writesCache.calcCompleteEventCache(serverCacheComplete ? serverCache : null);\r\n var eventCacheComplete = false;\r\n if (eventCache) {\r\n eventCacheComplete = true;\r\n }\r\n else if (serverCache instanceof ChildrenNode) {\r\n eventCache = writesCache.calcCompleteEventChildren(serverCache);\r\n eventCacheComplete = false;\r\n }\r\n else {\r\n eventCache = ChildrenNode.EMPTY_NODE;\r\n eventCacheComplete = false;\r\n }\r\n var viewCache = new ViewCache(new CacheNode(\r\n /** @type {!Node} */ eventCache, eventCacheComplete, false), new CacheNode(\r\n /** @type {!Node} */ serverCache, serverCacheComplete, false));\r\n view = new View(query, viewCache);\r\n this.views.set(queryId, view);\r\n }\r\n // This is guaranteed to exist now, we just created anything that was missing\r\n view.addEventRegistration(eventRegistration);\r\n return view.getInitialEvents(eventRegistration);\r\n };\r\n /**\r\n * Remove event callback(s). Return cancelEvents if a cancelError is specified.\r\n *\r\n * If query is the default query, we'll check all views for the specified eventRegistration.\r\n * If eventRegistration is null, we'll remove all callbacks for the specified view(s).\r\n *\r\n * @param {!Query} query\r\n * @param {?EventRegistration} eventRegistration If null, remove all callbacks.\r\n * @param {Error=} cancelError If a cancelError is provided, appropriate cancel events will be returned.\r\n * @return {{removed:!Array.<!Query>, events:!Array.<!Event>}} removed queries and any cancel events\r\n */\r\n SyncPoint.prototype.removeEventRegistration = function (query, eventRegistration, cancelError) {\r\n var e_2, _a;\r\n var queryId = query.queryIdentifier();\r\n var removed = [];\r\n var cancelEvents = [];\r\n var hadCompleteView = this.hasCompleteView();\r\n if (queryId === 'default') {\r\n try {\r\n // When you do ref.off(...), we search all views for the registration to remove.\r\n for (var _b = __values(this.views.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var _d = __read(_c.value, 2), viewQueryId = _d[0], view = _d[1];\r\n cancelEvents = cancelEvents.concat(view.removeEventRegistration(eventRegistration, cancelError));\r\n if (view.isEmpty()) {\r\n this.views.delete(viewQueryId);\r\n // We'll deal with complete views later.\r\n if (!view.getQuery().getQueryParams().loadsAllData()) {\r\n removed.push(view.getQuery());\r\n }\r\n }\r\n }\r\n }\r\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_2) throw e_2.error; }\r\n }\r\n }\r\n else {\r\n // remove the callback from the specific view.\r\n var view = this.views.get(queryId);\r\n if (view) {\r\n cancelEvents = cancelEvents.concat(view.removeEventRegistration(eventRegistration, cancelError));\r\n if (view.isEmpty()) {\r\n this.views.delete(queryId);\r\n // We'll deal with complete views later.\r\n if (!view.getQuery().getQueryParams().loadsAllData()) {\r\n removed.push(view.getQuery());\r\n }\r\n }\r\n }\r\n }\r\n if (hadCompleteView && !this.hasCompleteView()) {\r\n // We removed our last complete view.\r\n removed.push(new SyncPoint.__referenceConstructor(query.repo, query.path));\r\n }\r\n return { removed: removed, events: cancelEvents };\r\n };\r\n SyncPoint.prototype.getQueryViews = function () {\r\n var e_3, _a;\r\n var result = [];\r\n try {\r\n for (var _b = __values(this.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var view = _c.value;\r\n if (!view.getQuery().getQueryParams().loadsAllData()) {\r\n result.push(view);\r\n }\r\n }\r\n }\r\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_3) throw e_3.error; }\r\n }\r\n return result;\r\n };\r\n /**\r\n * @param path The path to the desired complete snapshot\r\n * @return A complete cache, if it exists\r\n */\r\n SyncPoint.prototype.getCompleteServerCache = function (path) {\r\n var e_4, _a;\r\n var serverCache = null;\r\n try {\r\n for (var _b = __values(this.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var view = _c.value;\r\n serverCache = serverCache || view.getCompleteServerCache(path);\r\n }\r\n }\r\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_4) throw e_4.error; }\r\n }\r\n return serverCache;\r\n };\r\n SyncPoint.prototype.viewForQuery = function (query) {\r\n var params = query.getQueryParams();\r\n if (params.loadsAllData()) {\r\n return this.getCompleteView();\r\n }\r\n else {\r\n var queryId = query.queryIdentifier();\r\n return this.views.get(queryId);\r\n }\r\n };\r\n SyncPoint.prototype.viewExistsForQuery = function (query) {\r\n return this.viewForQuery(query) != null;\r\n };\r\n SyncPoint.prototype.hasCompleteView = function () {\r\n return this.getCompleteView() != null;\r\n };\r\n SyncPoint.prototype.getCompleteView = function () {\r\n var e_5, _a;\r\n try {\r\n for (var _b = __values(this.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var view = _c.value;\r\n if (view.getQuery().getQueryParams().loadsAllData()) {\r\n return view;\r\n }\r\n }\r\n }\r\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_5) throw e_5.error; }\r\n }\r\n return null;\r\n };\r\n return SyncPoint;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * This class holds a collection of writes that can be applied to nodes in unison. It abstracts away the logic with\r\n * dealing with priority writes and multiple nested writes. At any given path there is only allowed to be one write\r\n * modifying that path. Any write to an existing path or shadowing an existing path will modify that existing write\r\n * to reflect the write added.\r\n */\r\nvar CompoundWrite = /** @class */ (function () {\r\n function CompoundWrite(writeTree_) {\r\n this.writeTree_ = writeTree_;\r\n }\r\n CompoundWrite.prototype.addWrite = function (path, node) {\r\n if (path.isEmpty()) {\r\n return new CompoundWrite(new ImmutableTree(node));\r\n }\r\n else {\r\n var rootmost = this.writeTree_.findRootMostValueAndPath(path);\r\n if (rootmost != null) {\r\n var rootMostPath = rootmost.path;\r\n var value = rootmost.value;\r\n var relativePath = Path.relativePath(rootMostPath, path);\r\n value = value.updateChild(relativePath, node);\r\n return new CompoundWrite(this.writeTree_.set(rootMostPath, value));\r\n }\r\n else {\r\n var subtree = new ImmutableTree(node);\r\n var newWriteTree = this.writeTree_.setTree(path, subtree);\r\n return new CompoundWrite(newWriteTree);\r\n }\r\n }\r\n };\r\n CompoundWrite.prototype.addWrites = function (path, updates) {\r\n var newWrite = this;\r\n each(updates, function (childKey, node) {\r\n newWrite = newWrite.addWrite(path.child(childKey), node);\r\n });\r\n return newWrite;\r\n };\r\n /**\r\n * Will remove a write at the given path and deeper paths. This will <em>not</em> modify a write at a higher\r\n * location, which must be removed by calling this method with that path.\r\n *\r\n * @param path The path at which a write and all deeper writes should be removed\r\n * @return {!CompoundWrite} The new CompoundWrite with the removed path\r\n */\r\n CompoundWrite.prototype.removeWrite = function (path) {\r\n if (path.isEmpty()) {\r\n return CompoundWrite.Empty;\r\n }\r\n else {\r\n var newWriteTree = this.writeTree_.setTree(path, ImmutableTree.Empty);\r\n return new CompoundWrite(newWriteTree);\r\n }\r\n };\r\n /**\r\n * Returns whether this CompoundWrite will fully overwrite a node at a given location and can therefore be\r\n * considered \"complete\".\r\n *\r\n * @param path The path to check for\r\n * @return Whether there is a complete write at that path\r\n */\r\n CompoundWrite.prototype.hasCompleteWrite = function (path) {\r\n return this.getCompleteNode(path) != null;\r\n };\r\n /**\r\n * Returns a node for a path if and only if the node is a \"complete\" overwrite at that path. This will not aggregate\r\n * writes from deeper paths, but will return child nodes from a more shallow path.\r\n *\r\n * @param path The path to get a complete write\r\n * @return The node if complete at that path, or null otherwise.\r\n */\r\n CompoundWrite.prototype.getCompleteNode = function (path) {\r\n var rootmost = this.writeTree_.findRootMostValueAndPath(path);\r\n if (rootmost != null) {\r\n return this.writeTree_\r\n .get(rootmost.path)\r\n .getChild(Path.relativePath(rootmost.path, path));\r\n }\r\n else {\r\n return null;\r\n }\r\n };\r\n /**\r\n * Returns all children that are guaranteed to be a complete overwrite.\r\n *\r\n * @return A list of all complete children.\r\n */\r\n CompoundWrite.prototype.getCompleteChildren = function () {\r\n var children = [];\r\n var node = this.writeTree_.value;\r\n if (node != null) {\r\n // If it's a leaf node, it has no children; so nothing to do.\r\n if (!node.isLeafNode()) {\r\n node.forEachChild(PRIORITY_INDEX, function (childName, childNode) {\r\n children.push(new NamedNode(childName, childNode));\r\n });\r\n }\r\n }\r\n else {\r\n this.writeTree_.children.inorderTraversal(function (childName, childTree) {\r\n if (childTree.value != null) {\r\n children.push(new NamedNode(childName, childTree.value));\r\n }\r\n });\r\n }\r\n return children;\r\n };\r\n CompoundWrite.prototype.childCompoundWrite = function (path) {\r\n if (path.isEmpty()) {\r\n return this;\r\n }\r\n else {\r\n var shadowingNode = this.getCompleteNode(path);\r\n if (shadowingNode != null) {\r\n return new CompoundWrite(new ImmutableTree(shadowingNode));\r\n }\r\n else {\r\n return new CompoundWrite(this.writeTree_.subtree(path));\r\n }\r\n }\r\n };\r\n /**\r\n * Returns true if this CompoundWrite is empty and therefore does not modify any nodes.\r\n * @return Whether this CompoundWrite is empty\r\n */\r\n CompoundWrite.prototype.isEmpty = function () {\r\n return this.writeTree_.isEmpty();\r\n };\r\n /**\r\n * Applies this CompoundWrite to a node. The node is returned with all writes from this CompoundWrite applied to the\r\n * node\r\n * @param node The node to apply this CompoundWrite to\r\n * @return The node with all writes applied\r\n */\r\n CompoundWrite.prototype.apply = function (node) {\r\n return applySubtreeWrite(Path.Empty, this.writeTree_, node);\r\n };\r\n CompoundWrite.Empty = new CompoundWrite(new ImmutableTree(null));\r\n return CompoundWrite;\r\n}());\r\nfunction applySubtreeWrite(relativePath, writeTree, node) {\r\n if (writeTree.value != null) {\r\n // Since there a write is always a leaf, we're done here\r\n return node.updateChild(relativePath, writeTree.value);\r\n }\r\n else {\r\n var priorityWrite_1 = null;\r\n writeTree.children.inorderTraversal(function (childKey, childTree) {\r\n if (childKey === '.priority') {\r\n // Apply priorities at the end so we don't update priorities for either empty nodes or forget\r\n // to apply priorities to empty nodes that are later filled\r\n assert(childTree.value !== null, 'Priority writes must always be leaf nodes');\r\n priorityWrite_1 = childTree.value;\r\n }\r\n else {\r\n node = applySubtreeWrite(relativePath.child(childKey), childTree, node);\r\n }\r\n });\r\n // If there was a priority write, we only apply it if the node is not empty\r\n if (!node.getChild(relativePath).isEmpty() && priorityWrite_1 !== null) {\r\n node = node.updateChild(relativePath.child('.priority'), priorityWrite_1);\r\n }\r\n return node;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * WriteTree tracks all pending user-initiated writes and has methods to calculate the result of merging them\r\n * with underlying server data (to create \"event cache\" data). Pending writes are added with addOverwrite()\r\n * and addMerge(), and removed with removeWrite().\r\n *\r\n * @constructor\r\n */\r\nvar WriteTree = /** @class */ (function () {\r\n function WriteTree() {\r\n /**\r\n * A tree tracking the result of applying all visible writes. This does not include transactions with\r\n * applyLocally=false or writes that are completely shadowed by other writes.\r\n *\r\n * @type {!CompoundWrite}\r\n * @private\r\n */\r\n this.visibleWrites_ = CompoundWrite.Empty;\r\n /**\r\n * A list of all pending writes, regardless of visibility and shadowed-ness. Used to calculate arbitrary\r\n * sets of the changed data, such as hidden writes (from transactions) or changes with certain writes excluded (also\r\n * used by transactions).\r\n *\r\n * @type {!Array.<!WriteRecord>}\r\n * @private\r\n */\r\n this.allWrites_ = [];\r\n this.lastWriteId_ = -1;\r\n }\r\n /**\r\n * Create a new WriteTreeRef for the given path. For use with a new sync point at the given path.\r\n *\r\n * @param {!Path} path\r\n * @return {!WriteTreeRef}\r\n */\r\n WriteTree.prototype.childWrites = function (path) {\r\n return new WriteTreeRef(path, this);\r\n };\r\n /**\r\n * Record a new overwrite from user code.\r\n *\r\n * @param {!Path} path\r\n * @param {!Node} snap\r\n * @param {!number} writeId\r\n * @param {boolean=} visible This is set to false by some transactions. It should be excluded from event caches\r\n */\r\n WriteTree.prototype.addOverwrite = function (path, snap, writeId, visible) {\r\n assert(writeId > this.lastWriteId_, 'Stacking an older write on top of newer ones');\r\n if (visible === undefined) {\r\n visible = true;\r\n }\r\n this.allWrites_.push({\r\n path: path,\r\n snap: snap,\r\n writeId: writeId,\r\n visible: visible\r\n });\r\n if (visible) {\r\n this.visibleWrites_ = this.visibleWrites_.addWrite(path, snap);\r\n }\r\n this.lastWriteId_ = writeId;\r\n };\r\n /**\r\n * Record a new merge from user code.\r\n *\r\n * @param {!Path} path\r\n * @param {!Object.<string, !Node>} changedChildren\r\n * @param {!number} writeId\r\n */\r\n WriteTree.prototype.addMerge = function (path, changedChildren, writeId) {\r\n assert(writeId > this.lastWriteId_, 'Stacking an older merge on top of newer ones');\r\n this.allWrites_.push({\r\n path: path,\r\n children: changedChildren,\r\n writeId: writeId,\r\n visible: true\r\n });\r\n this.visibleWrites_ = this.visibleWrites_.addWrites(path, changedChildren);\r\n this.lastWriteId_ = writeId;\r\n };\r\n /**\r\n * @param {!number} writeId\r\n * @return {?WriteRecord}\r\n */\r\n WriteTree.prototype.getWrite = function (writeId) {\r\n for (var i = 0; i < this.allWrites_.length; i++) {\r\n var record = this.allWrites_[i];\r\n if (record.writeId === writeId) {\r\n return record;\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * Remove a write (either an overwrite or merge) that has been successfully acknowledge by the server. Recalculates\r\n * the tree if necessary. We return true if it may have been visible, meaning views need to reevaluate.\r\n *\r\n * @param {!number} writeId\r\n * @return {boolean} true if the write may have been visible (meaning we'll need to reevaluate / raise\r\n * events as a result).\r\n */\r\n WriteTree.prototype.removeWrite = function (writeId) {\r\n // Note: disabling this check. It could be a transaction that preempted another transaction, and thus was applied\r\n // out of order.\r\n //const validClear = revert || this.allWrites_.length === 0 || writeId <= this.allWrites_[0].writeId;\r\n //assert(validClear, \"Either we don't have this write, or it's the first one in the queue\");\r\n var _this = this;\r\n var idx = this.allWrites_.findIndex(function (s) {\r\n return s.writeId === writeId;\r\n });\r\n assert(idx >= 0, 'removeWrite called with nonexistent writeId.');\r\n var writeToRemove = this.allWrites_[idx];\r\n this.allWrites_.splice(idx, 1);\r\n var removedWriteWasVisible = writeToRemove.visible;\r\n var removedWriteOverlapsWithOtherWrites = false;\r\n var i = this.allWrites_.length - 1;\r\n while (removedWriteWasVisible && i >= 0) {\r\n var currentWrite = this.allWrites_[i];\r\n if (currentWrite.visible) {\r\n if (i >= idx &&\r\n this.recordContainsPath_(currentWrite, writeToRemove.path)) {\r\n // The removed write was completely shadowed by a subsequent write.\r\n removedWriteWasVisible = false;\r\n }\r\n else if (writeToRemove.path.contains(currentWrite.path)) {\r\n // Either we're covering some writes or they're covering part of us (depending on which came first).\r\n removedWriteOverlapsWithOtherWrites = true;\r\n }\r\n }\r\n i--;\r\n }\r\n if (!removedWriteWasVisible) {\r\n return false;\r\n }\r\n else if (removedWriteOverlapsWithOtherWrites) {\r\n // There's some shadowing going on. Just rebuild the visible writes from scratch.\r\n this.resetTree_();\r\n return true;\r\n }\r\n else {\r\n // There's no shadowing. We can safely just remove the write(s) from visibleWrites.\r\n if (writeToRemove.snap) {\r\n this.visibleWrites_ = this.visibleWrites_.removeWrite(writeToRemove.path);\r\n }\r\n else {\r\n var children = writeToRemove.children;\r\n each(children, function (childName) {\r\n _this.visibleWrites_ = _this.visibleWrites_.removeWrite(writeToRemove.path.child(childName));\r\n });\r\n }\r\n return true;\r\n }\r\n };\r\n /**\r\n * Return a complete snapshot for the given path if there's visible write data at that path, else null.\r\n * No server data is considered.\r\n *\r\n * @param {!Path} path\r\n * @return {?Node}\r\n */\r\n WriteTree.prototype.getCompleteWriteData = function (path) {\r\n return this.visibleWrites_.getCompleteNode(path);\r\n };\r\n /**\r\n * Given optional, underlying server data, and an optional set of constraints (exclude some sets, include hidden\r\n * writes), attempt to calculate a complete snapshot for the given path\r\n *\r\n * @param {!Path} treePath\r\n * @param {?Node} completeServerCache\r\n * @param {Array.<number>=} writeIdsToExclude An optional set to be excluded\r\n * @param {boolean=} includeHiddenWrites Defaults to false, whether or not to layer on writes with visible set to false\r\n * @return {?Node}\r\n */\r\n WriteTree.prototype.calcCompleteEventCache = function (treePath, completeServerCache, writeIdsToExclude, includeHiddenWrites) {\r\n if (!writeIdsToExclude && !includeHiddenWrites) {\r\n var shadowingNode = this.visibleWrites_.getCompleteNode(treePath);\r\n if (shadowingNode != null) {\r\n return shadowingNode;\r\n }\r\n else {\r\n var subMerge = this.visibleWrites_.childCompoundWrite(treePath);\r\n if (subMerge.isEmpty()) {\r\n return completeServerCache;\r\n }\r\n else if (completeServerCache == null &&\r\n !subMerge.hasCompleteWrite(Path.Empty)) {\r\n // We wouldn't have a complete snapshot, since there's no underlying data and no complete shadow\r\n return null;\r\n }\r\n else {\r\n var layeredCache = completeServerCache || ChildrenNode.EMPTY_NODE;\r\n return subMerge.apply(layeredCache);\r\n }\r\n }\r\n }\r\n else {\r\n var merge = this.visibleWrites_.childCompoundWrite(treePath);\r\n if (!includeHiddenWrites && merge.isEmpty()) {\r\n return completeServerCache;\r\n }\r\n else {\r\n // If the server cache is null, and we don't have a complete cache, we need to return null\r\n if (!includeHiddenWrites &&\r\n completeServerCache == null &&\r\n !merge.hasCompleteWrite(Path.Empty)) {\r\n return null;\r\n }\r\n else {\r\n var filter = function (write) {\r\n return ((write.visible || includeHiddenWrites) &&\r\n (!writeIdsToExclude ||\r\n !~writeIdsToExclude.indexOf(write.writeId)) &&\r\n (write.path.contains(treePath) || treePath.contains(write.path)));\r\n };\r\n var mergeAtPath = WriteTree.layerTree_(this.allWrites_, filter, treePath);\r\n var layeredCache = completeServerCache || ChildrenNode.EMPTY_NODE;\r\n return mergeAtPath.apply(layeredCache);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * With optional, underlying server data, attempt to return a children node of children that we have complete data for.\r\n * Used when creating new views, to pre-fill their complete event children snapshot.\r\n *\r\n * @param {!Path} treePath\r\n * @param {?ChildrenNode} completeServerChildren\r\n * @return {!ChildrenNode}\r\n */\r\n WriteTree.prototype.calcCompleteEventChildren = function (treePath, completeServerChildren) {\r\n var completeChildren = ChildrenNode.EMPTY_NODE;\r\n var topLevelSet = this.visibleWrites_.getCompleteNode(treePath);\r\n if (topLevelSet) {\r\n if (!topLevelSet.isLeafNode()) {\r\n // we're shadowing everything. Return the children.\r\n topLevelSet.forEachChild(PRIORITY_INDEX, function (childName, childSnap) {\r\n completeChildren = completeChildren.updateImmediateChild(childName, childSnap);\r\n });\r\n }\r\n return completeChildren;\r\n }\r\n else if (completeServerChildren) {\r\n // Layer any children we have on top of this\r\n // We know we don't have a top-level set, so just enumerate existing children\r\n var merge_1 = this.visibleWrites_.childCompoundWrite(treePath);\r\n completeServerChildren.forEachChild(PRIORITY_INDEX, function (childName, childNode) {\r\n var node = merge_1\r\n .childCompoundWrite(new Path(childName))\r\n .apply(childNode);\r\n completeChildren = completeChildren.updateImmediateChild(childName, node);\r\n });\r\n // Add any complete children we have from the set\r\n merge_1.getCompleteChildren().forEach(function (namedNode) {\r\n completeChildren = completeChildren.updateImmediateChild(namedNode.name, namedNode.node);\r\n });\r\n return completeChildren;\r\n }\r\n else {\r\n // We don't have anything to layer on top of. Layer on any children we have\r\n // Note that we can return an empty snap if we have a defined delete\r\n var merge = this.visibleWrites_.childCompoundWrite(treePath);\r\n merge.getCompleteChildren().forEach(function (namedNode) {\r\n completeChildren = completeChildren.updateImmediateChild(namedNode.name, namedNode.node);\r\n });\r\n return completeChildren;\r\n }\r\n };\r\n /**\r\n * Given that the underlying server data has updated, determine what, if anything, needs to be\r\n * applied to the event cache.\r\n *\r\n * Possibilities:\r\n *\r\n * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data\r\n *\r\n * 2. Some write is completely shadowing. No events to be raised\r\n *\r\n * 3. Is partially shadowed. Events\r\n *\r\n * Either existingEventSnap or existingServerSnap must exist\r\n *\r\n * @param {!Path} treePath\r\n * @param {!Path} childPath\r\n * @param {?Node} existingEventSnap\r\n * @param {?Node} existingServerSnap\r\n * @return {?Node}\r\n */\r\n WriteTree.prototype.calcEventCacheAfterServerOverwrite = function (treePath, childPath, existingEventSnap, existingServerSnap) {\r\n assert(existingEventSnap || existingServerSnap, 'Either existingEventSnap or existingServerSnap must exist');\r\n var path = treePath.child(childPath);\r\n if (this.visibleWrites_.hasCompleteWrite(path)) {\r\n // At this point we can probably guarantee that we're in case 2, meaning no events\r\n // May need to check visibility while doing the findRootMostValueAndPath call\r\n return null;\r\n }\r\n else {\r\n // No complete shadowing. We're either partially shadowing or not shadowing at all.\r\n var childMerge = this.visibleWrites_.childCompoundWrite(path);\r\n if (childMerge.isEmpty()) {\r\n // We're not shadowing at all. Case 1\r\n return existingServerSnap.getChild(childPath);\r\n }\r\n else {\r\n // This could be more efficient if the serverNode + updates doesn't change the eventSnap\r\n // However this is tricky to find out, since user updates don't necessary change the server\r\n // snap, e.g. priority updates on empty nodes, or deep deletes. Another special case is if the server\r\n // adds nodes, but doesn't change any existing writes. It is therefore not enough to\r\n // only check if the updates change the serverNode.\r\n // Maybe check if the merge tree contains these special cases and only do a full overwrite in that case?\r\n return childMerge.apply(existingServerSnap.getChild(childPath));\r\n }\r\n }\r\n };\r\n /**\r\n * Returns a complete child for a given server snap after applying all user writes or null if there is no\r\n * complete child for this ChildKey.\r\n *\r\n * @param {!Path} treePath\r\n * @param {!string} childKey\r\n * @param {!CacheNode} existingServerSnap\r\n * @return {?Node}\r\n */\r\n WriteTree.prototype.calcCompleteChild = function (treePath, childKey, existingServerSnap) {\r\n var path = treePath.child(childKey);\r\n var shadowingNode = this.visibleWrites_.getCompleteNode(path);\r\n if (shadowingNode != null) {\r\n return shadowingNode;\r\n }\r\n else {\r\n if (existingServerSnap.isCompleteForChild(childKey)) {\r\n var childMerge = this.visibleWrites_.childCompoundWrite(path);\r\n return childMerge.apply(existingServerSnap.getNode().getImmediateChild(childKey));\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n };\r\n /**\r\n * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at\r\n * a higher path, this will return the child of that write relative to the write and this path.\r\n * Returns null if there is no write at this path.\r\n */\r\n WriteTree.prototype.shadowingWrite = function (path) {\r\n return this.visibleWrites_.getCompleteNode(path);\r\n };\r\n /**\r\n * This method is used when processing child remove events on a query. If we can, we pull in children that were outside\r\n * the window, but may now be in the window.\r\n */\r\n WriteTree.prototype.calcIndexedSlice = function (treePath, completeServerData, startPost, count, reverse, index) {\r\n var toIterate;\r\n var merge = this.visibleWrites_.childCompoundWrite(treePath);\r\n var shadowingNode = merge.getCompleteNode(Path.Empty);\r\n if (shadowingNode != null) {\r\n toIterate = shadowingNode;\r\n }\r\n else if (completeServerData != null) {\r\n toIterate = merge.apply(completeServerData);\r\n }\r\n else {\r\n // no children to iterate on\r\n return [];\r\n }\r\n toIterate = toIterate.withIndex(index);\r\n if (!toIterate.isEmpty() && !toIterate.isLeafNode()) {\r\n var nodes = [];\r\n var cmp = index.getCompare();\r\n var iter = reverse\r\n ? toIterate.getReverseIteratorFrom(startPost, index)\r\n : toIterate.getIteratorFrom(startPost, index);\r\n var next = iter.getNext();\r\n while (next && nodes.length < count) {\r\n if (cmp(next, startPost) !== 0) {\r\n nodes.push(next);\r\n }\r\n next = iter.getNext();\r\n }\r\n return nodes;\r\n }\r\n else {\r\n return [];\r\n }\r\n };\r\n WriteTree.prototype.recordContainsPath_ = function (writeRecord, path) {\r\n if (writeRecord.snap) {\r\n return writeRecord.path.contains(path);\r\n }\r\n else {\r\n for (var childName in writeRecord.children) {\r\n if (writeRecord.children.hasOwnProperty(childName) &&\r\n writeRecord.path.child(childName).contains(path)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n };\r\n /**\r\n * Re-layer the writes and merges into a tree so we can efficiently calculate event snapshots\r\n */\r\n WriteTree.prototype.resetTree_ = function () {\r\n this.visibleWrites_ = WriteTree.layerTree_(this.allWrites_, WriteTree.DefaultFilter_, Path.Empty);\r\n if (this.allWrites_.length > 0) {\r\n this.lastWriteId_ = this.allWrites_[this.allWrites_.length - 1].writeId;\r\n }\r\n else {\r\n this.lastWriteId_ = -1;\r\n }\r\n };\r\n /**\r\n * The default filter used when constructing the tree. Keep everything that's visible.\r\n */\r\n WriteTree.DefaultFilter_ = function (write) {\r\n return write.visible;\r\n };\r\n /**\r\n * Static method. Given an array of WriteRecords, a filter for which ones to include, and a path, construct the tree of\r\n * event data at that path.\r\n */\r\n WriteTree.layerTree_ = function (writes, filter, treeRoot) {\r\n var compoundWrite = CompoundWrite.Empty;\r\n for (var i = 0; i < writes.length; ++i) {\r\n var write = writes[i];\r\n // Theory, a later set will either:\r\n // a) abort a relevant transaction, so no need to worry about excluding it from calculating that transaction\r\n // b) not be relevant to a transaction (separate branch), so again will not affect the data for that transaction\r\n if (filter(write)) {\r\n var writePath = write.path;\r\n var relativePath = void 0;\r\n if (write.snap) {\r\n if (treeRoot.contains(writePath)) {\r\n relativePath = Path.relativePath(treeRoot, writePath);\r\n compoundWrite = compoundWrite.addWrite(relativePath, write.snap);\r\n }\r\n else if (writePath.contains(treeRoot)) {\r\n relativePath = Path.relativePath(writePath, treeRoot);\r\n compoundWrite = compoundWrite.addWrite(Path.Empty, write.snap.getChild(relativePath));\r\n }\r\n else ;\r\n }\r\n else if (write.children) {\r\n if (treeRoot.contains(writePath)) {\r\n relativePath = Path.relativePath(treeRoot, writePath);\r\n compoundWrite = compoundWrite.addWrites(relativePath, write.children);\r\n }\r\n else if (writePath.contains(treeRoot)) {\r\n relativePath = Path.relativePath(writePath, treeRoot);\r\n if (relativePath.isEmpty()) {\r\n compoundWrite = compoundWrite.addWrites(Path.Empty, write.children);\r\n }\r\n else {\r\n var child = safeGet(write.children, relativePath.getFront());\r\n if (child) {\r\n // There exists a child in this node that matches the root path\r\n var deepNode = child.getChild(relativePath.popFront());\r\n compoundWrite = compoundWrite.addWrite(Path.Empty, deepNode);\r\n }\r\n }\r\n }\r\n else ;\r\n }\r\n else {\r\n throw assertionError('WriteRecord should have .snap or .children');\r\n }\r\n }\r\n }\r\n return compoundWrite;\r\n };\r\n return WriteTree;\r\n}());\r\n/**\r\n * A WriteTreeRef wraps a WriteTree and a path, for convenient access to a particular subtree. All of the methods\r\n * just proxy to the underlying WriteTree.\r\n *\r\n * @constructor\r\n */\r\nvar WriteTreeRef = /** @class */ (function () {\r\n /**\r\n * @param {!Path} path\r\n * @param {!WriteTree} writeTree\r\n */\r\n function WriteTreeRef(path, writeTree) {\r\n this.treePath_ = path;\r\n this.writeTree_ = writeTree;\r\n }\r\n /**\r\n * If possible, returns a complete event cache, using the underlying server data if possible. In addition, can be used\r\n * to get a cache that includes hidden writes, and excludes arbitrary writes. Note that customizing the returned node\r\n * can lead to a more expensive calculation.\r\n *\r\n * @param {?Node} completeServerCache\r\n * @param {Array.<number>=} writeIdsToExclude Optional writes to exclude.\r\n * @param {boolean=} includeHiddenWrites Defaults to false, whether or not to layer on writes with visible set to false\r\n * @return {?Node}\r\n */\r\n WriteTreeRef.prototype.calcCompleteEventCache = function (completeServerCache, writeIdsToExclude, includeHiddenWrites) {\r\n return this.writeTree_.calcCompleteEventCache(this.treePath_, completeServerCache, writeIdsToExclude, includeHiddenWrites);\r\n };\r\n /**\r\n * If possible, returns a children node containing all of the complete children we have data for. The returned data is a\r\n * mix of the given server data and write data.\r\n *\r\n * @param {?ChildrenNode} completeServerChildren\r\n * @return {!ChildrenNode}\r\n */\r\n WriteTreeRef.prototype.calcCompleteEventChildren = function (completeServerChildren) {\r\n return this.writeTree_.calcCompleteEventChildren(this.treePath_, completeServerChildren);\r\n };\r\n /**\r\n * Given that either the underlying server data has updated or the outstanding writes have updated, determine what,\r\n * if anything, needs to be applied to the event cache.\r\n *\r\n * Possibilities:\r\n *\r\n * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data\r\n *\r\n * 2. Some write is completely shadowing. No events to be raised\r\n *\r\n * 3. Is partially shadowed. Events should be raised\r\n *\r\n * Either existingEventSnap or existingServerSnap must exist, this is validated via an assert\r\n *\r\n * @param {!Path} path\r\n * @param {?Node} existingEventSnap\r\n * @param {?Node} existingServerSnap\r\n * @return {?Node}\r\n */\r\n WriteTreeRef.prototype.calcEventCacheAfterServerOverwrite = function (path, existingEventSnap, existingServerSnap) {\r\n return this.writeTree_.calcEventCacheAfterServerOverwrite(this.treePath_, path, existingEventSnap, existingServerSnap);\r\n };\r\n /**\r\n * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at\r\n * a higher path, this will return the child of that write relative to the write and this path.\r\n * Returns null if there is no write at this path.\r\n *\r\n * @param {!Path} path\r\n * @return {?Node}\r\n */\r\n WriteTreeRef.prototype.shadowingWrite = function (path) {\r\n return this.writeTree_.shadowingWrite(this.treePath_.child(path));\r\n };\r\n /**\r\n * This method is used when processing child remove events on a query. If we can, we pull in children that were outside\r\n * the window, but may now be in the window\r\n *\r\n * @param {?Node} completeServerData\r\n * @param {!NamedNode} startPost\r\n * @param {!number} count\r\n * @param {boolean} reverse\r\n * @param {!Index} index\r\n * @return {!Array.<!NamedNode>}\r\n */\r\n WriteTreeRef.prototype.calcIndexedSlice = function (completeServerData, startPost, count, reverse, index) {\r\n return this.writeTree_.calcIndexedSlice(this.treePath_, completeServerData, startPost, count, reverse, index);\r\n };\r\n /**\r\n * Returns a complete child for a given server snap after applying all user writes or null if there is no\r\n * complete child for this ChildKey.\r\n *\r\n * @param {!string} childKey\r\n * @param {!CacheNode} existingServerCache\r\n * @return {?Node}\r\n */\r\n WriteTreeRef.prototype.calcCompleteChild = function (childKey, existingServerCache) {\r\n return this.writeTree_.calcCompleteChild(this.treePath_, childKey, existingServerCache);\r\n };\r\n /**\r\n * Return a WriteTreeRef for a child.\r\n *\r\n * @param {string} childName\r\n * @return {!WriteTreeRef}\r\n */\r\n WriteTreeRef.prototype.child = function (childName) {\r\n return new WriteTreeRef(this.treePath_.child(childName), this.writeTree_);\r\n };\r\n return WriteTreeRef;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * SyncTree is the central class for managing event callback registration, data caching, views\r\n * (query processing), and event generation. There are typically two SyncTree instances for\r\n * each Repo, one for the normal Firebase data, and one for the .info data.\r\n *\r\n * It has a number of responsibilities, including:\r\n * - Tracking all user event callbacks (registered via addEventRegistration() and removeEventRegistration()).\r\n * - Applying and caching data changes for user set(), transaction(), and update() calls\r\n * (applyUserOverwrite(), applyUserMerge()).\r\n * - Applying and caching data changes for server data changes (applyServerOverwrite(),\r\n * applyServerMerge()).\r\n * - Generating user-facing events for server and user changes (all of the apply* methods\r\n * return the set of events that need to be raised as a result).\r\n * - Maintaining the appropriate set of server listens to ensure we are always subscribed\r\n * to the correct set of paths and queries to satisfy the current set of user event\r\n * callbacks (listens are started/stopped using the provided listenProvider).\r\n *\r\n * NOTE: Although SyncTree tracks event callbacks and calculates events to raise, the actual\r\n * events are returned to the caller rather than raised synchronously.\r\n *\r\n * @constructor\r\n */\r\nvar SyncTree = /** @class */ (function () {\r\n /**\r\n * @param {!ListenProvider} listenProvider_ Used by SyncTree to start / stop listening\r\n * to server data.\r\n */\r\n function SyncTree(listenProvider_) {\r\n this.listenProvider_ = listenProvider_;\r\n /**\r\n * Tree of SyncPoints. There's a SyncPoint at any location that has 1 or more views.\r\n */\r\n this.syncPointTree_ = ImmutableTree.Empty;\r\n /**\r\n * A tree of all pending user writes (user-initiated set()'s, transaction()'s, update()'s, etc.).\r\n */\r\n this.pendingWriteTree_ = new WriteTree();\r\n this.tagToQueryMap = new Map();\r\n this.queryToTagMap = new Map();\r\n }\r\n /**\r\n * Apply the data changes for a user-generated set() or transaction() call.\r\n *\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.applyUserOverwrite = function (path, newData, writeId, visible) {\r\n // Record pending write.\r\n this.pendingWriteTree_.addOverwrite(path, newData, writeId, visible);\r\n if (!visible) {\r\n return [];\r\n }\r\n else {\r\n return this.applyOperationToSyncPoints_(new Overwrite(OperationSource.User, path, newData));\r\n }\r\n };\r\n /**\r\n * Apply the data from a user-generated update() call\r\n *\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.applyUserMerge = function (path, changedChildren, writeId) {\r\n // Record pending merge.\r\n this.pendingWriteTree_.addMerge(path, changedChildren, writeId);\r\n var changeTree = ImmutableTree.fromObject(changedChildren);\r\n return this.applyOperationToSyncPoints_(new Merge(OperationSource.User, path, changeTree));\r\n };\r\n /**\r\n * Acknowledge a pending user write that was previously registered with applyUserOverwrite() or applyUserMerge().\r\n *\r\n * @param revert True if the given write failed and needs to be reverted\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.ackUserWrite = function (writeId, revert) {\r\n if (revert === void 0) { revert = false; }\r\n var write = this.pendingWriteTree_.getWrite(writeId);\r\n var needToReevaluate = this.pendingWriteTree_.removeWrite(writeId);\r\n if (!needToReevaluate) {\r\n return [];\r\n }\r\n else {\r\n var affectedTree_1 = ImmutableTree.Empty;\r\n if (write.snap != null) {\r\n // overwrite\r\n affectedTree_1 = affectedTree_1.set(Path.Empty, true);\r\n }\r\n else {\r\n each(write.children, function (pathString, node) {\r\n affectedTree_1 = affectedTree_1.set(new Path(pathString), node);\r\n });\r\n }\r\n return this.applyOperationToSyncPoints_(new AckUserWrite(write.path, affectedTree_1, revert));\r\n }\r\n };\r\n /**\r\n * Apply new server data for the specified path..\r\n *\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.applyServerOverwrite = function (path, newData) {\r\n return this.applyOperationToSyncPoints_(new Overwrite(OperationSource.Server, path, newData));\r\n };\r\n /**\r\n * Apply new server data to be merged in at the specified path.\r\n *\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.applyServerMerge = function (path, changedChildren) {\r\n var changeTree = ImmutableTree.fromObject(changedChildren);\r\n return this.applyOperationToSyncPoints_(new Merge(OperationSource.Server, path, changeTree));\r\n };\r\n /**\r\n * Apply a listen complete for a query\r\n *\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.applyListenComplete = function (path) {\r\n return this.applyOperationToSyncPoints_(new ListenComplete(OperationSource.Server, path));\r\n };\r\n /**\r\n * Apply new server data for the specified tagged query.\r\n *\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.applyTaggedQueryOverwrite = function (path, snap, tag) {\r\n var queryKey = this.queryKeyForTag_(tag);\r\n if (queryKey != null) {\r\n var r = SyncTree.parseQueryKey_(queryKey);\r\n var queryPath = r.path, queryId = r.queryId;\r\n var relativePath = Path.relativePath(queryPath, path);\r\n var op = new Overwrite(OperationSource.forServerTaggedQuery(queryId), relativePath, snap);\r\n return this.applyTaggedOperation_(queryPath, op);\r\n }\r\n else {\r\n // Query must have been removed already\r\n return [];\r\n }\r\n };\r\n /**\r\n * Apply server data to be merged in for the specified tagged query.\r\n *\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.applyTaggedQueryMerge = function (path, changedChildren, tag) {\r\n var queryKey = this.queryKeyForTag_(tag);\r\n if (queryKey) {\r\n var r = SyncTree.parseQueryKey_(queryKey);\r\n var queryPath = r.path, queryId = r.queryId;\r\n var relativePath = Path.relativePath(queryPath, path);\r\n var changeTree = ImmutableTree.fromObject(changedChildren);\r\n var op = new Merge(OperationSource.forServerTaggedQuery(queryId), relativePath, changeTree);\r\n return this.applyTaggedOperation_(queryPath, op);\r\n }\r\n else {\r\n // We've already removed the query. No big deal, ignore the update\r\n return [];\r\n }\r\n };\r\n /**\r\n * Apply a listen complete for a tagged query\r\n *\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.applyTaggedListenComplete = function (path, tag) {\r\n var queryKey = this.queryKeyForTag_(tag);\r\n if (queryKey) {\r\n var r = SyncTree.parseQueryKey_(queryKey);\r\n var queryPath = r.path, queryId = r.queryId;\r\n var relativePath = Path.relativePath(queryPath, path);\r\n var op = new ListenComplete(OperationSource.forServerTaggedQuery(queryId), relativePath);\r\n return this.applyTaggedOperation_(queryPath, op);\r\n }\r\n else {\r\n // We've already removed the query. No big deal, ignore the update\r\n return [];\r\n }\r\n };\r\n /**\r\n * Add an event callback for the specified query.\r\n *\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.addEventRegistration = function (query, eventRegistration) {\r\n var path = query.path;\r\n var serverCache = null;\r\n var foundAncestorDefaultView = false;\r\n // Any covering writes will necessarily be at the root, so really all we need to find is the server cache.\r\n // Consider optimizing this once there's a better understanding of what actual behavior will be.\r\n this.syncPointTree_.foreachOnPath(path, function (pathToSyncPoint, sp) {\r\n var relativePath = Path.relativePath(pathToSyncPoint, path);\r\n serverCache = serverCache || sp.getCompleteServerCache(relativePath);\r\n foundAncestorDefaultView =\r\n foundAncestorDefaultView || sp.hasCompleteView();\r\n });\r\n var syncPoint = this.syncPointTree_.get(path);\r\n if (!syncPoint) {\r\n syncPoint = new SyncPoint();\r\n this.syncPointTree_ = this.syncPointTree_.set(path, syncPoint);\r\n }\r\n else {\r\n foundAncestorDefaultView =\r\n foundAncestorDefaultView || syncPoint.hasCompleteView();\r\n serverCache = serverCache || syncPoint.getCompleteServerCache(Path.Empty);\r\n }\r\n var serverCacheComplete;\r\n if (serverCache != null) {\r\n serverCacheComplete = true;\r\n }\r\n else {\r\n serverCacheComplete = false;\r\n serverCache = ChildrenNode.EMPTY_NODE;\r\n var subtree = this.syncPointTree_.subtree(path);\r\n subtree.foreachChild(function (childName, childSyncPoint) {\r\n var completeCache = childSyncPoint.getCompleteServerCache(Path.Empty);\r\n if (completeCache) {\r\n serverCache = serverCache.updateImmediateChild(childName, completeCache);\r\n }\r\n });\r\n }\r\n var viewAlreadyExists = syncPoint.viewExistsForQuery(query);\r\n if (!viewAlreadyExists && !query.getQueryParams().loadsAllData()) {\r\n // We need to track a tag for this query\r\n var queryKey = SyncTree.makeQueryKey_(query);\r\n assert(!this.queryToTagMap.has(queryKey), 'View does not exist, but we have a tag');\r\n var tag = SyncTree.getNextQueryTag_();\r\n this.queryToTagMap.set(queryKey, tag);\r\n this.tagToQueryMap.set(tag, queryKey);\r\n }\r\n var writesCache = this.pendingWriteTree_.childWrites(path);\r\n var events = syncPoint.addEventRegistration(query, eventRegistration, writesCache, serverCache, serverCacheComplete);\r\n if (!viewAlreadyExists && !foundAncestorDefaultView) {\r\n var view /** @type !View */ = syncPoint.viewForQuery(query);\r\n events = events.concat(this.setupListener_(query, view));\r\n }\r\n return events;\r\n };\r\n /**\r\n * Remove event callback(s).\r\n *\r\n * If query is the default query, we'll check all queries for the specified eventRegistration.\r\n * If eventRegistration is null, we'll remove all callbacks for the specified query/queries.\r\n *\r\n * @param eventRegistration If null, all callbacks are removed.\r\n * @param cancelError If a cancelError is provided, appropriate cancel events will be returned.\r\n * @return Cancel events, if cancelError was provided.\r\n */\r\n SyncTree.prototype.removeEventRegistration = function (query, eventRegistration, cancelError) {\r\n var _this = this;\r\n // Find the syncPoint first. Then deal with whether or not it has matching listeners\r\n var path = query.path;\r\n var maybeSyncPoint = this.syncPointTree_.get(path);\r\n var cancelEvents = [];\r\n // A removal on a default query affects all queries at that location. A removal on an indexed query, even one without\r\n // other query constraints, does *not* affect all queries at that location. So this check must be for 'default', and\r\n // not loadsAllData().\r\n if (maybeSyncPoint &&\r\n (query.queryIdentifier() === 'default' ||\r\n maybeSyncPoint.viewExistsForQuery(query))) {\r\n /**\r\n * @type {{removed: !Array.<!Query>, events: !Array.<!Event>}}\r\n */\r\n var removedAndEvents = maybeSyncPoint.removeEventRegistration(query, eventRegistration, cancelError);\r\n if (maybeSyncPoint.isEmpty()) {\r\n this.syncPointTree_ = this.syncPointTree_.remove(path);\r\n }\r\n var removed = removedAndEvents.removed;\r\n cancelEvents = removedAndEvents.events;\r\n // We may have just removed one of many listeners and can short-circuit this whole process\r\n // We may also not have removed a default listener, in which case all of the descendant listeners should already be\r\n // properly set up.\r\n //\r\n // Since indexed queries can shadow if they don't have other query constraints, check for loadsAllData(), instead of\r\n // queryId === 'default'\r\n var removingDefault = -1 !==\r\n removed.findIndex(function (query) {\r\n return query.getQueryParams().loadsAllData();\r\n });\r\n var covered = this.syncPointTree_.findOnPath(path, function (relativePath, parentSyncPoint) {\r\n return parentSyncPoint.hasCompleteView();\r\n });\r\n if (removingDefault && !covered) {\r\n var subtree = this.syncPointTree_.subtree(path);\r\n // There are potentially child listeners. Determine what if any listens we need to send before executing the\r\n // removal\r\n if (!subtree.isEmpty()) {\r\n // We need to fold over our subtree and collect the listeners to send\r\n var newViews = this.collectDistinctViewsForSubTree_(subtree);\r\n // Ok, we've collected all the listens we need. Set them up.\r\n for (var i = 0; i < newViews.length; ++i) {\r\n var view = newViews[i], newQuery = view.getQuery();\r\n var listener = this.createListenerForView_(view);\r\n this.listenProvider_.startListening(SyncTree.queryForListening_(newQuery), this.tagForQuery_(newQuery), listener.hashFn, listener.onComplete);\r\n }\r\n }\r\n }\r\n // If we removed anything and we're not covered by a higher up listen, we need to stop listening on this query\r\n // The above block has us covered in terms of making sure we're set up on listens lower in the tree.\r\n // Also, note that if we have a cancelError, it's already been removed at the provider level.\r\n if (!covered && removed.length > 0 && !cancelError) {\r\n // If we removed a default, then we weren't listening on any of the other queries here. Just cancel the one\r\n // default. Otherwise, we need to iterate through and cancel each individual query\r\n if (removingDefault) {\r\n // We don't tag default listeners\r\n var defaultTag = null;\r\n this.listenProvider_.stopListening(SyncTree.queryForListening_(query), defaultTag);\r\n }\r\n else {\r\n removed.forEach(function (queryToRemove) {\r\n var tagToRemove = _this.queryToTagMap.get(SyncTree.makeQueryKey_(queryToRemove));\r\n _this.listenProvider_.stopListening(SyncTree.queryForListening_(queryToRemove), tagToRemove);\r\n });\r\n }\r\n }\r\n // Now, clear all of the tags we're tracking for the removed listens\r\n this.removeTags_(removed);\r\n }\r\n return cancelEvents;\r\n };\r\n /**\r\n * Returns a complete cache, if we have one, of the data at a particular path. If the location does not have a\r\n * listener above it, we will get a false \"null\". This shouldn't be a problem because transactions will always\r\n * have a listener above, and atomic operations would correctly show a jitter of <increment value> ->\r\n * <incremented total> as the write is applied locally and then acknowledged at the server.\r\n *\r\n * Note: this method will *include* hidden writes from transaction with applyLocally set to false.\r\n *\r\n * @param path The path to the data we want\r\n * @param writeIdsToExclude A specific set to be excluded\r\n */\r\n SyncTree.prototype.calcCompleteEventCache = function (path, writeIdsToExclude) {\r\n var includeHiddenSets = true;\r\n var writeTree = this.pendingWriteTree_;\r\n var serverCache = this.syncPointTree_.findOnPath(path, function (pathSoFar, syncPoint) {\r\n var relativePath = Path.relativePath(pathSoFar, path);\r\n var serverCache = syncPoint.getCompleteServerCache(relativePath);\r\n if (serverCache) {\r\n return serverCache;\r\n }\r\n });\r\n return writeTree.calcCompleteEventCache(path, serverCache, writeIdsToExclude, includeHiddenSets);\r\n };\r\n /**\r\n * This collapses multiple unfiltered views into a single view, since we only need a single\r\n * listener for them.\r\n */\r\n SyncTree.prototype.collectDistinctViewsForSubTree_ = function (subtree) {\r\n return subtree.fold(function (relativePath, maybeChildSyncPoint, childMap) {\r\n if (maybeChildSyncPoint && maybeChildSyncPoint.hasCompleteView()) {\r\n var completeView = maybeChildSyncPoint.getCompleteView();\r\n return [completeView];\r\n }\r\n else {\r\n // No complete view here, flatten any deeper listens into an array\r\n var views_1 = [];\r\n if (maybeChildSyncPoint) {\r\n views_1 = maybeChildSyncPoint.getQueryViews();\r\n }\r\n each(childMap, function (_key, childViews) {\r\n views_1 = views_1.concat(childViews);\r\n });\r\n return views_1;\r\n }\r\n });\r\n };\r\n SyncTree.prototype.removeTags_ = function (queries) {\r\n for (var j = 0; j < queries.length; ++j) {\r\n var removedQuery = queries[j];\r\n if (!removedQuery.getQueryParams().loadsAllData()) {\r\n // We should have a tag for this\r\n var removedQueryKey = SyncTree.makeQueryKey_(removedQuery);\r\n var removedQueryTag = this.queryToTagMap.get(removedQueryKey);\r\n this.queryToTagMap.delete(removedQueryKey);\r\n this.tagToQueryMap.delete(removedQueryTag);\r\n }\r\n }\r\n };\r\n /**\r\n * Normalizes a query to a query we send the server for listening\r\n *\r\n * @return The normalized query\r\n */\r\n SyncTree.queryForListening_ = function (query) {\r\n if (query.getQueryParams().loadsAllData() &&\r\n !query.getQueryParams().isDefault()) {\r\n // We treat queries that load all data as default queries\r\n // Cast is necessary because ref() technically returns Firebase which is actually fb.api.Firebase which inherits\r\n // from Query\r\n return query.getRef();\r\n }\r\n else {\r\n return query;\r\n }\r\n };\r\n /**\r\n * For a given new listen, manage the de-duplication of outstanding subscriptions.\r\n *\r\n * @return This method can return events to support synchronous data sources\r\n */\r\n SyncTree.prototype.setupListener_ = function (query, view) {\r\n var path = query.path;\r\n var tag = this.tagForQuery_(query);\r\n var listener = this.createListenerForView_(view);\r\n var events = this.listenProvider_.startListening(SyncTree.queryForListening_(query), tag, listener.hashFn, listener.onComplete);\r\n var subtree = this.syncPointTree_.subtree(path);\r\n // The root of this subtree has our query. We're here because we definitely need to send a listen for that, but we\r\n // may need to shadow other listens as well.\r\n if (tag) {\r\n assert(!subtree.value.hasCompleteView(), \"If we're adding a query, it shouldn't be shadowed\");\r\n }\r\n else {\r\n // Shadow everything at or below this location, this is a default listener.\r\n var queriesToStop = subtree.fold(function (relativePath, maybeChildSyncPoint, childMap) {\r\n if (!relativePath.isEmpty() &&\r\n maybeChildSyncPoint &&\r\n maybeChildSyncPoint.hasCompleteView()) {\r\n return [maybeChildSyncPoint.getCompleteView().getQuery()];\r\n }\r\n else {\r\n // No default listener here, flatten any deeper queries into an array\r\n var queries_1 = [];\r\n if (maybeChildSyncPoint) {\r\n queries_1 = queries_1.concat(maybeChildSyncPoint.getQueryViews().map(function (view) { return view.getQuery(); }));\r\n }\r\n each(childMap, function (_key, childQueries) {\r\n queries_1 = queries_1.concat(childQueries);\r\n });\r\n return queries_1;\r\n }\r\n });\r\n for (var i = 0; i < queriesToStop.length; ++i) {\r\n var queryToStop = queriesToStop[i];\r\n this.listenProvider_.stopListening(SyncTree.queryForListening_(queryToStop), this.tagForQuery_(queryToStop));\r\n }\r\n }\r\n return events;\r\n };\r\n SyncTree.prototype.createListenerForView_ = function (view) {\r\n var _this = this;\r\n var query = view.getQuery();\r\n var tag = this.tagForQuery_(query);\r\n return {\r\n hashFn: function () {\r\n var cache = view.getServerCache() || ChildrenNode.EMPTY_NODE;\r\n return cache.hash();\r\n },\r\n onComplete: function (status) {\r\n if (status === 'ok') {\r\n if (tag) {\r\n return _this.applyTaggedListenComplete(query.path, tag);\r\n }\r\n else {\r\n return _this.applyListenComplete(query.path);\r\n }\r\n }\r\n else {\r\n // If a listen failed, kill all of the listeners here, not just the one that triggered the error.\r\n // Note that this may need to be scoped to just this listener if we change permissions on filtered children\r\n var error = errorForServerCode(status, query);\r\n return _this.removeEventRegistration(query, \r\n /*eventRegistration*/ null, error);\r\n }\r\n }\r\n };\r\n };\r\n /**\r\n * Given a query, computes a \"queryKey\" suitable for use in our queryToTagMap_.\r\n */\r\n SyncTree.makeQueryKey_ = function (query) {\r\n return query.path.toString() + '$' + query.queryIdentifier();\r\n };\r\n /**\r\n * Given a queryKey (created by makeQueryKey), parse it back into a path and queryId.\r\n */\r\n SyncTree.parseQueryKey_ = function (queryKey) {\r\n var splitIndex = queryKey.indexOf('$');\r\n assert(splitIndex !== -1 && splitIndex < queryKey.length - 1, 'Bad queryKey.');\r\n return {\r\n queryId: queryKey.substr(splitIndex + 1),\r\n path: new Path(queryKey.substr(0, splitIndex))\r\n };\r\n };\r\n /**\r\n * Return the query associated with the given tag, if we have one\r\n */\r\n SyncTree.prototype.queryKeyForTag_ = function (tag) {\r\n return this.tagToQueryMap.get(tag);\r\n };\r\n /**\r\n * Return the tag associated with the given query.\r\n */\r\n SyncTree.prototype.tagForQuery_ = function (query) {\r\n var queryKey = SyncTree.makeQueryKey_(query);\r\n return this.queryToTagMap.get(queryKey);\r\n };\r\n /**\r\n * Static accessor for query tags.\r\n */\r\n SyncTree.getNextQueryTag_ = function () {\r\n return SyncTree.nextQueryTag_++;\r\n };\r\n /**\r\n * A helper method to apply tagged operations\r\n */\r\n SyncTree.prototype.applyTaggedOperation_ = function (queryPath, operation) {\r\n var syncPoint = this.syncPointTree_.get(queryPath);\r\n assert(syncPoint, \"Missing sync point for query tag that we're tracking\");\r\n var writesCache = this.pendingWriteTree_.childWrites(queryPath);\r\n return syncPoint.applyOperation(operation, writesCache, \r\n /*serverCache=*/ null);\r\n };\r\n /**\r\n * A helper method that visits all descendant and ancestor SyncPoints, applying the operation.\r\n *\r\n * NOTES:\r\n * - Descendant SyncPoints will be visited first (since we raise events depth-first).\r\n *\r\n * - We call applyOperation() on each SyncPoint passing three things:\r\n * 1. A version of the Operation that has been made relative to the SyncPoint location.\r\n * 2. A WriteTreeRef of any writes we have cached at the SyncPoint location.\r\n * 3. A snapshot Node with cached server data, if we have it.\r\n *\r\n * - We concatenate all of the events returned by each SyncPoint and return the result.\r\n */\r\n SyncTree.prototype.applyOperationToSyncPoints_ = function (operation) {\r\n return this.applyOperationHelper_(operation, this.syncPointTree_, \r\n /*serverCache=*/ null, this.pendingWriteTree_.childWrites(Path.Empty));\r\n };\r\n /**\r\n * Recursive helper for applyOperationToSyncPoints_\r\n */\r\n SyncTree.prototype.applyOperationHelper_ = function (operation, syncPointTree, serverCache, writesCache) {\r\n if (operation.path.isEmpty()) {\r\n return this.applyOperationDescendantsHelper_(operation, syncPointTree, serverCache, writesCache);\r\n }\r\n else {\r\n var syncPoint = syncPointTree.get(Path.Empty);\r\n // If we don't have cached server data, see if we can get it from this SyncPoint.\r\n if (serverCache == null && syncPoint != null) {\r\n serverCache = syncPoint.getCompleteServerCache(Path.Empty);\r\n }\r\n var events = [];\r\n var childName = operation.path.getFront();\r\n var childOperation = operation.operationForChild(childName);\r\n var childTree = syncPointTree.children.get(childName);\r\n if (childTree && childOperation) {\r\n var childServerCache = serverCache\r\n ? serverCache.getImmediateChild(childName)\r\n : null;\r\n var childWritesCache = writesCache.child(childName);\r\n events = events.concat(this.applyOperationHelper_(childOperation, childTree, childServerCache, childWritesCache));\r\n }\r\n if (syncPoint) {\r\n events = events.concat(syncPoint.applyOperation(operation, writesCache, serverCache));\r\n }\r\n return events;\r\n }\r\n };\r\n /**\r\n * Recursive helper for applyOperationToSyncPoints_\r\n */\r\n SyncTree.prototype.applyOperationDescendantsHelper_ = function (operation, syncPointTree, serverCache, writesCache) {\r\n var _this = this;\r\n var syncPoint = syncPointTree.get(Path.Empty);\r\n // If we don't have cached server data, see if we can get it from this SyncPoint.\r\n if (serverCache == null && syncPoint != null) {\r\n serverCache = syncPoint.getCompleteServerCache(Path.Empty);\r\n }\r\n var events = [];\r\n syncPointTree.children.inorderTraversal(function (childName, childTree) {\r\n var childServerCache = serverCache\r\n ? serverCache.getImmediateChild(childName)\r\n : null;\r\n var childWritesCache = writesCache.child(childName);\r\n var childOperation = operation.operationForChild(childName);\r\n if (childOperation) {\r\n events = events.concat(_this.applyOperationDescendantsHelper_(childOperation, childTree, childServerCache, childWritesCache));\r\n }\r\n });\r\n if (syncPoint) {\r\n events = events.concat(syncPoint.applyOperation(operation, writesCache, serverCache));\r\n }\r\n return events;\r\n };\r\n /**\r\n * Static tracker for next query tag.\r\n */\r\n SyncTree.nextQueryTag_ = 1;\r\n return SyncTree;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Mutable object which basically just stores a reference to the \"latest\" immutable snapshot.\r\n *\r\n * @constructor\r\n */\r\nvar SnapshotHolder = /** @class */ (function () {\r\n function SnapshotHolder() {\r\n this.rootNode_ = ChildrenNode.EMPTY_NODE;\r\n }\r\n SnapshotHolder.prototype.getNode = function (path) {\r\n return this.rootNode_.getChild(path);\r\n };\r\n SnapshotHolder.prototype.updateSnapshot = function (path, newSnapshotNode) {\r\n this.rootNode_ = this.rootNode_.updateChild(path, newSnapshotNode);\r\n };\r\n return SnapshotHolder;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Tracks a collection of stats.\r\n *\r\n * @constructor\r\n */\r\nvar StatsCollection = /** @class */ (function () {\r\n function StatsCollection() {\r\n this.counters_ = {};\r\n }\r\n StatsCollection.prototype.incrementCounter = function (name, amount) {\r\n if (amount === void 0) { amount = 1; }\r\n if (!contains(this.counters_, name)) {\r\n this.counters_[name] = 0;\r\n }\r\n this.counters_[name] += amount;\r\n };\r\n StatsCollection.prototype.get = function () {\r\n return deepCopy(this.counters_);\r\n };\r\n return StatsCollection;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar StatsManager = /** @class */ (function () {\r\n function StatsManager() {\r\n }\r\n StatsManager.getCollection = function (repoInfo) {\r\n var hashString = repoInfo.toString();\r\n if (!this.collections_[hashString]) {\r\n this.collections_[hashString] = new StatsCollection();\r\n }\r\n return this.collections_[hashString];\r\n };\r\n StatsManager.getOrCreateReporter = function (repoInfo, creatorFunction) {\r\n var hashString = repoInfo.toString();\r\n if (!this.reporters_[hashString]) {\r\n this.reporters_[hashString] = creatorFunction();\r\n }\r\n return this.reporters_[hashString];\r\n };\r\n StatsManager.collections_ = {};\r\n StatsManager.reporters_ = {};\r\n return StatsManager;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns the delta from the previous call to get stats.\r\n *\r\n * @param collection_ The collection to \"listen\" to.\r\n * @constructor\r\n */\r\nvar StatsListener = /** @class */ (function () {\r\n function StatsListener(collection_) {\r\n this.collection_ = collection_;\r\n this.last_ = null;\r\n }\r\n StatsListener.prototype.get = function () {\r\n var newStats = this.collection_.get();\r\n var delta = __assign({}, newStats);\r\n if (this.last_) {\r\n each(this.last_, function (stat, value) {\r\n delta[stat] = delta[stat] - value;\r\n });\r\n }\r\n this.last_ = newStats;\r\n return delta;\r\n };\r\n return StatsListener;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// Assuming some apps may have a short amount of time on page, and a bulk of firebase operations probably\r\n// happen on page load, we try to report our first set of stats pretty quickly, but we wait at least 10\r\n// seconds to try to ensure the Firebase connection is established / settled.\r\nvar FIRST_STATS_MIN_TIME = 10 * 1000;\r\nvar FIRST_STATS_MAX_TIME = 30 * 1000;\r\n// We'll continue to report stats on average every 5 minutes.\r\nvar REPORT_STATS_INTERVAL = 5 * 60 * 1000;\r\n/**\r\n * @constructor\r\n */\r\nvar StatsReporter = /** @class */ (function () {\r\n /**\r\n * @param collection\r\n * @param server_\r\n */\r\n function StatsReporter(collection, server_) {\r\n this.server_ = server_;\r\n this.statsToReport_ = {};\r\n this.statsListener_ = new StatsListener(collection);\r\n var timeout = FIRST_STATS_MIN_TIME +\r\n (FIRST_STATS_MAX_TIME - FIRST_STATS_MIN_TIME) * Math.random();\r\n setTimeoutNonBlocking(this.reportStats_.bind(this), Math.floor(timeout));\r\n }\r\n StatsReporter.prototype.includeStat = function (stat) {\r\n this.statsToReport_[stat] = true;\r\n };\r\n StatsReporter.prototype.reportStats_ = function () {\r\n var _this = this;\r\n var stats = this.statsListener_.get();\r\n var reportedStats = {};\r\n var haveStatsToReport = false;\r\n each(stats, function (stat, value) {\r\n if (value > 0 && contains(_this.statsToReport_, stat)) {\r\n reportedStats[stat] = value;\r\n haveStatsToReport = true;\r\n }\r\n });\r\n if (haveStatsToReport) {\r\n this.server_.reportStats(reportedStats);\r\n }\r\n // queue our next run.\r\n setTimeoutNonBlocking(this.reportStats_.bind(this), Math.floor(Math.random() * 2 * REPORT_STATS_INTERVAL));\r\n };\r\n return StatsReporter;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * The event queue serves a few purposes:\r\n * 1. It ensures we maintain event order in the face of event callbacks doing operations that result in more\r\n * events being queued.\r\n * 2. raiseQueuedEvents() handles being called reentrantly nicely. That is, if in the course of raising events,\r\n * raiseQueuedEvents() is called again, the \"inner\" call will pick up raising events where the \"outer\" call\r\n * left off, ensuring that the events are still raised synchronously and in order.\r\n * 3. You can use raiseEventsAtPath and raiseEventsForChangedPath to ensure only relevant previously-queued\r\n * events are raised synchronously.\r\n *\r\n * NOTE: This can all go away if/when we move to async events.\r\n *\r\n * @constructor\r\n */\r\nvar EventQueue = /** @class */ (function () {\r\n function EventQueue() {\r\n /**\r\n * @private\r\n * @type {!Array.<EventList>}\r\n */\r\n this.eventLists_ = [];\r\n /**\r\n * Tracks recursion depth of raiseQueuedEvents_, for debugging purposes.\r\n * @private\r\n * @type {!number}\r\n */\r\n this.recursionDepth_ = 0;\r\n }\r\n /**\r\n * @param {!Array.<Event>} eventDataList The new events to queue.\r\n */\r\n EventQueue.prototype.queueEvents = function (eventDataList) {\r\n // We group events by path, storing them in a single EventList, to make it easier to skip over them quickly.\r\n var currList = null;\r\n for (var i = 0; i < eventDataList.length; i++) {\r\n var eventData = eventDataList[i];\r\n var eventPath = eventData.getPath();\r\n if (currList !== null && !eventPath.equals(currList.getPath())) {\r\n this.eventLists_.push(currList);\r\n currList = null;\r\n }\r\n if (currList === null) {\r\n currList = new EventList(eventPath);\r\n }\r\n currList.add(eventData);\r\n }\r\n if (currList) {\r\n this.eventLists_.push(currList);\r\n }\r\n };\r\n /**\r\n * Queues the specified events and synchronously raises all events (including previously queued ones)\r\n * for the specified path.\r\n *\r\n * It is assumed that the new events are all for the specified path.\r\n *\r\n * @param {!Path} path The path to raise events for.\r\n * @param {!Array.<Event>} eventDataList The new events to raise.\r\n */\r\n EventQueue.prototype.raiseEventsAtPath = function (path, eventDataList) {\r\n this.queueEvents(eventDataList);\r\n this.raiseQueuedEventsMatchingPredicate_(function (eventPath) {\r\n return eventPath.equals(path);\r\n });\r\n };\r\n /**\r\n * Queues the specified events and synchronously raises all events (including previously queued ones) for\r\n * locations related to the specified change path (i.e. all ancestors and descendants).\r\n *\r\n * It is assumed that the new events are all related (ancestor or descendant) to the specified path.\r\n *\r\n * @param {!Path} changedPath The path to raise events for.\r\n * @param {!Array.<!Event>} eventDataList The events to raise\r\n */\r\n EventQueue.prototype.raiseEventsForChangedPath = function (changedPath, eventDataList) {\r\n this.queueEvents(eventDataList);\r\n this.raiseQueuedEventsMatchingPredicate_(function (eventPath) {\r\n return eventPath.contains(changedPath) || changedPath.contains(eventPath);\r\n });\r\n };\r\n /**\r\n * @param {!function(!Path):boolean} predicate\r\n * @private\r\n */\r\n EventQueue.prototype.raiseQueuedEventsMatchingPredicate_ = function (predicate) {\r\n this.recursionDepth_++;\r\n var sentAll = true;\r\n for (var i = 0; i < this.eventLists_.length; i++) {\r\n var eventList = this.eventLists_[i];\r\n if (eventList) {\r\n var eventPath = eventList.getPath();\r\n if (predicate(eventPath)) {\r\n this.eventLists_[i].raise();\r\n this.eventLists_[i] = null;\r\n }\r\n else {\r\n sentAll = false;\r\n }\r\n }\r\n }\r\n if (sentAll) {\r\n this.eventLists_ = [];\r\n }\r\n this.recursionDepth_--;\r\n };\r\n return EventQueue;\r\n}());\r\n/**\r\n * @param {!Path} path\r\n * @constructor\r\n */\r\nvar EventList = /** @class */ (function () {\r\n function EventList(path_) {\r\n this.path_ = path_;\r\n /**\r\n * @type {!Array.<Event>}\r\n * @private\r\n */\r\n this.events_ = [];\r\n }\r\n /**\r\n * @param {!Event} eventData\r\n */\r\n EventList.prototype.add = function (eventData) {\r\n this.events_.push(eventData);\r\n };\r\n /**\r\n * Iterates through the list and raises each event\r\n */\r\n EventList.prototype.raise = function () {\r\n for (var i = 0; i < this.events_.length; i++) {\r\n var eventData = this.events_[i];\r\n if (eventData !== null) {\r\n this.events_[i] = null;\r\n var eventFn = eventData.getEventRunner();\r\n if (logger) {\r\n log('event: ' + eventData.toString());\r\n }\r\n exceptionGuard(eventFn);\r\n }\r\n }\r\n };\r\n /**\r\n * @return {!Path}\r\n */\r\n EventList.prototype.getPath = function () {\r\n return this.path_;\r\n };\r\n return EventList;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Base class to be used if you want to emit events. Call the constructor with\r\n * the set of allowed event names.\r\n */\r\nvar EventEmitter = /** @class */ (function () {\r\n /**\r\n * @param {!Array.<string>} allowedEvents_\r\n */\r\n function EventEmitter(allowedEvents_) {\r\n this.allowedEvents_ = allowedEvents_;\r\n this.listeners_ = {};\r\n assert(Array.isArray(allowedEvents_) && allowedEvents_.length > 0, 'Requires a non-empty array');\r\n }\r\n /**\r\n * To be called by derived classes to trigger events.\r\n * @param {!string} eventType\r\n * @param {...*} varArgs\r\n */\r\n EventEmitter.prototype.trigger = function (eventType) {\r\n var varArgs = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n varArgs[_i - 1] = arguments[_i];\r\n }\r\n if (Array.isArray(this.listeners_[eventType])) {\r\n // Clone the list, since callbacks could add/remove listeners.\r\n var listeners = __spread(this.listeners_[eventType]);\r\n for (var i = 0; i < listeners.length; i++) {\r\n listeners[i].callback.apply(listeners[i].context, varArgs);\r\n }\r\n }\r\n };\r\n EventEmitter.prototype.on = function (eventType, callback, context) {\r\n this.validateEventType_(eventType);\r\n this.listeners_[eventType] = this.listeners_[eventType] || [];\r\n this.listeners_[eventType].push({ callback: callback, context: context });\r\n var eventData = this.getInitialEvent(eventType);\r\n if (eventData) {\r\n callback.apply(context, eventData);\r\n }\r\n };\r\n EventEmitter.prototype.off = function (eventType, callback, context) {\r\n this.validateEventType_(eventType);\r\n var listeners = this.listeners_[eventType] || [];\r\n for (var i = 0; i < listeners.length; i++) {\r\n if (listeners[i].callback === callback &&\r\n (!context || context === listeners[i].context)) {\r\n listeners.splice(i, 1);\r\n return;\r\n }\r\n }\r\n };\r\n EventEmitter.prototype.validateEventType_ = function (eventType) {\r\n assert(this.allowedEvents_.find(function (et) {\r\n return et === eventType;\r\n }), 'Unknown event: ' + eventType);\r\n };\r\n return EventEmitter;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @extends {EventEmitter}\r\n */\r\nvar VisibilityMonitor = /** @class */ (function (_super) {\r\n __extends(VisibilityMonitor, _super);\r\n function VisibilityMonitor() {\r\n var _this = _super.call(this, ['visible']) || this;\r\n var hidden;\r\n var visibilityChange;\r\n if (typeof document !== 'undefined' &&\r\n typeof document.addEventListener !== 'undefined') {\r\n if (typeof document['hidden'] !== 'undefined') {\r\n // Opera 12.10 and Firefox 18 and later support\r\n visibilityChange = 'visibilitychange';\r\n hidden = 'hidden';\r\n }\r\n else if (typeof document['mozHidden'] !== 'undefined') {\r\n visibilityChange = 'mozvisibilitychange';\r\n hidden = 'mozHidden';\r\n }\r\n else if (typeof document['msHidden'] !== 'undefined') {\r\n visibilityChange = 'msvisibilitychange';\r\n hidden = 'msHidden';\r\n }\r\n else if (typeof document['webkitHidden'] !== 'undefined') {\r\n visibilityChange = 'webkitvisibilitychange';\r\n hidden = 'webkitHidden';\r\n }\r\n }\r\n // Initially, we always assume we are visible. This ensures that in browsers\r\n // without page visibility support or in cases where we are never visible\r\n // (e.g. chrome extension), we act as if we are visible, i.e. don't delay\r\n // reconnects\r\n _this.visible_ = true;\r\n if (visibilityChange) {\r\n document.addEventListener(visibilityChange, function () {\r\n var visible = !document[hidden];\r\n if (visible !== _this.visible_) {\r\n _this.visible_ = visible;\r\n _this.trigger('visible', visible);\r\n }\r\n }, false);\r\n }\r\n return _this;\r\n }\r\n VisibilityMonitor.getInstance = function () {\r\n return new VisibilityMonitor();\r\n };\r\n /**\r\n * @param {!string} eventType\r\n * @return {Array.<boolean>}\r\n */\r\n VisibilityMonitor.prototype.getInitialEvent = function (eventType) {\r\n assert(eventType === 'visible', 'Unknown event type: ' + eventType);\r\n return [this.visible_];\r\n };\r\n return VisibilityMonitor;\r\n}(EventEmitter));\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Monitors online state (as reported by window.online/offline events).\r\n *\r\n * The expectation is that this could have many false positives (thinks we are online\r\n * when we're not), but no false negatives. So we can safely use it to determine when\r\n * we definitely cannot reach the internet.\r\n *\r\n * @extends {EventEmitter}\r\n */\r\nvar OnlineMonitor = /** @class */ (function (_super) {\r\n __extends(OnlineMonitor, _super);\r\n function OnlineMonitor() {\r\n var _this = _super.call(this, ['online']) || this;\r\n _this.online_ = true;\r\n // We've had repeated complaints that Cordova apps can get stuck \"offline\", e.g.\r\n // https://forum.ionicframework.com/t/firebase-connection-is-lost-and-never-come-back/43810\r\n // It would seem that the 'online' event does not always fire consistently. So we disable it\r\n // for Cordova.\r\n if (typeof window !== 'undefined' &&\r\n typeof window.addEventListener !== 'undefined' &&\r\n !isMobileCordova()) {\r\n window.addEventListener('online', function () {\r\n if (!_this.online_) {\r\n _this.online_ = true;\r\n _this.trigger('online', true);\r\n }\r\n }, false);\r\n window.addEventListener('offline', function () {\r\n if (_this.online_) {\r\n _this.online_ = false;\r\n _this.trigger('online', false);\r\n }\r\n }, false);\r\n }\r\n return _this;\r\n }\r\n OnlineMonitor.getInstance = function () {\r\n return new OnlineMonitor();\r\n };\r\n /**\r\n * @param {!string} eventType\r\n * @return {Array.<boolean>}\r\n */\r\n OnlineMonitor.prototype.getInitialEvent = function (eventType) {\r\n assert(eventType === 'online', 'Unknown event type: ' + eventType);\r\n return [this.online_];\r\n };\r\n /**\r\n * @return {boolean}\r\n */\r\n OnlineMonitor.prototype.currentlyOnline = function () {\r\n return this.online_;\r\n };\r\n return OnlineMonitor;\r\n}(EventEmitter));\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * This class ensures the packets from the server arrive in order\r\n * This class takes data from the server and ensures it gets passed into the callbacks in order.\r\n * @constructor\r\n */\r\nvar PacketReceiver = /** @class */ (function () {\r\n /**\r\n * @param onMessage_\r\n */\r\n function PacketReceiver(onMessage_) {\r\n this.onMessage_ = onMessage_;\r\n this.pendingResponses = [];\r\n this.currentResponseNum = 0;\r\n this.closeAfterResponse = -1;\r\n this.onClose = null;\r\n }\r\n PacketReceiver.prototype.closeAfter = function (responseNum, callback) {\r\n this.closeAfterResponse = responseNum;\r\n this.onClose = callback;\r\n if (this.closeAfterResponse < this.currentResponseNum) {\r\n this.onClose();\r\n this.onClose = null;\r\n }\r\n };\r\n /**\r\n * Each message from the server comes with a response number, and an array of data. The responseNumber\r\n * allows us to ensure that we process them in the right order, since we can't be guaranteed that all\r\n * browsers will respond in the same order as the requests we sent\r\n * @param {number} requestNum\r\n * @param {Array} data\r\n */\r\n PacketReceiver.prototype.handleResponse = function (requestNum, data) {\r\n var _this = this;\r\n this.pendingResponses[requestNum] = data;\r\n var _loop_1 = function () {\r\n var toProcess = this_1.pendingResponses[this_1.currentResponseNum];\r\n delete this_1.pendingResponses[this_1.currentResponseNum];\r\n var _loop_2 = function (i) {\r\n if (toProcess[i]) {\r\n exceptionGuard(function () {\r\n _this.onMessage_(toProcess[i]);\r\n });\r\n }\r\n };\r\n for (var i = 0; i < toProcess.length; ++i) {\r\n _loop_2(i);\r\n }\r\n if (this_1.currentResponseNum === this_1.closeAfterResponse) {\r\n if (this_1.onClose) {\r\n this_1.onClose();\r\n this_1.onClose = null;\r\n }\r\n return \"break\";\r\n }\r\n this_1.currentResponseNum++;\r\n };\r\n var this_1 = this;\r\n while (this.pendingResponses[this.currentResponseNum]) {\r\n var state_1 = _loop_1();\r\n if (state_1 === \"break\")\r\n break;\r\n }\r\n };\r\n return PacketReceiver;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// URL query parameters associated with longpolling\r\nvar FIREBASE_LONGPOLL_START_PARAM = 'start';\r\nvar FIREBASE_LONGPOLL_CLOSE_COMMAND = 'close';\r\nvar FIREBASE_LONGPOLL_COMMAND_CB_NAME = 'pLPCommand';\r\nvar FIREBASE_LONGPOLL_DATA_CB_NAME = 'pRTLPCB';\r\nvar FIREBASE_LONGPOLL_ID_PARAM = 'id';\r\nvar FIREBASE_LONGPOLL_PW_PARAM = 'pw';\r\nvar FIREBASE_LONGPOLL_SERIAL_PARAM = 'ser';\r\nvar FIREBASE_LONGPOLL_CALLBACK_ID_PARAM = 'cb';\r\nvar FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM = 'seg';\r\nvar FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET = 'ts';\r\nvar FIREBASE_LONGPOLL_DATA_PARAM = 'd';\r\nvar FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM = 'dframe';\r\n//Data size constants.\r\n//TODO: Perf: the maximum length actually differs from browser to browser.\r\n// We should check what browser we're on and set accordingly.\r\nvar MAX_URL_DATA_SIZE = 1870;\r\nvar SEG_HEADER_SIZE = 30; //ie: &seg=8299234&ts=982389123&d=\r\nvar MAX_PAYLOAD_SIZE = MAX_URL_DATA_SIZE - SEG_HEADER_SIZE;\r\n/**\r\n * Keepalive period\r\n * send a fresh request at minimum every 25 seconds. Opera has a maximum request\r\n * length of 30 seconds that we can't exceed.\r\n * @const\r\n * @type {number}\r\n */\r\nvar KEEPALIVE_REQUEST_INTERVAL = 25000;\r\n/**\r\n * How long to wait before aborting a long-polling connection attempt.\r\n * @const\r\n * @type {number}\r\n */\r\nvar LP_CONNECT_TIMEOUT = 30000;\r\n/**\r\n * This class manages a single long-polling connection.\r\n *\r\n * @constructor\r\n * @implements {Transport}\r\n */\r\nvar BrowserPollConnection = /** @class */ (function () {\r\n /**\r\n * @param connId An identifier for this connection, used for logging\r\n * @param repoInfo The info for the endpoint to send data to.\r\n * @param applicationId The Firebase App ID for this project.\r\n * @param transportSessionId Optional transportSessionid if we are reconnecting for an existing\r\n * transport session\r\n * @param lastSessionId Optional lastSessionId if the PersistentConnection has already created a\r\n * connection previously\r\n */\r\n function BrowserPollConnection(connId, repoInfo, applicationId, transportSessionId, lastSessionId) {\r\n this.connId = connId;\r\n this.repoInfo = repoInfo;\r\n this.applicationId = applicationId;\r\n this.transportSessionId = transportSessionId;\r\n this.lastSessionId = lastSessionId;\r\n this.bytesSent = 0;\r\n this.bytesReceived = 0;\r\n this.everConnected_ = false;\r\n this.log_ = logWrapper(connId);\r\n this.stats_ = StatsManager.getCollection(repoInfo);\r\n this.urlFn = function (params) {\r\n return repoInfo.connectionURL(LONG_POLLING, params);\r\n };\r\n }\r\n /**\r\n *\r\n * @param {function(Object)} onMessage Callback when messages arrive\r\n * @param {function()} onDisconnect Callback with connection lost.\r\n */\r\n BrowserPollConnection.prototype.open = function (onMessage, onDisconnect) {\r\n var _this = this;\r\n this.curSegmentNum = 0;\r\n this.onDisconnect_ = onDisconnect;\r\n this.myPacketOrderer = new PacketReceiver(onMessage);\r\n this.isClosed_ = false;\r\n this.connectTimeoutTimer_ = setTimeout(function () {\r\n _this.log_('Timed out trying to connect.');\r\n // Make sure we clear the host cache\r\n _this.onClosed_();\r\n _this.connectTimeoutTimer_ = null;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n }, Math.floor(LP_CONNECT_TIMEOUT));\r\n // Ensure we delay the creation of the iframe until the DOM is loaded.\r\n executeWhenDOMReady(function () {\r\n if (_this.isClosed_) {\r\n return;\r\n }\r\n //Set up a callback that gets triggered once a connection is set up.\r\n _this.scriptTagHolder = new FirebaseIFrameScriptHolder(function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var _a = __read(args, 5), command = _a[0], arg1 = _a[1], arg2 = _a[2], arg3 = _a[3], arg4 = _a[4];\r\n _this.incrementIncomingBytes_(args);\r\n if (!_this.scriptTagHolder) {\r\n return; // we closed the connection.\r\n }\r\n if (_this.connectTimeoutTimer_) {\r\n clearTimeout(_this.connectTimeoutTimer_);\r\n _this.connectTimeoutTimer_ = null;\r\n }\r\n _this.everConnected_ = true;\r\n if (command === FIREBASE_LONGPOLL_START_PARAM) {\r\n _this.id = arg1;\r\n _this.password = arg2;\r\n }\r\n else if (command === FIREBASE_LONGPOLL_CLOSE_COMMAND) {\r\n // Don't clear the host cache. We got a response from the server, so we know it's reachable\r\n if (arg1) {\r\n // We aren't expecting any more data (other than what the server's already in the process of sending us\r\n // through our already open polls), so don't send any more.\r\n _this.scriptTagHolder.sendNewPolls = false;\r\n // arg1 in this case is the last response number sent by the server. We should try to receive\r\n // all of the responses up to this one before closing\r\n _this.myPacketOrderer.closeAfter(arg1, function () {\r\n _this.onClosed_();\r\n });\r\n }\r\n else {\r\n _this.onClosed_();\r\n }\r\n }\r\n else {\r\n throw new Error('Unrecognized command received: ' + command);\r\n }\r\n }, function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var _a = __read(args, 2), pN = _a[0], data = _a[1];\r\n _this.incrementIncomingBytes_(args);\r\n _this.myPacketOrderer.handleResponse(pN, data);\r\n }, function () {\r\n _this.onClosed_();\r\n }, _this.urlFn);\r\n //Send the initial request to connect. The serial number is simply to keep the browser from pulling previous results\r\n //from cache.\r\n var urlParams = {};\r\n urlParams[FIREBASE_LONGPOLL_START_PARAM] = 't';\r\n urlParams[FIREBASE_LONGPOLL_SERIAL_PARAM] = Math.floor(Math.random() * 100000000);\r\n if (_this.scriptTagHolder.uniqueCallbackIdentifier) {\r\n urlParams[FIREBASE_LONGPOLL_CALLBACK_ID_PARAM] = _this.scriptTagHolder.uniqueCallbackIdentifier;\r\n }\r\n urlParams[VERSION_PARAM] = PROTOCOL_VERSION;\r\n if (_this.transportSessionId) {\r\n urlParams[TRANSPORT_SESSION_PARAM] = _this.transportSessionId;\r\n }\r\n if (_this.lastSessionId) {\r\n urlParams[LAST_SESSION_PARAM] = _this.lastSessionId;\r\n }\r\n if (_this.applicationId) {\r\n urlParams[APPLICATION_ID_PARAM] = _this.applicationId;\r\n }\r\n if (typeof location !== 'undefined' &&\r\n location.href &&\r\n location.href.indexOf(FORGE_DOMAIN) !== -1) {\r\n urlParams[REFERER_PARAM] = FORGE_REF;\r\n }\r\n var connectURL = _this.urlFn(urlParams);\r\n _this.log_('Connecting via long-poll to ' + connectURL);\r\n _this.scriptTagHolder.addTag(connectURL, function () {\r\n /* do nothing */\r\n });\r\n });\r\n };\r\n /**\r\n * Call this when a handshake has completed successfully and we want to consider the connection established\r\n */\r\n BrowserPollConnection.prototype.start = function () {\r\n this.scriptTagHolder.startLongPoll(this.id, this.password);\r\n this.addDisconnectPingFrame(this.id, this.password);\r\n };\r\n /**\r\n * Forces long polling to be considered as a potential transport\r\n */\r\n BrowserPollConnection.forceAllow = function () {\r\n BrowserPollConnection.forceAllow_ = true;\r\n };\r\n /**\r\n * Forces longpolling to not be considered as a potential transport\r\n */\r\n BrowserPollConnection.forceDisallow = function () {\r\n BrowserPollConnection.forceDisallow_ = true;\r\n };\r\n // Static method, use string literal so it can be accessed in a generic way\r\n BrowserPollConnection.isAvailable = function () {\r\n if (isNodeSdk()) {\r\n return false;\r\n }\r\n else if (BrowserPollConnection.forceAllow_) {\r\n return true;\r\n }\r\n else {\r\n // NOTE: In React-Native there's normally no 'document', but if you debug a React-Native app in\r\n // the Chrome debugger, 'document' is defined, but document.createElement is null (2015/06/08).\r\n return (!BrowserPollConnection.forceDisallow_ &&\r\n typeof document !== 'undefined' &&\r\n document.createElement != null &&\r\n !isChromeExtensionContentScript() &&\r\n !isWindowsStoreApp());\r\n }\r\n };\r\n /**\r\n * No-op for polling\r\n */\r\n BrowserPollConnection.prototype.markConnectionHealthy = function () { };\r\n /**\r\n * Stops polling and cleans up the iframe\r\n * @private\r\n */\r\n BrowserPollConnection.prototype.shutdown_ = function () {\r\n this.isClosed_ = true;\r\n if (this.scriptTagHolder) {\r\n this.scriptTagHolder.close();\r\n this.scriptTagHolder = null;\r\n }\r\n //remove the disconnect frame, which will trigger an XHR call to the server to tell it we're leaving.\r\n if (this.myDisconnFrame) {\r\n document.body.removeChild(this.myDisconnFrame);\r\n this.myDisconnFrame = null;\r\n }\r\n if (this.connectTimeoutTimer_) {\r\n clearTimeout(this.connectTimeoutTimer_);\r\n this.connectTimeoutTimer_ = null;\r\n }\r\n };\r\n /**\r\n * Triggered when this transport is closed\r\n * @private\r\n */\r\n BrowserPollConnection.prototype.onClosed_ = function () {\r\n if (!this.isClosed_) {\r\n this.log_('Longpoll is closing itself');\r\n this.shutdown_();\r\n if (this.onDisconnect_) {\r\n this.onDisconnect_(this.everConnected_);\r\n this.onDisconnect_ = null;\r\n }\r\n }\r\n };\r\n /**\r\n * External-facing close handler. RealTime has requested we shut down. Kill our connection and tell the server\r\n * that we've left.\r\n */\r\n BrowserPollConnection.prototype.close = function () {\r\n if (!this.isClosed_) {\r\n this.log_('Longpoll is being closed.');\r\n this.shutdown_();\r\n }\r\n };\r\n /**\r\n * Send the JSON object down to the server. It will need to be stringified, base64 encoded, and then\r\n * broken into chunks (since URLs have a small maximum length).\r\n * @param {!Object} data The JSON data to transmit.\r\n */\r\n BrowserPollConnection.prototype.send = function (data) {\r\n var dataStr = stringify(data);\r\n this.bytesSent += dataStr.length;\r\n this.stats_.incrementCounter('bytes_sent', dataStr.length);\r\n //first, lets get the base64-encoded data\r\n var base64data = base64Encode(dataStr);\r\n //We can only fit a certain amount in each URL, so we need to split this request\r\n //up into multiple pieces if it doesn't fit in one request.\r\n var dataSegs = splitStringBySize(base64data, MAX_PAYLOAD_SIZE);\r\n //Enqueue each segment for transmission. We assign each chunk a sequential ID and a total number\r\n //of segments so that we can reassemble the packet on the server.\r\n for (var i = 0; i < dataSegs.length; i++) {\r\n this.scriptTagHolder.enqueueSegment(this.curSegmentNum, dataSegs.length, dataSegs[i]);\r\n this.curSegmentNum++;\r\n }\r\n };\r\n /**\r\n * This is how we notify the server that we're leaving.\r\n * We aren't able to send requests with DHTML on a window close event, but we can\r\n * trigger XHR requests in some browsers (everything but Opera basically).\r\n * @param {!string} id\r\n * @param {!string} pw\r\n */\r\n BrowserPollConnection.prototype.addDisconnectPingFrame = function (id, pw) {\r\n if (isNodeSdk()) {\r\n return;\r\n }\r\n this.myDisconnFrame = document.createElement('iframe');\r\n var urlParams = {};\r\n urlParams[FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM] = 't';\r\n urlParams[FIREBASE_LONGPOLL_ID_PARAM] = id;\r\n urlParams[FIREBASE_LONGPOLL_PW_PARAM] = pw;\r\n this.myDisconnFrame.src = this.urlFn(urlParams);\r\n this.myDisconnFrame.style.display = 'none';\r\n document.body.appendChild(this.myDisconnFrame);\r\n };\r\n /**\r\n * Used to track the bytes received by this client\r\n * @param {*} args\r\n * @private\r\n */\r\n BrowserPollConnection.prototype.incrementIncomingBytes_ = function (args) {\r\n // TODO: This is an annoying perf hit just to track the number of incoming bytes. Maybe it should be opt-in.\r\n var bytesReceived = stringify(args).length;\r\n this.bytesReceived += bytesReceived;\r\n this.stats_.incrementCounter('bytes_received', bytesReceived);\r\n };\r\n return BrowserPollConnection;\r\n}());\r\n/*********************************************************************************************\r\n * A wrapper around an iframe that is used as a long-polling script holder.\r\n * @constructor\r\n *********************************************************************************************/\r\nvar FirebaseIFrameScriptHolder = /** @class */ (function () {\r\n /**\r\n * @param commandCB - The callback to be called when control commands are recevied from the server.\r\n * @param onMessageCB - The callback to be triggered when responses arrive from the server.\r\n * @param onDisconnect - The callback to be triggered when this tag holder is closed\r\n * @param urlFn - A function that provides the URL of the endpoint to send data to.\r\n */\r\n function FirebaseIFrameScriptHolder(commandCB, onMessageCB, onDisconnect, urlFn) {\r\n this.onDisconnect = onDisconnect;\r\n this.urlFn = urlFn;\r\n //We maintain a count of all of the outstanding requests, because if we have too many active at once it can cause\r\n //problems in some browsers.\r\n this.outstandingRequests = new Set();\r\n //A queue of the pending segments waiting for transmission to the server.\r\n this.pendingSegs = [];\r\n //A serial number. We use this for two things:\r\n // 1) A way to ensure the browser doesn't cache responses to polls\r\n // 2) A way to make the server aware when long-polls arrive in a different order than we started them. The\r\n // server needs to release both polls in this case or it will cause problems in Opera since Opera can only execute\r\n // JSONP code in the order it was added to the iframe.\r\n this.currentSerial = Math.floor(Math.random() * 100000000);\r\n // This gets set to false when we're \"closing down\" the connection (e.g. we're switching transports but there's still\r\n // incoming data from the server that we're waiting for).\r\n this.sendNewPolls = true;\r\n if (!isNodeSdk()) {\r\n //Each script holder registers a couple of uniquely named callbacks with the window. These are called from the\r\n //iframes where we put the long-polling script tags. We have two callbacks:\r\n // 1) Command Callback - Triggered for control issues, like starting a connection.\r\n // 2) Message Callback - Triggered when new data arrives.\r\n this.uniqueCallbackIdentifier = LUIDGenerator();\r\n window[FIREBASE_LONGPOLL_COMMAND_CB_NAME + this.uniqueCallbackIdentifier] = commandCB;\r\n window[FIREBASE_LONGPOLL_DATA_CB_NAME + this.uniqueCallbackIdentifier] = onMessageCB;\r\n //Create an iframe for us to add script tags to.\r\n this.myIFrame = FirebaseIFrameScriptHolder.createIFrame_();\r\n // Set the iframe's contents.\r\n var script = '';\r\n // if we set a javascript url, it's IE and we need to set the document domain. The javascript url is sufficient\r\n // for ie9, but ie8 needs to do it again in the document itself.\r\n if (this.myIFrame.src &&\r\n this.myIFrame.src.substr(0, 'javascript:'.length) === 'javascript:') {\r\n var currentDomain = document.domain;\r\n script = '<script>document.domain=\"' + currentDomain + '\";</script>';\r\n }\r\n var iframeContents = '<html><body>' + script + '</body></html>';\r\n try {\r\n this.myIFrame.doc.open();\r\n this.myIFrame.doc.write(iframeContents);\r\n this.myIFrame.doc.close();\r\n }\r\n catch (e) {\r\n log('frame writing exception');\r\n if (e.stack) {\r\n log(e.stack);\r\n }\r\n log(e);\r\n }\r\n }\r\n else {\r\n this.commandCB = commandCB;\r\n this.onMessageCB = onMessageCB;\r\n }\r\n }\r\n /**\r\n * Each browser has its own funny way to handle iframes. Here we mush them all together into one object that I can\r\n * actually use.\r\n * @private\r\n * @return {Element}\r\n */\r\n FirebaseIFrameScriptHolder.createIFrame_ = function () {\r\n var iframe = document.createElement('iframe');\r\n iframe.style.display = 'none';\r\n // This is necessary in order to initialize the document inside the iframe\r\n if (document.body) {\r\n document.body.appendChild(iframe);\r\n try {\r\n // If document.domain has been modified in IE, this will throw an error, and we need to set the\r\n // domain of the iframe's document manually. We can do this via a javascript: url as the src attribute\r\n // Also note that we must do this *after* the iframe has been appended to the page. Otherwise it doesn't work.\r\n var a = iframe.contentWindow.document;\r\n if (!a) {\r\n // Apologies for the log-spam, I need to do something to keep closure from optimizing out the assignment above.\r\n log('No IE domain setting required');\r\n }\r\n }\r\n catch (e) {\r\n var domain = document.domain;\r\n iframe.src =\r\n \"javascript:void((function(){document.open();document.domain='\" +\r\n domain +\r\n \"';document.close();})())\";\r\n }\r\n }\r\n else {\r\n // LongPollConnection attempts to delay initialization until the document is ready, so hopefully this\r\n // never gets hit.\r\n throw 'Document body has not initialized. Wait to initialize Firebase until after the document is ready.';\r\n }\r\n // Get the document of the iframe in a browser-specific way.\r\n if (iframe.contentDocument) {\r\n iframe.doc = iframe.contentDocument; // Firefox, Opera, Safari\r\n }\r\n else if (iframe.contentWindow) {\r\n iframe.doc = iframe.contentWindow.document; // Internet Explorer\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n }\r\n else if (iframe.document) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n iframe.doc = iframe.document; //others?\r\n }\r\n return iframe;\r\n };\r\n /**\r\n * Cancel all outstanding queries and remove the frame.\r\n */\r\n FirebaseIFrameScriptHolder.prototype.close = function () {\r\n var _this = this;\r\n //Mark this iframe as dead, so no new requests are sent.\r\n this.alive = false;\r\n if (this.myIFrame) {\r\n //We have to actually remove all of the html inside this iframe before removing it from the\r\n //window, or IE will continue loading and executing the script tags we've already added, which\r\n //can lead to some errors being thrown. Setting innerHTML seems to be the easiest way to do this.\r\n this.myIFrame.doc.body.innerHTML = '';\r\n setTimeout(function () {\r\n if (_this.myIFrame !== null) {\r\n document.body.removeChild(_this.myIFrame);\r\n _this.myIFrame = null;\r\n }\r\n }, Math.floor(0));\r\n }\r\n // Protect from being called recursively.\r\n var onDisconnect = this.onDisconnect;\r\n if (onDisconnect) {\r\n this.onDisconnect = null;\r\n onDisconnect();\r\n }\r\n };\r\n /**\r\n * Actually start the long-polling session by adding the first script tag(s) to the iframe.\r\n * @param {!string} id - The ID of this connection\r\n * @param {!string} pw - The password for this connection\r\n */\r\n FirebaseIFrameScriptHolder.prototype.startLongPoll = function (id, pw) {\r\n this.myID = id;\r\n this.myPW = pw;\r\n this.alive = true;\r\n //send the initial request. If there are requests queued, make sure that we transmit as many as we are currently able to.\r\n while (this.newRequest_()) { }\r\n };\r\n /**\r\n * This is called any time someone might want a script tag to be added. It adds a script tag when there aren't\r\n * too many outstanding requests and we are still alive.\r\n *\r\n * If there are outstanding packet segments to send, it sends one. If there aren't, it sends a long-poll anyways if\r\n * needed.\r\n */\r\n FirebaseIFrameScriptHolder.prototype.newRequest_ = function () {\r\n // We keep one outstanding request open all the time to receive data, but if we need to send data\r\n // (pendingSegs.length > 0) then we create a new request to send the data. The server will automatically\r\n // close the old request.\r\n if (this.alive &&\r\n this.sendNewPolls &&\r\n this.outstandingRequests.size < (this.pendingSegs.length > 0 ? 2 : 1)) {\r\n //construct our url\r\n this.currentSerial++;\r\n var urlParams = {};\r\n urlParams[FIREBASE_LONGPOLL_ID_PARAM] = this.myID;\r\n urlParams[FIREBASE_LONGPOLL_PW_PARAM] = this.myPW;\r\n urlParams[FIREBASE_LONGPOLL_SERIAL_PARAM] = this.currentSerial;\r\n var theURL = this.urlFn(urlParams);\r\n //Now add as much data as we can.\r\n var curDataString = '';\r\n var i = 0;\r\n while (this.pendingSegs.length > 0) {\r\n //first, lets see if the next segment will fit.\r\n var nextSeg = this.pendingSegs[0];\r\n if (nextSeg.d.length +\r\n SEG_HEADER_SIZE +\r\n curDataString.length <=\r\n MAX_URL_DATA_SIZE) {\r\n //great, the segment will fit. Lets append it.\r\n var theSeg = this.pendingSegs.shift();\r\n curDataString =\r\n curDataString +\r\n '&' +\r\n FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM +\r\n i +\r\n '=' +\r\n theSeg.seg +\r\n '&' +\r\n FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET +\r\n i +\r\n '=' +\r\n theSeg.ts +\r\n '&' +\r\n FIREBASE_LONGPOLL_DATA_PARAM +\r\n i +\r\n '=' +\r\n theSeg.d;\r\n i++;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n theURL = theURL + curDataString;\r\n this.addLongPollTag_(theURL, this.currentSerial);\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n /**\r\n * Queue a packet for transmission to the server.\r\n * @param segnum - A sequential id for this packet segment used for reassembly\r\n * @param totalsegs - The total number of segments in this packet\r\n * @param data - The data for this segment.\r\n */\r\n FirebaseIFrameScriptHolder.prototype.enqueueSegment = function (segnum, totalsegs, data) {\r\n //add this to the queue of segments to send.\r\n this.pendingSegs.push({ seg: segnum, ts: totalsegs, d: data });\r\n //send the data immediately if there isn't already data being transmitted, unless\r\n //startLongPoll hasn't been called yet.\r\n if (this.alive) {\r\n this.newRequest_();\r\n }\r\n };\r\n /**\r\n * Add a script tag for a regular long-poll request.\r\n * @param {!string} url - The URL of the script tag.\r\n * @param {!number} serial - The serial number of the request.\r\n * @private\r\n */\r\n FirebaseIFrameScriptHolder.prototype.addLongPollTag_ = function (url, serial) {\r\n var _this = this;\r\n //remember that we sent this request.\r\n this.outstandingRequests.add(serial);\r\n var doNewRequest = function () {\r\n _this.outstandingRequests.delete(serial);\r\n _this.newRequest_();\r\n };\r\n // If this request doesn't return on its own accord (by the server sending us some data), we'll\r\n // create a new one after the KEEPALIVE interval to make sure we always keep a fresh request open.\r\n var keepaliveTimeout = setTimeout(doNewRequest, Math.floor(KEEPALIVE_REQUEST_INTERVAL));\r\n var readyStateCB = function () {\r\n // Request completed. Cancel the keepalive.\r\n clearTimeout(keepaliveTimeout);\r\n // Trigger a new request so we can continue receiving data.\r\n doNewRequest();\r\n };\r\n this.addTag(url, readyStateCB);\r\n };\r\n /**\r\n * Add an arbitrary script tag to the iframe.\r\n * @param {!string} url - The URL for the script tag source.\r\n * @param {!function()} loadCB - A callback to be triggered once the script has loaded.\r\n */\r\n FirebaseIFrameScriptHolder.prototype.addTag = function (url, loadCB) {\r\n var _this = this;\r\n if (isNodeSdk()) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n this.doNodeLongPoll(url, loadCB);\r\n }\r\n else {\r\n setTimeout(function () {\r\n try {\r\n // if we're already closed, don't add this poll\r\n if (!_this.sendNewPolls) {\r\n return;\r\n }\r\n var newScript_1 = _this.myIFrame.doc.createElement('script');\r\n newScript_1.type = 'text/javascript';\r\n newScript_1.async = true;\r\n newScript_1.src = url;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n newScript_1.onload = newScript_1.onreadystatechange = function () {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n var rstate = newScript_1.readyState;\r\n if (!rstate || rstate === 'loaded' || rstate === 'complete') {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n newScript_1.onload = newScript_1.onreadystatechange = null;\r\n if (newScript_1.parentNode) {\r\n newScript_1.parentNode.removeChild(newScript_1);\r\n }\r\n loadCB();\r\n }\r\n };\r\n newScript_1.onerror = function () {\r\n log('Long-poll script failed to load: ' + url);\r\n _this.sendNewPolls = false;\r\n _this.close();\r\n };\r\n _this.myIFrame.doc.body.appendChild(newScript_1);\r\n }\r\n catch (e) {\r\n // TODO: we should make this error visible somehow\r\n }\r\n }, Math.floor(1));\r\n }\r\n };\r\n return FirebaseIFrameScriptHolder;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** The semver (www.semver.org) version of the SDK. */\r\nvar SDK_VERSION = '';\r\n// SDK_VERSION should be set before any database instance is created\r\nfunction setSDKVersion(version) {\r\n SDK_VERSION = version;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar WEBSOCKET_MAX_FRAME_SIZE = 16384;\r\nvar WEBSOCKET_KEEPALIVE_INTERVAL = 45000;\r\nvar WebSocketImpl = null;\r\nif (typeof MozWebSocket !== 'undefined') {\r\n WebSocketImpl = MozWebSocket;\r\n}\r\nelse if (typeof WebSocket !== 'undefined') {\r\n WebSocketImpl = WebSocket;\r\n}\r\n/**\r\n * Create a new websocket connection with the given callbacks.\r\n * @constructor\r\n * @implements {Transport}\r\n */\r\nvar WebSocketConnection = /** @class */ (function () {\r\n /**\r\n * @param connId identifier for this transport\r\n * @param repoInfo The info for the websocket endpoint.\r\n * @param applicationId The Firebase App ID for this project.\r\n * @param transportSessionId Optional transportSessionId if this is connecting to an existing transport\r\n * session\r\n * @param lastSessionId Optional lastSessionId if there was a previous connection\r\n */\r\n function WebSocketConnection(connId, repoInfo, applicationId, transportSessionId, lastSessionId) {\r\n this.connId = connId;\r\n this.applicationId = applicationId;\r\n this.keepaliveTimer = null;\r\n this.frames = null;\r\n this.totalFrames = 0;\r\n this.bytesSent = 0;\r\n this.bytesReceived = 0;\r\n this.log_ = logWrapper(this.connId);\r\n this.stats_ = StatsManager.getCollection(repoInfo);\r\n this.connURL = WebSocketConnection.connectionURL_(repoInfo, transportSessionId, lastSessionId);\r\n this.nodeAdmin = repoInfo.nodeAdmin;\r\n }\r\n /**\r\n * @param {RepoInfo} repoInfo The info for the websocket endpoint.\r\n * @param {string=} transportSessionId Optional transportSessionId if this is connecting to an existing transport\r\n * session\r\n * @param {string=} lastSessionId Optional lastSessionId if there was a previous connection\r\n * @return {string} connection url\r\n * @private\r\n */\r\n WebSocketConnection.connectionURL_ = function (repoInfo, transportSessionId, lastSessionId) {\r\n var urlParams = {};\r\n urlParams[VERSION_PARAM] = PROTOCOL_VERSION;\r\n if (!isNodeSdk() &&\r\n typeof location !== 'undefined' &&\r\n location.href &&\r\n location.href.indexOf(FORGE_DOMAIN) !== -1) {\r\n urlParams[REFERER_PARAM] = FORGE_REF;\r\n }\r\n if (transportSessionId) {\r\n urlParams[TRANSPORT_SESSION_PARAM] = transportSessionId;\r\n }\r\n if (lastSessionId) {\r\n urlParams[LAST_SESSION_PARAM] = lastSessionId;\r\n }\r\n return repoInfo.connectionURL(WEBSOCKET, urlParams);\r\n };\r\n /**\r\n *\r\n * @param onMessage Callback when messages arrive\r\n * @param onDisconnect Callback with connection lost.\r\n */\r\n WebSocketConnection.prototype.open = function (onMessage, onDisconnect) {\r\n var _this = this;\r\n this.onDisconnect = onDisconnect;\r\n this.onMessage = onMessage;\r\n this.log_('Websocket connecting to ' + this.connURL);\r\n this.everConnected_ = false;\r\n // Assume failure until proven otherwise.\r\n PersistentStorage.set('previous_websocket_failure', true);\r\n try {\r\n if (isNodeSdk()) {\r\n var device = this.nodeAdmin ? 'AdminNode' : 'Node';\r\n // UA Format: Firebase/<wire_protocol>/<sdk_version>/<platform>/<device>\r\n var options = {\r\n headers: {\r\n 'User-Agent': \"Firebase/\" + PROTOCOL_VERSION + \"/\" + SDK_VERSION + \"/\" + process.platform + \"/\" + device,\r\n 'X-Firebase-GMPID': this.applicationId || ''\r\n }\r\n };\r\n // Plumb appropriate http_proxy environment variable into faye-websocket if it exists.\r\n var env = process['env'];\r\n var proxy = this.connURL.indexOf('wss://') === 0\r\n ? env['HTTPS_PROXY'] || env['https_proxy']\r\n : env['HTTP_PROXY'] || env['http_proxy'];\r\n if (proxy) {\r\n options['proxy'] = { origin: proxy };\r\n }\r\n this.mySock = new WebSocketImpl(this.connURL, [], options);\r\n }\r\n else {\r\n var options = {\r\n headers: {\r\n 'X-Firebase-GMPID': this.applicationId || ''\r\n }\r\n };\r\n this.mySock = new WebSocketImpl(this.connURL, [], options);\r\n }\r\n }\r\n catch (e) {\r\n this.log_('Error instantiating WebSocket.');\r\n var error = e.message || e.data;\r\n if (error) {\r\n this.log_(error);\r\n }\r\n this.onClosed_();\r\n return;\r\n }\r\n this.mySock.onopen = function () {\r\n _this.log_('Websocket connected.');\r\n _this.everConnected_ = true;\r\n };\r\n this.mySock.onclose = function () {\r\n _this.log_('Websocket connection was disconnected.');\r\n _this.mySock = null;\r\n _this.onClosed_();\r\n };\r\n this.mySock.onmessage = function (m) {\r\n _this.handleIncomingFrame(m);\r\n };\r\n this.mySock.onerror = function (e) {\r\n _this.log_('WebSocket error. Closing connection.');\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n var error = e.message || e.data;\r\n if (error) {\r\n _this.log_(error);\r\n }\r\n _this.onClosed_();\r\n };\r\n };\r\n /**\r\n * No-op for websockets, we don't need to do anything once the connection is confirmed as open\r\n */\r\n WebSocketConnection.prototype.start = function () { };\r\n WebSocketConnection.forceDisallow = function () {\r\n WebSocketConnection.forceDisallow_ = true;\r\n };\r\n WebSocketConnection.isAvailable = function () {\r\n var isOldAndroid = false;\r\n if (typeof navigator !== 'undefined' && navigator.userAgent) {\r\n var oldAndroidRegex = /Android ([0-9]{0,}\\.[0-9]{0,})/;\r\n var oldAndroidMatch = navigator.userAgent.match(oldAndroidRegex);\r\n if (oldAndroidMatch && oldAndroidMatch.length > 1) {\r\n if (parseFloat(oldAndroidMatch[1]) < 4.4) {\r\n isOldAndroid = true;\r\n }\r\n }\r\n }\r\n return (!isOldAndroid &&\r\n WebSocketImpl !== null &&\r\n !WebSocketConnection.forceDisallow_);\r\n };\r\n /**\r\n * Returns true if we previously failed to connect with this transport.\r\n * @return {boolean}\r\n */\r\n WebSocketConnection.previouslyFailed = function () {\r\n // If our persistent storage is actually only in-memory storage,\r\n // we default to assuming that it previously failed to be safe.\r\n return (PersistentStorage.isInMemoryStorage ||\r\n PersistentStorage.get('previous_websocket_failure') === true);\r\n };\r\n WebSocketConnection.prototype.markConnectionHealthy = function () {\r\n PersistentStorage.remove('previous_websocket_failure');\r\n };\r\n WebSocketConnection.prototype.appendFrame_ = function (data) {\r\n this.frames.push(data);\r\n if (this.frames.length === this.totalFrames) {\r\n var fullMess = this.frames.join('');\r\n this.frames = null;\r\n var jsonMess = jsonEval(fullMess);\r\n //handle the message\r\n this.onMessage(jsonMess);\r\n }\r\n };\r\n /**\r\n * @param {number} frameCount The number of frames we are expecting from the server\r\n * @private\r\n */\r\n WebSocketConnection.prototype.handleNewFrameCount_ = function (frameCount) {\r\n this.totalFrames = frameCount;\r\n this.frames = [];\r\n };\r\n /**\r\n * Attempts to parse a frame count out of some text. If it can't, assumes a value of 1\r\n * @param {!String} data\r\n * @return {?String} Any remaining data to be process, or null if there is none\r\n * @private\r\n */\r\n WebSocketConnection.prototype.extractFrameCount_ = function (data) {\r\n assert(this.frames === null, 'We already have a frame buffer');\r\n // TODO: The server is only supposed to send up to 9999 frames (i.e. length <= 4), but that isn't being enforced\r\n // currently. So allowing larger frame counts (length <= 6). See https://app.asana.com/0/search/8688598998380/8237608042508\r\n if (data.length <= 6) {\r\n var frameCount = Number(data);\r\n if (!isNaN(frameCount)) {\r\n this.handleNewFrameCount_(frameCount);\r\n return null;\r\n }\r\n }\r\n this.handleNewFrameCount_(1);\r\n return data;\r\n };\r\n /**\r\n * Process a websocket frame that has arrived from the server.\r\n * @param mess The frame data\r\n */\r\n WebSocketConnection.prototype.handleIncomingFrame = function (mess) {\r\n if (this.mySock === null) {\r\n return; // Chrome apparently delivers incoming packets even after we .close() the connection sometimes.\r\n }\r\n var data = mess['data'];\r\n this.bytesReceived += data.length;\r\n this.stats_.incrementCounter('bytes_received', data.length);\r\n this.resetKeepAlive();\r\n if (this.frames !== null) {\r\n // we're buffering\r\n this.appendFrame_(data);\r\n }\r\n else {\r\n // try to parse out a frame count, otherwise, assume 1 and process it\r\n var remainingData = this.extractFrameCount_(data);\r\n if (remainingData !== null) {\r\n this.appendFrame_(remainingData);\r\n }\r\n }\r\n };\r\n /**\r\n * Send a message to the server\r\n * @param {Object} data The JSON object to transmit\r\n */\r\n WebSocketConnection.prototype.send = function (data) {\r\n this.resetKeepAlive();\r\n var dataStr = stringify(data);\r\n this.bytesSent += dataStr.length;\r\n this.stats_.incrementCounter('bytes_sent', dataStr.length);\r\n //We can only fit a certain amount in each websocket frame, so we need to split this request\r\n //up into multiple pieces if it doesn't fit in one request.\r\n var dataSegs = splitStringBySize(dataStr, WEBSOCKET_MAX_FRAME_SIZE);\r\n //Send the length header\r\n if (dataSegs.length > 1) {\r\n this.sendString_(String(dataSegs.length));\r\n }\r\n //Send the actual data in segments.\r\n for (var i = 0; i < dataSegs.length; i++) {\r\n this.sendString_(dataSegs[i]);\r\n }\r\n };\r\n WebSocketConnection.prototype.shutdown_ = function () {\r\n this.isClosed_ = true;\r\n if (this.keepaliveTimer) {\r\n clearInterval(this.keepaliveTimer);\r\n this.keepaliveTimer = null;\r\n }\r\n if (this.mySock) {\r\n this.mySock.close();\r\n this.mySock = null;\r\n }\r\n };\r\n WebSocketConnection.prototype.onClosed_ = function () {\r\n if (!this.isClosed_) {\r\n this.log_('WebSocket is closing itself');\r\n this.shutdown_();\r\n // since this is an internal close, trigger the close listener\r\n if (this.onDisconnect) {\r\n this.onDisconnect(this.everConnected_);\r\n this.onDisconnect = null;\r\n }\r\n }\r\n };\r\n /**\r\n * External-facing close handler.\r\n * Close the websocket and kill the connection.\r\n */\r\n WebSocketConnection.prototype.close = function () {\r\n if (!this.isClosed_) {\r\n this.log_('WebSocket is being closed');\r\n this.shutdown_();\r\n }\r\n };\r\n /**\r\n * Kill the current keepalive timer and start a new one, to ensure that it always fires N seconds after\r\n * the last activity.\r\n */\r\n WebSocketConnection.prototype.resetKeepAlive = function () {\r\n var _this = this;\r\n clearInterval(this.keepaliveTimer);\r\n this.keepaliveTimer = setInterval(function () {\r\n //If there has been no websocket activity for a while, send a no-op\r\n if (_this.mySock) {\r\n _this.sendString_('0');\r\n }\r\n _this.resetKeepAlive();\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n }, Math.floor(WEBSOCKET_KEEPALIVE_INTERVAL));\r\n };\r\n /**\r\n * Send a string over the websocket.\r\n *\r\n * @param {string} str String to send.\r\n * @private\r\n */\r\n WebSocketConnection.prototype.sendString_ = function (str) {\r\n // Firefox seems to sometimes throw exceptions (NS_ERROR_UNEXPECTED) from websocket .send()\r\n // calls for some unknown reason. We treat these as an error and disconnect.\r\n // See https://app.asana.com/0/58926111402292/68021340250410\r\n try {\r\n this.mySock.send(str);\r\n }\r\n catch (e) {\r\n this.log_('Exception thrown from WebSocket.send():', e.message || e.data, 'Closing connection.');\r\n setTimeout(this.onClosed_.bind(this), 0);\r\n }\r\n };\r\n /**\r\n * Number of response before we consider the connection \"healthy.\"\r\n * @type {number}\r\n */\r\n WebSocketConnection.responsesRequiredToBeHealthy = 2;\r\n /**\r\n * Time to wait for the connection te become healthy before giving up.\r\n * @type {number}\r\n */\r\n WebSocketConnection.healthyTimeout = 30000;\r\n return WebSocketConnection;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Currently simplistic, this class manages what transport a Connection should use at various stages of its\r\n * lifecycle.\r\n *\r\n * It starts with longpolling in a browser, and httppolling on node. It then upgrades to websockets if\r\n * they are available.\r\n * @constructor\r\n */\r\nvar TransportManager = /** @class */ (function () {\r\n /**\r\n * @param {!RepoInfo} repoInfo Metadata around the namespace we're connecting to\r\n */\r\n function TransportManager(repoInfo) {\r\n this.initTransports_(repoInfo);\r\n }\r\n Object.defineProperty(TransportManager, \"ALL_TRANSPORTS\", {\r\n /**\r\n * @const\r\n * @type {!Array.<function(new:Transport, string, RepoInfo, string=)>}\r\n */\r\n get: function () {\r\n return [BrowserPollConnection, WebSocketConnection];\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * @param {!RepoInfo} repoInfo\r\n * @private\r\n */\r\n TransportManager.prototype.initTransports_ = function (repoInfo) {\r\n var e_1, _a;\r\n var isWebSocketsAvailable = WebSocketConnection && WebSocketConnection['isAvailable']();\r\n var isSkipPollConnection = isWebSocketsAvailable && !WebSocketConnection.previouslyFailed();\r\n if (repoInfo.webSocketOnly) {\r\n if (!isWebSocketsAvailable) {\r\n warn(\"wss:// URL used, but browser isn't known to support websockets. Trying anyway.\");\r\n }\r\n isSkipPollConnection = true;\r\n }\r\n if (isSkipPollConnection) {\r\n this.transports_ = [WebSocketConnection];\r\n }\r\n else {\r\n var transports = (this.transports_ = []);\r\n try {\r\n for (var _b = __values(TransportManager.ALL_TRANSPORTS), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var transport = _c.value;\r\n if (transport && transport['isAvailable']()) {\r\n transports.push(transport);\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n }\r\n };\r\n /**\r\n * @return {function(new:Transport, !string, !RepoInfo, string=, string=)} The constructor for the\r\n * initial transport to use\r\n */\r\n TransportManager.prototype.initialTransport = function () {\r\n if (this.transports_.length > 0) {\r\n return this.transports_[0];\r\n }\r\n else {\r\n throw new Error('No transports available');\r\n }\r\n };\r\n /**\r\n * @return {?function(new:Transport, function(),function(), string=)} The constructor for the next\r\n * transport, or null\r\n */\r\n TransportManager.prototype.upgradeTransport = function () {\r\n if (this.transports_.length > 1) {\r\n return this.transports_[1];\r\n }\r\n else {\r\n return null;\r\n }\r\n };\r\n return TransportManager;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// Abort upgrade attempt if it takes longer than 60s.\r\nvar UPGRADE_TIMEOUT = 60000;\r\n// For some transports (WebSockets), we need to \"validate\" the transport by exchanging a few requests and responses.\r\n// If we haven't sent enough requests within 5s, we'll start sending noop ping requests.\r\nvar DELAY_BEFORE_SENDING_EXTRA_REQUESTS = 5000;\r\n// If the initial data sent triggers a lot of bandwidth (i.e. it's a large put or a listen for a large amount of data)\r\n// then we may not be able to exchange our ping/pong requests within the healthy timeout. So if we reach the timeout\r\n// but we've sent/received enough bytes, we don't cancel the connection.\r\nvar BYTES_SENT_HEALTHY_OVERRIDE = 10 * 1024;\r\nvar BYTES_RECEIVED_HEALTHY_OVERRIDE = 100 * 1024;\r\nvar MESSAGE_TYPE = 't';\r\nvar MESSAGE_DATA = 'd';\r\nvar CONTROL_SHUTDOWN = 's';\r\nvar CONTROL_RESET = 'r';\r\nvar CONTROL_ERROR = 'e';\r\nvar CONTROL_PONG = 'o';\r\nvar SWITCH_ACK = 'a';\r\nvar END_TRANSMISSION = 'n';\r\nvar PING = 'p';\r\nvar SERVER_HELLO = 'h';\r\n/**\r\n * Creates a new real-time connection to the server using whichever method works\r\n * best in the current browser.\r\n *\r\n * @constructor\r\n */\r\nvar Connection = /** @class */ (function () {\r\n /**\r\n * @param id - an id for this connection\r\n * @param repoInfo_ - the info for the endpoint to connect to\r\n * @param applicationId_ - the Firebase App ID for this project\r\n * @param onMessage_ - the callback to be triggered when a server-push message arrives\r\n * @param onReady_ - the callback to be triggered when this connection is ready to send messages.\r\n * @param onDisconnect_ - the callback to be triggered when a connection was lost\r\n * @param onKill_ - the callback to be triggered when this connection has permanently shut down.\r\n * @param lastSessionId - last session id in persistent connection. is used to clean up old session in real-time server\r\n */\r\n function Connection(id, repoInfo_, applicationId_, onMessage_, onReady_, onDisconnect_, onKill_, lastSessionId) {\r\n this.id = id;\r\n this.repoInfo_ = repoInfo_;\r\n this.applicationId_ = applicationId_;\r\n this.onMessage_ = onMessage_;\r\n this.onReady_ = onReady_;\r\n this.onDisconnect_ = onDisconnect_;\r\n this.onKill_ = onKill_;\r\n this.lastSessionId = lastSessionId;\r\n this.connectionCount = 0;\r\n this.pendingDataMessages = [];\r\n this.state_ = 0 /* CONNECTING */;\r\n this.log_ = logWrapper('c:' + this.id + ':');\r\n this.transportManager_ = new TransportManager(repoInfo_);\r\n this.log_('Connection created');\r\n this.start_();\r\n }\r\n /**\r\n * Starts a connection attempt\r\n * @private\r\n */\r\n Connection.prototype.start_ = function () {\r\n var _this = this;\r\n var conn = this.transportManager_.initialTransport();\r\n this.conn_ = new conn(this.nextTransportId_(), this.repoInfo_, this.applicationId_, undefined, this.lastSessionId);\r\n // For certain transports (WebSockets), we need to send and receive several messages back and forth before we\r\n // can consider the transport healthy.\r\n this.primaryResponsesRequired_ = conn['responsesRequiredToBeHealthy'] || 0;\r\n var onMessageReceived = this.connReceiver_(this.conn_);\r\n var onConnectionLost = this.disconnReceiver_(this.conn_);\r\n this.tx_ = this.conn_;\r\n this.rx_ = this.conn_;\r\n this.secondaryConn_ = null;\r\n this.isHealthy_ = false;\r\n /*\r\n * Firefox doesn't like when code from one iframe tries to create another iframe by way of the parent frame.\r\n * This can occur in the case of a redirect, i.e. we guessed wrong on what server to connect to and received a reset.\r\n * Somehow, setTimeout seems to make this ok. That doesn't make sense from a security perspective, since you should\r\n * still have the context of your originating frame.\r\n */\r\n setTimeout(function () {\r\n // this.conn_ gets set to null in some of the tests. Check to make sure it still exists before using it\r\n _this.conn_ && _this.conn_.open(onMessageReceived, onConnectionLost);\r\n }, Math.floor(0));\r\n var healthyTimeoutMS = conn['healthyTimeout'] || 0;\r\n if (healthyTimeoutMS > 0) {\r\n this.healthyTimeout_ = setTimeoutNonBlocking(function () {\r\n _this.healthyTimeout_ = null;\r\n if (!_this.isHealthy_) {\r\n if (_this.conn_ &&\r\n _this.conn_.bytesReceived > BYTES_RECEIVED_HEALTHY_OVERRIDE) {\r\n _this.log_('Connection exceeded healthy timeout but has received ' +\r\n _this.conn_.bytesReceived +\r\n ' bytes. Marking connection healthy.');\r\n _this.isHealthy_ = true;\r\n _this.conn_.markConnectionHealthy();\r\n }\r\n else if (_this.conn_ &&\r\n _this.conn_.bytesSent > BYTES_SENT_HEALTHY_OVERRIDE) {\r\n _this.log_('Connection exceeded healthy timeout but has sent ' +\r\n _this.conn_.bytesSent +\r\n ' bytes. Leaving connection alive.');\r\n // NOTE: We don't want to mark it healthy, since we have no guarantee that the bytes have made it to\r\n // the server.\r\n }\r\n else {\r\n _this.log_('Closing unhealthy connection after timeout.');\r\n _this.close();\r\n }\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n }, Math.floor(healthyTimeoutMS));\r\n }\r\n };\r\n /**\r\n * @return {!string}\r\n * @private\r\n */\r\n Connection.prototype.nextTransportId_ = function () {\r\n return 'c:' + this.id + ':' + this.connectionCount++;\r\n };\r\n Connection.prototype.disconnReceiver_ = function (conn) {\r\n var _this = this;\r\n return function (everConnected) {\r\n if (conn === _this.conn_) {\r\n _this.onConnectionLost_(everConnected);\r\n }\r\n else if (conn === _this.secondaryConn_) {\r\n _this.log_('Secondary connection lost.');\r\n _this.onSecondaryConnectionLost_();\r\n }\r\n else {\r\n _this.log_('closing an old connection');\r\n }\r\n };\r\n };\r\n Connection.prototype.connReceiver_ = function (conn) {\r\n var _this = this;\r\n return function (message) {\r\n if (_this.state_ !== 2 /* DISCONNECTED */) {\r\n if (conn === _this.rx_) {\r\n _this.onPrimaryMessageReceived_(message);\r\n }\r\n else if (conn === _this.secondaryConn_) {\r\n _this.onSecondaryMessageReceived_(message);\r\n }\r\n else {\r\n _this.log_('message on old connection');\r\n }\r\n }\r\n };\r\n };\r\n /**\r\n *\r\n * @param {Object} dataMsg An arbitrary data message to be sent to the server\r\n */\r\n Connection.prototype.sendRequest = function (dataMsg) {\r\n // wrap in a data message envelope and send it on\r\n var msg = { t: 'd', d: dataMsg };\r\n this.sendData_(msg);\r\n };\r\n Connection.prototype.tryCleanupConnection = function () {\r\n if (this.tx_ === this.secondaryConn_ && this.rx_ === this.secondaryConn_) {\r\n this.log_('cleaning up and promoting a connection: ' + this.secondaryConn_.connId);\r\n this.conn_ = this.secondaryConn_;\r\n this.secondaryConn_ = null;\r\n // the server will shutdown the old connection\r\n }\r\n };\r\n Connection.prototype.onSecondaryControl_ = function (controlData) {\r\n if (MESSAGE_TYPE in controlData) {\r\n var cmd = controlData[MESSAGE_TYPE];\r\n if (cmd === SWITCH_ACK) {\r\n this.upgradeIfSecondaryHealthy_();\r\n }\r\n else if (cmd === CONTROL_RESET) {\r\n // Most likely the session wasn't valid. Abandon the switch attempt\r\n this.log_('Got a reset on secondary, closing it');\r\n this.secondaryConn_.close();\r\n // If we were already using this connection for something, than we need to fully close\r\n if (this.tx_ === this.secondaryConn_ ||\r\n this.rx_ === this.secondaryConn_) {\r\n this.close();\r\n }\r\n }\r\n else if (cmd === CONTROL_PONG) {\r\n this.log_('got pong on secondary.');\r\n this.secondaryResponsesRequired_--;\r\n this.upgradeIfSecondaryHealthy_();\r\n }\r\n }\r\n };\r\n Connection.prototype.onSecondaryMessageReceived_ = function (parsedData) {\r\n var layer = requireKey('t', parsedData);\r\n var data = requireKey('d', parsedData);\r\n if (layer === 'c') {\r\n this.onSecondaryControl_(data);\r\n }\r\n else if (layer === 'd') {\r\n // got a data message, but we're still second connection. Need to buffer it up\r\n this.pendingDataMessages.push(data);\r\n }\r\n else {\r\n throw new Error('Unknown protocol layer: ' + layer);\r\n }\r\n };\r\n Connection.prototype.upgradeIfSecondaryHealthy_ = function () {\r\n if (this.secondaryResponsesRequired_ <= 0) {\r\n this.log_('Secondary connection is healthy.');\r\n this.isHealthy_ = true;\r\n this.secondaryConn_.markConnectionHealthy();\r\n this.proceedWithUpgrade_();\r\n }\r\n else {\r\n // Send a ping to make sure the connection is healthy.\r\n this.log_('sending ping on secondary.');\r\n this.secondaryConn_.send({ t: 'c', d: { t: PING, d: {} } });\r\n }\r\n };\r\n Connection.prototype.proceedWithUpgrade_ = function () {\r\n // tell this connection to consider itself open\r\n this.secondaryConn_.start();\r\n // send ack\r\n this.log_('sending client ack on secondary');\r\n this.secondaryConn_.send({ t: 'c', d: { t: SWITCH_ACK, d: {} } });\r\n // send end packet on primary transport, switch to sending on this one\r\n // can receive on this one, buffer responses until end received on primary transport\r\n this.log_('Ending transmission on primary');\r\n this.conn_.send({ t: 'c', d: { t: END_TRANSMISSION, d: {} } });\r\n this.tx_ = this.secondaryConn_;\r\n this.tryCleanupConnection();\r\n };\r\n Connection.prototype.onPrimaryMessageReceived_ = function (parsedData) {\r\n // Must refer to parsedData properties in quotes, so closure doesn't touch them.\r\n var layer = requireKey('t', parsedData);\r\n var data = requireKey('d', parsedData);\r\n if (layer === 'c') {\r\n this.onControl_(data);\r\n }\r\n else if (layer === 'd') {\r\n this.onDataMessage_(data);\r\n }\r\n };\r\n Connection.prototype.onDataMessage_ = function (message) {\r\n this.onPrimaryResponse_();\r\n // We don't do anything with data messages, just kick them up a level\r\n this.onMessage_(message);\r\n };\r\n Connection.prototype.onPrimaryResponse_ = function () {\r\n if (!this.isHealthy_) {\r\n this.primaryResponsesRequired_--;\r\n if (this.primaryResponsesRequired_ <= 0) {\r\n this.log_('Primary connection is healthy.');\r\n this.isHealthy_ = true;\r\n this.conn_.markConnectionHealthy();\r\n }\r\n }\r\n };\r\n Connection.prototype.onControl_ = function (controlData) {\r\n var cmd = requireKey(MESSAGE_TYPE, controlData);\r\n if (MESSAGE_DATA in controlData) {\r\n var payload = controlData[MESSAGE_DATA];\r\n if (cmd === SERVER_HELLO) {\r\n this.onHandshake_(payload);\r\n }\r\n else if (cmd === END_TRANSMISSION) {\r\n this.log_('recvd end transmission on primary');\r\n this.rx_ = this.secondaryConn_;\r\n for (var i = 0; i < this.pendingDataMessages.length; ++i) {\r\n this.onDataMessage_(this.pendingDataMessages[i]);\r\n }\r\n this.pendingDataMessages = [];\r\n this.tryCleanupConnection();\r\n }\r\n else if (cmd === CONTROL_SHUTDOWN) {\r\n // This was previously the 'onKill' callback passed to the lower-level connection\r\n // payload in this case is the reason for the shutdown. Generally a human-readable error\r\n this.onConnectionShutdown_(payload);\r\n }\r\n else if (cmd === CONTROL_RESET) {\r\n // payload in this case is the host we should contact\r\n this.onReset_(payload);\r\n }\r\n else if (cmd === CONTROL_ERROR) {\r\n error('Server Error: ' + payload);\r\n }\r\n else if (cmd === CONTROL_PONG) {\r\n this.log_('got pong on primary.');\r\n this.onPrimaryResponse_();\r\n this.sendPingOnPrimaryIfNecessary_();\r\n }\r\n else {\r\n error('Unknown control packet command: ' + cmd);\r\n }\r\n }\r\n };\r\n /**\r\n *\r\n * @param {Object} handshake The handshake data returned from the server\r\n * @private\r\n */\r\n Connection.prototype.onHandshake_ = function (handshake) {\r\n var timestamp = handshake.ts;\r\n var version = handshake.v;\r\n var host = handshake.h;\r\n this.sessionId = handshake.s;\r\n this.repoInfo_.updateHost(host);\r\n // if we've already closed the connection, then don't bother trying to progress further\r\n if (this.state_ === 0 /* CONNECTING */) {\r\n this.conn_.start();\r\n this.onConnectionEstablished_(this.conn_, timestamp);\r\n if (PROTOCOL_VERSION !== version) {\r\n warn('Protocol version mismatch detected');\r\n }\r\n // TODO: do we want to upgrade? when? maybe a delay?\r\n this.tryStartUpgrade_();\r\n }\r\n };\r\n Connection.prototype.tryStartUpgrade_ = function () {\r\n var conn = this.transportManager_.upgradeTransport();\r\n if (conn) {\r\n this.startUpgrade_(conn);\r\n }\r\n };\r\n Connection.prototype.startUpgrade_ = function (conn) {\r\n var _this = this;\r\n this.secondaryConn_ = new conn(this.nextTransportId_(), this.repoInfo_, this.applicationId_, this.sessionId);\r\n // For certain transports (WebSockets), we need to send and receive several messages back and forth before we\r\n // can consider the transport healthy.\r\n this.secondaryResponsesRequired_ =\r\n conn['responsesRequiredToBeHealthy'] || 0;\r\n var onMessage = this.connReceiver_(this.secondaryConn_);\r\n var onDisconnect = this.disconnReceiver_(this.secondaryConn_);\r\n this.secondaryConn_.open(onMessage, onDisconnect);\r\n // If we haven't successfully upgraded after UPGRADE_TIMEOUT, give up and kill the secondary.\r\n setTimeoutNonBlocking(function () {\r\n if (_this.secondaryConn_) {\r\n _this.log_('Timed out trying to upgrade.');\r\n _this.secondaryConn_.close();\r\n }\r\n }, Math.floor(UPGRADE_TIMEOUT));\r\n };\r\n Connection.prototype.onReset_ = function (host) {\r\n this.log_('Reset packet received. New host: ' + host);\r\n this.repoInfo_.updateHost(host);\r\n // TODO: if we're already \"connected\", we need to trigger a disconnect at the next layer up.\r\n // We don't currently support resets after the connection has already been established\r\n if (this.state_ === 1 /* CONNECTED */) {\r\n this.close();\r\n }\r\n else {\r\n // Close whatever connections we have open and start again.\r\n this.closeConnections_();\r\n this.start_();\r\n }\r\n };\r\n Connection.prototype.onConnectionEstablished_ = function (conn, timestamp) {\r\n var _this = this;\r\n this.log_('Realtime connection established.');\r\n this.conn_ = conn;\r\n this.state_ = 1 /* CONNECTED */;\r\n if (this.onReady_) {\r\n this.onReady_(timestamp, this.sessionId);\r\n this.onReady_ = null;\r\n }\r\n // If after 5 seconds we haven't sent enough requests to the server to get the connection healthy,\r\n // send some pings.\r\n if (this.primaryResponsesRequired_ === 0) {\r\n this.log_('Primary connection is healthy.');\r\n this.isHealthy_ = true;\r\n }\r\n else {\r\n setTimeoutNonBlocking(function () {\r\n _this.sendPingOnPrimaryIfNecessary_();\r\n }, Math.floor(DELAY_BEFORE_SENDING_EXTRA_REQUESTS));\r\n }\r\n };\r\n Connection.prototype.sendPingOnPrimaryIfNecessary_ = function () {\r\n // If the connection isn't considered healthy yet, we'll send a noop ping packet request.\r\n if (!this.isHealthy_ && this.state_ === 1 /* CONNECTED */) {\r\n this.log_('sending ping on primary.');\r\n this.sendData_({ t: 'c', d: { t: PING, d: {} } });\r\n }\r\n };\r\n Connection.prototype.onSecondaryConnectionLost_ = function () {\r\n var conn = this.secondaryConn_;\r\n this.secondaryConn_ = null;\r\n if (this.tx_ === conn || this.rx_ === conn) {\r\n // we are relying on this connection already in some capacity. Therefore, a failure is real\r\n this.close();\r\n }\r\n };\r\n /**\r\n *\r\n * @param {boolean} everConnected Whether or not the connection ever reached a server. Used to determine if\r\n * we should flush the host cache\r\n * @private\r\n */\r\n Connection.prototype.onConnectionLost_ = function (everConnected) {\r\n this.conn_ = null;\r\n // NOTE: IF you're seeing a Firefox error for this line, I think it might be because it's getting\r\n // called on window close and RealtimeState.CONNECTING is no longer defined. Just a guess.\r\n if (!everConnected && this.state_ === 0 /* CONNECTING */) {\r\n this.log_('Realtime connection failed.');\r\n // Since we failed to connect at all, clear any cached entry for this namespace in case the machine went away\r\n if (this.repoInfo_.isCacheableHost()) {\r\n PersistentStorage.remove('host:' + this.repoInfo_.host);\r\n // reset the internal host to what we would show the user, i.e. <ns>.firebaseio.com\r\n this.repoInfo_.internalHost = this.repoInfo_.host;\r\n }\r\n }\r\n else if (this.state_ === 1 /* CONNECTED */) {\r\n this.log_('Realtime connection lost.');\r\n }\r\n this.close();\r\n };\r\n /**\r\n *\r\n * @param {string} reason\r\n * @private\r\n */\r\n Connection.prototype.onConnectionShutdown_ = function (reason) {\r\n this.log_('Connection shutdown command received. Shutting down...');\r\n if (this.onKill_) {\r\n this.onKill_(reason);\r\n this.onKill_ = null;\r\n }\r\n // We intentionally don't want to fire onDisconnect (kill is a different case),\r\n // so clear the callback.\r\n this.onDisconnect_ = null;\r\n this.close();\r\n };\r\n Connection.prototype.sendData_ = function (data) {\r\n if (this.state_ !== 1 /* CONNECTED */) {\r\n throw 'Connection is not connected';\r\n }\r\n else {\r\n this.tx_.send(data);\r\n }\r\n };\r\n /**\r\n * Cleans up this connection, calling the appropriate callbacks\r\n */\r\n Connection.prototype.close = function () {\r\n if (this.state_ !== 2 /* DISCONNECTED */) {\r\n this.log_('Closing realtime connection.');\r\n this.state_ = 2 /* DISCONNECTED */;\r\n this.closeConnections_();\r\n if (this.onDisconnect_) {\r\n this.onDisconnect_();\r\n this.onDisconnect_ = null;\r\n }\r\n }\r\n };\r\n /**\r\n *\r\n * @private\r\n */\r\n Connection.prototype.closeConnections_ = function () {\r\n this.log_('Shutting down all connections');\r\n if (this.conn_) {\r\n this.conn_.close();\r\n this.conn_ = null;\r\n }\r\n if (this.secondaryConn_) {\r\n this.secondaryConn_.close();\r\n this.secondaryConn_ = null;\r\n }\r\n if (this.healthyTimeout_) {\r\n clearTimeout(this.healthyTimeout_);\r\n this.healthyTimeout_ = null;\r\n }\r\n };\r\n return Connection;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Interface defining the set of actions that can be performed against the Firebase server\r\n * (basically corresponds to our wire protocol).\r\n *\r\n * @interface\r\n */\r\nvar ServerActions = /** @class */ (function () {\r\n function ServerActions() {\r\n }\r\n /**\r\n * @param {string} pathString\r\n * @param {*} data\r\n * @param {function(string, string)=} onComplete\r\n * @param {string=} hash\r\n */\r\n ServerActions.prototype.put = function (pathString, data, onComplete, hash) { };\r\n /**\r\n * @param {string} pathString\r\n * @param {*} data\r\n * @param {function(string, ?string)} onComplete\r\n * @param {string=} hash\r\n */\r\n ServerActions.prototype.merge = function (pathString, data, onComplete, hash) { };\r\n /**\r\n * Refreshes the auth token for the current connection.\r\n * @param {string} token The authentication token\r\n */\r\n ServerActions.prototype.refreshAuthToken = function (token) { };\r\n /**\r\n * @param {string} pathString\r\n * @param {*} data\r\n * @param {function(string, string)=} onComplete\r\n */\r\n ServerActions.prototype.onDisconnectPut = function (pathString, data, onComplete) { };\r\n /**\r\n * @param {string} pathString\r\n * @param {*} data\r\n * @param {function(string, string)=} onComplete\r\n */\r\n ServerActions.prototype.onDisconnectMerge = function (pathString, data, onComplete) { };\r\n /**\r\n * @param {string} pathString\r\n * @param {function(string, string)=} onComplete\r\n */\r\n ServerActions.prototype.onDisconnectCancel = function (pathString, onComplete) { };\r\n /**\r\n * @param {Object.<string, *>} stats\r\n */\r\n ServerActions.prototype.reportStats = function (stats) { };\r\n return ServerActions;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar RECONNECT_MIN_DELAY = 1000;\r\nvar RECONNECT_MAX_DELAY_DEFAULT = 60 * 5 * 1000; // 5 minutes in milliseconds (Case: 1858)\r\nvar RECONNECT_MAX_DELAY_FOR_ADMINS = 30 * 1000; // 30 seconds for admin clients (likely to be a backend server)\r\nvar RECONNECT_DELAY_MULTIPLIER = 1.3;\r\nvar RECONNECT_DELAY_RESET_TIMEOUT = 30000; // Reset delay back to MIN_DELAY after being connected for 30sec.\r\nvar SERVER_KILL_INTERRUPT_REASON = 'server_kill';\r\n// If auth fails repeatedly, we'll assume something is wrong and log a warning / back off.\r\nvar INVALID_AUTH_TOKEN_THRESHOLD = 3;\r\n/**\r\n * Firebase connection. Abstracts wire protocol and handles reconnecting.\r\n *\r\n * NOTE: All JSON objects sent to the realtime connection must have property names enclosed\r\n * in quotes to make sure the closure compiler does not minify them.\r\n */\r\nvar PersistentConnection = /** @class */ (function (_super) {\r\n __extends(PersistentConnection, _super);\r\n /**\r\n * @implements {ServerActions}\r\n * @param repoInfo_ Data about the namespace we are connecting to\r\n * @param applicationId_ The Firebase App ID for this project\r\n * @param onDataUpdate_ A callback for new data from the server\r\n */\r\n function PersistentConnection(repoInfo_, applicationId_, onDataUpdate_, onConnectStatus_, onServerInfoUpdate_, authTokenProvider_, authOverride_) {\r\n var _this = _super.call(this) || this;\r\n _this.repoInfo_ = repoInfo_;\r\n _this.applicationId_ = applicationId_;\r\n _this.onDataUpdate_ = onDataUpdate_;\r\n _this.onConnectStatus_ = onConnectStatus_;\r\n _this.onServerInfoUpdate_ = onServerInfoUpdate_;\r\n _this.authTokenProvider_ = authTokenProvider_;\r\n _this.authOverride_ = authOverride_;\r\n // Used for diagnostic logging.\r\n _this.id = PersistentConnection.nextPersistentConnectionId_++;\r\n _this.log_ = logWrapper('p:' + _this.id + ':');\r\n _this.interruptReasons_ = {};\r\n /** Map<path, Map<queryId, ListenSpec>> */\r\n _this.listens = new Map();\r\n _this.outstandingPuts_ = [];\r\n _this.outstandingPutCount_ = 0;\r\n _this.onDisconnectRequestQueue_ = [];\r\n _this.connected_ = false;\r\n _this.reconnectDelay_ = RECONNECT_MIN_DELAY;\r\n _this.maxReconnectDelay_ = RECONNECT_MAX_DELAY_DEFAULT;\r\n _this.securityDebugCallback_ = null;\r\n _this.lastSessionId = null;\r\n _this.establishConnectionTimer_ = null;\r\n _this.visible_ = false;\r\n // Before we get connected, we keep a queue of pending messages to send.\r\n _this.requestCBHash_ = {};\r\n _this.requestNumber_ = 0;\r\n _this.realtime_ = null;\r\n _this.authToken_ = null;\r\n _this.forceTokenRefresh_ = false;\r\n _this.invalidAuthTokenCount_ = 0;\r\n _this.firstConnection_ = true;\r\n _this.lastConnectionAttemptTime_ = null;\r\n _this.lastConnectionEstablishedTime_ = null;\r\n if (authOverride_ && !isNodeSdk()) {\r\n throw new Error('Auth override specified in options, but not supported on non Node.js platforms');\r\n }\r\n _this.scheduleConnect_(0);\r\n VisibilityMonitor.getInstance().on('visible', _this.onVisible_, _this);\r\n if (repoInfo_.host.indexOf('fblocal') === -1) {\r\n OnlineMonitor.getInstance().on('online', _this.onOnline_, _this);\r\n }\r\n return _this;\r\n }\r\n PersistentConnection.prototype.sendRequest = function (action, body, onResponse) {\r\n var curReqNum = ++this.requestNumber_;\r\n var msg = { r: curReqNum, a: action, b: body };\r\n this.log_(stringify(msg));\r\n assert(this.connected_, \"sendRequest call when we're not connected not allowed.\");\r\n this.realtime_.sendRequest(msg);\r\n if (onResponse) {\r\n this.requestCBHash_[curReqNum] = onResponse;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PersistentConnection.prototype.listen = function (query, currentHashFn, tag, onComplete) {\r\n var queryId = query.queryIdentifier();\r\n var pathString = query.path.toString();\r\n this.log_('Listen called for ' + pathString + ' ' + queryId);\r\n if (!this.listens.has(pathString)) {\r\n this.listens.set(pathString, new Map());\r\n }\r\n assert(query.getQueryParams().isDefault() ||\r\n !query.getQueryParams().loadsAllData(), 'listen() called for non-default but complete query');\r\n assert(!this.listens.get(pathString).has(queryId), 'listen() called twice for same path/queryId.');\r\n var listenSpec = {\r\n onComplete: onComplete,\r\n hashFn: currentHashFn,\r\n query: query,\r\n tag: tag\r\n };\r\n this.listens.get(pathString).set(queryId, listenSpec);\r\n if (this.connected_) {\r\n this.sendListen_(listenSpec);\r\n }\r\n };\r\n PersistentConnection.prototype.sendListen_ = function (listenSpec) {\r\n var _this = this;\r\n var query = listenSpec.query;\r\n var pathString = query.path.toString();\r\n var queryId = query.queryIdentifier();\r\n this.log_('Listen on ' + pathString + ' for ' + queryId);\r\n var req = { /*path*/ p: pathString };\r\n var action = 'q';\r\n // Only bother to send query if it's non-default.\r\n if (listenSpec.tag) {\r\n req['q'] = query.queryObject();\r\n req['t'] = listenSpec.tag;\r\n }\r\n req[ /*hash*/'h'] = listenSpec.hashFn();\r\n this.sendRequest(action, req, function (message) {\r\n var payload = message[ /*data*/'d'];\r\n var status = message[ /*status*/'s'];\r\n // print warnings in any case...\r\n PersistentConnection.warnOnListenWarnings_(payload, query);\r\n var currentListenSpec = _this.listens.get(pathString) &&\r\n _this.listens.get(pathString).get(queryId);\r\n // only trigger actions if the listen hasn't been removed and readded\r\n if (currentListenSpec === listenSpec) {\r\n _this.log_('listen response', message);\r\n if (status !== 'ok') {\r\n _this.removeListen_(pathString, queryId);\r\n }\r\n if (listenSpec.onComplete) {\r\n listenSpec.onComplete(status, payload);\r\n }\r\n }\r\n });\r\n };\r\n PersistentConnection.warnOnListenWarnings_ = function (payload, query) {\r\n if (payload && typeof payload === 'object' && contains(payload, 'w')) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n var warnings = safeGet(payload, 'w');\r\n if (Array.isArray(warnings) && ~warnings.indexOf('no_index')) {\r\n var indexSpec = '\".indexOn\": \"' + query.getQueryParams().getIndex().toString() + '\"';\r\n var indexPath = query.path.toString();\r\n warn(\"Using an unspecified index. Your data will be downloaded and \" +\r\n (\"filtered on the client. Consider adding \" + indexSpec + \" at \") +\r\n (indexPath + \" to your security rules for better performance.\"));\r\n }\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PersistentConnection.prototype.refreshAuthToken = function (token) {\r\n this.authToken_ = token;\r\n this.log_('Auth token refreshed');\r\n if (this.authToken_) {\r\n this.tryAuth();\r\n }\r\n else {\r\n //If we're connected we want to let the server know to unauthenticate us. If we're not connected, simply delete\r\n //the credential so we dont become authenticated next time we connect.\r\n if (this.connected_) {\r\n this.sendRequest('unauth', {}, function () { });\r\n }\r\n }\r\n this.reduceReconnectDelayIfAdminCredential_(token);\r\n };\r\n PersistentConnection.prototype.reduceReconnectDelayIfAdminCredential_ = function (credential) {\r\n // NOTE: This isn't intended to be bulletproof (a malicious developer can always just modify the client).\r\n // Additionally, we don't bother resetting the max delay back to the default if auth fails / expires.\r\n var isFirebaseSecret = credential && credential.length === 40;\r\n if (isFirebaseSecret || isAdmin(credential)) {\r\n this.log_('Admin auth credential detected. Reducing max reconnect time.');\r\n this.maxReconnectDelay_ = RECONNECT_MAX_DELAY_FOR_ADMINS;\r\n }\r\n };\r\n /**\r\n * Attempts to authenticate with the given credentials. If the authentication attempt fails, it's triggered like\r\n * a auth revoked (the connection is closed).\r\n */\r\n PersistentConnection.prototype.tryAuth = function () {\r\n var _this = this;\r\n if (this.connected_ && this.authToken_) {\r\n var token_1 = this.authToken_;\r\n var authMethod = isValidFormat(token_1) ? 'auth' : 'gauth';\r\n var requestData = { cred: token_1 };\r\n if (this.authOverride_ === null) {\r\n requestData['noauth'] = true;\r\n }\r\n else if (typeof this.authOverride_ === 'object') {\r\n requestData['authvar'] = this.authOverride_;\r\n }\r\n this.sendRequest(authMethod, requestData, function (res) {\r\n var status = res[ /*status*/'s'];\r\n var data = res[ /*data*/'d'] || 'error';\r\n if (_this.authToken_ === token_1) {\r\n if (status === 'ok') {\r\n _this.invalidAuthTokenCount_ = 0;\r\n }\r\n else {\r\n // Triggers reconnect and force refresh for auth token\r\n _this.onAuthRevoked_(status, data);\r\n }\r\n }\r\n });\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PersistentConnection.prototype.unlisten = function (query, tag) {\r\n var pathString = query.path.toString();\r\n var queryId = query.queryIdentifier();\r\n this.log_('Unlisten called for ' + pathString + ' ' + queryId);\r\n assert(query.getQueryParams().isDefault() ||\r\n !query.getQueryParams().loadsAllData(), 'unlisten() called for non-default but complete query');\r\n var listen = this.removeListen_(pathString, queryId);\r\n if (listen && this.connected_) {\r\n this.sendUnlisten_(pathString, queryId, query.queryObject(), tag);\r\n }\r\n };\r\n PersistentConnection.prototype.sendUnlisten_ = function (pathString, queryId, queryObj, tag) {\r\n this.log_('Unlisten on ' + pathString + ' for ' + queryId);\r\n var req = { /*path*/ p: pathString };\r\n var action = 'n';\r\n // Only bother sending queryId if it's non-default.\r\n if (tag) {\r\n req['q'] = queryObj;\r\n req['t'] = tag;\r\n }\r\n this.sendRequest(action, req);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PersistentConnection.prototype.onDisconnectPut = function (pathString, data, onComplete) {\r\n if (this.connected_) {\r\n this.sendOnDisconnect_('o', pathString, data, onComplete);\r\n }\r\n else {\r\n this.onDisconnectRequestQueue_.push({\r\n pathString: pathString,\r\n action: 'o',\r\n data: data,\r\n onComplete: onComplete\r\n });\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PersistentConnection.prototype.onDisconnectMerge = function (pathString, data, onComplete) {\r\n if (this.connected_) {\r\n this.sendOnDisconnect_('om', pathString, data, onComplete);\r\n }\r\n else {\r\n this.onDisconnectRequestQueue_.push({\r\n pathString: pathString,\r\n action: 'om',\r\n data: data,\r\n onComplete: onComplete\r\n });\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PersistentConnection.prototype.onDisconnectCancel = function (pathString, onComplete) {\r\n if (this.connected_) {\r\n this.sendOnDisconnect_('oc', pathString, null, onComplete);\r\n }\r\n else {\r\n this.onDisconnectRequestQueue_.push({\r\n pathString: pathString,\r\n action: 'oc',\r\n data: null,\r\n onComplete: onComplete\r\n });\r\n }\r\n };\r\n PersistentConnection.prototype.sendOnDisconnect_ = function (action, pathString, data, onComplete) {\r\n var request = { /*path*/ p: pathString, /*data*/ d: data };\r\n this.log_('onDisconnect ' + action, request);\r\n this.sendRequest(action, request, function (response) {\r\n if (onComplete) {\r\n setTimeout(function () {\r\n onComplete(response[ /*status*/'s'], response[ /* data */'d']);\r\n }, Math.floor(0));\r\n }\r\n });\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PersistentConnection.prototype.put = function (pathString, data, onComplete, hash) {\r\n this.putInternal('p', pathString, data, onComplete, hash);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PersistentConnection.prototype.merge = function (pathString, data, onComplete, hash) {\r\n this.putInternal('m', pathString, data, onComplete, hash);\r\n };\r\n PersistentConnection.prototype.putInternal = function (action, pathString, data, onComplete, hash) {\r\n var request = {\r\n /*path*/ p: pathString,\r\n /*data*/ d: data\r\n };\r\n if (hash !== undefined) {\r\n request[ /*hash*/'h'] = hash;\r\n }\r\n // TODO: Only keep track of the most recent put for a given path?\r\n this.outstandingPuts_.push({\r\n action: action,\r\n request: request,\r\n onComplete: onComplete\r\n });\r\n this.outstandingPutCount_++;\r\n var index = this.outstandingPuts_.length - 1;\r\n if (this.connected_) {\r\n this.sendPut_(index);\r\n }\r\n else {\r\n this.log_('Buffering put: ' + pathString);\r\n }\r\n };\r\n PersistentConnection.prototype.sendPut_ = function (index) {\r\n var _this = this;\r\n var action = this.outstandingPuts_[index].action;\r\n var request = this.outstandingPuts_[index].request;\r\n var onComplete = this.outstandingPuts_[index].onComplete;\r\n this.outstandingPuts_[index].queued = this.connected_;\r\n this.sendRequest(action, request, function (message) {\r\n _this.log_(action + ' response', message);\r\n delete _this.outstandingPuts_[index];\r\n _this.outstandingPutCount_--;\r\n // Clean up array occasionally.\r\n if (_this.outstandingPutCount_ === 0) {\r\n _this.outstandingPuts_ = [];\r\n }\r\n if (onComplete) {\r\n onComplete(message[ /*status*/'s'], message[ /* data */'d']);\r\n }\r\n });\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PersistentConnection.prototype.reportStats = function (stats) {\r\n var _this = this;\r\n // If we're not connected, we just drop the stats.\r\n if (this.connected_) {\r\n var request = { /*counters*/ c: stats };\r\n this.log_('reportStats', request);\r\n this.sendRequest(/*stats*/ 's', request, function (result) {\r\n var status = result[ /*status*/'s'];\r\n if (status !== 'ok') {\r\n var errorReason = result[ /* data */'d'];\r\n _this.log_('reportStats', 'Error sending stats: ' + errorReason);\r\n }\r\n });\r\n }\r\n };\r\n PersistentConnection.prototype.onDataMessage_ = function (message) {\r\n if ('r' in message) {\r\n // this is a response\r\n this.log_('from server: ' + stringify(message));\r\n var reqNum = message['r'];\r\n var onResponse = this.requestCBHash_[reqNum];\r\n if (onResponse) {\r\n delete this.requestCBHash_[reqNum];\r\n onResponse(message[ /*body*/'b']);\r\n }\r\n }\r\n else if ('error' in message) {\r\n throw 'A server-side error has occurred: ' + message['error'];\r\n }\r\n else if ('a' in message) {\r\n // a and b are action and body, respectively\r\n this.onDataPush_(message['a'], message['b']);\r\n }\r\n };\r\n PersistentConnection.prototype.onDataPush_ = function (action, body) {\r\n this.log_('handleServerMessage', action, body);\r\n if (action === 'd') {\r\n this.onDataUpdate_(body[ /*path*/'p'], body[ /*data*/'d'], \r\n /*isMerge*/ false, body['t']);\r\n }\r\n else if (action === 'm') {\r\n this.onDataUpdate_(body[ /*path*/'p'], body[ /*data*/'d'], \r\n /*isMerge=*/ true, body['t']);\r\n }\r\n else if (action === 'c') {\r\n this.onListenRevoked_(body[ /*path*/'p'], body[ /*query*/'q']);\r\n }\r\n else if (action === 'ac') {\r\n this.onAuthRevoked_(body[ /*status code*/'s'], body[ /* explanation */'d']);\r\n }\r\n else if (action === 'sd') {\r\n this.onSecurityDebugPacket_(body);\r\n }\r\n else {\r\n error('Unrecognized action received from server: ' +\r\n stringify(action) +\r\n '\\nAre you using the latest client?');\r\n }\r\n };\r\n PersistentConnection.prototype.onReady_ = function (timestamp, sessionId) {\r\n this.log_('connection ready');\r\n this.connected_ = true;\r\n this.lastConnectionEstablishedTime_ = new Date().getTime();\r\n this.handleTimestamp_(timestamp);\r\n this.lastSessionId = sessionId;\r\n if (this.firstConnection_) {\r\n this.sendConnectStats_();\r\n }\r\n this.restoreState_();\r\n this.firstConnection_ = false;\r\n this.onConnectStatus_(true);\r\n };\r\n PersistentConnection.prototype.scheduleConnect_ = function (timeout) {\r\n var _this = this;\r\n assert(!this.realtime_, \"Scheduling a connect when we're already connected/ing?\");\r\n if (this.establishConnectionTimer_) {\r\n clearTimeout(this.establishConnectionTimer_);\r\n }\r\n // NOTE: Even when timeout is 0, it's important to do a setTimeout to work around an infuriating \"Security Error\" in\r\n // Firefox when trying to write to our long-polling iframe in some scenarios (e.g. Forge or our unit tests).\r\n this.establishConnectionTimer_ = setTimeout(function () {\r\n _this.establishConnectionTimer_ = null;\r\n _this.establishConnection_();\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n }, Math.floor(timeout));\r\n };\r\n PersistentConnection.prototype.onVisible_ = function (visible) {\r\n // NOTE: Tabbing away and back to a window will defeat our reconnect backoff, but I think that's fine.\r\n if (visible &&\r\n !this.visible_ &&\r\n this.reconnectDelay_ === this.maxReconnectDelay_) {\r\n this.log_('Window became visible. Reducing delay.');\r\n this.reconnectDelay_ = RECONNECT_MIN_DELAY;\r\n if (!this.realtime_) {\r\n this.scheduleConnect_(0);\r\n }\r\n }\r\n this.visible_ = visible;\r\n };\r\n PersistentConnection.prototype.onOnline_ = function (online) {\r\n if (online) {\r\n this.log_('Browser went online.');\r\n this.reconnectDelay_ = RECONNECT_MIN_DELAY;\r\n if (!this.realtime_) {\r\n this.scheduleConnect_(0);\r\n }\r\n }\r\n else {\r\n this.log_('Browser went offline. Killing connection.');\r\n if (this.realtime_) {\r\n this.realtime_.close();\r\n }\r\n }\r\n };\r\n PersistentConnection.prototype.onRealtimeDisconnect_ = function () {\r\n this.log_('data client disconnected');\r\n this.connected_ = false;\r\n this.realtime_ = null;\r\n // Since we don't know if our sent transactions succeeded or not, we need to cancel them.\r\n this.cancelSentTransactions_();\r\n // Clear out the pending requests.\r\n this.requestCBHash_ = {};\r\n if (this.shouldReconnect_()) {\r\n if (!this.visible_) {\r\n this.log_(\"Window isn't visible. Delaying reconnect.\");\r\n this.reconnectDelay_ = this.maxReconnectDelay_;\r\n this.lastConnectionAttemptTime_ = new Date().getTime();\r\n }\r\n else if (this.lastConnectionEstablishedTime_) {\r\n // If we've been connected long enough, reset reconnect delay to minimum.\r\n var timeSinceLastConnectSucceeded = new Date().getTime() - this.lastConnectionEstablishedTime_;\r\n if (timeSinceLastConnectSucceeded > RECONNECT_DELAY_RESET_TIMEOUT) {\r\n this.reconnectDelay_ = RECONNECT_MIN_DELAY;\r\n }\r\n this.lastConnectionEstablishedTime_ = null;\r\n }\r\n var timeSinceLastConnectAttempt = new Date().getTime() - this.lastConnectionAttemptTime_;\r\n var reconnectDelay = Math.max(0, this.reconnectDelay_ - timeSinceLastConnectAttempt);\r\n reconnectDelay = Math.random() * reconnectDelay;\r\n this.log_('Trying to reconnect in ' + reconnectDelay + 'ms');\r\n this.scheduleConnect_(reconnectDelay);\r\n // Adjust reconnect delay for next time.\r\n this.reconnectDelay_ = Math.min(this.maxReconnectDelay_, this.reconnectDelay_ * RECONNECT_DELAY_MULTIPLIER);\r\n }\r\n this.onConnectStatus_(false);\r\n };\r\n PersistentConnection.prototype.establishConnection_ = function () {\r\n var _this = this;\r\n if (this.shouldReconnect_()) {\r\n this.log_('Making a connection attempt');\r\n this.lastConnectionAttemptTime_ = new Date().getTime();\r\n this.lastConnectionEstablishedTime_ = null;\r\n var onDataMessage_1 = this.onDataMessage_.bind(this);\r\n var onReady_1 = this.onReady_.bind(this);\r\n var onDisconnect_1 = this.onRealtimeDisconnect_.bind(this);\r\n var connId_1 = this.id + ':' + PersistentConnection.nextConnectionId_++;\r\n var self_1 = this;\r\n var lastSessionId_1 = this.lastSessionId;\r\n var canceled_1 = false;\r\n var connection_1 = null;\r\n var closeFn_1 = function () {\r\n if (connection_1) {\r\n connection_1.close();\r\n }\r\n else {\r\n canceled_1 = true;\r\n onDisconnect_1();\r\n }\r\n };\r\n var sendRequestFn = function (msg) {\r\n assert(connection_1, \"sendRequest call when we're not connected not allowed.\");\r\n connection_1.sendRequest(msg);\r\n };\r\n this.realtime_ = {\r\n close: closeFn_1,\r\n sendRequest: sendRequestFn\r\n };\r\n var forceRefresh = this.forceTokenRefresh_;\r\n this.forceTokenRefresh_ = false;\r\n // First fetch auth token, and establish connection after fetching the token was successful\r\n this.authTokenProvider_\r\n .getToken(forceRefresh)\r\n .then(function (result) {\r\n if (!canceled_1) {\r\n log('getToken() completed. Creating connection.');\r\n self_1.authToken_ = result && result.accessToken;\r\n connection_1 = new Connection(connId_1, self_1.repoInfo_, self_1.applicationId_, onDataMessage_1, onReady_1, onDisconnect_1, \r\n /* onKill= */ function (reason) {\r\n warn(reason + ' (' + self_1.repoInfo_.toString() + ')');\r\n self_1.interrupt(SERVER_KILL_INTERRUPT_REASON);\r\n }, lastSessionId_1);\r\n }\r\n else {\r\n log('getToken() completed but was canceled');\r\n }\r\n })\r\n .then(null, function (error) {\r\n self_1.log_('Failed to get token: ' + error);\r\n if (!canceled_1) {\r\n if (_this.repoInfo_.nodeAdmin) {\r\n // This may be a critical error for the Admin Node.js SDK, so log a warning.\r\n // But getToken() may also just have temporarily failed, so we still want to\r\n // continue retrying.\r\n warn(error);\r\n }\r\n closeFn_1();\r\n }\r\n });\r\n }\r\n };\r\n PersistentConnection.prototype.interrupt = function (reason) {\r\n log('Interrupting connection for reason: ' + reason);\r\n this.interruptReasons_[reason] = true;\r\n if (this.realtime_) {\r\n this.realtime_.close();\r\n }\r\n else {\r\n if (this.establishConnectionTimer_) {\r\n clearTimeout(this.establishConnectionTimer_);\r\n this.establishConnectionTimer_ = null;\r\n }\r\n if (this.connected_) {\r\n this.onRealtimeDisconnect_();\r\n }\r\n }\r\n };\r\n PersistentConnection.prototype.resume = function (reason) {\r\n log('Resuming connection for reason: ' + reason);\r\n delete this.interruptReasons_[reason];\r\n if (isEmpty(this.interruptReasons_)) {\r\n this.reconnectDelay_ = RECONNECT_MIN_DELAY;\r\n if (!this.realtime_) {\r\n this.scheduleConnect_(0);\r\n }\r\n }\r\n };\r\n PersistentConnection.prototype.handleTimestamp_ = function (timestamp) {\r\n var delta = timestamp - new Date().getTime();\r\n this.onServerInfoUpdate_({ serverTimeOffset: delta });\r\n };\r\n PersistentConnection.prototype.cancelSentTransactions_ = function () {\r\n for (var i = 0; i < this.outstandingPuts_.length; i++) {\r\n var put = this.outstandingPuts_[i];\r\n if (put && /*hash*/ 'h' in put.request && put.queued) {\r\n if (put.onComplete) {\r\n put.onComplete('disconnect');\r\n }\r\n delete this.outstandingPuts_[i];\r\n this.outstandingPutCount_--;\r\n }\r\n }\r\n // Clean up array occasionally.\r\n if (this.outstandingPutCount_ === 0) {\r\n this.outstandingPuts_ = [];\r\n }\r\n };\r\n PersistentConnection.prototype.onListenRevoked_ = function (pathString, query) {\r\n // Remove the listen and manufacture a \"permission_denied\" error for the failed listen.\r\n var queryId;\r\n if (!query) {\r\n queryId = 'default';\r\n }\r\n else {\r\n queryId = query.map(function (q) { return ObjectToUniqueKey(q); }).join('$');\r\n }\r\n var listen = this.removeListen_(pathString, queryId);\r\n if (listen && listen.onComplete) {\r\n listen.onComplete('permission_denied');\r\n }\r\n };\r\n PersistentConnection.prototype.removeListen_ = function (pathString, queryId) {\r\n var normalizedPathString = new Path(pathString).toString(); // normalize path.\r\n var listen;\r\n if (this.listens.has(normalizedPathString)) {\r\n var map = this.listens.get(normalizedPathString);\r\n listen = map.get(queryId);\r\n map.delete(queryId);\r\n if (map.size === 0) {\r\n this.listens.delete(normalizedPathString);\r\n }\r\n }\r\n else {\r\n // all listens for this path has already been removed\r\n listen = undefined;\r\n }\r\n return listen;\r\n };\r\n PersistentConnection.prototype.onAuthRevoked_ = function (statusCode, explanation) {\r\n log('Auth token revoked: ' + statusCode + '/' + explanation);\r\n this.authToken_ = null;\r\n this.forceTokenRefresh_ = true;\r\n this.realtime_.close();\r\n if (statusCode === 'invalid_token' || statusCode === 'permission_denied') {\r\n // We'll wait a couple times before logging the warning / increasing the\r\n // retry period since oauth tokens will report as \"invalid\" if they're\r\n // just expired. Plus there may be transient issues that resolve themselves.\r\n this.invalidAuthTokenCount_++;\r\n if (this.invalidAuthTokenCount_ >= INVALID_AUTH_TOKEN_THRESHOLD) {\r\n // Set a long reconnect delay because recovery is unlikely\r\n this.reconnectDelay_ = RECONNECT_MAX_DELAY_FOR_ADMINS;\r\n // Notify the auth token provider that the token is invalid, which will log\r\n // a warning\r\n this.authTokenProvider_.notifyForInvalidToken();\r\n }\r\n }\r\n };\r\n PersistentConnection.prototype.onSecurityDebugPacket_ = function (body) {\r\n if (this.securityDebugCallback_) {\r\n this.securityDebugCallback_(body);\r\n }\r\n else {\r\n if ('msg' in body) {\r\n console.log('FIREBASE: ' + body['msg'].replace('\\n', '\\nFIREBASE: '));\r\n }\r\n }\r\n };\r\n PersistentConnection.prototype.restoreState_ = function () {\r\n var e_1, _a, e_2, _b;\r\n //Re-authenticate ourselves if we have a credential stored.\r\n this.tryAuth();\r\n try {\r\n // Puts depend on having received the corresponding data update from the server before they complete, so we must\r\n // make sure to send listens before puts.\r\n for (var _c = __values(this.listens.values()), _d = _c.next(); !_d.done; _d = _c.next()) {\r\n var queries = _d.value;\r\n try {\r\n for (var _e = (e_2 = void 0, __values(queries.values())), _f = _e.next(); !_f.done; _f = _e.next()) {\r\n var listenSpec = _f.value;\r\n this.sendListen_(listenSpec);\r\n }\r\n }\r\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\r\n finally {\r\n try {\r\n if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\r\n }\r\n finally { if (e_2) throw e_2.error; }\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n for (var i = 0; i < this.outstandingPuts_.length; i++) {\r\n if (this.outstandingPuts_[i]) {\r\n this.sendPut_(i);\r\n }\r\n }\r\n while (this.onDisconnectRequestQueue_.length) {\r\n var request = this.onDisconnectRequestQueue_.shift();\r\n this.sendOnDisconnect_(request.action, request.pathString, request.data, request.onComplete);\r\n }\r\n };\r\n /**\r\n * Sends client stats for first connection\r\n */\r\n PersistentConnection.prototype.sendConnectStats_ = function () {\r\n var stats = {};\r\n var clientName = 'js';\r\n if (isNodeSdk()) {\r\n if (this.repoInfo_.nodeAdmin) {\r\n clientName = 'admin_node';\r\n }\r\n else {\r\n clientName = 'node';\r\n }\r\n }\r\n stats['sdk.' + clientName + '.' + SDK_VERSION.replace(/\\./g, '-')] = 1;\r\n if (isMobileCordova()) {\r\n stats['framework.cordova'] = 1;\r\n }\r\n else if (isReactNative()) {\r\n stats['framework.reactnative'] = 1;\r\n }\r\n this.reportStats(stats);\r\n };\r\n PersistentConnection.prototype.shouldReconnect_ = function () {\r\n var online = OnlineMonitor.getInstance().currentlyOnline();\r\n return isEmpty(this.interruptReasons_) && online;\r\n };\r\n PersistentConnection.nextPersistentConnectionId_ = 0;\r\n /**\r\n * Counter for number of connections created. Mainly used for tagging in the logs\r\n */\r\n PersistentConnection.nextConnectionId_ = 0;\r\n return PersistentConnection;\r\n}(ServerActions));\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An implementation of ServerActions that communicates with the server via REST requests.\r\n * This is mostly useful for compatibility with crawlers, where we don't want to spin up a full\r\n * persistent connection (using WebSockets or long-polling)\r\n */\r\nvar ReadonlyRestClient = /** @class */ (function (_super) {\r\n __extends(ReadonlyRestClient, _super);\r\n /**\r\n * @param {!RepoInfo} repoInfo_ Data about the namespace we are connecting to\r\n * @param {function(string, *, boolean, ?number)} onDataUpdate_ A callback for new data from the server\r\n * @param {AuthTokenProvider} authTokenProvider_\r\n * @implements {ServerActions}\r\n */\r\n function ReadonlyRestClient(repoInfo_, onDataUpdate_, authTokenProvider_) {\r\n var _this = _super.call(this) || this;\r\n _this.repoInfo_ = repoInfo_;\r\n _this.onDataUpdate_ = onDataUpdate_;\r\n _this.authTokenProvider_ = authTokenProvider_;\r\n /** @private {function(...[*])} */\r\n _this.log_ = logWrapper('p:rest:');\r\n /**\r\n * We don't actually need to track listens, except to prevent us calling an onComplete for a listen\r\n * that's been removed. :-/\r\n *\r\n * @private {!Object.<string, !Object>}\r\n */\r\n _this.listens_ = {};\r\n return _this;\r\n }\r\n ReadonlyRestClient.prototype.reportStats = function (stats) {\r\n throw new Error('Method not implemented.');\r\n };\r\n /**\r\n * @param {!Query} query\r\n * @param {?number=} tag\r\n * @return {string}\r\n * @private\r\n */\r\n ReadonlyRestClient.getListenId_ = function (query, tag) {\r\n if (tag !== undefined) {\r\n return 'tag$' + tag;\r\n }\r\n else {\r\n assert(query.getQueryParams().isDefault(), \"should have a tag if it's not a default query.\");\r\n return query.path.toString();\r\n }\r\n };\r\n /** @inheritDoc */\r\n ReadonlyRestClient.prototype.listen = function (query, currentHashFn, tag, onComplete) {\r\n var _this = this;\r\n var pathString = query.path.toString();\r\n this.log_('Listen called for ' + pathString + ' ' + query.queryIdentifier());\r\n // Mark this listener so we can tell if it's removed.\r\n var listenId = ReadonlyRestClient.getListenId_(query, tag);\r\n var thisListen = {};\r\n this.listens_[listenId] = thisListen;\r\n var queryStringParameters = query\r\n .getQueryParams()\r\n .toRestQueryStringParameters();\r\n this.restRequest_(pathString + '.json', queryStringParameters, function (error, result) {\r\n var data = result;\r\n if (error === 404) {\r\n data = null;\r\n error = null;\r\n }\r\n if (error === null) {\r\n _this.onDataUpdate_(pathString, data, /*isMerge=*/ false, tag);\r\n }\r\n if (safeGet(_this.listens_, listenId) === thisListen) {\r\n var status_1;\r\n if (!error) {\r\n status_1 = 'ok';\r\n }\r\n else if (error === 401) {\r\n status_1 = 'permission_denied';\r\n }\r\n else {\r\n status_1 = 'rest_error:' + error;\r\n }\r\n onComplete(status_1, null);\r\n }\r\n });\r\n };\r\n /** @inheritDoc */\r\n ReadonlyRestClient.prototype.unlisten = function (query, tag) {\r\n var listenId = ReadonlyRestClient.getListenId_(query, tag);\r\n delete this.listens_[listenId];\r\n };\r\n /** @inheritDoc */\r\n ReadonlyRestClient.prototype.refreshAuthToken = function (token) {\r\n // no-op since we just always call getToken.\r\n };\r\n /**\r\n * Performs a REST request to the given path, with the provided query string parameters,\r\n * and any auth credentials we have.\r\n *\r\n * @param {!string} pathString\r\n * @param {!Object.<string, *>} queryStringParameters\r\n * @param {?function(?number, *=)} callback\r\n * @private\r\n */\r\n ReadonlyRestClient.prototype.restRequest_ = function (pathString, queryStringParameters, callback) {\r\n var _this = this;\r\n if (queryStringParameters === void 0) { queryStringParameters = {}; }\r\n queryStringParameters['format'] = 'export';\r\n this.authTokenProvider_\r\n .getToken(/*forceRefresh=*/ false)\r\n .then(function (authTokenData) {\r\n var authToken = authTokenData && authTokenData.accessToken;\r\n if (authToken) {\r\n queryStringParameters['auth'] = authToken;\r\n }\r\n var url = (_this.repoInfo_.secure ? 'https://' : 'http://') +\r\n _this.repoInfo_.host +\r\n pathString +\r\n '?' +\r\n 'ns=' +\r\n _this.repoInfo_.namespace +\r\n querystring(queryStringParameters);\r\n _this.log_('Sending REST request for ' + url);\r\n var xhr = new XMLHttpRequest();\r\n xhr.onreadystatechange = function () {\r\n if (callback && xhr.readyState === 4) {\r\n _this.log_('REST Response for ' + url + ' received. status:', xhr.status, 'response:', xhr.responseText);\r\n var res = null;\r\n if (xhr.status >= 200 && xhr.status < 300) {\r\n try {\r\n res = jsonEval(xhr.responseText);\r\n }\r\n catch (e) {\r\n warn('Failed to parse JSON response for ' +\r\n url +\r\n ': ' +\r\n xhr.responseText);\r\n }\r\n callback(null, res);\r\n }\r\n else {\r\n // 401 and 404 are expected.\r\n if (xhr.status !== 401 && xhr.status !== 404) {\r\n warn('Got unsuccessful REST response for ' +\r\n url +\r\n ' Status: ' +\r\n xhr.status);\r\n }\r\n callback(xhr.status);\r\n }\r\n callback = null;\r\n }\r\n };\r\n xhr.open('GET', url, /*asynchronous=*/ true);\r\n xhr.send();\r\n });\r\n };\r\n return ReadonlyRestClient;\r\n}(ServerActions));\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar INTERRUPT_REASON = 'repo_interrupt';\r\n/**\r\n * A connection to a single data repository.\r\n */\r\nvar Repo = /** @class */ (function () {\r\n function Repo(repoInfo_, forceRestClient_, app, authTokenProvider_) {\r\n this.repoInfo_ = repoInfo_;\r\n this.forceRestClient_ = forceRestClient_;\r\n this.app = app;\r\n this.authTokenProvider_ = authTokenProvider_;\r\n this.dataUpdateCount = 0;\r\n this.statsListener_ = null;\r\n this.eventQueue_ = new EventQueue();\r\n this.nextWriteId_ = 1;\r\n this.interceptServerDataCallback_ = null;\r\n /** A list of data pieces and paths to be set when this client disconnects. */\r\n this.onDisconnect_ = new SparseSnapshotTree();\r\n // TODO: This should be @private but it's used by test_access.js and internal.js\r\n this.persistentConnection_ = null;\r\n // This key is intentionally not updated if RepoInfo is later changed or replaced\r\n this.key = this.repoInfo_.toURLString();\r\n }\r\n Repo.prototype.start = function () {\r\n var _this = this;\r\n this.stats_ = StatsManager.getCollection(this.repoInfo_);\r\n if (this.forceRestClient_ || beingCrawled()) {\r\n this.server_ = new ReadonlyRestClient(this.repoInfo_, this.onDataUpdate_.bind(this), this.authTokenProvider_);\r\n // Minor hack: Fire onConnect immediately, since there's no actual connection.\r\n setTimeout(this.onConnectStatus_.bind(this, true), 0);\r\n }\r\n else {\r\n var authOverride = this.app.options['databaseAuthVariableOverride'];\r\n // Validate authOverride\r\n if (typeof authOverride !== 'undefined' && authOverride !== null) {\r\n if (typeof authOverride !== 'object') {\r\n throw new Error('Only objects are supported for option databaseAuthVariableOverride');\r\n }\r\n try {\r\n stringify(authOverride);\r\n }\r\n catch (e) {\r\n throw new Error('Invalid authOverride provided: ' + e);\r\n }\r\n }\r\n this.persistentConnection_ = new PersistentConnection(this.repoInfo_, this.app.options.appId, this.onDataUpdate_.bind(this), this.onConnectStatus_.bind(this), this.onServerInfoUpdate_.bind(this), this.authTokenProvider_, authOverride);\r\n this.server_ = this.persistentConnection_;\r\n }\r\n this.authTokenProvider_.addTokenChangeListener(function (token) {\r\n _this.server_.refreshAuthToken(token);\r\n });\r\n // In the case of multiple Repos for the same repoInfo (i.e. there are multiple Firebase.Contexts being used),\r\n // we only want to create one StatsReporter. As such, we'll report stats over the first Repo created.\r\n this.statsReporter_ = StatsManager.getOrCreateReporter(this.repoInfo_, function () { return new StatsReporter(_this.stats_, _this.server_); });\r\n this.transactionsInit_();\r\n // Used for .info.\r\n this.infoData_ = new SnapshotHolder();\r\n this.infoSyncTree_ = new SyncTree({\r\n startListening: function (query, tag, currentHashFn, onComplete) {\r\n var infoEvents = [];\r\n var node = _this.infoData_.getNode(query.path);\r\n // This is possibly a hack, but we have different semantics for .info endpoints. We don't raise null events\r\n // on initial data...\r\n if (!node.isEmpty()) {\r\n infoEvents = _this.infoSyncTree_.applyServerOverwrite(query.path, node);\r\n setTimeout(function () {\r\n onComplete('ok');\r\n }, 0);\r\n }\r\n return infoEvents;\r\n },\r\n stopListening: function () { }\r\n });\r\n this.updateInfo_('connected', false);\r\n this.serverSyncTree_ = new SyncTree({\r\n startListening: function (query, tag, currentHashFn, onComplete) {\r\n _this.server_.listen(query, currentHashFn, tag, function (status, data) {\r\n var events = onComplete(status, data);\r\n _this.eventQueue_.raiseEventsForChangedPath(query.path, events);\r\n });\r\n // No synchronous events for network-backed sync trees\r\n return [];\r\n },\r\n stopListening: function (query, tag) {\r\n _this.server_.unlisten(query, tag);\r\n }\r\n });\r\n };\r\n /**\r\n * @return The URL corresponding to the root of this Firebase.\r\n */\r\n Repo.prototype.toString = function () {\r\n return ((this.repoInfo_.secure ? 'https://' : 'http://') + this.repoInfo_.host);\r\n };\r\n /**\r\n * @return The namespace represented by the repo.\r\n */\r\n Repo.prototype.name = function () {\r\n return this.repoInfo_.namespace;\r\n };\r\n /**\r\n * @return The time in milliseconds, taking the server offset into account if we have one.\r\n */\r\n Repo.prototype.serverTime = function () {\r\n var offsetNode = this.infoData_.getNode(new Path('.info/serverTimeOffset'));\r\n var offset = offsetNode.val() || 0;\r\n return new Date().getTime() + offset;\r\n };\r\n /**\r\n * Generate ServerValues using some variables from the repo object.\r\n */\r\n Repo.prototype.generateServerValues = function () {\r\n return generateWithValues({\r\n timestamp: this.serverTime()\r\n });\r\n };\r\n /**\r\n * Called by realtime when we get new messages from the server.\r\n */\r\n Repo.prototype.onDataUpdate_ = function (pathString, data, isMerge, tag) {\r\n // For testing.\r\n this.dataUpdateCount++;\r\n var path = new Path(pathString);\r\n data = this.interceptServerDataCallback_\r\n ? this.interceptServerDataCallback_(pathString, data)\r\n : data;\r\n var events = [];\r\n if (tag) {\r\n if (isMerge) {\r\n var taggedChildren = map(data, function (raw) { return nodeFromJSON$1(raw); });\r\n events = this.serverSyncTree_.applyTaggedQueryMerge(path, taggedChildren, tag);\r\n }\r\n else {\r\n var taggedSnap = nodeFromJSON$1(data);\r\n events = this.serverSyncTree_.applyTaggedQueryOverwrite(path, taggedSnap, tag);\r\n }\r\n }\r\n else if (isMerge) {\r\n var changedChildren = map(data, function (raw) { return nodeFromJSON$1(raw); });\r\n events = this.serverSyncTree_.applyServerMerge(path, changedChildren);\r\n }\r\n else {\r\n var snap = nodeFromJSON$1(data);\r\n events = this.serverSyncTree_.applyServerOverwrite(path, snap);\r\n }\r\n var affectedPath = path;\r\n if (events.length > 0) {\r\n // Since we have a listener outstanding for each transaction, receiving any events\r\n // is a proxy for some change having occurred.\r\n affectedPath = this.rerunTransactions_(path);\r\n }\r\n this.eventQueue_.raiseEventsForChangedPath(affectedPath, events);\r\n };\r\n // TODO: This should be @private but it's used by test_access.js and internal.js\r\n Repo.prototype.interceptServerData_ = function (callback) {\r\n this.interceptServerDataCallback_ = callback;\r\n };\r\n Repo.prototype.onConnectStatus_ = function (connectStatus) {\r\n this.updateInfo_('connected', connectStatus);\r\n if (connectStatus === false) {\r\n this.runOnDisconnectEvents_();\r\n }\r\n };\r\n Repo.prototype.onServerInfoUpdate_ = function (updates) {\r\n var _this = this;\r\n each(updates, function (key, value) {\r\n _this.updateInfo_(key, value);\r\n });\r\n };\r\n Repo.prototype.updateInfo_ = function (pathString, value) {\r\n var path = new Path('/.info/' + pathString);\r\n var newNode = nodeFromJSON$1(value);\r\n this.infoData_.updateSnapshot(path, newNode);\r\n var events = this.infoSyncTree_.applyServerOverwrite(path, newNode);\r\n this.eventQueue_.raiseEventsForChangedPath(path, events);\r\n };\r\n Repo.prototype.getNextWriteId_ = function () {\r\n return this.nextWriteId_++;\r\n };\r\n Repo.prototype.setWithPriority = function (path, newVal, newPriority, onComplete) {\r\n var _this = this;\r\n this.log_('set', {\r\n path: path.toString(),\r\n value: newVal,\r\n priority: newPriority\r\n });\r\n // TODO: Optimize this behavior to either (a) store flag to skip resolving where possible and / or\r\n // (b) store unresolved paths on JSON parse\r\n var serverValues = this.generateServerValues();\r\n var newNodeUnresolved = nodeFromJSON$1(newVal, newPriority);\r\n var existing = this.serverSyncTree_.calcCompleteEventCache(path);\r\n var newNode = resolveDeferredValueSnapshot(newNodeUnresolved, existing, serverValues);\r\n var writeId = this.getNextWriteId_();\r\n var events = this.serverSyncTree_.applyUserOverwrite(path, newNode, writeId, true);\r\n this.eventQueue_.queueEvents(events);\r\n this.server_.put(path.toString(), newNodeUnresolved.val(/*export=*/ true), function (status, errorReason) {\r\n var success = status === 'ok';\r\n if (!success) {\r\n warn('set at ' + path + ' failed: ' + status);\r\n }\r\n var clearEvents = _this.serverSyncTree_.ackUserWrite(writeId, !success);\r\n _this.eventQueue_.raiseEventsForChangedPath(path, clearEvents);\r\n _this.callOnCompleteCallback(onComplete, status, errorReason);\r\n });\r\n var affectedPath = this.abortTransactions_(path);\r\n this.rerunTransactions_(affectedPath);\r\n // We queued the events above, so just flush the queue here\r\n this.eventQueue_.raiseEventsForChangedPath(affectedPath, []);\r\n };\r\n Repo.prototype.update = function (path, childrenToMerge, onComplete) {\r\n var _this = this;\r\n this.log_('update', { path: path.toString(), value: childrenToMerge });\r\n // Start with our existing data and merge each child into it.\r\n var empty = true;\r\n var serverValues = this.generateServerValues();\r\n var changedChildren = {};\r\n each(childrenToMerge, function (changedKey, changedValue) {\r\n empty = false;\r\n changedChildren[changedKey] = resolveDeferredValueTree(path.child(changedKey), nodeFromJSON$1(changedValue), _this.serverSyncTree_, serverValues);\r\n });\r\n if (!empty) {\r\n var writeId_1 = this.getNextWriteId_();\r\n var events = this.serverSyncTree_.applyUserMerge(path, changedChildren, writeId_1);\r\n this.eventQueue_.queueEvents(events);\r\n this.server_.merge(path.toString(), childrenToMerge, function (status, errorReason) {\r\n var success = status === 'ok';\r\n if (!success) {\r\n warn('update at ' + path + ' failed: ' + status);\r\n }\r\n var clearEvents = _this.serverSyncTree_.ackUserWrite(writeId_1, !success);\r\n var affectedPath = clearEvents.length > 0 ? _this.rerunTransactions_(path) : path;\r\n _this.eventQueue_.raiseEventsForChangedPath(affectedPath, clearEvents);\r\n _this.callOnCompleteCallback(onComplete, status, errorReason);\r\n });\r\n each(childrenToMerge, function (changedPath) {\r\n var affectedPath = _this.abortTransactions_(path.child(changedPath));\r\n _this.rerunTransactions_(affectedPath);\r\n });\r\n // We queued the events above, so just flush the queue here\r\n this.eventQueue_.raiseEventsForChangedPath(path, []);\r\n }\r\n else {\r\n log(\"update() called with empty data. Don't do anything.\");\r\n this.callOnCompleteCallback(onComplete, 'ok');\r\n }\r\n };\r\n /**\r\n * Applies all of the changes stored up in the onDisconnect_ tree.\r\n */\r\n Repo.prototype.runOnDisconnectEvents_ = function () {\r\n var _this = this;\r\n this.log_('onDisconnectEvents');\r\n var serverValues = this.generateServerValues();\r\n var resolvedOnDisconnectTree = new SparseSnapshotTree();\r\n this.onDisconnect_.forEachTree(Path.Empty, function (path, node) {\r\n var resolved = resolveDeferredValueTree(path, node, _this.serverSyncTree_, serverValues);\r\n resolvedOnDisconnectTree.remember(path, resolved);\r\n });\r\n var events = [];\r\n resolvedOnDisconnectTree.forEachTree(Path.Empty, function (path, snap) {\r\n events = events.concat(_this.serverSyncTree_.applyServerOverwrite(path, snap));\r\n var affectedPath = _this.abortTransactions_(path);\r\n _this.rerunTransactions_(affectedPath);\r\n });\r\n this.onDisconnect_ = new SparseSnapshotTree();\r\n this.eventQueue_.raiseEventsForChangedPath(Path.Empty, events);\r\n };\r\n Repo.prototype.onDisconnectCancel = function (path, onComplete) {\r\n var _this = this;\r\n this.server_.onDisconnectCancel(path.toString(), function (status, errorReason) {\r\n if (status === 'ok') {\r\n _this.onDisconnect_.forget(path);\r\n }\r\n _this.callOnCompleteCallback(onComplete, status, errorReason);\r\n });\r\n };\r\n Repo.prototype.onDisconnectSet = function (path, value, onComplete) {\r\n var _this = this;\r\n var newNode = nodeFromJSON$1(value);\r\n this.server_.onDisconnectPut(path.toString(), newNode.val(/*export=*/ true), function (status, errorReason) {\r\n if (status === 'ok') {\r\n _this.onDisconnect_.remember(path, newNode);\r\n }\r\n _this.callOnCompleteCallback(onComplete, status, errorReason);\r\n });\r\n };\r\n Repo.prototype.onDisconnectSetWithPriority = function (path, value, priority, onComplete) {\r\n var _this = this;\r\n var newNode = nodeFromJSON$1(value, priority);\r\n this.server_.onDisconnectPut(path.toString(), newNode.val(/*export=*/ true), function (status, errorReason) {\r\n if (status === 'ok') {\r\n _this.onDisconnect_.remember(path, newNode);\r\n }\r\n _this.callOnCompleteCallback(onComplete, status, errorReason);\r\n });\r\n };\r\n Repo.prototype.onDisconnectUpdate = function (path, childrenToMerge, onComplete) {\r\n var _this = this;\r\n if (isEmpty(childrenToMerge)) {\r\n log(\"onDisconnect().update() called with empty data. Don't do anything.\");\r\n this.callOnCompleteCallback(onComplete, 'ok');\r\n return;\r\n }\r\n this.server_.onDisconnectMerge(path.toString(), childrenToMerge, function (status, errorReason) {\r\n if (status === 'ok') {\r\n each(childrenToMerge, function (childName, childNode) {\r\n var newChildNode = nodeFromJSON$1(childNode);\r\n _this.onDisconnect_.remember(path.child(childName), newChildNode);\r\n });\r\n }\r\n _this.callOnCompleteCallback(onComplete, status, errorReason);\r\n });\r\n };\r\n Repo.prototype.addEventCallbackForQuery = function (query, eventRegistration) {\r\n var events;\r\n if (query.path.getFront() === '.info') {\r\n events = this.infoSyncTree_.addEventRegistration(query, eventRegistration);\r\n }\r\n else {\r\n events = this.serverSyncTree_.addEventRegistration(query, eventRegistration);\r\n }\r\n this.eventQueue_.raiseEventsAtPath(query.path, events);\r\n };\r\n Repo.prototype.removeEventCallbackForQuery = function (query, eventRegistration) {\r\n // These are guaranteed not to raise events, since we're not passing in a cancelError. However, we can future-proof\r\n // a little bit by handling the return values anyways.\r\n var events;\r\n if (query.path.getFront() === '.info') {\r\n events = this.infoSyncTree_.removeEventRegistration(query, eventRegistration);\r\n }\r\n else {\r\n events = this.serverSyncTree_.removeEventRegistration(query, eventRegistration);\r\n }\r\n this.eventQueue_.raiseEventsAtPath(query.path, events);\r\n };\r\n Repo.prototype.interrupt = function () {\r\n if (this.persistentConnection_) {\r\n this.persistentConnection_.interrupt(INTERRUPT_REASON);\r\n }\r\n };\r\n Repo.prototype.resume = function () {\r\n if (this.persistentConnection_) {\r\n this.persistentConnection_.resume(INTERRUPT_REASON);\r\n }\r\n };\r\n Repo.prototype.stats = function (showDelta) {\r\n if (showDelta === void 0) { showDelta = false; }\r\n if (typeof console === 'undefined') {\r\n return;\r\n }\r\n var stats;\r\n if (showDelta) {\r\n if (!this.statsListener_) {\r\n this.statsListener_ = new StatsListener(this.stats_);\r\n }\r\n stats = this.statsListener_.get();\r\n }\r\n else {\r\n stats = this.stats_.get();\r\n }\r\n var longestName = Object.keys(stats).reduce(function (previousValue, currentValue) {\r\n return Math.max(currentValue.length, previousValue);\r\n }, 0);\r\n each(stats, function (stat, value) {\r\n var paddedStat = stat;\r\n // pad stat names to be the same length (plus 2 extra spaces).\r\n for (var i = stat.length; i < longestName + 2; i++) {\r\n paddedStat += ' ';\r\n }\r\n console.log(paddedStat + value);\r\n });\r\n };\r\n Repo.prototype.statsIncrementCounter = function (metric) {\r\n this.stats_.incrementCounter(metric);\r\n this.statsReporter_.includeStat(metric);\r\n };\r\n Repo.prototype.log_ = function () {\r\n var varArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n varArgs[_i] = arguments[_i];\r\n }\r\n var prefix = '';\r\n if (this.persistentConnection_) {\r\n prefix = this.persistentConnection_.id + ':';\r\n }\r\n log.apply(void 0, __spread([prefix], varArgs));\r\n };\r\n Repo.prototype.callOnCompleteCallback = function (callback, status, errorReason) {\r\n if (callback) {\r\n exceptionGuard(function () {\r\n if (status === 'ok') {\r\n callback(null);\r\n }\r\n else {\r\n var code = (status || 'error').toUpperCase();\r\n var message = code;\r\n if (errorReason) {\r\n message += ': ' + errorReason;\r\n }\r\n var error = new Error(message);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n error.code = code;\r\n callback(error);\r\n }\r\n });\r\n }\r\n };\r\n Object.defineProperty(Repo.prototype, \"database\", {\r\n get: function () {\r\n return this.__database || (this.__database = new Database(this));\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return Repo;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Filters nodes by range and uses an IndexFilter to track any changes after filtering the node\r\n *\r\n * @constructor\r\n * @implements {NodeFilter}\r\n */\r\nvar RangedFilter = /** @class */ (function () {\r\n /**\r\n * @param {!QueryParams} params\r\n */\r\n function RangedFilter(params) {\r\n this.indexedFilter_ = new IndexedFilter(params.getIndex());\r\n this.index_ = params.getIndex();\r\n this.startPost_ = RangedFilter.getStartPost_(params);\r\n this.endPost_ = RangedFilter.getEndPost_(params);\r\n }\r\n /**\r\n * @return {!NamedNode}\r\n */\r\n RangedFilter.prototype.getStartPost = function () {\r\n return this.startPost_;\r\n };\r\n /**\r\n * @return {!NamedNode}\r\n */\r\n RangedFilter.prototype.getEndPost = function () {\r\n return this.endPost_;\r\n };\r\n /**\r\n * @param {!NamedNode} node\r\n * @return {boolean}\r\n */\r\n RangedFilter.prototype.matches = function (node) {\r\n return (this.index_.compare(this.getStartPost(), node) <= 0 &&\r\n this.index_.compare(node, this.getEndPost()) <= 0);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n RangedFilter.prototype.updateChild = function (snap, key, newChild, affectedPath, source, optChangeAccumulator) {\r\n if (!this.matches(new NamedNode(key, newChild))) {\r\n newChild = ChildrenNode.EMPTY_NODE;\r\n }\r\n return this.indexedFilter_.updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n RangedFilter.prototype.updateFullNode = function (oldSnap, newSnap, optChangeAccumulator) {\r\n if (newSnap.isLeafNode()) {\r\n // Make sure we have a children node with the correct index, not a leaf node;\r\n newSnap = ChildrenNode.EMPTY_NODE;\r\n }\r\n var filtered = newSnap.withIndex(this.index_);\r\n // Don't support priorities on queries\r\n filtered = filtered.updatePriority(ChildrenNode.EMPTY_NODE);\r\n var self = this;\r\n newSnap.forEachChild(PRIORITY_INDEX, function (key, childNode) {\r\n if (!self.matches(new NamedNode(key, childNode))) {\r\n filtered = filtered.updateImmediateChild(key, ChildrenNode.EMPTY_NODE);\r\n }\r\n });\r\n return this.indexedFilter_.updateFullNode(oldSnap, filtered, optChangeAccumulator);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n RangedFilter.prototype.updatePriority = function (oldSnap, newPriority) {\r\n // Don't support priorities on queries\r\n return oldSnap;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n RangedFilter.prototype.filtersNodes = function () {\r\n return true;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n RangedFilter.prototype.getIndexedFilter = function () {\r\n return this.indexedFilter_;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n RangedFilter.prototype.getIndex = function () {\r\n return this.index_;\r\n };\r\n /**\r\n * @param {!QueryParams} params\r\n * @return {!NamedNode}\r\n * @private\r\n */\r\n RangedFilter.getStartPost_ = function (params) {\r\n if (params.hasStart()) {\r\n var startName = params.getIndexStartName();\r\n return params.getIndex().makePost(params.getIndexStartValue(), startName);\r\n }\r\n else {\r\n return params.getIndex().minPost();\r\n }\r\n };\r\n /**\r\n * @param {!QueryParams} params\r\n * @return {!NamedNode}\r\n * @private\r\n */\r\n RangedFilter.getEndPost_ = function (params) {\r\n if (params.hasEnd()) {\r\n var endName = params.getIndexEndName();\r\n return params.getIndex().makePost(params.getIndexEndValue(), endName);\r\n }\r\n else {\r\n return params.getIndex().maxPost();\r\n }\r\n };\r\n return RangedFilter;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Applies a limit and a range to a node and uses RangedFilter to do the heavy lifting where possible\r\n *\r\n * @constructor\r\n * @implements {NodeFilter}\r\n */\r\nvar LimitedFilter = /** @class */ (function () {\r\n /**\r\n * @param {!QueryParams} params\r\n */\r\n function LimitedFilter(params) {\r\n this.rangedFilter_ = new RangedFilter(params);\r\n this.index_ = params.getIndex();\r\n this.limit_ = params.getLimit();\r\n this.reverse_ = !params.isViewFromLeft();\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n LimitedFilter.prototype.updateChild = function (snap, key, newChild, affectedPath, source, optChangeAccumulator) {\r\n if (!this.rangedFilter_.matches(new NamedNode(key, newChild))) {\r\n newChild = ChildrenNode.EMPTY_NODE;\r\n }\r\n if (snap.getImmediateChild(key).equals(newChild)) {\r\n // No change\r\n return snap;\r\n }\r\n else if (snap.numChildren() < this.limit_) {\r\n return this.rangedFilter_\r\n .getIndexedFilter()\r\n .updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator);\r\n }\r\n else {\r\n return this.fullLimitUpdateChild_(snap, key, newChild, source, optChangeAccumulator);\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LimitedFilter.prototype.updateFullNode = function (oldSnap, newSnap, optChangeAccumulator) {\r\n var filtered;\r\n if (newSnap.isLeafNode() || newSnap.isEmpty()) {\r\n // Make sure we have a children node with the correct index, not a leaf node;\r\n filtered = ChildrenNode.EMPTY_NODE.withIndex(this.index_);\r\n }\r\n else {\r\n if (this.limit_ * 2 < newSnap.numChildren() &&\r\n newSnap.isIndexed(this.index_)) {\r\n // Easier to build up a snapshot, since what we're given has more than twice the elements we want\r\n filtered = ChildrenNode.EMPTY_NODE.withIndex(this.index_);\r\n // anchor to the startPost, endPost, or last element as appropriate\r\n var iterator = void 0;\r\n if (this.reverse_) {\r\n iterator = newSnap.getReverseIteratorFrom(this.rangedFilter_.getEndPost(), this.index_);\r\n }\r\n else {\r\n iterator = newSnap.getIteratorFrom(this.rangedFilter_.getStartPost(), this.index_);\r\n }\r\n var count = 0;\r\n while (iterator.hasNext() && count < this.limit_) {\r\n var next = iterator.getNext();\r\n var inRange = void 0;\r\n if (this.reverse_) {\r\n inRange =\r\n this.index_.compare(this.rangedFilter_.getStartPost(), next) <= 0;\r\n }\r\n else {\r\n inRange =\r\n this.index_.compare(next, this.rangedFilter_.getEndPost()) <= 0;\r\n }\r\n if (inRange) {\r\n filtered = filtered.updateImmediateChild(next.name, next.node);\r\n count++;\r\n }\r\n else {\r\n // if we have reached the end post, we cannot keep adding elemments\r\n break;\r\n }\r\n }\r\n }\r\n else {\r\n // The snap contains less than twice the limit. Faster to delete from the snap than build up a new one\r\n filtered = newSnap.withIndex(this.index_);\r\n // Don't support priorities on queries\r\n filtered = filtered.updatePriority(ChildrenNode.EMPTY_NODE);\r\n var startPost = void 0;\r\n var endPost = void 0;\r\n var cmp = void 0;\r\n var iterator = void 0;\r\n if (this.reverse_) {\r\n iterator = filtered.getReverseIterator(this.index_);\r\n startPost = this.rangedFilter_.getEndPost();\r\n endPost = this.rangedFilter_.getStartPost();\r\n var indexCompare_1 = this.index_.getCompare();\r\n cmp = function (a, b) { return indexCompare_1(b, a); };\r\n }\r\n else {\r\n iterator = filtered.getIterator(this.index_);\r\n startPost = this.rangedFilter_.getStartPost();\r\n endPost = this.rangedFilter_.getEndPost();\r\n cmp = this.index_.getCompare();\r\n }\r\n var count = 0;\r\n var foundStartPost = false;\r\n while (iterator.hasNext()) {\r\n var next = iterator.getNext();\r\n if (!foundStartPost && cmp(startPost, next) <= 0) {\r\n // start adding\r\n foundStartPost = true;\r\n }\r\n var inRange = foundStartPost && count < this.limit_ && cmp(next, endPost) <= 0;\r\n if (inRange) {\r\n count++;\r\n }\r\n else {\r\n filtered = filtered.updateImmediateChild(next.name, ChildrenNode.EMPTY_NODE);\r\n }\r\n }\r\n }\r\n }\r\n return this.rangedFilter_\r\n .getIndexedFilter()\r\n .updateFullNode(oldSnap, filtered, optChangeAccumulator);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LimitedFilter.prototype.updatePriority = function (oldSnap, newPriority) {\r\n // Don't support priorities on queries\r\n return oldSnap;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LimitedFilter.prototype.filtersNodes = function () {\r\n return true;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LimitedFilter.prototype.getIndexedFilter = function () {\r\n return this.rangedFilter_.getIndexedFilter();\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LimitedFilter.prototype.getIndex = function () {\r\n return this.index_;\r\n };\r\n /**\r\n * @param {!Node} snap\r\n * @param {string} childKey\r\n * @param {!Node} childSnap\r\n * @param {!CompleteChildSource} source\r\n * @param {?ChildChangeAccumulator} changeAccumulator\r\n * @return {!Node}\r\n * @private\r\n */\r\n LimitedFilter.prototype.fullLimitUpdateChild_ = function (snap, childKey, childSnap, source, changeAccumulator) {\r\n // TODO: rename all cache stuff etc to general snap terminology\r\n var cmp;\r\n if (this.reverse_) {\r\n var indexCmp_1 = this.index_.getCompare();\r\n cmp = function (a, b) { return indexCmp_1(b, a); };\r\n }\r\n else {\r\n cmp = this.index_.getCompare();\r\n }\r\n var oldEventCache = snap;\r\n assert(oldEventCache.numChildren() === this.limit_, '');\r\n var newChildNamedNode = new NamedNode(childKey, childSnap);\r\n var windowBoundary = this.reverse_\r\n ? oldEventCache.getFirstChild(this.index_)\r\n : oldEventCache.getLastChild(this.index_);\r\n var inRange = this.rangedFilter_.matches(newChildNamedNode);\r\n if (oldEventCache.hasChild(childKey)) {\r\n var oldChildSnap = oldEventCache.getImmediateChild(childKey);\r\n var nextChild = source.getChildAfterChild(this.index_, windowBoundary, this.reverse_);\r\n while (nextChild != null &&\r\n (nextChild.name === childKey || oldEventCache.hasChild(nextChild.name))) {\r\n // There is a weird edge case where a node is updated as part of a merge in the write tree, but hasn't\r\n // been applied to the limited filter yet. Ignore this next child which will be updated later in\r\n // the limited filter...\r\n nextChild = source.getChildAfterChild(this.index_, nextChild, this.reverse_);\r\n }\r\n var compareNext = nextChild == null ? 1 : cmp(nextChild, newChildNamedNode);\r\n var remainsInWindow = inRange && !childSnap.isEmpty() && compareNext >= 0;\r\n if (remainsInWindow) {\r\n if (changeAccumulator != null) {\r\n changeAccumulator.trackChildChange(Change.childChangedChange(childKey, childSnap, oldChildSnap));\r\n }\r\n return oldEventCache.updateImmediateChild(childKey, childSnap);\r\n }\r\n else {\r\n if (changeAccumulator != null) {\r\n changeAccumulator.trackChildChange(Change.childRemovedChange(childKey, oldChildSnap));\r\n }\r\n var newEventCache = oldEventCache.updateImmediateChild(childKey, ChildrenNode.EMPTY_NODE);\r\n var nextChildInRange = nextChild != null && this.rangedFilter_.matches(nextChild);\r\n if (nextChildInRange) {\r\n if (changeAccumulator != null) {\r\n changeAccumulator.trackChildChange(Change.childAddedChange(nextChild.name, nextChild.node));\r\n }\r\n return newEventCache.updateImmediateChild(nextChild.name, nextChild.node);\r\n }\r\n else {\r\n return newEventCache;\r\n }\r\n }\r\n }\r\n else if (childSnap.isEmpty()) {\r\n // we're deleting a node, but it was not in the window, so ignore it\r\n return snap;\r\n }\r\n else if (inRange) {\r\n if (cmp(windowBoundary, newChildNamedNode) >= 0) {\r\n if (changeAccumulator != null) {\r\n changeAccumulator.trackChildChange(Change.childRemovedChange(windowBoundary.name, windowBoundary.node));\r\n changeAccumulator.trackChildChange(Change.childAddedChange(childKey, childSnap));\r\n }\r\n return oldEventCache\r\n .updateImmediateChild(childKey, childSnap)\r\n .updateImmediateChild(windowBoundary.name, ChildrenNode.EMPTY_NODE);\r\n }\r\n else {\r\n return snap;\r\n }\r\n }\r\n else {\r\n return snap;\r\n }\r\n };\r\n return LimitedFilter;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * This class is an immutable-from-the-public-api struct containing a set of query parameters defining a\r\n * range to be returned for a particular location. It is assumed that validation of parameters is done at the\r\n * user-facing API level, so it is not done here.\r\n * @constructor\r\n */\r\nvar QueryParams = /** @class */ (function () {\r\n function QueryParams() {\r\n this.limitSet_ = false;\r\n this.startSet_ = false;\r\n this.startNameSet_ = false;\r\n this.endSet_ = false;\r\n this.endNameSet_ = false;\r\n this.limit_ = 0;\r\n this.viewFrom_ = '';\r\n this.indexStartValue_ = null;\r\n this.indexStartName_ = '';\r\n this.indexEndValue_ = null;\r\n this.indexEndName_ = '';\r\n this.index_ = PRIORITY_INDEX;\r\n }\r\n /**\r\n * @return {boolean}\r\n */\r\n QueryParams.prototype.hasStart = function () {\r\n return this.startSet_;\r\n };\r\n /**\r\n * @return {boolean} True if it would return from left.\r\n */\r\n QueryParams.prototype.isViewFromLeft = function () {\r\n if (this.viewFrom_ === '') {\r\n // limit(), rather than limitToFirst or limitToLast was called.\r\n // This means that only one of startSet_ and endSet_ is true. Use them\r\n // to calculate which side of the view to anchor to. If neither is set,\r\n // anchor to the end.\r\n return this.startSet_;\r\n }\r\n else {\r\n return (this.viewFrom_ === QueryParams.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT);\r\n }\r\n };\r\n /**\r\n * Only valid to call if hasStart() returns true\r\n * @return {*}\r\n */\r\n QueryParams.prototype.getIndexStartValue = function () {\r\n assert(this.startSet_, 'Only valid if start has been set');\r\n return this.indexStartValue_;\r\n };\r\n /**\r\n * Only valid to call if hasStart() returns true.\r\n * Returns the starting key name for the range defined by these query parameters\r\n * @return {!string}\r\n */\r\n QueryParams.prototype.getIndexStartName = function () {\r\n assert(this.startSet_, 'Only valid if start has been set');\r\n if (this.startNameSet_) {\r\n return this.indexStartName_;\r\n }\r\n else {\r\n return MIN_NAME;\r\n }\r\n };\r\n /**\r\n * @return {boolean}\r\n */\r\n QueryParams.prototype.hasEnd = function () {\r\n return this.endSet_;\r\n };\r\n /**\r\n * Only valid to call if hasEnd() returns true.\r\n * @return {*}\r\n */\r\n QueryParams.prototype.getIndexEndValue = function () {\r\n assert(this.endSet_, 'Only valid if end has been set');\r\n return this.indexEndValue_;\r\n };\r\n /**\r\n * Only valid to call if hasEnd() returns true.\r\n * Returns the end key name for the range defined by these query parameters\r\n * @return {!string}\r\n */\r\n QueryParams.prototype.getIndexEndName = function () {\r\n assert(this.endSet_, 'Only valid if end has been set');\r\n if (this.endNameSet_) {\r\n return this.indexEndName_;\r\n }\r\n else {\r\n return MAX_NAME;\r\n }\r\n };\r\n /**\r\n * @return {boolean}\r\n */\r\n QueryParams.prototype.hasLimit = function () {\r\n return this.limitSet_;\r\n };\r\n /**\r\n * @return {boolean} True if a limit has been set and it has been explicitly anchored\r\n */\r\n QueryParams.prototype.hasAnchoredLimit = function () {\r\n return this.limitSet_ && this.viewFrom_ !== '';\r\n };\r\n /**\r\n * Only valid to call if hasLimit() returns true\r\n * @return {!number}\r\n */\r\n QueryParams.prototype.getLimit = function () {\r\n assert(this.limitSet_, 'Only valid if limit has been set');\r\n return this.limit_;\r\n };\r\n /**\r\n * @return {!Index}\r\n */\r\n QueryParams.prototype.getIndex = function () {\r\n return this.index_;\r\n };\r\n /**\r\n * @return {!QueryParams}\r\n * @private\r\n */\r\n QueryParams.prototype.copy_ = function () {\r\n var copy = new QueryParams();\r\n copy.limitSet_ = this.limitSet_;\r\n copy.limit_ = this.limit_;\r\n copy.startSet_ = this.startSet_;\r\n copy.indexStartValue_ = this.indexStartValue_;\r\n copy.startNameSet_ = this.startNameSet_;\r\n copy.indexStartName_ = this.indexStartName_;\r\n copy.endSet_ = this.endSet_;\r\n copy.indexEndValue_ = this.indexEndValue_;\r\n copy.endNameSet_ = this.endNameSet_;\r\n copy.indexEndName_ = this.indexEndName_;\r\n copy.index_ = this.index_;\r\n copy.viewFrom_ = this.viewFrom_;\r\n return copy;\r\n };\r\n /**\r\n * @param {!number} newLimit\r\n * @return {!QueryParams}\r\n */\r\n QueryParams.prototype.limit = function (newLimit) {\r\n var newParams = this.copy_();\r\n newParams.limitSet_ = true;\r\n newParams.limit_ = newLimit;\r\n newParams.viewFrom_ = '';\r\n return newParams;\r\n };\r\n /**\r\n * @param {!number} newLimit\r\n * @return {!QueryParams}\r\n */\r\n QueryParams.prototype.limitToFirst = function (newLimit) {\r\n var newParams = this.copy_();\r\n newParams.limitSet_ = true;\r\n newParams.limit_ = newLimit;\r\n newParams.viewFrom_ = QueryParams.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT;\r\n return newParams;\r\n };\r\n /**\r\n * @param {!number} newLimit\r\n * @return {!QueryParams}\r\n */\r\n QueryParams.prototype.limitToLast = function (newLimit) {\r\n var newParams = this.copy_();\r\n newParams.limitSet_ = true;\r\n newParams.limit_ = newLimit;\r\n newParams.viewFrom_ = QueryParams.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_RIGHT;\r\n return newParams;\r\n };\r\n /**\r\n * @param {*} indexValue\r\n * @param {?string=} key\r\n * @return {!QueryParams}\r\n */\r\n QueryParams.prototype.startAt = function (indexValue, key) {\r\n var newParams = this.copy_();\r\n newParams.startSet_ = true;\r\n if (indexValue === undefined) {\r\n indexValue = null;\r\n }\r\n newParams.indexStartValue_ = indexValue;\r\n if (key != null) {\r\n newParams.startNameSet_ = true;\r\n newParams.indexStartName_ = key;\r\n }\r\n else {\r\n newParams.startNameSet_ = false;\r\n newParams.indexStartName_ = '';\r\n }\r\n return newParams;\r\n };\r\n /**\r\n * @param {*} indexValue\r\n * @param {?string=} key\r\n * @return {!QueryParams}\r\n */\r\n QueryParams.prototype.endAt = function (indexValue, key) {\r\n var newParams = this.copy_();\r\n newParams.endSet_ = true;\r\n if (indexValue === undefined) {\r\n indexValue = null;\r\n }\r\n newParams.indexEndValue_ = indexValue;\r\n if (key !== undefined) {\r\n newParams.endNameSet_ = true;\r\n newParams.indexEndName_ = key;\r\n }\r\n else {\r\n newParams.endNameSet_ = false;\r\n newParams.indexEndName_ = '';\r\n }\r\n return newParams;\r\n };\r\n /**\r\n * @param {!Index} index\r\n * @return {!QueryParams}\r\n */\r\n QueryParams.prototype.orderBy = function (index) {\r\n var newParams = this.copy_();\r\n newParams.index_ = index;\r\n return newParams;\r\n };\r\n /**\r\n * @return {!Object}\r\n */\r\n QueryParams.prototype.getQueryObject = function () {\r\n var WIRE_PROTOCOL_CONSTANTS = QueryParams.WIRE_PROTOCOL_CONSTANTS_;\r\n var obj = {};\r\n if (this.startSet_) {\r\n obj[WIRE_PROTOCOL_CONSTANTS.INDEX_START_VALUE] = this.indexStartValue_;\r\n if (this.startNameSet_) {\r\n obj[WIRE_PROTOCOL_CONSTANTS.INDEX_START_NAME] = this.indexStartName_;\r\n }\r\n }\r\n if (this.endSet_) {\r\n obj[WIRE_PROTOCOL_CONSTANTS.INDEX_END_VALUE] = this.indexEndValue_;\r\n if (this.endNameSet_) {\r\n obj[WIRE_PROTOCOL_CONSTANTS.INDEX_END_NAME] = this.indexEndName_;\r\n }\r\n }\r\n if (this.limitSet_) {\r\n obj[WIRE_PROTOCOL_CONSTANTS.LIMIT] = this.limit_;\r\n var viewFrom = this.viewFrom_;\r\n if (viewFrom === '') {\r\n if (this.isViewFromLeft()) {\r\n viewFrom = WIRE_PROTOCOL_CONSTANTS.VIEW_FROM_LEFT;\r\n }\r\n else {\r\n viewFrom = WIRE_PROTOCOL_CONSTANTS.VIEW_FROM_RIGHT;\r\n }\r\n }\r\n obj[WIRE_PROTOCOL_CONSTANTS.VIEW_FROM] = viewFrom;\r\n }\r\n // For now, priority index is the default, so we only specify if it's some other index\r\n if (this.index_ !== PRIORITY_INDEX) {\r\n obj[WIRE_PROTOCOL_CONSTANTS.INDEX] = this.index_.toString();\r\n }\r\n return obj;\r\n };\r\n /**\r\n * @return {boolean}\r\n */\r\n QueryParams.prototype.loadsAllData = function () {\r\n return !(this.startSet_ || this.endSet_ || this.limitSet_);\r\n };\r\n /**\r\n * @return {boolean}\r\n */\r\n QueryParams.prototype.isDefault = function () {\r\n return this.loadsAllData() && this.index_ === PRIORITY_INDEX;\r\n };\r\n /**\r\n * @return {!NodeFilter}\r\n */\r\n QueryParams.prototype.getNodeFilter = function () {\r\n if (this.loadsAllData()) {\r\n return new IndexedFilter(this.getIndex());\r\n }\r\n else if (this.hasLimit()) {\r\n return new LimitedFilter(this);\r\n }\r\n else {\r\n return new RangedFilter(this);\r\n }\r\n };\r\n /**\r\n * Returns a set of REST query string parameters representing this query.\r\n *\r\n * @return {!Object.<string,*>} query string parameters\r\n */\r\n QueryParams.prototype.toRestQueryStringParameters = function () {\r\n var REST_CONSTANTS = QueryParams.REST_QUERY_CONSTANTS_;\r\n var qs = {};\r\n if (this.isDefault()) {\r\n return qs;\r\n }\r\n var orderBy;\r\n if (this.index_ === PRIORITY_INDEX) {\r\n orderBy = REST_CONSTANTS.PRIORITY_INDEX;\r\n }\r\n else if (this.index_ === VALUE_INDEX) {\r\n orderBy = REST_CONSTANTS.VALUE_INDEX;\r\n }\r\n else if (this.index_ === KEY_INDEX) {\r\n orderBy = REST_CONSTANTS.KEY_INDEX;\r\n }\r\n else {\r\n assert(this.index_ instanceof PathIndex, 'Unrecognized index type!');\r\n orderBy = this.index_.toString();\r\n }\r\n qs[REST_CONSTANTS.ORDER_BY] = stringify(orderBy);\r\n if (this.startSet_) {\r\n qs[REST_CONSTANTS.START_AT] = stringify(this.indexStartValue_);\r\n if (this.startNameSet_) {\r\n qs[REST_CONSTANTS.START_AT] += ',' + stringify(this.indexStartName_);\r\n }\r\n }\r\n if (this.endSet_) {\r\n qs[REST_CONSTANTS.END_AT] = stringify(this.indexEndValue_);\r\n if (this.endNameSet_) {\r\n qs[REST_CONSTANTS.END_AT] += ',' + stringify(this.indexEndName_);\r\n }\r\n }\r\n if (this.limitSet_) {\r\n if (this.isViewFromLeft()) {\r\n qs[REST_CONSTANTS.LIMIT_TO_FIRST] = this.limit_;\r\n }\r\n else {\r\n qs[REST_CONSTANTS.LIMIT_TO_LAST] = this.limit_;\r\n }\r\n }\r\n return qs;\r\n };\r\n /**\r\n * Wire Protocol Constants\r\n * @const\r\n * @enum {string}\r\n * @private\r\n */\r\n QueryParams.WIRE_PROTOCOL_CONSTANTS_ = {\r\n INDEX_START_VALUE: 'sp',\r\n INDEX_START_NAME: 'sn',\r\n INDEX_END_VALUE: 'ep',\r\n INDEX_END_NAME: 'en',\r\n LIMIT: 'l',\r\n VIEW_FROM: 'vf',\r\n VIEW_FROM_LEFT: 'l',\r\n VIEW_FROM_RIGHT: 'r',\r\n INDEX: 'i'\r\n };\r\n /**\r\n * REST Query Constants\r\n * @const\r\n * @enum {string}\r\n * @private\r\n */\r\n QueryParams.REST_QUERY_CONSTANTS_ = {\r\n ORDER_BY: 'orderBy',\r\n PRIORITY_INDEX: '$priority',\r\n VALUE_INDEX: '$value',\r\n KEY_INDEX: '$key',\r\n START_AT: 'startAt',\r\n END_AT: 'endAt',\r\n LIMIT_TO_FIRST: 'limitToFirst',\r\n LIMIT_TO_LAST: 'limitToLast'\r\n };\r\n /**\r\n * Default, empty query parameters\r\n * @type {!QueryParams}\r\n * @const\r\n */\r\n QueryParams.DEFAULT = new QueryParams();\r\n return QueryParams;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar Reference = /** @class */ (function (_super) {\r\n __extends(Reference, _super);\r\n /**\r\n * Call options:\r\n * new Reference(Repo, Path) or\r\n * new Reference(url: string, string|RepoManager)\r\n *\r\n * Externally - this is the firebase.database.Reference type.\r\n *\r\n * @param {!Repo} repo\r\n * @param {(!Path)} path\r\n * @extends {Query}\r\n */\r\n function Reference(repo, path) {\r\n var _this = this;\r\n if (!(repo instanceof Repo)) {\r\n throw new Error('new Reference() no longer supported - use app.database().');\r\n }\r\n // call Query's constructor, passing in the repo and path.\r\n _this = _super.call(this, repo, path, QueryParams.DEFAULT, false) || this;\r\n return _this;\r\n }\r\n /** @return {?string} */\r\n Reference.prototype.getKey = function () {\r\n validateArgCount('Reference.key', 0, 0, arguments.length);\r\n if (this.path.isEmpty()) {\r\n return null;\r\n }\r\n else {\r\n return this.path.getBack();\r\n }\r\n };\r\n /**\r\n * @param {!(string|Path)} pathString\r\n * @return {!Reference}\r\n */\r\n Reference.prototype.child = function (pathString) {\r\n validateArgCount('Reference.child', 1, 1, arguments.length);\r\n if (typeof pathString === 'number') {\r\n pathString = String(pathString);\r\n }\r\n else if (!(pathString instanceof Path)) {\r\n if (this.path.getFront() === null) {\r\n validateRootPathString('Reference.child', 1, pathString, false);\r\n }\r\n else {\r\n validatePathString('Reference.child', 1, pathString, false);\r\n }\r\n }\r\n return new Reference(this.repo, this.path.child(pathString));\r\n };\r\n /** @return {?Reference} */\r\n Reference.prototype.getParent = function () {\r\n validateArgCount('Reference.parent', 0, 0, arguments.length);\r\n var parentPath = this.path.parent();\r\n return parentPath === null ? null : new Reference(this.repo, parentPath);\r\n };\r\n /** @return {!Reference} */\r\n Reference.prototype.getRoot = function () {\r\n validateArgCount('Reference.root', 0, 0, arguments.length);\r\n var ref = this;\r\n while (ref.getParent() !== null) {\r\n ref = ref.getParent();\r\n }\r\n return ref;\r\n };\r\n /** @return {!Database} */\r\n Reference.prototype.databaseProp = function () {\r\n return this.repo.database;\r\n };\r\n /**\r\n * @param {*} newVal\r\n * @param {function(?Error)=} onComplete\r\n * @return {!Promise}\r\n */\r\n Reference.prototype.set = function (newVal, onComplete) {\r\n validateArgCount('Reference.set', 1, 2, arguments.length);\r\n validateWritablePath('Reference.set', this.path);\r\n validateFirebaseDataArg('Reference.set', 1, newVal, this.path, false);\r\n validateCallback('Reference.set', 2, onComplete, true);\r\n var deferred = new Deferred();\r\n this.repo.setWithPriority(this.path, newVal, \r\n /*priority=*/ null, deferred.wrapCallback(onComplete));\r\n return deferred.promise;\r\n };\r\n /**\r\n * @param {!Object} objectToMerge\r\n * @param {function(?Error)=} onComplete\r\n * @return {!Promise}\r\n */\r\n Reference.prototype.update = function (objectToMerge, onComplete) {\r\n validateArgCount('Reference.update', 1, 2, arguments.length);\r\n validateWritablePath('Reference.update', this.path);\r\n if (Array.isArray(objectToMerge)) {\r\n var newObjectToMerge = {};\r\n for (var i = 0; i < objectToMerge.length; ++i) {\r\n newObjectToMerge['' + i] = objectToMerge[i];\r\n }\r\n objectToMerge = newObjectToMerge;\r\n warn('Passing an Array to Firebase.update() is deprecated. ' +\r\n 'Use set() if you want to overwrite the existing data, or ' +\r\n 'an Object with integer keys if you really do want to ' +\r\n 'only update some of the children.');\r\n }\r\n validateFirebaseMergeDataArg('Reference.update', 1, objectToMerge, this.path, false);\r\n validateCallback('Reference.update', 2, onComplete, true);\r\n var deferred = new Deferred();\r\n this.repo.update(this.path, objectToMerge, deferred.wrapCallback(onComplete));\r\n return deferred.promise;\r\n };\r\n /**\r\n * @param {*} newVal\r\n * @param {string|number|null} newPriority\r\n * @param {function(?Error)=} onComplete\r\n * @return {!Promise}\r\n */\r\n Reference.prototype.setWithPriority = function (newVal, newPriority, onComplete) {\r\n validateArgCount('Reference.setWithPriority', 2, 3, arguments.length);\r\n validateWritablePath('Reference.setWithPriority', this.path);\r\n validateFirebaseDataArg('Reference.setWithPriority', 1, newVal, this.path, false);\r\n validatePriority('Reference.setWithPriority', 2, newPriority, false);\r\n validateCallback('Reference.setWithPriority', 3, onComplete, true);\r\n if (this.getKey() === '.length' || this.getKey() === '.keys') {\r\n throw ('Reference.setWithPriority failed: ' +\r\n this.getKey() +\r\n ' is a read-only object.');\r\n }\r\n var deferred = new Deferred();\r\n this.repo.setWithPriority(this.path, newVal, newPriority, deferred.wrapCallback(onComplete));\r\n return deferred.promise;\r\n };\r\n /**\r\n * @param {function(?Error)=} onComplete\r\n * @return {!Promise}\r\n */\r\n Reference.prototype.remove = function (onComplete) {\r\n validateArgCount('Reference.remove', 0, 1, arguments.length);\r\n validateWritablePath('Reference.remove', this.path);\r\n validateCallback('Reference.remove', 1, onComplete, true);\r\n return this.set(null, onComplete);\r\n };\r\n /**\r\n * @param {function(*):*} transactionUpdate\r\n * @param {(function(?Error, boolean, ?DataSnapshot))=} onComplete\r\n * @param {boolean=} applyLocally\r\n * @return {!Promise}\r\n */\r\n Reference.prototype.transaction = function (transactionUpdate, onComplete, applyLocally) {\r\n validateArgCount('Reference.transaction', 1, 3, arguments.length);\r\n validateWritablePath('Reference.transaction', this.path);\r\n validateCallback('Reference.transaction', 1, transactionUpdate, false);\r\n validateCallback('Reference.transaction', 2, onComplete, true);\r\n // NOTE: applyLocally is an internal-only option for now. We need to decide if we want to keep it and how\r\n // to expose it.\r\n validateBoolean('Reference.transaction', 3, applyLocally, true);\r\n if (this.getKey() === '.length' || this.getKey() === '.keys') {\r\n throw ('Reference.transaction failed: ' +\r\n this.getKey() +\r\n ' is a read-only object.');\r\n }\r\n if (applyLocally === undefined) {\r\n applyLocally = true;\r\n }\r\n var deferred = new Deferred();\r\n if (typeof onComplete === 'function') {\r\n deferred.promise.catch(function () { });\r\n }\r\n var promiseComplete = function (error, committed, snapshot) {\r\n if (error) {\r\n deferred.reject(error);\r\n }\r\n else {\r\n deferred.resolve(new TransactionResult(committed, snapshot));\r\n }\r\n if (typeof onComplete === 'function') {\r\n onComplete(error, committed, snapshot);\r\n }\r\n };\r\n this.repo.startTransaction(this.path, transactionUpdate, promiseComplete, applyLocally);\r\n return deferred.promise;\r\n };\r\n /**\r\n * @param {string|number|null} priority\r\n * @param {function(?Error)=} onComplete\r\n * @return {!Promise}\r\n */\r\n Reference.prototype.setPriority = function (priority, onComplete) {\r\n validateArgCount('Reference.setPriority', 1, 2, arguments.length);\r\n validateWritablePath('Reference.setPriority', this.path);\r\n validatePriority('Reference.setPriority', 1, priority, false);\r\n validateCallback('Reference.setPriority', 2, onComplete, true);\r\n var deferred = new Deferred();\r\n this.repo.setWithPriority(this.path.child('.priority'), priority, null, deferred.wrapCallback(onComplete));\r\n return deferred.promise;\r\n };\r\n /**\r\n * @param {*=} value\r\n * @param {function(?Error)=} onComplete\r\n * @return {!Reference}\r\n */\r\n Reference.prototype.push = function (value, onComplete) {\r\n validateArgCount('Reference.push', 0, 2, arguments.length);\r\n validateWritablePath('Reference.push', this.path);\r\n validateFirebaseDataArg('Reference.push', 1, value, this.path, true);\r\n validateCallback('Reference.push', 2, onComplete, true);\r\n var now = this.repo.serverTime();\r\n var name = nextPushId(now);\r\n // push() returns a ThennableReference whose promise is fulfilled with a regular Reference.\r\n // We use child() to create handles to two different references. The first is turned into a\r\n // ThennableReference below by adding then() and catch() methods and is used as the\r\n // return value of push(). The second remains a regular Reference and is used as the fulfilled\r\n // value of the first ThennableReference.\r\n var thennablePushRef = this.child(name);\r\n var pushRef = this.child(name);\r\n var promise;\r\n if (value != null) {\r\n promise = thennablePushRef.set(value, onComplete).then(function () { return pushRef; });\r\n }\r\n else {\r\n promise = Promise.resolve(pushRef);\r\n }\r\n thennablePushRef.then = promise.then.bind(promise);\r\n thennablePushRef.catch = promise.then.bind(promise, undefined);\r\n if (typeof onComplete === 'function') {\r\n promise.catch(function () { });\r\n }\r\n return thennablePushRef;\r\n };\r\n /**\r\n * @return {!OnDisconnect}\r\n */\r\n Reference.prototype.onDisconnect = function () {\r\n validateWritablePath('Reference.onDisconnect', this.path);\r\n return new OnDisconnect(this.repo, this.path);\r\n };\r\n Object.defineProperty(Reference.prototype, \"database\", {\r\n get: function () {\r\n return this.databaseProp();\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Reference.prototype, \"key\", {\r\n get: function () {\r\n return this.getKey();\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Reference.prototype, \"parent\", {\r\n get: function () {\r\n return this.getParent();\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Reference.prototype, \"root\", {\r\n get: function () {\r\n return this.getRoot();\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return Reference;\r\n}(Query));\r\n/**\r\n * Define reference constructor in various modules\r\n *\r\n * We are doing this here to avoid several circular\r\n * dependency issues\r\n */\r\nQuery.__referenceConstructor = Reference;\r\nSyncPoint.__referenceConstructor = Reference;\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Node in a Tree.\r\n */\r\nvar TreeNode = /** @class */ (function () {\r\n function TreeNode() {\r\n // TODO: Consider making accessors that create children and value lazily or\r\n // separate Internal / Leaf 'types'.\r\n this.children = {};\r\n this.childCount = 0;\r\n this.value = null;\r\n }\r\n return TreeNode;\r\n}());\r\n/**\r\n * A light-weight tree, traversable by path. Nodes can have both values and children.\r\n * Nodes are not enumerated (by forEachChild) unless they have a value or non-empty\r\n * children.\r\n */\r\nvar Tree = /** @class */ (function () {\r\n /**\r\n * @template T\r\n * @param {string=} name_ Optional name of the node.\r\n * @param {Tree=} parent_ Optional parent node.\r\n * @param {TreeNode=} node_ Optional node to wrap.\r\n */\r\n function Tree(name_, parent_, node_) {\r\n if (name_ === void 0) { name_ = ''; }\r\n if (parent_ === void 0) { parent_ = null; }\r\n if (node_ === void 0) { node_ = new TreeNode(); }\r\n this.name_ = name_;\r\n this.parent_ = parent_;\r\n this.node_ = node_;\r\n }\r\n /**\r\n * Returns a sub-Tree for the given path.\r\n *\r\n * @param {!(string|Path)} pathObj Path to look up.\r\n * @return {!Tree.<T>} Tree for path.\r\n */\r\n Tree.prototype.subTree = function (pathObj) {\r\n // TODO: Require pathObj to be Path?\r\n var path = pathObj instanceof Path ? pathObj : new Path(pathObj);\r\n var child = this, next = path.getFront();\r\n while (next !== null) {\r\n var childNode = safeGet(child.node_.children, next) || new TreeNode();\r\n child = new Tree(next, child, childNode);\r\n path = path.popFront();\r\n next = path.getFront();\r\n }\r\n return child;\r\n };\r\n /**\r\n * Returns the data associated with this tree node.\r\n *\r\n * @return {?T} The data or null if no data exists.\r\n */\r\n Tree.prototype.getValue = function () {\r\n return this.node_.value;\r\n };\r\n /**\r\n * Sets data to this tree node.\r\n *\r\n * @param {!T} value Value to set.\r\n */\r\n Tree.prototype.setValue = function (value) {\r\n assert(typeof value !== 'undefined', 'Cannot set value to undefined');\r\n this.node_.value = value;\r\n this.updateParents_();\r\n };\r\n /**\r\n * Clears the contents of the tree node (its value and all children).\r\n */\r\n Tree.prototype.clear = function () {\r\n this.node_.value = null;\r\n this.node_.children = {};\r\n this.node_.childCount = 0;\r\n this.updateParents_();\r\n };\r\n /**\r\n * @return {boolean} Whether the tree has any children.\r\n */\r\n Tree.prototype.hasChildren = function () {\r\n return this.node_.childCount > 0;\r\n };\r\n /**\r\n * @return {boolean} Whether the tree is empty (no value or children).\r\n */\r\n Tree.prototype.isEmpty = function () {\r\n return this.getValue() === null && !this.hasChildren();\r\n };\r\n /**\r\n * Calls action for each child of this tree node.\r\n *\r\n * @param {function(!Tree.<T>)} action Action to be called for each child.\r\n */\r\n Tree.prototype.forEachChild = function (action) {\r\n var _this = this;\r\n each(this.node_.children, function (child, childTree) {\r\n action(new Tree(child, _this, childTree));\r\n });\r\n };\r\n /**\r\n * Does a depth-first traversal of this node's descendants, calling action for each one.\r\n *\r\n * @param {function(!Tree.<T>)} action Action to be called for each child.\r\n * @param {boolean=} includeSelf Whether to call action on this node as well. Defaults to\r\n * false.\r\n * @param {boolean=} childrenFirst Whether to call action on children before calling it on\r\n * parent.\r\n */\r\n Tree.prototype.forEachDescendant = function (action, includeSelf, childrenFirst) {\r\n if (includeSelf && !childrenFirst) {\r\n action(this);\r\n }\r\n this.forEachChild(function (child) {\r\n child.forEachDescendant(action, /*includeSelf=*/ true, childrenFirst);\r\n });\r\n if (includeSelf && childrenFirst) {\r\n action(this);\r\n }\r\n };\r\n /**\r\n * Calls action on each ancestor node.\r\n *\r\n * @param {function(!Tree.<T>)} action Action to be called on each parent; return\r\n * true to abort.\r\n * @param {boolean=} includeSelf Whether to call action on this node as well.\r\n * @return {boolean} true if the action callback returned true.\r\n */\r\n Tree.prototype.forEachAncestor = function (action, includeSelf) {\r\n var node = includeSelf ? this : this.parent();\r\n while (node !== null) {\r\n if (action(node)) {\r\n return true;\r\n }\r\n node = node.parent();\r\n }\r\n return false;\r\n };\r\n /**\r\n * Does a depth-first traversal of this node's descendants. When a descendant with a value\r\n * is found, action is called on it and traversal does not continue inside the node.\r\n * Action is *not* called on this node.\r\n *\r\n * @param {function(!Tree.<T>)} action Action to be called for each child.\r\n */\r\n Tree.prototype.forEachImmediateDescendantWithValue = function (action) {\r\n this.forEachChild(function (child) {\r\n if (child.getValue() !== null) {\r\n action(child);\r\n }\r\n else {\r\n child.forEachImmediateDescendantWithValue(action);\r\n }\r\n });\r\n };\r\n /**\r\n * @return {!Path} The path of this tree node, as a Path.\r\n */\r\n Tree.prototype.path = function () {\r\n return new Path(this.parent_ === null\r\n ? this.name_\r\n : this.parent_.path() + '/' + this.name_);\r\n };\r\n /**\r\n * @return {string} The name of the tree node.\r\n */\r\n Tree.prototype.name = function () {\r\n return this.name_;\r\n };\r\n /**\r\n * @return {?Tree} The parent tree node, or null if this is the root of the tree.\r\n */\r\n Tree.prototype.parent = function () {\r\n return this.parent_;\r\n };\r\n /**\r\n * Adds or removes this child from its parent based on whether it's empty or not.\r\n *\r\n * @private\r\n */\r\n Tree.prototype.updateParents_ = function () {\r\n if (this.parent_ !== null) {\r\n this.parent_.updateChild_(this.name_, this);\r\n }\r\n };\r\n /**\r\n * Adds or removes the passed child to this tree node, depending on whether it's empty.\r\n *\r\n * @param {string} childName The name of the child to update.\r\n * @param {!Tree.<T>} child The child to update.\r\n * @private\r\n */\r\n Tree.prototype.updateChild_ = function (childName, child) {\r\n var childEmpty = child.isEmpty();\r\n var childExists = contains(this.node_.children, childName);\r\n if (childEmpty && childExists) {\r\n delete this.node_.children[childName];\r\n this.node_.childCount--;\r\n this.updateParents_();\r\n }\r\n else if (!childEmpty && !childExists) {\r\n this.node_.children[childName] = child.node_;\r\n this.node_.childCount++;\r\n this.updateParents_();\r\n }\r\n };\r\n return Tree;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// TODO: This is pretty messy. Ideally, a lot of this would move into FirebaseData, or a transaction-specific\r\n// component used by FirebaseData, but it has ties to user callbacks (transaction update and onComplete) as well\r\n// as the realtime connection (to send transactions to the server). So that all needs to be decoupled first.\r\n// For now it's part of Repo, but in its own file.\r\n/**\r\n * @enum {number}\r\n */\r\nvar TransactionStatus;\r\n(function (TransactionStatus) {\r\n // We've run the transaction and updated transactionResultData_ with the result, but it isn't currently sent to the\r\n // server. A transaction will go from RUN -> SENT -> RUN if it comes back from the server as rejected due to\r\n // mismatched hash.\r\n TransactionStatus[TransactionStatus[\"RUN\"] = 0] = \"RUN\";\r\n // We've run the transaction and sent it to the server and it's currently outstanding (hasn't come back as accepted\r\n // or rejected yet).\r\n TransactionStatus[TransactionStatus[\"SENT\"] = 1] = \"SENT\";\r\n // Temporary state used to mark completed transactions (whether successful or aborted). The transaction will be\r\n // removed when we get a chance to prune completed ones.\r\n TransactionStatus[TransactionStatus[\"COMPLETED\"] = 2] = \"COMPLETED\";\r\n // Used when an already-sent transaction needs to be aborted (e.g. due to a conflicting set() call that was made).\r\n // If it comes back as unsuccessful, we'll abort it.\r\n TransactionStatus[TransactionStatus[\"SENT_NEEDS_ABORT\"] = 3] = \"SENT_NEEDS_ABORT\";\r\n // Temporary state used to mark transactions that need to be aborted.\r\n TransactionStatus[TransactionStatus[\"NEEDS_ABORT\"] = 4] = \"NEEDS_ABORT\";\r\n})(TransactionStatus || (TransactionStatus = {}));\r\n/**\r\n * If a transaction does not succeed after 25 retries, we abort it. Among other things this ensure that if there's\r\n * ever a bug causing a mismatch between client / server hashes for some data, we won't retry indefinitely.\r\n * @type {number}\r\n * @const\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.MAX_TRANSACTION_RETRIES_ = 25;\r\n/**\r\n * Setup the transaction data structures\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.transactionsInit_ = function () {\r\n /**\r\n * Stores queues of outstanding transactions for Firebase locations.\r\n *\r\n * @type {!Tree.<Array.<!Transaction>>}\r\n * @private\r\n */\r\n this.transactionQueueTree_ = new Tree();\r\n};\r\n/**\r\n * Creates a new transaction, adds it to the transactions we're tracking, and sends it to the server if possible.\r\n *\r\n * @param {!Path} path Path at which to do transaction.\r\n * @param {function(*):*} transactionUpdate Update callback.\r\n * @param {?function(?Error, boolean, ?DataSnapshot)} onComplete Completion callback.\r\n * @param {boolean} applyLocally Whether or not to make intermediate results visible\r\n */\r\nRepo.prototype.startTransaction = function (path, transactionUpdate, onComplete, applyLocally) {\r\n this.log_('transaction on ' + path);\r\n // Add a watch to make sure we get server updates.\r\n var valueCallback = function () { };\r\n var watchRef = new Reference(this, path);\r\n watchRef.on('value', valueCallback);\r\n var unwatcher = function () {\r\n watchRef.off('value', valueCallback);\r\n };\r\n // Initialize transaction.\r\n var transaction = {\r\n path: path,\r\n update: transactionUpdate,\r\n onComplete: onComplete,\r\n // One of TransactionStatus enums.\r\n status: null,\r\n // Used when combining transactions at different locations to figure out which one goes first.\r\n order: LUIDGenerator(),\r\n // Whether to raise local events for this transaction.\r\n applyLocally: applyLocally,\r\n // Count of how many times we've retried the transaction.\r\n retryCount: 0,\r\n // Function to call to clean up our .on() listener.\r\n unwatcher: unwatcher,\r\n // Stores why a transaction was aborted.\r\n abortReason: null,\r\n currentWriteId: null,\r\n currentInputSnapshot: null,\r\n currentOutputSnapshotRaw: null,\r\n currentOutputSnapshotResolved: null\r\n };\r\n // Run transaction initially.\r\n var currentState = this.getLatestState_(path);\r\n transaction.currentInputSnapshot = currentState;\r\n var newVal = transaction.update(currentState.val());\r\n if (newVal === undefined) {\r\n // Abort transaction.\r\n transaction.unwatcher();\r\n transaction.currentOutputSnapshotRaw = null;\r\n transaction.currentOutputSnapshotResolved = null;\r\n if (transaction.onComplete) {\r\n // We just set the input snapshot, so this cast should be safe\r\n var snapshot = new DataSnapshot(transaction.currentInputSnapshot, new Reference(this, transaction.path), PRIORITY_INDEX);\r\n transaction.onComplete(null, false, snapshot);\r\n }\r\n }\r\n else {\r\n validateFirebaseData('transaction failed: Data returned ', newVal, transaction.path);\r\n // Mark as run and add to our queue.\r\n transaction.status = TransactionStatus.RUN;\r\n var queueNode = this.transactionQueueTree_.subTree(path);\r\n var nodeQueue = queueNode.getValue() || [];\r\n nodeQueue.push(transaction);\r\n queueNode.setValue(nodeQueue);\r\n // Update visibleData and raise events\r\n // Note: We intentionally raise events after updating all of our transaction state, since the user could\r\n // start new transactions from the event callbacks.\r\n var priorityForNode = void 0;\r\n if (typeof newVal === 'object' &&\r\n newVal !== null &&\r\n contains(newVal, '.priority')) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n priorityForNode = safeGet(newVal, '.priority');\r\n assert(isValidPriority(priorityForNode), 'Invalid priority returned by transaction. ' +\r\n 'Priority must be a valid string, finite number, server value, or null.');\r\n }\r\n else {\r\n var currentNode = this.serverSyncTree_.calcCompleteEventCache(path) ||\r\n ChildrenNode.EMPTY_NODE;\r\n priorityForNode = currentNode.getPriority().val();\r\n }\r\n priorityForNode /** @type {null|number|string} */ = priorityForNode;\r\n var serverValues = this.generateServerValues();\r\n var newNodeUnresolved = nodeFromJSON$1(newVal, priorityForNode);\r\n var newNode = resolveDeferredValueSnapshot(newNodeUnresolved, currentState, serverValues);\r\n transaction.currentOutputSnapshotRaw = newNodeUnresolved;\r\n transaction.currentOutputSnapshotResolved = newNode;\r\n transaction.currentWriteId = this.getNextWriteId_();\r\n var events = this.serverSyncTree_.applyUserOverwrite(path, newNode, transaction.currentWriteId, transaction.applyLocally);\r\n this.eventQueue_.raiseEventsForChangedPath(path, events);\r\n this.sendReadyTransactions_();\r\n }\r\n};\r\n/**\r\n * @param {!Path} path\r\n * @param {Array.<number>=} excludeSets A specific set to exclude\r\n * @return {Node}\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.getLatestState_ = function (path, excludeSets) {\r\n return (this.serverSyncTree_.calcCompleteEventCache(path, excludeSets) ||\r\n ChildrenNode.EMPTY_NODE);\r\n};\r\n/**\r\n * Sends any already-run transactions that aren't waiting for outstanding transactions to\r\n * complete.\r\n *\r\n * Externally it's called with no arguments, but it calls itself recursively with a particular\r\n * transactionQueueTree node to recurse through the tree.\r\n *\r\n * @param {Tree.<Array.<Transaction>>=} node transactionQueueTree node to start at.\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.sendReadyTransactions_ = function (node) {\r\n var _this = this;\r\n if (node === void 0) { node = this.transactionQueueTree_; }\r\n // Before recursing, make sure any completed transactions are removed.\r\n if (!node) {\r\n this.pruneCompletedTransactionsBelowNode_(node);\r\n }\r\n if (node.getValue() !== null) {\r\n var queue = this.buildTransactionQueue_(node);\r\n assert(queue.length > 0, 'Sending zero length transaction queue');\r\n var allRun = queue.every(function (transaction) { return transaction.status === TransactionStatus.RUN; });\r\n // If they're all run (and not sent), we can send them. Else, we must wait.\r\n if (allRun) {\r\n this.sendTransactionQueue_(node.path(), queue);\r\n }\r\n }\r\n else if (node.hasChildren()) {\r\n node.forEachChild(function (childNode) {\r\n _this.sendReadyTransactions_(childNode);\r\n });\r\n }\r\n};\r\n/**\r\n * Given a list of run transactions, send them to the server and then handle the result (success or failure).\r\n *\r\n * @param {!Path} path The location of the queue.\r\n * @param {!Array.<Transaction>} queue Queue of transactions under the specified location.\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.sendTransactionQueue_ = function (path, queue) {\r\n var _this = this;\r\n // Mark transactions as sent and increment retry count!\r\n var setsToIgnore = queue.map(function (txn) {\r\n return txn.currentWriteId;\r\n });\r\n var latestState = this.getLatestState_(path, setsToIgnore);\r\n var snapToSend = latestState;\r\n var latestHash = latestState.hash();\r\n for (var i = 0; i < queue.length; i++) {\r\n var txn = queue[i];\r\n assert(txn.status === TransactionStatus.RUN, 'tryToSendTransactionQueue_: items in queue should all be run.');\r\n txn.status = TransactionStatus.SENT;\r\n txn.retryCount++;\r\n var relativePath = Path.relativePath(path, txn.path);\r\n // If we've gotten to this point, the output snapshot must be defined.\r\n snapToSend = snapToSend.updateChild(relativePath /** @type {!Node} */, txn.currentOutputSnapshotRaw);\r\n }\r\n var dataToSend = snapToSend.val(true);\r\n var pathToSend = path;\r\n // Send the put.\r\n this.server_.put(pathToSend.toString(), dataToSend, function (status) {\r\n _this.log_('transaction put response', {\r\n path: pathToSend.toString(),\r\n status: status\r\n });\r\n var events = [];\r\n if (status === 'ok') {\r\n // Queue up the callbacks and fire them after cleaning up all of our transaction state, since\r\n // the callback could trigger more transactions or sets.\r\n var callbacks = [];\r\n for (var i = 0; i < queue.length; i++) {\r\n queue[i].status = TransactionStatus.COMPLETED;\r\n events = events.concat(_this.serverSyncTree_.ackUserWrite(queue[i].currentWriteId));\r\n if (queue[i].onComplete) {\r\n // We never unset the output snapshot, and given that this transaction is complete, it should be set\r\n var node = queue[i].currentOutputSnapshotResolved;\r\n var ref = new Reference(_this, queue[i].path);\r\n var snapshot = new DataSnapshot(node, ref, PRIORITY_INDEX);\r\n callbacks.push(queue[i].onComplete.bind(null, null, true, snapshot));\r\n }\r\n queue[i].unwatcher();\r\n }\r\n // Now remove the completed transactions.\r\n _this.pruneCompletedTransactionsBelowNode_(_this.transactionQueueTree_.subTree(path));\r\n // There may be pending transactions that we can now send.\r\n _this.sendReadyTransactions_();\r\n _this.eventQueue_.raiseEventsForChangedPath(path, events);\r\n // Finally, trigger onComplete callbacks.\r\n for (var i = 0; i < callbacks.length; i++) {\r\n exceptionGuard(callbacks[i]);\r\n }\r\n }\r\n else {\r\n // transactions are no longer sent. Update their status appropriately.\r\n if (status === 'datastale') {\r\n for (var i = 0; i < queue.length; i++) {\r\n if (queue[i].status === TransactionStatus.SENT_NEEDS_ABORT) {\r\n queue[i].status = TransactionStatus.NEEDS_ABORT;\r\n }\r\n else {\r\n queue[i].status = TransactionStatus.RUN;\r\n }\r\n }\r\n }\r\n else {\r\n warn('transaction at ' + pathToSend.toString() + ' failed: ' + status);\r\n for (var i = 0; i < queue.length; i++) {\r\n queue[i].status = TransactionStatus.NEEDS_ABORT;\r\n queue[i].abortReason = status;\r\n }\r\n }\r\n _this.rerunTransactions_(path);\r\n }\r\n }, latestHash);\r\n};\r\n/**\r\n * Finds all transactions dependent on the data at changedPath and reruns them.\r\n *\r\n * Should be called any time cached data changes.\r\n *\r\n * Return the highest path that was affected by rerunning transactions. This is the path at which events need to\r\n * be raised for.\r\n *\r\n * @param {!Path} changedPath The path in mergedData that changed.\r\n * @return {!Path} The rootmost path that was affected by rerunning transactions.\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.rerunTransactions_ = function (changedPath) {\r\n var rootMostTransactionNode = this.getAncestorTransactionNode_(changedPath);\r\n var path = rootMostTransactionNode.path();\r\n var queue = this.buildTransactionQueue_(rootMostTransactionNode);\r\n this.rerunTransactionQueue_(queue, path);\r\n return path;\r\n};\r\n/**\r\n * Does all the work of rerunning transactions (as well as cleans up aborted transactions and whatnot).\r\n *\r\n * @param {Array.<Transaction>} queue The queue of transactions to run.\r\n * @param {!Path} path The path the queue is for.\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.rerunTransactionQueue_ = function (queue, path) {\r\n if (queue.length === 0) {\r\n return; // Nothing to do!\r\n }\r\n // Queue up the callbacks and fire them after cleaning up all of our transaction state, since\r\n // the callback could trigger more transactions or sets.\r\n var callbacks = [];\r\n var events = [];\r\n // Ignore all of the sets we're going to re-run.\r\n var txnsToRerun = queue.filter(function (q) {\r\n return q.status === TransactionStatus.RUN;\r\n });\r\n var setsToIgnore = txnsToRerun.map(function (q) {\r\n return q.currentWriteId;\r\n });\r\n for (var i = 0; i < queue.length; i++) {\r\n var transaction = queue[i];\r\n var relativePath = Path.relativePath(path, transaction.path);\r\n var abortTransaction = false, abortReason = void 0;\r\n assert(relativePath !== null, 'rerunTransactionsUnderNode_: relativePath should not be null.');\r\n if (transaction.status === TransactionStatus.NEEDS_ABORT) {\r\n abortTransaction = true;\r\n abortReason = transaction.abortReason;\r\n events = events.concat(this.serverSyncTree_.ackUserWrite(transaction.currentWriteId, true));\r\n }\r\n else if (transaction.status === TransactionStatus.RUN) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n if (transaction.retryCount >= Repo.MAX_TRANSACTION_RETRIES_) {\r\n abortTransaction = true;\r\n abortReason = 'maxretry';\r\n events = events.concat(this.serverSyncTree_.ackUserWrite(transaction.currentWriteId, true));\r\n }\r\n else {\r\n // This code reruns a transaction\r\n var currentNode = this.getLatestState_(transaction.path, setsToIgnore);\r\n transaction.currentInputSnapshot = currentNode;\r\n var newData = queue[i].update(currentNode.val());\r\n if (newData !== undefined) {\r\n validateFirebaseData('transaction failed: Data returned ', newData, transaction.path);\r\n var newDataNode = nodeFromJSON$1(newData);\r\n var hasExplicitPriority = typeof newData === 'object' &&\r\n newData != null &&\r\n contains(newData, '.priority');\r\n if (!hasExplicitPriority) {\r\n // Keep the old priority if there wasn't a priority explicitly specified.\r\n newDataNode = newDataNode.updatePriority(currentNode.getPriority());\r\n }\r\n var oldWriteId = transaction.currentWriteId;\r\n var serverValues = this.generateServerValues();\r\n var newNodeResolved = resolveDeferredValueSnapshot(newDataNode, currentNode, serverValues);\r\n transaction.currentOutputSnapshotRaw = newDataNode;\r\n transaction.currentOutputSnapshotResolved = newNodeResolved;\r\n transaction.currentWriteId = this.getNextWriteId_();\r\n // Mutates setsToIgnore in place\r\n setsToIgnore.splice(setsToIgnore.indexOf(oldWriteId), 1);\r\n events = events.concat(this.serverSyncTree_.applyUserOverwrite(transaction.path, newNodeResolved, transaction.currentWriteId, transaction.applyLocally));\r\n events = events.concat(this.serverSyncTree_.ackUserWrite(oldWriteId, true));\r\n }\r\n else {\r\n abortTransaction = true;\r\n abortReason = 'nodata';\r\n events = events.concat(this.serverSyncTree_.ackUserWrite(transaction.currentWriteId, true));\r\n }\r\n }\r\n }\r\n this.eventQueue_.raiseEventsForChangedPath(path, events);\r\n events = [];\r\n if (abortTransaction) {\r\n // Abort.\r\n queue[i].status = TransactionStatus.COMPLETED;\r\n // Removing a listener can trigger pruning which can muck with mergedData/visibleData (as it prunes data).\r\n // So defer the unwatcher until we're done.\r\n (function (unwatcher) {\r\n setTimeout(unwatcher, Math.floor(0));\r\n })(queue[i].unwatcher);\r\n if (queue[i].onComplete) {\r\n if (abortReason === 'nodata') {\r\n var ref = new Reference(this, queue[i].path);\r\n // We set this field immediately, so it's safe to cast to an actual snapshot\r\n var lastInput /** @type {!Node} */ = queue[i].currentInputSnapshot;\r\n var snapshot = new DataSnapshot(lastInput, ref, PRIORITY_INDEX);\r\n callbacks.push(queue[i].onComplete.bind(null, null, false, snapshot));\r\n }\r\n else {\r\n callbacks.push(queue[i].onComplete.bind(null, new Error(abortReason), false, null));\r\n }\r\n }\r\n }\r\n }\r\n // Clean up completed transactions.\r\n this.pruneCompletedTransactionsBelowNode_(this.transactionQueueTree_);\r\n // Now fire callbacks, now that we're in a good, known state.\r\n for (var i = 0; i < callbacks.length; i++) {\r\n exceptionGuard(callbacks[i]);\r\n }\r\n // Try to send the transaction result to the server.\r\n this.sendReadyTransactions_();\r\n};\r\n/**\r\n * Returns the rootmost ancestor node of the specified path that has a pending transaction on it, or just returns\r\n * the node for the given path if there are no pending transactions on any ancestor.\r\n *\r\n * @param {!Path} path The location to start at.\r\n * @return {!Tree.<Array.<!Transaction>>} The rootmost node with a transaction.\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.getAncestorTransactionNode_ = function (path) {\r\n var front;\r\n // Start at the root and walk deeper into the tree towards path until we find a node with pending transactions.\r\n var transactionNode = this.transactionQueueTree_;\r\n front = path.getFront();\r\n while (front !== null && transactionNode.getValue() === null) {\r\n transactionNode = transactionNode.subTree(front);\r\n path = path.popFront();\r\n front = path.getFront();\r\n }\r\n return transactionNode;\r\n};\r\n/**\r\n * Builds the queue of all transactions at or below the specified transactionNode.\r\n *\r\n * @param {!Tree.<Array.<Transaction>>} transactionNode\r\n * @return {Array.<Transaction>} The generated queue.\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.buildTransactionQueue_ = function (transactionNode) {\r\n // Walk any child transaction queues and aggregate them into a single queue.\r\n var transactionQueue = [];\r\n this.aggregateTransactionQueuesForNode_(transactionNode, transactionQueue);\r\n // Sort them by the order the transactions were created.\r\n transactionQueue.sort(function (a, b) {\r\n return a.order - b.order;\r\n });\r\n return transactionQueue;\r\n};\r\n/**\r\n * @param {!Tree.<Array.<Transaction>>} node\r\n * @param {Array.<Transaction>} queue\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.aggregateTransactionQueuesForNode_ = function (node, queue) {\r\n var _this = this;\r\n var nodeQueue = node.getValue();\r\n if (nodeQueue !== null) {\r\n for (var i = 0; i < nodeQueue.length; i++) {\r\n queue.push(nodeQueue[i]);\r\n }\r\n }\r\n node.forEachChild(function (child) {\r\n _this.aggregateTransactionQueuesForNode_(child, queue);\r\n });\r\n};\r\n/**\r\n * Remove COMPLETED transactions at or below this node in the transactionQueueTree_.\r\n *\r\n * @param {!Tree.<Array.<!Transaction>>} node\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.pruneCompletedTransactionsBelowNode_ = function (node) {\r\n var _this = this;\r\n var queue = node.getValue();\r\n if (queue) {\r\n var to = 0;\r\n for (var from = 0; from < queue.length; from++) {\r\n if (queue[from].status !== TransactionStatus.COMPLETED) {\r\n queue[to] = queue[from];\r\n to++;\r\n }\r\n }\r\n queue.length = to;\r\n node.setValue(queue.length > 0 ? queue : null);\r\n }\r\n node.forEachChild(function (childNode) {\r\n _this.pruneCompletedTransactionsBelowNode_(childNode);\r\n });\r\n};\r\n/**\r\n * Aborts all transactions on ancestors or descendants of the specified path. Called when doing a set() or update()\r\n * since we consider them incompatible with transactions.\r\n *\r\n * @param {!Path} path Path for which we want to abort related transactions.\r\n * @return {!Path}\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.abortTransactions_ = function (path) {\r\n var _this = this;\r\n var affectedPath = this.getAncestorTransactionNode_(path).path();\r\n var transactionNode = this.transactionQueueTree_.subTree(path);\r\n transactionNode.forEachAncestor(function (node) {\r\n _this.abortTransactionsOnNode_(node);\r\n });\r\n this.abortTransactionsOnNode_(transactionNode);\r\n transactionNode.forEachDescendant(function (node) {\r\n _this.abortTransactionsOnNode_(node);\r\n });\r\n return affectedPath;\r\n};\r\n/**\r\n * Abort transactions stored in this transaction queue node.\r\n *\r\n * @param {!Tree.<Array.<Transaction>>} node Node to abort transactions for.\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.abortTransactionsOnNode_ = function (node) {\r\n var queue = node.getValue();\r\n if (queue !== null) {\r\n // Queue up the callbacks and fire them after cleaning up all of our transaction state, since\r\n // the callback could trigger more transactions or sets.\r\n var callbacks = [];\r\n // Go through queue. Any already-sent transactions must be marked for abort, while the unsent ones\r\n // can be immediately aborted and removed.\r\n var events = [];\r\n var lastSent = -1;\r\n for (var i = 0; i < queue.length; i++) {\r\n if (queue[i].status === TransactionStatus.SENT_NEEDS_ABORT) ;\r\n else if (queue[i].status === TransactionStatus.SENT) {\r\n assert(lastSent === i - 1, 'All SENT items should be at beginning of queue.');\r\n lastSent = i;\r\n // Mark transaction for abort when it comes back.\r\n queue[i].status = TransactionStatus.SENT_NEEDS_ABORT;\r\n queue[i].abortReason = 'set';\r\n }\r\n else {\r\n assert(queue[i].status === TransactionStatus.RUN, 'Unexpected transaction status in abort');\r\n // We can abort it immediately.\r\n queue[i].unwatcher();\r\n events = events.concat(this.serverSyncTree_.ackUserWrite(queue[i].currentWriteId, true));\r\n if (queue[i].onComplete) {\r\n var snapshot = null;\r\n callbacks.push(queue[i].onComplete.bind(null, new Error('set'), false, snapshot));\r\n }\r\n }\r\n }\r\n if (lastSent === -1) {\r\n // We're not waiting for any sent transactions. We can clear the queue.\r\n node.setValue(null);\r\n }\r\n else {\r\n // Remove the transactions we aborted.\r\n queue.length = lastSent + 1;\r\n }\r\n // Now fire the callbacks.\r\n this.eventQueue_.raiseEventsForChangedPath(node.path(), events);\r\n for (var i = 0; i < callbacks.length; i++) {\r\n exceptionGuard(callbacks[i]);\r\n }\r\n }\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Abstraction around FirebaseApp's token fetching capabilities.\r\n */\r\nvar FirebaseAuthTokenProvider = /** @class */ (function () {\r\n function FirebaseAuthTokenProvider(app_, authProvider_) {\r\n var _this = this;\r\n this.app_ = app_;\r\n this.authProvider_ = authProvider_;\r\n this.auth_ = null;\r\n this.auth_ = authProvider_.getImmediate({ optional: true });\r\n if (!this.auth_) {\r\n authProvider_.get().then(function (auth) { return (_this.auth_ = auth); });\r\n }\r\n }\r\n /**\r\n * @param {boolean} forceRefresh\r\n * @return {!Promise<FirebaseAuthTokenData>}\r\n */\r\n FirebaseAuthTokenProvider.prototype.getToken = function (forceRefresh) {\r\n if (!this.auth_) {\r\n return Promise.resolve(null);\r\n }\r\n return this.auth_.getToken(forceRefresh).catch(function (error) {\r\n // TODO: Need to figure out all the cases this is raised and whether\r\n // this makes sense.\r\n if (error && error.code === 'auth/token-not-initialized') {\r\n log('Got auth/token-not-initialized error. Treating as null token.');\r\n return null;\r\n }\r\n else {\r\n return Promise.reject(error);\r\n }\r\n });\r\n };\r\n FirebaseAuthTokenProvider.prototype.addTokenChangeListener = function (listener) {\r\n // TODO: We might want to wrap the listener and call it with no args to\r\n // avoid a leaky abstraction, but that makes removing the listener harder.\r\n if (this.auth_) {\r\n this.auth_.addAuthTokenListener(listener);\r\n }\r\n else {\r\n setTimeout(function () { return listener(null); }, 0);\r\n this.authProvider_\r\n .get()\r\n .then(function (auth) { return auth.addAuthTokenListener(listener); });\r\n }\r\n };\r\n FirebaseAuthTokenProvider.prototype.removeTokenChangeListener = function (listener) {\r\n this.authProvider_\r\n .get()\r\n .then(function (auth) { return auth.removeAuthTokenListener(listener); });\r\n };\r\n FirebaseAuthTokenProvider.prototype.notifyForInvalidToken = function () {\r\n var errorMessage = 'Provided authentication credentials for the app named \"' +\r\n this.app_.name +\r\n '\" are invalid. This usually indicates your app was not ' +\r\n 'initialized correctly. ';\r\n if ('credential' in this.app_.options) {\r\n errorMessage +=\r\n 'Make sure the \"credential\" property provided to initializeApp() ' +\r\n 'is authorized to access the specified \"databaseURL\" and is from the correct ' +\r\n 'project.';\r\n }\r\n else if ('serviceAccount' in this.app_.options) {\r\n errorMessage +=\r\n 'Make sure the \"serviceAccount\" property provided to initializeApp() ' +\r\n 'is authorized to access the specified \"databaseURL\" and is from the correct ' +\r\n 'project.';\r\n }\r\n else {\r\n errorMessage +=\r\n 'Make sure the \"apiKey\" and \"databaseURL\" properties provided to ' +\r\n 'initializeApp() match the values provided for your app at ' +\r\n 'https://console.firebase.google.com/.';\r\n }\r\n warn(errorMessage);\r\n };\r\n return FirebaseAuthTokenProvider;\r\n}());\r\n/* Auth token provider that the Admin SDK uses to connect to the Emulator. */\r\nvar EmulatorAdminTokenProvider = /** @class */ (function () {\r\n function EmulatorAdminTokenProvider() {\r\n }\r\n EmulatorAdminTokenProvider.prototype.getToken = function (forceRefresh) {\r\n return Promise.resolve({\r\n accessToken: EmulatorAdminTokenProvider.EMULATOR_AUTH_TOKEN\r\n });\r\n };\r\n EmulatorAdminTokenProvider.prototype.addTokenChangeListener = function (listener) {\r\n // Invoke the listener immediately to match the behavior in Firebase Auth\r\n // (see packages/auth/src/auth.js#L1807)\r\n listener(EmulatorAdminTokenProvider.EMULATOR_AUTH_TOKEN);\r\n };\r\n EmulatorAdminTokenProvider.prototype.removeTokenChangeListener = function (listener) { };\r\n EmulatorAdminTokenProvider.prototype.notifyForInvalidToken = function () { };\r\n EmulatorAdminTokenProvider.EMULATOR_AUTH_TOKEN = 'owner';\r\n return EmulatorAdminTokenProvider;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * This variable is also defined in the firebase node.js admin SDK. Before\r\n * modifying this definition, consult the definition in:\r\n *\r\n * https://github.com/firebase/firebase-admin-node\r\n *\r\n * and make sure the two are consistent.\r\n */\r\nvar FIREBASE_DATABASE_EMULATOR_HOST_VAR = 'FIREBASE_DATABASE_EMULATOR_HOST';\r\nvar _staticInstance;\r\n/**\r\n * Creates and caches Repo instances.\r\n */\r\nvar RepoManager = /** @class */ (function () {\r\n function RepoManager() {\r\n /**\r\n * @private {!Object.<string, Object<string, !fb.core.Repo>>}\r\n */\r\n this.repos_ = {};\r\n /**\r\n * If true, new Repos will be created to use ReadonlyRestClient (for testing purposes).\r\n * @private {boolean}\r\n */\r\n this.useRestClient_ = false;\r\n }\r\n RepoManager.getInstance = function () {\r\n if (!_staticInstance) {\r\n _staticInstance = new RepoManager();\r\n }\r\n return _staticInstance;\r\n };\r\n // TODO(koss): Remove these functions unless used in tests?\r\n RepoManager.prototype.interrupt = function () {\r\n var e_1, _a, e_2, _b;\r\n try {\r\n for (var _c = __values(Object.keys(this.repos_)), _d = _c.next(); !_d.done; _d = _c.next()) {\r\n var appName = _d.value;\r\n try {\r\n for (var _e = (e_2 = void 0, __values(Object.keys(this.repos_[appName]))), _f = _e.next(); !_f.done; _f = _e.next()) {\r\n var dbUrl = _f.value;\r\n this.repos_[appName][dbUrl].interrupt();\r\n }\r\n }\r\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\r\n finally {\r\n try {\r\n if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\r\n }\r\n finally { if (e_2) throw e_2.error; }\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n };\r\n RepoManager.prototype.resume = function () {\r\n var e_3, _a, e_4, _b;\r\n try {\r\n for (var _c = __values(Object.keys(this.repos_)), _d = _c.next(); !_d.done; _d = _c.next()) {\r\n var appName = _d.value;\r\n try {\r\n for (var _e = (e_4 = void 0, __values(Object.keys(this.repos_[appName]))), _f = _e.next(); !_f.done; _f = _e.next()) {\r\n var dbUrl = _f.value;\r\n this.repos_[appName][dbUrl].resume();\r\n }\r\n }\r\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\r\n finally {\r\n try {\r\n if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\r\n }\r\n finally { if (e_4) throw e_4.error; }\r\n }\r\n }\r\n }\r\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\r\n finally {\r\n try {\r\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\r\n }\r\n finally { if (e_3) throw e_3.error; }\r\n }\r\n };\r\n /**\r\n * Update an existing repo in place to point to a new host/port.\r\n */\r\n RepoManager.prototype.applyEmulatorSettings = function (repo, host, port) {\r\n repo.repoInfo_ = new RepoInfo(host + \":\" + port, \r\n /* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams);\r\n if (repo.repoInfo_.nodeAdmin) {\r\n repo.authTokenProvider_ = new EmulatorAdminTokenProvider();\r\n }\r\n };\r\n /**\r\n * This function should only ever be called to CREATE a new database instance.\r\n *\r\n * @param {!FirebaseApp} app\r\n * @return {!Database}\r\n */\r\n RepoManager.prototype.databaseFromApp = function (app, authProvider, url, nodeAdmin) {\r\n var dbUrl = url || app.options.databaseURL;\r\n if (dbUrl === undefined) {\r\n if (!app.options.projectId) {\r\n fatal(\"Can't determine Firebase Database URL. Be sure to include \" +\r\n ' a Project ID when calling firebase.initializeApp().');\r\n }\r\n log('Using default host for project ', app.options.projectId);\r\n dbUrl = app.options.projectId + \"-default-rtdb.firebaseio.com\";\r\n }\r\n var parsedUrl = parseRepoInfo(dbUrl, nodeAdmin);\r\n var repoInfo = parsedUrl.repoInfo;\r\n var isEmulator;\r\n var dbEmulatorHost = undefined;\r\n if (typeof process !== 'undefined') {\r\n dbEmulatorHost = process.env[FIREBASE_DATABASE_EMULATOR_HOST_VAR];\r\n }\r\n if (dbEmulatorHost) {\r\n isEmulator = true;\r\n dbUrl = \"http://\" + dbEmulatorHost + \"?ns=\" + repoInfo.namespace;\r\n parsedUrl = parseRepoInfo(dbUrl, nodeAdmin);\r\n repoInfo = parsedUrl.repoInfo;\r\n }\r\n else {\r\n isEmulator = !parsedUrl.repoInfo.secure;\r\n }\r\n var authTokenProvider = nodeAdmin && isEmulator\r\n ? new EmulatorAdminTokenProvider()\r\n : new FirebaseAuthTokenProvider(app, authProvider);\r\n validateUrl('Invalid Firebase Database URL', 1, parsedUrl);\r\n if (!parsedUrl.path.isEmpty()) {\r\n fatal('Database URL must point to the root of a Firebase Database ' +\r\n '(not including a child path).');\r\n }\r\n var repo = this.createRepo(repoInfo, app, authTokenProvider);\r\n return repo.database;\r\n };\r\n /**\r\n * Remove the repo and make sure it is disconnected.\r\n *\r\n * @param {!Repo} repo\r\n */\r\n RepoManager.prototype.deleteRepo = function (repo) {\r\n var appRepos = safeGet(this.repos_, repo.app.name);\r\n // This should never happen...\r\n if (!appRepos || safeGet(appRepos, repo.key) !== repo) {\r\n fatal(\"Database \" + repo.app.name + \"(\" + repo.repoInfo_ + \") has already been deleted.\");\r\n }\r\n repo.interrupt();\r\n delete appRepos[repo.key];\r\n };\r\n /**\r\n * Ensures a repo doesn't already exist and then creates one using the\r\n * provided app.\r\n *\r\n * @param {!RepoInfo} repoInfo The metadata about the Repo\r\n * @param {!FirebaseApp} app\r\n * @return {!Repo} The Repo object for the specified server / repoName.\r\n */\r\n RepoManager.prototype.createRepo = function (repoInfo, app, authTokenProvider) {\r\n var appRepos = safeGet(this.repos_, app.name);\r\n if (!appRepos) {\r\n appRepos = {};\r\n this.repos_[app.name] = appRepos;\r\n }\r\n var repo = safeGet(appRepos, repoInfo.toURLString());\r\n if (repo) {\r\n fatal('Database initialized multiple times. Please make sure the format of the database URL matches with each database() call.');\r\n }\r\n repo = new Repo(repoInfo, this.useRestClient_, app, authTokenProvider);\r\n appRepos[repoInfo.toURLString()] = repo;\r\n return repo;\r\n };\r\n /**\r\n * Forces us to use ReadonlyRestClient instead of PersistentConnection for new Repos.\r\n * @param {boolean} forceRestClient\r\n */\r\n RepoManager.prototype.forceRestClient = function (forceRestClient) {\r\n this.useRestClient_ = forceRestClient;\r\n };\r\n return RepoManager;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Class representing a firebase database.\r\n * @implements {FirebaseService}\r\n */\r\nvar Database = /** @class */ (function () {\r\n /**\r\n * The constructor should not be called by users of our public API.\r\n * @param {!Repo} repoInternal_\r\n */\r\n function Database(repoInternal_) {\r\n var _this = this;\r\n this.repoInternal_ = repoInternal_;\r\n /** Track if the instance has been used (root or repo accessed) */\r\n this.instanceStarted_ = false;\r\n this.INTERNAL = {\r\n delete: function () { return __awaiter(_this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n this.checkDeleted_('delete');\r\n RepoManager.getInstance().deleteRepo(this.repo_);\r\n this.repoInternal_ = null;\r\n this.rootInternal_ = null;\r\n return [2 /*return*/];\r\n });\r\n }); }\r\n };\r\n if (!(repoInternal_ instanceof Repo)) {\r\n fatal(\"Don't call new Database() directly - please use firebase.database().\");\r\n }\r\n }\r\n Object.defineProperty(Database.prototype, \"repo_\", {\r\n get: function () {\r\n if (!this.instanceStarted_) {\r\n this.repoInternal_.start();\r\n this.instanceStarted_ = true;\r\n }\r\n return this.repoInternal_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Database.prototype, \"root_\", {\r\n get: function () {\r\n if (!this.rootInternal_) {\r\n this.rootInternal_ = new Reference(this.repo_, Path.Empty);\r\n }\r\n return this.rootInternal_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Database.prototype, \"app\", {\r\n get: function () {\r\n return this.repo_.app;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Modify this instance to communicate with the Realtime Database emulator.\r\n *\r\n * <p>Note: This method must be called before performing any other operation.\r\n *\r\n * @param host the emulator host (ex: localhost)\r\n * @param port the emulator port (ex: 8080)\r\n */\r\n Database.prototype.useEmulator = function (host, port) {\r\n this.checkDeleted_('useEmulator');\r\n if (this.instanceStarted_) {\r\n fatal('Cannot call useEmulator() after instance has already been initialized.');\r\n return;\r\n }\r\n // Modify the repo to apply emulator settings\r\n RepoManager.getInstance().applyEmulatorSettings(this.repoInternal_, host, port);\r\n };\r\n Database.prototype.ref = function (path) {\r\n this.checkDeleted_('ref');\r\n validateArgCount('database.ref', 0, 1, arguments.length);\r\n if (path instanceof Reference) {\r\n return this.refFromURL(path.toString());\r\n }\r\n return path !== undefined ? this.root_.child(path) : this.root_;\r\n };\r\n /**\r\n * Returns a reference to the root or the path specified in url.\r\n * We throw a exception if the url is not in the same domain as the\r\n * current repo.\r\n * @param {string} url\r\n * @return {!Reference} Firebase reference.\r\n */\r\n Database.prototype.refFromURL = function (url) {\r\n /** @const {string} */\r\n var apiName = 'database.refFromURL';\r\n this.checkDeleted_(apiName);\r\n validateArgCount(apiName, 1, 1, arguments.length);\r\n var parsedURL = parseRepoInfo(url, this.repo_.repoInfo_.nodeAdmin);\r\n validateUrl(apiName, 1, parsedURL);\r\n var repoInfo = parsedURL.repoInfo;\r\n if (!repoInfo.isCustomHost() && repoInfo.host !== this.repo_.repoInfo_.host) {\r\n fatal(apiName +\r\n ': Host name does not match the current database: ' +\r\n '(found ' +\r\n repoInfo.host +\r\n ' but expected ' +\r\n this.repo_.repoInfo_.host +\r\n ')');\r\n }\r\n return this.ref(parsedURL.path.toString());\r\n };\r\n /**\r\n * @param {string} apiName\r\n */\r\n Database.prototype.checkDeleted_ = function (apiName) {\r\n if (this.repoInternal_ === null) {\r\n fatal('Cannot call ' + apiName + ' on a deleted database.');\r\n }\r\n };\r\n // Make individual repo go offline.\r\n Database.prototype.goOffline = function () {\r\n validateArgCount('database.goOffline', 0, 0, arguments.length);\r\n this.checkDeleted_('goOffline');\r\n this.repo_.interrupt();\r\n };\r\n Database.prototype.goOnline = function () {\r\n validateArgCount('database.goOnline', 0, 0, arguments.length);\r\n this.checkDeleted_('goOnline');\r\n this.repo_.resume();\r\n };\r\n Database.ServerValue = {\r\n TIMESTAMP: {\r\n '.sv': 'timestamp'\r\n },\r\n increment: function (delta) {\r\n return {\r\n '.sv': {\r\n 'increment': delta\r\n }\r\n };\r\n }\r\n };\r\n return Database;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * INTERNAL methods for internal-use only (tests, etc.).\r\n *\r\n * Customers shouldn't use these or else should be aware that they could break at any time.\r\n *\r\n * @const\r\n */\r\nvar forceLongPolling = function () {\r\n WebSocketConnection.forceDisallow();\r\n BrowserPollConnection.forceAllow();\r\n};\r\nvar forceWebSockets = function () {\r\n BrowserPollConnection.forceDisallow();\r\n};\r\n/* Used by App Manager */\r\nvar isWebSocketsAvailable = function () {\r\n return WebSocketConnection['isAvailable']();\r\n};\r\nvar setSecurityDebugCallback = function (ref, callback) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n ref.repo.persistentConnection_.securityDebugCallback_ = callback;\r\n};\r\nvar stats = function (ref, showDelta) {\r\n ref.repo.stats(showDelta);\r\n};\r\nvar statsIncrementCounter = function (ref, metric) {\r\n ref.repo.statsIncrementCounter(metric);\r\n};\r\nvar dataUpdateCount = function (ref) {\r\n return ref.repo.dataUpdateCount;\r\n};\r\nvar interceptServerData = function (ref, callback) {\r\n return ref.repo.interceptServerData_(callback);\r\n};\r\n/**\r\n * Used by console to create a database based on the app,\r\n * passed database URL and a custom auth implementation.\r\n *\r\n * @param app A valid FirebaseApp-like object\r\n * @param url A valid Firebase databaseURL\r\n * @param version custom version e.g. firebase-admin version\r\n * @param customAuthImpl custom auth implementation\r\n */\r\nfunction initStandalone(_a) {\r\n var app = _a.app, url = _a.url, version = _a.version, customAuthImpl = _a.customAuthImpl, namespace = _a.namespace, _b = _a.nodeAdmin, nodeAdmin = _b === void 0 ? false : _b;\r\n setSDKVersion(version);\r\n /**\r\n * ComponentContainer('database-standalone') is just a placeholder that doesn't perform\r\n * any actual function.\r\n */\r\n var authProvider = new Provider('auth-internal', new ComponentContainer('database-standalone'));\r\n authProvider.setComponent(new Component('auth-internal', function () { return customAuthImpl; }, \"PRIVATE\" /* PRIVATE */));\r\n return {\r\n instance: RepoManager.getInstance().databaseFromApp(app, authProvider, url, nodeAdmin),\r\n namespace: namespace\r\n };\r\n}\n\nvar INTERNAL = /*#__PURE__*/Object.freeze({\n __proto__: null,\n forceLongPolling: forceLongPolling,\n forceWebSockets: forceWebSockets,\n isWebSocketsAvailable: isWebSocketsAvailable,\n setSecurityDebugCallback: setSecurityDebugCallback,\n stats: stats,\n statsIncrementCounter: statsIncrementCounter,\n dataUpdateCount: dataUpdateCount,\n interceptServerData: interceptServerData,\n initStandalone: initStandalone\n});\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DataConnection = PersistentConnection;\r\n/**\r\n * @param {!string} pathString\r\n * @param {function(*)} onComplete\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nPersistentConnection.prototype.simpleListen = function (pathString, onComplete) {\r\n this.sendRequest('q', { p: pathString }, onComplete);\r\n};\r\n/**\r\n * @param {*} data\r\n * @param {function(*)} onEcho\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nPersistentConnection.prototype.echo = function (data, onEcho) {\r\n this.sendRequest('echo', { d: data }, onEcho);\r\n};\r\n// RealTimeConnection properties that we use in tests.\r\nvar RealTimeConnection = Connection;\r\n/**\r\n * @param {function(): string} newHash\r\n * @return {function()}\r\n */\r\nvar hijackHash = function (newHash) {\r\n var oldPut = PersistentConnection.prototype.put;\r\n PersistentConnection.prototype.put = function (pathString, data, onComplete, hash) {\r\n if (hash !== undefined) {\r\n hash = newHash();\r\n }\r\n oldPut.call(this, pathString, data, onComplete, hash);\r\n };\r\n return function () {\r\n PersistentConnection.prototype.put = oldPut;\r\n };\r\n};\r\n/**\r\n * @type {function(new:RepoInfo, !string, boolean, !string, boolean): undefined}\r\n */\r\nvar ConnectionTarget = RepoInfo;\r\n/**\r\n * @param {!Query} query\r\n * @return {!string}\r\n */\r\nvar queryIdentifier = function (query) {\r\n return query.queryIdentifier();\r\n};\r\n/**\r\n * Forces the RepoManager to create Repos that use ReadonlyRestClient instead of PersistentConnection.\r\n *\r\n * @param {boolean} forceRestClient\r\n */\r\nvar forceRestClient = function (forceRestClient) {\r\n RepoManager.getInstance().forceRestClient(forceRestClient);\r\n};\n\nvar TEST_ACCESS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n DataConnection: DataConnection,\n RealTimeConnection: RealTimeConnection,\n hijackHash: hijackHash,\n ConnectionTarget: ConnectionTarget,\n queryIdentifier: queryIdentifier,\n forceRestClient: forceRestClient\n});\n\nvar name = \"@firebase/database\";\nvar version = \"0.7.0\";\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar ServerValue = Database.ServerValue;\r\nfunction registerDatabase(instance) {\r\n // set SDK_VERSION\r\n setSDKVersion(instance.SDK_VERSION);\r\n // Register the Database Service with the 'firebase' namespace.\r\n var namespace = instance.INTERNAL.registerComponent(new Component('database', function (container, url) {\r\n /* Dependencies */\r\n // getImmediate for FirebaseApp will always succeed\r\n var app = container.getProvider('app').getImmediate();\r\n var authProvider = container.getProvider('auth-internal');\r\n return RepoManager.getInstance().databaseFromApp(app, authProvider, url);\r\n }, \"PUBLIC\" /* PUBLIC */)\r\n .setServiceProps(\r\n // firebase.database namespace properties\r\n {\r\n Reference: Reference,\r\n Query: Query,\r\n Database: Database,\r\n DataSnapshot: DataSnapshot,\r\n enableLogging: enableLogging,\r\n INTERNAL: INTERNAL,\r\n ServerValue: ServerValue,\r\n TEST_ACCESS: TEST_ACCESS\r\n })\r\n .setMultipleInstances(true));\r\n instance.registerVersion(name, version);\r\n if (isNodeSdk()) {\r\n module.exports = namespace;\r\n }\r\n}\r\nregisterDatabase(firebase);\n\nexport { DataSnapshot, Database, OnDisconnect, Query, Reference, ServerValue, enableLogging, registerDatabase };\n//# sourceMappingURL=index.esm.js.map\n","import { __extends as t, __awaiter as e, __generator as n, __spreadArrays as r } from \"tslib\";\n\nimport i from \"@firebase/app\";\n\nimport { Logger as o, LogLevel as u } from \"@firebase/logger\";\n\nimport { getUA as s, isMobileCordova as a, isReactNative as c, isElectron as h, isIE as f, isUWP as l, isBrowserExtension as p } from \"@firebase/util\";\n\nimport { XhrIo as d, EventType as v, ErrorCode as y, createWebChannelTransport as m, WebChannel as g } from \"@firebase/webchannel-wrapper\";\n\nimport { Component as w } from \"@firebase/component\";\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Converts a Base64 encoded string to a binary string. */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ var b = {\n // Causes are copied from:\n // https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\n /** Not an error; returned on success. */\n OK: \"ok\",\n /** The operation was cancelled (typically by the caller). */\n CANCELLED: \"cancelled\",\n /** Unknown error or an error from a different error domain. */\n UNKNOWN: \"unknown\",\n /**\n * Client specified an invalid argument. Note that this differs from\n * FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are\n * problematic regardless of the state of the system (e.g., a malformed file\n * name).\n */\n INVALID_ARGUMENT: \"invalid-argument\",\n /**\n * Deadline expired before operation could complete. For operations that\n * change the state of the system, this error may be returned even if the\n * operation has completed successfully. For example, a successful response\n * from a server could have been delayed long enough for the deadline to\n * expire.\n */\n DEADLINE_EXCEEDED: \"deadline-exceeded\",\n /** Some requested entity (e.g., file or directory) was not found. */\n NOT_FOUND: \"not-found\",\n /**\n * Some entity that we attempted to create (e.g., file or directory) already\n * exists.\n */\n ALREADY_EXISTS: \"already-exists\",\n /**\n * The caller does not have permission to execute the specified operation.\n * PERMISSION_DENIED must not be used for rejections caused by exhausting\n * some resource (use RESOURCE_EXHAUSTED instead for those errors).\n * PERMISSION_DENIED must not be used if the caller can not be identified\n * (use UNAUTHENTICATED instead for those errors).\n */\n PERMISSION_DENIED: \"permission-denied\",\n /**\n * The request does not have valid authentication credentials for the\n * operation.\n */\n UNAUTHENTICATED: \"unauthenticated\",\n /**\n * Some resource has been exhausted, perhaps a per-user quota, or perhaps the\n * entire file system is out of space.\n */\n RESOURCE_EXHAUSTED: \"resource-exhausted\",\n /**\n * Operation was rejected because the system is not in a state required for\n * the operation's execution. For example, directory to be deleted may be\n * non-empty, an rmdir operation is applied to a non-directory, etc.\n *\n * A litmus test that may help a service implementor in deciding\n * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:\n * (a) Use UNAVAILABLE if the client can retry just the failing call.\n * (b) Use ABORTED if the client should retry at a higher-level\n * (e.g., restarting a read-modify-write sequence).\n * (c) Use FAILED_PRECONDITION if the client should not retry until\n * the system state has been explicitly fixed. E.g., if an \"rmdir\"\n * fails because the directory is non-empty, FAILED_PRECONDITION\n * should be returned since the client should not retry unless\n * they have first fixed up the directory by deleting files from it.\n * (d) Use FAILED_PRECONDITION if the client performs conditional\n * REST Get/Update/Delete on a resource and the resource on the\n * server does not match the condition. E.g., conflicting\n * read-modify-write on the same resource.\n */\n FAILED_PRECONDITION: \"failed-precondition\",\n /**\n * The operation was aborted, typically due to a concurrency issue like\n * sequencer check failures, transaction aborts, etc.\n *\n * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\n * and UNAVAILABLE.\n */\n ABORTED: \"aborted\",\n /**\n * Operation was attempted past the valid range. E.g., seeking or reading\n * past end of file.\n *\n * Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed\n * if the system state changes. For example, a 32-bit file system will\n * generate INVALID_ARGUMENT if asked to read at an offset that is not in the\n * range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from\n * an offset past the current file size.\n *\n * There is a fair bit of overlap between FAILED_PRECONDITION and\n * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)\n * when it applies so that callers who are iterating through a space can\n * easily look for an OUT_OF_RANGE error to detect when they are done.\n */\n OUT_OF_RANGE: \"out-of-range\",\n /** Operation is not implemented or not supported/enabled in this service. */\n UNIMPLEMENTED: \"unimplemented\",\n /**\n * Internal errors. Means some invariants expected by underlying System has\n * been broken. If you see one of these errors, Something is very broken.\n */\n INTERNAL: \"internal\",\n /**\n * The service is currently unavailable. This is a most likely a transient\n * condition and may be corrected by retrying with a backoff.\n *\n * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\n * and UNAVAILABLE.\n */\n UNAVAILABLE: \"unavailable\",\n /** Unrecoverable data loss or corruption. */\n DATA_LOSS: \"data-loss\"\n}, I = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this, n) || this).code = t, r.message = n, r.name = \"FirebaseError\", \n // HACK: We write a toString property directly because Error is not a real\n // class and so inheritance does not work correctly. We could alternatively\n // do the same \"back-door inheritance\" trick that FirebaseError does.\n r.toString = function() {\n return r.name + \": [code=\" + r.code + \"]: \" + r.message;\n }, r;\n }\n return t(n, e), n;\n}(Error), E = new o(\"@firebase/firestore\");\n\n/** An error returned by a Firestore operation. */\n// Helper methods are needed because variables can't be exported as read/write\nfunction _() {\n return E.logLevel;\n}\n\n/**\n * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).\n *\n * @param logLevel\n * The verbosity you set for activity and error logging. Can be any of\n * the following values:\n *\n * <ul>\n * <li>`debug` for the most verbose logging level, primarily for\n * debugging.</li>\n * <li>`error` to log errors only.</li>\n * <li><code>`silent` to turn off logging.</li>\n * </ul>\n */ function T(t) {\n for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];\n if (E.logLevel <= u.DEBUG) {\n var i = e.map(D);\n E.debug.apply(E, r([ \"Firestore (8.0.0): \" + t ], i));\n }\n}\n\nfunction N(t) {\n for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];\n if (E.logLevel <= u.ERROR) {\n var i = e.map(D);\n E.error.apply(E, r([ \"Firestore (8.0.0): \" + t ], i));\n }\n}\n\nfunction A(t) {\n for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];\n if (E.logLevel <= u.WARN) {\n var i = e.map(D);\n E.warn.apply(E, r([ \"Firestore (8.0.0): \" + t ], i));\n }\n}\n\n/**\n * Converts an additional log parameter to a string representation.\n */ function D(t) {\n if (\"string\" == typeof t) return t;\n try {\n return e = t, JSON.stringify(e);\n } catch (e) {\n // Converting to JSON failed, just log the object directly\n return t;\n }\n /**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n /** Formats an object as a JSON string, suitable for logging. */ var e;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Unconditionally fails, throwing an Error with the given message.\n * Messages are stripped in production builds.\n *\n * Returns `never` and can be used in expressions:\n * @example\n * let futureVar = fail('not implemented yet');\n */ function S(t) {\n void 0 === t && (t = \"Unexpected state\");\n // Log the failure in addition to throw an exception, just in case the\n // exception is swallowed.\n var e = \"FIRESTORE (8.0.0) INTERNAL ASSERTION FAILED: \" + t;\n // NOTE: We don't use FirestoreError here because these are internal failures\n // that cannot be handled by the user. (Also it would create a circular\n // dependency between the error and assert modules which doesn't work.)\n throw N(e), new Error(e)\n /**\n * Fails if the given assertion condition is false, throwing an Error with the\n * given message if it did.\n *\n * Messages are stripped in production builds.\n */;\n}\n\nfunction x(t, e) {\n t || S();\n}\n\n/**\n * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an\n * instance of `T` before casting.\n */ function k(t, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ne) {\n return t;\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Generates `nBytes` of random bytes.\n *\n * If `nBytes < 0` , an error will be thrown.\n */ function P(t) {\n // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.\n var e = \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n \"undefined\" != typeof self && (self.crypto || self.msCrypto), n = new Uint8Array(t);\n if (e && \"function\" == typeof e.getRandomValues) e.getRandomValues(n); else \n // Falls back to Math.random\n for (var r = 0; r < t; r++) n[r] = Math.floor(256 * Math.random());\n return n;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ var O = /** @class */ function() {\n function t() {}\n return t.t = function() {\n for (\n // Alphanumeric characters\n var t = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\", e = Math.floor(256 / t.length) * t.length, n = \"\"\n // The largest byte value that is a multiple of `char.length`.\n ; n.length < 20; ) for (var r = P(40), i = 0; i < r.length; ++i) \n // Only accept values that are [0, maxMultiple), this ensures they can\n // be evenly mapped to indices of `chars` via a modulo operation.\n n.length < 20 && r[i] < e && (n += t.charAt(r[i] % t.length));\n return n;\n }, t;\n}();\n\nfunction L(t, e) {\n return t < e ? -1 : t > e ? 1 : 0;\n}\n\n/** Helper to compare arrays using isEqual(). */ function V(t, e, n) {\n return t.length === e.length && t.every((function(t, r) {\n return n(t, e[r]);\n }));\n}\n\n/**\n * Returns the immediate lexicographically-following string. This is useful to\n * construct an inclusive range for indexeddb iterators.\n */ function R(t) {\n // Return the input string, with an additional NUL byte appended.\n return t + \"\\0\";\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Immutable class that represents a \"proto\" byte string.\n *\n * Proto byte strings can either be Base64-encoded strings or Uint8Arrays when\n * sent on the wire. This class abstracts away this differentiation by holding\n * the proto byte string in a common class that must be converted into a string\n * before being sent as a proto.\n */ var C = /** @class */ function() {\n function t(t) {\n this.i = t;\n }\n return t.fromBase64String = function(e) {\n return new t(atob(e));\n }, t.fromUint8Array = function(e) {\n return new t(\n /**\n * Helper function to convert an Uint8array to a binary string.\n */\n function(t) {\n for (var e = \"\", n = 0; n < t.length; ++n) e += String.fromCharCode(t[n]);\n return e;\n }(e));\n }, t.prototype.toBase64 = function() {\n return t = this.i, btoa(t);\n /** Converts a binary string to a Base64 encoded string. */ var t;\n /** True if and only if the Base64 conversion functions are available. */ }, \n t.prototype.toUint8Array = function() {\n return function(t) {\n for (var e = new Uint8Array(t.length), n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);\n return e;\n }(this.i);\n }, t.prototype.o = function() {\n return 2 * this.i.length;\n }, t.prototype.h = function(t) {\n return L(this.i, t.i);\n }, t.prototype.isEqual = function(t) {\n return this.i === t.i;\n }, t;\n}();\n\nC.u = new C(\"\");\n\nvar U = /** @class */ function() {\n function t(t) {\n this.l = t;\n }\n /**\n * Creates a new `Bytes` object from the given Base64 string, converting it to\n * bytes.\n *\n * @param base64 The Base64 string used to create the `Bytes` object.\n */ return t.fromBase64String = function(e) {\n try {\n return new t(C.fromBase64String(e));\n } catch (e) {\n throw new I(b.INVALID_ARGUMENT, \"Failed to construct Bytes from Base64 string: \" + e);\n }\n }, \n /**\n * Creates a new `Bytes` object from the given Uint8Array.\n *\n * @param array The Uint8Array used to create the `Bytes` object.\n */\n t.fromUint8Array = function(e) {\n return new t(C.fromUint8Array(e));\n }, \n /**\n * Returns the underlying bytes as a Base64-encoded string.\n *\n * @return The Base64-encoded string created from the `Bytes` object.\n */\n t.prototype.toBase64 = function() {\n return this.l.toBase64();\n }, \n /**\n * Returns the underlying bytes in a new `Uint8Array`.\n *\n * @return The Uint8Array created from the `Bytes` object.\n */\n t.prototype.toUint8Array = function() {\n return this.l.toUint8Array();\n }, \n /**\n * Returns a string representation of the `Bytes` object.\n *\n * @return A string representation of the `Bytes` object.\n */\n t.prototype.toString = function() {\n return \"Bytes(base64: \" + this.toBase64() + \")\";\n }, \n /**\n * Returns true if this `Bytes` object is equal to the provided one.\n *\n * @param other The `Bytes` object to compare against.\n * @return true if this `Bytes` object is equal to the provided one.\n */\n t.prototype.isEqual = function(t) {\n return this.l.isEqual(t.l);\n }, t;\n}();\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Helper function to assert Uint8Array is available at runtime. */ function M() {\n if (\"undefined\" == typeof Uint8Array) throw new I(b.UNIMPLEMENTED, \"Uint8Arrays are not available in this environment.\");\n}\n\n/** Helper function to assert Base64 functions are available at runtime. */ function q() {\n if (\"undefined\" == typeof atob) throw new I(b.UNIMPLEMENTED, \"Blobs are unavailable in Firestore in this environment.\");\n}\n\n/**\n * Immutable class holding a blob (binary data).\n *\n * This class is directly exposed in the public API. It extends the Bytes class\n * of the firestore-exp API to support `instanceof Bytes` checks during user\n * data conversion.\n *\n * Note that while you can't hide the constructor in JavaScript code, we are\n * using the hack above to make sure no-one outside this module can call it.\n */ var F = /** @class */ function(e) {\n function n() {\n return null !== e && e.apply(this, arguments) || this;\n }\n return t(n, e), n.fromBase64String = function(t) {\n q();\n try {\n return new n(C.fromBase64String(t));\n } catch (t) {\n throw new I(b.INVALID_ARGUMENT, \"Failed to construct Blob from Base64 string: \" + t);\n }\n }, n.fromUint8Array = function(t) {\n return M(), new n(C.fromUint8Array(t));\n }, n.prototype.toBase64 = function() {\n return q(), e.prototype.toBase64.call(this);\n }, n.prototype.toUint8Array = function() {\n return M(), e.prototype.toUint8Array.call(this);\n }, n.prototype.toString = function() {\n return \"Blob(base64: \" + this.toBase64() + \")\";\n }, n;\n}(U), j = \n/**\n * Constructs a DatabaseInfo using the provided host, databaseId and\n * persistenceKey.\n *\n * @param databaseId The database to use.\n * @param persistenceKey A unique identifier for this Firestore's local\n * storage (used in conjunction with the databaseId).\n * @param host The Firestore backend host to connect to.\n * @param ssl Whether to use SSL when connecting.\n * @param forceLongPolling Whether to use the forceLongPolling option\n * when using WebChannel as the network transport.\n * @param autoDetectLongPolling Whether to use the detectBufferingProxy\n * option when using WebChannel as the network transport.\n */\nfunction(t, e, n, r, i, o) {\n this._ = t, this.persistenceKey = e, this.host = n, this.ssl = r, this.forceLongPolling = i, \n this.T = o;\n}, G = /** @class */ function() {\n function t(t, e) {\n this.projectId = t, this.database = e || \"(default)\";\n }\n return Object.defineProperty(t.prototype, \"I\", {\n get: function() {\n return \"(default)\" === this.database;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.isEqual = function(e) {\n return e instanceof t && e.projectId === this.projectId && e.database === this.database;\n }, t.prototype.h = function(t) {\n return L(this.projectId, t.projectId) || L(this.database, t.database);\n }, t;\n}();\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction B(t) {\n var e = 0;\n for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;\n return e;\n}\n\nfunction z(t, e) {\n for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);\n}\n\nfunction K(t) {\n for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;\n return !0;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A map implementation that uses objects as keys. Objects must have an\n * associated equals function and must be immutable. Entries in the map are\n * stored together with the key being produced from the mapKeyFn. This map\n * automatically handles collisions of keys.\n */ var W = /** @class */ function() {\n function t(t, e) {\n this.m = t, this.A = e, \n /**\n * The inner map for a key -> value pair. Due to the possibility of\n * collisions we keep a list of entries that we do a linear search through\n * to find an actual match. Note that collisions should be rare, so we still\n * expect near constant time lookups in practice.\n */\n this.R = {}\n /** Get a value for this key, or undefined if it does not exist. */;\n }\n return t.prototype.get = function(t) {\n var e = this.m(t), n = this.R[e];\n if (void 0 !== n) for (var r = 0, i = n; r < i.length; r++) {\n var o = i[r], u = o[0], s = o[1];\n if (this.A(u, t)) return s;\n }\n }, t.prototype.has = function(t) {\n return void 0 !== this.get(t);\n }, \n /** Put this key and value in the map. */ t.prototype.set = function(t, e) {\n var n = this.m(t), r = this.R[n];\n if (void 0 !== r) {\n for (var i = 0; i < r.length; i++) if (this.A(r[i][0], t)) return void (r[i] = [ t, e ]);\n r.push([ t, e ]);\n } else this.R[n] = [ [ t, e ] ];\n }, \n /**\n * Remove this key from the map. Returns a boolean if anything was deleted.\n */\n t.prototype.delete = function(t) {\n var e = this.m(t), n = this.R[e];\n if (void 0 === n) return !1;\n for (var r = 0; r < n.length; r++) if (this.A(n[r][0], t)) return 1 === n.length ? delete this.R[e] : n.splice(r, 1), \n !0;\n return !1;\n }, t.prototype.forEach = function(t) {\n z(this.R, (function(e, n) {\n for (var r = 0, i = n; r < i.length; r++) {\n var o = i[r], u = o[0], s = o[1];\n t(u, s);\n }\n }));\n }, t.prototype.P = function() {\n return K(this.R);\n }, t;\n}(), Q = /** @class */ function() {\n /**\n * Creates a new timestamp.\n *\n * @param seconds The number of seconds of UTC time since Unix epoch\n * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n * 9999-12-31T23:59:59Z inclusive.\n * @param nanoseconds The non-negative fractions of a second at nanosecond\n * resolution. Negative second values with fractions must still have\n * non-negative nanoseconds values that count forward in time. Must be\n * from 0 to 999,999,999 inclusive.\n */\n function t(t, e) {\n if (this.seconds = t, this.nanoseconds = e, e < 0) throw new I(b.INVALID_ARGUMENT, \"Timestamp nanoseconds out of range: \" + e);\n if (e >= 1e9) throw new I(b.INVALID_ARGUMENT, \"Timestamp nanoseconds out of range: \" + e);\n if (t < -62135596800) throw new I(b.INVALID_ARGUMENT, \"Timestamp seconds out of range: \" + t);\n // This will break in the year 10,000.\n if (t >= 253402300800) throw new I(b.INVALID_ARGUMENT, \"Timestamp seconds out of range: \" + t);\n }\n /**\n * Creates a new timestamp with the current date, with millisecond precision.\n *\n * @return a new timestamp representing the current date.\n */ return t.now = function() {\n return t.fromMillis(Date.now());\n }, \n /**\n * Creates a new timestamp from the given date.\n *\n * @param date The date to initialize the `Timestamp` from.\n * @return A new `Timestamp` representing the same point in time as the given\n * date.\n */\n t.fromDate = function(e) {\n return t.fromMillis(e.getTime());\n }, \n /**\n * Creates a new timestamp from the given number of milliseconds.\n *\n * @param milliseconds Number of milliseconds since Unix epoch\n * 1970-01-01T00:00:00Z.\n * @return A new `Timestamp` representing the same point in time as the given\n * number of milliseconds.\n */\n t.fromMillis = function(e) {\n var n = Math.floor(e / 1e3);\n return new t(n, 1e6 * (e - 1e3 * n));\n }, \n /**\n * Converts a `Timestamp` to a JavaScript `Date` object. This conversion causes\n * a loss of precision since `Date` objects only support millisecond precision.\n *\n * @return JavaScript `Date` object representing the same point in time as\n * this `Timestamp`, with millisecond precision.\n */\n t.prototype.toDate = function() {\n return new Date(this.toMillis());\n }, \n /**\n * Converts a `Timestamp` to a numeric timestamp (in milliseconds since\n * epoch). This operation causes a loss of precision.\n *\n * @return The point in time corresponding to this timestamp, represented as\n * the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.\n */\n t.prototype.toMillis = function() {\n return 1e3 * this.seconds + this.nanoseconds / 1e6;\n }, t.prototype.g = function(t) {\n return this.seconds === t.seconds ? L(this.nanoseconds, t.nanoseconds) : L(this.seconds, t.seconds);\n }, \n /**\n * Returns true if this `Timestamp` is equal to the provided one.\n *\n * @param other The `Timestamp` to compare against.\n * @return true if this `Timestamp` is equal to the provided one.\n */\n t.prototype.isEqual = function(t) {\n return t.seconds === this.seconds && t.nanoseconds === this.nanoseconds;\n }, t.prototype.toString = function() {\n return \"Timestamp(seconds=\" + this.seconds + \", nanoseconds=\" + this.nanoseconds + \")\";\n }, t.prototype.toJSON = function() {\n return {\n seconds: this.seconds,\n nanoseconds: this.nanoseconds\n };\n }, \n /**\n * Converts this object to a primitive string, which allows Timestamp objects to be compared\n * using the `>`, `<=`, `>=` and `>` operators.\n */\n t.prototype.valueOf = function() {\n // This method returns a string of the form <seconds>.<nanoseconds> where <seconds> is\n // translated to have a non-negative value and both <seconds> and <nanoseconds> are left-padded\n // with zeroes to be a consistent length. Strings with this format then have a lexiographical\n // ordering that matches the expected ordering. The <seconds> translation is done to avoid\n // having a leading negative sign (i.e. a leading '-' character) in its string representation,\n // which would affect its lexiographical ordering.\n var t = this.seconds - -62135596800;\n // Note: Up to 12 decimal digits are required to represent all valid 'seconds' values.\n return String(t).padStart(12, \"0\") + \".\" + String(this.nanoseconds).padStart(9, \"0\");\n }, t;\n}(), H = /** @class */ function() {\n function t(t) {\n this.timestamp = t;\n }\n return t.V = function(e) {\n return new t(e);\n }, t.min = function() {\n return new t(new Q(0, 0));\n }, t.prototype.h = function(t) {\n return this.timestamp.g(t.timestamp);\n }, t.prototype.isEqual = function(t) {\n return this.timestamp.isEqual(t.timestamp);\n }, \n /** Returns a number representation of the version for use in spec tests. */ t.prototype.p = function() {\n // Convert to microseconds.\n return 1e6 * this.timestamp.seconds + this.timestamp.nanoseconds / 1e3;\n }, t.prototype.toString = function() {\n return \"SnapshotVersion(\" + this.timestamp.toString() + \")\";\n }, t.prototype.v = function() {\n return this.timestamp;\n }, t;\n}(), Y = /** @class */ function() {\n function t(t, e, n) {\n void 0 === e ? e = 0 : e > t.length && S(), void 0 === n ? n = t.length - e : n > t.length - e && S(), \n this.segments = t, this.offset = e, this.S = n;\n }\n return Object.defineProperty(t.prototype, \"length\", {\n get: function() {\n return this.S;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.isEqual = function(e) {\n return 0 === t.D(this, e);\n }, t.prototype.child = function(e) {\n var n = this.segments.slice(this.offset, this.limit());\n return e instanceof t ? e.forEach((function(t) {\n n.push(t);\n })) : n.push(e), this.C(n);\n }, \n /** The index of one past the last segment of the path. */ t.prototype.limit = function() {\n return this.offset + this.length;\n }, t.prototype.N = function(t) {\n return t = void 0 === t ? 1 : t, this.C(this.segments, this.offset + t, this.length - t);\n }, t.prototype.F = function() {\n return this.C(this.segments, this.offset, this.length - 1);\n }, t.prototype.k = function() {\n return this.segments[this.offset];\n }, t.prototype.O = function() {\n return this.get(this.length - 1);\n }, t.prototype.get = function(t) {\n return this.segments[this.offset + t];\n }, t.prototype.P = function() {\n return 0 === this.length;\n }, t.prototype.M = function(t) {\n if (t.length < this.length) return !1;\n for (var e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\n return !0;\n }, t.prototype.$ = function(t) {\n if (this.length + 1 !== t.length) return !1;\n for (var e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\n return !0;\n }, t.prototype.forEach = function(t) {\n for (var e = this.offset, n = this.limit(); e < n; e++) t(this.segments[e]);\n }, t.prototype.L = function() {\n return this.segments.slice(this.offset, this.limit());\n }, t.D = function(t, e) {\n for (var n = Math.min(t.length, e.length), r = 0; r < n; r++) {\n var i = t.get(r), o = e.get(r);\n if (i < o) return -1;\n if (i > o) return 1;\n }\n return t.length < e.length ? -1 : t.length > e.length ? 1 : 0;\n }, t;\n}(), X = /** @class */ function(e) {\n function n() {\n return null !== e && e.apply(this, arguments) || this;\n }\n return t(n, e), n.prototype.C = function(t, e, r) {\n return new n(t, e, r);\n }, n.prototype.B = function() {\n // NOTE: The client is ignorant of any path segments containing escape\n // sequences (e.g. __id123__) and just passes them through raw (they exist\n // for legacy reasons and should not be used frequently).\n return this.L().join(\"/\");\n }, n.prototype.toString = function() {\n return this.B();\n }, \n /**\n * Creates a resource path from the given slash-delimited string. If multiple\n * arguments are provided, all components are combined. Leading and trailing\n * slashes from all components are ignored.\n */\n n.q = function() {\n for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];\n // NOTE: The client is ignorant of any path segments containing escape\n // sequences (e.g. __id123__) and just passes them through raw (they exist\n // for legacy reasons and should not be used frequently).\n for (var r = [], i = 0, o = t; i < o.length; i++) {\n var u = o[i];\n if (u.indexOf(\"//\") >= 0) throw new I(b.INVALID_ARGUMENT, \"Invalid segment (\" + u + \"). Paths must not contain // in them.\");\n // Strip leading and traling slashed.\n r.push.apply(r, u.split(\"/\").filter((function(t) {\n return t.length > 0;\n })));\n }\n return new n(r);\n }, n.U = function() {\n return new n([]);\n }, n;\n}(Y), J = /^[_a-zA-Z][_a-zA-Z0-9]*$/, $ = /** @class */ function(e) {\n function n() {\n return null !== e && e.apply(this, arguments) || this;\n }\n return t(n, e), n.prototype.C = function(t, e, r) {\n return new n(t, e, r);\n }, \n /**\n * Returns true if the string could be used as a segment in a field path\n * without escaping.\n */\n n.K = function(t) {\n return J.test(t);\n }, n.prototype.B = function() {\n return this.L().map((function(t) {\n return t = t.replace(\"\\\\\", \"\\\\\\\\\").replace(\"`\", \"\\\\`\"), n.K(t) || (t = \"`\" + t + \"`\"), \n t;\n })).join(\".\");\n }, n.prototype.toString = function() {\n return this.B();\n }, \n /**\n * Returns true if this field references the key of a document.\n */\n n.prototype.W = function() {\n return 1 === this.length && \"__name__\" === this.get(0);\n }, \n /**\n * The field designating the key of a document.\n */\n n.j = function() {\n return new n([ \"__name__\" ]);\n }, \n /**\n * Parses a field string from the given server-formatted string.\n *\n * - Splitting the empty string is not allowed (for now at least).\n * - Empty segments within the string (e.g. if there are two consecutive\n * separators) are not allowed.\n *\n * TODO(b/37244157): we should make this more strict. Right now, it allows\n * non-identifier path components, even if they aren't escaped.\n */\n n.G = function(t) {\n for (var e = [], r = \"\", i = 0, o = function() {\n if (0 === r.length) throw new I(b.INVALID_ARGUMENT, \"Invalid field path (\" + t + \"). Paths must not be empty, begin with '.', end with '.', or contain '..'\");\n e.push(r), r = \"\";\n }, u = !1; i < t.length; ) {\n var s = t[i];\n if (\"\\\\\" === s) {\n if (i + 1 === t.length) throw new I(b.INVALID_ARGUMENT, \"Path has trailing escape character: \" + t);\n var a = t[i + 1];\n if (\"\\\\\" !== a && \".\" !== a && \"`\" !== a) throw new I(b.INVALID_ARGUMENT, \"Path has invalid escape sequence: \" + t);\n r += a, i += 2;\n } else \"`\" === s ? (u = !u, i++) : \".\" !== s || u ? (r += s, i++) : (o(), i++);\n }\n if (o(), u) throw new I(b.INVALID_ARGUMENT, \"Unterminated ` in path: \" + t);\n return new n(e);\n }, n.U = function() {\n return new n([]);\n }, n;\n}(Y), Z = /** @class */ function() {\n function t(t) {\n this.path = t;\n }\n return t.H = function(e) {\n return new t(X.q(e));\n }, t.J = function(e) {\n return new t(X.q(e).N(5));\n }, \n /** Returns true if the document is in the specified collectionId. */ t.prototype.Y = function(t) {\n return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;\n }, t.prototype.isEqual = function(t) {\n return null !== t && 0 === X.D(this.path, t.path);\n }, t.prototype.toString = function() {\n return this.path.toString();\n }, t.D = function(t, e) {\n return X.D(t.path, e.path);\n }, t.X = function(t) {\n return t.length % 2 == 0;\n }, \n /**\n * Creates and returns a new document key with the given segments.\n *\n * @param segments The segments of the path to the document\n * @return A new instance of DocumentKey\n */\n t.Z = function(e) {\n return new t(new X(e.slice()));\n }, t;\n}();\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// The earlist date supported by Firestore timestamps (0001-01-01T00:00:00Z).\n/**\n * A `Timestamp` represents a point in time independent of any time zone or\n * calendar, represented as seconds and fractions of seconds at nanosecond\n * resolution in UTC Epoch time.\n *\n * It is encoded using the Proleptic Gregorian Calendar which extends the\n * Gregorian calendar backwards to year one. It is encoded assuming all minutes\n * are 60 seconds long, i.e. leap seconds are \"smeared\" so that no leap second\n * table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to\n * 9999-12-31T23:59:59.999999999Z.\n *\n * @see https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto\n */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Returns whether a variable is either undefined or null.\n */\nfunction tt(t) {\n return null == t;\n}\n\n/** Returns whether the value represents -0. */ function et(t) {\n // Detect if the value is -0.0. Based on polyfill from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n return 0 === t && 1 / t == -1 / 0;\n}\n\n/**\n * Returns whether a value is an integer and in the safe integer range\n * @param value The value to test for being an integer and in the safe range\n */ function nt(t) {\n return \"number\" == typeof t && Number.isInteger(t) && !et(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Visible for testing\nvar rt = function(t, e, n, r, i, o, u) {\n void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []), \n void 0 === i && (i = null), void 0 === o && (o = null), void 0 === u && (u = null), \n this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = r, this.limit = i, \n this.startAt = o, this.endAt = u, this.tt = null;\n};\n\n/**\n * Initializes a Target with a path and optional additional query constraints.\n * Path must currently be empty if this is a collection group query.\n *\n * NOTE: you should always construct `Target` from `Query.toTarget` instead of\n * using this factory method, because `Query` provides an implicit `orderBy`\n * property.\n */ function it(t, e, n, r, i, o, u) {\n return void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []), \n void 0 === i && (i = null), void 0 === o && (o = null), void 0 === u && (u = null), \n new rt(t, e, n, r, i, o, u);\n}\n\nfunction ot(t) {\n var e = k(t);\n if (null === e.tt) {\n var n = e.path.B();\n null !== e.collectionGroup && (n += \"|cg:\" + e.collectionGroup), n += \"|f:\", n += e.filters.map((function(t) {\n return function(t) {\n // TODO(b/29183165): Technically, this won't be unique if two values have\n // the same description, such as the int 3 and the string \"3\". So we should\n // add the types in here somehow, too.\n return t.field.B() + t.op.toString() + Xt(t.value);\n }(t);\n })).join(\",\"), n += \"|ob:\", n += e.orderBy.map((function(t) {\n return (e = t).field.B() + e.dir;\n var e;\n })).join(\",\"), tt(e.limit) || (n += \"|l:\", n += e.limit), e.startAt && (n += \"|lb:\", \n n += er(e.startAt)), e.endAt && (n += \"|ub:\", n += er(e.endAt)), e.tt = n;\n }\n return e.tt;\n}\n\nfunction ut(t, e) {\n if (t.limit !== e.limit) return !1;\n if (t.orderBy.length !== e.orderBy.length) return !1;\n for (var n = 0; n < t.orderBy.length; n++) if (!ur(t.orderBy[n], e.orderBy[n])) return !1;\n if (t.filters.length !== e.filters.length) return !1;\n for (var r = 0; r < t.filters.length; r++) if (i = t.filters[r], o = e.filters[r], \n i.op !== o.op || !i.field.isEqual(o.field) || !Wt(i.value, o.value)) return !1;\n var i, o;\n return t.collectionGroup === e.collectionGroup && !!t.path.isEqual(e.path) && !!rr(t.startAt, e.startAt) && rr(t.endAt, e.endAt);\n}\n\nfunction st(t) {\n return Z.X(t.path) && null === t.collectionGroup && 0 === t.filters.length;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An immutable set of metadata that the local store tracks for each target.\n */ var at, ct, ht = /** @class */ function() {\n function t(\n /** The target being listened to. */\n t, \n /**\n * The target ID to which the target corresponds; Assigned by the\n * LocalStore for user listens and by the SyncEngine for limbo watches.\n */\n e, \n /** The purpose of the target. */\n n, \n /**\n * The sequence number of the last transaction during which this target data\n * was modified.\n */\n r, \n /** The latest snapshot version seen for this target. */\n i\n /**\n * The maximum snapshot version at which the associated view\n * contained no limbo documents.\n */ , o\n /**\n * An opaque, server-assigned token that allows watching a target to be\n * resumed after disconnecting without retransmitting all the data that\n * matches the target. The resume token essentially identifies a point in\n * time from which the server should resume sending results.\n */ , u) {\n void 0 === i && (i = H.min()), void 0 === o && (o = H.min()), void 0 === u && (u = C.u), \n this.target = t, this.targetId = e, this.et = n, this.sequenceNumber = r, this.nt = i, \n this.lastLimboFreeSnapshotVersion = o, this.resumeToken = u;\n }\n /** Creates a new target data instance with an updated sequence number. */ return t.prototype.st = function(e) {\n return new t(this.target, this.targetId, this.et, e, this.nt, this.lastLimboFreeSnapshotVersion, this.resumeToken);\n }, \n /**\n * Creates a new target data instance with an updated resume token and\n * snapshot version.\n */\n t.prototype.it = function(e, n) {\n return new t(this.target, this.targetId, this.et, this.sequenceNumber, n, this.lastLimboFreeSnapshotVersion, e);\n }, \n /**\n * Creates a new target data instance with an updated last limbo free\n * snapshot version number.\n */\n t.prototype.rt = function(e) {\n return new t(this.target, this.targetId, this.et, this.sequenceNumber, this.nt, e, this.resumeToken);\n }, t;\n}(), ft = \n// TODO(b/33078163): just use simplest form of existence filter for now\nfunction(t) {\n this.count = t;\n};\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Determines whether an error code represents a permanent error when received\n * in response to a non-write operation.\n *\n * See isPermanentWriteError for classifying write errors.\n */\nfunction lt(t) {\n switch (t) {\n case b.OK:\n return S();\n\n case b.CANCELLED:\n case b.UNKNOWN:\n case b.DEADLINE_EXCEEDED:\n case b.RESOURCE_EXHAUSTED:\n case b.INTERNAL:\n case b.UNAVAILABLE:\n // Unauthenticated means something went wrong with our token and we need\n // to retry with new credentials which will happen automatically.\n case b.UNAUTHENTICATED:\n return !1;\n\n case b.INVALID_ARGUMENT:\n case b.NOT_FOUND:\n case b.ALREADY_EXISTS:\n case b.PERMISSION_DENIED:\n case b.FAILED_PRECONDITION:\n // Aborted might be retried in some scenarios, but that is dependant on\n // the context and should handled individually by the calling code.\n // See https://cloud.google.com/apis/design/errors.\n case b.ABORTED:\n case b.OUT_OF_RANGE:\n case b.UNIMPLEMENTED:\n case b.DATA_LOSS:\n return !0;\n\n default:\n return S();\n }\n}\n\n/**\n * Determines whether an error code represents a permanent error when received\n * in response to a write operation.\n *\n * Write operations must be handled specially because as of b/119437764, ABORTED\n * errors on the write stream should be retried too (even though ABORTED errors\n * are not generally retryable).\n *\n * Note that during the initial handshake on the write stream an ABORTED error\n * signals that we should discard our stream token (i.e. it is permanent). This\n * means a handshake error should be classified with isPermanentError, above.\n */\n/**\n * Maps an error Code from GRPC status code number, like 0, 1, or 14. These\n * are not the same as HTTP status codes.\n *\n * @returns The Code equivalent to the given GRPC status code. Fails if there\n * is no match.\n */ function pt(t) {\n if (void 0 === t) \n // This shouldn't normally happen, but in certain error cases (like trying\n // to send invalid proto messages) we may get an error with no GRPC code.\n return N(\"GRPC error has no .code\"), b.UNKNOWN;\n switch (t) {\n case at.OK:\n return b.OK;\n\n case at.CANCELLED:\n return b.CANCELLED;\n\n case at.UNKNOWN:\n return b.UNKNOWN;\n\n case at.DEADLINE_EXCEEDED:\n return b.DEADLINE_EXCEEDED;\n\n case at.RESOURCE_EXHAUSTED:\n return b.RESOURCE_EXHAUSTED;\n\n case at.INTERNAL:\n return b.INTERNAL;\n\n case at.UNAVAILABLE:\n return b.UNAVAILABLE;\n\n case at.UNAUTHENTICATED:\n return b.UNAUTHENTICATED;\n\n case at.INVALID_ARGUMENT:\n return b.INVALID_ARGUMENT;\n\n case at.NOT_FOUND:\n return b.NOT_FOUND;\n\n case at.ALREADY_EXISTS:\n return b.ALREADY_EXISTS;\n\n case at.PERMISSION_DENIED:\n return b.PERMISSION_DENIED;\n\n case at.FAILED_PRECONDITION:\n return b.FAILED_PRECONDITION;\n\n case at.ABORTED:\n return b.ABORTED;\n\n case at.OUT_OF_RANGE:\n return b.OUT_OF_RANGE;\n\n case at.UNIMPLEMENTED:\n return b.UNIMPLEMENTED;\n\n case at.DATA_LOSS:\n return b.DATA_LOSS;\n\n default:\n return S();\n }\n}\n\n/**\n * Converts an HTTP response's error status to the equivalent error code.\n *\n * @param status An HTTP error response status (\"FAILED_PRECONDITION\",\n * \"UNKNOWN\", etc.)\n * @returns The equivalent Code. Non-matching responses are mapped to\n * Code.UNKNOWN.\n */ (ct = at || (at = {}))[ct.OK = 0] = \"OK\", ct[ct.CANCELLED = 1] = \"CANCELLED\", \nct[ct.UNKNOWN = 2] = \"UNKNOWN\", ct[ct.INVALID_ARGUMENT = 3] = \"INVALID_ARGUMENT\", \nct[ct.DEADLINE_EXCEEDED = 4] = \"DEADLINE_EXCEEDED\", ct[ct.NOT_FOUND = 5] = \"NOT_FOUND\", \nct[ct.ALREADY_EXISTS = 6] = \"ALREADY_EXISTS\", ct[ct.PERMISSION_DENIED = 7] = \"PERMISSION_DENIED\", \nct[ct.UNAUTHENTICATED = 16] = \"UNAUTHENTICATED\", ct[ct.RESOURCE_EXHAUSTED = 8] = \"RESOURCE_EXHAUSTED\", \nct[ct.FAILED_PRECONDITION = 9] = \"FAILED_PRECONDITION\", ct[ct.ABORTED = 10] = \"ABORTED\", \nct[ct.OUT_OF_RANGE = 11] = \"OUT_OF_RANGE\", ct[ct.UNIMPLEMENTED = 12] = \"UNIMPLEMENTED\", \nct[ct.INTERNAL = 13] = \"INTERNAL\", ct[ct.UNAVAILABLE = 14] = \"UNAVAILABLE\", ct[ct.DATA_LOSS = 15] = \"DATA_LOSS\";\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// An immutable sorted map implementation, based on a Left-leaning Red-Black\n// tree.\nvar dt = /** @class */ function() {\n function t(t, e) {\n this.D = t, this.root = e || yt.EMPTY;\n }\n // Returns a copy of the map, with the specified key/value added or replaced.\n return t.prototype.ot = function(e, n) {\n return new t(this.D, this.root.ot(e, n, this.D).copy(null, null, yt.at, null, null));\n }, \n // Returns a copy of the map, with the specified key removed.\n t.prototype.remove = function(e) {\n return new t(this.D, this.root.remove(e, this.D).copy(null, null, yt.at, null, null));\n }, \n // Returns the value of the node with the given key, or null.\n t.prototype.get = function(t) {\n for (var e = this.root; !e.P(); ) {\n var n = this.D(t, e.key);\n if (0 === n) return e.value;\n n < 0 ? e = e.left : n > 0 && (e = e.right);\n }\n return null;\n }, \n // Returns the index of the element in this sorted map, or -1 if it doesn't\n // exist.\n t.prototype.indexOf = function(t) {\n for (\n // Number of nodes that were pruned when descending right\n var e = 0, n = this.root; !n.P(); ) {\n var r = this.D(t, n.key);\n if (0 === r) return e + n.left.size;\n r < 0 ? n = n.left : (\n // Count all nodes left of the node plus the node itself\n e += n.left.size + 1, n = n.right);\n }\n // Node not found\n return -1;\n }, t.prototype.P = function() {\n return this.root.P();\n }, Object.defineProperty(t.prototype, \"size\", {\n // Returns the total number of nodes in the map.\n get: function() {\n return this.root.size;\n },\n enumerable: !1,\n configurable: !0\n }), \n // Returns the minimum key in the map.\n t.prototype.ht = function() {\n return this.root.ht();\n }, \n // Returns the maximum key in the map.\n t.prototype.ct = function() {\n return this.root.ct();\n }, \n // Traverses the map in key order and calls the specified action function\n // for each key/value pair. If action returns true, traversal is aborted.\n // Returns the first truthy value returned by action, or the last falsey\n // value returned by action.\n t.prototype.ut = function(t) {\n return this.root.ut(t);\n }, t.prototype.forEach = function(t) {\n this.ut((function(e, n) {\n return t(e, n), !1;\n }));\n }, t.prototype.toString = function() {\n var t = [];\n return this.ut((function(e, n) {\n return t.push(e + \":\" + n), !1;\n })), \"{\" + t.join(\", \") + \"}\";\n }, \n // Traverses the map in reverse key order and calls the specified action\n // function for each key/value pair. If action returns true, traversal is\n // aborted.\n // Returns the first truthy value returned by action, or the last falsey\n // value returned by action.\n t.prototype.lt = function(t) {\n return this.root.lt(t);\n }, \n // Returns an iterator over the SortedMap.\n t.prototype._t = function() {\n return new vt(this.root, null, this.D, !1);\n }, t.prototype.ft = function(t) {\n return new vt(this.root, t, this.D, !1);\n }, t.prototype.dt = function() {\n return new vt(this.root, null, this.D, !0);\n }, t.prototype.wt = function(t) {\n return new vt(this.root, t, this.D, !0);\n }, t;\n}(), vt = /** @class */ function() {\n function t(t, e, n, r) {\n this.Et = r, this.Tt = [];\n for (var i = 1; !t.P(); ) if (i = e ? n(t.key, e) : 1, \n // flip the comparison if we're going in reverse\n r && (i *= -1), i < 0) \n // This node is less than our start key. ignore it\n t = this.Et ? t.left : t.right; else {\n if (0 === i) {\n // This node is exactly equal to our start key. Push it on the stack,\n // but stop iterating;\n this.Tt.push(t);\n break;\n }\n // This node is greater than our start key, add it to the stack and move\n // to the next one\n this.Tt.push(t), t = this.Et ? t.right : t.left;\n }\n }\n return t.prototype.It = function() {\n var t = this.Tt.pop(), e = {\n key: t.key,\n value: t.value\n };\n if (this.Et) for (t = t.left; !t.P(); ) this.Tt.push(t), t = t.right; else for (t = t.right; !t.P(); ) this.Tt.push(t), \n t = t.left;\n return e;\n }, t.prototype.At = function() {\n return this.Tt.length > 0;\n }, t.prototype.Rt = function() {\n if (0 === this.Tt.length) return null;\n var t = this.Tt[this.Tt.length - 1];\n return {\n key: t.key,\n value: t.value\n };\n }, t;\n}(), yt = /** @class */ function() {\n function t(e, n, r, i, o) {\n this.key = e, this.value = n, this.color = null != r ? r : t.RED, this.left = null != i ? i : t.EMPTY, \n this.right = null != o ? o : t.EMPTY, this.size = this.left.size + 1 + this.right.size;\n }\n // Returns a copy of the current node, optionally replacing pieces of it.\n return t.prototype.copy = function(e, n, r, i, o) {\n return new t(null != e ? e : this.key, null != n ? n : this.value, null != r ? r : this.color, null != i ? i : this.left, null != o ? o : this.right);\n }, t.prototype.P = function() {\n return !1;\n }, \n // Traverses the tree in key order and calls the specified action function\n // for each node. If action returns true, traversal is aborted.\n // Returns the first truthy value returned by action, or the last falsey\n // value returned by action.\n t.prototype.ut = function(t) {\n return this.left.ut(t) || t(this.key, this.value) || this.right.ut(t);\n }, \n // Traverses the tree in reverse key order and calls the specified action\n // function for each node. If action returns true, traversal is aborted.\n // Returns the first truthy value returned by action, or the last falsey\n // value returned by action.\n t.prototype.lt = function(t) {\n return this.right.lt(t) || t(this.key, this.value) || this.left.lt(t);\n }, \n // Returns the minimum node in the tree.\n t.prototype.min = function() {\n return this.left.P() ? this : this.left.min();\n }, \n // Returns the maximum key in the tree.\n t.prototype.ht = function() {\n return this.min().key;\n }, \n // Returns the maximum key in the tree.\n t.prototype.ct = function() {\n return this.right.P() ? this.key : this.right.ct();\n }, \n // Returns new tree, with the key/value added.\n t.prototype.ot = function(t, e, n) {\n var r = this, i = n(t, r.key);\n return (r = i < 0 ? r.copy(null, null, null, r.left.ot(t, e, n), null) : 0 === i ? r.copy(null, e, null, null, null) : r.copy(null, null, null, null, r.right.ot(t, e, n))).Pt();\n }, t.prototype.gt = function() {\n if (this.left.P()) return t.EMPTY;\n var e = this;\n return e.left.Vt() || e.left.left.Vt() || (e = e.yt()), (e = e.copy(null, null, null, e.left.gt(), null)).Pt();\n }, \n // Returns new tree, with the specified item removed.\n t.prototype.remove = function(e, n) {\n var r, i = this;\n if (n(e, i.key) < 0) i.left.P() || i.left.Vt() || i.left.left.Vt() || (i = i.yt()), \n i = i.copy(null, null, null, i.left.remove(e, n), null); else {\n if (i.left.Vt() && (i = i.bt()), i.right.P() || i.right.Vt() || i.right.left.Vt() || (i = i.vt()), \n 0 === n(e, i.key)) {\n if (i.right.P()) return t.EMPTY;\n r = i.right.min(), i = i.copy(r.key, r.value, null, null, i.right.gt());\n }\n i = i.copy(null, null, null, null, i.right.remove(e, n));\n }\n return i.Pt();\n }, t.prototype.Vt = function() {\n return this.color;\n }, \n // Returns new tree after performing any needed rotations.\n t.prototype.Pt = function() {\n var t = this;\n return t.right.Vt() && !t.left.Vt() && (t = t.St()), t.left.Vt() && t.left.left.Vt() && (t = t.bt()), \n t.left.Vt() && t.right.Vt() && (t = t.Dt()), t;\n }, t.prototype.yt = function() {\n var t = this.Dt();\n return t.right.left.Vt() && (t = (t = (t = t.copy(null, null, null, null, t.right.bt())).St()).Dt()), \n t;\n }, t.prototype.vt = function() {\n var t = this.Dt();\n return t.left.left.Vt() && (t = (t = t.bt()).Dt()), t;\n }, t.prototype.St = function() {\n var e = this.copy(null, null, t.RED, null, this.right.left);\n return this.right.copy(null, null, this.color, e, null);\n }, t.prototype.bt = function() {\n var e = this.copy(null, null, t.RED, this.left.right, null);\n return this.left.copy(null, null, this.color, null, e);\n }, t.prototype.Dt = function() {\n var t = this.left.copy(null, null, !this.left.color, null, null), e = this.right.copy(null, null, !this.right.color, null, null);\n return this.copy(null, null, !this.color, t, e);\n }, \n // For testing.\n t.prototype.Ct = function() {\n var t = this.Nt();\n return Math.pow(2, t) <= this.size + 1;\n }, \n // In a balanced RB tree, the black-depth (number of black nodes) from root to\n // leaves is equal on both sides. This function verifies that or asserts.\n t.prototype.Nt = function() {\n if (this.Vt() && this.left.Vt()) throw S();\n if (this.right.Vt()) throw S();\n var t = this.left.Nt();\n if (t !== this.right.Nt()) throw S();\n return t + (this.Vt() ? 0 : 1);\n }, t;\n}();\n\n// end SortedMap\n// An iterator over an LLRBNode.\n// end LLRBNode\n// Empty node is shared between all LLRB trees.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nyt.EMPTY = null, yt.RED = !0, yt.at = !1, \n// end LLRBEmptyNode\nyt.EMPTY = new (/** @class */ function() {\n function t() {\n this.size = 0;\n }\n return Object.defineProperty(t.prototype, \"key\", {\n get: function() {\n throw S();\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"value\", {\n get: function() {\n throw S();\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"color\", {\n get: function() {\n throw S();\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"left\", {\n get: function() {\n throw S();\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"right\", {\n get: function() {\n throw S();\n },\n enumerable: !1,\n configurable: !0\n }), \n // Returns a copy of the current node.\n t.prototype.copy = function(t, e, n, r, i) {\n return this;\n }, \n // Returns a copy of the tree, with the specified key/value added.\n t.prototype.ot = function(t, e, n) {\n return new yt(t, e);\n }, \n // Returns a copy of the tree, with the specified key removed.\n t.prototype.remove = function(t, e) {\n return this;\n }, t.prototype.P = function() {\n return !0;\n }, t.prototype.ut = function(t) {\n return !1;\n }, t.prototype.lt = function(t) {\n return !1;\n }, t.prototype.ht = function() {\n return null;\n }, t.prototype.ct = function() {\n return null;\n }, t.prototype.Vt = function() {\n return !1;\n }, \n // For testing.\n t.prototype.Ct = function() {\n return !0;\n }, t.prototype.Nt = function() {\n return 0;\n }, t;\n}());\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * SortedSet is an immutable (copy-on-write) collection that holds elements\n * in order specified by the provided comparator.\n *\n * NOTE: if provided comparator returns 0 for two elements, we consider them to\n * be equal!\n */\nvar mt = /** @class */ function() {\n function t(t) {\n this.D = t, this.data = new dt(this.D);\n }\n return t.prototype.has = function(t) {\n return null !== this.data.get(t);\n }, t.prototype.first = function() {\n return this.data.ht();\n }, t.prototype.last = function() {\n return this.data.ct();\n }, Object.defineProperty(t.prototype, \"size\", {\n get: function() {\n return this.data.size;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.indexOf = function(t) {\n return this.data.indexOf(t);\n }, \n /** Iterates elements in order defined by \"comparator\" */ t.prototype.forEach = function(t) {\n this.data.ut((function(e, n) {\n return t(e), !1;\n }));\n }, \n /** Iterates over `elem`s such that: range[0] <= elem < range[1]. */ t.prototype.xt = function(t, e) {\n for (var n = this.data.ft(t[0]); n.At(); ) {\n var r = n.It();\n if (this.D(r.key, t[1]) >= 0) return;\n e(r.key);\n }\n }, \n /**\n * Iterates over `elem`s such that: start <= elem until false is returned.\n */\n t.prototype.Ft = function(t, e) {\n var n;\n for (n = void 0 !== e ? this.data.ft(e) : this.data._t(); n.At(); ) if (!t(n.It().key)) return;\n }, \n /** Finds the least element greater than or equal to `elem`. */ t.prototype.kt = function(t) {\n var e = this.data.ft(t);\n return e.At() ? e.It().key : null;\n }, t.prototype._t = function() {\n return new gt(this.data._t());\n }, t.prototype.ft = function(t) {\n return new gt(this.data.ft(t));\n }, \n /** Inserts or updates an element */ t.prototype.add = function(t) {\n return this.copy(this.data.remove(t).ot(t, !0));\n }, \n /** Deletes an element */ t.prototype.delete = function(t) {\n return this.has(t) ? this.copy(this.data.remove(t)) : this;\n }, t.prototype.P = function() {\n return this.data.P();\n }, t.prototype.Ot = function(t) {\n var e = this;\n // Make sure `result` always refers to the larger one of the two sets.\n return e.size < t.size && (e = t, t = this), t.forEach((function(t) {\n e = e.add(t);\n })), e;\n }, t.prototype.isEqual = function(e) {\n if (!(e instanceof t)) return !1;\n if (this.size !== e.size) return !1;\n for (var n = this.data._t(), r = e.data._t(); n.At(); ) {\n var i = n.It().key, o = r.It().key;\n if (0 !== this.D(i, o)) return !1;\n }\n return !0;\n }, t.prototype.L = function() {\n var t = [];\n return this.forEach((function(e) {\n t.push(e);\n })), t;\n }, t.prototype.toString = function() {\n var t = [];\n return this.forEach((function(e) {\n return t.push(e);\n })), \"SortedSet(\" + t.toString() + \")\";\n }, t.prototype.copy = function(e) {\n var n = new t(this.D);\n return n.data = e, n;\n }, t;\n}(), gt = /** @class */ function() {\n function t(t) {\n this.Mt = t;\n }\n return t.prototype.It = function() {\n return this.Mt.It().key;\n }, t.prototype.At = function() {\n return this.Mt.At();\n }, t;\n}(), wt = new dt(Z.D);\n\nfunction bt() {\n return wt;\n}\n\nfunction It() {\n return bt();\n}\n\nvar Et = new dt(Z.D);\n\nfunction _t() {\n return Et;\n}\n\nvar Tt = new dt(Z.D), Nt = new mt(Z.D);\n\nfunction At() {\n for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];\n for (var n = Nt, r = 0, i = t; r < i.length; r++) {\n var o = i[r];\n n = n.add(o);\n }\n return n;\n}\n\nvar Dt = new mt(L);\n\nfunction St() {\n return Dt;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * DocumentSet is an immutable (copy-on-write) collection that holds documents\n * in order specified by the provided comparator. We always add a document key\n * comparator on top of what is provided to guarantee document equality based on\n * the key.\n */ var xt = /** @class */ function() {\n /** The default ordering is by key if the comparator is omitted */\n function t(t) {\n // We are adding document key comparator to the end as it's the only\n // guaranteed unique property of a document.\n this.D = t ? function(e, n) {\n return t(e, n) || Z.D(e.key, n.key);\n } : function(t, e) {\n return Z.D(t.key, e.key);\n }, this.$t = _t(), this.Lt = new dt(this.D)\n /**\n * Returns an empty copy of the existing DocumentSet, using the same\n * comparator.\n */;\n }\n return t.Bt = function(e) {\n return new t(e.D);\n }, t.prototype.has = function(t) {\n return null != this.$t.get(t);\n }, t.prototype.get = function(t) {\n return this.$t.get(t);\n }, t.prototype.first = function() {\n return this.Lt.ht();\n }, t.prototype.last = function() {\n return this.Lt.ct();\n }, t.prototype.P = function() {\n return this.Lt.P();\n }, \n /**\n * Returns the index of the provided key in the document set, or -1 if the\n * document key is not present in the set;\n */\n t.prototype.indexOf = function(t) {\n var e = this.$t.get(t);\n return e ? this.Lt.indexOf(e) : -1;\n }, Object.defineProperty(t.prototype, \"size\", {\n get: function() {\n return this.Lt.size;\n },\n enumerable: !1,\n configurable: !0\n }), \n /** Iterates documents in order defined by \"comparator\" */ t.prototype.forEach = function(t) {\n this.Lt.ut((function(e, n) {\n return t(e), !1;\n }));\n }, \n /** Inserts or updates a document with the same key */ t.prototype.add = function(t) {\n // First remove the element if we have it.\n var e = this.delete(t.key);\n return e.copy(e.$t.ot(t.key, t), e.Lt.ot(t, null));\n }, \n /** Deletes a document with a given key */ t.prototype.delete = function(t) {\n var e = this.get(t);\n return e ? this.copy(this.$t.remove(t), this.Lt.remove(e)) : this;\n }, t.prototype.isEqual = function(e) {\n if (!(e instanceof t)) return !1;\n if (this.size !== e.size) return !1;\n for (var n = this.Lt._t(), r = e.Lt._t(); n.At(); ) {\n var i = n.It().key, o = r.It().key;\n if (!i.isEqual(o)) return !1;\n }\n return !0;\n }, t.prototype.toString = function() {\n var t = [];\n return this.forEach((function(e) {\n t.push(e.toString());\n })), 0 === t.length ? \"DocumentSet ()\" : \"DocumentSet (\\n \" + t.join(\" \\n\") + \"\\n)\";\n }, t.prototype.copy = function(e, n) {\n var r = new t;\n return r.D = this.D, r.$t = e, r.Lt = n, r;\n }, t;\n}(), kt = /** @class */ function() {\n function t() {\n this.qt = new dt(Z.D);\n }\n return t.prototype.track = function(t) {\n var e = t.doc.key, n = this.qt.get(e);\n n ? \n // Merge the new change with the existing change.\n 0 /* Added */ !== t.type && 3 /* Metadata */ === n.type ? this.qt = this.qt.ot(e, t) : 3 /* Metadata */ === t.type && 1 /* Removed */ !== n.type ? this.qt = this.qt.ot(e, {\n type: n.type,\n doc: t.doc\n }) : 2 /* Modified */ === t.type && 2 /* Modified */ === n.type ? this.qt = this.qt.ot(e, {\n type: 2 /* Modified */ ,\n doc: t.doc\n }) : 2 /* Modified */ === t.type && 0 /* Added */ === n.type ? this.qt = this.qt.ot(e, {\n type: 0 /* Added */ ,\n doc: t.doc\n }) : 1 /* Removed */ === t.type && 0 /* Added */ === n.type ? this.qt = this.qt.remove(e) : 1 /* Removed */ === t.type && 2 /* Modified */ === n.type ? this.qt = this.qt.ot(e, {\n type: 1 /* Removed */ ,\n doc: n.doc\n }) : 0 /* Added */ === t.type && 1 /* Removed */ === n.type ? this.qt = this.qt.ot(e, {\n type: 2 /* Modified */ ,\n doc: t.doc\n }) : \n // This includes these cases, which don't make sense:\n // Added->Added\n // Removed->Removed\n // Modified->Added\n // Removed->Modified\n // Metadata->Added\n // Removed->Metadata\n S() : this.qt = this.qt.ot(e, t);\n }, t.prototype.Ut = function() {\n var t = [];\n return this.qt.ut((function(e, n) {\n t.push(n);\n })), t;\n }, t;\n}(), Pt = /** @class */ function() {\n function t(t, e, n, r, i, o, u, s) {\n this.query = t, this.docs = e, this.Kt = n, this.docChanges = r, this.Qt = i, this.fromCache = o, \n this.Wt = u, this.jt = s\n /** Returns a view snapshot as if all documents in the snapshot were added. */;\n }\n return t.Gt = function(e, n, r, i) {\n var o = [];\n return n.forEach((function(t) {\n o.push({\n type: 0 /* Added */ ,\n doc: t\n });\n })), new t(e, n, xt.Bt(n), o, r, i, \n /* syncStateChanged= */ !0, \n /* excludesMetadataChanges= */ !1);\n }, Object.defineProperty(t.prototype, \"hasPendingWrites\", {\n get: function() {\n return !this.Qt.P();\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.isEqual = function(t) {\n if (!(this.fromCache === t.fromCache && this.Wt === t.Wt && this.Qt.isEqual(t.Qt) && Fn(this.query, t.query) && this.docs.isEqual(t.docs) && this.Kt.isEqual(t.Kt))) return !1;\n var e = this.docChanges, n = t.docChanges;\n if (e.length !== n.length) return !1;\n for (var r = 0; r < e.length; r++) if (e[r].type !== n[r].type || !e[r].doc.isEqual(n[r].doc)) return !1;\n return !0;\n }, t;\n}(), Ot = /** @class */ function() {\n function t(\n /**\n * The snapshot version this event brings us up to, or MIN if not set.\n */\n t, \n /**\n * A map from target to changes to the target. See TargetChange.\n */\n e, \n /**\n * A set of targets that is known to be inconsistent. Listens for these\n * targets should be re-established without resume tokens.\n */\n n, \n /**\n * A set of which documents have changed or been deleted, along with the\n * doc's new values (if not deleted).\n */\n r, \n /**\n * A set of which document updates are due only to limbo resolution targets.\n */\n i) {\n this.nt = t, this.zt = e, this.Ht = n, this.Jt = r, this.Yt = i;\n }\n /**\n * HACK: Views require RemoteEvents in order to determine whether the view is\n * CURRENT, but secondary tabs don't receive remote events. So this method is\n * used to create a synthesized RemoteEvent that can be used to apply a\n * CURRENT status change to a View, for queries executed in a different tab.\n */\n // PORTING NOTE: Multi-tab only\n return t.Xt = function(e, n) {\n var r = new Map;\n return r.set(e, Lt.Zt(e, n)), new t(H.min(), r, St(), bt(), At());\n }, t;\n}(), Lt = /** @class */ function() {\n function t(\n /**\n * An opaque, server-assigned token that allows watching a query to be resumed\n * after disconnecting without retransmitting all the data that matches the\n * query. The resume token essentially identifies a point in time from which\n * the server should resume sending results.\n */\n t, \n /**\n * The \"current\" (synced) status of this target. Note that \"current\"\n * has special meaning in the RPC protocol that implies that a target is\n * both up-to-date and consistent with the rest of the watch stream.\n */\n e, \n /**\n * The set of documents that were newly assigned to this target as part of\n * this remote event.\n */\n n, \n /**\n * The set of documents that were already assigned to this target but received\n * an update during this remote event.\n */\n r, \n /**\n * The set of documents that were removed from this target as part of this\n * remote event.\n */\n i) {\n this.resumeToken = t, this.te = e, this.ee = n, this.ne = r, this.se = i\n /**\n * This method is used to create a synthesized TargetChanges that can be used to\n * apply a CURRENT status change to a View (for queries executed in a different\n * tab) or for new queries (to raise snapshots with correct CURRENT status).\n */;\n }\n return t.Zt = function(e, n) {\n return new t(C.u, n, At(), At(), At());\n }, t;\n}(), Vt = function(\n/** The new document applies to all of these targets. */\nt, \n/** The new document is removed from all of these targets. */\ne, \n/** The key of the document for this change. */\nn, \n/**\n * The new document or NoDocument if it was deleted. Is null if the\n * document went out of view without the server sending a new document.\n */\nr) {\n this.ie = t, this.removedTargetIds = e, this.key = n, this.re = r;\n}, Rt = function(t, e) {\n this.targetId = t, this.oe = e;\n}, Ct = function(\n/** What kind of change occurred to the watch target. */\nt, \n/** The target IDs that were added/removed/set. */\ne, \n/**\n * An opaque, server-assigned token that allows watching a target to be\n * resumed after disconnecting without retransmitting all the data that\n * matches the target. The resume token essentially identifies a point in\n * time from which the server should resume sending results.\n */\nn\n/** An RPC error indicating why the watch failed. */ , r) {\n void 0 === n && (n = C.u), void 0 === r && (r = null), this.state = t, this.targetIds = e, \n this.resumeToken = n, this.cause = r;\n}, Ut = /** @class */ function() {\n function t() {\n /**\n * The number of pending responses (adds or removes) that we are waiting on.\n * We only consider targets active that have no pending responses.\n */\n this.ae = 0, \n /**\n * Keeps track of the document changes since the last raised snapshot.\n *\n * These changes are continuously updated as we receive document updates and\n * always reflect the current set of changes against the last issued snapshot.\n */\n this.he = Ft(), \n /** See public getters for explanations of these fields. */\n this.ce = C.u, this.ue = !1, \n /**\n * Whether this target state should be included in the next snapshot. We\n * initialize to true so that newly-added targets are included in the next\n * RemoteEvent.\n */\n this.le = !0;\n }\n return Object.defineProperty(t.prototype, \"te\", {\n /**\n * Whether this target has been marked 'current'.\n *\n * 'Current' has special meaning in the RPC protocol: It implies that the\n * Watch backend has sent us all changes up to the point at which the target\n * was added and that the target is consistent with the rest of the watch\n * stream.\n */\n get: function() {\n return this.ue;\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"resumeToken\", {\n /** The last resume token sent to us for this target. */ get: function() {\n return this.ce;\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"_e\", {\n /** Whether this target has pending target adds or target removes. */ get: function() {\n return 0 !== this.ae;\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"fe\", {\n /** Whether we have modified any state that should trigger a snapshot. */ get: function() {\n return this.le;\n },\n enumerable: !1,\n configurable: !0\n }), \n /**\n * Applies the resume token to the TargetChange, but only when it has a new\n * value. Empty resumeTokens are discarded.\n */\n t.prototype.de = function(t) {\n t.o() > 0 && (this.le = !0, this.ce = t);\n }, \n /**\n * Creates a target change from the current set of changes.\n *\n * To reset the document changes after raising this snapshot, call\n * `clearPendingChanges()`.\n */\n t.prototype.we = function() {\n var t = At(), e = At(), n = At();\n return this.he.forEach((function(r, i) {\n switch (i) {\n case 0 /* Added */ :\n t = t.add(r);\n break;\n\n case 2 /* Modified */ :\n e = e.add(r);\n break;\n\n case 1 /* Removed */ :\n n = n.add(r);\n break;\n\n default:\n S();\n }\n })), new Lt(this.ce, this.ue, t, e, n);\n }, \n /**\n * Resets the document changes and sets `hasPendingChanges` to false.\n */\n t.prototype.Ee = function() {\n this.le = !1, this.he = Ft();\n }, t.prototype.Te = function(t, e) {\n this.le = !0, this.he = this.he.ot(t, e);\n }, t.prototype.Ie = function(t) {\n this.le = !0, this.he = this.he.remove(t);\n }, t.prototype.me = function() {\n this.ae += 1;\n }, t.prototype.Ae = function() {\n this.ae -= 1;\n }, t.prototype.Re = function() {\n this.le = !0, this.ue = !0;\n }, t;\n}(), Mt = /** @class */ function() {\n function t(t) {\n this.Pe = t, \n /** The internal state of all tracked targets. */\n this.ge = new Map, \n /** Keeps track of the documents to update since the last raised snapshot. */\n this.Ve = bt(), \n /** A mapping of document keys to their set of target IDs. */\n this.ye = qt(), \n /**\n * A list of targets with existence filter mismatches. These targets are\n * known to be inconsistent and their listens needs to be re-established by\n * RemoteStore.\n */\n this.pe = new mt(L)\n /**\n * Processes and adds the DocumentWatchChange to the current set of changes.\n */;\n }\n return t.prototype.be = function(t) {\n for (var e = 0, n = t.ie; e < n.length; e++) {\n var r = n[e];\n t.re instanceof Tn ? this.ve(r, t.re) : t.re instanceof Nn && this.Se(r, t.key, t.re);\n }\n for (var i = 0, o = t.removedTargetIds; i < o.length; i++) {\n var u = o[i];\n this.Se(u, t.key, t.re);\n }\n }, \n /** Processes and adds the WatchTargetChange to the current set of changes. */ t.prototype.De = function(t) {\n var e = this;\n this.Ce(t, (function(n) {\n var r = e.Ne(n);\n switch (t.state) {\n case 0 /* NoChange */ :\n e.xe(n) && r.de(t.resumeToken);\n break;\n\n case 1 /* Added */ :\n // We need to decrement the number of pending acks needed from watch\n // for this targetId.\n r.Ae(), r._e || \n // We have a freshly added target, so we need to reset any state\n // that we had previously. This can happen e.g. when remove and add\n // back a target for existence filter mismatches.\n r.Ee(), r.de(t.resumeToken);\n break;\n\n case 2 /* Removed */ :\n // We need to keep track of removed targets to we can post-filter and\n // remove any target changes.\n // We need to decrement the number of pending acks needed from watch\n // for this targetId.\n r.Ae(), r._e || e.removeTarget(n);\n break;\n\n case 3 /* Current */ :\n e.xe(n) && (r.Re(), r.de(t.resumeToken));\n break;\n\n case 4 /* Reset */ :\n e.xe(n) && (\n // Reset the target and synthesizes removes for all existing\n // documents. The backend will re-add any documents that still\n // match the target before it sends the next global snapshot.\n e.Fe(n), r.de(t.resumeToken));\n break;\n\n default:\n S();\n }\n }));\n }, \n /**\n * Iterates over all targetIds that the watch change applies to: either the\n * targetIds explicitly listed in the change or the targetIds of all currently\n * active targets.\n */\n t.prototype.Ce = function(t, e) {\n var n = this;\n t.targetIds.length > 0 ? t.targetIds.forEach(e) : this.ge.forEach((function(t, r) {\n n.xe(r) && e(r);\n }));\n }, \n /**\n * Handles existence filters and synthesizes deletes for filter mismatches.\n * Targets that are invalidated by filter mismatches are added to\n * `pendingTargetResets`.\n */\n t.prototype.ke = function(t) {\n var e = t.targetId, n = t.oe.count, r = this.Oe(e);\n if (r) {\n var i = r.target;\n if (st(i)) if (0 === n) {\n // The existence filter told us the document does not exist. We deduce\n // that this document does not exist and apply a deleted document to\n // our updates. Without applying this deleted document there might be\n // another query that will raise this document as part of a snapshot\n // until it is resolved, essentially exposing inconsistency between\n // queries.\n var o = new Z(i.path);\n this.Se(e, o, new Nn(o, H.min()));\n } else x(1 === n); else this.Me(e) !== n && (\n // Existence filter mismatch: We reset the mapping and raise a new\n // snapshot with `isFromCache:true`.\n this.Fe(e), this.pe = this.pe.add(e));\n }\n }, \n /**\n * Converts the currently accumulated state into a remote event at the\n * provided snapshot version. Resets the accumulated changes before returning.\n */\n t.prototype.$e = function(t) {\n var e = this, n = new Map;\n this.ge.forEach((function(r, i) {\n var o = e.Oe(i);\n if (o) {\n if (r.te && st(o.target)) {\n // Document queries for document that don't exist can produce an empty\n // result set. To update our local cache, we synthesize a document\n // delete if we have not previously received the document. This\n // resolves the limbo state of the document, removing it from\n // limboDocumentRefs.\n // TODO(dimond): Ideally we would have an explicit lookup target\n // instead resulting in an explicit delete message and we could\n // remove this special logic.\n var u = new Z(o.target.path);\n null !== e.Ve.get(u) || e.Le(i, u) || e.Se(i, u, new Nn(u, t));\n }\n r.fe && (n.set(i, r.we()), r.Ee());\n }\n }));\n var r = At();\n // We extract the set of limbo-only document updates as the GC logic\n // special-cases documents that do not appear in the target cache.\n // TODO(gsoltis): Expand on this comment once GC is available in the JS\n // client.\n this.ye.forEach((function(t, n) {\n var i = !0;\n n.Ft((function(t) {\n var n = e.Oe(t);\n return !n || 2 /* LimboResolution */ === n.et || (i = !1, !1);\n })), i && (r = r.add(t));\n }));\n var i = new Ot(t, n, this.pe, this.Ve, r);\n return this.Ve = bt(), this.ye = qt(), this.pe = new mt(L), i;\n }, \n /**\n * Adds the provided document to the internal list of document updates and\n * its document key to the given target's mapping.\n */\n // Visible for testing.\n t.prototype.ve = function(t, e) {\n if (this.xe(t)) {\n var n = this.Le(t, e.key) ? 2 /* Modified */ : 0 /* Added */;\n this.Ne(t).Te(e.key, n), this.Ve = this.Ve.ot(e.key, e), this.ye = this.ye.ot(e.key, this.Be(e.key).add(t));\n }\n }, \n /**\n * Removes the provided document from the target mapping. If the\n * document no longer matches the target, but the document's state is still\n * known (e.g. we know that the document was deleted or we received the change\n * that caused the filter mismatch), the new document can be provided\n * to update the remote document cache.\n */\n // Visible for testing.\n t.prototype.Se = function(t, e, n) {\n if (this.xe(t)) {\n var r = this.Ne(t);\n this.Le(t, e) ? r.Te(e, 1 /* Removed */) : \n // The document may have entered and left the target before we raised a\n // snapshot, so we can just ignore the change.\n r.Ie(e), this.ye = this.ye.ot(e, this.Be(e).delete(t)), n && (this.Ve = this.Ve.ot(e, n));\n }\n }, t.prototype.removeTarget = function(t) {\n this.ge.delete(t);\n }, \n /**\n * Returns the current count of documents in the target. This includes both\n * the number of documents that the LocalStore considers to be part of the\n * target as well as any accumulated changes.\n */\n t.prototype.Me = function(t) {\n var e = this.Ne(t).we();\n return this.Pe.qe(t).size + e.ee.size - e.se.size;\n }, \n /**\n * Increment the number of acks needed from watch before we can consider the\n * server to be 'in-sync' with the client's active targets.\n */\n t.prototype.me = function(t) {\n this.Ne(t).me();\n }, t.prototype.Ne = function(t) {\n var e = this.ge.get(t);\n return e || (e = new Ut, this.ge.set(t, e)), e;\n }, t.prototype.Be = function(t) {\n var e = this.ye.get(t);\n return e || (e = new mt(L), this.ye = this.ye.ot(t, e)), e;\n }, \n /**\n * Verifies that the user is still interested in this target (by calling\n * `getTargetDataForTarget()`) and that we are not waiting for pending ADDs\n * from watch.\n */\n t.prototype.xe = function(t) {\n var e = null !== this.Oe(t);\n return e || T(\"WatchChangeAggregator\", \"Detected inactive target\", t), e;\n }, \n /**\n * Returns the TargetData for an active target (i.e. a target that the user\n * is still interested in that has no outstanding target change requests).\n */\n t.prototype.Oe = function(t) {\n var e = this.ge.get(t);\n return e && e._e ? null : this.Pe.Ue(t);\n }, \n /**\n * Resets the state of a Watch target to its initial state (e.g. sets\n * 'current' to false, clears the resume token and removes its target mapping\n * from all documents).\n */\n t.prototype.Fe = function(t) {\n var e = this;\n this.ge.set(t, new Ut), this.Pe.qe(t).forEach((function(n) {\n e.Se(t, n, /*updatedDocument=*/ null);\n }));\n }, \n /**\n * Returns whether the LocalStore considers the document to be part of the\n * specified target.\n */\n t.prototype.Le = function(t, e) {\n return this.Pe.qe(t).has(e);\n }, t;\n}();\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * DocumentChangeSet keeps track of a set of changes to docs in a query, merging\n * duplicate events for the same doc.\n */ function qt() {\n return new dt(Z.D);\n}\n\nfunction Ft() {\n return new dt(Z.D);\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents a locally-applied ServerTimestamp.\n *\n * Server Timestamps are backed by MapValues that contain an internal field\n * `__type__` with a value of `server_timestamp`. The previous value and local\n * write time are stored in its `__previous_value__` and `__local_write_time__`\n * fields respectively.\n *\n * Notes:\n * - ServerTimestampValue instances are created as the result of applying a\n * TransformMutation (see TransformMutation.applyTo()). They can only exist in\n * the local view of a document. Therefore they do not need to be parsed or\n * serialized.\n * - When evaluated locally (e.g. for snapshot.data()), they by default\n * evaluate to `null`. This behavior can be configured by passing custom\n * FieldValueOptions to value().\n * - With respect to other ServerTimestampValues, they sort by their\n * localWriteTime.\n */ function jt(t) {\n var e, n;\n return \"server_timestamp\" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);\n}\n\n/**\n * Creates a new ServerTimestamp proto value (using the internal format).\n */\n/**\n * Returns the value of the field before this ServerTimestamp was set.\n *\n * Preserving the previous values allows the user to display the last resoled\n * value until the backend responds with the timestamp.\n */ function Gt(t) {\n var e = t.mapValue.fields.__previous_value__;\n return jt(e) ? Gt(e) : e;\n}\n\n/**\n * Returns the local time at which this timestamp was first set.\n */ function Bt(t) {\n var e = $t(t.mapValue.fields.__local_write_time__.timestampValue);\n return new Q(e.seconds, e.nanos);\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// A RegExp matching ISO 8601 UTC timestamps with optional fraction.\nvar zt = new RegExp(/^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d(?:\\.(\\d+))?Z$/);\n\n/** Extracts the backend's type order for the provided value. */ function Kt(t) {\n return \"nullValue\" in t ? 0 /* NullValue */ : \"booleanValue\" in t ? 1 /* BooleanValue */ : \"integerValue\" in t || \"doubleValue\" in t ? 2 /* NumberValue */ : \"timestampValue\" in t ? 3 /* TimestampValue */ : \"stringValue\" in t ? 5 /* StringValue */ : \"bytesValue\" in t ? 6 /* BlobValue */ : \"referenceValue\" in t ? 7 /* RefValue */ : \"geoPointValue\" in t ? 8 /* GeoPointValue */ : \"arrayValue\" in t ? 9 /* ArrayValue */ : \"mapValue\" in t ? jt(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : S();\n}\n\n/** Tests `left` and `right` for equality based on the backend semantics. */ function Wt(t, e) {\n var n = Kt(t);\n if (n !== Kt(e)) return !1;\n switch (n) {\n case 0 /* NullValue */ :\n return !0;\n\n case 1 /* BooleanValue */ :\n return t.booleanValue === e.booleanValue;\n\n case 4 /* ServerTimestampValue */ :\n return Bt(t).isEqual(Bt(e));\n\n case 3 /* TimestampValue */ :\n return function(t, e) {\n if (\"string\" == typeof t.timestampValue && \"string\" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length) \n // Use string equality for ISO 8601 timestamps\n return t.timestampValue === e.timestampValue;\n var n = $t(t.timestampValue), r = $t(e.timestampValue);\n return n.seconds === r.seconds && n.nanos === r.nanos;\n }(t, e);\n\n case 5 /* StringValue */ :\n return t.stringValue === e.stringValue;\n\n case 6 /* BlobValue */ :\n return function(t, e) {\n return te(t.bytesValue).isEqual(te(e.bytesValue));\n }(t, e);\n\n case 7 /* RefValue */ :\n return t.referenceValue === e.referenceValue;\n\n case 8 /* GeoPointValue */ :\n return function(t, e) {\n return Zt(t.geoPointValue.latitude) === Zt(e.geoPointValue.latitude) && Zt(t.geoPointValue.longitude) === Zt(e.geoPointValue.longitude);\n }(t, e);\n\n case 2 /* NumberValue */ :\n return function(t, e) {\n if (\"integerValue\" in t && \"integerValue\" in e) return Zt(t.integerValue) === Zt(e.integerValue);\n if (\"doubleValue\" in t && \"doubleValue\" in e) {\n var n = Zt(t.doubleValue), r = Zt(e.doubleValue);\n return n === r ? et(n) === et(r) : isNaN(n) && isNaN(r);\n }\n return !1;\n }(t, e);\n\n case 9 /* ArrayValue */ :\n return V(t.arrayValue.values || [], e.arrayValue.values || [], Wt);\n\n case 10 /* ObjectValue */ :\n return function(t, e) {\n var n = t.mapValue.fields || {}, r = e.mapValue.fields || {};\n if (B(n) !== B(r)) return !1;\n for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !Wt(n[i], r[i]))) return !1;\n return !0;\n }(t, e);\n\n default:\n return S();\n }\n}\n\nfunction Qt(t, e) {\n return void 0 !== (t.values || []).find((function(t) {\n return Wt(t, e);\n }));\n}\n\nfunction Ht(t, e) {\n var n = Kt(t), r = Kt(e);\n if (n !== r) return L(n, r);\n switch (n) {\n case 0 /* NullValue */ :\n return 0;\n\n case 1 /* BooleanValue */ :\n return L(t.booleanValue, e.booleanValue);\n\n case 2 /* NumberValue */ :\n return function(t, e) {\n var n = Zt(t.integerValue || t.doubleValue), r = Zt(e.integerValue || e.doubleValue);\n return n < r ? -1 : n > r ? 1 : n === r ? 0 : \n // one or both are NaN.\n isNaN(n) ? isNaN(r) ? 0 : -1 : 1;\n }(t, e);\n\n case 3 /* TimestampValue */ :\n return Yt(t.timestampValue, e.timestampValue);\n\n case 4 /* ServerTimestampValue */ :\n return Yt(Bt(t), Bt(e));\n\n case 5 /* StringValue */ :\n return L(t.stringValue, e.stringValue);\n\n case 6 /* BlobValue */ :\n return function(t, e) {\n var n = te(t), r = te(e);\n return n.h(r);\n }(t.bytesValue, e.bytesValue);\n\n case 7 /* RefValue */ :\n return function(t, e) {\n for (var n = t.split(\"/\"), r = e.split(\"/\"), i = 0; i < n.length && i < r.length; i++) {\n var o = L(n[i], r[i]);\n if (0 !== o) return o;\n }\n return L(n.length, r.length);\n }(t.referenceValue, e.referenceValue);\n\n case 8 /* GeoPointValue */ :\n return function(t, e) {\n var n = L(Zt(t.latitude), Zt(e.latitude));\n return 0 !== n ? n : L(Zt(t.longitude), Zt(e.longitude));\n }(t.geoPointValue, e.geoPointValue);\n\n case 9 /* ArrayValue */ :\n return function(t, e) {\n for (var n = t.values || [], r = e.values || [], i = 0; i < n.length && i < r.length; ++i) {\n var o = Ht(n[i], r[i]);\n if (o) return o;\n }\n return L(n.length, r.length);\n }(t.arrayValue, e.arrayValue);\n\n case 10 /* ObjectValue */ :\n return function(t, e) {\n var n = t.fields || {}, r = Object.keys(n), i = e.fields || {}, o = Object.keys(i);\n // Even though MapValues are likely sorted correctly based on their insertion\n // order (e.g. when received from the backend), local modifications can bring\n // elements out of order. We need to re-sort the elements to ensure that\n // canonical IDs are independent of insertion order.\n r.sort(), o.sort();\n for (var u = 0; u < r.length && u < o.length; ++u) {\n var s = L(r[u], o[u]);\n if (0 !== s) return s;\n var a = Ht(n[r[u]], i[o[u]]);\n if (0 !== a) return a;\n }\n return L(r.length, o.length);\n }(t.mapValue, e.mapValue);\n\n default:\n throw S();\n }\n}\n\nfunction Yt(t, e) {\n if (\"string\" == typeof t && \"string\" == typeof e && t.length === e.length) return L(t, e);\n var n = $t(t), r = $t(e), i = L(n.seconds, r.seconds);\n return 0 !== i ? i : L(n.nanos, r.nanos);\n}\n\nfunction Xt(t) {\n return Jt(t);\n}\n\nfunction Jt(t) {\n return \"nullValue\" in t ? \"null\" : \"booleanValue\" in t ? \"\" + t.booleanValue : \"integerValue\" in t ? \"\" + t.integerValue : \"doubleValue\" in t ? \"\" + t.doubleValue : \"timestampValue\" in t ? function(t) {\n var e = $t(t);\n return \"time(\" + e.seconds + \",\" + e.nanos + \")\";\n }(t.timestampValue) : \"stringValue\" in t ? t.stringValue : \"bytesValue\" in t ? te(t.bytesValue).toBase64() : \"referenceValue\" in t ? (n = t.referenceValue, \n Z.J(n).toString()) : \"geoPointValue\" in t ? \"geo(\" + (e = t.geoPointValue).latitude + \",\" + e.longitude + \")\" : \"arrayValue\" in t ? function(t) {\n for (var e = \"[\", n = !0, r = 0, i = t.values || []; r < i.length; r++) {\n n ? n = !1 : e += \",\", e += Jt(i[r]);\n }\n return e + \"]\";\n }(t.arrayValue) : \"mapValue\" in t ? function(t) {\n for (\n // Iteration order in JavaScript is not guaranteed. To ensure that we generate\n // matching canonical IDs for identical maps, we need to sort the keys.\n var e = \"{\", n = !0, r = 0, i = Object.keys(t.fields || {}).sort(); r < i.length; r++) {\n var o = i[r];\n n ? n = !1 : e += \",\", e += o + \":\" + Jt(t.fields[o]);\n }\n return e + \"}\";\n }(t.mapValue) : S();\n var e, n;\n}\n\nfunction $t(t) {\n // The json interface (for the browser) will return an iso timestamp string,\n // while the proto js library (for node) will return a\n // google.protobuf.Timestamp instance.\n if (x(!!t), \"string\" == typeof t) {\n // The date string can have higher precision (nanos) than the Date class\n // (millis), so we do some custom parsing here.\n // Parse the nanos right out of the string.\n var e = 0, n = zt.exec(t);\n if (x(!!n), n[1]) {\n // Pad the fraction out to 9 digits (nanos).\n var r = n[1];\n r = (r + \"000000000\").substr(0, 9), e = Number(r);\n }\n // Parse the date to get the seconds.\n var i = new Date(t);\n return {\n seconds: Math.floor(i.getTime() / 1e3),\n nanos: e\n };\n }\n return {\n seconds: Zt(t.seconds),\n nanos: Zt(t.nanos)\n };\n}\n\n/**\n * Converts the possible Proto types for numbers into a JavaScript number.\n * Returns 0 if the value is not numeric.\n */ function Zt(t) {\n // TODO(bjornick): Handle int64 greater than 53 bits.\n return \"number\" == typeof t ? t : \"string\" == typeof t ? Number(t) : 0;\n}\n\n/** Converts the possible Proto types for Blobs into a ByteString. */ function te(t) {\n return \"string\" == typeof t ? C.fromBase64String(t) : C.fromUint8Array(t);\n}\n\n/** Returns a reference value for the provided database and key. */ function ee(t, e) {\n return {\n referenceValue: \"projects/\" + t.projectId + \"/databases/\" + t.database + \"/documents/\" + e.path.B()\n };\n}\n\n/** Returns true if `value` is an IntegerValue . */ function ne(t) {\n return !!t && \"integerValue\" in t;\n}\n\n/** Returns true if `value` is a DoubleValue. */\n/** Returns true if `value` is an ArrayValue. */ function re(t) {\n return !!t && \"arrayValue\" in t;\n}\n\n/** Returns true if `value` is a NullValue. */ function ie(t) {\n return !!t && \"nullValue\" in t;\n}\n\n/** Returns true if `value` is NaN. */ function oe(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}\n\n/** Returns true if `value` is a MapValue. */ function ue(t) {\n return !!t && \"mapValue\" in t;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ var se = {\n asc: \"ASCENDING\",\n desc: \"DESCENDING\"\n}, ae = {\n \"<\": \"LESS_THAN\",\n \"<=\": \"LESS_THAN_OR_EQUAL\",\n \">\": \"GREATER_THAN\",\n \">=\": \"GREATER_THAN_OR_EQUAL\",\n \"==\": \"EQUAL\",\n \"!=\": \"NOT_EQUAL\",\n \"array-contains\": \"ARRAY_CONTAINS\",\n in: \"IN\",\n \"not-in\": \"NOT_IN\",\n \"array-contains-any\": \"ARRAY_CONTAINS_ANY\"\n}, ce = function(t, e) {\n this._ = t, this.Ke = e;\n};\n\n/**\n * This class generates JsonObject values for the Datastore API suitable for\n * sending to either GRPC stub methods or via the JSON/HTTP REST API.\n *\n * The serializer supports both Protobuf.js and Proto3 JSON formats. By\n * setting `useProto3Json` to true, the serializer will use the Proto3 JSON\n * format.\n *\n * For a description of the Proto3 JSON format check\n * https://developers.google.com/protocol-buffers/docs/proto3#json\n *\n * TODO(klimt): We can remove the databaseId argument if we keep the full\n * resource name in documents.\n */\n/**\n * Returns an IntegerValue for `value`.\n */\nfunction he(t) {\n return {\n integerValue: \"\" + t\n };\n}\n\n/**\n * Returns an DoubleValue for `value` that is encoded based the serializer's\n * `useProto3Json` setting.\n */ function fe(t, e) {\n if (t.Ke) {\n if (isNaN(e)) return {\n doubleValue: \"NaN\"\n };\n if (e === 1 / 0) return {\n doubleValue: \"Infinity\"\n };\n if (e === -1 / 0) return {\n doubleValue: \"-Infinity\"\n };\n }\n return {\n doubleValue: et(e) ? \"-0\" : e\n };\n}\n\n/**\n * Returns a value for a number that's appropriate to put into a proto.\n * The return value is an IntegerValue if it can safely represent the value,\n * otherwise a DoubleValue is returned.\n */ function le(t, e) {\n return nt(e) ? he(e) : fe(t, e);\n}\n\n/**\n * Returns a value for a Date that's appropriate to put into a proto.\n */ function pe(t, e) {\n return t.Ke ? new Date(1e3 * e.seconds).toISOString().replace(/\\.\\d*/, \"\").replace(\"Z\", \"\") + \".\" + (\"000000000\" + e.nanoseconds).slice(-9) + \"Z\" : {\n seconds: \"\" + e.seconds,\n nanos: e.nanoseconds\n };\n}\n\n/**\n * Returns a value for bytes that's appropriate to put in a proto.\n *\n * Visible for testing.\n */ function de(t, e) {\n return t.Ke ? e.toBase64() : e.toUint8Array();\n}\n\n/**\n * Returns a ByteString based on the proto string value.\n */ function ve(t, e) {\n return pe(t, e.v());\n}\n\nfunction ye(t) {\n return x(!!t), H.V(function(t) {\n var e = $t(t);\n return new Q(e.seconds, e.nanos);\n }(t));\n}\n\nfunction me(t, e) {\n return function(t) {\n return new X([ \"projects\", t.projectId, \"databases\", t.database ]);\n }(t).child(\"documents\").child(e).B();\n}\n\nfunction ge(t) {\n var e = X.q(t);\n return x(je(e)), e;\n}\n\nfunction we(t, e) {\n return me(t._, e.path);\n}\n\nfunction be(t, e) {\n var n = ge(e);\n return x(n.get(1) === t._.projectId), x(!n.get(3) && !t._.database || n.get(3) === t._.database), \n new Z(Te(n));\n}\n\nfunction Ie(t, e) {\n return me(t._, e);\n}\n\nfunction Ee(t) {\n var e = ge(t);\n // In v1beta1 queries for collections at the root did not have a trailing\n // \"/documents\". In v1 all resource paths contain \"/documents\". Preserve the\n // ability to read the v1beta1 form for compatibility with queries persisted\n // in the local target cache.\n return 4 === e.length ? X.U() : Te(e);\n}\n\nfunction _e(t) {\n return new X([ \"projects\", t._.projectId, \"databases\", t._.database ]).B();\n}\n\nfunction Te(t) {\n return x(t.length > 4 && \"documents\" === t.get(4)), t.N(5)\n /** Creates a Document proto from key and fields (but no create/update time) */;\n}\n\nfunction Ne(t, e, n) {\n return {\n name: we(t, e),\n fields: n.proto.mapValue.fields\n };\n}\n\nfunction Ae(t, e) {\n var n;\n if (e instanceof ln) n = {\n update: Ne(t, e.key, e.value)\n }; else if (e instanceof gn) n = {\n delete: we(t, e.key)\n }; else if (e instanceof pn) n = {\n update: Ne(t, e.key, e.data),\n updateMask: Fe(e.Qe)\n }; else if (e instanceof vn) n = {\n transform: {\n document: we(t, e.key),\n fieldTransforms: e.fieldTransforms.map((function(t) {\n return function(t, e) {\n var n = e.transform;\n if (n instanceof We) return {\n fieldPath: e.field.B(),\n setToServerValue: \"REQUEST_TIME\"\n };\n if (n instanceof Qe) return {\n fieldPath: e.field.B(),\n appendMissingElements: {\n values: n.elements\n }\n };\n if (n instanceof Ye) return {\n fieldPath: e.field.B(),\n removeAllFromArray: {\n values: n.elements\n }\n };\n if (n instanceof Je) return {\n fieldPath: e.field.B(),\n increment: n.We\n };\n throw S();\n }(0, t);\n }))\n }\n }; else {\n if (!(e instanceof wn)) return S();\n n = {\n verify: we(t, e.key)\n };\n }\n return e.Ge.je || (n.currentDocument = function(t, e) {\n return void 0 !== e.updateTime ? {\n updateTime: ve(t, e.updateTime)\n } : void 0 !== e.exists ? {\n exists: e.exists\n } : S();\n }(t, e.Ge)), n;\n}\n\nfunction De(t, e) {\n var n = e.currentDocument ? function(t) {\n return void 0 !== t.updateTime ? rn.updateTime(ye(t.updateTime)) : void 0 !== t.exists ? rn.exists(t.exists) : rn.ze();\n }(e.currentDocument) : rn.ze();\n if (e.update) {\n e.update.name;\n var r = be(t, e.update.name), i = new bn({\n mapValue: {\n fields: e.update.fields\n }\n });\n if (e.updateMask) {\n var o = function(t) {\n var e = t.fieldPaths || [];\n return new tn(e.map((function(t) {\n return $.G(t);\n })));\n }(e.updateMask);\n return new pn(r, i, o, n);\n }\n return new ln(r, i, n);\n }\n if (e.delete) {\n var u = be(t, e.delete);\n return new gn(u, n);\n }\n if (e.transform) {\n var s = be(t, e.transform.document), a = e.transform.fieldTransforms.map((function(e) {\n return function(t, e) {\n var n = null;\n if (\"setToServerValue\" in e) x(\"REQUEST_TIME\" === e.setToServerValue), n = new We; else if (\"appendMissingElements\" in e) {\n var r = e.appendMissingElements.values || [];\n n = new Qe(r);\n } else if (\"removeAllFromArray\" in e) {\n var i = e.removeAllFromArray.values || [];\n n = new Ye(i);\n } else \"increment\" in e ? n = new Je(t, e.increment) : S();\n var o = $.G(e.fieldPath);\n return new en(o, n);\n }(t, e);\n }));\n return x(!0 === n.exists), new vn(s, a);\n }\n if (e.verify) {\n var c = be(t, e.verify);\n return new wn(c, n);\n }\n return S();\n}\n\nfunction Se(t, e) {\n return {\n documents: [ Ie(t, e.path) ]\n };\n}\n\nfunction xe(t, e) {\n // Dissect the path into parent, collectionId, and optional key filter.\n var n = {\n structuredQuery: {}\n }, r = e.path;\n null !== e.collectionGroup ? (n.parent = Ie(t, r), n.structuredQuery.from = [ {\n collectionId: e.collectionGroup,\n allDescendants: !0\n } ]) : (n.parent = Ie(t, r.F()), n.structuredQuery.from = [ {\n collectionId: r.O()\n } ]);\n var i = function(t) {\n if (0 !== t.length) {\n var e = t.map((function(t) {\n // visible for testing\n return function(t) {\n if (\"==\" /* EQUAL */ === t.op) {\n if (oe(t.value)) return {\n unaryFilter: {\n field: Ce(t.field),\n op: \"IS_NAN\"\n }\n };\n if (ie(t.value)) return {\n unaryFilter: {\n field: Ce(t.field),\n op: \"IS_NULL\"\n }\n };\n } else if (\"!=\" /* NOT_EQUAL */ === t.op) {\n if (oe(t.value)) return {\n unaryFilter: {\n field: Ce(t.field),\n op: \"IS_NOT_NAN\"\n }\n };\n if (ie(t.value)) return {\n unaryFilter: {\n field: Ce(t.field),\n op: \"IS_NOT_NULL\"\n }\n };\n }\n return {\n fieldFilter: {\n field: Ce(t.field),\n op: Re(t.op),\n value: t.value\n }\n };\n }(t);\n }));\n return 1 === e.length ? e[0] : {\n compositeFilter: {\n op: \"AND\",\n filters: e\n }\n };\n }\n }(e.filters);\n i && (n.structuredQuery.where = i);\n var o = function(t) {\n if (0 !== t.length) return t.map((function(t) {\n // visible for testing\n return function(t) {\n return {\n field: Ce(t.field),\n direction: Ve(t.dir)\n };\n }(t);\n }));\n }(e.orderBy);\n o && (n.structuredQuery.orderBy = o);\n var u = function(t, e) {\n return t.Ke || tt(e) ? e : {\n value: e\n };\n }(t, e.limit);\n return null !== u && (n.structuredQuery.limit = u), e.startAt && (n.structuredQuery.startAt = Oe(e.startAt)), \n e.endAt && (n.structuredQuery.endAt = Oe(e.endAt)), n;\n}\n\nfunction ke(t) {\n var e = Ee(t.parent), n = t.structuredQuery, r = n.from ? n.from.length : 0, i = null;\n if (r > 0) {\n x(1 === r);\n var o = n.from[0];\n o.allDescendants ? i = o.collectionId : e = e.child(o.collectionId);\n }\n var u = [];\n n.where && (u = Pe(n.where));\n var s = [];\n n.orderBy && (s = n.orderBy.map((function(t) {\n return function(t) {\n return new ir(Ue(t.field), \n // visible for testing\n function(t) {\n switch (t) {\n case \"ASCENDING\":\n return \"asc\" /* ASCENDING */;\n\n case \"DESCENDING\":\n return \"desc\" /* DESCENDING */;\n\n default:\n return;\n }\n }(t.direction));\n }(t);\n })));\n var a = null;\n n.limit && (a = function(t) {\n var e;\n return tt(e = \"object\" == typeof t ? t.value : t) ? null : e;\n }(n.limit));\n var c = null;\n n.startAt && (c = Le(n.startAt));\n var h = null;\n return n.endAt && (h = Le(n.endAt)), Cn(Sn(e, i, s, u, a, \"F\" /* First */ , c, h));\n}\n\nfunction Pe(t) {\n return t ? void 0 !== t.unaryFilter ? [ qe(t) ] : void 0 !== t.fieldFilter ? [ Me(t) ] : void 0 !== t.compositeFilter ? t.compositeFilter.filters.map((function(t) {\n return Pe(t);\n })).reduce((function(t, e) {\n return t.concat(e);\n })) : S() : [];\n}\n\nfunction Oe(t) {\n return {\n before: t.before,\n values: t.position\n };\n}\n\nfunction Le(t) {\n var e = !!t.before, n = t.values || [];\n return new tr(n, e);\n}\n\n// visible for testing\nfunction Ve(t) {\n return se[t];\n}\n\nfunction Re(t) {\n return ae[t];\n}\n\nfunction Ce(t) {\n return {\n fieldPath: t.B()\n };\n}\n\nfunction Ue(t) {\n return $.G(t.fieldPath);\n}\n\nfunction Me(t) {\n return Kn.create(Ue(t.fieldFilter.field), function(t) {\n switch (t) {\n case \"EQUAL\":\n return \"==\" /* EQUAL */;\n\n case \"NOT_EQUAL\":\n return \"!=\" /* NOT_EQUAL */;\n\n case \"GREATER_THAN\":\n return \">\" /* GREATER_THAN */;\n\n case \"GREATER_THAN_OR_EQUAL\":\n return \">=\" /* GREATER_THAN_OR_EQUAL */;\n\n case \"LESS_THAN\":\n return \"<\" /* LESS_THAN */;\n\n case \"LESS_THAN_OR_EQUAL\":\n return \"<=\" /* LESS_THAN_OR_EQUAL */;\n\n case \"ARRAY_CONTAINS\":\n return \"array-contains\" /* ARRAY_CONTAINS */;\n\n case \"IN\":\n return \"in\" /* IN */;\n\n case \"NOT_IN\":\n return \"not-in\" /* NOT_IN */;\n\n case \"ARRAY_CONTAINS_ANY\":\n return \"array-contains-any\" /* ARRAY_CONTAINS_ANY */;\n\n case \"OPERATOR_UNSPECIFIED\":\n default:\n return S();\n }\n }(t.fieldFilter.op), t.fieldFilter.value);\n}\n\nfunction qe(t) {\n switch (t.unaryFilter.op) {\n case \"IS_NAN\":\n var e = Ue(t.unaryFilter.field);\n return Kn.create(e, \"==\" /* EQUAL */ , {\n doubleValue: NaN\n });\n\n case \"IS_NULL\":\n var n = Ue(t.unaryFilter.field);\n return Kn.create(n, \"==\" /* EQUAL */ , {\n nullValue: \"NULL_VALUE\"\n });\n\n case \"IS_NOT_NAN\":\n var r = Ue(t.unaryFilter.field);\n return Kn.create(r, \"!=\" /* NOT_EQUAL */ , {\n doubleValue: NaN\n });\n\n case \"IS_NOT_NULL\":\n var i = Ue(t.unaryFilter.field);\n return Kn.create(i, \"!=\" /* NOT_EQUAL */ , {\n nullValue: \"NULL_VALUE\"\n });\n\n case \"OPERATOR_UNSPECIFIED\":\n default:\n return S();\n }\n}\n\nfunction Fe(t) {\n var e = [];\n return t.fields.forEach((function(t) {\n return e.push(t.B());\n })), {\n fieldPaths: e\n };\n}\n\nfunction je(t) {\n // Resource names have at least 4 components (project ID, database ID)\n return t.length >= 4 && \"projects\" === t.get(0) && \"databases\" === t.get(2);\n}\n\n/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Represents a transform within a TransformMutation. */ var Ge = function() {\n // Make sure that the structural type of `TransformOperation` is unique.\n // See https://github.com/microsoft/TypeScript/issues/5451\n this.He = void 0;\n};\n\n/**\n * Computes the local transform result against the provided `previousValue`,\n * optionally using the provided localWriteTime.\n */ function Be(t, e, n) {\n return t instanceof We ? function(t, e) {\n var n = {\n fields: {\n __type__: {\n stringValue: \"server_timestamp\"\n },\n __local_write_time__: {\n timestampValue: {\n seconds: t.seconds,\n nanos: t.nanoseconds\n }\n }\n }\n };\n return e && (n.fields.__previous_value__ = e), {\n mapValue: n\n };\n }(n, e) : t instanceof Qe ? He(t, e) : t instanceof Ye ? Xe(t, e) : function(t, e) {\n // PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit\n // precision and resolves overflows by reducing precision, we do not\n // manually cap overflows at 2^63.\n var n = Ke(t, e), r = $e(n) + $e(t.We);\n return ne(n) && ne(t.We) ? he(r) : fe(t.serializer, r);\n }(t, e);\n}\n\n/**\n * Computes a final transform result after the transform has been acknowledged\n * by the server, potentially using the server-provided transformResult.\n */ function ze(t, e, n) {\n // The server just sends null as the transform result for array operations,\n // so we have to calculate a result the same as we do for local\n // applications.\n return t instanceof Qe ? He(t, e) : t instanceof Ye ? Xe(t, e) : n;\n}\n\n/**\n * If this transform operation is not idempotent, returns the base value to\n * persist for this transform. If a base value is returned, the transform\n * operation is always applied to this base value, even if document has\n * already been updated.\n *\n * Base values provide consistent behavior for non-idempotent transforms and\n * allow us to return the same latency-compensated value even if the backend\n * has already applied the transform operation. The base value is null for\n * idempotent transforms, as they can be re-played even if the backend has\n * already applied them.\n *\n * @return a base value to store along with the mutation, or null for\n * idempotent transforms.\n */ function Ke(t, e) {\n return t instanceof Je ? ne(n = e) || function(t) {\n return !!t && \"doubleValue\" in t;\n }(n) ? e : {\n integerValue: 0\n } : null;\n var n;\n}\n\n/** Transforms a value into a server-generated timestamp. */ var We = /** @class */ function(e) {\n function n() {\n return null !== e && e.apply(this, arguments) || this;\n }\n return t(n, e), n;\n}(Ge), Qe = /** @class */ function(e) {\n function n(t) {\n var n = this;\n return (n = e.call(this) || this).elements = t, n;\n }\n return t(n, e), n;\n}(Ge);\n\n/** Transforms an array value via a union operation. */ function He(t, e) {\n for (var n = Ze(e), r = function(t) {\n n.some((function(e) {\n return Wt(e, t);\n })) || n.push(t);\n }, i = 0, o = t.elements; i < o.length; i++) {\n r(o[i]);\n }\n return {\n arrayValue: {\n values: n\n }\n };\n}\n\n/** Transforms an array value via a remove operation. */ var Ye = /** @class */ function(e) {\n function n(t) {\n var n = this;\n return (n = e.call(this) || this).elements = t, n;\n }\n return t(n, e), n;\n}(Ge);\n\nfunction Xe(t, e) {\n for (var n = Ze(e), r = function(t) {\n n = n.filter((function(e) {\n return !Wt(e, t);\n }));\n }, i = 0, o = t.elements; i < o.length; i++) {\n r(o[i]);\n }\n return {\n arrayValue: {\n values: n\n }\n };\n}\n\n/**\n * Implements the backend semantics for locally computed NUMERIC_ADD (increment)\n * transforms. Converts all field values to integers or doubles, but unlike the\n * backend does not cap integer values at 2^63. Instead, JavaScript number\n * arithmetic is used and precision loss can occur for values greater than 2^53.\n */ var Je = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this) || this).serializer = t, r.We = n, r;\n }\n return t(n, e), n;\n}(Ge);\n\nfunction $e(t) {\n return Zt(t.integerValue || t.doubleValue);\n}\n\nfunction Ze(t) {\n return re(t) && t.arrayValue.values ? t.arrayValue.values.slice() : [];\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Provides a set of fields that can be used to partially patch a document.\n * FieldMask is used in conjunction with ObjectValue.\n * Examples:\n * foo - Overwrites foo entirely with the provided value. If foo is not\n * present in the companion ObjectValue, the field is deleted.\n * foo.bar - Overwrites only the field bar of the object foo.\n * If foo is not an object, foo is replaced with an object\n * containing foo\n */ var tn = /** @class */ function() {\n function t(t) {\n this.fields = t, \n // TODO(dimond): validation of FieldMask\n // Sort the field mask to support `FieldMask.isEqual()` and assert below.\n t.sort($.D)\n /**\n * Verifies that `fieldPath` is included by at least one field in this field\n * mask.\n *\n * This is an O(n) operation, where `n` is the size of the field mask.\n */;\n }\n return t.prototype.Je = function(t) {\n for (var e = 0, n = this.fields; e < n.length; e++) {\n if (n[e].M(t)) return !0;\n }\n return !1;\n }, t.prototype.isEqual = function(t) {\n return V(this.fields, t.fields, (function(t, e) {\n return t.isEqual(e);\n }));\n }, t;\n}(), en = function(t, e) {\n this.field = t, this.transform = e;\n};\n\n/** A field path and the TransformOperation to perform upon it. */\n/** The result of successfully applying a mutation to the backend. */ var nn = function(\n/**\n * The version at which the mutation was committed:\n *\n * - For most operations, this is the updateTime in the WriteResult.\n * - For deletes, the commitTime of the WriteResponse (because deletes are\n * not stored and have no updateTime).\n *\n * Note that these versions can be different: No-op writes will not change\n * the updateTime even though the commitTime advances.\n */\nt, \n/**\n * The resulting fields returned from the backend after a\n * TransformMutation has been committed. Contains one FieldValue for each\n * FieldTransform that was in the mutation.\n *\n * Will be null if the mutation was not a TransformMutation.\n */\ne) {\n this.version = t, this.transformResults = e;\n}, rn = /** @class */ function() {\n function t(t, e) {\n this.updateTime = t, this.exists = e\n /** Creates a new empty Precondition. */;\n }\n return t.ze = function() {\n return new t;\n }, \n /** Creates a new Precondition with an exists flag. */ t.exists = function(e) {\n return new t(void 0, e);\n }, \n /** Creates a new Precondition based on a version a document exists at. */ t.updateTime = function(e) {\n return new t(e);\n }, Object.defineProperty(t.prototype, \"je\", {\n /** Returns whether this Precondition is empty. */ get: function() {\n return void 0 === this.updateTime && void 0 === this.exists;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.isEqual = function(t) {\n return this.exists === t.exists && (this.updateTime ? !!t.updateTime && this.updateTime.isEqual(t.updateTime) : !t.updateTime);\n }, t;\n}();\n\n/**\n * Encodes a precondition for a mutation. This follows the model that the\n * backend accepts with the special case of an explicit \"empty\" precondition\n * (meaning no precondition).\n */\n/**\n * Returns true if the preconditions is valid for the given document\n * (or null if no document is available).\n */\nfunction on(t, e) {\n return void 0 !== t.updateTime ? e instanceof Tn && e.version.isEqual(t.updateTime) : void 0 === t.exists || t.exists === e instanceof Tn;\n}\n\n/**\n * A mutation describes a self-contained change to a document. Mutations can\n * create, replace, delete, and update subsets of documents.\n *\n * Mutations not only act on the value of the document but also its version.\n *\n * For local mutations (mutations that haven't been committed yet), we preserve\n * the existing version for Set, Patch, and Transform mutations. For Delete\n * mutations, we reset the version to 0.\n *\n * Here's the expected transition table.\n *\n * MUTATION APPLIED TO RESULTS IN\n *\n * SetMutation Document(v3) Document(v3)\n * SetMutation NoDocument(v3) Document(v0)\n * SetMutation null Document(v0)\n * PatchMutation Document(v3) Document(v3)\n * PatchMutation NoDocument(v3) NoDocument(v3)\n * PatchMutation null null\n * TransformMutation Document(v3) Document(v3)\n * TransformMutation NoDocument(v3) NoDocument(v3)\n * TransformMutation null null\n * DeleteMutation Document(v3) NoDocument(v0)\n * DeleteMutation NoDocument(v3) NoDocument(v0)\n * DeleteMutation null NoDocument(v0)\n *\n * For acknowledged mutations, we use the updateTime of the WriteResponse as\n * the resulting version for Set, Patch, and Transform mutations. As deletes\n * have no explicit update time, we use the commitTime of the WriteResponse for\n * Delete mutations.\n *\n * If a mutation is acknowledged by the backend but fails the precondition check\n * locally, we return an `UnknownDocument` and rely on Watch to send us the\n * updated version.\n *\n * Note that TransformMutations don't create Documents (in the case of being\n * applied to a NoDocument), even though they would on the backend. This is\n * because the client always combines the TransformMutation with a SetMutation\n * or PatchMutation and we only want to apply the transform if the prior\n * mutation resulted in a Document (always true for a SetMutation, but not\n * necessarily for a PatchMutation).\n *\n * ## Subclassing Notes\n *\n * Subclasses of Mutation need to implement applyToRemoteDocument() and\n * applyToLocalView() to implement the actual behavior of applying the mutation\n * to some source document.\n */ var un = function() {};\n\n/**\n * Applies this mutation to the given MaybeDocument or null for the purposes\n * of computing a new remote document. If the input document doesn't match the\n * expected state (e.g. it is null or outdated), an `UnknownDocument` can be\n * returned.\n *\n * @param mutation The mutation to apply.\n * @param maybeDoc The document to mutate. The input document can be null if\n * the client has no knowledge of the pre-mutation state of the document.\n * @param mutationResult The result of applying the mutation from the backend.\n * @return The mutated document. The returned document may be an\n * UnknownDocument if the mutation could not be applied to the locally\n * cached base document.\n */ function sn(t, e, n) {\n return t instanceof ln ? function(t, e, n) {\n // Unlike applySetMutationToLocalView, if we're applying a mutation to a\n // remote document the server has accepted the mutation so the precondition\n // must have held.\n return new Tn(t.key, n.version, t.value, {\n hasCommittedMutations: !0\n });\n }(t, 0, n) : t instanceof pn ? function(t, e, n) {\n if (!on(t.Ge, e)) \n // Since the mutation was not rejected, we know that the precondition\n // matched on the backend. We therefore must not have the expected version\n // of the document in our cache and return an UnknownDocument with the\n // known updateTime.\n return new An(t.key, n.version);\n var r = dn(t, e);\n return new Tn(t.key, n.version, r, {\n hasCommittedMutations: !0\n });\n }(t, e, n) : t instanceof vn ? function(t, e, n) {\n if (x(null != n.transformResults), !on(t.Ge, e)) \n // Since the mutation was not rejected, we know that the precondition\n // matched on the backend. We therefore must not have the expected version\n // of the document in our cache and return an UnknownDocument with the\n // known updateTime.\n return new An(t.key, n.version);\n var r = yn(t, e), i = \n /**\n * Creates a list of \"transform results\" (a transform result is a field value\n * representing the result of applying a transform) for use after a\n * TransformMutation has been acknowledged by the server.\n *\n * @param fieldTransforms The field transforms to apply the result to.\n * @param baseDoc The document prior to applying this mutation batch.\n * @param serverTransformResults The transform results received by the server.\n * @return The transform results list.\n */\n function(t, e, n) {\n var r = [];\n x(t.length === n.length);\n for (var i = 0; i < n.length; i++) {\n var o = t[i], u = o.transform, s = null;\n e instanceof Tn && (s = e.field(o.field)), r.push(ze(u, s, n[i]));\n }\n return r;\n }(t.fieldTransforms, e, n.transformResults), o = n.version, u = mn(t, r.data(), i);\n return new Tn(t.key, o, u, {\n hasCommittedMutations: !0\n });\n }(t, e, n) : function(t, e, n) {\n // Unlike applyToLocalView, if we're applying a mutation to a remote\n // document the server has accepted the mutation so the precondition must\n // have held.\n return new Nn(t.key, n.version, {\n hasCommittedMutations: !0\n });\n }(t, 0, n);\n}\n\n/**\n * Applies this mutation to the given MaybeDocument or null for the purposes\n * of computing the new local view of a document. Both the input and returned\n * documents can be null.\n *\n * @param mutation The mutation to apply.\n * @param maybeDoc The document to mutate. The input document can be null if\n * the client has no knowledge of the pre-mutation state of the document.\n * @param baseDoc The state of the document prior to this mutation batch. The\n * input document can be null if the client has no knowledge of the\n * pre-mutation state of the document.\n * @param localWriteTime A timestamp indicating the local write time of the\n * batch this mutation is a part of.\n * @return The mutated document. The returned document may be null, but only\n * if maybeDoc was null and the mutation would not create a new document.\n */ function an(t, e, n, r) {\n return t instanceof ln ? function(t, e) {\n if (!on(t.Ge, e)) return e;\n var n = fn(e);\n return new Tn(t.key, n, t.value, {\n Ye: !0\n });\n }(t, e) : t instanceof pn ? function(t, e) {\n if (!on(t.Ge, e)) return e;\n var n = fn(e), r = dn(t, e);\n return new Tn(t.key, n, r, {\n Ye: !0\n });\n }(t, e) : t instanceof vn ? function(t, e, n, r) {\n if (!on(t.Ge, e)) return e;\n var i = yn(t, e), o = function(t, e, n, r) {\n for (var i = [], o = 0, u = t; o < u.length; o++) {\n var s = u[o], a = s.transform, c = null;\n n instanceof Tn && (c = n.field(s.field)), null === c && r instanceof Tn && (\n // If the current document does not contain a value for the mutated\n // field, use the value that existed before applying this mutation\n // batch. This solves an edge case where a PatchMutation clears the\n // values in a nested map before the TransformMutation is applied.\n c = r.field(s.field)), i.push(Be(a, c, e));\n }\n return i;\n }(t.fieldTransforms, n, e, r), u = mn(t, i.data(), o);\n return new Tn(t.key, i.version, u, {\n Ye: !0\n });\n }(t, e, r, n) : function(t, e) {\n return on(t.Ge, e) ? new Nn(t.key, H.min()) : e;\n }(t, e);\n}\n\n/**\n * If this mutation is not idempotent, returns the base value to persist with\n * this mutation. If a base value is returned, the mutation is always applied\n * to this base value, even if document has already been updated.\n *\n * The base value is a sparse object that consists of only the document\n * fields for which this mutation contains a non-idempotent transformation\n * (e.g. a numeric increment). The provided value guarantees consistent\n * behavior for non-idempotent transforms and allow us to return the same\n * latency-compensated value even if the backend has already applied the\n * mutation. The base value is null for idempotent mutations, as they can be\n * re-played even if the backend has already applied them.\n *\n * @return a base value to store along with the mutation, or null for\n * idempotent mutations.\n */ function cn(t, e) {\n return t instanceof vn ? function(t, e) {\n for (var n = null, r = 0, i = t.fieldTransforms; r < i.length; r++) {\n var o = i[r], u = e instanceof Tn ? e.field(o.field) : void 0, s = Ke(o.transform, u || null);\n null != s && (n = null == n ? (new In).set(o.field, s) : n.set(o.field, s));\n }\n return n ? n.Xe() : null;\n }(t, e) : null;\n}\n\nfunction hn(t, e) {\n return t.type === e.type && !!t.key.isEqual(e.key) && !!t.Ge.isEqual(e.Ge) && (0 /* Set */ === t.type ? t.value.isEqual(e.value) : 1 /* Patch */ === t.type ? t.data.isEqual(e.data) && t.Qe.isEqual(e.Qe) : 2 /* Transform */ !== t.type || V(t.fieldTransforms, t.fieldTransforms, (function(t, e) {\n return function(t, e) {\n return t.field.isEqual(e.field) && function(t, e) {\n return t instanceof Qe && e instanceof Qe || t instanceof Ye && e instanceof Ye ? V(t.elements, e.elements, Wt) : t instanceof Je && e instanceof Je ? Wt(t.We, e.We) : t instanceof We && e instanceof We;\n }(t.transform, e.transform);\n }(t, e);\n })));\n}\n\n/**\n * Returns the version from the given document for use as the result of a\n * mutation. Mutations are defined to return the version of the base document\n * only if it is an existing document. Deleted and unknown documents have a\n * post-mutation version of SnapshotVersion.min().\n */ function fn(t) {\n return t instanceof Tn ? t.version : H.min();\n}\n\n/**\n * A mutation that creates or replaces the document at the given key with the\n * object value contents.\n */ var ln = /** @class */ function(e) {\n function n(t, n, r) {\n var i = this;\n return (i = e.call(this) || this).key = t, i.value = n, i.Ge = r, i.type = 0 /* Set */ , \n i;\n }\n return t(n, e), n;\n}(un), pn = /** @class */ function(e) {\n function n(t, n, r, i) {\n var o = this;\n return (o = e.call(this) || this).key = t, o.data = n, o.Qe = r, o.Ge = i, o.type = 1 /* Patch */ , \n o;\n }\n return t(n, e), n;\n}(un);\n\nfunction dn(t, e) {\n return function(t, e) {\n var n = new In(e);\n return t.Qe.fields.forEach((function(e) {\n if (!e.P()) {\n var r = t.data.field(e);\n null !== r ? n.set(e, r) : n.delete(e);\n }\n })), n.Xe();\n }(t, e instanceof Tn ? e.data() : bn.empty());\n}\n\nvar vn = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this) || this).key = t, r.fieldTransforms = n, r.type = 2 /* Transform */ , \n // NOTE: We set a precondition of exists: true as a safety-check, since we\n // always combine TransformMutations with a SetMutation or PatchMutation which\n // (if successful) should end up with an existing document.\n r.Ge = rn.exists(!0), r;\n }\n return t(n, e), n;\n}(un);\n\nfunction yn(t, e) {\n return e;\n}\n\nfunction mn(t, e, n) {\n for (var r = new In(e), i = 0; i < t.fieldTransforms.length; i++) {\n var o = t.fieldTransforms[i];\n r.set(o.field, n[i]);\n }\n return r.Xe();\n}\n\n/** A mutation that deletes the document at the given key. */ var gn = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this) || this).key = t, r.Ge = n, r.type = 3 /* Delete */ , r;\n }\n return t(n, e), n;\n}(un), wn = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this) || this).key = t, r.Ge = n, r.type = 4 /* Verify */ , r;\n }\n return t(n, e), n;\n}(un), bn = /** @class */ function() {\n function t(t) {\n this.proto = t;\n }\n return t.empty = function() {\n return new t({\n mapValue: {}\n });\n }, \n /**\n * Returns the value at the given path or null.\n *\n * @param path the path to search\n * @return The value at the path or if there it doesn't exist.\n */\n t.prototype.field = function(t) {\n if (t.P()) return this.proto;\n for (var e = this.proto, n = 0; n < t.length - 1; ++n) {\n if (!e.mapValue.fields) return null;\n if (!ue(e = e.mapValue.fields[t.get(n)])) return null;\n }\n return (e = (e.mapValue.fields || {})[t.O()]) || null;\n }, t.prototype.isEqual = function(t) {\n return Wt(this.proto, t.proto);\n }, t;\n}(), In = /** @class */ function() {\n /**\n * @param baseObject The object to mutate.\n */\n function t(t) {\n void 0 === t && (t = bn.empty()), this.Ze = t, \n /** A map that contains the accumulated changes in this builder. */\n this.tn = new Map;\n }\n /**\n * Sets the field to the provided value.\n *\n * @param path The field path to set.\n * @param value The value to set.\n * @return The current Builder instance.\n */ return t.prototype.set = function(t, e) {\n return this.en(t, e), this;\n }, \n /**\n * Removes the field at the specified path. If there is no field at the\n * specified path, nothing is changed.\n *\n * @param path The field path to remove.\n * @return The current Builder instance.\n */\n t.prototype.delete = function(t) {\n return this.en(t, null), this;\n }, \n /**\n * Adds `value` to the overlay map at `path`. Creates nested map entries if\n * needed.\n */\n t.prototype.en = function(t, e) {\n for (var n = this.tn, r = 0; r < t.length - 1; ++r) {\n var i = t.get(r), o = n.get(i);\n o instanceof Map ? \n // Re-use a previously created map\n n = o : o && 10 /* ObjectValue */ === Kt(o) ? (\n // Convert the existing Protobuf MapValue into a map\n o = new Map(Object.entries(o.mapValue.fields || {})), n.set(i, o), n = o) : (\n // Create an empty map to represent the current nesting level\n o = new Map, n.set(i, o), n = o);\n }\n n.set(t.O(), e);\n }, \n /** Returns an ObjectValue with all mutations applied. */ t.prototype.Xe = function() {\n var t = this.nn($.U(), this.tn);\n return null != t ? new bn(t) : this.Ze;\n }, \n /**\n * Applies any overlays from `currentOverlays` that exist at `currentPath`\n * and returns the merged data at `currentPath` (or null if there were no\n * changes).\n *\n * @param currentPath The path at the current nesting level. Can be set to\n * FieldValue.emptyPath() to represent the root.\n * @param currentOverlays The overlays at the current nesting level in the\n * same format as `overlayMap`.\n * @return The merged data at `currentPath` or null if no modifications\n * were applied.\n */\n t.prototype.nn = function(t, e) {\n var n = this, r = !1, i = this.Ze.field(t), o = ue(i) ? // If there is already data at the current path, base our\n Object.assign({}, i.mapValue.fields) : {};\n return e.forEach((function(e, i) {\n if (e instanceof Map) {\n var u = n.nn(t.child(i), e);\n null != u && (o[i] = u, r = !0);\n } else null !== e ? (o[i] = e, r = !0) : o.hasOwnProperty(i) && (delete o[i], r = !0);\n })), r ? {\n mapValue: {\n fields: o\n }\n } : null;\n }, t;\n}();\n\n/**\n * Returns a FieldMask built from all fields in a MapValue.\n */\nfunction En(t) {\n var e = [];\n return z(t.fields || {}, (function(t, n) {\n var r = new $([ t ]);\n if (ue(n)) {\n var i = En(n.mapValue).fields;\n if (0 === i.length) \n // Preserve the empty map by adding it to the FieldMask.\n e.push(r); else \n // For nested and non-empty ObjectValues, add the FieldPath of the\n // leaf nodes.\n for (var o = 0, u = i; o < u.length; o++) {\n var s = u[o];\n e.push(r.child(s));\n }\n } else \n // For nested and non-empty ObjectValues, add the FieldPath of the leaf\n // nodes.\n e.push(r);\n })), new tn(e)\n /**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n /**\n * The result of a lookup for a given path may be an existing document or a\n * marker that this document does not exist at a given version.\n */;\n}\n\nvar _n = function(t, e) {\n this.key = t, this.version = e;\n}, Tn = /** @class */ function(e) {\n function n(t, n, r, i) {\n var o = this;\n return (o = e.call(this, t, n) || this).sn = r, o.Ye = !!i.Ye, o.hasCommittedMutations = !!i.hasCommittedMutations, \n o;\n }\n return t(n, e), n.prototype.field = function(t) {\n return this.sn.field(t);\n }, n.prototype.data = function() {\n return this.sn;\n }, n.prototype.rn = function() {\n return this.sn.proto;\n }, n.prototype.isEqual = function(t) {\n return t instanceof n && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.Ye === t.Ye && this.hasCommittedMutations === t.hasCommittedMutations && this.sn.isEqual(t.sn);\n }, n.prototype.toString = function() {\n return \"Document(\" + this.key + \", \" + this.version + \", \" + this.sn.toString() + \", {hasLocalMutations: \" + this.Ye + \"}), {hasCommittedMutations: \" + this.hasCommittedMutations + \"})\";\n }, Object.defineProperty(n.prototype, \"hasPendingWrites\", {\n get: function() {\n return this.Ye || this.hasCommittedMutations;\n },\n enumerable: !1,\n configurable: !0\n }), n;\n}(_n), Nn = /** @class */ function(e) {\n function n(t, n, r) {\n var i = this;\n return (i = e.call(this, t, n) || this).hasCommittedMutations = !(!r || !r.hasCommittedMutations), \n i;\n }\n return t(n, e), n.prototype.toString = function() {\n return \"NoDocument(\" + this.key + \", \" + this.version + \")\";\n }, Object.defineProperty(n.prototype, \"hasPendingWrites\", {\n get: function() {\n return this.hasCommittedMutations;\n },\n enumerable: !1,\n configurable: !0\n }), n.prototype.isEqual = function(t) {\n return t instanceof n && t.hasCommittedMutations === this.hasCommittedMutations && t.version.isEqual(this.version) && t.key.isEqual(this.key);\n }, n;\n}(_n), An = /** @class */ function(e) {\n function n() {\n return null !== e && e.apply(this, arguments) || this;\n }\n return t(n, e), n.prototype.toString = function() {\n return \"UnknownDocument(\" + this.key + \", \" + this.version + \")\";\n }, Object.defineProperty(n.prototype, \"hasPendingWrites\", {\n get: function() {\n return !0;\n },\n enumerable: !1,\n configurable: !0\n }), n.prototype.isEqual = function(t) {\n return t instanceof n && t.version.isEqual(this.version) && t.key.isEqual(this.key);\n }, n;\n}(_n), Dn = \n/**\n * Initializes a Query with a path and optional additional query constraints.\n * Path must currently be empty if this is a collection group query.\n */\nfunction(t, e, n, r, i, o /* First */ , u, s) {\n void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []), \n void 0 === i && (i = null), void 0 === o && (o = \"F\"), void 0 === u && (u = null), \n void 0 === s && (s = null), this.path = t, this.collectionGroup = e, this.on = n, \n this.filters = r, this.limit = i, this.an = o, this.startAt = u, this.endAt = s, \n this.hn = null, \n // The corresponding `Target` of this `Query` instance.\n this.cn = null, this.startAt, this.endAt;\n};\n\n/**\n * Represents a document in Firestore with a key, version, data and whether the\n * data has local mutations applied to it.\n */\n/** Creates a new Query instance with the options provided. */ function Sn(t, e, n, r, i, o, u, s) {\n return new Dn(t, e, n, r, i, o, u, s);\n}\n\n/** Creates a new Query for a query that matches all documents at `path` */ function xn(t) {\n return new Dn(t);\n}\n\n/**\n * Helper to convert a collection group query into a collection query at a\n * specific path. This is used when executing collection group queries, since\n * we have to split the query into a set of collection queries at multiple\n * paths.\n */ function kn(t) {\n return !tt(t.limit) && \"F\" /* First */ === t.an;\n}\n\nfunction Pn(t) {\n return !tt(t.limit) && \"L\" /* Last */ === t.an;\n}\n\nfunction On(t) {\n return t.on.length > 0 ? t.on[0].field : null;\n}\n\nfunction Ln(t) {\n for (var e = 0, n = t.filters; e < n.length; e++) {\n var r = n[e];\n if (r.un()) return r.field;\n }\n return null;\n}\n\n/**\n * Checks if any of the provided Operators are included in the query and\n * returns the first one that is, or null if none are.\n */\n/**\n * Returns whether the query matches a collection group rather than a specific\n * collection.\n */ function Vn(t) {\n return null !== t.collectionGroup;\n}\n\n/**\n * Returns the implicit order by constraint that is used to execute the Query,\n * which can be different from the order by constraints the user provided (e.g.\n * the SDK and backend always orders by `__name__`).\n */ function Rn(t) {\n var e = k(t);\n if (null === e.hn) {\n e.hn = [];\n var n = Ln(e), r = On(e);\n if (null !== n && null === r) \n // In order to implicitly add key ordering, we must also add the\n // inequality filter field for it to be a valid query.\n // Note that the default inequality field and key ordering is ascending.\n n.W() || e.hn.push(new ir(n)), e.hn.push(new ir($.j(), \"asc\" /* ASCENDING */)); else {\n for (var i = !1, o = 0, u = e.on; o < u.length; o++) {\n var s = u[o];\n e.hn.push(s), s.field.W() && (i = !0);\n }\n if (!i) {\n // The order of the implicit key ordering always matches the last\n // explicit order by\n var a = e.on.length > 0 ? e.on[e.on.length - 1].dir : \"asc\" /* ASCENDING */;\n e.hn.push(new ir($.j(), a));\n }\n }\n }\n return e.hn;\n}\n\n/**\n * Converts this `Query` instance to it's corresponding `Target` representation.\n */ function Cn(t) {\n var e = k(t);\n if (!e.cn) if (\"F\" /* First */ === e.an) e.cn = it(e.path, e.collectionGroup, Rn(e), e.filters, e.limit, e.startAt, e.endAt); else {\n for (\n // Flip the orderBy directions since we want the last results\n var n = [], r = 0, i = Rn(e); r < i.length; r++) {\n var o = i[r], u = \"desc\" /* DESCENDING */ === o.dir ? \"asc\" /* ASCENDING */ : \"desc\" /* DESCENDING */;\n n.push(new ir(o.field, u));\n }\n // We need to swap the cursors to match the now-flipped query ordering.\n var s = e.endAt ? new tr(e.endAt.position, !e.endAt.before) : null, a = e.startAt ? new tr(e.startAt.position, !e.startAt.before) : null;\n // Now return as a LimitType.First query.\n e.cn = it(e.path, e.collectionGroup, n, e.filters, e.limit, s, a);\n }\n return e.cn;\n}\n\nfunction Un(t, e, n) {\n return new Dn(t.path, t.collectionGroup, t.on.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);\n}\n\nfunction Mn(t, e) {\n return new Dn(t.path, t.collectionGroup, t.on.slice(), t.filters.slice(), t.limit, t.an, e, t.endAt);\n}\n\nfunction qn(t, e) {\n return new Dn(t.path, t.collectionGroup, t.on.slice(), t.filters.slice(), t.limit, t.an, t.startAt, e);\n}\n\nfunction Fn(t, e) {\n return ut(Cn(t), Cn(e)) && t.an === e.an;\n}\n\n// TODO(b/29183165): This is used to get a unique string from a query to, for\n// example, use as a dictionary key, but the implementation is subject to\n// collisions. Make it collision-free.\nfunction jn(t) {\n return ot(Cn(t)) + \"|lt:\" + t.an;\n}\n\nfunction Gn(t) {\n return \"Query(target=\" + function(t) {\n var e = t.path.B();\n return null !== t.collectionGroup && (e += \" collectionGroup=\" + t.collectionGroup), \n t.filters.length > 0 && (e += \", filters: [\" + t.filters.map((function(t) {\n return (e = t).field.B() + \" \" + e.op + \" \" + Xt(e.value);\n /** Returns a debug description for `filter`. */ var e;\n /** Filter that matches on key fields (i.e. '__name__'). */ })).join(\", \") + \"]\"), \n tt(t.limit) || (e += \", limit: \" + t.limit), t.orderBy.length > 0 && (e += \", orderBy: [\" + t.orderBy.map((function(t) {\n return (e = t).field.B() + \" (\" + e.dir + \")\";\n var e;\n })).join(\", \") + \"]\"), t.startAt && (e += \", startAt: \" + er(t.startAt)), t.endAt && (e += \", endAt: \" + er(t.endAt)), \n \"Target(\" + e + \")\";\n }(Cn(t)) + \"; limitType=\" + t.an + \")\";\n}\n\n/** Returns whether `doc` matches the constraints of `query`. */ function Bn(t, e) {\n return function(t, e) {\n var n = e.key.path;\n return null !== t.collectionGroup ? e.key.Y(t.collectionGroup) && t.path.M(n) : Z.X(t.path) ? t.path.isEqual(n) : t.path.$(n);\n }(t, e) && function(t, e) {\n for (var n = 0, r = t.on; n < r.length; n++) {\n var i = r[n];\n // order by key always matches\n if (!i.field.W() && null === e.field(i.field)) return !1;\n }\n return !0;\n }(t, e) && function(t, e) {\n for (var n = 0, r = t.filters; n < r.length; n++) {\n if (!r[n].matches(e)) return !1;\n }\n return !0;\n }(t, e) && function(t, e) {\n return !(t.startAt && !nr(t.startAt, Rn(t), e)) && (!t.endAt || !nr(t.endAt, Rn(t), e));\n }(t, e);\n}\n\nfunction zn(t) {\n return function(e, n) {\n for (var r = !1, i = 0, o = Rn(t); i < o.length; i++) {\n var u = o[i], s = or(u, e, n);\n if (0 !== s) return s;\n r = r || u.field.W();\n }\n return 0;\n };\n}\n\nvar Kn = /** @class */ function(e) {\n function n(t, n, r) {\n var i = this;\n return (i = e.call(this) || this).field = t, i.op = n, i.value = r, i;\n }\n /**\n * Creates a filter based on the provided arguments.\n */ return t(n, e), n.create = function(t, e, r) {\n return t.W() ? \"in\" /* IN */ === e || \"not-in\" /* NOT_IN */ === e ? this.ln(t, e, r) : new Wn(t, e, r) : \"array-contains\" /* ARRAY_CONTAINS */ === e ? new Xn(t, r) : \"in\" /* IN */ === e ? new Jn(t, r) : \"not-in\" /* NOT_IN */ === e ? new $n(t, r) : \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ === e ? new Zn(t, r) : new n(t, e, r);\n }, n.ln = function(t, e, n) {\n return \"in\" /* IN */ === e ? new Qn(t, n) : new Hn(t, n);\n }, n.prototype.matches = function(t) {\n var e = t.field(this.field);\n // Types do not have to match in NOT_EQUAL filters.\n return \"!=\" /* NOT_EQUAL */ === this.op ? null !== e && this._n(Ht(e, this.value)) : null !== e && Kt(this.value) === Kt(e) && this._n(Ht(e, this.value));\n // Only compare types with matching backend order (such as double and int).\n }, n.prototype._n = function(t) {\n switch (this.op) {\n case \"<\" /* LESS_THAN */ :\n return t < 0;\n\n case \"<=\" /* LESS_THAN_OR_EQUAL */ :\n return t <= 0;\n\n case \"==\" /* EQUAL */ :\n return 0 === t;\n\n case \"!=\" /* NOT_EQUAL */ :\n return 0 !== t;\n\n case \">\" /* GREATER_THAN */ :\n return t > 0;\n\n case \">=\" /* GREATER_THAN_OR_EQUAL */ :\n return t >= 0;\n\n default:\n return S();\n }\n }, n.prototype.un = function() {\n return [ \"<\" /* LESS_THAN */ , \"<=\" /* LESS_THAN_OR_EQUAL */ , \">\" /* GREATER_THAN */ , \">=\" /* GREATER_THAN_OR_EQUAL */ , \"!=\" /* NOT_EQUAL */ , \"not-in\" /* NOT_IN */ ].indexOf(this.op) >= 0;\n }, n;\n}((function() {}));\n\nvar Wn = /** @class */ function(e) {\n function n(t, n, r) {\n var i = this;\n return (i = e.call(this, t, n, r) || this).key = Z.J(r.referenceValue), i;\n }\n return t(n, e), n.prototype.matches = function(t) {\n var e = Z.D(t.key, this.key);\n return this._n(e);\n }, n;\n}(Kn), Qn = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this, t, \"in\" /* IN */ , n) || this).keys = Yn(\"in\" /* IN */ , n), \n r;\n }\n return t(n, e), n.prototype.matches = function(t) {\n return this.keys.some((function(e) {\n return e.isEqual(t.key);\n }));\n }, n;\n}(Kn), Hn = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this, t, \"not-in\" /* NOT_IN */ , n) || this).keys = Yn(\"not-in\" /* NOT_IN */ , n), \n r;\n }\n return t(n, e), n.prototype.matches = function(t) {\n return !this.keys.some((function(e) {\n return e.isEqual(t.key);\n }));\n }, n;\n}(Kn);\n\n/** Filter that matches on key fields within an array. */ function Yn(t, e) {\n var n;\n return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((function(t) {\n return Z.J(t.referenceValue);\n }));\n}\n\n/** A Filter that implements the array-contains operator. */ var Xn = /** @class */ function(e) {\n function n(t, n) {\n return e.call(this, t, \"array-contains\" /* ARRAY_CONTAINS */ , n) || this;\n }\n return t(n, e), n.prototype.matches = function(t) {\n var e = t.field(this.field);\n return re(e) && Qt(e.arrayValue, this.value);\n }, n;\n}(Kn), Jn = /** @class */ function(e) {\n function n(t, n) {\n return e.call(this, t, \"in\" /* IN */ , n) || this;\n }\n return t(n, e), n.prototype.matches = function(t) {\n var e = t.field(this.field);\n return null !== e && Qt(this.value.arrayValue, e);\n }, n;\n}(Kn), $n = /** @class */ function(e) {\n function n(t, n) {\n return e.call(this, t, \"not-in\" /* NOT_IN */ , n) || this;\n }\n return t(n, e), n.prototype.matches = function(t) {\n if (Qt(this.value.arrayValue, {\n nullValue: \"NULL_VALUE\"\n })) return !1;\n var e = t.field(this.field);\n return null !== e && !Qt(this.value.arrayValue, e);\n }, n;\n}(Kn), Zn = /** @class */ function(e) {\n function n(t, n) {\n return e.call(this, t, \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , n) || this;\n }\n return t(n, e), n.prototype.matches = function(t) {\n var e = this, n = t.field(this.field);\n return !(!re(n) || !n.arrayValue.values) && n.arrayValue.values.some((function(t) {\n return Qt(e.value.arrayValue, t);\n }));\n }, n;\n}(Kn), tr = function(t, e) {\n this.position = t, this.before = e;\n};\n\n/** A Filter that implements the IN operator. */ function er(t) {\n // TODO(b/29183165): Make this collision robust.\n return (t.before ? \"b\" : \"a\") + \":\" + t.position.map((function(t) {\n return Xt(t);\n })).join(\",\");\n}\n\n/**\n * Returns true if a document sorts before a bound using the provided sort\n * order.\n */ function nr(t, e, n) {\n for (var r = 0, i = 0; i < t.position.length; i++) {\n var o = e[i], u = t.position[i];\n if (r = o.field.W() ? Z.D(Z.J(u.referenceValue), n.key) : Ht(u, n.field(o.field)), \n \"desc\" /* DESCENDING */ === o.dir && (r *= -1), 0 !== r) break;\n }\n return t.before ? r <= 0 : r < 0;\n}\n\nfunction rr(t, e) {\n if (null === t) return null === e;\n if (null === e) return !1;\n if (t.before !== e.before || t.position.length !== e.position.length) return !1;\n for (var n = 0; n < t.position.length; n++) if (!Wt(t.position[n], e.position[n])) return !1;\n return !0;\n}\n\n/**\n * An ordering on a field, in some Direction. Direction defaults to ASCENDING.\n */ var ir = function(t, e /* ASCENDING */) {\n void 0 === e && (e = \"asc\"), this.field = t, this.dir = e;\n};\n\nfunction or(t, e, n) {\n var r = t.field.W() ? Z.D(e.key, n.key) : function(t, e, n) {\n var r = e.field(t), i = n.field(t);\n return null !== r && null !== i ? Ht(r, i) : S();\n }(t.field, e, n);\n switch (t.dir) {\n case \"asc\" /* ASCENDING */ :\n return r;\n\n case \"desc\" /* DESCENDING */ :\n return -1 * r;\n\n default:\n return S();\n }\n}\n\nfunction ur(t, e) {\n return t.dir === e.dir && t.field.isEqual(e.field);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ var sr = function() {\n var t = this;\n this.promise = new Promise((function(e, n) {\n t.resolve = e, t.reject = n;\n }));\n}, ar = /** @class */ function() {\n function t(\n /**\n * The AsyncQueue to run backoff operations on.\n */\n t, \n /**\n * The ID to use when scheduling backoff operations on the AsyncQueue.\n */\n e, \n /**\n * The initial delay (used as the base delay on the first retry attempt).\n * Note that jitter will still be applied, so the actual delay could be as\n * little as 0.5*initialDelayMs.\n */\n n\n /**\n * The multiplier to use to determine the extended base delay after each\n * attempt.\n */ , r\n /**\n * The maximum base delay after which no further backoff is performed.\n * Note that jitter will still be applied, so the actual delay could be as\n * much as 1.5*maxDelayMs.\n */ , i) {\n void 0 === n && (n = 1e3), void 0 === r && (r = 1.5), void 0 === i && (i = 6e4), \n this.fn = t, this.dn = e, this.wn = n, this.En = r, this.Tn = i, this.In = 0, this.mn = null, \n /** The last backoff attempt, as epoch milliseconds. */\n this.An = Date.now(), this.reset();\n }\n /**\n * Resets the backoff delay.\n *\n * The very next backoffAndWait() will have no delay. If it is called again\n * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and\n * subsequent ones will increase according to the backoffFactor.\n */ return t.prototype.reset = function() {\n this.In = 0;\n }, \n /**\n * Resets the backoff delay to the maximum delay (e.g. for use after a\n * RESOURCE_EXHAUSTED error).\n */\n t.prototype.Rn = function() {\n this.In = this.Tn;\n }, \n /**\n * Returns a promise that resolves after currentDelayMs, and increases the\n * delay for any subsequent attempts. If there was a pending backoff operation\n * already, it will be canceled.\n */\n t.prototype.Pn = function(t) {\n var e = this;\n // Cancel any pending backoff operation.\n this.cancel();\n // First schedule using the current base (which may be 0 and should be\n // honored as such).\n var n = Math.floor(this.In + this.gn()), r = Math.max(0, Date.now() - this.An), i = Math.max(0, n - r);\n // Guard against lastAttemptTime being in the future due to a clock change.\n i > 0 && T(\"ExponentialBackoff\", \"Backing off for \" + i + \" ms (base delay: \" + this.In + \" ms, delay with jitter: \" + n + \" ms, last attempt: \" + r + \" ms ago)\"), \n this.mn = this.fn.Vn(this.dn, i, (function() {\n return e.An = Date.now(), t();\n })), \n // Apply backoff factor to determine next delay and ensure it is within\n // bounds.\n this.In *= this.En, this.In < this.wn && (this.In = this.wn), this.In > this.Tn && (this.In = this.Tn);\n }, t.prototype.yn = function() {\n null !== this.mn && (this.mn.pn(), this.mn = null);\n }, t.prototype.cancel = function() {\n null !== this.mn && (this.mn.cancel(), this.mn = null);\n }, \n /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ t.prototype.gn = function() {\n return (Math.random() - .5) * this.In;\n }, t;\n}(), cr = /** @class */ function() {\n function t(t) {\n var e = this;\n // NOTE: next/catchCallback will always point to our own wrapper functions,\n // not the user's raw next() or catch() callbacks.\n this.bn = null, this.vn = null, \n // When the operation resolves, we'll set result or error and mark isDone.\n this.result = void 0, this.error = void 0, this.Sn = !1, \n // Set to true when .then() or .catch() are called and prevents additional\n // chaining.\n this.Dn = !1, t((function(t) {\n e.Sn = !0, e.result = t, e.bn && \n // value should be defined unless T is Void, but we can't express\n // that in the type system.\n e.bn(t);\n }), (function(t) {\n e.Sn = !0, e.error = t, e.vn && e.vn(t);\n }));\n }\n return t.prototype.catch = function(t) {\n return this.next(void 0, t);\n }, t.prototype.next = function(e, n) {\n var r = this;\n return this.Dn && S(), this.Dn = !0, this.Sn ? this.error ? this.Cn(n, this.error) : this.Nn(e, this.result) : new t((function(t, i) {\n r.bn = function(n) {\n r.Nn(e, n).next(t, i);\n }, r.vn = function(e) {\n r.Cn(n, e).next(t, i);\n };\n }));\n }, t.prototype.xn = function() {\n var t = this;\n return new Promise((function(e, n) {\n t.next(e, n);\n }));\n }, t.prototype.Fn = function(e) {\n try {\n var n = e();\n return n instanceof t ? n : t.resolve(n);\n } catch (e) {\n return t.reject(e);\n }\n }, t.prototype.Nn = function(e, n) {\n return e ? this.Fn((function() {\n return e(n);\n })) : t.resolve(n);\n }, t.prototype.Cn = function(e, n) {\n return e ? this.Fn((function() {\n return e(n);\n })) : t.reject(n);\n }, t.resolve = function(e) {\n return new t((function(t, n) {\n t(e);\n }));\n }, t.reject = function(e) {\n return new t((function(t, n) {\n n(e);\n }));\n }, t.kn = function(\n // Accept all Promise types in waitFor().\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n e) {\n return new t((function(t, n) {\n var r = 0, i = 0, o = !1;\n e.forEach((function(e) {\n ++r, e.next((function() {\n ++i, o && i === r && t();\n }), (function(t) {\n return n(t);\n }));\n })), o = !0, i === r && t();\n }));\n }, \n /**\n * Given an array of predicate functions that asynchronously evaluate to a\n * boolean, implements a short-circuiting `or` between the results. Predicates\n * will be evaluated until one of them returns `true`, then stop. The final\n * result will be whether any of them returned `true`.\n */\n t.On = function(e) {\n for (var n = t.resolve(!1), r = function(e) {\n n = n.next((function(n) {\n return n ? t.resolve(n) : e();\n }));\n }, i = 0, o = e; i < o.length; i++) {\n r(o[i]);\n }\n return n;\n }, t.forEach = function(t, e) {\n var n = this, r = [];\n return t.forEach((function(t, i) {\n r.push(e.call(n, t, i));\n })), this.kn(r);\n }, t;\n}(), hr = /** @class */ function() {\n /*\n * Creates a new SimpleDb wrapper for IndexedDb database `name`.\n *\n * Note that `version` must not be a downgrade. IndexedDB does not support\n * downgrading the schema version. We currently do not support any way to do\n * versioning outside of IndexedDB's versioning mechanism, as only\n * version-upgrade transactions are allowed to do things like create\n * objectstores.\n */\n function t(e, n, r) {\n this.name = e, this.version = n, this.Mn = r, \n // NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the\n // bug we're checking for should exist in iOS >= 12.2 and < 13, but for\n // whatever reason it's much harder to hit after 12.2 so we only proactively\n // log on 12.2.\n 12.2 === t.$n(s()) && N(\"Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.\");\n }\n /** Deletes the specified database. */ return t.delete = function(t) {\n return T(\"SimpleDb\", \"Removing database:\", t), yr(window.indexedDB.deleteDatabase(t)).xn();\n }, \n /** Returns true if IndexedDB is available in the current environment. */ t.Ln = function() {\n if (\"undefined\" == typeof indexedDB) return !1;\n if (t.Bn()) return !0;\n // We extensively use indexed array values and compound keys,\n // which IE and Edge do not support. However, they still have indexedDB\n // defined on the window, so we need to check for them here and make sure\n // to return that persistence is not enabled for those browsers.\n // For tracking support of this feature, see here:\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/\n // Check the UA string to find out the browser.\n var e = s(), n = t.$n(e), r = 0 < n && n < 10, i = t.qn(e), o = 0 < i && i < 4.5;\n // IE 10\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n // IE 11\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n // Edge\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,\n // like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n // iOS Safari: Disable for users running iOS version < 10.\n return !(e.indexOf(\"MSIE \") > 0 || e.indexOf(\"Trident/\") > 0 || e.indexOf(\"Edge/\") > 0 || r || o);\n }, \n /**\n * Returns true if the backing IndexedDB store is the Node IndexedDBShim\n * (see https://github.com/axemclion/IndexedDBShim).\n */\n t.Bn = function() {\n var t;\n return \"undefined\" != typeof process && \"YES\" === (null === (t = process.env) || void 0 === t ? void 0 : t.Un);\n }, \n /** Helper to get a typed SimpleDbStore from a transaction. */ t.Kn = function(t, e) {\n return t.store(e);\n }, \n // visible for testing\n /** Parse User Agent to determine iOS version. Returns -1 if not found. */\n t.$n = function(t) {\n var e = t.match(/i(?:phone|pad|pod) os ([\\d_]+)/i), n = e ? e[1].split(\"_\").slice(0, 2).join(\".\") : \"-1\";\n return Number(n);\n }, \n // visible for testing\n /** Parse User Agent to determine Android version. Returns -1 if not found. */\n t.qn = function(t) {\n var e = t.match(/Android ([\\d.]+)/i), n = e ? e[1].split(\".\").slice(0, 2).join(\".\") : \"-1\";\n return Number(n);\n }, \n /**\n * Opens the specified database, creating or upgrading it if necessary.\n */\n t.prototype.Qn = function(t) {\n return e(this, void 0, void 0, (function() {\n var e, r = this;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return this.db ? [ 3 /*break*/ , 2 ] : (T(\"SimpleDb\", \"Opening database:\", this.name), \n e = this, [ 4 /*yield*/ , new Promise((function(e, n) {\n // TODO(mikelehen): Investigate browser compatibility.\n // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB\n // suggests IE9 and older WebKit browsers handle upgrade\n // differently. They expect setVersion, as described here:\n // https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeRequest/setVersion\n var i = indexedDB.open(r.name, r.version);\n i.onsuccess = function(t) {\n var n = t.target.result;\n e(n);\n }, i.onblocked = function() {\n n(new lr(t, \"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed.\"));\n }, i.onerror = function(e) {\n var r = e.target.error;\n \"VersionError\" === r.name ? n(new I(b.FAILED_PRECONDITION, \"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.\")) : n(new lr(t, r));\n }, i.onupgradeneeded = function(t) {\n T(\"SimpleDb\", 'Database \"' + r.name + '\" requires upgrade from version:', t.oldVersion);\n var e = t.target.result;\n r.Mn.createOrUpgrade(e, i.transaction, t.oldVersion, r.version).next((function() {\n T(\"SimpleDb\", \"Database upgrade to version \" + r.version + \" complete\");\n }));\n };\n })) ]);\n\n case 1:\n e.db = n.sent(), n.label = 2;\n\n case 2:\n return [ 2 /*return*/ , (this.Wn && (this.db.onversionchange = function(t) {\n return r.Wn(t);\n }), this.db) ];\n }\n }));\n }));\n }, t.prototype.jn = function(t) {\n this.Wn = t, this.db && (this.db.onversionchange = function(e) {\n return t(e);\n });\n }, t.prototype.runTransaction = function(t, r, i, o) {\n return e(this, void 0, void 0, (function() {\n var e, u, s, a, c;\n return n(this, (function(h) {\n switch (h.label) {\n case 0:\n e = \"readonly\" === r, u = 0, s = function() {\n var r, s, c, h, f;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n ++u, n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 4, , 5 ]), [ 4 /*yield*/ , a.Qn(t) ];\n\n case 2:\n // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to\n // fire), but still return the original transactionFnResult back to the\n // caller.\n return a.db = n.sent(), r = dr.open(a.db, t, e ? \"readonly\" : \"readwrite\", i), s = o(r).catch((function(t) {\n // Abort the transaction if there was an error.\n return r.abort(t), cr.reject(t);\n })).xn(), c = {}, s.catch((function() {})), [ 4 /*yield*/ , r.Gn ];\n\n case 3:\n return [ 2 /*return*/ , (c.value = (\n // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to\n // fire), but still return the original transactionFnResult back to the\n // caller.\n n.sent(), s), c) ];\n\n case 4:\n return h = n.sent(), f = \"FirebaseError\" !== h.name && u < 3, T(\"SimpleDb\", \"Transaction failed with error:\", h.message, \"Retrying:\", f), \n a.close(), f ? [ 3 /*break*/ , 5 ] : [ 2 /*return*/ , {\n value: Promise.reject(h)\n } ];\n\n case 5:\n return [ 2 /*return*/ ];\n }\n }));\n }, a = this, h.label = 1;\n\n case 1:\n return [ 5 /*yield**/ , s() ];\n\n case 2:\n if (\"object\" == typeof (c = h.sent())) return [ 2 /*return*/ , c.value ];\n h.label = 3;\n\n case 3:\n return [ 3 /*break*/ , 1 ];\n\n case 4:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }, t.prototype.close = function() {\n this.db && this.db.close(), this.db = void 0;\n }, t;\n}(), fr = /** @class */ function() {\n function t(t) {\n this.zn = t, this.Hn = !1, this.Jn = null;\n }\n return Object.defineProperty(t.prototype, \"Sn\", {\n get: function() {\n return this.Hn;\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"Yn\", {\n get: function() {\n return this.Jn;\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"cursor\", {\n set: function(t) {\n this.zn = t;\n },\n enumerable: !1,\n configurable: !0\n }), \n /**\n * This function can be called to stop iteration at any point.\n */\n t.prototype.done = function() {\n this.Hn = !0;\n }, \n /**\n * This function can be called to skip to that next key, which could be\n * an index or a primary key.\n */\n t.prototype.Xn = function(t) {\n this.Jn = t;\n }, \n /**\n * Delete the current cursor value from the object store.\n *\n * NOTE: You CANNOT do this with a keysOnly query.\n */\n t.prototype.delete = function() {\n return yr(this.zn.delete());\n }, t;\n}(), lr = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this, b.UNAVAILABLE, \"IndexedDB transaction '\" + t + \"' failed: \" + n) || this).name = \"IndexedDbTransactionError\", \n r;\n }\n return t(n, e), n;\n}(I);\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A helper for running delayed tasks following an exponential backoff curve\n * between attempts.\n *\n * Each delay is made up of a \"base\" delay which follows the exponential\n * backoff curve, and a +/- 50% \"jitter\" that is calculated and added to the\n * base delay. This prevents clients from accidentally synchronizing their\n * delays causing spikes of load to the backend.\n */\n/** Verifies whether `e` is an IndexedDbTransactionError. */ function pr(t) {\n // Use name equality, as instanceof checks on errors don't work with errors\n // that wrap other errors.\n return \"IndexedDbTransactionError\" === t.name;\n}\n\n/**\n * Wraps an IDBTransaction and exposes a store() method to get a handle to a\n * specific object store.\n */ var dr = /** @class */ function() {\n function t(t, e) {\n var n = this;\n this.action = t, this.transaction = e, this.aborted = !1, \n /**\n * A promise that resolves with the result of the IndexedDb transaction.\n */\n this.Zn = new sr, this.transaction.oncomplete = function() {\n n.Zn.resolve();\n }, this.transaction.onabort = function() {\n e.error ? n.Zn.reject(new lr(t, e.error)) : n.Zn.resolve();\n }, this.transaction.onerror = function(e) {\n var r = gr(e.target.error);\n n.Zn.reject(new lr(t, r));\n };\n }\n return t.open = function(e, n, r, i) {\n try {\n return new t(n, e.transaction(i, r));\n } catch (e) {\n throw new lr(n, e);\n }\n }, Object.defineProperty(t.prototype, \"Gn\", {\n get: function() {\n return this.Zn.promise;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.abort = function(t) {\n t && this.Zn.reject(t), this.aborted || (T(\"SimpleDb\", \"Aborting transaction:\", t ? t.message : \"Client-initiated abort\"), \n this.aborted = !0, this.transaction.abort());\n }, \n /**\n * Returns a SimpleDbStore<KeyType, ValueType> for the specified store. All\n * operations performed on the SimpleDbStore happen within the context of this\n * transaction and it cannot be used anymore once the transaction is\n * completed.\n *\n * Note that we can't actually enforce that the KeyType and ValueType are\n * correct, but they allow type safety through the rest of the consuming code.\n */\n t.prototype.store = function(t) {\n var e = this.transaction.objectStore(t);\n return new vr(e);\n }, t;\n}(), vr = /** @class */ function() {\n function t(t) {\n this.store = t;\n }\n return t.prototype.put = function(t, e) {\n var n;\n return void 0 !== e ? (T(\"SimpleDb\", \"PUT\", this.store.name, t, e), n = this.store.put(e, t)) : (T(\"SimpleDb\", \"PUT\", this.store.name, \"<auto-key>\", t), \n n = this.store.put(t)), yr(n);\n }, \n /**\n * Adds a new value into an Object Store and returns the new key. Similar to\n * IndexedDb's `add()`, this method will fail on primary key collisions.\n *\n * @param value The object to write.\n * @return The key of the value to add.\n */\n t.prototype.add = function(t) {\n return T(\"SimpleDb\", \"ADD\", this.store.name, t, t), yr(this.store.add(t));\n }, \n /**\n * Gets the object with the specified key from the specified store, or null\n * if no object exists with the specified key.\n *\n * @key The key of the object to get.\n * @return The object with the specified key or null if no object exists.\n */\n t.prototype.get = function(t) {\n var e = this;\n // We're doing an unsafe cast to ValueType.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return yr(this.store.get(t)).next((function(n) {\n // Normalize nonexistence to null.\n return void 0 === n && (n = null), T(\"SimpleDb\", \"GET\", e.store.name, t, n), n;\n }));\n }, t.prototype.delete = function(t) {\n return T(\"SimpleDb\", \"DELETE\", this.store.name, t), yr(this.store.delete(t));\n }, \n /**\n * If we ever need more of the count variants, we can add overloads. For now,\n * all we need is to count everything in a store.\n *\n * Returns the number of rows in the store.\n */\n t.prototype.count = function() {\n return T(\"SimpleDb\", \"COUNT\", this.store.name), yr(this.store.count());\n }, t.prototype.ts = function(t, e) {\n var n = this.cursor(this.options(t, e)), r = [];\n return this.es(n, (function(t, e) {\n r.push(e);\n })).next((function() {\n return r;\n }));\n }, t.prototype.ns = function(t, e) {\n T(\"SimpleDb\", \"DELETE ALL\", this.store.name);\n var n = this.options(t, e);\n n.ss = !1;\n var r = this.cursor(n);\n return this.es(r, (function(t, e, n) {\n return n.delete();\n }));\n }, t.prototype.rs = function(t, e) {\n var n;\n e ? n = t : (n = {}, e = t);\n var r = this.cursor(n);\n return this.es(r, e);\n }, \n /**\n * Iterates over a store, but waits for the given callback to complete for\n * each entry before iterating the next entry. This allows the callback to do\n * asynchronous work to determine if this iteration should continue.\n *\n * The provided callback should return `true` to continue iteration, and\n * `false` otherwise.\n */\n t.prototype.os = function(t) {\n var e = this.cursor({});\n return new cr((function(n, r) {\n e.onerror = function(t) {\n var e = gr(t.target.error);\n r(e);\n }, e.onsuccess = function(e) {\n var r = e.target.result;\n r ? t(r.primaryKey, r.value).next((function(t) {\n t ? r.continue() : n();\n })) : n();\n };\n }));\n }, t.prototype.es = function(t, e) {\n var n = [];\n return new cr((function(r, i) {\n t.onerror = function(t) {\n i(t.target.error);\n }, t.onsuccess = function(t) {\n var i = t.target.result;\n if (i) {\n var o = new fr(i), u = e(i.primaryKey, i.value, o);\n if (u instanceof cr) {\n var s = u.catch((function(t) {\n return o.done(), cr.reject(t);\n }));\n n.push(s);\n }\n o.Sn ? r() : null === o.Yn ? i.continue() : i.continue(o.Yn);\n } else r();\n };\n })).next((function() {\n return cr.kn(n);\n }));\n }, t.prototype.options = function(t, e) {\n var n = void 0;\n return void 0 !== t && (\"string\" == typeof t ? n = t : e = t), {\n index: n,\n range: e\n };\n }, t.prototype.cursor = function(t) {\n var e = \"next\";\n if (t.reverse && (e = \"prev\"), t.index) {\n var n = this.store.index(t.index);\n return t.ss ? n.openKeyCursor(t.range, e) : n.openCursor(t.range, e);\n }\n return this.store.openCursor(t.range, e);\n }, t;\n}();\n\n/**\n * A wrapper around an IDBObjectStore providing an API that:\n *\n * 1) Has generic KeyType / ValueType parameters to provide strongly-typed\n * methods for acting against the object store.\n * 2) Deals with IndexedDB's onsuccess / onerror event callbacks, making every\n * method return a PersistencePromise instead.\n * 3) Provides a higher-level API to avoid needing to do excessive wrapping of\n * intermediate IndexedDB types (IDBCursorWithValue, etc.)\n */\n/**\n * Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror\n * handlers to resolve / reject the PersistencePromise as appropriate.\n */\nfunction yr(t) {\n return new cr((function(e, n) {\n t.onsuccess = function(t) {\n var n = t.target.result;\n e(n);\n }, t.onerror = function(t) {\n var e = gr(t.target.error);\n n(e);\n };\n }));\n}\n\n// Guard so we only report the error once.\nvar mr = !1;\n\nfunction gr(t) {\n var e = hr.$n(s());\n if (e >= 12.2 && e < 13) {\n var n = \"An internal error was encountered in the Indexed Database server\";\n if (t.message.indexOf(n) >= 0) {\n // Wrap error in a more descriptive one.\n var r = new I(\"internal\", \"IOS_INDEXEDDB_BUG1: IndexedDb has thrown '\" + n + \"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.\");\n return mr || (mr = !0, \n // Throw a global exception outside of this promise chain, for the user to\n // potentially catch.\n setTimeout((function() {\n throw r;\n }), 0)), r;\n }\n }\n return t;\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** The Platform's 'window' implementation or null if not available. */ function wr() {\n // `window` is not always available, e.g. in ReactNative and WebWorkers.\n // eslint-disable-next-line no-restricted-globals\n return \"undefined\" != typeof window ? window : null;\n}\n\n/** The Platform's 'document' implementation or null if not available. */ function br() {\n // `document` is not always available, e.g. in ReactNative and WebWorkers.\n // eslint-disable-next-line no-restricted-globals\n return \"undefined\" != typeof document ? document : null;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents an operation scheduled to be run in the future on an AsyncQueue.\n *\n * It is created via DelayedOperation.createAndSchedule().\n *\n * Supports cancellation (via cancel()) and early execution (via skipDelay()).\n *\n * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type\n * in newer versions of TypeScript defines `finally`, which is not available in\n * IE.\n */ var Ir = /** @class */ function() {\n function t(t, e, n, r, i) {\n this.hs = t, this.dn = e, this.cs = n, this.op = r, this.us = i, this.ls = new sr, \n this.then = this.ls.promise.then.bind(this.ls.promise), \n // It's normal for the deferred promise to be canceled (due to cancellation)\n // and so we attach a dummy catch callback to avoid\n // 'UnhandledPromiseRejectionWarning' log spam.\n this.ls.promise.catch((function(t) {}))\n /**\n * Creates and returns a DelayedOperation that has been scheduled to be\n * executed on the provided asyncQueue after the provided delayMs.\n *\n * @param asyncQueue The queue to schedule the operation on.\n * @param id A Timer ID identifying the type of operation this is.\n * @param delayMs The delay (ms) before the operation should be scheduled.\n * @param op The operation to run.\n * @param removalCallback A callback to be called synchronously once the\n * operation is executed or canceled, notifying the AsyncQueue to remove it\n * from its delayedOperations list.\n * PORTING NOTE: This exists to prevent making removeDelayedOperation() and\n * the DelayedOperation class public.\n */;\n }\n return t._s = function(e, n, r, i, o) {\n var u = new t(e, n, Date.now() + r, i, o);\n return u.start(r), u;\n }, \n /**\n * Starts the timer. This is called immediately after construction by\n * createAndSchedule().\n */\n t.prototype.start = function(t) {\n var e = this;\n this.fs = setTimeout((function() {\n return e.ds();\n }), t);\n }, \n /**\n * Queues the operation to run immediately (if it hasn't already been run or\n * canceled).\n */\n t.prototype.pn = function() {\n return this.ds();\n }, \n /**\n * Cancels the operation if it hasn't already been executed or canceled. The\n * promise will be rejected.\n *\n * As long as the operation has not yet been run, calling cancel() provides a\n * guarantee that the operation will not be run.\n */\n t.prototype.cancel = function(t) {\n null !== this.fs && (this.clearTimeout(), this.ls.reject(new I(b.CANCELLED, \"Operation cancelled\" + (t ? \": \" + t : \"\"))));\n }, t.prototype.ds = function() {\n var t = this;\n this.hs.ws((function() {\n return null !== t.fs ? (t.clearTimeout(), t.op().then((function(e) {\n return t.ls.resolve(e);\n }))) : Promise.resolve();\n }));\n }, t.prototype.clearTimeout = function() {\n null !== this.fs && (this.us(this), clearTimeout(this.fs), this.fs = null);\n }, t;\n}(), Er = /** @class */ function() {\n function t() {\n var t = this;\n // The last promise in the queue.\n this.Es = Promise.resolve(), \n // A list of retryable operations. Retryable operations are run in order and\n // retried with backoff.\n this.Ts = [], \n // Is this AsyncQueue being shut down? Once it is set to true, it will not\n // be changed again.\n this.Is = !1, \n // Operations scheduled to be queued in the future. Operations are\n // automatically removed after they are run or canceled.\n this.As = [], \n // visible for testing\n this.Rs = null, \n // Flag set while there's an outstanding AsyncQueue operation, used for\n // assertion sanity-checks.\n this.Ps = !1, \n // List of TimerIds to fast-forward delays for.\n this.gs = [], \n // Backoff timer used to schedule retries for retryable operations\n this.Vs = new ar(this, \"async_queue_retry\" /* AsyncQueueRetry */), \n // Visibility handler that triggers an immediate retry of all retryable\n // operations. Meant to speed up recovery when we regain file system access\n // after page comes into foreground.\n this.ys = function() {\n var e = br();\n e && T(\"AsyncQueue\", \"Visibility state changed to \", e.visibilityState), t.Vs.yn();\n };\n var e = br();\n e && \"function\" == typeof e.addEventListener && e.addEventListener(\"visibilitychange\", this.ys);\n }\n return Object.defineProperty(t.prototype, \"ps\", {\n // Is this AsyncQueue being shut down? If true, this instance will not enqueue\n // any new operations, Promises from enqueue requests will not resolve.\n get: function() {\n return this.Is;\n },\n enumerable: !1,\n configurable: !0\n }), \n /**\n * Adds a new operation to the queue without waiting for it to complete (i.e.\n * we ignore the Promise result).\n */\n t.prototype.ws = function(t) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.enqueue(t);\n }, \n /**\n * Regardless if the queue has initialized shutdown, adds a new operation to the\n * queue without waiting for it to complete (i.e. we ignore the Promise result).\n */\n t.prototype.bs = function(t) {\n this.vs(), \n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.Ss(t);\n }, \n /**\n * Initialize the shutdown of this queue. Once this method is called, the\n * only possible way to request running an operation is through\n * `enqueueEvenWhileRestricted()`.\n */\n t.prototype.Ds = function() {\n if (!this.Is) {\n this.Is = !0;\n var t = br();\n t && \"function\" == typeof t.removeEventListener && t.removeEventListener(\"visibilitychange\", this.ys);\n }\n }, \n /**\n * Adds a new operation to the queue. Returns a promise that will be resolved\n * when the promise returned by the new operation is (with its value).\n */\n t.prototype.enqueue = function(t) {\n return this.vs(), this.Is ? new Promise((function(t) {})) : this.Ss(t);\n }, \n /**\n * Enqueue a retryable operation.\n *\n * A retryable operation is rescheduled with backoff if it fails with a\n * IndexedDbTransactionError (the error type used by SimpleDb). All\n * retryable operations are executed in order and only run if all prior\n * operations were retried successfully.\n */\n t.prototype.Cs = function(t) {\n var e = this;\n this.ws((function() {\n return e.Ts.push(t), e.Ns();\n }));\n }, \n /**\n * Runs the next operation from the retryable queue. If the operation fails,\n * reschedules with backoff.\n */\n t.prototype.Ns = function() {\n return e(this, void 0, void 0, (function() {\n var t, e = this;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n if (0 === this.Ts.length) return [ 3 /*break*/ , 5 ];\n n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 3, , 4 ]), [ 4 /*yield*/ , this.Ts[0]() ];\n\n case 2:\n return n.sent(), this.Ts.shift(), this.Vs.reset(), [ 3 /*break*/ , 4 ];\n\n case 3:\n if (!pr(t = n.sent())) throw t;\n // Failure will be handled by AsyncQueue\n return T(\"AsyncQueue\", \"Operation failed with retryable error: \" + t), \n [ 3 /*break*/ , 4 ];\n\n case 4:\n this.Ts.length > 0 && \n // If there are additional operations, we re-schedule `retryNextOp()`.\n // This is necessary to run retryable operations that failed during\n // their initial attempt since we don't know whether they are already\n // enqueued. If, for example, `op1`, `op2`, `op3` are enqueued and `op1`\n // needs to be re-run, we will run `op1`, `op1`, `op2` using the\n // already enqueued calls to `retryNextOp()`. `op3()` will then run in the\n // call scheduled here.\n // Since `backoffAndRun()` cancels an existing backoff and schedules a\n // new backoff on every call, there is only ever a single additional\n // operation in the queue.\n this.Vs.Pn((function() {\n return e.Ns();\n })), n.label = 5;\n\n case 5:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }, t.prototype.Ss = function(t) {\n var e = this, n = this.Es.then((function() {\n return e.Ps = !0, t().catch((function(t) {\n // Re-throw the error so that this.tail becomes a rejected Promise and\n // all further attempts to chain (via .then) will just short-circuit\n // and return the rejected Promise.\n throw e.Rs = t, e.Ps = !1, N(\"INTERNAL UNHANDLED ERROR: \", \n /**\n * Chrome includes Error.message in Error.stack. Other browsers do not.\n * This returns expected output of message + stack when available.\n * @param error Error or FirestoreError\n */\n function(t) {\n var e = t.message || \"\";\n return t.stack && (e = t.stack.includes(t.message) ? t.stack : t.message + \"\\n\" + t.stack), \n e;\n }(t)), t;\n })).then((function(t) {\n return e.Ps = !1, t;\n }));\n }));\n return this.Es = n, n;\n }, \n /**\n * Schedules an operation to be queued on the AsyncQueue once the specified\n * `delayMs` has elapsed. The returned DelayedOperation can be used to cancel\n * or fast-forward the operation prior to its running.\n */\n t.prototype.Vn = function(t, e, n) {\n var r = this;\n this.vs(), \n // Fast-forward delays for timerIds that have been overriden.\n this.gs.indexOf(t) > -1 && (e = 0);\n var i = Ir._s(this, t, e, n, (function(t) {\n return r.xs(t);\n }));\n return this.As.push(i), i;\n }, t.prototype.vs = function() {\n this.Rs && S();\n }, \n /**\n * Verifies there's an operation currently in-progress on the AsyncQueue.\n * Unfortunately we can't verify that the running code is in the promise chain\n * of that operation, so this isn't a foolproof check, but it should be enough\n * to catch some bugs.\n */\n t.prototype.Fs = function() {}, \n /**\n * Waits until all currently queued tasks are finished executing. Delayed\n * operations are not run.\n */\n t.prototype.ks = function() {\n return e(this, void 0, void 0, (function() {\n var t;\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n return [ 4 /*yield*/ , t = this.Es ];\n\n case 1:\n e.sent(), e.label = 2;\n\n case 2:\n if (t !== this.Es) return [ 3 /*break*/ , 0 ];\n e.label = 3;\n\n case 3:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }, \n /**\n * For Tests: Determine if a delayed operation with a particular TimerId\n * exists.\n */\n t.prototype.Os = function(t) {\n for (var e = 0, n = this.As; e < n.length; e++) {\n if (n[e].dn === t) return !0;\n }\n return !1;\n }, \n /**\n * For Tests: Runs some or all delayed operations early.\n *\n * @param lastTimerId Delayed operations up to and including this TimerId will\n * be drained. Pass TimerId.All to run all delayed operations.\n * @returns a Promise that resolves once all operations have been run.\n */\n t.prototype.Ms = function(t) {\n var e = this;\n // Note that draining may generate more delayed ops, so we do that first.\n return this.ks().then((function() {\n // Run ops in the same order they'd run if they ran naturally.\n e.As.sort((function(t, e) {\n return t.cs - e.cs;\n }));\n for (var n = 0, r = e.As; n < r.length; n++) {\n var i = r[n];\n if (i.pn(), \"all\" /* All */ !== t && i.dn === t) break;\n }\n return e.ks();\n }));\n }, \n /**\n * For Tests: Skip all subsequent delays for a timer id.\n */\n t.prototype.$s = function(t) {\n this.gs.push(t);\n }, \n /** Called once a DelayedOperation is run or canceled. */ t.prototype.xs = function(t) {\n // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.\n var e = this.As.indexOf(t);\n this.As.splice(e, 1);\n }, t;\n}();\n\n/**\n * Returns a FirestoreError that can be surfaced to the user if the provided\n * error is an IndexedDbTransactionError. Re-throws the error otherwise.\n */\nfunction _r(t, e) {\n if (N(\"AsyncQueue\", e + \": \" + t), pr(t)) return new I(b.UNAVAILABLE, e + \": \" + t);\n throw t;\n}\n\nvar Tr = function() {\n this.Ls = void 0, this.listeners = [];\n}, Nr = function() {\n this.Bs = new W((function(t) {\n return jn(t);\n }), Fn), this.onlineState = \"Unknown\" /* Unknown */ , this.qs = new Set;\n};\n\nfunction Ar(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u, s, a, c;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n if (e = k(t), i = r.query, o = !1, (u = e.Bs.get(i)) || (o = !0, u = new Tr), !o) return [ 3 /*break*/ , 4 ];\n n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 3, , 4 ]), s = u, [ 4 /*yield*/ , e.Us(i) ];\n\n case 2:\n return s.Ls = n.sent(), [ 3 /*break*/ , 4 ];\n\n case 3:\n return a = n.sent(), c = _r(a, \"Initialization of query '\" + Gn(r.query) + \"' failed\"), \n [ 2 /*return*/ , void r.onError(c) ];\n\n case 4:\n return e.Bs.set(i, u), u.listeners.push(r), \n // Run global snapshot listeners if a consistent snapshot has been emitted.\n r.Ks(e.onlineState), u.Ls && r.Qs(u.Ls) && kr(e), [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction Dr(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u, s;\n return n(this, (function(n) {\n return e = k(t), i = r.query, o = !1, (u = e.Bs.get(i)) && (s = u.listeners.indexOf(r)) >= 0 && (u.listeners.splice(s, 1), \n o = 0 === u.listeners.length), o ? [ 2 /*return*/ , (e.Bs.delete(i), e.Ws(i)) ] : [ 2 /*return*/ ];\n }));\n }));\n}\n\nfunction Sr(t, e) {\n for (var n = k(t), r = !1, i = 0, o = e; i < o.length; i++) {\n var u = o[i], s = u.query, a = n.Bs.get(s);\n if (a) {\n for (var c = 0, h = a.listeners; c < h.length; c++) {\n h[c].Qs(u) && (r = !0);\n }\n a.Ls = u;\n }\n }\n r && kr(n);\n}\n\nfunction xr(t, e, n) {\n var r = k(t), i = r.Bs.get(e);\n if (i) for (var o = 0, u = i.listeners; o < u.length; o++) {\n u[o].onError(n);\n }\n // Remove all listeners. NOTE: We don't need to call syncEngine.unlisten()\n // after an error.\n r.Bs.delete(e);\n}\n\n// Call all global snapshot listeners that have been set.\nfunction kr(t) {\n t.qs.forEach((function(t) {\n t.next();\n }));\n}\n\n/**\n * QueryListener takes a series of internal view snapshots and determines\n * when to raise the event.\n *\n * It uses an Observer to dispatch events.\n */ var Pr = /** @class */ function() {\n function t(t, e, n) {\n this.query = t, this.js = e, \n /**\n * Initial snapshots (e.g. from cache) may not be propagated to the wrapped\n * observer. This flag is set to true once we've actually raised an event.\n */\n this.Gs = !1, this.zs = null, this.onlineState = \"Unknown\" /* Unknown */ , this.options = n || {}\n /**\n * Applies the new ViewSnapshot to this listener, raising a user-facing event\n * if applicable (depending on what changed, whether the user has opted into\n * metadata-only changes, etc.). Returns true if a user-facing event was\n * indeed raised.\n */;\n }\n return t.prototype.Qs = function(t) {\n if (!this.options.includeMetadataChanges) {\n for (\n // Remove the metadata only changes.\n var e = [], n = 0, r = t.docChanges; n < r.length; n++) {\n var i = r[n];\n 3 /* Metadata */ !== i.type && e.push(i);\n }\n t = new Pt(t.query, t.docs, t.Kt, e, t.Qt, t.fromCache, t.Wt, \n /* excludesMetadataChanges= */ !0);\n }\n var o = !1;\n return this.Gs ? this.Hs(t) && (this.js.next(t), o = !0) : this.Js(t, this.onlineState) && (this.Ys(t), \n o = !0), this.zs = t, o;\n }, t.prototype.onError = function(t) {\n this.js.error(t);\n }, \n /** Returns whether a snapshot was raised. */ t.prototype.Ks = function(t) {\n this.onlineState = t;\n var e = !1;\n return this.zs && !this.Gs && this.Js(this.zs, t) && (this.Ys(this.zs), e = !0), \n e;\n }, t.prototype.Js = function(t, e) {\n // Always raise the first event when we're synced\n if (!t.fromCache) return !0;\n // NOTE: We consider OnlineState.Unknown as online (it should become Offline\n // or Online if we wait long enough).\n var n = \"Offline\" /* Offline */ !== e;\n // Don't raise the event if we're online, aren't synced yet (checked\n // above) and are waiting for a sync.\n return !(this.options.Xs && n || t.docs.P() && \"Offline\" /* Offline */ !== e);\n // Raise data from cache if we have any documents or we are offline\n }, t.prototype.Hs = function(t) {\n // We don't need to handle includeDocumentMetadataChanges here because\n // the Metadata only changes have already been stripped out if needed.\n // At this point the only changes we will see are the ones we should\n // propagate.\n if (t.docChanges.length > 0) return !0;\n var e = this.zs && this.zs.hasPendingWrites !== t.hasPendingWrites;\n return !(!t.Wt && !e) && !0 === this.options.includeMetadataChanges;\n // Generally we should have hit one of the cases above, but it's possible\n // to get here if there were only metadata docChanges and they got\n // stripped out.\n }, t.prototype.Ys = function(t) {\n t = Pt.Gt(t.query, t.docs, t.Qt, t.fromCache), this.Gs = !0, this.js.next(t);\n }, t;\n}(), Or = /** @class */ function() {\n function t(t) {\n this.uid = t;\n }\n return t.prototype.Zs = function() {\n return null != this.uid;\n }, \n /**\n * Returns a key representing this user, suitable for inclusion in a\n * dictionary.\n */\n t.prototype.ti = function() {\n return this.Zs() ? \"uid:\" + this.uid : \"anonymous-user\";\n }, t.prototype.isEqual = function(t) {\n return t.uid === this.uid;\n }, t;\n}();\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Simple wrapper around a nullable UID. Mostly exists to make code more\n * readable.\n */\n/** A user with a null UID. */ Or.UNAUTHENTICATED = new Or(null), \n// TODO(mikelehen): Look into getting a proper uid-equivalent for\n// non-FirebaseAuth providers.\nOr.ei = new Or(\"google-credentials-uid\"), Or.ni = new Or(\"first-party-uid\");\n\n/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * `ListenSequence` is a monotonic sequence. It is initialized with a minimum value to\n * exceed. All subsequent calls to next will return increasing values. If provided with a\n * `SequenceNumberSyncer`, it will additionally bump its next value when told of a new value, as\n * well as write out sequence numbers that it produces via `next()`.\n */\nvar Lr = /** @class */ function() {\n function t(t, e) {\n var n = this;\n this.previousValue = t, e && (e.si = function(t) {\n return n.ii(t);\n }, this.ri = function(t) {\n return e.oi(t);\n });\n }\n return t.prototype.ii = function(t) {\n return this.previousValue = Math.max(t, this.previousValue), this.previousValue;\n }, t.prototype.next = function() {\n var t = ++this.previousValue;\n return this.ri && this.ri(t), t;\n }, t;\n}();\n\n/** Assembles the key for a client state in WebStorage */\nfunction Vr(t, e) {\n return \"firestore_clients_\" + t + \"_\" + e;\n}\n\n// The format of the WebStorage key that stores the mutation state is:\n// firestore_mutations_<persistence_prefix>_<batch_id>\n// (for unauthenticated users)\n// or: firestore_mutations_<persistence_prefix>_<batch_id>_<user_uid>\n// 'user_uid' is last to avoid needing to escape '_' characters that it might\n// contain.\n/** Assembles the key for a mutation batch in WebStorage */ function Rr(t, e, n) {\n var r = \"firestore_mutations_\" + t + \"_\" + n;\n return e.Zs() && (r += \"_\" + e.uid), r;\n}\n\n// The format of the WebStorage key that stores a query target's metadata is:\n// firestore_targets_<persistence_prefix>_<target_id>\n/** Assembles the key for a query state in WebStorage */ function Cr(t, e) {\n return \"firestore_targets_\" + t + \"_\" + e;\n}\n\n// The WebStorage prefix that stores the primary tab's online state. The\n// format of the key is:\n// firestore_online_state_<persistence_prefix>\n/**\n * Holds the state of a mutation batch, including its user ID, batch ID and\n * whether the batch is 'pending', 'acknowledged' or 'rejected'.\n */\n// Visible for testing\nLr.ai = -1;\n\nvar Ur = /** @class */ function() {\n function t(t, e, n, r) {\n this.user = t, this.batchId = e, this.state = n, this.error = r\n /**\n * Parses a MutationMetadata from its JSON representation in WebStorage.\n * Logs a warning and returns null if the format of the data is not valid.\n */;\n }\n return t.hi = function(e, n, r) {\n var i = JSON.parse(r), o = \"object\" == typeof i && -1 !== [ \"pending\", \"acknowledged\", \"rejected\" ].indexOf(i.state) && (void 0 === i.error || \"object\" == typeof i.error), u = void 0;\n return o && i.error && ((o = \"string\" == typeof i.error.message && \"string\" == typeof i.error.code) && (u = new I(i.error.code, i.error.message))), \n o ? new t(e, n, i.state, u) : (N(\"SharedClientState\", \"Failed to parse mutation state for ID '\" + n + \"': \" + r), \n null);\n }, t.prototype.ci = function() {\n var t = {\n state: this.state,\n updateTimeMs: Date.now()\n };\n return this.error && (t.error = {\n code: this.error.code,\n message: this.error.message\n }), JSON.stringify(t);\n }, t;\n}(), Mr = /** @class */ function() {\n function t(t, e, n) {\n this.targetId = t, this.state = e, this.error = n\n /**\n * Parses a QueryTargetMetadata from its JSON representation in WebStorage.\n * Logs a warning and returns null if the format of the data is not valid.\n */;\n }\n return t.hi = function(e, n) {\n var r = JSON.parse(n), i = \"object\" == typeof r && -1 !== [ \"not-current\", \"current\", \"rejected\" ].indexOf(r.state) && (void 0 === r.error || \"object\" == typeof r.error), o = void 0;\n return i && r.error && ((i = \"string\" == typeof r.error.message && \"string\" == typeof r.error.code) && (o = new I(r.error.code, r.error.message))), \n i ? new t(e, r.state, o) : (N(\"SharedClientState\", \"Failed to parse target state for ID '\" + e + \"': \" + n), \n null);\n }, t.prototype.ci = function() {\n var t = {\n state: this.state,\n updateTimeMs: Date.now()\n };\n return this.error && (t.error = {\n code: this.error.code,\n message: this.error.message\n }), JSON.stringify(t);\n }, t;\n}(), qr = /** @class */ function() {\n function t(t, e) {\n this.clientId = t, this.activeTargetIds = e\n /**\n * Parses a RemoteClientState from the JSON representation in WebStorage.\n * Logs a warning and returns null if the format of the data is not valid.\n */;\n }\n return t.hi = function(e, n) {\n for (var r = JSON.parse(n), i = \"object\" == typeof r && r.activeTargetIds instanceof Array, o = St(), u = 0; i && u < r.activeTargetIds.length; ++u) i = nt(r.activeTargetIds[u]), \n o = o.add(r.activeTargetIds[u]);\n return i ? new t(e, o) : (N(\"SharedClientState\", \"Failed to parse client data for instance '\" + e + \"': \" + n), \n null);\n }, t;\n}(), Fr = /** @class */ function() {\n function t(t, e) {\n this.clientId = t, this.onlineState = e\n /**\n * Parses a SharedOnlineState from its JSON representation in WebStorage.\n * Logs a warning and returns null if the format of the data is not valid.\n */;\n }\n return t.hi = function(e) {\n var n = JSON.parse(e);\n return \"object\" == typeof n && -1 !== [ \"Unknown\", \"Online\", \"Offline\" ].indexOf(n.onlineState) && \"string\" == typeof n.clientId ? new t(n.clientId, n.onlineState) : (N(\"SharedClientState\", \"Failed to parse online state: \" + e), \n null);\n }, t;\n}(), jr = /** @class */ function() {\n function t() {\n this.activeTargetIds = St();\n }\n return t.prototype.ui = function(t) {\n this.activeTargetIds = this.activeTargetIds.add(t);\n }, t.prototype.li = function(t) {\n this.activeTargetIds = this.activeTargetIds.delete(t);\n }, \n /**\n * Converts this entry into a JSON-encoded format we can use for WebStorage.\n * Does not encode `clientId` as it is part of the key in WebStorage.\n */\n t.prototype.ci = function() {\n var t = {\n activeTargetIds: this.activeTargetIds.L(),\n updateTimeMs: Date.now()\n };\n return JSON.stringify(t);\n }, t;\n}(), Gr = /** @class */ function() {\n function t(t, e, n, r, i) {\n this.window = t, this.fn = e, this.persistenceKey = n, this._i = r, this.fi = null, \n this.di = null, this.si = null, this.wi = this.Ei.bind(this), this.Ti = new dt(L), \n this.Ii = !1, \n /**\n * Captures WebStorage events that occur before `start()` is called. These\n * events are replayed once `WebStorageSharedClientState` is started.\n */\n this.mi = [];\n // Escape the special characters mentioned here:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\n var o = n.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n this.storage = this.window.localStorage, this.currentUser = i, this.Ai = Vr(this.persistenceKey, this._i), \n this.Ri = \n /** Assembles the key for the current sequence number. */\n function(t) {\n return \"firestore_sequence_number_\" + t;\n }(this.persistenceKey), this.Ti = this.Ti.ot(this._i, new jr), this.Pi = new RegExp(\"^firestore_clients_\" + o + \"_([^_]*)$\"), \n this.gi = new RegExp(\"^firestore_mutations_\" + o + \"_(\\\\d+)(?:_(.*))?$\"), this.Vi = new RegExp(\"^firestore_targets_\" + o + \"_(\\\\d+)$\"), \n this.yi = \n /** Assembles the key for the online state of the primary tab. */\n function(t) {\n return \"firestore_online_state_\" + t;\n }(this.persistenceKey), \n // Rather than adding the storage observer during start(), we add the\n // storage observer during initialization. This ensures that we collect\n // events before other components populate their initial state (during their\n // respective start() calls). Otherwise, we might for example miss a\n // mutation that is added after LocalStore's start() processed the existing\n // mutations but before we observe WebStorage events.\n this.window.addEventListener(\"storage\", this.wi);\n }\n /** Returns 'true' if WebStorage is available in the current environment. */ return t.Ln = function(t) {\n return !(!t || !t.localStorage);\n }, t.prototype.start = function() {\n return e(this, void 0, void 0, (function() {\n var t, e, r, i, o, u, s, a, c, h, f, l = this;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return [ 4 /*yield*/ , this.fi.pi() ];\n\n case 1:\n for (t = n.sent(), e = 0, r = t; e < r.length; e++) (i = r[e]) !== this._i && (o = this.getItem(Vr(this.persistenceKey, i))) && (u = qr.hi(i, o)) && (this.Ti = this.Ti.ot(u.clientId, u));\n for (this.bi(), (s = this.storage.getItem(this.yi)) && (a = this.vi(s)) && this.Si(a), \n c = 0, h = this.mi; c < h.length; c++) f = h[c], this.Ei(f);\n return this.mi = [], \n // Register a window unload hook to remove the client metadata entry from\n // WebStorage even if `shutdown()` was not called.\n this.window.addEventListener(\"unload\", (function() {\n return l.Di();\n })), this.Ii = !0, [ 2 /*return*/ ];\n }\n }));\n }));\n }, t.prototype.oi = function(t) {\n this.setItem(this.Ri, JSON.stringify(t));\n }, t.prototype.Ci = function() {\n return this.Ni(this.Ti);\n }, t.prototype.xi = function(t) {\n var e = !1;\n return this.Ti.forEach((function(n, r) {\n r.activeTargetIds.has(t) && (e = !0);\n })), e;\n }, t.prototype.Fi = function(t) {\n this.ki(t, \"pending\");\n }, t.prototype.Oi = function(t, e, n) {\n this.ki(t, e, n), \n // Once a final mutation result is observed by other clients, they no longer\n // access the mutation's metadata entry. Since WebStorage replays events\n // in order, it is safe to delete the entry right after updating it.\n this.Mi(t);\n }, t.prototype.$i = function(t) {\n var e = \"not-current\";\n // Lookup an existing query state if the target ID was already registered\n // by another tab\n if (this.xi(t)) {\n var n = this.storage.getItem(Cr(this.persistenceKey, t));\n if (n) {\n var r = Mr.hi(t, n);\n r && (e = r.state);\n }\n }\n return this.Li.ui(t), this.bi(), e;\n }, t.prototype.Bi = function(t) {\n this.Li.li(t), this.bi();\n }, t.prototype.qi = function(t) {\n return this.Li.activeTargetIds.has(t);\n }, t.prototype.Ui = function(t) {\n this.removeItem(Cr(this.persistenceKey, t));\n }, t.prototype.Ki = function(t, e, n) {\n this.Qi(t, e, n);\n }, t.prototype.Wi = function(t, e, n) {\n var r = this;\n e.forEach((function(t) {\n r.Mi(t);\n })), this.currentUser = t, n.forEach((function(t) {\n r.Fi(t);\n }));\n }, t.prototype.ji = function(t) {\n this.Gi(t);\n }, t.prototype.Di = function() {\n this.Ii && (this.window.removeEventListener(\"storage\", this.wi), this.removeItem(this.Ai), \n this.Ii = !1);\n }, t.prototype.getItem = function(t) {\n var e = this.storage.getItem(t);\n return T(\"SharedClientState\", \"READ\", t, e), e;\n }, t.prototype.setItem = function(t, e) {\n T(\"SharedClientState\", \"SET\", t, e), this.storage.setItem(t, e);\n }, t.prototype.removeItem = function(t) {\n T(\"SharedClientState\", \"REMOVE\", t), this.storage.removeItem(t);\n }, t.prototype.Ei = function(t) {\n var r = this, i = t;\n // Note: The function is typed to take Event to be interface-compatible with\n // `Window.addEventListener`.\n if (i.storageArea === this.storage) {\n if (T(\"SharedClientState\", \"EVENT\", i.key, i.newValue), i.key === this.Ai) return void N(\"Received WebStorage notification for local change. Another client might have garbage-collected our state\");\n this.fn.Cs((function() {\n return e(r, void 0, void 0, (function() {\n var t, e, r, o, u, s;\n return n(this, (function(n) {\n if (this.Ii) {\n if (null !== i.key) if (this.Pi.test(i.key)) {\n if (null == i.newValue) return t = this.zi(i.key), [ 2 /*return*/ , this.Hi(t, null) ];\n if (e = this.Ji(i.key, i.newValue)) return [ 2 /*return*/ , this.Hi(e.clientId, e) ];\n } else if (this.gi.test(i.key)) {\n if (null !== i.newValue && (r = this.Yi(i.key, i.newValue))) return [ 2 /*return*/ , this.Xi(r) ];\n } else if (this.Vi.test(i.key)) {\n if (null !== i.newValue && (o = this.Zi(i.key, i.newValue))) return [ 2 /*return*/ , this.tr(o) ];\n } else if (i.key === this.yi) {\n if (null !== i.newValue && (u = this.vi(i.newValue))) return [ 2 /*return*/ , this.Si(u) ];\n } else i.key === this.Ri && (s = function(t) {\n var e = Lr.ai;\n if (null != t) try {\n var n = JSON.parse(t);\n x(\"number\" == typeof n), e = n;\n } catch (t) {\n N(\"SharedClientState\", \"Failed to read sequence number from WebStorage\", t);\n }\n return e;\n }(i.newValue)) !== Lr.ai && this.si(s);\n } else this.mi.push(i);\n return [ 2 /*return*/ ];\n }));\n }));\n }));\n }\n }, Object.defineProperty(t.prototype, \"Li\", {\n get: function() {\n return this.Ti.get(this._i);\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.bi = function() {\n this.setItem(this.Ai, this.Li.ci());\n }, t.prototype.ki = function(t, e, n) {\n var r = new Ur(this.currentUser, t, e, n), i = Rr(this.persistenceKey, this.currentUser, t);\n this.setItem(i, r.ci());\n }, t.prototype.Mi = function(t) {\n var e = Rr(this.persistenceKey, this.currentUser, t);\n this.removeItem(e);\n }, t.prototype.Gi = function(t) {\n var e = {\n clientId: this._i,\n onlineState: t\n };\n this.storage.setItem(this.yi, JSON.stringify(e));\n }, t.prototype.Qi = function(t, e, n) {\n var r = Cr(this.persistenceKey, t), i = new Mr(t, e, n);\n this.setItem(r, i.ci());\n }, \n /**\n * Parses a client state key in WebStorage. Returns null if the key does not\n * match the expected key format.\n */\n t.prototype.zi = function(t) {\n var e = this.Pi.exec(t);\n return e ? e[1] : null;\n }, \n /**\n * Parses a client state in WebStorage. Returns 'null' if the value could not\n * be parsed.\n */\n t.prototype.Ji = function(t, e) {\n var n = this.zi(t);\n return qr.hi(n, e);\n }, \n /**\n * Parses a mutation batch state in WebStorage. Returns 'null' if the value\n * could not be parsed.\n */\n t.prototype.Yi = function(t, e) {\n var n = this.gi.exec(t), r = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;\n return Ur.hi(new Or(i), r, e);\n }, \n /**\n * Parses a query target state from WebStorage. Returns 'null' if the value\n * could not be parsed.\n */\n t.prototype.Zi = function(t, e) {\n var n = this.Vi.exec(t), r = Number(n[1]);\n return Mr.hi(r, e);\n }, \n /**\n * Parses an online state from WebStorage. Returns 'null' if the value\n * could not be parsed.\n */\n t.prototype.vi = function(t) {\n return Fr.hi(t);\n }, t.prototype.Xi = function(t) {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(e) {\n return t.user.uid === this.currentUser.uid ? [ 2 /*return*/ , this.fi.er(t.batchId, t.state, t.error) ] : (T(\"SharedClientState\", \"Ignoring mutation for non-active user \" + t.user.uid), \n [ 2 /*return*/ ]);\n }));\n }));\n }, t.prototype.tr = function(t) {\n return this.fi.nr(t.targetId, t.state, t.error);\n }, t.prototype.Hi = function(t, e) {\n var n = this, r = e ? this.Ti.ot(t, e) : this.Ti.remove(t), i = this.Ni(this.Ti), o = this.Ni(r), u = [], s = [];\n return o.forEach((function(t) {\n i.has(t) || u.push(t);\n })), i.forEach((function(t) {\n o.has(t) || s.push(t);\n })), this.fi.sr(u, s).then((function() {\n n.Ti = r;\n }));\n }, t.prototype.Si = function(t) {\n // We check whether the client that wrote this online state is still active\n // by comparing its client ID to the list of clients kept active in\n // IndexedDb. If a client does not update their IndexedDb client state\n // within 5 seconds, it is considered inactive and we don't emit an online\n // state event.\n this.Ti.get(t.clientId) && this.di(t.onlineState);\n }, t.prototype.Ni = function(t) {\n var e = St();\n return t.forEach((function(t, n) {\n e = e.Ot(n.activeTargetIds);\n })), e;\n }, t;\n}(), Br = /** @class */ function() {\n function t() {\n this.ir = new jr, this.rr = {}, this.di = null, this.si = null;\n }\n return t.prototype.Fi = function(t) {\n // No op.\n }, t.prototype.Oi = function(t, e, n) {\n // No op.\n }, t.prototype.$i = function(t) {\n return this.ir.ui(t), this.rr[t] || \"not-current\";\n }, t.prototype.Ki = function(t, e, n) {\n this.rr[t] = e;\n }, t.prototype.Bi = function(t) {\n this.ir.li(t);\n }, t.prototype.qi = function(t) {\n return this.ir.activeTargetIds.has(t);\n }, t.prototype.Ui = function(t) {\n delete this.rr[t];\n }, t.prototype.Ci = function() {\n return this.ir.activeTargetIds;\n }, t.prototype.xi = function(t) {\n return this.ir.activeTargetIds.has(t);\n }, t.prototype.start = function() {\n return this.ir = new jr, Promise.resolve();\n }, t.prototype.Wi = function(t, e, n) {\n // No op.\n }, t.prototype.ji = function(t) {\n // No op.\n }, t.prototype.Di = function() {}, t.prototype.oi = function(t) {}, t;\n}(), zr = /** @class */ function() {\n /**\n * @param batchId The unique ID of this mutation batch.\n * @param localWriteTime The original write time of this mutation.\n * @param baseMutations Mutations that are used to populate the base\n * values when this mutation is applied locally. This can be used to locally\n * overwrite values that are persisted in the remote document cache. Base\n * mutations are never sent to the backend.\n * @param mutations The user-provided mutations in this mutation batch.\n * User-provided mutations are applied both locally and remotely on the\n * backend.\n */\n function t(t, e, n, r) {\n this.batchId = t, this.ar = e, this.baseMutations = n, this.mutations = r\n /**\n * Applies all the mutations in this MutationBatch to the specified document\n * to create a new remote document\n *\n * @param docKey The key of the document to apply mutations to.\n * @param maybeDoc The document to apply mutations to.\n * @param batchResult The result of applying the MutationBatch to the\n * backend.\n */;\n }\n return t.prototype.hr = function(t, e, n) {\n for (var r = n.cr, i = 0; i < this.mutations.length; i++) {\n var o = this.mutations[i];\n o.key.isEqual(t) && (e = sn(o, e, r[i]));\n }\n return e;\n }, \n /**\n * Computes the local view of a document given all the mutations in this\n * batch.\n *\n * @param docKey The key of the document to apply mutations to.\n * @param maybeDoc The document to apply mutations to.\n */\n t.prototype.ur = function(t, e) {\n // First, apply the base state. This allows us to apply non-idempotent\n // transform against a consistent set of values.\n for (var n = 0, r = this.baseMutations; n < r.length; n++) {\n var i = r[n];\n i.key.isEqual(t) && (e = an(i, e, e, this.ar));\n }\n // Second, apply all user-provided mutations.\n for (var o = e, u = 0, s = this.mutations; u < s.length; u++) {\n var a = s[u];\n a.key.isEqual(t) && (e = an(a, e, o, this.ar));\n }\n return e;\n }, \n /**\n * Computes the local view for all provided documents given the mutations in\n * this batch.\n */\n t.prototype.lr = function(t) {\n var e = this, n = t;\n // TODO(mrschmidt): This implementation is O(n^2). If we apply the mutations\n // directly (as done in `applyToLocalView()`), we can reduce the complexity\n // to O(n).\n return this.mutations.forEach((function(r) {\n var i = e.ur(r.key, t.get(r.key));\n i && (n = n.ot(r.key, i));\n })), n;\n }, t.prototype.keys = function() {\n return this.mutations.reduce((function(t, e) {\n return t.add(e.key);\n }), At());\n }, t.prototype.isEqual = function(t) {\n return this.batchId === t.batchId && V(this.mutations, t.mutations, (function(t, e) {\n return hn(t, e);\n })) && V(this.baseMutations, t.baseMutations, (function(t, e) {\n return hn(t, e);\n }));\n }, t;\n}(), Kr = /** @class */ function() {\n function t(t, e, n, \n /**\n * A pre-computed mapping from each mutated document to the resulting\n * version.\n */\n r) {\n this.batch = t, this._r = e, this.cr = n, this.dr = r\n /**\n * Creates a new MutationBatchResult for the given batch and results. There\n * must be one result for each mutation in the batch. This static factory\n * caches a document=>version mapping (docVersions).\n */;\n }\n return t.from = function(e, n, r) {\n x(e.mutations.length === r.length);\n for (var i = Tt, o = e.mutations, u = 0; u < o.length; u++) i = i.ot(o[u].key, r[u].version);\n return new t(e, n, r, i);\n }, t;\n}(), Wr = /** @class */ function() {\n function t() {\n // A mapping of document key to the new cache entry that should be written (or null if any\n // existing cache entry should be removed).\n this.wr = new W((function(t) {\n return t.toString();\n }), (function(t, e) {\n return t.isEqual(e);\n })), this.Er = !1;\n }\n return Object.defineProperty(t.prototype, \"readTime\", {\n get: function() {\n return this.Tr;\n },\n set: function(t) {\n this.Tr = t;\n },\n enumerable: !1,\n configurable: !0\n }), \n /**\n * Buffers a `RemoteDocumentCache.addEntry()` call.\n *\n * You can only modify documents that have already been retrieved via\n * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\n */\n t.prototype.Ir = function(t, e) {\n this.mr(), this.readTime = e, this.wr.set(t.key, t);\n }, \n /**\n * Buffers a `RemoteDocumentCache.removeEntry()` call.\n *\n * You can only remove documents that have already been retrieved via\n * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\n */\n t.prototype.Ar = function(t, e) {\n this.mr(), e && (this.readTime = e), this.wr.set(t, null);\n }, \n /**\n * Looks up an entry in the cache. The buffered changes will first be checked,\n * and if no buffered change applies, this will forward to\n * `RemoteDocumentCache.getEntry()`.\n *\n * @param transaction The transaction in which to perform any persistence\n * operations.\n * @param documentKey The key of the entry to look up.\n * @return The cached Document or NoDocument entry, or null if we have nothing\n * cached.\n */\n t.prototype.Rr = function(t, e) {\n this.mr();\n var n = this.wr.get(e);\n return void 0 !== n ? cr.resolve(n) : this.Pr(t, e);\n }, \n /**\n * Looks up several entries in the cache, forwarding to\n * `RemoteDocumentCache.getEntry()`.\n *\n * @param transaction The transaction in which to perform any persistence\n * operations.\n * @param documentKeys The keys of the entries to look up.\n * @return A map of cached `Document`s or `NoDocument`s, indexed by key. If an\n * entry cannot be found, the corresponding key will be mapped to a null\n * value.\n */\n t.prototype.getEntries = function(t, e) {\n return this.gr(t, e);\n }, \n /**\n * Applies buffered changes to the underlying RemoteDocumentCache, using\n * the provided transaction.\n */\n t.prototype.apply = function(t) {\n return this.mr(), this.Er = !0, this.Vr(t);\n }, \n /** Helper to assert this.changes is not null */ t.prototype.mr = function() {}, \n t;\n}(), Qr = \"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.\", Hr = /** @class */ function() {\n function t() {\n this.yr = [];\n }\n return t.prototype.pr = function(t) {\n this.yr.push(t);\n }, t.prototype.br = function() {\n this.yr.forEach((function(t) {\n return t();\n }));\n }, t;\n}(), Yr = /** @class */ function() {\n function t(t, e, n) {\n this.vr = t, this.Sr = e, this.Dr = n\n /**\n * Get the local view of the document identified by `key`.\n *\n * @return Local view of the document or null if we don't have any cached\n * state for it.\n */;\n }\n return t.prototype.Cr = function(t, e) {\n var n = this;\n return this.Sr.Nr(t, e).next((function(r) {\n return n.Fr(t, e, r);\n }));\n }, \n /** Internal version of `getDocument` that allows reusing batches. */ t.prototype.Fr = function(t, e, n) {\n return this.vr.Rr(t, e).next((function(t) {\n for (var r = 0, i = n; r < i.length; r++) {\n t = i[r].ur(e, t);\n }\n return t;\n }));\n }, \n // Returns the view of the given `docs` as they would appear after applying\n // all mutations in the given `batches`.\n t.prototype.kr = function(t, e, n) {\n var r = It();\n return e.forEach((function(t, e) {\n for (var i = 0, o = n; i < o.length; i++) {\n e = o[i].ur(t, e);\n }\n r = r.ot(t, e);\n })), r;\n }, \n /**\n * Gets the local view of the documents identified by `keys`.\n *\n * If we don't have cached state for a document in `keys`, a NoDocument will\n * be stored for that key in the resulting set.\n */\n t.prototype.Or = function(t, e) {\n var n = this;\n return this.vr.getEntries(t, e).next((function(e) {\n return n.Mr(t, e);\n }));\n }, \n /**\n * Similar to `getDocuments`, but creates the local view from the given\n * `baseDocs` without retrieving documents from the local store.\n */\n t.prototype.Mr = function(t, e) {\n var n = this;\n return this.Sr.$r(t, e).next((function(r) {\n var i = n.kr(t, e, r), o = bt();\n return i.forEach((function(t, e) {\n // TODO(http://b/32275378): Don't conflate missing / deleted.\n e || (e = new Nn(t, H.min())), o = o.ot(t, e);\n })), o;\n }));\n }, \n /**\n * Performs a query against the local view of all documents.\n *\n * @param transaction The persistence transaction.\n * @param query The query to match documents against.\n * @param sinceReadTime If not set to SnapshotVersion.min(), return only\n * documents that have been read since this snapshot version (exclusive).\n */\n t.prototype.Lr = function(t, e, n) {\n /**\n * Returns whether the query matches a single document by path (rather than a\n * collection).\n */\n return function(t) {\n return Z.X(t.path) && null === t.collectionGroup && 0 === t.filters.length;\n }(e) ? this.Br(t, e.path) : Vn(e) ? this.qr(t, e, n) : this.Ur(t, e, n);\n }, t.prototype.Br = function(t, e) {\n // Just do a simple document lookup.\n return this.Cr(t, new Z(e)).next((function(t) {\n var e = _t();\n return t instanceof Tn && (e = e.ot(t.key, t)), e;\n }));\n }, t.prototype.qr = function(t, e, n) {\n var r = this, i = e.collectionGroup, o = _t();\n return this.Dr.Kr(t, i).next((function(u) {\n return cr.forEach(u, (function(u) {\n var s = function(t, e) {\n return new Dn(e, \n /*collectionGroup=*/ null, t.on.slice(), t.filters.slice(), t.limit, t.an, t.startAt, t.endAt);\n }(e, u.child(i));\n return r.Ur(t, s, n).next((function(t) {\n t.forEach((function(t, e) {\n o = o.ot(t, e);\n }));\n }));\n })).next((function() {\n return o;\n }));\n }));\n }, t.prototype.Ur = function(t, e, n) {\n var r, i, o = this;\n // Query the remote documents and overlay mutations.\n return this.vr.Lr(t, e, n).next((function(n) {\n return r = n, o.Sr.Qr(t, e);\n })).next((function(e) {\n return i = e, o.Wr(t, i, r).next((function(t) {\n r = t;\n for (var e = 0, n = i; e < n.length; e++) for (var o = n[e], u = 0, s = o.mutations; u < s.length; u++) {\n var a = s[u], c = a.key, h = r.get(c), f = an(a, h, h, o.ar);\n r = f instanceof Tn ? r.ot(c, f) : r.remove(c);\n }\n }));\n })).next((function() {\n // Finally, filter out any documents that don't actually match\n // the query.\n return r.forEach((function(t, n) {\n Bn(e, n) || (r = r.remove(t));\n })), r;\n }));\n }, t.prototype.Wr = function(t, e, n) {\n for (var r = At(), i = 0, o = e; i < o.length; i++) for (var u = 0, s = o[i].mutations; u < s.length; u++) {\n var a = s[u];\n a instanceof pn && null === n.get(a.key) && (r = r.add(a.key));\n }\n var c = n;\n return this.vr.getEntries(t, r).next((function(t) {\n return t.forEach((function(t, e) {\n null !== e && e instanceof Tn && (c = c.ot(t, e));\n })), c;\n }));\n }, t;\n}(), Xr = /** @class */ function() {\n function t(t, e, n, r) {\n this.targetId = t, this.fromCache = e, this.jr = n, this.Gr = r;\n }\n return t.zr = function(e, n) {\n for (var r = At(), i = At(), o = 0, u = n.docChanges; o < u.length; o++) {\n var s = u[o];\n switch (s.type) {\n case 0 /* Added */ :\n r = r.add(s.doc.key);\n break;\n\n case 1 /* Removed */ :\n i = i.add(s.doc.key);\n // do nothing\n }\n }\n return new t(e, n.fromCache, r, i);\n }, t;\n}();\n\n/**\n * Holds the state of a query target, including its target ID and whether the\n * target is 'not-current', 'current' or 'rejected'.\n */\n// Visible for testing\n/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction Jr(t, e) {\n var n = t[0], r = t[1], i = e[0], o = e[1], u = L(n, i);\n return 0 === u ? L(r, o) : u;\n}\n\n/**\n * Used to calculate the nth sequence number. Keeps a rolling buffer of the\n * lowest n values passed to `addElement`, and finally reports the largest of\n * them in `maxValue`.\n */ var $r = /** @class */ function() {\n function t(t) {\n this.Hr = t, this.buffer = new mt(Jr), this.Jr = 0;\n }\n return t.prototype.Yr = function() {\n return ++this.Jr;\n }, t.prototype.Xr = function(t) {\n var e = [ t, this.Yr() ];\n if (this.buffer.size < this.Hr) this.buffer = this.buffer.add(e); else {\n var n = this.buffer.last();\n Jr(e, n) < 0 && (this.buffer = this.buffer.delete(n).add(e));\n }\n }, Object.defineProperty(t.prototype, \"maxValue\", {\n get: function() {\n // Guaranteed to be non-empty. If we decide we are not collecting any\n // sequence numbers, nthSequenceNumber below short-circuits. If we have\n // decided that we are collecting n sequence numbers, it's because n is some\n // percentage of the existing sequence numbers. That means we should never\n // be in a situation where we are collecting sequence numbers but don't\n // actually have any.\n return this.buffer.last()[0];\n },\n enumerable: !1,\n configurable: !0\n }), t;\n}(), Zr = {\n Zr: !1,\n eo: 0,\n no: 0,\n so: 0\n}, ti = /** @class */ function() {\n function t(\n // When we attempt to collect, we will only do so if the cache size is greater than this\n // threshold. Passing `COLLECTION_DISABLED` here will cause collection to always be skipped.\n t, \n // The percentage of sequence numbers that we will attempt to collect\n e, \n // A cap on the total number of sequence numbers that will be collected. This prevents\n // us from collecting a huge number of sequence numbers if the cache has grown very large.\n n) {\n this.io = t, this.ro = e, this.oo = n;\n }\n return t.ao = function(e) {\n return new t(e, t.ho, t.co);\n }, t;\n}();\n\nti.uo = -1, ti.lo = 1048576, ti._o = 41943040, ti.ho = 10, ti.co = 1e3, ti.fo = new ti(ti._o, ti.ho, ti.co), \nti.do = new ti(ti.uo, 0, 0);\n\n/**\n * This class is responsible for the scheduling of LRU garbage collection. It handles checking\n * whether or not GC is enabled, as well as which delay to use before the next run.\n */\nvar ei = /** @class */ function() {\n function t(t, e) {\n this.wo = t, this.hs = e, this.Eo = !1, this.To = null;\n }\n return t.prototype.start = function(t) {\n this.wo.params.io !== ti.uo && this.Io(t);\n }, t.prototype.stop = function() {\n this.To && (this.To.cancel(), this.To = null);\n }, Object.defineProperty(t.prototype, \"Ii\", {\n get: function() {\n return null !== this.To;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.Io = function(t) {\n var r = this, i = this.Eo ? 3e5 : 6e4;\n T(\"LruGarbageCollector\", \"Garbage collection scheduled in \" + i + \"ms\"), this.To = this.hs.Vn(\"lru_garbage_collection\" /* LruGarbageCollection */ , i, (function() {\n return e(r, void 0, void 0, (function() {\n var e;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n this.To = null, this.Eo = !0, n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 3, , 7 ]), [ 4 /*yield*/ , t.mo(this.wo) ];\n\n case 2:\n return n.sent(), [ 3 /*break*/ , 7 ];\n\n case 3:\n return pr(e = n.sent()) ? (T(\"LruGarbageCollector\", \"Ignoring IndexedDB error during garbage collection: \", e), \n [ 3 /*break*/ , 6 ]) : [ 3 /*break*/ , 4 ];\n\n case 4:\n return [ 4 /*yield*/ , Io(e) ];\n\n case 5:\n n.sent(), n.label = 6;\n\n case 6:\n return [ 3 /*break*/ , 7 ];\n\n case 7:\n return [ 4 /*yield*/ , this.Io(t) ];\n\n case 8:\n return n.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }));\n }, t;\n}(), ni = /** @class */ function() {\n function t(t, e) {\n this.Ao = t, this.params = e\n /** Given a percentile of target to collect, returns the number of targets to collect. */;\n }\n return t.prototype.Ro = function(t, e) {\n return this.Ao.Po(t).next((function(t) {\n return Math.floor(e / 100 * t);\n }));\n }, \n /** Returns the nth sequence number, counting in order from the smallest. */ t.prototype.Vo = function(t, e) {\n var n = this;\n if (0 === e) return cr.resolve(Lr.ai);\n var r = new $r(e);\n return this.Ao.Ce(t, (function(t) {\n return r.Xr(t.sequenceNumber);\n })).next((function() {\n return n.Ao.yo(t, (function(t) {\n return r.Xr(t);\n }));\n })).next((function() {\n return r.maxValue;\n }));\n }, \n /**\n * Removes targets with a sequence number equal to or less than the given upper bound, and removes\n * document associations with those targets.\n */\n t.prototype.po = function(t, e, n) {\n return this.Ao.po(t, e, n);\n }, \n /**\n * Removes documents that have a sequence number equal to or less than the upper bound and are not\n * otherwise pinned.\n */\n t.prototype.bo = function(t, e) {\n return this.Ao.bo(t, e);\n }, t.prototype.vo = function(t, e) {\n var n = this;\n return this.params.io === ti.uo ? (T(\"LruGarbageCollector\", \"Garbage collection skipped; disabled\"), \n cr.resolve(Zr)) : this.So(t).next((function(r) {\n return r < n.params.io ? (T(\"LruGarbageCollector\", \"Garbage collection skipped; Cache size \" + r + \" is lower than threshold \" + n.params.io), \n Zr) : n.Do(t, e);\n }));\n }, t.prototype.So = function(t) {\n return this.Ao.So(t);\n }, t.prototype.Do = function(t, e) {\n var n, r, i, o, s, a, c, h = this, f = Date.now();\n return this.Ro(t, this.params.ro).next((function(e) {\n // Cap at the configured max\n return e > h.params.oo ? (T(\"LruGarbageCollector\", \"Capping sequence numbers to collect down to the maximum of \" + h.params.oo + \" from \" + e), \n r = h.params.oo) : r = e, o = Date.now(), h.Vo(t, r);\n })).next((function(r) {\n return n = r, s = Date.now(), h.po(t, n, e);\n })).next((function(e) {\n return i = e, a = Date.now(), h.bo(t, n);\n })).next((function(t) {\n return c = Date.now(), _() <= u.DEBUG && T(\"LruGarbageCollector\", \"LRU Garbage Collection\\n\\tCounted targets in \" + (o - f) + \"ms\\n\\tDetermined least recently used \" + r + \" in \" + (s - o) + \"ms\\n\\tRemoved \" + i + \" targets in \" + (a - s) + \"ms\\n\\tRemoved \" + t + \" documents in \" + (c - a) + \"ms\\nTotal Duration: \" + (c - f) + \"ms\"), \n cr.resolve({\n Zr: !0,\n eo: r,\n no: i,\n so: t\n });\n }));\n }, t;\n}();\n\n/** Implements the steps for LRU garbage collection. */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Encodes a resource path into a IndexedDb-compatible string form.\n */\nfunction ri(t) {\n for (var e = \"\", n = 0; n < t.length; n++) e.length > 0 && (e = oi(e)), e = ii(t.get(n), e);\n return oi(e);\n}\n\n/** Encodes a single segment of a resource path into the given result */ function ii(t, e) {\n for (var n = e, r = t.length, i = 0; i < r; i++) {\n var o = t.charAt(i);\n switch (o) {\n case \"\\0\":\n n += \"\u0001\u0010\";\n break;\n\n case \"\u0001\":\n n += \"\u0001\u0011\";\n break;\n\n default:\n n += o;\n }\n }\n return n;\n}\n\n/** Encodes a path separator into the given result */ function oi(t) {\n return t + \"\u0001\u0001\";\n}\n\n/**\n * Decodes the given IndexedDb-compatible string form of a resource path into\n * a ResourcePath instance. Note that this method is not suitable for use with\n * decoding resource names from the server; those are One Platform format\n * strings.\n */ function ui(t) {\n // Event the empty path must encode as a path of at least length 2. A path\n // with exactly 2 must be the empty path.\n var e = t.length;\n if (x(e >= 2), 2 === e) return x(\"\u0001\" === t.charAt(0) && \"\u0001\" === t.charAt(1)), X.U();\n // Escape characters cannot exist past the second-to-last position in the\n // source value.\n for (var n = e - 2, r = [], i = \"\", o = 0; o < e; ) {\n // The last two characters of a valid encoded path must be a separator, so\n // there must be an end to this segment.\n var u = t.indexOf(\"\u0001\", o);\n switch ((u < 0 || u > n) && S(), t.charAt(u + 1)) {\n case \"\u0001\":\n var s = t.substring(o, u), a = void 0;\n 0 === i.length ? \n // Avoid copying for the common case of a segment that excludes \\0\n // and \\001\n a = s : (a = i += s, i = \"\"), r.push(a);\n break;\n\n case \"\u0010\":\n i += t.substring(o, u), i += \"\\0\";\n break;\n\n case \"\u0011\":\n // The escape character can be used in the output to encode itself.\n i += t.substring(o, u + 1);\n break;\n\n default:\n S();\n }\n o = u + 2;\n }\n return new X(r);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Serializer for values stored in the LocalStore. */ var si = function(t) {\n this.Co = t;\n};\n\n/** Decodes a remote document from storage locally to a Document. */ function ai(t, e) {\n if (e.document) return function(t, e, n) {\n var r = be(t, e.name), i = ye(e.updateTime), o = new bn({\n mapValue: {\n fields: e.fields\n }\n });\n return new Tn(r, i, o, {\n hasCommittedMutations: !!n\n });\n }(t.Co, e.document, !!e.hasCommittedMutations);\n if (e.noDocument) {\n var n = Z.Z(e.noDocument.path), r = pi(e.noDocument.readTime);\n return new Nn(n, r, {\n hasCommittedMutations: !!e.hasCommittedMutations\n });\n }\n if (e.unknownDocument) {\n var i = Z.Z(e.unknownDocument.path), o = pi(e.unknownDocument.version);\n return new An(i, o);\n }\n return S();\n}\n\n/** Encodes a document for storage locally. */ function ci(t, e, n) {\n var r = hi(n), i = e.key.path.F().L();\n if (e instanceof Tn) {\n var o = function(t, e) {\n return {\n name: we(t, e.key),\n fields: e.rn().mapValue.fields,\n updateTime: pe(t, e.version.v())\n };\n }(t.Co, e), u = e.hasCommittedMutations;\n return new qi(\n /* unknownDocument= */ null, \n /* noDocument= */ null, o, u, r, i);\n }\n if (e instanceof Nn) {\n var s = e.key.path.L(), a = li(e.version), c = e.hasCommittedMutations;\n return new qi(\n /* unknownDocument= */ null, new Ui(s, a), \n /* document= */ null, c, r, i);\n }\n if (e instanceof An) {\n var h = e.key.path.L(), f = li(e.version);\n return new qi(new Mi(h, f), \n /* noDocument= */ null, \n /* document= */ null, \n /* hasCommittedMutations= */ !0, r, i);\n }\n return S();\n}\n\nfunction hi(t) {\n var e = t.v();\n return [ e.seconds, e.nanoseconds ];\n}\n\nfunction fi(t) {\n var e = new Q(t[0], t[1]);\n return H.V(e);\n}\n\nfunction li(t) {\n var e = t.v();\n return new Oi(e.seconds, e.nanoseconds);\n}\n\nfunction pi(t) {\n var e = new Q(t.seconds, t.nanoseconds);\n return H.V(e);\n}\n\n/** Encodes a batch of mutations into a DbMutationBatch for local storage. */\n/** Decodes a DbMutationBatch into a MutationBatch */ function di(t, e) {\n var n = (e.baseMutations || []).map((function(e) {\n return De(t.Co, e);\n })), r = e.mutations.map((function(e) {\n return De(t.Co, e);\n })), i = Q.fromMillis(e.localWriteTimeMs);\n return new zr(e.batchId, i, n, r);\n}\n\n/** Decodes a DbTarget into TargetData */ function vi(t) {\n var e, n, r = pi(t.readTime), i = void 0 !== t.lastLimboFreeSnapshotVersion ? pi(t.lastLimboFreeSnapshotVersion) : H.min();\n return void 0 !== t.query.documents ? (x(1 === (n = t.query).documents.length), \n e = Cn(xn(Ee(n.documents[0])))) : e = ke(t.query), new ht(e, t.targetId, 0 /* Listen */ , t.lastListenSequenceNumber, r, i, C.fromBase64String(t.resumeToken))\n /** Encodes TargetData into a DbTarget for storage locally. */;\n}\n\nfunction yi(t, e) {\n var n, r = li(e.nt), i = li(e.lastLimboFreeSnapshotVersion);\n n = st(e.target) ? Se(t.Co, e.target) : xe(t.Co, e.target);\n // We can't store the resumeToken as a ByteString in IndexedDb, so we\n // convert it to a base64 string for storage.\n var o = e.resumeToken.toBase64();\n // lastListenSequenceNumber is always 0 until we do real GC.\n return new ji(e.targetId, ot(e.target), r, o, e.sequenceNumber, i, n);\n}\n\n/**\n * A helper function for figuring out what kind of query has been stored.\n */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** A mutation queue for a specific user, backed by IndexedDB. */ var mi = /** @class */ function() {\n function t(\n /**\n * The normalized userId (e.g. null UID => \"\" userId) used to store /\n * retrieve mutations.\n */\n t, e, n, r) {\n this.userId = t, this.serializer = e, this.Dr = n, this.No = r, \n /**\n * Caches the document keys for pending mutation batches. If the mutation\n * has been removed from IndexedDb, the cached value may continue to\n * be used to retrieve the batch's document keys. To remove a cached value\n * locally, `removeCachedMutationKeys()` should be invoked either directly\n * or through `removeMutationBatches()`.\n *\n * With multi-tab, when the primary client acknowledges or rejects a mutation,\n * this cache is used by secondary clients to invalidate the local\n * view of the documents that were previously affected by the mutation.\n */\n // PORTING NOTE: Multi-tab only.\n this.xo = {}\n /**\n * Creates a new mutation queue for the given user.\n * @param user The user for which to create a mutation queue.\n * @param serializer The serializer to use when persisting to IndexedDb.\n */;\n }\n return t.Fo = function(e, n, r, i) {\n // TODO(mcg): Figure out what constraints there are on userIDs\n // In particular, are there any reserved characters? are empty ids allowed?\n // For the moment store these together in the same mutations table assuming\n // that empty userIDs aren't allowed.\n return x(\"\" !== e.uid), new t(e.Zs() ? e.uid : \"\", n, r, i);\n }, t.prototype.ko = function(t) {\n var e = !0, n = IDBKeyRange.bound([ this.userId, Number.NEGATIVE_INFINITY ], [ this.userId, Number.POSITIVE_INFINITY ]);\n return bi(t).rs({\n index: Ri.userMutationsIndex,\n range: n\n }, (function(t, n, r) {\n e = !1, r.done();\n })).next((function() {\n return e;\n }));\n }, t.prototype.Oo = function(t, e, n, r) {\n var i = this, o = Ii(t), u = bi(t);\n // The IndexedDb implementation in Chrome (and Firefox) does not handle\n // compound indices that include auto-generated keys correctly. To ensure\n // that the index entry is added correctly in all browsers, we perform two\n // writes: The first write is used to retrieve the next auto-generated Batch\n // ID, and the second write populates the index and stores the actual\n // mutation batch.\n // See: https://bugs.chromium.org/p/chromium/issues/detail?id=701972\n // We write an empty object to obtain key\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return u.add({}).next((function(s) {\n x(\"number\" == typeof s);\n for (var a = new zr(s, e, n, r), c = function(t, e, n) {\n var r = n.baseMutations.map((function(e) {\n return Ae(t.Co, e);\n })), i = n.mutations.map((function(e) {\n return Ae(t.Co, e);\n }));\n return new Ri(e, n.batchId, n.ar.toMillis(), r, i);\n }(i.serializer, i.userId, a), h = [], f = new mt((function(t, e) {\n return L(t.B(), e.B());\n })), l = 0, p = r; l < p.length; l++) {\n var d = p[l], v = Ci.key(i.userId, d.key.path, s);\n f = f.add(d.key.path.F()), h.push(u.put(c)), h.push(o.put(v, Ci.PLACEHOLDER));\n }\n return f.forEach((function(e) {\n h.push(i.Dr.Mo(t, e));\n })), t.pr((function() {\n i.xo[s] = a.keys();\n })), cr.kn(h).next((function() {\n return a;\n }));\n }));\n }, t.prototype.$o = function(t, e) {\n var n = this;\n return bi(t).get(e).next((function(t) {\n return t ? (x(t.userId === n.userId), di(n.serializer, t)) : null;\n }));\n }, \n /**\n * Returns the document keys for the mutation batch with the given batchId.\n * For primary clients, this method returns `null` after\n * `removeMutationBatches()` has been called. Secondary clients return a\n * cached result until `removeCachedMutationKeys()` is invoked.\n */\n // PORTING NOTE: Multi-tab only.\n t.prototype.Lo = function(t, e) {\n var n = this;\n return this.xo[e] ? cr.resolve(this.xo[e]) : this.$o(t, e).next((function(t) {\n if (t) {\n var r = t.keys();\n return n.xo[e] = r, r;\n }\n return null;\n }));\n }, t.prototype.Bo = function(t, e) {\n var n = this, r = e + 1, i = IDBKeyRange.lowerBound([ this.userId, r ]), o = null;\n return bi(t).rs({\n index: Ri.userMutationsIndex,\n range: i\n }, (function(t, e, i) {\n e.userId === n.userId && (x(e.batchId >= r), o = di(n.serializer, e)), i.done();\n })).next((function() {\n return o;\n }));\n }, t.prototype.qo = function(t) {\n var e = IDBKeyRange.upperBound([ this.userId, Number.POSITIVE_INFINITY ]), n = -1;\n return bi(t).rs({\n index: Ri.userMutationsIndex,\n range: e,\n reverse: !0\n }, (function(t, e, r) {\n n = e.batchId, r.done();\n })).next((function() {\n return n;\n }));\n }, t.prototype.Uo = function(t) {\n var e = this, n = IDBKeyRange.bound([ this.userId, -1 ], [ this.userId, Number.POSITIVE_INFINITY ]);\n return bi(t).ts(Ri.userMutationsIndex, n).next((function(t) {\n return t.map((function(t) {\n return di(e.serializer, t);\n }));\n }));\n }, t.prototype.Nr = function(t, e) {\n var n = this, r = Ci.prefixForPath(this.userId, e.path), i = IDBKeyRange.lowerBound(r), o = [];\n // Scan the document-mutation index starting with a prefix starting with\n // the given documentKey.\n return Ii(t).rs({\n range: i\n }, (function(r, i, u) {\n var s = r[0], a = r[1], c = r[2], h = ui(a);\n // Only consider rows matching exactly the specific key of\n // interest. Note that because we order by path first, and we\n // order terminators before path separators, we'll encounter all\n // the index rows for documentKey contiguously. In particular, all\n // the rows for documentKey will occur before any rows for\n // documents nested in a subcollection beneath documentKey so we\n // can stop as soon as we hit any such row.\n if (s === n.userId && e.path.isEqual(h)) \n // Look up the mutation batch in the store.\n return bi(t).get(c).next((function(t) {\n if (!t) throw S();\n x(t.userId === n.userId), o.push(di(n.serializer, t));\n }));\n u.done();\n })).next((function() {\n return o;\n }));\n }, t.prototype.$r = function(t, e) {\n var n = this, r = new mt(L), i = [];\n return e.forEach((function(e) {\n var o = Ci.prefixForPath(n.userId, e.path), u = IDBKeyRange.lowerBound(o), s = Ii(t).rs({\n range: u\n }, (function(t, i, o) {\n var u = t[0], s = t[1], a = t[2], c = ui(s);\n // Only consider rows matching exactly the specific key of\n // interest. Note that because we order by path first, and we\n // order terminators before path separators, we'll encounter all\n // the index rows for documentKey contiguously. In particular, all\n // the rows for documentKey will occur before any rows for\n // documents nested in a subcollection beneath documentKey so we\n // can stop as soon as we hit any such row.\n u === n.userId && e.path.isEqual(c) ? r = r.add(a) : o.done();\n }));\n i.push(s);\n })), cr.kn(i).next((function() {\n return n.Ko(t, r);\n }));\n }, t.prototype.Qr = function(t, e) {\n var n = this, r = e.path, i = r.length + 1, o = Ci.prefixForPath(this.userId, r), u = IDBKeyRange.lowerBound(o), s = new mt(L);\n return Ii(t).rs({\n range: u\n }, (function(t, e, o) {\n var u = t[0], a = t[1], c = t[2], h = ui(a);\n u === n.userId && r.M(h) ? \n // Rows with document keys more than one segment longer than the\n // query path can't be matches. For example, a query on 'rooms'\n // can't match the document /rooms/abc/messages/xyx.\n // TODO(mcg): we'll need a different scanner when we implement\n // ancestor queries.\n h.length === i && (s = s.add(c)) : o.done();\n })).next((function() {\n return n.Ko(t, s);\n }));\n }, t.prototype.Ko = function(t, e) {\n var n = this, r = [], i = [];\n // TODO(rockwood): Implement this using iterate.\n return e.forEach((function(e) {\n i.push(bi(t).get(e).next((function(t) {\n if (null === t) throw S();\n x(t.userId === n.userId), r.push(di(n.serializer, t));\n })));\n })), cr.kn(i).next((function() {\n return r;\n }));\n }, t.prototype.Qo = function(t, e) {\n var n = this;\n return wi(t.Wo, this.userId, e).next((function(r) {\n return t.pr((function() {\n n.jo(e.batchId);\n })), cr.forEach(r, (function(e) {\n return n.No.Go(t, e);\n }));\n }));\n }, \n /**\n * Clears the cached keys for a mutation batch. This method should be\n * called by secondary clients after they process mutation updates.\n *\n * Note that this method does not have to be called from primary clients as\n * the corresponding cache entries are cleared when an acknowledged or\n * rejected batch is removed from the mutation queue.\n */\n // PORTING NOTE: Multi-tab only\n t.prototype.jo = function(t) {\n delete this.xo[t];\n }, t.prototype.zo = function(t) {\n var e = this;\n return this.ko(t).next((function(n) {\n if (!n) return cr.resolve();\n // Verify that there are no entries in the documentMutations index if\n // the queue is empty.\n var r = IDBKeyRange.lowerBound(Ci.prefixForUser(e.userId)), i = [];\n return Ii(t).rs({\n range: r\n }, (function(t, n, r) {\n if (t[0] === e.userId) {\n var o = ui(t[1]);\n i.push(o);\n } else r.done();\n })).next((function() {\n x(0 === i.length);\n }));\n }));\n }, t.prototype.Ho = function(t, e) {\n return gi(t, this.userId, e);\n }, \n // PORTING NOTE: Multi-tab only (state is held in memory in other clients).\n /** Returns the mutation queue's metadata from IndexedDb. */\n t.prototype.Jo = function(t) {\n var e = this;\n return Ei(t).get(this.userId).next((function(t) {\n return t || new Vi(e.userId, -1, \n /*lastStreamToken=*/ \"\");\n }));\n }, t;\n}();\n\n/**\n * @return true if the mutation queue for the given user contains a pending\n * mutation for the given key.\n */ function gi(t, e, n) {\n var r = Ci.prefixForPath(e, n.path), i = r[1], o = IDBKeyRange.lowerBound(r), u = !1;\n return Ii(t).rs({\n range: o,\n ss: !0\n }, (function(t, n, r) {\n var o = t[0], s = t[1];\n t[2];\n o === e && s === i && (u = !0), r.done();\n })).next((function() {\n return u;\n }));\n}\n\n/** Returns true if any mutation queue contains the given document. */\n/**\n * Delete a mutation batch and the associated document mutations.\n * @return A PersistencePromise of the document mutations that were removed.\n */ function wi(t, e, n) {\n var r = t.store(Ri.store), i = t.store(Ci.store), o = [], u = IDBKeyRange.only(n.batchId), s = 0, a = r.rs({\n range: u\n }, (function(t, e, n) {\n return s++, n.delete();\n }));\n o.push(a.next((function() {\n x(1 === s);\n })));\n for (var c = [], h = 0, f = n.mutations; h < f.length; h++) {\n var l = f[h], p = Ci.key(e, l.key.path, n.batchId);\n o.push(i.delete(p)), c.push(l.key);\n }\n return cr.kn(o).next((function() {\n return c;\n }));\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the mutations object store.\n */ function bi(t) {\n return ro.Kn(t, Ri.store);\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\n */ function Ii(t) {\n return ro.Kn(t, Ci.store);\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\n */ function Ei(t) {\n return ro.Kn(t, Vi.store);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * The RemoteDocumentCache for IndexedDb. To construct, invoke\n * `newIndexedDbRemoteDocumentCache()`.\n */ var _i = /** @class */ function() {\n /**\n * @param serializer The document serializer.\n * @param indexManager The query indexes that need to be maintained.\n */\n function t(t, e) {\n this.serializer = t, this.Dr = e\n /**\n * Adds the supplied entries to the cache.\n *\n * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\n * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\n */;\n }\n return t.prototype.Ir = function(t, e, n) {\n return Ai(t).put(Di(e), n);\n }, \n /**\n * Removes a document from the cache.\n *\n * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\n * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\n */\n t.prototype.Ar = function(t, e) {\n var n = Ai(t), r = Di(e);\n return n.delete(r);\n }, \n /**\n * Updates the current cache size.\n *\n * Callers to `addEntry()` and `removeEntry()` *must* call this afterwards to update the\n * cache's metadata.\n */\n t.prototype.updateMetadata = function(t, e) {\n var n = this;\n return this.getMetadata(t).next((function(r) {\n return r.byteSize += e, n.Yo(t, r);\n }));\n }, t.prototype.Rr = function(t, e) {\n var n = this;\n return Ai(t).get(Di(e)).next((function(t) {\n return n.Xo(t);\n }));\n }, \n /**\n * Looks up an entry in the cache.\n *\n * @param documentKey The key of the entry to look up.\n * @return The cached MaybeDocument entry and its size, or null if we have nothing cached.\n */\n t.prototype.Zo = function(t, e) {\n var n = this;\n return Ai(t).get(Di(e)).next((function(t) {\n var e = n.Xo(t);\n return e ? {\n ta: e,\n size: Si(t)\n } : null;\n }));\n }, t.prototype.getEntries = function(t, e) {\n var n = this, r = It();\n return this.ea(t, e, (function(t, e) {\n var i = n.Xo(e);\n r = r.ot(t, i);\n })).next((function() {\n return r;\n }));\n }, \n /**\n * Looks up several entries in the cache.\n *\n * @param documentKeys The set of keys entries to look up.\n * @return A map of MaybeDocuments indexed by key (if a document cannot be\n * found, the key will be mapped to null) and a map of sizes indexed by\n * key (zero if the key cannot be found).\n */\n t.prototype.na = function(t, e) {\n var n = this, r = It(), i = new dt(Z.D);\n return this.ea(t, e, (function(t, e) {\n var o = n.Xo(e);\n o ? (r = r.ot(t, o), i = i.ot(t, Si(e))) : (r = r.ot(t, null), i = i.ot(t, 0));\n })).next((function() {\n return {\n sa: r,\n ia: i\n };\n }));\n }, t.prototype.ea = function(t, e, n) {\n if (e.P()) return cr.resolve();\n var r = IDBKeyRange.bound(e.first().path.L(), e.last().path.L()), i = e._t(), o = i.It();\n return Ai(t).rs({\n range: r\n }, (function(t, e, r) {\n // Go through keys not found in cache.\n for (var u = Z.Z(t); o && Z.D(o, u) < 0; ) n(o, null), o = i.It();\n o && o.isEqual(u) && (\n // Key found in cache.\n n(o, e), o = i.At() ? i.It() : null), \n // Skip to the next key (if there is one).\n o ? r.Xn(o.path.L()) : r.done();\n })).next((function() {\n // The rest of the keys are not in the cache. One case where `iterate`\n // above won't go through them is when the cache is empty.\n for (;o; ) n(o, null), o = i.At() ? i.It() : null;\n }));\n }, t.prototype.Lr = function(t, e, n) {\n var r = this, i = _t(), o = e.path.length + 1, u = {};\n if (n.isEqual(H.min())) {\n // Documents are ordered by key, so we can use a prefix scan to narrow\n // down the documents we need to match the query against.\n var s = e.path.L();\n u.range = IDBKeyRange.lowerBound(s);\n } else {\n // Execute an index-free query and filter by read time. This is safe\n // since all document changes to queries that have a\n // lastLimboFreeSnapshotVersion (`sinceReadTime`) have a read time set.\n var a = e.path.L(), c = hi(n);\n u.range = IDBKeyRange.lowerBound([ a, c ], \n /* open= */ !0), u.index = qi.collectionReadTimeIndex;\n }\n return Ai(t).rs(u, (function(t, n, u) {\n // The query is actually returning any path that starts with the query\n // path prefix which may include documents in subcollections. For\n // example, a query on 'rooms' will return rooms/abc/messages/xyx but we\n // shouldn't match it. Fix this by discarding rows with document keys\n // more than one segment longer than the query path.\n if (t.length === o) {\n var s = ai(r.serializer, n);\n e.path.M(s.key.path) ? s instanceof Tn && Bn(e, s) && (i = i.ot(s.key, s)) : u.done();\n }\n })).next((function() {\n return i;\n }));\n }, t.prototype.ra = function(t) {\n return new Ti(this, !!t && t.oa);\n }, t.prototype.aa = function(t) {\n return this.getMetadata(t).next((function(t) {\n return t.byteSize;\n }));\n }, t.prototype.getMetadata = function(t) {\n return Ni(t).get(Fi.key).next((function(t) {\n return x(!!t), t;\n }));\n }, t.prototype.Yo = function(t, e) {\n return Ni(t).put(Fi.key, e);\n }, \n /**\n * Decodes `remoteDoc` and returns the document (or null, if the document\n * corresponds to the format used for sentinel deletes).\n */\n t.prototype.Xo = function(t) {\n if (t) {\n var e = ai(this.serializer, t);\n return e instanceof Nn && e.version.isEqual(H.min()) ? null : e;\n }\n return null;\n }, t;\n}(), Ti = /** @class */ function(e) {\n /**\n * @param documentCache The IndexedDbRemoteDocumentCache to apply the changes to.\n * @param trackRemovals Whether to create sentinel deletes that can be tracked by\n * `getNewDocumentChanges()`.\n */\n function n(t, n) {\n var r = this;\n return (r = e.call(this) || this).ha = t, r.oa = n, \n // A map of document sizes prior to applying the changes in this buffer.\n r.ca = new W((function(t) {\n return t.toString();\n }), (function(t, e) {\n return t.isEqual(e);\n })), r;\n }\n return t(n, e), n.prototype.Vr = function(t) {\n var e = this, n = [], r = 0, i = new mt((function(t, e) {\n return L(t.B(), e.B());\n }));\n return this.wr.forEach((function(o, u) {\n var s = e.ca.get(o);\n if (u) {\n var a = ci(e.ha.serializer, u, e.readTime);\n i = i.add(o.path.F());\n var c = Si(a);\n r += c - s, n.push(e.ha.Ir(t, o, a));\n } else if (r -= s, e.oa) {\n // In order to track removals, we store a \"sentinel delete\" in the\n // RemoteDocumentCache. This entry is represented by a NoDocument\n // with a version of 0 and ignored by `maybeDecodeDocument()` but\n // preserved in `getNewDocumentChanges()`.\n var h = ci(e.ha.serializer, new Nn(o, H.min()), e.readTime);\n n.push(e.ha.Ir(t, o, h));\n } else n.push(e.ha.Ar(t, o));\n })), i.forEach((function(r) {\n n.push(e.ha.Dr.Mo(t, r));\n })), n.push(this.ha.updateMetadata(t, r)), cr.kn(n);\n }, n.prototype.Pr = function(t, e) {\n var n = this;\n // Record the size of everything we load from the cache so we can compute a delta later.\n return this.ha.Zo(t, e).next((function(t) {\n return null === t ? (n.ca.set(e, 0), null) : (n.ca.set(e, t.size), t.ta);\n }));\n }, n.prototype.gr = function(t, e) {\n var n = this;\n // Record the size of everything we load from the cache so we can compute\n // a delta later.\n return this.ha.na(t, e).next((function(t) {\n var e = t.sa;\n // Note: `getAllFromCache` returns two maps instead of a single map from\n // keys to `DocumentSizeEntry`s. This is to allow returning the\n // `NullableMaybeDocumentMap` directly, without a conversion.\n return t.ia.forEach((function(t, e) {\n n.ca.set(t, e);\n })), e;\n }));\n }, n;\n}(Wr);\n\n/**\n * Creates a new IndexedDbRemoteDocumentCache.\n *\n * @param serializer The document serializer.\n * @param indexManager The query indexes that need to be maintained.\n */\n/**\n * Handles the details of adding and updating documents in the IndexedDbRemoteDocumentCache.\n *\n * Unlike the MemoryRemoteDocumentChangeBuffer, the IndexedDb implementation computes the size\n * delta for all submitted changes. This avoids having to re-read all documents from IndexedDb\n * when we apply the changes.\n */ function Ni(t) {\n return ro.Kn(t, Fi.store);\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the remoteDocuments object store.\n */ function Ai(t) {\n return ro.Kn(t, qi.store);\n}\n\nfunction Di(t) {\n return t.path.L();\n}\n\n/**\n * Retrusn an approximate size for the given document.\n */ function Si(t) {\n var e;\n if (t.document) e = t.document; else if (t.unknownDocument) e = t.unknownDocument; else {\n if (!t.noDocument) throw S();\n e = t.noDocument;\n }\n return JSON.stringify(e).length;\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An in-memory implementation of IndexManager.\n */ var xi = /** @class */ function() {\n function t() {\n this.ua = new ki;\n }\n return t.prototype.Mo = function(t, e) {\n return this.ua.add(e), cr.resolve();\n }, t.prototype.Kr = function(t, e) {\n return cr.resolve(this.ua.getEntries(e));\n }, t;\n}(), ki = /** @class */ function() {\n function t() {\n this.index = {};\n }\n // Returns false if the entry already existed.\n return t.prototype.add = function(t) {\n var e = t.O(), n = t.F(), r = this.index[e] || new mt(X.D), i = !r.has(n);\n return this.index[e] = r.add(n), i;\n }, t.prototype.has = function(t) {\n var e = t.O(), n = t.F(), r = this.index[e];\n return r && r.has(n);\n }, t.prototype.getEntries = function(t) {\n return (this.index[t] || new mt(X.D)).L();\n }, t;\n}(), Pi = /** @class */ function() {\n function t(t) {\n this.serializer = t;\n }\n /**\n * Performs database creation and schema upgrades.\n *\n * Note that in production, this method is only ever used to upgrade the schema\n * to SCHEMA_VERSION. Different values of toVersion are only used for testing\n * and local feature development.\n */ return t.prototype.createOrUpgrade = function(t, e, n, r) {\n var i = this;\n x(n < r && n >= 0 && r <= 10);\n var o = new dr(\"createOrUpgrade\", e);\n n < 1 && r >= 1 && (function(t) {\n t.createObjectStore(Li.store);\n }(t), function(t) {\n t.createObjectStore(Vi.store, {\n keyPath: Vi.keyPath\n }), t.createObjectStore(Ri.store, {\n keyPath: Ri.keyPath,\n autoIncrement: !0\n }).createIndex(Ri.userMutationsIndex, Ri.userMutationsKeyPath, {\n unique: !0\n }), t.createObjectStore(Ci.store);\n }(t), Ki(t), function(t) {\n t.createObjectStore(qi.store);\n }(t));\n // Migration 2 to populate the targetGlobal object no longer needed since\n // migration 3 unconditionally clears it.\n var u = cr.resolve();\n return n < 3 && r >= 3 && (\n // Brand new clients don't need to drop and recreate--only clients that\n // potentially have corrupt data.\n 0 !== n && (function(t) {\n t.deleteObjectStore(Gi.store), t.deleteObjectStore(ji.store), t.deleteObjectStore(Bi.store);\n }(t), Ki(t)), u = u.next((function() {\n /**\n * Creates the target global singleton row.\n *\n * @param {IDBTransaction} txn The version upgrade transaction for indexeddb\n */\n return function(t) {\n var e = t.store(Bi.store), n = new Bi(\n /*highestTargetId=*/ 0, \n /*lastListenSequenceNumber=*/ 0, H.min().v(), \n /*targetCount=*/ 0);\n return e.put(Bi.key, n);\n }(o);\n }))), n < 4 && r >= 4 && (0 !== n && (\n // Schema version 3 uses auto-generated keys to generate globally unique\n // mutation batch IDs (this was previously ensured internally by the\n // client). To migrate to the new schema, we have to read all mutations\n // and write them back out. We preserve the existing batch IDs to guarantee\n // consistency with other object stores. Any further mutation batch IDs will\n // be auto-generated.\n u = u.next((function() {\n return function(t, e) {\n return e.store(Ri.store).ts().next((function(n) {\n t.deleteObjectStore(Ri.store), t.createObjectStore(Ri.store, {\n keyPath: Ri.keyPath,\n autoIncrement: !0\n }).createIndex(Ri.userMutationsIndex, Ri.userMutationsKeyPath, {\n unique: !0\n });\n var r = e.store(Ri.store), i = n.map((function(t) {\n return r.put(t);\n }));\n return cr.kn(i);\n }));\n }(t, o);\n }))), u = u.next((function() {\n !function(t) {\n t.createObjectStore(Wi.store, {\n keyPath: Wi.keyPath\n });\n }(t);\n }))), n < 5 && r >= 5 && (u = u.next((function() {\n return i.removeAcknowledgedMutations(o);\n }))), n < 6 && r >= 6 && (u = u.next((function() {\n return function(t) {\n t.createObjectStore(Fi.store);\n }(t), i.addDocumentGlobal(o);\n }))), n < 7 && r >= 7 && (u = u.next((function() {\n return i.ensureSequenceNumbers(o);\n }))), n < 8 && r >= 8 && (u = u.next((function() {\n return i.createCollectionParentIndex(t, o);\n }))), n < 9 && r >= 9 && (u = u.next((function() {\n // Multi-Tab used to manage its own changelog, but this has been moved\n // to the DbRemoteDocument object store itself. Since the previous change\n // log only contained transient data, we can drop its object store.\n !function(t) {\n t.objectStoreNames.contains(\"remoteDocumentChanges\") && t.deleteObjectStore(\"remoteDocumentChanges\");\n }(t), function(t) {\n var e = t.objectStore(qi.store);\n e.createIndex(qi.readTimeIndex, qi.readTimeIndexPath, {\n unique: !1\n }), e.createIndex(qi.collectionReadTimeIndex, qi.collectionReadTimeIndexPath, {\n unique: !1\n });\n }(e);\n }))), n < 10 && r >= 10 && (u = u.next((function() {\n return i.rewriteCanonicalIds(o);\n }))), u;\n }, t.prototype.addDocumentGlobal = function(t) {\n var e = 0;\n return t.store(qi.store).rs((function(t, n) {\n e += Si(n);\n })).next((function() {\n var n = new Fi(e);\n return t.store(Fi.store).put(Fi.key, n);\n }));\n }, t.prototype.removeAcknowledgedMutations = function(t) {\n var e = this, n = t.store(Vi.store), r = t.store(Ri.store);\n return n.ts().next((function(n) {\n return cr.forEach(n, (function(n) {\n var i = IDBKeyRange.bound([ n.userId, -1 ], [ n.userId, n.lastAcknowledgedBatchId ]);\n return r.ts(Ri.userMutationsIndex, i).next((function(r) {\n return cr.forEach(r, (function(r) {\n x(r.userId === n.userId);\n var i = di(e.serializer, r);\n return wi(t, n.userId, i).next((function() {}));\n }));\n }));\n }));\n }));\n }, \n /**\n * Ensures that every document in the remote document cache has a corresponding sentinel row\n * with a sequence number. Missing rows are given the most recently used sequence number.\n */\n t.prototype.ensureSequenceNumbers = function(t) {\n var e = t.store(Gi.store), n = t.store(qi.store);\n return t.store(Bi.store).get(Bi.key).next((function(t) {\n var r = [];\n return n.rs((function(n, i) {\n var o = new X(n), u = function(t) {\n return [ 0, ri(t) ];\n }(o);\n r.push(e.get(u).next((function(n) {\n return n ? cr.resolve() : function(n) {\n return e.put(new Gi(0, ri(n), t.highestListenSequenceNumber));\n }(o);\n })));\n })).next((function() {\n return cr.kn(r);\n }));\n }));\n }, t.prototype.createCollectionParentIndex = function(t, e) {\n // Create the index.\n t.createObjectStore(zi.store, {\n keyPath: zi.keyPath\n });\n var n = e.store(zi.store), r = new ki, i = function(t) {\n if (r.add(t)) {\n var e = t.O(), i = t.F();\n return n.put({\n collectionId: e,\n parent: ri(i)\n });\n }\n };\n // Helper to add an index entry iff we haven't already written it.\n // Index existing remote documents.\n return e.store(qi.store).rs({\n ss: !0\n }, (function(t, e) {\n var n = new X(t);\n return i(n.F());\n })).next((function() {\n return e.store(Ci.store).rs({\n ss: !0\n }, (function(t, e) {\n t[0];\n var n = t[1], r = (t[2], ui(n));\n return i(r.F());\n }));\n }));\n }, t.prototype.rewriteCanonicalIds = function(t) {\n var e = this, n = t.store(ji.store);\n return n.rs((function(t, r) {\n var i = vi(r), o = yi(e.serializer, i);\n return n.put(o);\n }));\n }, t;\n}(), Oi = function(t, e) {\n this.seconds = t, this.nanoseconds = e;\n}, Li = function(t, \n/** Whether to allow shared access from multiple tabs. */\ne, n) {\n this.ownerId = t, this.allowTabSynchronization = e, this.leaseTimestampMs = n;\n};\n\n/**\n * Internal implementation of the collection-parent index exposed by MemoryIndexManager.\n * Also used for in-memory caching by IndexedDbIndexManager and initial index population\n * in indexeddb_schema.ts\n */\n/**\n * Name of the IndexedDb object store.\n *\n * Note that the name 'owner' is chosen to ensure backwards compatibility with\n * older clients that only supported single locked access to the persistence\n * layer.\n */\nLi.store = \"owner\", \n/**\n * The key string used for the single object that exists in the\n * DbPrimaryClient store.\n */\nLi.key = \"owner\";\n\nvar Vi = function(\n/**\n * The normalized user ID to which this queue belongs.\n */\nt, \n/**\n * An identifier for the highest numbered batch that has been acknowledged\n * by the server. All MutationBatches in this queue with batchIds less\n * than or equal to this value are considered to have been acknowledged by\n * the server.\n *\n * NOTE: this is deprecated and no longer used by the code.\n */\ne, \n/**\n * A stream token that was previously sent by the server.\n *\n * See StreamingWriteRequest in datastore.proto for more details about\n * usage.\n *\n * After sending this token, earlier tokens may not be used anymore so\n * only a single stream token is retained.\n *\n * NOTE: this is deprecated and no longer used by the code.\n */\nn) {\n this.userId = t, this.lastAcknowledgedBatchId = e, this.lastStreamToken = n;\n};\n\n/** Name of the IndexedDb object store. */ Vi.store = \"mutationQueues\", \n/** Keys are automatically assigned via the userId property. */\nVi.keyPath = \"userId\";\n\n/**\n * An object to be stored in the 'mutations' store in IndexedDb.\n *\n * Represents a batch of user-level mutations intended to be sent to the server\n * in a single write. Each user-level batch gets a separate DbMutationBatch\n * with a new batchId.\n */\nvar Ri = function(\n/**\n * The normalized user ID to which this batch belongs.\n */\nt, \n/**\n * An identifier for this batch, allocated using an auto-generated key.\n */\ne, \n/**\n * The local write time of the batch, stored as milliseconds since the\n * epoch.\n */\nn, \n/**\n * A list of \"mutations\" that represent a partial base state from when this\n * write batch was initially created. During local application of the write\n * batch, these baseMutations are applied prior to the real writes in order\n * to override certain document fields from the remote document cache. This\n * is necessary in the case of non-idempotent writes (e.g. `increment()`\n * transforms) to make sure that the local view of the modified documents\n * doesn't flicker if the remote document cache receives the result of the\n * non-idempotent write before the write is removed from the queue.\n *\n * These mutations are never sent to the backend.\n */\nr, \n/**\n * A list of mutations to apply. All mutations will be applied atomically.\n *\n * Mutations are serialized via toMutation().\n */\ni) {\n this.userId = t, this.batchId = e, this.localWriteTimeMs = n, this.baseMutations = r, \n this.mutations = i;\n};\n\n/** Name of the IndexedDb object store. */ Ri.store = \"mutations\", \n/** Keys are automatically assigned via the userId, batchId properties. */\nRi.keyPath = \"batchId\", \n/** The index name for lookup of mutations by user. */\nRi.userMutationsIndex = \"userMutationsIndex\", \n/** The user mutations index is keyed by [userId, batchId] pairs. */\nRi.userMutationsKeyPath = [ \"userId\", \"batchId\" ];\n\nvar Ci = /** @class */ function() {\n function t() {}\n /**\n * Creates a [userId] key for use in the DbDocumentMutations index to iterate\n * over all of a user's document mutations.\n */ return t.prefixForUser = function(t) {\n return [ t ];\n }, \n /**\n * Creates a [userId, encodedPath] key for use in the DbDocumentMutations\n * index to iterate over all at document mutations for a given path or lower.\n */\n t.prefixForPath = function(t, e) {\n return [ t, ri(e) ];\n }, \n /**\n * Creates a full index key of [userId, encodedPath, batchId] for inserting\n * and deleting into the DbDocumentMutations index.\n */\n t.key = function(t, e, n) {\n return [ t, ri(e), n ];\n }, t;\n}();\n\nCi.store = \"documentMutations\", \n/**\n * Because we store all the useful information for this store in the key,\n * there is no useful information to store as the value. The raw (unencoded)\n * path cannot be stored because IndexedDb doesn't store prototype\n * information.\n */\nCi.PLACEHOLDER = new Ci;\n\nvar Ui = function(t, e) {\n this.path = t, this.readTime = e;\n}, Mi = function(t, e) {\n this.path = t, this.version = e;\n}, qi = \n// TODO: We are currently storing full document keys almost three times\n// (once as part of the primary key, once - partly - as `parentPath` and once\n// inside the encoded documents). During our next migration, we should\n// rewrite the primary key as parentPath + document ID which would allow us\n// to drop one value.\nfunction(\n/**\n * Set to an instance of DbUnknownDocument if the data for a document is\n * not known, but it is known that a document exists at the specified\n * version (e.g. it had a successful update applied to it)\n */\nt, \n/**\n * Set to an instance of a DbNoDocument if it is known that no document\n * exists.\n */\ne, \n/**\n * Set to an instance of a Document if there's a cached version of the\n * document.\n */\nn, \n/**\n * Documents that were written to the remote document store based on\n * a write acknowledgment are marked with `hasCommittedMutations`. These\n * documents are potentially inconsistent with the backend's copy and use\n * the write's commit version as their document version.\n */\nr, \n/**\n * When the document was read from the backend. Undefined for data written\n * prior to schema version 9.\n */\ni, \n/**\n * The path of the collection this document is part of. Undefined for data\n * written prior to schema version 9.\n */\no) {\n this.unknownDocument = t, this.noDocument = e, this.document = n, this.hasCommittedMutations = r, \n this.readTime = i, this.parentPath = o;\n};\n\n/**\n * Represents a document that is known to exist but whose data is unknown.\n * Stored in IndexedDb as part of a DbRemoteDocument object.\n */ qi.store = \"remoteDocuments\", \n/**\n * An index that provides access to all entries sorted by read time (which\n * corresponds to the last modification time of each row).\n *\n * This index is used to provide a changelog for Multi-Tab.\n */\nqi.readTimeIndex = \"readTimeIndex\", qi.readTimeIndexPath = \"readTime\", \n/**\n * An index that provides access to documents in a collection sorted by read\n * time.\n *\n * This index is used to allow the RemoteDocumentCache to fetch newly changed\n * documents in a collection.\n */\nqi.collectionReadTimeIndex = \"collectionReadTimeIndex\", qi.collectionReadTimeIndexPath = [ \"parentPath\", \"readTime\" ];\n\n/**\n * Contains a single entry that has metadata about the remote document cache.\n */\nvar Fi = \n/**\n * @param byteSize Approximately the total size in bytes of all the documents in the document\n * cache.\n */\nfunction(t) {\n this.byteSize = t;\n};\n\nFi.store = \"remoteDocumentGlobal\", Fi.key = \"remoteDocumentGlobalKey\";\n\nvar ji = function(\n/**\n * An auto-generated sequential numeric identifier for the query.\n *\n * Queries are stored using their canonicalId as the key, but these\n * canonicalIds can be quite long so we additionally assign a unique\n * queryId which can be used by referenced data structures (e.g.\n * indexes) to minimize the on-disk cost.\n */\nt, \n/**\n * The canonical string representing this query. This is not unique.\n */\ne, \n/**\n * The last readTime received from the Watch Service for this query.\n *\n * This is the same value as TargetChange.read_time in the protos.\n */\nn, \n/**\n * An opaque, server-assigned token that allows watching a query to be\n * resumed after disconnecting without retransmitting all the data\n * that matches the query. The resume token essentially identifies a\n * point in time from which the server should resume sending results.\n *\n * This is related to the snapshotVersion in that the resumeToken\n * effectively also encodes that value, but the resumeToken is opaque\n * and sometimes encodes additional information.\n *\n * A consequence of this is that the resumeToken should be used when\n * asking the server to reason about where this client is in the watch\n * stream, but the client should use the snapshotVersion for its own\n * purposes.\n *\n * This is the same value as TargetChange.resume_token in the protos.\n */\nr, \n/**\n * A sequence number representing the last time this query was\n * listened to, used for garbage collection purposes.\n *\n * Conventionally this would be a timestamp value, but device-local\n * clocks are unreliable and they must be able to create new listens\n * even while disconnected. Instead this should be a monotonically\n * increasing number that's incremented on each listen call.\n *\n * This is different from the queryId since the queryId is an\n * immutable identifier assigned to the Query on first use while\n * lastListenSequenceNumber is updated every time the query is\n * listened to.\n */\ni, \n/**\n * Denotes the maximum snapshot version at which the associated query view\n * contained no limbo documents. Undefined for data written prior to\n * schema version 9.\n */\no, \n/**\n * The query for this target.\n *\n * Because canonical ids are not unique we must store the actual query. We\n * use the proto to have an object we can persist without having to\n * duplicate translation logic to and from a `Query` object.\n */\nu) {\n this.targetId = t, this.canonicalId = e, this.readTime = n, this.resumeToken = r, \n this.lastListenSequenceNumber = i, this.lastLimboFreeSnapshotVersion = o, this.query = u;\n};\n\nji.store = \"targets\", \n/** Keys are automatically assigned via the targetId property. */\nji.keyPath = \"targetId\", \n/** The name of the queryTargets index. */\nji.queryTargetsIndexName = \"queryTargetsIndex\", \n/**\n * The index of all canonicalIds to the targets that they match. This is not\n * a unique mapping because canonicalId does not promise a unique name for all\n * possible queries, so we append the targetId to make the mapping unique.\n */\nji.queryTargetsKeyPath = [ \"canonicalId\", \"targetId\" ];\n\n/**\n * An object representing an association between a target and a document, or a\n * sentinel row marking the last sequence number at which a document was used.\n * Each document cached must have a corresponding sentinel row before lru\n * garbage collection is enabled.\n *\n * The target associations and sentinel rows are co-located so that orphaned\n * documents and their sequence numbers can be identified efficiently via a scan\n * of this store.\n */\nvar Gi = function(\n/**\n * The targetId identifying a target or 0 for a sentinel row.\n */\nt, \n/**\n * The path to the document, as encoded in the key.\n */\ne, \n/**\n * If this is a sentinel row, this should be the sequence number of the last\n * time the document specified by `path` was used. Otherwise, it should be\n * `undefined`.\n */\nn) {\n this.targetId = t, this.path = e, this.sequenceNumber = n;\n};\n\n/** Name of the IndexedDb object store. */ Gi.store = \"targetDocuments\", \n/** Keys are automatically assigned via the targetId, path properties. */\nGi.keyPath = [ \"targetId\", \"path\" ], \n/** The index name for the reverse index. */\nGi.documentTargetsIndex = \"documentTargetsIndex\", \n/** We also need to create the reverse index for these properties. */\nGi.documentTargetsKeyPath = [ \"path\", \"targetId\" ];\n\n/**\n * A record of global state tracked across all Targets, tracked separately\n * to avoid the need for extra indexes.\n *\n * This should be kept in-sync with the proto used in the iOS client.\n */\nvar Bi = function(\n/**\n * The highest numbered target id across all targets.\n *\n * See DbTarget.targetId.\n */\nt, \n/**\n * The highest numbered lastListenSequenceNumber across all targets.\n *\n * See DbTarget.lastListenSequenceNumber.\n */\ne, \n/**\n * A global snapshot version representing the last consistent snapshot we\n * received from the backend. This is monotonically increasing and any\n * snapshots received from the backend prior to this version (e.g. for\n * targets resumed with a resumeToken) should be suppressed (buffered)\n * until the backend has caught up to this snapshot version again. This\n * prevents our cache from ever going backwards in time.\n */\nn, \n/**\n * The number of targets persisted.\n */\nr) {\n this.highestTargetId = t, this.highestListenSequenceNumber = e, this.lastRemoteSnapshotVersion = n, \n this.targetCount = r;\n};\n\n/**\n * The key string used for the single object that exists in the\n * DbTargetGlobal store.\n */ Bi.key = \"targetGlobalKey\", Bi.store = \"targetGlobal\";\n\n/**\n * An object representing an association between a Collection id (e.g. 'messages')\n * to a parent path (e.g. '/chats/123') that contains it as a (sub)collection.\n * This is used to efficiently find all collections to query when performing\n * a Collection Group query.\n */\nvar zi = function(\n/**\n * The collectionId (e.g. 'messages')\n */\nt, \n/**\n * The path to the parent (either a document location or an empty path for\n * a root-level collection).\n */\ne) {\n this.collectionId = t, this.parent = e;\n};\n\n/** Name of the IndexedDb object store. */ function Ki(t) {\n t.createObjectStore(Gi.store, {\n keyPath: Gi.keyPath\n }).createIndex(Gi.documentTargetsIndex, Gi.documentTargetsKeyPath, {\n unique: !0\n }), \n // NOTE: This is unique only because the TargetId is the suffix.\n t.createObjectStore(ji.store, {\n keyPath: ji.keyPath\n }).createIndex(ji.queryTargetsIndexName, ji.queryTargetsKeyPath, {\n unique: !0\n }), t.createObjectStore(Bi.store);\n}\n\nzi.store = \"collectionParents\", \n/** Keys are automatically assigned via the collectionId, parent properties. */\nzi.keyPath = [ \"collectionId\", \"parent\" ];\n\nvar Wi = function(\n// Note: Previous schema versions included a field\n// \"lastProcessedDocumentChangeId\". Don't use anymore.\n/** The auto-generated client id assigned at client startup. */\nt, \n/** The last time this state was updated. */\ne, \n/** Whether the client's network connection is enabled. */\nn, \n/** Whether this client is running in a foreground tab. */\nr) {\n this.clientId = t, this.updateTimeMs = e, this.networkEnabled = n, this.inForeground = r;\n};\n\n/** Name of the IndexedDb object store. */ Wi.store = \"clientMetadata\", \n/** Keys are automatically assigned via the clientId properties. */\nWi.keyPath = \"clientId\";\n\nvar Qi = r(r(r([ Vi.store, Ri.store, Ci.store, qi.store, ji.store, Li.store, Bi.store, Gi.store ], [ Wi.store ]), [ Fi.store ]), [ zi.store ]), Hi = /** @class */ function() {\n function t() {\n /**\n * An in-memory copy of the index entries we've already written since the SDK\n * launched. Used to avoid re-writing the same entry repeatedly.\n *\n * This is *NOT* a complete cache of what's in persistence and so can never be used to\n * satisfy reads.\n */\n this.la = new ki;\n }\n /**\n * Adds a new entry to the collection parent index.\n *\n * Repeated calls for the same collectionPath should be avoided within a\n * transaction as IndexedDbIndexManager only caches writes once a transaction\n * has been committed.\n */ return t.prototype.Mo = function(t, e) {\n var n = this;\n if (!this.la.has(e)) {\n var r = e.O(), i = e.F();\n t.pr((function() {\n // Add the collection to the in memory cache only if the transaction was\n // successfully committed.\n n.la.add(e);\n }));\n var o = {\n collectionId: r,\n parent: ri(i)\n };\n return Yi(t).put(o);\n }\n return cr.resolve();\n }, t.prototype.Kr = function(t, e) {\n var n = [], r = IDBKeyRange.bound([ e, \"\" ], [ R(e), \"\" ], \n /*lowerOpen=*/ !1, \n /*upperOpen=*/ !0);\n return Yi(t).ts(r).next((function(t) {\n for (var r = 0, i = t; r < i.length; r++) {\n var o = i[r];\n // This collectionId guard shouldn't be necessary (and isn't as long\n // as we're running in a real browser), but there's a bug in\n // indexeddbshim that breaks our range in our tests running in node:\n // https://github.com/axemclion/IndexedDBShim/issues/334\n if (o.collectionId !== e) break;\n n.push(ui(o.parent));\n }\n return n;\n }));\n }, t;\n}();\n\n// V2 is no longer usable (see comment at top of file)\n// Visible for testing\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A persisted implementation of IndexManager.\n */\n/**\n * Helper to get a typed SimpleDbStore for the collectionParents\n * document store.\n */\nfunction Yi(t) {\n return ro.Kn(t, zi.store);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Offset to ensure non-overlapping target ids. */\n/**\n * Generates monotonically increasing target IDs for sending targets to the\n * watch stream.\n *\n * The client constructs two generators, one for the target cache, and one for\n * for the sync engine (to generate limbo documents targets). These\n * generators produce non-overlapping IDs (by using even and odd IDs\n * respectively).\n *\n * By separating the target ID space, the query cache can generate target IDs\n * that persist across client restarts, while sync engine can independently\n * generate in-memory target IDs that are transient and can be reused after a\n * restart.\n */ var Xi = /** @class */ function() {\n function t(t) {\n this._a = t;\n }\n return t.prototype.next = function() {\n return this._a += 2, this._a;\n }, t.fa = function() {\n // The target cache generator must return '2' in its first call to `next()`\n // as there is no differentiation in the protocol layer between an unset\n // number and the number '0'. If we were to sent a target with target ID\n // '0', the backend would consider it unset and replace it with its own ID.\n return new t(0);\n }, t.da = function() {\n // Sync engine assigns target IDs for limbo document detection.\n return new t(-1);\n }, t;\n}(), Ji = /** @class */ function() {\n function t(t, e) {\n this.No = t, this.serializer = e;\n }\n // PORTING NOTE: We don't cache global metadata for the target cache, since\n // some of it (in particular `highestTargetId`) can be modified by secondary\n // tabs. We could perhaps be more granular (and e.g. still cache\n // `lastRemoteSnapshotVersion` in memory) but for simplicity we currently go\n // to IndexedDb whenever we need to read metadata. We can revisit if it turns\n // out to have a meaningful performance impact.\n return t.prototype.wa = function(t) {\n var e = this;\n return this.Ea(t).next((function(n) {\n var r = new Xi(n.highestTargetId);\n return n.highestTargetId = r.next(), e.Ta(t, n).next((function() {\n return n.highestTargetId;\n }));\n }));\n }, t.prototype.Ia = function(t) {\n return this.Ea(t).next((function(t) {\n return H.V(new Q(t.lastRemoteSnapshotVersion.seconds, t.lastRemoteSnapshotVersion.nanoseconds));\n }));\n }, t.prototype.ma = function(t) {\n return this.Ea(t).next((function(t) {\n return t.highestListenSequenceNumber;\n }));\n }, t.prototype.Aa = function(t, e, n) {\n var r = this;\n return this.Ea(t).next((function(i) {\n return i.highestListenSequenceNumber = e, n && (i.lastRemoteSnapshotVersion = n.v()), \n e > i.highestListenSequenceNumber && (i.highestListenSequenceNumber = e), r.Ta(t, i);\n }));\n }, t.prototype.Ra = function(t, e) {\n var n = this;\n return this.Pa(t, e).next((function() {\n return n.Ea(t).next((function(r) {\n return r.targetCount += 1, n.ga(e, r), n.Ta(t, r);\n }));\n }));\n }, t.prototype.Va = function(t, e) {\n return this.Pa(t, e);\n }, t.prototype.ya = function(t, e) {\n var n = this;\n return this.pa(t, e.targetId).next((function() {\n return $i(t).delete(e.targetId);\n })).next((function() {\n return n.Ea(t);\n })).next((function(e) {\n return x(e.targetCount > 0), e.targetCount -= 1, n.Ta(t, e);\n }));\n }, \n /**\n * Drops any targets with sequence number less than or equal to the upper bound, excepting those\n * present in `activeTargetIds`. Document associations for the removed targets are also removed.\n * Returns the number of targets removed.\n */\n t.prototype.po = function(t, e, n) {\n var r = this, i = 0, o = [];\n return $i(t).rs((function(u, s) {\n var a = vi(s);\n a.sequenceNumber <= e && null === n.get(a.targetId) && (i++, o.push(r.ya(t, a)));\n })).next((function() {\n return cr.kn(o);\n })).next((function() {\n return i;\n }));\n }, \n /**\n * Call provided function with each `TargetData` that we have cached.\n */\n t.prototype.Ce = function(t, e) {\n return $i(t).rs((function(t, n) {\n var r = vi(n);\n e(r);\n }));\n }, t.prototype.Ea = function(t) {\n return Zi(t).get(Bi.key).next((function(t) {\n return x(null !== t), t;\n }));\n }, t.prototype.Ta = function(t, e) {\n return Zi(t).put(Bi.key, e);\n }, t.prototype.Pa = function(t, e) {\n return $i(t).put(yi(this.serializer, e));\n }, \n /**\n * In-place updates the provided metadata to account for values in the given\n * TargetData. Saving is done separately. Returns true if there were any\n * changes to the metadata.\n */\n t.prototype.ga = function(t, e) {\n var n = !1;\n return t.targetId > e.highestTargetId && (e.highestTargetId = t.targetId, n = !0), \n t.sequenceNumber > e.highestListenSequenceNumber && (e.highestListenSequenceNumber = t.sequenceNumber, \n n = !0), n;\n }, t.prototype.ba = function(t) {\n return this.Ea(t).next((function(t) {\n return t.targetCount;\n }));\n }, t.prototype.va = function(t, e) {\n // Iterating by the canonicalId may yield more than one result because\n // canonicalId values are not required to be unique per target. This query\n // depends on the queryTargets index to be efficient.\n var n = ot(e), r = IDBKeyRange.bound([ n, Number.NEGATIVE_INFINITY ], [ n, Number.POSITIVE_INFINITY ]), i = null;\n return $i(t).rs({\n range: r,\n index: ji.queryTargetsIndexName\n }, (function(t, n, r) {\n var o = vi(n);\n // After finding a potential match, check that the target is\n // actually equal to the requested target.\n ut(e, o.target) && (i = o, r.done());\n })).next((function() {\n return i;\n }));\n }, t.prototype.Sa = function(t, e, n) {\n var r = this, i = [], o = to(t);\n // PORTING NOTE: The reverse index (documentsTargets) is maintained by\n // IndexedDb.\n return e.forEach((function(e) {\n var u = ri(e.path);\n i.push(o.put(new Gi(n, u))), i.push(r.No.Da(t, n, e));\n })), cr.kn(i);\n }, t.prototype.Ca = function(t, e, n) {\n var r = this, i = to(t);\n // PORTING NOTE: The reverse index (documentsTargets) is maintained by\n // IndexedDb.\n return cr.forEach(e, (function(e) {\n var o = ri(e.path);\n return cr.kn([ i.delete([ n, o ]), r.No.Na(t, n, e) ]);\n }));\n }, t.prototype.pa = function(t, e) {\n var n = to(t), r = IDBKeyRange.bound([ e ], [ e + 1 ], \n /*lowerOpen=*/ !1, \n /*upperOpen=*/ !0);\n return n.delete(r);\n }, t.prototype.xa = function(t, e) {\n var n = IDBKeyRange.bound([ e ], [ e + 1 ], \n /*lowerOpen=*/ !1, \n /*upperOpen=*/ !0), r = to(t), i = At();\n return r.rs({\n range: n,\n ss: !0\n }, (function(t, e, n) {\n var r = ui(t[1]), o = new Z(r);\n i = i.add(o);\n })).next((function() {\n return i;\n }));\n }, t.prototype.Ho = function(t, e) {\n var n = ri(e.path), r = IDBKeyRange.bound([ n ], [ R(n) ], \n /*lowerOpen=*/ !1, \n /*upperOpen=*/ !0), i = 0;\n return to(t).rs({\n index: Gi.documentTargetsIndex,\n ss: !0,\n range: r\n }, (function(t, e, n) {\n var r = t[0];\n // Having a sentinel row for a document does not count as containing that document;\n // For the target cache, containing the document means the document is part of some\n // target.\n t[1];\n 0 !== r && (i++, n.done());\n })).next((function() {\n return i > 0;\n }));\n }, \n /**\n * Looks up a TargetData entry by target ID.\n *\n * @param targetId The target ID of the TargetData entry to look up.\n * @return The cached TargetData entry, or null if the cache has no entry for\n * the target.\n */\n // PORTING NOTE: Multi-tab only.\n t.prototype.Ue = function(t, e) {\n return $i(t).get(e).next((function(t) {\n return t ? vi(t) : null;\n }));\n }, t;\n}();\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Helper to get a typed SimpleDbStore for the queries object store.\n */\nfunction $i(t) {\n return ro.Kn(t, ji.store);\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the target globals object store.\n */ function Zi(t) {\n return ro.Kn(t, Bi.store);\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the document target object store.\n */ function to(t) {\n return ro.Kn(t, Gi.store);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ var eo = \"Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.\", no = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this) || this).Wo = t, r.Fa = n, r;\n }\n return t(n, e), n;\n}(Hr), ro = /** @class */ function() {\n function t(\n /**\n * Whether to synchronize the in-memory state of multiple tabs and share\n * access to local persistence.\n */\n e, n, r, i, o, u, s, a, c, \n /**\n * If set to true, forcefully obtains database access. Existing tabs will\n * no longer be able to access IndexedDB.\n */\n h) {\n if (this.allowTabSynchronization = e, this.persistenceKey = n, this.clientId = r, \n this.fn = o, this.window = u, this.document = s, this.ka = c, this.Oa = h, this.Ma = null, \n this.$a = !1, this.isPrimary = !1, this.networkEnabled = !0, \n /** Our window.unload handler, if registered. */\n this.La = null, this.inForeground = !1, \n /** Our 'visibilitychange' listener if registered. */\n this.Ba = null, \n /** The client metadata refresh task. */\n this.qa = null, \n /** The last time we garbage collected the client metadata object store. */\n this.Ua = Number.NEGATIVE_INFINITY, \n /** A listener to notify on primary state changes. */\n this.Ka = function(t) {\n return Promise.resolve();\n }, !t.Ln()) throw new I(b.UNIMPLEMENTED, \"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.\");\n this.No = new uo(this, i), this.Qa = n + \"main\", this.serializer = new si(a), this.Wa = new hr(this.Qa, 10, new Pi(this.serializer)), \n this.ja = new Ji(this.No, this.serializer), this.Dr = new Hi, this.vr = function(t, e) {\n return new _i(t, e);\n }(this.serializer, this.Dr), this.window && this.window.localStorage ? this.Ga = this.window.localStorage : (this.Ga = null, \n !1 === h && N(\"IndexedDbPersistence\", \"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page.\"));\n }\n return t.Kn = function(t, e) {\n if (t instanceof no) return hr.Kn(t.Wo, e);\n throw S();\n }, \n /**\n * Attempt to start IndexedDb persistence.\n *\n * @return {Promise<void>} Whether persistence was enabled.\n */\n t.prototype.start = function() {\n var t = this;\n // NOTE: This is expected to fail sometimes (in the case of another tab\n // already having the persistence lock), so it's the first thing we should\n // do.\n return this.za().then((function() {\n if (!t.isPrimary && !t.allowTabSynchronization) \n // Fail `start()` if `synchronizeTabs` is disabled and we cannot\n // obtain the primary lease.\n throw new I(b.FAILED_PRECONDITION, eo);\n return t.Ha(), t.Ja(), t.Ya(), t.runTransaction(\"getHighestListenSequenceNumber\", \"readonly\", (function(e) {\n return t.ja.ma(e);\n }));\n })).then((function(e) {\n t.Ma = new Lr(e, t.ka);\n })).then((function() {\n t.$a = !0;\n })).catch((function(e) {\n return t.Wa && t.Wa.close(), Promise.reject(e);\n }));\n }, \n /**\n * Registers a listener that gets called when the primary state of the\n * instance changes. Upon registering, this listener is invoked immediately\n * with the current primary state.\n *\n * PORTING NOTE: This is only used for Web multi-tab.\n */\n t.prototype.Xa = function(t) {\n var r = this;\n return this.Ka = function(i) {\n return e(r, void 0, void 0, (function() {\n return n(this, (function(e) {\n return this.Ii ? [ 2 /*return*/ , t(i) ] : [ 2 /*return*/ ];\n }));\n }));\n }, t(this.isPrimary);\n }, \n /**\n * Registers a listener that gets called when the database receives a\n * version change event indicating that it has deleted.\n *\n * PORTING NOTE: This is only used for Web multi-tab.\n */\n t.prototype.Za = function(t) {\n var r = this;\n this.Wa.jn((function(i) {\n return e(r, void 0, void 0, (function() {\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n return null === i.newVersion ? [ 4 /*yield*/ , t() ] : [ 3 /*break*/ , 2 ];\n\n case 1:\n e.sent(), e.label = 2;\n\n case 2:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }));\n }, \n /**\n * Adjusts the current network state in the client's metadata, potentially\n * affecting the primary lease.\n *\n * PORTING NOTE: This is only used for Web multi-tab.\n */\n t.prototype.th = function(t) {\n var r = this;\n this.networkEnabled !== t && (this.networkEnabled = t, \n // Schedule a primary lease refresh for immediate execution. The eventual\n // lease update will be propagated via `primaryStateListener`.\n this.fn.ws((function() {\n return e(r, void 0, void 0, (function() {\n return n(this, (function(t) {\n switch (t.label) {\n case 0:\n return this.Ii ? [ 4 /*yield*/ , this.za() ] : [ 3 /*break*/ , 2 ];\n\n case 1:\n t.sent(), t.label = 2;\n\n case 2:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n })));\n }, \n /**\n * Updates the client metadata in IndexedDb and attempts to either obtain or\n * extend the primary lease for the local client. Asynchronously notifies the\n * primary state listener if the client either newly obtained or released its\n * primary lease.\n */\n t.prototype.za = function() {\n var t = this;\n return this.runTransaction(\"updateClientMetadataAndTryBecomePrimary\", \"readwrite\", (function(e) {\n return oo(e).put(new Wi(t.clientId, Date.now(), t.networkEnabled, t.inForeground)).next((function() {\n if (t.isPrimary) return t.eh(e).next((function(e) {\n e || (t.isPrimary = !1, t.fn.Cs((function() {\n return t.Ka(!1);\n })));\n }));\n })).next((function() {\n return t.nh(e);\n })).next((function(n) {\n return t.isPrimary && !n ? t.sh(e).next((function() {\n return !1;\n })) : !!n && t.ih(e).next((function() {\n return !0;\n }));\n }));\n })).catch((function(e) {\n if (pr(e)) \n // Proceed with the existing state. Any subsequent access to\n // IndexedDB will verify the lease.\n return T(\"IndexedDbPersistence\", \"Failed to extend owner lease: \", e), t.isPrimary;\n if (!t.allowTabSynchronization) throw e;\n return T(\"IndexedDbPersistence\", \"Releasing owner lease after error during lease refresh\", e), \n /* isPrimary= */ !1;\n })).then((function(e) {\n t.isPrimary !== e && t.fn.Cs((function() {\n return t.Ka(e);\n })), t.isPrimary = e;\n }));\n }, t.prototype.eh = function(t) {\n var e = this;\n return io(t).get(Li.key).next((function(t) {\n return cr.resolve(e.rh(t));\n }));\n }, t.prototype.oh = function(t) {\n return oo(t).delete(this.clientId);\n }, \n /**\n * If the garbage collection threshold has passed, prunes the\n * RemoteDocumentChanges and the ClientMetadata store based on the last update\n * time of all clients.\n */\n t.prototype.ah = function() {\n return e(this, void 0, void 0, (function() {\n var e, r, i, o, u = this;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return !this.isPrimary || this.hh(this.Ua, 18e5) ? [ 3 /*break*/ , 2 ] : (this.Ua = Date.now(), \n [ 4 /*yield*/ , this.runTransaction(\"maybeGarbageCollectMultiClientState\", \"readwrite-primary\", (function(e) {\n var n = t.Kn(e, Wi.store);\n return n.ts().next((function(t) {\n var e = u.uh(t, 18e5), r = t.filter((function(t) {\n return -1 === e.indexOf(t);\n }));\n // Delete metadata for clients that are no longer considered active.\n return cr.forEach(r, (function(t) {\n return n.delete(t.clientId);\n })).next((function() {\n return r;\n }));\n }));\n })).catch((function() {\n return [];\n })) ]);\n\n case 1:\n // Delete potential leftover entries that may continue to mark the\n // inactive clients as zombied in LocalStorage.\n // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for\n // the client atomically, but we can't. So we opt to delete the IndexedDb\n // entries first to avoid potentially reviving a zombied client.\n if (e = n.sent(), this.Ga) for (r = 0, i = e; r < i.length; r++) o = i[r], this.Ga.removeItem(this.lh(o.clientId));\n n.label = 2;\n\n case 2:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }, \n /**\n * Schedules a recurring timer to update the client metadata and to either\n * extend or acquire the primary lease if the client is eligible.\n */\n t.prototype.Ya = function() {\n var t = this;\n this.qa = this.fn.Vn(\"client_metadata_refresh\" /* ClientMetadataRefresh */ , 4e3, (function() {\n return t.za().then((function() {\n return t.ah();\n })).then((function() {\n return t.Ya();\n }));\n }));\n }, \n /** Checks whether `client` is the local client. */ t.prototype.rh = function(t) {\n return !!t && t.ownerId === this.clientId;\n }, \n /**\n * Evaluate the state of all active clients and determine whether the local\n * client is or can act as the holder of the primary lease. Returns whether\n * the client is eligible for the lease, but does not actually acquire it.\n * May return 'false' even if there is no active leaseholder and another\n * (foreground) client should become leaseholder instead.\n */\n t.prototype.nh = function(t) {\n var e = this;\n return this.Oa ? cr.resolve(!0) : io(t).get(Li.key).next((function(n) {\n // A client is eligible for the primary lease if:\n // - its network is enabled and the client's tab is in the foreground.\n // - its network is enabled and no other client's tab is in the\n // foreground.\n // - every clients network is disabled and the client's tab is in the\n // foreground.\n // - every clients network is disabled and no other client's tab is in\n // the foreground.\n // - the `forceOwningTab` setting was passed in.\n if (null !== n && e.hh(n.leaseTimestampMs, 5e3) && !e._h(n.ownerId)) {\n if (e.rh(n) && e.networkEnabled) return !0;\n if (!e.rh(n)) {\n if (!n.allowTabSynchronization) \n // Fail the `canActAsPrimary` check if the current leaseholder has\n // not opted into multi-tab synchronization. If this happens at\n // client startup, we reject the Promise returned by\n // `enablePersistence()` and the user can continue to use Firestore\n // with in-memory persistence.\n // If this fails during a lease refresh, we will instead block the\n // AsyncQueue from executing further operations. Note that this is\n // acceptable since mixing & matching different `synchronizeTabs`\n // settings is not supported.\n // TODO(b/114226234): Remove this check when `synchronizeTabs` can\n // no longer be turned off.\n throw new I(b.FAILED_PRECONDITION, eo);\n return !1;\n }\n }\n return !(!e.networkEnabled || !e.inForeground) || oo(t).ts().next((function(t) {\n return void 0 === e.uh(t, 5e3).find((function(t) {\n if (e.clientId !== t.clientId) {\n var n = !e.networkEnabled && t.networkEnabled, r = !e.inForeground && t.inForeground, i = e.networkEnabled === t.networkEnabled;\n if (n || r && i) return !0;\n }\n return !1;\n }));\n }));\n })).next((function(t) {\n return e.isPrimary !== t && T(\"IndexedDbPersistence\", \"Client \" + (t ? \"is\" : \"is not\") + \" eligible for a primary lease.\"), \n t;\n }));\n }, t.prototype.Di = function() {\n return e(this, void 0, void 0, (function() {\n var t = this;\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n // Use `SimpleDb.runTransaction` directly to avoid failing if another tab\n // has obtained the primary lease.\n // The shutdown() operations are idempotent and can be called even when\n // start() aborted (e.g. because it couldn't acquire the persistence lease).\n return this.$a = !1, this.fh(), this.qa && (this.qa.cancel(), this.qa = null), this.dh(), \n this.wh(), [ 4 /*yield*/ , this.Wa.runTransaction(\"shutdown\", \"readwrite\", [ Li.store, Wi.store ], (function(e) {\n var n = new no(e, Lr.ai);\n return t.sh(n).next((function() {\n return t.oh(n);\n }));\n })) ];\n\n case 1:\n // The shutdown() operations are idempotent and can be called even when\n // start() aborted (e.g. because it couldn't acquire the persistence lease).\n // Use `SimpleDb.runTransaction` directly to avoid failing if another tab\n // has obtained the primary lease.\n return e.sent(), this.Wa.close(), \n // Remove the entry marking the client as zombied from LocalStorage since\n // we successfully deleted its metadata from IndexedDb.\n this.Eh(), [ 2 /*return*/ ];\n }\n }));\n }));\n }, \n /**\n * Returns clients that are not zombied and have an updateTime within the\n * provided threshold.\n */\n t.prototype.uh = function(t, e) {\n var n = this;\n return t.filter((function(t) {\n return n.hh(t.updateTimeMs, e) && !n._h(t.clientId);\n }));\n }, \n /**\n * Returns the IDs of the clients that are currently active. If multi-tab\n * is not supported, returns an array that only contains the local client's\n * ID.\n *\n * PORTING NOTE: This is only used for Web multi-tab.\n */\n t.prototype.pi = function() {\n var t = this;\n return this.runTransaction(\"getActiveClients\", \"readonly\", (function(e) {\n return oo(e).ts().next((function(e) {\n return t.uh(e, 18e5).map((function(t) {\n return t.clientId;\n }));\n }));\n }));\n }, Object.defineProperty(t.prototype, \"Ii\", {\n get: function() {\n return this.$a;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.Th = function(t) {\n return mi.Fo(t, this.serializer, this.Dr, this.No);\n }, t.prototype.Ih = function() {\n return this.ja;\n }, t.prototype.mh = function() {\n return this.vr;\n }, t.prototype.Ah = function() {\n return this.Dr;\n }, t.prototype.runTransaction = function(t, e, n) {\n var r = this;\n T(\"IndexedDbPersistence\", \"Starting transaction:\", t);\n var i, o = \"readonly\" === e ? \"readonly\" : \"readwrite\";\n // Do all transactions as readwrite against all object stores, since we\n // are the only reader/writer.\n return this.Wa.runTransaction(t, o, Qi, (function(o) {\n return i = new no(o, r.Ma ? r.Ma.next() : Lr.ai), \"readwrite-primary\" === e ? r.eh(i).next((function(t) {\n return !!t || r.nh(i);\n })).next((function(e) {\n if (!e) throw N(\"Failed to obtain primary lease for action '\" + t + \"'.\"), r.isPrimary = !1, \n r.fn.Cs((function() {\n return r.Ka(!1);\n })), new I(b.FAILED_PRECONDITION, Qr);\n return n(i);\n })).next((function(t) {\n return r.ih(i).next((function() {\n return t;\n }));\n })) : r.Rh(i).next((function() {\n return n(i);\n }));\n })).then((function(t) {\n return i.br(), t;\n }));\n }, \n /**\n * Verifies that the current tab is the primary leaseholder or alternatively\n * that the leaseholder has opted into multi-tab synchronization.\n */\n // TODO(b/114226234): Remove this check when `synchronizeTabs` can no longer\n // be turned off.\n t.prototype.Rh = function(t) {\n var e = this;\n return io(t).get(Li.key).next((function(t) {\n if (null !== t && e.hh(t.leaseTimestampMs, 5e3) && !e._h(t.ownerId) && !e.rh(t) && !(e.Oa || e.allowTabSynchronization && t.allowTabSynchronization)) throw new I(b.FAILED_PRECONDITION, eo);\n }));\n }, \n /**\n * Obtains or extends the new primary lease for the local client. This\n * method does not verify that the client is eligible for this lease.\n */\n t.prototype.ih = function(t) {\n var e = new Li(this.clientId, this.allowTabSynchronization, Date.now());\n return io(t).put(Li.key, e);\n }, t.Ln = function() {\n return hr.Ln();\n }, \n /** Checks the primary lease and removes it if we are the current primary. */ t.prototype.sh = function(t) {\n var e = this, n = io(t);\n return n.get(Li.key).next((function(t) {\n return e.rh(t) ? (T(\"IndexedDbPersistence\", \"Releasing primary lease.\"), n.delete(Li.key)) : cr.resolve();\n }));\n }, \n /** Verifies that `updateTimeMs` is within `maxAgeMs`. */ t.prototype.hh = function(t, e) {\n var n = Date.now();\n return !(t < n - e || t > n && (N(\"Detected an update time that is in the future: \" + t + \" > \" + n), \n 1));\n }, t.prototype.Ha = function() {\n var t = this;\n null !== this.document && \"function\" == typeof this.document.addEventListener && (this.Ba = function() {\n t.fn.ws((function() {\n return t.inForeground = \"visible\" === t.document.visibilityState, t.za();\n }));\n }, this.document.addEventListener(\"visibilitychange\", this.Ba), this.inForeground = \"visible\" === this.document.visibilityState);\n }, t.prototype.dh = function() {\n this.Ba && (this.document.removeEventListener(\"visibilitychange\", this.Ba), this.Ba = null);\n }, \n /**\n * Attaches a window.unload handler that will synchronously write our\n * clientId to a \"zombie client id\" location in LocalStorage. This can be used\n * by tabs trying to acquire the primary lease to determine that the lease\n * is no longer valid even if the timestamp is recent. This is particularly\n * important for the refresh case (so the tab correctly re-acquires the\n * primary lease). LocalStorage is used for this rather than IndexedDb because\n * it is a synchronous API and so can be used reliably from an unload\n * handler.\n */\n t.prototype.Ja = function() {\n var t, e = this;\n \"function\" == typeof (null === (t = this.window) || void 0 === t ? void 0 : t.addEventListener) && (this.La = function() {\n // Note: In theory, this should be scheduled on the AsyncQueue since it\n // accesses internal state. We execute this code directly during shutdown\n // to make sure it gets a chance to run.\n e.fh(), e.fn.ws((function() {\n return e.Di();\n }));\n }, this.window.addEventListener(\"unload\", this.La));\n }, t.prototype.wh = function() {\n this.La && (this.window.removeEventListener(\"unload\", this.La), this.La = null);\n }, \n /**\n * Returns whether a client is \"zombied\" based on its LocalStorage entry.\n * Clients become zombied when their tab closes without running all of the\n * cleanup logic in `shutdown()`.\n */\n t.prototype._h = function(t) {\n var e;\n try {\n var n = null !== (null === (e = this.Ga) || void 0 === e ? void 0 : e.getItem(this.lh(t)));\n return T(\"IndexedDbPersistence\", \"Client '\" + t + \"' \" + (n ? \"is\" : \"is not\") + \" zombied in LocalStorage\"), \n n;\n } catch (t) {\n // Gracefully handle if LocalStorage isn't working.\n return N(\"IndexedDbPersistence\", \"Failed to get zombied client id.\", t), !1;\n }\n }, \n /**\n * Record client as zombied (a client that had its tab closed). Zombied\n * clients are ignored during primary tab selection.\n */\n t.prototype.fh = function() {\n if (this.Ga) try {\n this.Ga.setItem(this.lh(this.clientId), String(Date.now()));\n } catch (t) {\n // Gracefully handle if LocalStorage isn't available / working.\n N(\"Failed to set zombie client id.\", t);\n }\n }, \n /** Removes the zombied client entry if it exists. */ t.prototype.Eh = function() {\n if (this.Ga) try {\n this.Ga.removeItem(this.lh(this.clientId));\n } catch (t) {\n // Ignore\n }\n }, t.prototype.lh = function(t) {\n return \"firestore_zombie_\" + this.persistenceKey + \"_\" + t;\n }, t;\n}();\n\n/**\n * Oldest acceptable age in milliseconds for client metadata before the client\n * is considered inactive and its associated data is garbage collected.\n */\n/**\n * Helper to get a typed SimpleDbStore for the primary client object store.\n */\nfunction io(t) {\n return ro.Kn(t, Li.store);\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the client metadata object store.\n */ function oo(t) {\n return ro.Kn(t, Wi.store);\n}\n\n/** Provides LRU functionality for IndexedDB persistence. */ var uo = /** @class */ function() {\n function t(t, e) {\n this.db = t, this.wo = new ni(this, e);\n }\n return t.prototype.Po = function(t) {\n var e = this.Ph(t);\n return this.db.Ih().ba(t).next((function(t) {\n return e.next((function(e) {\n return t + e;\n }));\n }));\n }, t.prototype.Ph = function(t) {\n var e = 0;\n return this.yo(t, (function(t) {\n e++;\n })).next((function() {\n return e;\n }));\n }, t.prototype.Ce = function(t, e) {\n return this.db.Ih().Ce(t, e);\n }, t.prototype.yo = function(t, e) {\n return this.gh(t, (function(t, n) {\n return e(n);\n }));\n }, t.prototype.Da = function(t, e, n) {\n return so(t, n);\n }, t.prototype.Na = function(t, e, n) {\n return so(t, n);\n }, t.prototype.po = function(t, e, n) {\n return this.db.Ih().po(t, e, n);\n }, t.prototype.Go = function(t, e) {\n return so(t, e);\n }, \n /**\n * Returns true if anything would prevent this document from being garbage\n * collected, given that the document in question is not present in any\n * targets and has a sequence number less than or equal to the upper bound for\n * the collection run.\n */\n t.prototype.Vh = function(t, e) {\n return function(t, e) {\n var n = !1;\n return Ei(t).os((function(r) {\n return gi(t, r, e).next((function(t) {\n return t && (n = !0), cr.resolve(!t);\n }));\n })).next((function() {\n return n;\n }));\n }(t, e);\n }, t.prototype.bo = function(t, e) {\n var n = this, r = this.db.mh().ra(), i = [], o = 0;\n return this.gh(t, (function(u, s) {\n if (s <= e) {\n var a = n.Vh(t, u).next((function(e) {\n if (!e) \n // Our size accounting requires us to read all documents before\n // removing them.\n return o++, r.Rr(t, u).next((function() {\n return r.Ar(u), to(t).delete([ 0, ri(u.path) ]);\n }));\n }));\n i.push(a);\n }\n })).next((function() {\n return cr.kn(i);\n })).next((function() {\n return r.apply(t);\n })).next((function() {\n return o;\n }));\n }, t.prototype.removeTarget = function(t, e) {\n var n = e.st(t.Fa);\n return this.db.Ih().Va(t, n);\n }, t.prototype.yh = function(t, e) {\n return so(t, e);\n }, \n /**\n * Call provided function for each document in the cache that is 'orphaned'. Orphaned\n * means not a part of any target, so the only entry in the target-document index for\n * that document will be the sentinel row (targetId 0), which will also have the sequence\n * number for the last time the document was accessed.\n */\n t.prototype.gh = function(t, e) {\n var n, r = to(t), i = Lr.ai;\n return r.rs({\n index: Gi.documentTargetsIndex\n }, (function(t, r) {\n var o = t[0], u = (t[1], r.path), s = r.sequenceNumber;\n 0 === o ? (\n // if nextToReport is valid, report it, this is a new key so the\n // last one must not be a member of any targets.\n i !== Lr.ai && e(new Z(ui(n)), i), \n // set nextToReport to be this sequence number. It's the next one we\n // might report, if we don't find any targets for this document.\n // Note that the sequence number must be defined when the targetId\n // is 0.\n i = s, n = u) : \n // set nextToReport to be invalid, we know we don't need to report\n // this one since we found a target for it.\n i = Lr.ai;\n })).next((function() {\n // Since we report sequence numbers after getting to the next key, we\n // need to check if the last key we iterated over was an orphaned\n // document and report it.\n i !== Lr.ai && e(new Z(ui(n)), i);\n }));\n }, t.prototype.So = function(t) {\n return this.db.mh().aa(t);\n }, t;\n}();\n\nfunction so(t, e) {\n return to(t).put(\n /**\n * @return A value suitable for writing a sentinel row in the target-document\n * store.\n */\n function(t, e) {\n return new Gi(0, ri(t.path), e);\n }(e, t.Fa));\n}\n\n/**\n * Generates a string used as a prefix when storing data in IndexedDB and\n * LocalStorage.\n */ function ao(t, e) {\n // Use two different prefix formats:\n // * firestore / persistenceKey / projectID . databaseID / ...\n // * firestore / persistenceKey / projectID / ...\n // projectIDs are DNS-compatible names and cannot contain dots\n // so there's no danger of collisions.\n var n = t.projectId;\n return t.I || (n += \".\" + t.database), \"firestore/\" + e + \"/\" + n + \"/\"\n /**\n * Implements `LocalStore` interface.\n *\n * Note: some field defined in this class might have public access level, but\n * the class is not exported so they are only accessible from this module.\n * This is useful to implement optional features (like bundles) in free\n * functions, such that they are tree-shakeable.\n */;\n}\n\nvar co = /** @class */ function() {\n function t(\n /** Manages our in-memory or durable persistence. */\n t, e, n) {\n this.persistence = t, this.ph = e, \n /**\n * Maps a targetID to data about its target.\n *\n * PORTING NOTE: We are using an immutable data structure on Web to make re-runs\n * of `applyRemoteEvent()` idempotent.\n */\n this.bh = new dt(L), \n /** Maps a target to its targetID. */\n // TODO(wuandy): Evaluate if TargetId can be part of Target.\n this.Sh = new W((function(t) {\n return ot(t);\n }), ut), \n /**\n * The read time of the last entry processed by `getNewDocumentChanges()`.\n *\n * PORTING NOTE: This is only used for multi-tab synchronization.\n */\n this.Dh = H.min(), this.Sr = t.Th(n), this.Ch = t.mh(), this.ja = t.Ih(), this.Nh = new Yr(this.Ch, this.Sr, this.persistence.Ah()), \n this.ph.xh(this.Nh);\n }\n return t.prototype.mo = function(t) {\n var e = this;\n return this.persistence.runTransaction(\"Collect garbage\", \"readwrite-primary\", (function(n) {\n return t.vo(n, e.bh);\n }));\n }, t;\n}();\n\n/**\n * Acknowledges the given batch.\n *\n * On the happy path when a batch is acknowledged, the local store will\n *\n * + remove the batch from the mutation queue;\n * + apply the changes to the remote document cache;\n * + recalculate the latency compensated view implied by those changes (there\n * may be mutations in the queue that affect the documents but haven't been\n * acknowledged yet); and\n * + give the changed documents back the sync engine\n *\n * @returns The resulting (modified) documents.\n */ function ho(t, e) {\n var n = k(t);\n return n.persistence.runTransaction(\"Acknowledge batch\", \"readwrite-primary\", (function(t) {\n var r = e.batch.keys(), i = n.Ch.ra({\n oa: !0\n });\n return function(t, e, n, r) {\n var i = n.batch, o = i.keys(), u = cr.resolve();\n return o.forEach((function(t) {\n u = u.next((function() {\n return r.Rr(e, t);\n })).next((function(e) {\n var o = e, u = n.dr.get(t);\n x(null !== u), (!o || o.version.h(u) < 0) && ((o = i.hr(t, o, n)) && \n // We use the commitVersion as the readTime rather than the\n // document's updateTime since the updateTime is not advanced\n // for updates that do not modify the underlying document.\n r.Ir(o, n._r));\n }));\n })), u.next((function() {\n return t.Sr.Qo(e, i);\n }));\n }(n, t, e, i).next((function() {\n return i.apply(t);\n })).next((function() {\n return n.Sr.zo(t);\n })).next((function() {\n return n.Nh.Or(t, r);\n }));\n }));\n}\n\n/**\n * Removes mutations from the MutationQueue for the specified batch;\n * LocalDocuments will be recalculated.\n *\n * @returns The resulting modified documents.\n */\n/**\n * Returns the last consistent snapshot processed (used by the RemoteStore to\n * determine whether to buffer incoming snapshots from the backend).\n */ function fo(t) {\n var e = k(t);\n return e.persistence.runTransaction(\"Get last remote snapshot version\", \"readonly\", (function(t) {\n return e.ja.Ia(t);\n }));\n}\n\n/**\n * Updates the \"ground-state\" (remote) documents. We assume that the remote\n * event reflects any write batches that have been acknowledged or rejected\n * (i.e. we do not re-apply local mutations to updates from this event).\n *\n * LocalDocuments are re-calculated if there are remaining mutations in the\n * queue.\n */ function lo(t, e) {\n var n = k(t), r = e.nt, i = n.bh;\n return n.persistence.runTransaction(\"Apply remote event\", \"readwrite-primary\", (function(t) {\n var o = n.Ch.ra({\n oa: !0\n });\n // Reset newTargetDataByTargetMap in case this transaction gets re-run.\n i = n.bh;\n var u = [];\n e.zt.forEach((function(e, o) {\n var s = i.get(o);\n if (s) {\n // Only update the remote keys if the target is still active. This\n // ensures that we can persist the updated target data along with\n // the updated assignment.\n u.push(n.ja.Ca(t, e.se, o).next((function() {\n return n.ja.Sa(t, e.ee, o);\n })));\n var a = e.resumeToken;\n // Update the resume token if the change includes one.\n if (a.o() > 0) {\n var c = s.it(a, r).st(t.Fa);\n i = i.ot(o, c), \n // Update the target data if there are target changes (or if\n // sufficient time has passed since the last update).\n /**\n * Returns true if the newTargetData should be persisted during an update of\n * an active target. TargetData should always be persisted when a target is\n * being released and should not call this function.\n *\n * While the target is active, TargetData updates can be omitted when nothing\n * about the target has changed except metadata like the resume token or\n * snapshot version. Occasionally it's worth the extra write to prevent these\n * values from getting too stale after a crash, but this doesn't have to be\n * too frequent.\n */\n function(t, e, n) {\n // Always persist target data if we don't already have a resume token.\n return x(e.resumeToken.o() > 0), 0 === t.resumeToken.o() || (\n // Don't allow resume token changes to be buffered indefinitely. This\n // allows us to be reasonably up-to-date after a crash and avoids needing\n // to loop over all active queries on shutdown. Especially in the browser\n // we may not get time to do anything interesting while the current tab is\n // closing.\n e.nt.p() - t.nt.p() >= 3e8 || n.ee.size + n.ne.size + n.se.size > 0);\n }(s, c, e) && u.push(n.ja.Va(t, c));\n }\n }\n }));\n var s = bt(), a = At();\n // HACK: The only reason we allow a null snapshot version is so that we\n // can synthesize remote events when we get permission denied errors while\n // trying to resolve the state of a locally cached document that is in\n // limbo.\n if (e.Jt.forEach((function(t, e) {\n a = a.add(t);\n })), \n // Each loop iteration only affects its \"own\" doc, so it's safe to get all the remote\n // documents in advance in a single call.\n u.push(o.getEntries(t, a).next((function(i) {\n e.Jt.forEach((function(a, c) {\n var h = i.get(a);\n // Note: The order of the steps below is important, since we want\n // to ensure that rejected limbo resolutions (which fabricate\n // NoDocuments with SnapshotVersion.min()) never add documents to\n // cache.\n c instanceof Nn && c.version.isEqual(H.min()) ? (\n // NoDocuments with SnapshotVersion.min() are used in manufactured\n // events. We remove these documents from cache since we lost\n // access.\n o.Ar(a, r), s = s.ot(a, c)) : null == h || c.version.h(h.version) > 0 || 0 === c.version.h(h.version) && h.hasPendingWrites ? (o.Ir(c, r), \n s = s.ot(a, c)) : T(\"LocalStore\", \"Ignoring outdated watch update for \", a, \". Current version:\", h.version, \" Watch version:\", c.version), \n e.Yt.has(a) && u.push(n.persistence.No.yh(t, a));\n }));\n }))), !r.isEqual(H.min())) {\n var c = n.ja.Ia(t).next((function(e) {\n return n.ja.Aa(t, t.Fa, r);\n }));\n u.push(c);\n }\n return cr.kn(u).next((function() {\n return o.apply(t);\n })).next((function() {\n return n.Nh.Mr(t, s);\n }));\n })).then((function(t) {\n return n.bh = i, t;\n }));\n}\n\n/**\n * Gets the mutation batch after the passed in batchId in the mutation queue\n * or null if empty.\n * @param afterBatchId If provided, the batch to search after.\n * @returns The next mutation or null if there wasn't one.\n */ function po(t, e) {\n var n = k(t);\n return n.persistence.runTransaction(\"Get next mutation batch\", \"readonly\", (function(t) {\n return void 0 === e && (e = -1), n.Sr.Bo(t, e);\n }));\n}\n\n/**\n * Reads the current value of a Document with a given key or null if not\n * found - used for testing.\n */\n/**\n * Assigns the given target an internal ID so that its results can be pinned so\n * they don't get GC'd. A target must be allocated in the local store before\n * the store can be used to manage its view.\n *\n * Allocating an already allocated `Target` will return the existing `TargetData`\n * for that `Target`.\n */ function vo(t, e) {\n var n = k(t);\n return n.persistence.runTransaction(\"Allocate target\", \"readwrite\", (function(t) {\n var r;\n return n.ja.va(t, e).next((function(i) {\n return i ? (\n // This target has been listened to previously, so reuse the\n // previous targetID.\n // TODO(mcg): freshen last accessed date?\n r = i, cr.resolve(r)) : n.ja.wa(t).next((function(i) {\n return r = new ht(e, i, 0 /* Listen */ , t.Fa), n.ja.Ra(t, r).next((function() {\n return r;\n }));\n }));\n }));\n })).then((function(t) {\n // If Multi-Tab is enabled, the existing target data may be newer than\n // the in-memory data\n var r = n.bh.get(t.targetId);\n return (null === r || t.nt.h(r.nt) > 0) && (n.bh = n.bh.ot(t.targetId, t), n.Sh.set(e, t.targetId)), \n t;\n }));\n}\n\n/**\n * Returns the TargetData as seen by the LocalStore, including updates that may\n * have not yet been persisted to the TargetCache.\n */\n// Visible for testing.\n/**\n * Unpins all the documents associated with the given target. If\n * `keepPersistedTargetData` is set to false and Eager GC enabled, the method\n * directly removes the associated target data from the target cache.\n *\n * Releasing a non-existing `Target` is a no-op.\n */\n// PORTING NOTE: `keepPersistedTargetData` is multi-tab only.\nfunction yo(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var e, o, u, s;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = k(t), o = e.bh.get(r), u = i ? \"readwrite\" : \"readwrite-primary\", n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 4, , 5 ]), i ? [ 3 /*break*/ , 3 ] : [ 4 /*yield*/ , e.persistence.runTransaction(\"Release target\", u, (function(t) {\n return e.persistence.No.removeTarget(t, o);\n })) ];\n\n case 2:\n n.sent(), n.label = 3;\n\n case 3:\n return [ 3 /*break*/ , 5 ];\n\n case 4:\n if (!pr(s = n.sent())) throw s;\n // All `releaseTarget` does is record the final metadata state for the\n // target, but we've been recording this periodically during target\n // activity. If we lose this write this could cause a very slight\n // difference in the order of target deletion during GC, but we\n // don't define exact LRU semantics so this is acceptable.\n return T(\"LocalStore\", \"Failed to update sequence numbers for target \" + r + \": \" + s), \n [ 3 /*break*/ , 5 ];\n\n case 5:\n return e.bh = e.bh.remove(r), e.Sh.delete(o.target), [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * Runs the specified query against the local store and returns the results,\n * potentially taking advantage of query data from previous executions (such\n * as the set of remote keys).\n *\n * @param usePreviousResults Whether results from previous executions can\n * be used to optimize this query execution.\n */ function mo(t, e, n) {\n var r = k(t), i = H.min(), o = At();\n return r.persistence.runTransaction(\"Execute query\", \"readonly\", (function(t) {\n return function(t, e, n) {\n var r = k(t), i = r.Sh.get(n);\n return void 0 !== i ? cr.resolve(r.bh.get(i)) : r.ja.va(e, n);\n }(r, t, Cn(e)).next((function(e) {\n if (e) return i = e.lastLimboFreeSnapshotVersion, r.ja.xa(t, e.targetId).next((function(t) {\n o = t;\n }));\n })).next((function() {\n return r.ph.Lr(t, e, n ? i : H.min(), n ? o : At());\n })).next((function(t) {\n return {\n documents: t,\n Fh: o\n };\n }));\n }));\n}\n\n// PORTING NOTE: Multi-Tab only.\nfunction go(t, e) {\n var n = k(t), r = k(n.ja), i = n.bh.get(e);\n return i ? Promise.resolve(i.target) : n.persistence.runTransaction(\"Get target data\", \"readonly\", (function(t) {\n return r.Ue(t, e).next((function(t) {\n return t ? t.target : null;\n }));\n }));\n}\n\n/**\n * Returns the set of documents that have been updated since the last call.\n * If this is the first call, returns the set of changes since client\n * initialization. Further invocations will return document that have changed\n * since the prior call.\n */\n// PORTING NOTE: Multi-Tab only.\nfunction wo(t) {\n var e = k(t);\n return e.persistence.runTransaction(\"Get new document changes\", \"readonly\", (function(t) {\n return function(t, e, n) {\n var r = k(t), i = bt(), o = hi(n), u = Ai(e), s = IDBKeyRange.lowerBound(o, !0);\n return u.rs({\n index: qi.readTimeIndex,\n range: s\n }, (function(t, e) {\n // Unlike `getEntry()` and others, `getNewDocumentChanges()` parses\n // the documents directly since we want to keep sentinel deletes.\n var n = ai(r.serializer, e);\n i = i.ot(n.key, n), o = e.readTime;\n })).next((function() {\n return {\n kh: i,\n readTime: fi(o)\n };\n }));\n }(e.Ch, t, e.Dh);\n })).then((function(t) {\n var n = t.kh, r = t.readTime;\n return e.Dh = r, n;\n }));\n}\n\n/**\n * Reads the newest document change from persistence and moves the internal\n * synchronization marker forward so that calls to `getNewDocumentChanges()`\n * only return changes that happened after client initialization.\n */\n// PORTING NOTE: Multi-Tab only.\nfunction bo(t) {\n return e(this, void 0, void 0, (function() {\n var e;\n return n(this, (function(n) {\n return [ 2 /*return*/ , (e = k(t)).persistence.runTransaction(\"Synchronize last document change read time\", \"readonly\", (function(t) {\n return function(t) {\n var e = Ai(t), n = H.min();\n // If there are no existing entries, we return SnapshotVersion.min().\n return e.rs({\n index: qi.readTimeIndex,\n reverse: !0\n }, (function(t, e, r) {\n e.readTime && (n = fi(e.readTime)), r.done();\n })).next((function() {\n return n;\n }));\n }(t);\n })).then((function(t) {\n e.Dh = t;\n })) ];\n }));\n }));\n}\n\n/**\n * Verifies the error thrown by a LocalStore operation. If a LocalStore\n * operation fails because the primary lease has been taken by another client,\n * we ignore the error (the persistence layer will immediately call\n * `applyPrimaryLease` to propagate the primary state change). All other errors\n * are re-thrown.\n *\n * @param err An error returned by a LocalStore operation.\n * @return A Promise that resolves after we recovered, or the original error.\n */ function Io(t) {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(e) {\n if (t.code !== b.FAILED_PRECONDITION || t.message !== Qr) throw t;\n return T(\"LocalStore\", \"Unexpectedly lost primary lease\"), [ 2 /*return*/ ];\n }));\n }));\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A collection of references to a document from some kind of numbered entity\n * (either a target ID or batch ID). As references are added to or removed from\n * the set corresponding events are emitted to a registered garbage collector.\n *\n * Each reference is represented by a DocumentReference object. Each of them\n * contains enough information to uniquely identify the reference. They are all\n * stored primarily in a set sorted by key. A document is considered garbage if\n * there's no references in that set (this can be efficiently checked thanks to\n * sorting by key).\n *\n * ReferenceSet also keeps a secondary set that contains references sorted by\n * IDs. This one is used to efficiently implement removal of all references by\n * some target ID.\n */ var Eo = /** @class */ function() {\n function t() {\n // A set of outstanding references to a document sorted by key.\n this.Oh = new mt(_o.Mh), \n // A set of outstanding references to a document sorted by target id.\n this.$h = new mt(_o.Lh)\n /** Returns true if the reference set contains no references. */;\n }\n return t.prototype.P = function() {\n return this.Oh.P();\n }, \n /** Adds a reference to the given document key for the given ID. */ t.prototype.Da = function(t, e) {\n var n = new _o(t, e);\n this.Oh = this.Oh.add(n), this.$h = this.$h.add(n);\n }, \n /** Add references to the given document keys for the given ID. */ t.prototype.Bh = function(t, e) {\n var n = this;\n t.forEach((function(t) {\n return n.Da(t, e);\n }));\n }, \n /**\n * Removes a reference to the given document key for the given\n * ID.\n */\n t.prototype.Na = function(t, e) {\n this.qh(new _o(t, e));\n }, t.prototype.Uh = function(t, e) {\n var n = this;\n t.forEach((function(t) {\n return n.Na(t, e);\n }));\n }, \n /**\n * Clears all references with a given ID. Calls removeRef() for each key\n * removed.\n */\n t.prototype.Kh = function(t) {\n var e = this, n = new Z(new X([])), r = new _o(n, t), i = new _o(n, t + 1), o = [];\n return this.$h.xt([ r, i ], (function(t) {\n e.qh(t), o.push(t.key);\n })), o;\n }, t.prototype.Qh = function() {\n var t = this;\n this.Oh.forEach((function(e) {\n return t.qh(e);\n }));\n }, t.prototype.qh = function(t) {\n this.Oh = this.Oh.delete(t), this.$h = this.$h.delete(t);\n }, t.prototype.Wh = function(t) {\n var e = new Z(new X([])), n = new _o(e, t), r = new _o(e, t + 1), i = At();\n return this.$h.xt([ n, r ], (function(t) {\n i = i.add(t.key);\n })), i;\n }, t.prototype.Ho = function(t) {\n var e = new _o(t, 0), n = this.Oh.kt(e);\n return null !== n && t.isEqual(n.key);\n }, t;\n}(), _o = /** @class */ function() {\n function t(t, e) {\n this.key = t, this.jh = e\n /** Compare by key then by ID */;\n }\n return t.Mh = function(t, e) {\n return Z.D(t.key, e.key) || L(t.jh, e.jh);\n }, \n /** Compare by ID then by key */ t.Lh = function(t, e) {\n return L(t.jh, e.jh) || Z.D(t.key, e.key);\n }, t;\n}(), To = function(t, e) {\n this.user = e, this.type = \"OAuth\", this.Gh = {}, \n // Set the headers using Object Literal notation to avoid minification\n this.Gh.Authorization = \"Bearer \" + t;\n}, No = /** @class */ function() {\n function t() {\n /**\n * Stores the listener registered with setChangeListener()\n * This isn't actually necessary since the UID never changes, but we use this\n * to verify the listen contract is adhered to in tests.\n */\n this.zh = null;\n }\n return t.prototype.getToken = function() {\n return Promise.resolve(null);\n }, t.prototype.Hh = function() {}, t.prototype.Jh = function(t) {\n this.zh = t, \n // Fire with initial user.\n t(Or.UNAUTHENTICATED);\n }, t.prototype.Yh = function() {\n this.zh = null;\n }, t;\n}(), Ao = /** @class */ function() {\n function t(t) {\n var e = this;\n /**\n * The auth token listener registered with FirebaseApp, retained here so we\n * can unregister it.\n */ this.Xh = null, \n /** Tracks the current User. */\n this.currentUser = Or.UNAUTHENTICATED, this.Zh = !1, \n /**\n * Counter used to detect if the token changed while a getToken request was\n * outstanding.\n */\n this.tc = 0, \n /** The listener registered with setChangeListener(). */\n this.zh = null, this.forceRefresh = !1, this.Xh = function() {\n e.tc++, e.currentUser = e.ec(), e.Zh = !0, e.zh && e.zh(e.currentUser);\n }, this.tc = 0, this.auth = t.getImmediate({\n optional: !0\n }), this.auth ? this.auth.addAuthTokenListener(this.Xh) : (\n // if auth is not available, invoke tokenListener once with null token\n this.Xh(null), t.get().then((function(t) {\n e.auth = t, e.Xh && \n // tokenListener can be removed by removeChangeListener()\n e.auth.addAuthTokenListener(e.Xh);\n }), (function() {})));\n }\n return t.prototype.getToken = function() {\n var t = this, e = this.tc, n = this.forceRefresh;\n // Take note of the current value of the tokenCounter so that this method\n // can fail (with an ABORTED error) if there is a token change while the\n // request is outstanding.\n return this.forceRefresh = !1, this.auth ? this.auth.getToken(n).then((function(n) {\n // Cancel the request since the token changed while the request was\n // outstanding so the response is potentially for a previous user (which\n // user, we can't be sure).\n return t.tc !== e ? (T(\"FirebaseCredentialsProvider\", \"getToken aborted due to token change.\"), \n t.getToken()) : n ? (x(\"string\" == typeof n.accessToken), new To(n.accessToken, t.currentUser)) : null;\n })) : Promise.resolve(null);\n }, t.prototype.Hh = function() {\n this.forceRefresh = !0;\n }, t.prototype.Jh = function(t) {\n this.zh = t, \n // Fire the initial event\n this.Zh && t(this.currentUser);\n }, t.prototype.Yh = function() {\n this.auth && this.auth.removeAuthTokenListener(this.Xh), this.Xh = null, this.zh = null;\n }, \n // Auth.getUid() can return null even with a user logged in. It is because\n // getUid() is synchronous, but the auth code populating Uid is asynchronous.\n // This method should only be called in the AuthTokenListener callback\n // to guarantee to get the actual user.\n t.prototype.ec = function() {\n var t = this.auth && this.auth.getUid();\n return x(null === t || \"string\" == typeof t), new Or(t);\n }, t;\n}(), Do = /** @class */ function() {\n function t(t, e) {\n this.nc = t, this.sc = e, this.type = \"FirstParty\", this.user = Or.ni;\n }\n return Object.defineProperty(t.prototype, \"Gh\", {\n get: function() {\n var t = {\n \"X-Goog-AuthUser\": this.sc\n }, e = this.nc.auth.getAuthHeaderValueForFirstParty([]);\n // Use array notation to prevent minification\n return e && (t.Authorization = e), t;\n },\n enumerable: !1,\n configurable: !0\n }), t;\n}(), So = /** @class */ function() {\n function t(t, e) {\n this.nc = t, this.sc = e;\n }\n return t.prototype.getToken = function() {\n return Promise.resolve(new Do(this.nc, this.sc));\n }, t.prototype.Jh = function(t) {\n // Fire with initial uid.\n t(Or.ni);\n }, t.prototype.Yh = function() {}, t.prototype.Hh = function() {}, t;\n}(), xo = /** @class */ function() {\n function t(t, e, n, r, i, o) {\n this.fn = t, this.ic = n, this.rc = r, this.oc = i, this.listener = o, this.state = 0 /* Initial */ , \n /**\n * A close count that's incremented every time the stream is closed; used by\n * getCloseGuardedDispatcher() to invalidate callbacks that happen after\n * close.\n */\n this.ac = 0, this.hc = null, this.stream = null, this.Vs = new ar(t, e)\n /**\n * Returns true if start() has been called and no error has occurred. True\n * indicates the stream is open or in the process of opening (which\n * encompasses respecting backoff, getting auth tokens, and starting the\n * actual RPC). Use isOpen() to determine if the stream is open and ready for\n * outbound requests.\n */;\n }\n return t.prototype.cc = function() {\n return 1 /* Starting */ === this.state || 2 /* Open */ === this.state || 4 /* Backoff */ === this.state;\n }, \n /**\n * Returns true if the underlying RPC is open (the onOpen() listener has been\n * called) and the stream is ready for outbound requests.\n */\n t.prototype.uc = function() {\n return 2 /* Open */ === this.state;\n }, \n /**\n * Starts the RPC. Only allowed if isStarted() returns false. The stream is\n * not immediately ready for use: onOpen() will be invoked when the RPC is\n * ready for outbound requests, at which point isOpen() will return true.\n *\n * When start returns, isStarted() will return true.\n */\n t.prototype.start = function() {\n 3 /* Error */ !== this.state ? this.auth() : this.lc();\n }, \n /**\n * Stops the RPC. This call is idempotent and allowed regardless of the\n * current isStarted() state.\n *\n * When stop returns, isStarted() and isOpen() will both return false.\n */\n t.prototype.stop = function() {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(t) {\n switch (t.label) {\n case 0:\n return this.cc() ? [ 4 /*yield*/ , this.close(0 /* Initial */) ] : [ 3 /*break*/ , 2 ];\n\n case 1:\n t.sent(), t.label = 2;\n\n case 2:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }, \n /**\n * After an error the stream will usually back off on the next attempt to\n * start it. If the error warrants an immediate restart of the stream, the\n * sender can use this to indicate that the receiver should not back off.\n *\n * Each error will call the onClose() listener. That function can decide to\n * inhibit backoff if required.\n */\n t.prototype._c = function() {\n this.state = 0 /* Initial */ , this.Vs.reset();\n }, \n /**\n * Marks this stream as idle. If no further actions are performed on the\n * stream for one minute, the stream will automatically close itself and\n * notify the stream's onClose() handler with Status.OK. The stream will then\n * be in a !isStarted() state, requiring the caller to start the stream again\n * before further use.\n *\n * Only streams that are in state 'Open' can be marked idle, as all other\n * states imply pending network operations.\n */\n t.prototype.fc = function() {\n var t = this;\n // Starts the idle time if we are in state 'Open' and are not yet already\n // running a timer (in which case the previous idle timeout still applies).\n this.uc() && null === this.hc && (this.hc = this.fn.Vn(this.ic, 6e4, (function() {\n return t.dc();\n })));\n }, \n /** Sends a message to the underlying stream. */ t.prototype.wc = function(t) {\n this.Ec(), this.stream.send(t);\n }, \n /** Called by the idle timer when the stream should close due to inactivity. */ t.prototype.dc = function() {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(t) {\n return this.uc() ? [ 2 /*return*/ , this.close(0 /* Initial */) ] : [ 2 /*return*/ ];\n }));\n }));\n }, \n /** Marks the stream as active again. */ t.prototype.Ec = function() {\n this.hc && (this.hc.cancel(), this.hc = null);\n }, \n /**\n * Closes the stream and cleans up as necessary:\n *\n * * closes the underlying GRPC stream;\n * * calls the onClose handler with the given 'error';\n * * sets internal stream state to 'finalState';\n * * adjusts the backoff timer based on the error\n *\n * A new stream can be opened by calling start().\n *\n * @param finalState the intended state of the stream after closing.\n * @param error the error the connection was closed with.\n */\n t.prototype.close = function(t, r) {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n // Notify the listener that the stream closed.\n // Cancel any outstanding timers (they're guaranteed not to execute).\n return this.Ec(), this.Vs.cancel(), \n // Invalidates any stream-related callbacks (e.g. from auth or the\n // underlying stream), guaranteeing they won't execute.\n this.ac++, 3 /* Error */ !== t ? \n // If this is an intentional close ensure we don't delay our next connection attempt.\n this.Vs.reset() : r && r.code === b.RESOURCE_EXHAUSTED ? (\n // Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)\n N(r.toString()), N(\"Using maximum backoff delay to prevent overloading the backend.\"), \n this.Vs.Rn()) : r && r.code === b.UNAUTHENTICATED && \n // \"unauthenticated\" error means the token was rejected. Try force refreshing it in case it\n // just expired.\n this.oc.Hh(), \n // Clean up the underlying stream because we are no longer interested in events.\n null !== this.stream && (this.Tc(), this.stream.close(), this.stream = null), \n // This state must be assigned before calling onClose() to allow the callback to\n // inhibit backoff or otherwise manipulate the state in its non-started state.\n this.state = t, [ 4 /*yield*/ , this.listener.Ic(r) ];\n\n case 1:\n // Cancel any outstanding timers (they're guaranteed not to execute).\n // Notify the listener that the stream closed.\n return e.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }, \n /**\n * Can be overridden to perform additional cleanup before the stream is closed.\n * Calling super.tearDown() is not required.\n */\n t.prototype.Tc = function() {}, t.prototype.auth = function() {\n var t = this;\n this.state = 1 /* Starting */;\n var e = this.mc(this.ac), n = this.ac;\n // TODO(mikelehen): Just use dispatchIfNotClosed, but see TODO below.\n this.oc.getToken().then((function(e) {\n // Stream can be stopped while waiting for authentication.\n // TODO(mikelehen): We really should just use dispatchIfNotClosed\n // and let this dispatch onto the queue, but that opened a spec test can\n // of worms that I don't want to deal with in this PR.\n t.ac === n && \n // Normally we'd have to schedule the callback on the AsyncQueue.\n // However, the following calls are safe to be called outside the\n // AsyncQueue since they don't chain asynchronous calls\n t.Ac(e);\n }), (function(n) {\n e((function() {\n var e = new I(b.UNKNOWN, \"Fetching auth token failed: \" + n.message);\n return t.Rc(e);\n }));\n }));\n }, t.prototype.Ac = function(t) {\n var e = this, n = this.mc(this.ac);\n this.stream = this.Pc(t), this.stream.gc((function() {\n n((function() {\n return e.state = 2 /* Open */ , e.listener.gc();\n }));\n })), this.stream.Ic((function(t) {\n n((function() {\n return e.Rc(t);\n }));\n })), this.stream.onMessage((function(t) {\n n((function() {\n return e.onMessage(t);\n }));\n }));\n }, t.prototype.lc = function() {\n var t = this;\n this.state = 4 /* Backoff */ , this.Vs.Pn((function() {\n return e(t, void 0, void 0, (function() {\n return n(this, (function(t) {\n return this.state = 0 /* Initial */ , this.start(), [ 2 /*return*/ ];\n }));\n }));\n }));\n }, \n // Visible for tests\n t.prototype.Rc = function(t) {\n // In theory the stream could close cleanly, however, in our current model\n // we never expect this to happen because if we stop a stream ourselves,\n // this callback will never be called. To prevent cases where we retry\n // without a backoff accidentally, we set the stream to error in all cases.\n return T(\"PersistentStream\", \"close with error: \" + t), this.stream = null, this.close(3 /* Error */ , t);\n }, \n /**\n * Returns a \"dispatcher\" function that dispatches operations onto the\n * AsyncQueue but only runs them if closeCount remains unchanged. This allows\n * us to turn auth / stream callbacks into no-ops if the stream is closed /\n * re-opened, etc.\n */\n t.prototype.mc = function(t) {\n var e = this;\n return function(n) {\n e.fn.ws((function() {\n return e.ac === t ? n() : (T(\"PersistentStream\", \"stream callback skipped by getCloseGuardedDispatcher.\"), \n Promise.resolve());\n }));\n };\n }, t;\n}(), ko = /** @class */ function(e) {\n function n(t, n, r, i, o) {\n var u = this;\n return (u = e.call(this, t, \"listen_stream_connection_backoff\" /* ListenStreamConnectionBackoff */ , \"listen_stream_idle\" /* ListenStreamIdle */ , n, r, o) || this).serializer = i, \n u;\n }\n return t(n, e), n.prototype.Pc = function(t) {\n return this.rc.Vc(\"Listen\", t);\n }, n.prototype.onMessage = function(t) {\n // A successful response means the stream is healthy\n this.Vs.reset();\n var e = function(t, e) {\n var n;\n if (\"targetChange\" in e) {\n e.targetChange;\n // proto3 default value is unset in JSON (undefined), so use 'NO_CHANGE'\n // if unset\n var r = function(t) {\n return \"NO_CHANGE\" === t ? 0 /* NoChange */ : \"ADD\" === t ? 1 /* Added */ : \"REMOVE\" === t ? 2 /* Removed */ : \"CURRENT\" === t ? 3 /* Current */ : \"RESET\" === t ? 4 /* Reset */ : S();\n }(e.targetChange.targetChangeType || \"NO_CHANGE\"), i = e.targetChange.targetIds || [], o = function(t, e) {\n return t.Ke ? (x(void 0 === e || \"string\" == typeof e), C.fromBase64String(e || \"\")) : (x(void 0 === e || e instanceof Uint8Array), \n C.fromUint8Array(e || new Uint8Array));\n }(t, e.targetChange.resumeToken), u = e.targetChange.cause, s = u && function(t) {\n var e = void 0 === t.code ? b.UNKNOWN : pt(t.code);\n return new I(e, t.message || \"\");\n }(u);\n n = new Ct(r, i, o, s || null);\n } else if (\"documentChange\" in e) {\n e.documentChange;\n var a = e.documentChange;\n a.document, a.document.name, a.document.updateTime;\n var c = be(t, a.document.name), h = ye(a.document.updateTime), f = new bn({\n mapValue: {\n fields: a.document.fields\n }\n }), l = new Tn(c, h, f, {}), p = a.targetIds || [], d = a.removedTargetIds || [];\n n = new Vt(p, d, l.key, l);\n } else if (\"documentDelete\" in e) {\n e.documentDelete;\n var v = e.documentDelete;\n v.document;\n var y = be(t, v.document), m = v.readTime ? ye(v.readTime) : H.min(), g = new Nn(y, m), w = v.removedTargetIds || [];\n n = new Vt([], w, g.key, g);\n } else if (\"documentRemove\" in e) {\n e.documentRemove;\n var E = e.documentRemove;\n E.document;\n var _ = be(t, E.document), T = E.removedTargetIds || [];\n n = new Vt([], T, _, null);\n } else {\n if (!(\"filter\" in e)) return S();\n e.filter;\n var N = e.filter;\n N.targetId;\n var A = N.count || 0, D = new ft(A), k = N.targetId;\n n = new Rt(k, D);\n }\n return n;\n }(this.serializer, t), n = function(t) {\n // We have only reached a consistent snapshot for the entire stream if there\n // is a read_time set and it applies to all targets (i.e. the list of\n // targets is empty). The backend is guaranteed to send such responses.\n if (!(\"targetChange\" in t)) return H.min();\n var e = t.targetChange;\n return e.targetIds && e.targetIds.length ? H.min() : e.readTime ? ye(e.readTime) : H.min();\n }(t);\n return this.listener.yc(e, n);\n }, \n /**\n * Registers interest in the results of the given target. If the target\n * includes a resumeToken it will be included in the request. Results that\n * affect the target will be streamed back as WatchChange messages that\n * reference the targetId.\n */\n n.prototype.bc = function(t) {\n var e = {};\n e.database = _e(this.serializer), e.addTarget = function(t, e) {\n var n, r = e.target;\n return (n = st(r) ? {\n documents: Se(t, r)\n } : {\n query: xe(t, r)\n }).targetId = e.targetId, e.resumeToken.o() > 0 && (n.resumeToken = de(t, e.resumeToken)), \n n;\n }(this.serializer, t);\n var n = function(t, e) {\n var n = function(t, e) {\n switch (e) {\n case 0 /* Listen */ :\n return null;\n\n case 1 /* ExistenceFilterMismatch */ :\n return \"existence-filter-mismatch\";\n\n case 2 /* LimboResolution */ :\n return \"limbo-document\";\n\n default:\n return S();\n }\n }(0, e.et);\n return null == n ? null : {\n \"goog-listen-tags\": n\n };\n }(this.serializer, t);\n n && (e.labels = n), this.wc(e);\n }, \n /**\n * Unregisters interest in the results of the target associated with the\n * given targetId.\n */\n n.prototype.vc = function(t) {\n var e = {};\n e.database = _e(this.serializer), e.removeTarget = t, this.wc(e);\n }, n;\n}(xo), Po = /** @class */ function(e) {\n function n(t, n, r, i, o) {\n var u = this;\n return (u = e.call(this, t, \"write_stream_connection_backoff\" /* WriteStreamConnectionBackoff */ , \"write_stream_idle\" /* WriteStreamIdle */ , n, r, o) || this).serializer = i, \n u.Sc = !1, u;\n }\n return t(n, e), Object.defineProperty(n.prototype, \"Dc\", {\n /**\n * Tracks whether or not a handshake has been successfully exchanged and\n * the stream is ready to accept mutations.\n */\n get: function() {\n return this.Sc;\n },\n enumerable: !1,\n configurable: !0\n }), \n // Override of PersistentStream.start\n n.prototype.start = function() {\n this.Sc = !1, this.lastStreamToken = void 0, e.prototype.start.call(this);\n }, n.prototype.Tc = function() {\n this.Sc && this.Cc([]);\n }, n.prototype.Pc = function(t) {\n return this.rc.Vc(\"Write\", t);\n }, n.prototype.onMessage = function(t) {\n if (\n // Always capture the last stream token.\n x(!!t.streamToken), this.lastStreamToken = t.streamToken, this.Sc) {\n // A successful first write response means the stream is healthy,\n // Note, that we could consider a successful handshake healthy, however,\n // the write itself might be causing an error we want to back off from.\n this.Vs.reset();\n var e = function(t, e) {\n return t && t.length > 0 ? (x(void 0 !== e), t.map((function(t) {\n return function(t, e) {\n // NOTE: Deletes don't have an updateTime.\n var n = t.updateTime ? ye(t.updateTime) : ye(e);\n n.isEqual(H.min()) && (\n // The Firestore Emulator currently returns an update time of 0 for\n // deletes of non-existing documents (rather than null). This breaks the\n // test \"get deleted doc while offline with source=cache\" as NoDocuments\n // with version 0 are filtered by IndexedDb's RemoteDocumentCache.\n // TODO(#2149): Remove this when Emulator is fixed\n n = ye(e));\n var r = null;\n return t.transformResults && t.transformResults.length > 0 && (r = t.transformResults), \n new nn(n, r);\n }(t, e);\n }))) : [];\n }(t.writeResults, t.commitTime), n = ye(t.commitTime);\n return this.listener.Nc(n, e);\n }\n // The first response is always the handshake response\n return x(!t.writeResults || 0 === t.writeResults.length), this.Sc = !0, \n this.listener.xc();\n }, \n /**\n * Sends an initial streamToken to the server, performing the handshake\n * required to make the StreamingWrite RPC work. Subsequent\n * calls should wait until onHandshakeComplete was called.\n */\n n.prototype.Fc = function() {\n // TODO(dimond): Support stream resumption. We intentionally do not set the\n // stream token on the handshake, ignoring any stream token we might have.\n var t = {};\n t.database = _e(this.serializer), this.wc(t);\n }, \n /** Sends a group of mutations to the Firestore backend to apply. */ n.prototype.Cc = function(t) {\n var e = this, n = {\n streamToken: this.lastStreamToken,\n writes: t.map((function(t) {\n return Ae(e.serializer, t);\n }))\n };\n this.wc(n);\n }, n;\n}(xo), Oo = /** @class */ function(e) {\n function n(t, n, r) {\n var i = this;\n return (i = e.call(this) || this).credentials = t, i.rc = n, i.serializer = r, i.kc = !1, \n i;\n }\n return t(n, e), n.prototype.Oc = function() {\n if (this.kc) throw new I(b.FAILED_PRECONDITION, \"The client has already been terminated.\");\n }, \n /** Gets an auth token and invokes the provided RPC. */ n.prototype.Mc = function(t, e, n) {\n var r = this;\n return this.Oc(), this.credentials.getToken().then((function(i) {\n return r.rc.Mc(t, e, n, i);\n })).catch((function(t) {\n throw t.code === b.UNAUTHENTICATED && r.credentials.Hh(), t;\n }));\n }, \n /** Gets an auth token and invokes the provided RPC with streamed results. */ n.prototype.$c = function(t, e, n) {\n var r = this;\n return this.Oc(), this.credentials.getToken().then((function(i) {\n return r.rc.$c(t, e, n, i);\n })).catch((function(t) {\n throw t.code === b.UNAUTHENTICATED && r.credentials.Hh(), t;\n }));\n }, n.prototype.terminate = function() {\n this.kc = !1;\n }, n;\n}((function() {})), Lo = /** @class */ function() {\n function t(t, e) {\n this.hs = t, this.di = e, \n /** The current OnlineState. */\n this.state = \"Unknown\" /* Unknown */ , \n /**\n * A count of consecutive failures to open the stream. If it reaches the\n * maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to\n * Offline.\n */\n this.Lc = 0, \n /**\n * A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we\n * transition from OnlineState.Unknown to OnlineState.Offline without waiting\n * for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).\n */\n this.Bc = null, \n /**\n * Whether the client should log a warning message if it fails to connect to\n * the backend (initially true, cleared after a successful stream, or if we've\n * logged the message already).\n */\n this.qc = !0\n /**\n * Called by RemoteStore when a watch stream is started (including on each\n * backoff attempt).\n *\n * If this is the first attempt, it sets the OnlineState to Unknown and starts\n * the onlineStateTimer.\n */;\n }\n return t.prototype.Uc = function() {\n var t = this;\n 0 === this.Lc && (this.Kc(\"Unknown\" /* Unknown */), this.Bc = this.hs.Vn(\"online_state_timeout\" /* OnlineStateTimeout */ , 1e4, (function() {\n return t.Bc = null, t.Qc(\"Backend didn't respond within 10 seconds.\"), t.Kc(\"Offline\" /* Offline */), \n Promise.resolve();\n })));\n }, \n /**\n * Updates our OnlineState as appropriate after the watch stream reports a\n * failure. The first failure moves us to the 'Unknown' state. We then may\n * allow multiple failures (based on MAX_WATCH_STREAM_FAILURES) before we\n * actually transition to the 'Offline' state.\n */\n t.prototype.Wc = function(t) {\n \"Online\" /* Online */ === this.state ? this.Kc(\"Unknown\" /* Unknown */) : (this.Lc++, \n this.Lc >= 1 && (this.jc(), this.Qc(\"Connection failed 1 times. Most recent error: \" + t.toString()), \n this.Kc(\"Offline\" /* Offline */)));\n }, \n /**\n * Explicitly sets the OnlineState to the specified state.\n *\n * Note that this resets our timers / failure counters, etc. used by our\n * Offline heuristics, so must not be used in place of\n * handleWatchStreamStart() and handleWatchStreamFailure().\n */\n t.prototype.set = function(t) {\n this.jc(), this.Lc = 0, \"Online\" /* Online */ === t && (\n // We've connected to watch at least once. Don't warn the developer\n // about being offline going forward.\n this.qc = !1), this.Kc(t);\n }, t.prototype.Kc = function(t) {\n t !== this.state && (this.state = t, this.di(t));\n }, t.prototype.Qc = function(t) {\n var e = \"Could not reach Cloud Firestore backend. \" + t + \"\\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.\";\n this.qc ? (N(e), this.qc = !1) : T(\"OnlineStateTracker\", e);\n }, t.prototype.jc = function() {\n null !== this.Bc && (this.Bc.cancel(), this.Bc = null);\n }, t;\n}(), Vo = function(\n/**\n * The local store, used to fill the write pipeline with outbound mutations.\n */\nt, \n/** The client-side proxy for interacting with the backend. */\nr, i, o, u) {\n var s = this;\n this.Gc = t, this.zc = r, this.hs = i, this.Hc = {}, \n /**\n * A list of up to MAX_PENDING_WRITES writes that we have fetched from the\n * LocalStore via fillWritePipeline() and have or will send to the write\n * stream.\n *\n * Whenever writePipeline.length > 0 the RemoteStore will attempt to start or\n * restart the write stream. When the stream is established the writes in the\n * pipeline will be sent in order.\n *\n * Writes remain in writePipeline until they are acknowledged by the backend\n * and thus will automatically be re-sent if the stream is interrupted /\n * restarted before they're acknowledged.\n *\n * Write responses from the backend are linked to their originating request\n * purely based on order, and so we can just shift() writes from the front of\n * the writePipeline as we receive responses.\n */\n this.Jc = [], \n /**\n * A mapping of watched targets that the client cares about tracking and the\n * user has explicitly called a 'listen' for this target.\n *\n * These targets may or may not have been sent to or acknowledged by the\n * server. On re-establishing the listen stream, these targets should be sent\n * to the server. The targets removed with unlistens are removed eagerly\n * without waiting for confirmation from the listen stream.\n */\n this.Yc = new Map, \n /**\n * A set of reasons for why the RemoteStore may be offline. If empty, the\n * RemoteStore may start its network connections.\n */\n this.Xc = new Set, \n /**\n * Event handlers that get called when the network is disabled or enabled.\n *\n * PORTING NOTE: These functions are used on the Web client to create the\n * underlying streams (to support tree-shakeable streams). On Android and iOS,\n * the streams are created during construction of RemoteStore.\n */\n this.Zc = [], this.tu = u, this.tu.eu((function(t) {\n i.ws((function() {\n return e(s, void 0, void 0, (function() {\n return n(this, (function(t) {\n switch (t.label) {\n case 0:\n return zo(this) ? (T(\"RemoteStore\", \"Restarting streams for network reachability change.\"), \n [ 4 /*yield*/ , function(t) {\n return e(this, void 0, void 0, (function() {\n var e;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return (e = k(t)).Xc.add(4 /* ConnectivityChange */), [ 4 /*yield*/ , Co(e) ];\n\n case 1:\n return n.sent(), e.nu.set(\"Unknown\" /* Unknown */), e.Xc.delete(4 /* ConnectivityChange */), \n [ 4 /*yield*/ , Ro(e) ];\n\n case 2:\n return n.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }(this) ]) : [ 3 /*break*/ , 2 ];\n\n case 1:\n t.sent(), t.label = 2;\n\n case 2:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }));\n })), this.nu = new Lo(i, o);\n};\n\nfunction Ro(t) {\n return e(this, void 0, void 0, (function() {\n var e, r;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n if (!zo(t)) return [ 3 /*break*/ , 4 ];\n e = 0, r = t.Zc, n.label = 1;\n\n case 1:\n return e < r.length ? [ 4 /*yield*/ , (0, r[e])(/* enabled= */ !0) ] : [ 3 /*break*/ , 4 ];\n\n case 2:\n n.sent(), n.label = 3;\n\n case 3:\n return e++, [ 3 /*break*/ , 1 ];\n\n case 4:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * Temporarily disables the network. The network can be re-enabled using\n * enableNetwork().\n */ function Co(t) {\n return e(this, void 0, void 0, (function() {\n var e, r;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = 0, r = t.Zc, n.label = 1;\n\n case 1:\n return e < r.length ? [ 4 /*yield*/ , (0, r[e])(/* enabled= */ !1) ] : [ 3 /*break*/ , 4 ];\n\n case 2:\n n.sent(), n.label = 3;\n\n case 3:\n return e++, [ 3 /*break*/ , 1 ];\n\n case 4:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction Uo(t) {\n return e(this, void 0, void 0, (function() {\n var e;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e = k(t), T(\"RemoteStore\", \"RemoteStore shutting down.\"), e.Xc.add(5 /* Shutdown */), \n [ 4 /*yield*/ , Co(e) ];\n\n case 1:\n return n.sent(), e.tu.Di(), \n // Set the OnlineState to Unknown (rather than Offline) to avoid potentially\n // triggering spurious listener events with cached data, etc.\n e.nu.set(\"Unknown\" /* Unknown */), [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * Starts new listen for the given target. Uses resume token if provided. It\n * is a no-op if the target of given `TargetData` is already being listened to.\n */ function Mo(t, e) {\n var n = k(t);\n n.Yc.has(e.targetId) || (\n // Mark this as something the client is currently listening for.\n n.Yc.set(e.targetId, e), Bo(n) ? \n // The listen will be sent in onWatchStreamOpen\n Go(n) : ou(n).uc() && Fo(n, e));\n}\n\n/**\n * Removes the listen from server. It is a no-op if the given target id is\n * not being listened to.\n */ function qo(t, e) {\n var n = k(t), r = ou(n);\n n.Yc.delete(e), r.uc() && jo(n, e), 0 === n.Yc.size && (r.uc() ? r.fc() : zo(n) && \n // Revert to OnlineState.Unknown if the watch stream is not open and we\n // have no listeners, since without any listens to send we cannot\n // confirm if the stream is healthy and upgrade to OnlineState.Online.\n n.nu.set(\"Unknown\" /* Unknown */));\n}\n\n/**\n * We need to increment the the expected number of pending responses we're due\n * from watch so we wait for the ack to process any messages from this target.\n */ function Fo(t, e) {\n t.su.me(e.targetId), ou(t).bc(e)\n /**\n * We need to increment the expected number of pending responses we're due\n * from watch so we wait for the removal on the server before we process any\n * messages from this target.\n */;\n}\n\nfunction jo(t, e) {\n t.su.me(e), ou(t).vc(e);\n}\n\nfunction Go(t) {\n t.su = new Mt({\n qe: function(e) {\n return t.Hc.qe(e);\n },\n Ue: function(e) {\n return t.Yc.get(e) || null;\n }\n }), ou(t).start(), t.nu.Uc()\n /**\n * Returns whether the watch stream should be started because it's necessary\n * and has not yet been started.\n */;\n}\n\nfunction Bo(t) {\n return zo(t) && !ou(t).cc() && t.Yc.size > 0;\n}\n\nfunction zo(t) {\n return 0 === k(t).Xc.size;\n}\n\nfunction Ko(t) {\n t.su = void 0;\n}\n\nfunction Wo(t) {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(e) {\n return t.Yc.forEach((function(e, n) {\n Fo(t, e);\n })), [ 2 /*return*/ ];\n }));\n }));\n}\n\nfunction Qo(t, r) {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(e) {\n return Ko(t), \n // If we still need the watch stream, retry the connection.\n Bo(t) ? (t.nu.Wc(r), Go(t)) : \n // No need to restart watch stream because there are no active targets.\n // The online state is set to unknown because there is no active attempt\n // at establishing a connection\n t.nu.set(\"Unknown\" /* Unknown */), [ 2 /*return*/ ];\n }));\n }));\n}\n\nfunction Ho(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var o, u, s;\n return n(this, (function(a) {\n switch (a.label) {\n case 0:\n if (t.nu.set(\"Online\" /* Online */), !(r instanceof Ct && 2 /* Removed */ === r.state && r.cause)) \n // Mark the client as online since we got a message from the server\n return [ 3 /*break*/ , 6 ];\n a.label = 1;\n\n case 1:\n return a.trys.push([ 1, 3, , 5 ]), [ 4 /*yield*/ , \n /** Handles an error on a target */\n function(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = r.cause, i = 0, o = r.targetIds, n.label = 1;\n\n case 1:\n return i < o.length ? (u = o[i], t.Yc.has(u) ? [ 4 /*yield*/ , t.Hc.iu(u, e) ] : [ 3 /*break*/ , 3 ]) : [ 3 /*break*/ , 5 ];\n\n case 2:\n n.sent(), t.Yc.delete(u), t.su.removeTarget(u), n.label = 3;\n\n case 3:\n n.label = 4;\n\n case 4:\n return i++, [ 3 /*break*/ , 1 ];\n\n case 5:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }(t, r) ];\n\n case 2:\n return a.sent(), [ 3 /*break*/ , 5 ];\n\n case 3:\n return o = a.sent(), T(\"RemoteStore\", \"Failed to remove targets %s: %s \", r.targetIds.join(\",\"), o), \n [ 4 /*yield*/ , Yo(t, o) ];\n\n case 4:\n return a.sent(), [ 3 /*break*/ , 5 ];\n\n case 5:\n return [ 3 /*break*/ , 13 ];\n\n case 6:\n if (r instanceof Vt ? t.su.be(r) : r instanceof Rt ? t.su.ke(r) : t.su.De(r), i.isEqual(H.min())) return [ 3 /*break*/ , 13 ];\n a.label = 7;\n\n case 7:\n return a.trys.push([ 7, 11, , 13 ]), [ 4 /*yield*/ , fo(t.Gc) ];\n\n case 8:\n return u = a.sent(), i.h(u) >= 0 ? [ 4 /*yield*/ , \n /**\n * Takes a batch of changes from the Datastore, repackages them as a\n * RemoteEvent, and passes that on to the listener, which is typically the\n * SyncEngine.\n */\n function(t, e) {\n var n = t.su.$e(e);\n // Update in-memory resume tokens. LocalStore will update the\n // persistent view of these when applying the completed RemoteEvent.\n return n.zt.forEach((function(n, r) {\n if (n.resumeToken.o() > 0) {\n var i = t.Yc.get(r);\n // A watched target might have been removed already.\n i && t.Yc.set(r, i.it(n.resumeToken, e));\n }\n })), \n // Re-establish listens for the targets that have been invalidated by\n // existence filter mismatches.\n n.Ht.forEach((function(e) {\n var n = t.Yc.get(e);\n if (n) {\n // Clear the resume token for the target, since we're in a known mismatch\n // state.\n t.Yc.set(e, n.it(C.u, n.nt)), \n // Cause a hard reset by unwatching and rewatching immediately, but\n // deliberately don't send a resume token so that we get a full update.\n jo(t, e);\n // Mark the target we send as being on behalf of an existence filter\n // mismatch, but don't actually retain that in listenTargets. This ensures\n // that we flag the first re-listen this way without impacting future\n // listens of this target (that might happen e.g. on reconnect).\n var r = new ht(n.target, e, 1 /* ExistenceFilterMismatch */ , n.sequenceNumber);\n Fo(t, r);\n }\n })), t.Hc.ru(n);\n }(t, i) ] : [ 3 /*break*/ , 10 ];\n\n // We have received a target change with a global snapshot if the snapshot\n // version is not equal to SnapshotVersion.min().\n case 9:\n // We have received a target change with a global snapshot if the snapshot\n // version is not equal to SnapshotVersion.min().\n a.sent(), a.label = 10;\n\n case 10:\n return [ 3 /*break*/ , 13 ];\n\n case 11:\n return T(\"RemoteStore\", \"Failed to raise snapshot:\", s = a.sent()), [ 4 /*yield*/ , Yo(t, s) ];\n\n case 12:\n return a.sent(), [ 3 /*break*/ , 13 ];\n\n case 13:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * Recovery logic for IndexedDB errors that takes the network offline until\n * `op` succeeds. Retries are scheduled with backoff using\n * `enqueueRetryable()`. If `op()` is not provided, IndexedDB access is\n * validated via a generic operation.\n *\n * The returned Promise is resolved once the network is disabled and before\n * any retry attempt.\n */ function Yo(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var o = this;\n return n(this, (function(u) {\n switch (u.label) {\n case 0:\n if (!pr(r)) throw r;\n // Disable network and raise offline snapshots\n return t.Xc.add(1 /* IndexedDbFailed */), [ 4 /*yield*/ , Co(t) ];\n\n case 1:\n // Disable network and raise offline snapshots\n return u.sent(), t.nu.set(\"Offline\" /* Offline */), i || (\n // Use a simple read operation to determine if IndexedDB recovered.\n // Ideally, we would expose a health check directly on SimpleDb, but\n // RemoteStore only has access to persistence through LocalStore.\n i = function() {\n return fo(t.Gc);\n }), \n // Probe IndexedDB periodically and re-enable network\n t.hs.Cs((function() {\n return e(o, void 0, void 0, (function() {\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n return T(\"RemoteStore\", \"Retrying IndexedDB access\"), [ 4 /*yield*/ , i() ];\n\n case 1:\n return e.sent(), t.Xc.delete(1 /* IndexedDbFailed */), [ 4 /*yield*/ , Ro(t) ];\n\n case 2:\n return e.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n })), [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * Executes `op`. If `op` fails, takes the network offline until `op`\n * succeeds. Returns after the first attempt.\n */ function Xo(t, e) {\n return e().catch((function(n) {\n return Yo(t, n, e);\n }));\n}\n\nfunction Jo(t) {\n return e(this, void 0, void 0, (function() {\n var e, r, i, o, u;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = k(t), r = uu(e), i = e.Jc.length > 0 ? e.Jc[e.Jc.length - 1].batchId : -1, n.label = 1;\n\n case 1:\n if (!\n /**\n * Returns true if we can add to the write pipeline (i.e. the network is\n * enabled and the write pipeline is not full).\n */\n function(t) {\n return zo(t) && t.Jc.length < 10;\n }\n /**\n * Queues additional writes to be sent to the write stream, sending them\n * immediately if the write stream is established.\n */ (e)) return [ 3 /*break*/ , 7 ];\n n.label = 2;\n\n case 2:\n return n.trys.push([ 2, 4, , 6 ]), [ 4 /*yield*/ , po(e.Gc, i) ];\n\n case 3:\n return null === (o = n.sent()) ? (0 === e.Jc.length && r.fc(), [ 3 /*break*/ , 7 ]) : (i = o.batchId, \n function(t, e) {\n t.Jc.push(e);\n var n = uu(t);\n n.uc() && n.Dc && n.Cc(e.mutations);\n }(e, o), [ 3 /*break*/ , 6 ]);\n\n case 4:\n return u = n.sent(), [ 4 /*yield*/ , Yo(e, u) ];\n\n case 5:\n return n.sent(), [ 3 /*break*/ , 6 ];\n\n case 6:\n return [ 3 /*break*/ , 1 ];\n\n case 7:\n return $o(e) && Zo(e), [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction $o(t) {\n return zo(t) && !uu(t).cc() && t.Jc.length > 0;\n}\n\nfunction Zo(t) {\n uu(t).start();\n}\n\nfunction tu(t) {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(e) {\n return uu(t).Fc(), [ 2 /*return*/ ];\n }));\n }));\n}\n\nfunction eu(t) {\n return e(this, void 0, void 0, (function() {\n var e, r, i, o;\n return n(this, (function(n) {\n // Send the write pipeline now that the stream is established.\n for (e = uu(t), r = 0, i = t.Jc; r < i.length; r++) o = i[r], e.Cc(o.mutations);\n return [ 2 /*return*/ ];\n }));\n }));\n}\n\nfunction nu(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var e, o;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e = t.Jc.shift(), o = Kr.from(e, r, i), [ 4 /*yield*/ , Xo(t, (function() {\n return t.Hc.ou(o);\n })) ];\n\n case 1:\n // It's possible that with the completion of this mutation another\n // slot has freed up.\n return n.sent(), [ 4 /*yield*/ , Jo(t) ];\n\n case 2:\n // It's possible that with the completion of this mutation another\n // slot has freed up.\n return n.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction ru(t, r) {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(i) {\n switch (i.label) {\n case 0:\n return r && uu(t).Dc ? [ 4 /*yield*/ , function(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return lt(i = r.code) && i !== b.ABORTED ? (e = t.Jc.shift(), \n // In this case it's also unlikely that the server itself is melting\n // down -- this was just a bad request so inhibit backoff on the next\n // restart.\n uu(t)._c(), [ 4 /*yield*/ , Xo(t, (function() {\n return t.Hc.au(e.batchId, r);\n })) ]) : [ 3 /*break*/ , 3 ];\n\n case 1:\n // It's possible that with the completion of this mutation\n // another slot has freed up.\n return n.sent(), [ 4 /*yield*/ , Jo(t) ];\n\n case 2:\n // In this case it's also unlikely that the server itself is melting\n // down -- this was just a bad request so inhibit backoff on the next\n // restart.\n // It's possible that with the completion of this mutation\n // another slot has freed up.\n n.sent(), n.label = 3;\n\n case 3:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }(t, r) ] : [ 3 /*break*/ , 2 ];\n\n // This error affects the actual write.\n case 1:\n // This error affects the actual write.\n i.sent(), i.label = 2;\n\n case 2:\n // If the write stream closed after the write handshake completes, a write\n // operation failed and we fail the pending operation.\n // The write stream might have been started by refilling the write\n // pipeline for failed writes\n return $o(t) && Zo(t), [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * Toggles the network state when the client gains or loses its primary lease.\n */ function iu(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e = k(t), r ? (e.Xc.delete(2 /* IsSecondary */), [ 4 /*yield*/ , Ro(e) ]) : [ 3 /*break*/ , 2 ];\n\n case 1:\n return n.sent(), [ 3 /*break*/ , 5 ];\n\n case 2:\n return (i = r) ? [ 3 /*break*/ , 4 ] : (e.Xc.add(2 /* IsSecondary */), [ 4 /*yield*/ , Co(e) ]);\n\n case 3:\n n.sent(), i = e.nu.set(\"Unknown\" /* Unknown */), n.label = 4;\n\n case 4:\n i, n.label = 5;\n\n case 5:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * If not yet initialized, registers the WatchStream and its network state\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\n * already available.\n *\n * PORTING NOTE: On iOS and Android, the WatchStream gets registered on startup.\n * This is not done on Web to allow it to be tree-shaken.\n */ function ou(t) {\n var r = this;\n return t.hu || (\n // Create stream (but note that it is not started yet).\n t.hu = function(t, e, n) {\n var r = k(t);\n return r.Oc(), new ko(e, r.rc, r.credentials, r.serializer, n);\n }(t.zc, t.hs, {\n gc: Wo.bind(null, t),\n Ic: Qo.bind(null, t),\n yc: Ho.bind(null, t)\n }), t.Zc.push((function(i) {\n return e(r, void 0, void 0, (function() {\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n return i ? (t.hu._c(), Bo(t) ? Go(t) : t.nu.set(\"Unknown\" /* Unknown */), [ 3 /*break*/ , 3 ]) : [ 3 /*break*/ , 1 ];\n\n case 1:\n return [ 4 /*yield*/ , t.hu.stop() ];\n\n case 2:\n e.sent(), Ko(t), e.label = 3;\n\n case 3:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }))), t.hu\n /**\n * If not yet initialized, registers the WriteStream and its network state\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\n * already available.\n *\n * PORTING NOTE: On iOS and Android, the WriteStream gets registered on startup.\n * This is not done on Web to allow it to be tree-shaken.\n */;\n}\n\nfunction uu(t) {\n var r = this;\n return t.cu || (\n // Create stream (but note that it is not started yet).\n t.cu = function(t, e, n) {\n var r = k(t);\n return r.Oc(), new Po(e, r.rc, r.credentials, r.serializer, n);\n }(t.zc, t.hs, {\n gc: tu.bind(null, t),\n Ic: ru.bind(null, t),\n xc: eu.bind(null, t),\n Nc: nu.bind(null, t)\n }), t.Zc.push((function(i) {\n return e(r, void 0, void 0, (function() {\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n return i ? (t.cu._c(), [ 4 /*yield*/ , Jo(t) ]) : [ 3 /*break*/ , 2 ];\n\n case 1:\n // This will start the write stream if necessary.\n return e.sent(), [ 3 /*break*/ , 4 ];\n\n case 2:\n return [ 4 /*yield*/ , t.cu.stop() ];\n\n case 3:\n e.sent(), t.Jc.length > 0 && (T(\"RemoteStore\", \"Stopping write stream with \" + t.Jc.length + \" pending writes\"), \n t.Jc = []), e.label = 4;\n\n case 4:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }))), t.cu\n /**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */;\n}\n\nvar su = function(t) {\n this.key = t;\n}, au = function(t) {\n this.key = t;\n}, cu = /** @class */ function() {\n function t(t, \n /** Documents included in the remote target */\n e) {\n this.query = t, this.uu = e, this.lu = null, \n /**\n * A flag whether the view is current with the backend. A view is considered\n * current after it has seen the current flag from the backend and did not\n * lose consistency within the watch stream (e.g. because of an existence\n * filter mismatch).\n */\n this.te = !1, \n /** Documents in the view but not in the remote target */\n this._u = At(), \n /** Document Keys that have local changes */\n this.Qt = At(), this.fu = zn(t), this.du = new xt(this.fu);\n }\n return Object.defineProperty(t.prototype, \"wu\", {\n /**\n * The set of remote documents that the server has told us belongs to the target associated with\n * this view.\n */\n get: function() {\n return this.uu;\n },\n enumerable: !1,\n configurable: !0\n }), \n /**\n * Iterates over a set of doc changes, applies the query limit, and computes\n * what the new results should be, what the changes were, and whether we may\n * need to go back to the local cache for more results. Does not make any\n * changes to the view.\n * @param docChanges The doc changes to apply to this view.\n * @param previousChanges If this is being called with a refill, then start\n * with this set of docs and changes instead of the current view.\n * @return a new set of docs, changes, and refill flag.\n */\n t.prototype.Eu = function(t, e) {\n var n = this, r = e ? e.Tu : new kt, i = e ? e.du : this.du, o = e ? e.Qt : this.Qt, u = i, s = !1, a = kn(this.query) && i.size === this.query.limit ? i.last() : null, c = Pn(this.query) && i.size === this.query.limit ? i.first() : null;\n // Drop documents out to meet limit/limitToLast requirement.\n if (t.ut((function(t, e) {\n var h = i.get(t), f = e instanceof Tn ? e : null;\n f && (f = Bn(n.query, f) ? f : null);\n var l = !!h && n.Qt.has(h.key), p = !!f && (f.Ye || \n // We only consider committed mutations for documents that were\n // mutated during the lifetime of the view.\n n.Qt.has(f.key) && f.hasCommittedMutations), d = !1;\n // Calculate change\n h && f ? h.data().isEqual(f.data()) ? l !== p && (r.track({\n type: 3 /* Metadata */ ,\n doc: f\n }), d = !0) : n.Iu(h, f) || (r.track({\n type: 2 /* Modified */ ,\n doc: f\n }), d = !0, (a && n.fu(f, a) > 0 || c && n.fu(f, c) < 0) && (\n // This doc moved from inside the limit to outside the limit.\n // That means there may be some other doc in the local cache\n // that should be included instead.\n s = !0)) : !h && f ? (r.track({\n type: 0 /* Added */ ,\n doc: f\n }), d = !0) : h && !f && (r.track({\n type: 1 /* Removed */ ,\n doc: h\n }), d = !0, (a || c) && (\n // A doc was removed from a full limit query. We'll need to\n // requery from the local cache to see if we know about some other\n // doc that should be in the results.\n s = !0)), d && (f ? (u = u.add(f), o = p ? o.add(t) : o.delete(t)) : (u = u.delete(t), \n o = o.delete(t)));\n })), kn(this.query) || Pn(this.query)) for (;u.size > this.query.limit; ) {\n var h = kn(this.query) ? u.last() : u.first();\n u = u.delete(h.key), o = o.delete(h.key), r.track({\n type: 1 /* Removed */ ,\n doc: h\n });\n }\n return {\n du: u,\n Tu: r,\n mu: s,\n Qt: o\n };\n }, t.prototype.Iu = function(t, e) {\n // We suppress the initial change event for documents that were modified as\n // part of a write acknowledgment (e.g. when the value of a server transform\n // is applied) as Watch will send us the same document again.\n // By suppressing the event, we only raise two user visible events (one with\n // `hasPendingWrites` and the final state of the document) instead of three\n // (one with `hasPendingWrites`, the modified document with\n // `hasPendingWrites` and the final state of the document).\n return t.Ye && e.hasCommittedMutations && !e.Ye;\n }, \n /**\n * Updates the view with the given ViewDocumentChanges and optionally updates\n * limbo docs and sync state from the provided target change.\n * @param docChanges The set of changes to make to the view's docs.\n * @param updateLimboDocuments Whether to update limbo documents based on this\n * change.\n * @param targetChange A target change to apply for computing limbo docs and\n * sync state.\n * @return A new ViewChange with the given docs, changes, and sync state.\n */\n // PORTING NOTE: The iOS/Android clients always compute limbo document changes.\n t.prototype.Vr = function(t, e, n) {\n var r = this, i = this.du;\n this.du = t.du, this.Qt = t.Qt;\n // Sort changes based on type and query comparator\n var o = t.Tu.Ut();\n o.sort((function(t, e) {\n return function(t, e) {\n var n = function(t) {\n switch (t) {\n case 0 /* Added */ :\n return 1;\n\n case 2 /* Modified */ :\n case 3 /* Metadata */ :\n // A metadata change is converted to a modified change at the public\n // api layer. Since we sort by document key and then change type,\n // metadata and modified changes must be sorted equivalently.\n return 2;\n\n case 1 /* Removed */ :\n return 0;\n\n default:\n return S();\n }\n };\n return n(t) - n(e);\n }(t.type, e.type) || r.fu(t.doc, e.doc);\n })), this.Au(n);\n var u = e ? this.Ru() : [], s = 0 === this._u.size && this.te ? 1 /* Synced */ : 0 /* Local */ , a = s !== this.lu;\n return this.lu = s, 0 !== o.length || a ? {\n snapshot: new Pt(this.query, t.du, i, o, t.Qt, 0 /* Local */ === s, a, \n /* excludesMetadataChanges= */ !1),\n Pu: u\n } : {\n Pu: u\n };\n // no changes\n }, \n /**\n * Applies an OnlineState change to the view, potentially generating a\n * ViewChange if the view's syncState changes as a result.\n */\n t.prototype.Ks = function(t) {\n return this.te && \"Offline\" /* Offline */ === t ? (\n // If we're offline, set `current` to false and then call applyChanges()\n // to refresh our syncState and generate a ViewChange as appropriate. We\n // are guaranteed to get a new TargetChange that sets `current` back to\n // true once the client is back online.\n this.te = !1, this.Vr({\n du: this.du,\n Tu: new kt,\n Qt: this.Qt,\n mu: !1\n }, \n /* updateLimboDocuments= */ !1)) : {\n Pu: []\n };\n }, \n /**\n * Returns whether the doc for the given key should be in limbo.\n */\n t.prototype.gu = function(t) {\n // If the remote end says it's part of this query, it's not in limbo.\n return !this.uu.has(t) && \n // The local store doesn't think it's a result, so it shouldn't be in limbo.\n !!this.du.has(t) && !this.du.get(t).Ye;\n }, \n /**\n * Updates syncedDocuments, current, and limbo docs based on the given change.\n * Returns the list of changes to which docs are in limbo.\n */\n t.prototype.Au = function(t) {\n var e = this;\n t && (t.ee.forEach((function(t) {\n return e.uu = e.uu.add(t);\n })), t.ne.forEach((function(t) {})), t.se.forEach((function(t) {\n return e.uu = e.uu.delete(t);\n })), this.te = t.te);\n }, t.prototype.Ru = function() {\n var t = this;\n // We can only determine limbo documents when we're in-sync with the server.\n if (!this.te) return [];\n // TODO(klimt): Do this incrementally so that it's not quadratic when\n // updating many documents.\n var e = this._u;\n this._u = At(), this.du.forEach((function(e) {\n t.gu(e.key) && (t._u = t._u.add(e.key));\n }));\n // Diff the new limbo docs with the old limbo docs.\n var n = [];\n return e.forEach((function(e) {\n t._u.has(e) || n.push(new au(e));\n })), this._u.forEach((function(t) {\n e.has(t) || n.push(new su(t));\n })), n;\n }, \n /**\n * Update the in-memory state of the current view with the state read from\n * persistence.\n *\n * We update the query view whenever a client's primary status changes:\n * - When a client transitions from primary to secondary, it can miss\n * LocalStorage updates and its query views may temporarily not be\n * synchronized with the state on disk.\n * - For secondary to primary transitions, the client needs to update the list\n * of `syncedDocuments` since secondary clients update their query views\n * based purely on synthesized RemoteEvents.\n *\n * @param queryResult.documents - The documents that match the query according\n * to the LocalStore.\n * @param queryResult.remoteKeys - The keys of the documents that match the\n * query according to the backend.\n *\n * @return The ViewChange that resulted from this synchronization.\n */\n // PORTING NOTE: Multi-tab only.\n t.prototype.Vu = function(t) {\n this.uu = t.Fh, this._u = At();\n var e = this.Eu(t.documents);\n return this.Vr(e, /*updateLimboDocuments=*/ !0);\n }, \n /**\n * Returns a view snapshot as if this query was just listened to. Contains\n * a document add for every existing document and the `fromCache` and\n * `hasPendingWrites` status of the already established view.\n */\n // PORTING NOTE: Multi-tab only.\n t.prototype.yu = function() {\n return Pt.Gt(this.query, this.du, this.Qt, 0 /* Local */ === this.lu);\n }, t;\n}(), hu = function(\n/**\n * The query itself.\n */\nt, \n/**\n * The target number created by the client that is used in the watch\n * stream to identify this query.\n */\ne, \n/**\n * The view is responsible for computing the final merged truth of what\n * docs are in the query. It gets notified of local and remote changes,\n * and applies the query filters and limits to determine the most correct\n * possible results.\n */\nn) {\n this.query = t, this.targetId = e, this.view = n;\n}, fu = function(t) {\n this.key = t, \n /**\n * Set to true once we've received a document. This is used in\n * getRemoteKeysForTarget() and ultimately used by WatchChangeAggregator to\n * decide whether it needs to manufacture a delete event for the target once\n * the target is CURRENT.\n */\n this.pu = !1;\n}, lu = /** @class */ function() {\n function t(t, e, n, \n // PORTING NOTE: Manages state synchronization in multi-tab environments.\n r, i, o) {\n this.Gc = t, this.bu = e, this.vu = n, this.Su = r, this.currentUser = i, this.Du = o, \n this.Cu = {}, this.Nu = new W((function(t) {\n return jn(t);\n }), Fn), this.xu = new Map, \n /**\n * The keys of documents that are in limbo for which we haven't yet started a\n * limbo resolution query.\n */\n this.Fu = [], \n /**\n * Keeps track of the target ID for each document that is in limbo with an\n * active target.\n */\n this.ku = new dt(Z.D), \n /**\n * Keeps track of the information about an active limbo resolution for each\n * active target ID that was started for the purpose of limbo resolution.\n */\n this.Ou = new Map, this.Mu = new Eo, \n /** Stores user completion handlers, indexed by User and BatchId. */\n this.$u = {}, \n /** Stores user callbacks waiting for all pending writes to be acknowledged. */\n this.Lu = new Map, this.Bu = Xi.da(), this.onlineState = \"Unknown\" /* Unknown */ , \n // The primary state is set to `true` or `false` immediately after Firestore\n // startup. In the interim, a client should only be considered primary if\n // `isPrimary` is true.\n this.qu = void 0;\n }\n return Object.defineProperty(t.prototype, \"Uu\", {\n get: function() {\n return !0 === this.qu;\n },\n enumerable: !1,\n configurable: !0\n }), t;\n}();\n\n/**\n * Initiates the new listen, resolves promise when listen enqueued to the\n * server. All the subsequent view snapshots or errors are sent to the\n * subscribed handlers. Returns the initial snapshot.\n */\nfunction pu(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u, s, a;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e = qu(t), (u = e.Nu.get(r)) ? (\n // PORTING NOTE: With Multi-Tab Web, it is possible that a query view\n // already exists when EventManager calls us for the first time. This\n // happens when the primary tab is already listening to this query on\n // behalf of another tab and the user of the primary also starts listening\n // to the query. EventManager will not have an assigned target ID in this\n // case and calls `listen` to obtain this ID.\n i = u.targetId, e.Su.$i(i), o = u.view.yu(), [ 3 /*break*/ , 4 ]) : [ 3 /*break*/ , 1 ];\n\n case 1:\n return [ 4 /*yield*/ , vo(e.Gc, Cn(r)) ];\n\n case 2:\n return s = n.sent(), a = e.Su.$i(s.targetId), i = s.targetId, [ 4 /*yield*/ , du(e, r, i, \"current\" === a) ];\n\n case 3:\n o = n.sent(), e.Uu && Mo(e.bu, s), n.label = 4;\n\n case 4:\n return [ 2 /*return*/ , o ];\n }\n }));\n }));\n}\n\n/**\n * Registers a view for a previously unknown query and computes its initial\n * snapshot.\n */ function du(t, r, i, o) {\n return e(this, void 0, void 0, (function() {\n var u, s, a, c, h, f;\n return n(this, (function(l) {\n switch (l.label) {\n case 0:\n // PORTING NOTE: On Web only, we inject the code that registers new Limbo\n // targets based on view changes. This allows us to only depend on Limbo\n // changes when user code includes queries.\n return t.Ku = function(r, i, o) {\n return function(t, r, i, o) {\n return e(this, void 0, void 0, (function() {\n var e, u, s;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e = r.view.Eu(i), e.mu ? [ 4 /*yield*/ , mo(t.Gc, r.query, \n /* usePreviousResults= */ !1).then((function(t) {\n var n = t.documents;\n return r.view.Eu(n, e);\n })) ] : [ 3 /*break*/ , 2 ];\n\n case 1:\n // The query has a limit and some docs were removed, so we need\n // to re-run the query against the local store to make sure we\n // didn't lose any good docs that had been past the limit.\n e = n.sent(), n.label = 2;\n\n case 2:\n return u = o && o.zt.get(r.targetId), s = r.view.Vr(e, \n /* updateLimboDocuments= */ t.Uu, u), [ 2 /*return*/ , (Nu(t, r.targetId, s.Pu), \n s.snapshot) ];\n }\n }));\n }));\n }(t, r, i, o);\n }, [ 4 /*yield*/ , mo(t.Gc, r, \n /* usePreviousResults= */ !0) ];\n\n case 1:\n return u = l.sent(), s = new cu(r, u.Fh), a = s.Eu(u.documents), c = Lt.Zt(i, o && \"Offline\" /* Offline */ !== t.onlineState), \n h = s.Vr(a, \n /* updateLimboDocuments= */ t.Uu, c), Nu(t, i, h.Pu), f = new hu(r, i, s), [ 2 /*return*/ , (t.Nu.set(r, f), \n t.xu.has(i) ? t.xu.get(i).push(r) : t.xu.set(i, [ r ]), h.snapshot) ];\n }\n }));\n }));\n}\n\n/** Stops listening to the query. */ function vu(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e = k(t), i = e.Nu.get(r), (o = e.xu.get(i.targetId)).length > 1 ? [ 2 /*return*/ , (e.xu.set(i.targetId, o.filter((function(t) {\n return !Fn(t, r);\n }))), void e.Nu.delete(r)) ] : e.Uu ? (\n // We need to remove the local query target first to allow us to verify\n // whether any other client is still interested in this target.\n e.Su.Bi(i.targetId), e.Su.xi(i.targetId) ? [ 3 /*break*/ , 2 ] : [ 4 /*yield*/ , yo(e.Gc, i.targetId, \n /*keepPersistedTargetData=*/ !1).then((function() {\n e.Su.Ui(i.targetId), qo(e.bu, i.targetId), _u(e, i.targetId);\n })).catch(Io) ]) : [ 3 /*break*/ , 3 ];\n\n case 1:\n n.sent(), n.label = 2;\n\n case 2:\n return [ 3 /*break*/ , 5 ];\n\n case 3:\n return _u(e, i.targetId), [ 4 /*yield*/ , yo(e.Gc, i.targetId, \n /*keepPersistedTargetData=*/ !0) ];\n\n case 4:\n n.sent(), n.label = 5;\n\n case 5:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * Initiates the write of local mutation batch which involves adding the\n * writes to the mutation queue, notifying the remote store about new\n * mutations and raising events for any changes this write caused.\n *\n * The promise returned by this call is resolved when the above steps\n * have completed, *not* when the write was acked by the backend. The\n * userCallback is resolved once the write was acked/rejected by the\n * backend (or failed locally for any other reason).\n */\n/**\n * Applies one remote event to the sync engine, notifying any views of the\n * changes, and releasing any pending mutation batches that would become\n * visible because of the snapshot version the remote event contains.\n */\nfunction yu(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = k(t), n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 4, , 6 ]), [ 4 /*yield*/ , lo(e.Gc, r) ];\n\n case 2:\n return i = n.sent(), \n // Update `receivedDocument` as appropriate for any limbo targets.\n r.zt.forEach((function(t, n) {\n var r = e.Ou.get(n);\n r && (\n // Since this is a limbo resolution lookup, it's for a single document\n // and it could be added, modified, or removed, but not a combination.\n x(t.ee.size + t.ne.size + t.se.size <= 1), t.ee.size > 0 ? r.pu = !0 : t.ne.size > 0 ? x(r.pu) : t.se.size > 0 && (x(r.pu), \n r.pu = !1));\n })), [ 4 /*yield*/ , Su(e, i, r) ];\n\n case 3:\n // Update `receivedDocument` as appropriate for any limbo targets.\n return n.sent(), [ 3 /*break*/ , 6 ];\n\n case 4:\n return [ 4 /*yield*/ , Io(n.sent()) ];\n\n case 5:\n return n.sent(), [ 3 /*break*/ , 6 ];\n\n case 6:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * Applies an OnlineState change to the sync engine and notifies any views of\n * the change.\n */ function mu(t, e, n) {\n var r = k(t);\n // If we are the secondary client, we explicitly ignore the remote store's\n // online state (the local client may go offline, even though the primary\n // tab remains online) and only apply the primary tab's online state from\n // SharedClientState.\n if (r.Uu && 0 /* RemoteStore */ === n || !r.Uu && 1 /* SharedClientState */ === n) {\n var i = [];\n r.Nu.forEach((function(t, n) {\n var r = n.view.Ks(e);\n r.snapshot && i.push(r.snapshot);\n })), function(t, e) {\n var n = k(t);\n n.onlineState = e;\n var r = !1;\n n.Bs.forEach((function(t, n) {\n for (var i = 0, o = n.listeners; i < o.length; i++) {\n // Run global snapshot listeners if a consistent snapshot has been emitted.\n o[i].Ks(e) && (r = !0);\n }\n })), r && kr(n);\n }(r.vu, e), i.length && r.Cu.yc(i), r.onlineState = e, r.Uu && r.Su.ji(e);\n }\n}\n\n/**\n * Rejects the listen for the given targetID. This can be triggered by the\n * backend for any active target.\n *\n * @param syncEngine The sync engine implementation.\n * @param targetId The targetID corresponds to one previously initiated by the\n * user as part of TargetData passed to listen() on RemoteStore.\n * @param err A description of the condition that has forced the rejection.\n * Nearly always this will be an indication that the user is no longer\n * authorized to see the data matching the target.\n */ function gu(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var e, o, u, s, a, c;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n // PORTING NOTE: Multi-tab only.\n return (e = k(t)).Su.Ki(r, \"rejected\", i), o = e.Ou.get(r), (u = o && o.key) ? (s = (s = new dt(Z.D)).ot(u, new Nn(u, H.min())), \n a = At().add(u), c = new Ot(H.min(), \n /* targetChanges= */ new Map, \n /* targetMismatches= */ new mt(L), s, a), [ 4 /*yield*/ , yu(e, c) ]) : [ 3 /*break*/ , 2 ];\n\n case 1:\n return n.sent(), \n // Since this query failed, we won't want to manually unlisten to it.\n // We only remove it from bookkeeping after we successfully applied the\n // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to\n // this query when the RemoteStore restarts the Watch stream, which should\n // re-trigger the target failure.\n e.ku = e.ku.remove(u), e.Ou.delete(r), Du(e), [ 3 /*break*/ , 4 ];\n\n case 2:\n return [ 4 /*yield*/ , yo(e.Gc, r, \n /* keepPersistedTargetData */ !1).then((function() {\n return _u(e, r, i);\n })).catch(Io) ];\n\n case 3:\n n.sent(), n.label = 4;\n\n case 4:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction wu(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = k(t), i = r.batch.batchId, n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 4, , 6 ]), [ 4 /*yield*/ , ho(e.Gc, r) ];\n\n case 2:\n return o = n.sent(), \n // The local store may or may not be able to apply the write result and\n // raise events immediately (depending on whether the watcher is caught\n // up), so we raise user callbacks first so that they consistently happen\n // before listen events.\n Eu(e, i, /*error=*/ null), Iu(e, i), e.Su.Oi(i, \"acknowledged\"), [ 4 /*yield*/ , Su(e, o) ];\n\n case 3:\n // The local store may or may not be able to apply the write result and\n // raise events immediately (depending on whether the watcher is caught\n // up), so we raise user callbacks first so that they consistently happen\n // before listen events.\n return n.sent(), [ 3 /*break*/ , 6 ];\n\n case 4:\n return [ 4 /*yield*/ , Io(n.sent()) ];\n\n case 5:\n return n.sent(), [ 3 /*break*/ , 6 ];\n\n case 6:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction bu(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var e, o;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = k(t), n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 4, , 6 ]), [ 4 /*yield*/ , function(t, e) {\n var n = k(t);\n return n.persistence.runTransaction(\"Reject batch\", \"readwrite-primary\", (function(t) {\n var r;\n return n.Sr.$o(t, e).next((function(e) {\n return x(null !== e), r = e.keys(), n.Sr.Qo(t, e);\n })).next((function() {\n return n.Sr.zo(t);\n })).next((function() {\n return n.Nh.Or(t, r);\n }));\n }));\n }(e.Gc, r) ];\n\n case 2:\n return o = n.sent(), \n // The local store may or may not be able to apply the write result and\n // raise events immediately (depending on whether the watcher is caught up),\n // so we raise user callbacks first so that they consistently happen before\n // listen events.\n Eu(e, r, i), Iu(e, r), e.Su.Oi(r, \"rejected\", i), [ 4 /*yield*/ , Su(e, o) ];\n\n case 3:\n // The local store may or may not be able to apply the write result and\n // raise events immediately (depending on whether the watcher is caught up),\n // so we raise user callbacks first so that they consistently happen before\n // listen events.\n return n.sent(), [ 3 /*break*/ , 6 ];\n\n case 4:\n return [ 4 /*yield*/ , Io(n.sent()) ];\n\n case 5:\n return n.sent(), [ 3 /*break*/ , 6 ];\n\n case 6:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * Registers a user callback that resolves when all pending mutations at the moment of calling\n * are acknowledged .\n */\n/**\n * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,\n * if there are any.\n */\nfunction Iu(t, e) {\n (t.Lu.get(e) || []).forEach((function(t) {\n t.resolve();\n })), t.Lu.delete(e)\n /** Reject all outstanding callbacks waiting for pending writes to complete. */;\n}\n\nfunction Eu(t, e, n) {\n var r = k(t), i = r.$u[r.currentUser.ti()];\n // NOTE: Mutations restored from persistence won't have callbacks, so it's\n // okay for there to be no callback for this ID.\n if (i) {\n var o = i.get(e);\n o && (n ? o.reject(n) : o.resolve(), i = i.remove(e)), r.$u[r.currentUser.ti()] = i;\n }\n}\n\nfunction _u(t, e, n) {\n void 0 === n && (n = null), t.Su.Bi(e);\n for (var r = 0, i = t.xu.get(e); r < i.length; r++) {\n var o = i[r];\n t.Nu.delete(o), n && t.Cu.Qu(o, n);\n }\n t.xu.delete(e), t.Uu && t.Mu.Kh(e).forEach((function(e) {\n t.Mu.Ho(e) || \n // We removed the last reference for this key\n Tu(t, e);\n }));\n}\n\nfunction Tu(t, e) {\n // It's possible that the target already got removed because the query failed. In that case,\n // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.\n var n = t.ku.get(e);\n null !== n && (qo(t.bu, n), t.ku = t.ku.remove(e), t.Ou.delete(n), Du(t));\n}\n\nfunction Nu(t, e, n) {\n for (var r = 0, i = n; r < i.length; r++) {\n var o = i[r];\n o instanceof su ? (t.Mu.Da(o.key, e), Au(t, o)) : o instanceof au ? (T(\"SyncEngine\", \"Document no longer in limbo: \" + o.key), \n t.Mu.Na(o.key, e), t.Mu.Ho(o.key) || \n // We removed the last reference for this key\n Tu(t, o.key)) : S();\n }\n}\n\nfunction Au(t, e) {\n var n = e.key;\n t.ku.get(n) || (T(\"SyncEngine\", \"New document in limbo: \" + n), t.Fu.push(n), Du(t));\n}\n\n/**\n * Starts listens for documents in limbo that are enqueued for resolution,\n * subject to a maximum number of concurrent resolutions.\n *\n * Without bounding the number of concurrent resolutions, the server can fail\n * with \"resource exhausted\" errors which can lead to pathological client\n * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.\n */ function Du(t) {\n for (;t.Fu.length > 0 && t.ku.size < t.Du; ) {\n var e = t.Fu.shift(), n = t.Bu.next();\n t.Ou.set(n, new fu(e)), t.ku = t.ku.ot(e, n), Mo(t.bu, new ht(Cn(xn(e.path)), n, 2 /* LimboResolution */ , Lr.ai));\n }\n}\n\nfunction Su(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var o, u, s, a;\n return n(this, (function(c) {\n switch (c.label) {\n case 0:\n return o = k(t), u = [], s = [], a = [], o.Nu.P() ? [ 3 /*break*/ , 3 ] : (o.Nu.forEach((function(t, e) {\n a.push(o.Ku(e, r, i).then((function(t) {\n if (t) {\n o.Uu && o.Su.Ki(e.targetId, t.fromCache ? \"not-current\" : \"current\"), u.push(t);\n var n = Xr.zr(e.targetId, t);\n s.push(n);\n }\n })));\n })), [ 4 /*yield*/ , Promise.all(a) ]);\n\n case 1:\n return c.sent(), o.Cu.yc(u), [ 4 /*yield*/ , function(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u, s, a, c, h, f;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = k(t), n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 3, , 4 ]), [ 4 /*yield*/ , e.persistence.runTransaction(\"notifyLocalViewChanges\", \"readwrite\", (function(t) {\n return cr.forEach(r, (function(n) {\n return cr.forEach(n.jr, (function(r) {\n return e.persistence.No.Da(t, n.targetId, r);\n })).next((function() {\n return cr.forEach(n.Gr, (function(r) {\n return e.persistence.No.Na(t, n.targetId, r);\n }));\n }));\n }));\n })) ];\n\n case 2:\n return n.sent(), [ 3 /*break*/ , 4 ];\n\n case 3:\n if (!pr(i = n.sent())) throw i;\n // If `notifyLocalViewChanges` fails, we did not advance the sequence\n // number for the documents that were included in this transaction.\n // This might trigger them to be deleted earlier than they otherwise\n // would have, but it should not invalidate the integrity of the data.\n return T(\"LocalStore\", \"Failed to update sequence numbers: \" + i), \n [ 3 /*break*/ , 4 ];\n\n case 4:\n for (o = 0, u = r; o < u.length; o++) s = u[o], a = s.targetId, s.fromCache || (c = e.bh.get(a), \n h = c.nt, f = c.rt(h), \n // Advance the last limbo free snapshot version\n e.bh = e.bh.ot(a, f));\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }(o.Gc, s) ];\n\n case 2:\n c.sent(), c.label = 3;\n\n case 3:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction xu(t, r) {\n return e(this, void 0, void 0, (function() {\n var i, o;\n return n(this, (function(u) {\n switch (u.label) {\n case 0:\n return (i = k(t)).currentUser.isEqual(r) ? [ 3 /*break*/ , 3 ] : (T(\"SyncEngine\", \"User change. New user:\", r.ti()), \n [ 4 /*yield*/ , \n /**\n * Tells the LocalStore that the currently authenticated user has changed.\n *\n * In response the local store switches the mutation queue to the new user and\n * returns any resulting document changes.\n */\n // PORTING NOTE: Android and iOS only return the documents affected by the\n // change.\n function(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e = k(t), i = e.Sr, o = e.Nh, [ 4 /*yield*/ , e.persistence.runTransaction(\"Handle user change\", \"readonly\", (function(t) {\n // Swap out the mutation queue, grabbing the pending mutation batches\n // before and after.\n var n;\n return e.Sr.Uo(t).next((function(u) {\n return n = u, i = e.persistence.Th(r), \n // Recreate our LocalDocumentsView using the new\n // MutationQueue.\n o = new Yr(e.Ch, i, e.persistence.Ah()), i.Uo(t);\n })).next((function(e) {\n for (var r = [], i = [], u = At(), s = 0, a = n\n // Union the old/new changed keys.\n ; s < a.length; s++) {\n var c = a[s];\n r.push(c.batchId);\n for (var h = 0, f = c.mutations; h < f.length; h++) {\n var l = f[h];\n u = u.add(l.key);\n }\n }\n for (var p = 0, d = e; p < d.length; p++) {\n var v = d[p];\n i.push(v.batchId);\n for (var y = 0, m = v.mutations; y < m.length; y++) {\n var g = m[y];\n u = u.add(g.key);\n }\n }\n // Return the set of all (potentially) changed documents and the list\n // of mutation batch IDs that were affected by change.\n return o.Or(t, u).next((function(t) {\n return {\n Wu: t,\n ju: r,\n Gu: i\n };\n }));\n }));\n })) ];\n\n case 1:\n return u = n.sent(), [ 2 /*return*/ , (e.Sr = i, e.Nh = o, e.ph.xh(e.Nh), u) ];\n }\n }));\n }));\n }(i.Gc, r) ]);\n\n case 1:\n return o = u.sent(), i.currentUser = r, \n // Fails tasks waiting for pending writes requested by previous user.\n function(t, e) {\n t.Lu.forEach((function(t) {\n t.forEach((function(t) {\n t.reject(new I(b.CANCELLED, \"'waitForPendingWrites' promise is rejected due to a user change.\"));\n }));\n })), t.Lu.clear();\n }(i), \n // TODO(b/114226417): Consider calling this only in the primary tab.\n i.Su.Wi(r, o.ju, o.Gu), [ 4 /*yield*/ , Su(i, o.Wu) ];\n\n case 2:\n u.sent(), u.label = 3;\n\n case 3:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction ku(t, e) {\n var n = k(t), r = n.Ou.get(e);\n if (r && r.pu) return At().add(r.key);\n var i = At(), o = n.xu.get(e);\n if (!o) return i;\n for (var u = 0, s = o; u < s.length; u++) {\n var a = s[u], c = n.Nu.get(a);\n i = i.Ot(c.view.wu);\n }\n return i;\n}\n\n/**\n * Reconcile the list of synced documents in an existing view with those\n * from persistence.\n */ function Pu(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return [ 4 /*yield*/ , mo((e = k(t)).Gc, r.query, \n /* usePreviousResults= */ !0) ];\n\n case 1:\n return i = n.sent(), o = r.view.Vu(i), [ 2 /*return*/ , (e.Uu && Nu(e, r.targetId, o.Pu), \n o) ];\n }\n }));\n }));\n}\n\n/** Applies a mutation state to an existing batch. */\n// PORTING NOTE: Multi-Tab only.\nfunction Ou(t, r, i, o) {\n return e(this, void 0, void 0, (function() {\n var e, u;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return [ 4 /*yield*/ , function(t, e) {\n var n = k(t), r = k(n.Sr);\n return n.persistence.runTransaction(\"Lookup mutation documents\", \"readonly\", (function(t) {\n return r.Lo(t, e).next((function(e) {\n return e ? n.Nh.Or(t, e) : cr.resolve(null);\n }));\n }));\n }((e = k(t)).Gc, r) ];\n\n case 1:\n return null === (u = n.sent()) ? [ 3 /*break*/ , 6 ] : \"pending\" !== i ? [ 3 /*break*/ , 3 ] : [ 4 /*yield*/ , Jo(e.bu) ];\n\n case 2:\n // If we are the primary client, we need to send this write to the\n // backend. Secondary clients will ignore these writes since their remote\n // connection is disabled.\n return n.sent(), [ 3 /*break*/ , 4 ];\n\n case 3:\n \"acknowledged\" === i || \"rejected\" === i ? (\n // NOTE: Both these methods are no-ops for batches that originated from\n // other clients.\n Eu(e, r, o || null), Iu(e, r), function(t, e) {\n k(k(t).Sr).jo(e);\n }(e.Gc, r)) : S(), n.label = 4;\n\n case 4:\n return [ 4 /*yield*/ , Su(e, u) ];\n\n case 5:\n return n.sent(), [ 3 /*break*/ , 7 ];\n\n case 6:\n // A throttled tab may not have seen the mutation before it was completed\n // and removed from the mutation queue, in which case we won't have cached\n // the affected documents. In this case we can safely ignore the update\n // since that means we didn't apply the mutation locally at all (if we\n // had, we would have cached the affected documents), and so we will just\n // see any resulting document changes via normal remote document updates\n // as applicable.\n T(\"SyncEngine\", \"Cannot apply mutation batch with id: \" + r), n.label = 7;\n\n case 7:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/** Applies a query target change from a different tab. */\n// PORTING NOTE: Multi-Tab only.\nfunction Lu(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u, s, a, c, h;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return qu(e = k(t)), Fu(e), !0 !== r || !0 === e.qu ? [ 3 /*break*/ , 3 ] : (i = e.Su.Ci(), \n [ 4 /*yield*/ , Vu(e, i.L()) ]);\n\n case 1:\n return o = n.sent(), e.qu = !0, [ 4 /*yield*/ , iu(e.bu, !0) ];\n\n case 2:\n for (n.sent(), u = 0, s = o; u < s.length; u++) a = s[u], Mo(e.bu, a);\n return [ 3 /*break*/ , 7 ];\n\n case 3:\n return !1 !== r || !1 === e.qu ? [ 3 /*break*/ , 7 ] : (c = [], h = Promise.resolve(), \n e.xu.forEach((function(t, n) {\n e.Su.qi(n) ? c.push(n) : h = h.then((function() {\n return _u(e, n), yo(e.Gc, n, \n /*keepPersistedTargetData=*/ !0);\n })), qo(e.bu, n);\n })), [ 4 /*yield*/ , h ]);\n\n case 4:\n return n.sent(), [ 4 /*yield*/ , Vu(e, c) ];\n\n case 5:\n return n.sent(), \n // PORTING NOTE: Multi-Tab only.\n function(t) {\n var e = k(t);\n e.Ou.forEach((function(t, n) {\n qo(e.bu, n);\n })), e.Mu.Qh(), e.Ou = new Map, e.ku = new dt(Z.D);\n }(e), e.qu = !1, [ 4 /*yield*/ , iu(e.bu, !1) ];\n\n case 6:\n n.sent(), n.label = 7;\n\n case 7:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction Vu(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u, s, a, c, h, f, l, p, d, v, y;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = k(t), i = [], o = [], u = 0, s = r, n.label = 1;\n\n case 1:\n return u < s.length ? (a = s[u], c = void 0, (h = e.xu.get(a)) && 0 !== h.length ? [ 4 /*yield*/ , vo(e.Gc, Cn(h[0])) ] : [ 3 /*break*/ , 7 ]) : [ 3 /*break*/ , 13 ];\n\n case 2:\n // For queries that have a local View, we fetch their current state\n // from LocalStore (as the resume token and the snapshot version\n // might have changed) and reconcile their views with the persisted\n // state (the list of syncedDocuments may have gotten out of sync).\n c = n.sent(), f = 0, l = h, n.label = 3;\n\n case 3:\n return f < l.length ? (p = l[f], d = e.Nu.get(p), [ 4 /*yield*/ , Pu(e, d) ]) : [ 3 /*break*/ , 6 ];\n\n case 4:\n (v = n.sent()).snapshot && o.push(v.snapshot), n.label = 5;\n\n case 5:\n return f++, [ 3 /*break*/ , 3 ];\n\n case 6:\n return [ 3 /*break*/ , 11 ];\n\n case 7:\n return [ 4 /*yield*/ , go(e.Gc, a) ];\n\n case 8:\n return y = n.sent(), [ 4 /*yield*/ , vo(e.Gc, y) ];\n\n case 9:\n return c = n.sent(), [ 4 /*yield*/ , du(e, Ru(y), a, \n /*current=*/ !1) ];\n\n case 10:\n n.sent(), n.label = 11;\n\n case 11:\n i.push(c), n.label = 12;\n\n case 12:\n return u++, [ 3 /*break*/ , 1 ];\n\n case 13:\n return [ 2 /*return*/ , (e.Cu.yc(o), i) ];\n }\n }));\n }));\n}\n\n/**\n * Creates a `Query` object from the specified `Target`. There is no way to\n * obtain the original `Query`, so we synthesize a `Query` from the `Target`\n * object.\n *\n * The synthesized result might be different from the original `Query`, but\n * since the synthesized `Query` should return the same results as the\n * original one (only the presentation of results might differ), the potential\n * difference will not cause issues.\n */\n// PORTING NOTE: Multi-Tab only.\nfunction Ru(t) {\n return Sn(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, \"F\" /* First */ , t.startAt, t.endAt);\n}\n\n/** Returns the IDs of the clients that are currently active. */\n// PORTING NOTE: Multi-Tab only.\nfunction Cu(t) {\n var e = k(t);\n return k(k(e.Gc).persistence).pi();\n}\n\n/** Applies a query target change from a different tab. */\n// PORTING NOTE: Multi-Tab only.\nfunction Uu(t, r, i, o) {\n return e(this, void 0, void 0, (function() {\n var e, u, s;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return (e = k(t)).qu ? (\n // If we receive a target state notification via WebStorage, we are\n // either already secondary or another tab has taken the primary lease.\n T(\"SyncEngine\", \"Ignoring unexpected query state notification.\"), [ 3 /*break*/ , 8 ]) : [ 3 /*break*/ , 1 ];\n\n case 1:\n if (!e.xu.has(r)) return [ 3 /*break*/ , 8 ];\n switch (i) {\n case \"current\":\n case \"not-current\":\n return [ 3 /*break*/ , 2 ];\n\n case \"rejected\":\n return [ 3 /*break*/ , 5 ];\n }\n return [ 3 /*break*/ , 7 ];\n\n case 2:\n return [ 4 /*yield*/ , wo(e.Gc) ];\n\n case 3:\n return u = n.sent(), s = Ot.Xt(r, \"current\" === i), [ 4 /*yield*/ , Su(e, u, s) ];\n\n case 4:\n return n.sent(), [ 3 /*break*/ , 8 ];\n\n case 5:\n return [ 4 /*yield*/ , yo(e.Gc, r, \n /* keepPersistedTargetData */ !0) ];\n\n case 6:\n return n.sent(), _u(e, r, o), [ 3 /*break*/ , 8 ];\n\n case 7:\n S(), n.label = 8;\n\n case 8:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/** Adds or removes Watch targets for queries from different tabs. */ function Mu(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var e, o, u, s, a, c, h, f, l, p;\n return n(this, (function(d) {\n switch (d.label) {\n case 0:\n if (!(e = qu(t)).qu) return [ 3 /*break*/ , 10 ];\n o = 0, u = r, d.label = 1;\n\n case 1:\n return o < u.length ? (s = u[o], e.xu.has(s) ? (\n // A target might have been added in a previous attempt\n T(\"SyncEngine\", \"Adding an already active target \" + s), [ 3 /*break*/ , 5 ]) : [ 4 /*yield*/ , go(e.Gc, s) ]) : [ 3 /*break*/ , 6 ];\n\n case 2:\n return a = d.sent(), [ 4 /*yield*/ , vo(e.Gc, a) ];\n\n case 3:\n return c = d.sent(), [ 4 /*yield*/ , du(e, Ru(a), c.targetId, \n /*current=*/ !1) ];\n\n case 4:\n d.sent(), Mo(e.bu, c), d.label = 5;\n\n case 5:\n return o++, [ 3 /*break*/ , 1 ];\n\n case 6:\n h = function(t) {\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e.xu.has(t) ? [ 4 /*yield*/ , yo(e.Gc, t, \n /* keepPersistedTargetData */ !1).then((function() {\n qo(e.bu, t), _u(e, t);\n })).catch(Io) ] : [ 3 /*break*/ , 2 ];\n\n // Release queries that are still active.\n case 1:\n // Release queries that are still active.\n n.sent(), n.label = 2;\n\n case 2:\n return [ 2 /*return*/ ];\n }\n }));\n }, f = 0, l = i, d.label = 7;\n\n case 7:\n return f < l.length ? (p = l[f], [ 5 /*yield**/ , h(p) ]) : [ 3 /*break*/ , 10 ];\n\n case 8:\n d.sent(), d.label = 9;\n\n case 9:\n return f++, [ 3 /*break*/ , 7 ];\n\n case 10:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction qu(t) {\n var e = k(t);\n return e.bu.Hc.ru = yu.bind(null, e), e.bu.Hc.qe = ku.bind(null, e), e.bu.Hc.iu = gu.bind(null, e), \n e.Cu.yc = Sr.bind(null, e.vu), e.Cu.Qu = xr.bind(null, e.vu), e;\n}\n\nfunction Fu(t) {\n var e = k(t);\n return e.bu.Hc.ou = wu.bind(null, e), e.bu.Hc.au = bu.bind(null, e), e;\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// TOOD(b/140938512): Drop SimpleQueryEngine and rename IndexFreeQueryEngine.\n/**\n * A query engine that takes advantage of the target document mapping in the\n * QueryCache. The IndexFreeQueryEngine optimizes query execution by only\n * reading the documents that previously matched a query plus any documents that were\n * edited after the query was last listened to.\n *\n * There are some cases where Index-Free queries are not guaranteed to produce\n * the same results as full collection scans. In these cases, the\n * IndexFreeQueryEngine falls back to full query processing. These cases are:\n *\n * - Limit queries where a document that matched the query previously no longer\n * matches the query.\n *\n * - Limit queries where a document edit may cause the document to sort below\n * another document that is in the local cache.\n *\n * - Queries that have never been CURRENT or free of Limbo documents.\n */ var ju = /** @class */ function() {\n function t() {}\n return t.prototype.xh = function(t) {\n this.zu = t;\n }, t.prototype.Lr = function(t, e, n, r) {\n var i = this;\n // Queries that match all documents don't benefit from using\n // IndexFreeQueries. It is more efficient to scan all documents in a\n // collection, rather than to perform individual lookups.\n return function(t) {\n return 0 === t.filters.length && null === t.limit && null == t.startAt && null == t.endAt && (0 === t.on.length || 1 === t.on.length && t.on[0].field.W());\n }(e) || n.isEqual(H.min()) ? this.Hu(t, e) : this.zu.Or(t, r).next((function(o) {\n var s = i.Ju(e, o);\n return (kn(e) || Pn(e)) && i.mu(e.an, s, r, n) ? i.Hu(t, e) : (_() <= u.DEBUG && T(\"IndexFreeQueryEngine\", \"Re-using previous result from %s to execute query: %s\", n.toString(), Gn(e)), \n i.zu.Lr(t, e, n).next((function(t) {\n // We merge `previousResults` into `updateResults`, since\n // `updateResults` is already a DocumentMap. If a document is\n // contained in both lists, then its contents are the same.\n return s.forEach((function(e) {\n t = t.ot(e.key, e);\n })), t;\n })));\n }));\n // Queries that have never seen a snapshot without limbo free documents\n // should also be run as a full collection scan.\n }, \n /** Applies the query filter and sorting to the provided documents. */ t.prototype.Ju = function(t, e) {\n // Sort the documents and re-apply the query filter since previously\n // matching documents do not necessarily still match the query.\n var n = new mt(zn(t));\n return e.forEach((function(e, r) {\n r instanceof Tn && Bn(t, r) && (n = n.add(r));\n })), n;\n }, \n /**\n * Determines if a limit query needs to be refilled from cache, making it\n * ineligible for index-free execution.\n *\n * @param sortedPreviousResults The documents that matched the query when it\n * was last synchronized, sorted by the query's comparator.\n * @param remoteKeys The document keys that matched the query at the last\n * snapshot.\n * @param limboFreeSnapshotVersion The version of the snapshot when the query\n * was last synchronized.\n */\n t.prototype.mu = function(t, e, n, r) {\n // The query needs to be refilled if a previously matching document no\n // longer matches.\n if (n.size !== e.size) return !0;\n // Limit queries are not eligible for index-free query execution if there is\n // a potential that an older document from cache now sorts before a document\n // that was previously part of the limit. This, however, can only happen if\n // the document at the edge of the limit goes out of limit.\n // If a document that is not the limit boundary sorts differently,\n // the boundary of the limit itself did not change and documents from cache\n // will continue to be \"rejected\" by this boundary. Therefore, we can ignore\n // any modifications that don't affect the last document.\n var i = \"F\" /* First */ === t ? e.last() : e.first();\n return !!i && (i.hasPendingWrites || i.version.h(r) > 0);\n }, t.prototype.Hu = function(t, e) {\n return _() <= u.DEBUG && T(\"IndexFreeQueryEngine\", \"Using full collection scan to execute query:\", Gn(e)), \n this.zu.Lr(t, e, H.min());\n }, t;\n}(), Gu = /** @class */ function() {\n function t(t, e) {\n this.Dr = t, this.No = e, \n /**\n * The set of all mutations that have been sent but not yet been applied to\n * the backend.\n */\n this.Sr = [], \n /** Next value to use when assigning sequential IDs to each mutation batch. */\n this.Yu = 1, \n /** An ordered mapping between documents and the mutations batch IDs. */\n this.Xu = new mt(_o.Mh);\n }\n return t.prototype.ko = function(t) {\n return cr.resolve(0 === this.Sr.length);\n }, t.prototype.Oo = function(t, e, n, r) {\n var i = this.Yu;\n this.Yu++, this.Sr.length > 0 && this.Sr[this.Sr.length - 1];\n var o = new zr(i, e, n, r);\n this.Sr.push(o);\n // Track references by document key and index collection parents.\n for (var u = 0, s = r; u < s.length; u++) {\n var a = s[u];\n this.Xu = this.Xu.add(new _o(a.key, i)), this.Dr.Mo(t, a.key.path.F());\n }\n return cr.resolve(o);\n }, t.prototype.$o = function(t, e) {\n return cr.resolve(this.Zu(e));\n }, t.prototype.Bo = function(t, e) {\n var n = e + 1, r = this.tl(n), i = r < 0 ? 0 : r;\n // The requested batchId may still be out of range so normalize it to the\n // start of the queue.\n return cr.resolve(this.Sr.length > i ? this.Sr[i] : null);\n }, t.prototype.qo = function() {\n return cr.resolve(0 === this.Sr.length ? -1 : this.Yu - 1);\n }, t.prototype.Uo = function(t) {\n return cr.resolve(this.Sr.slice());\n }, t.prototype.Nr = function(t, e) {\n var n = this, r = new _o(e, 0), i = new _o(e, Number.POSITIVE_INFINITY), o = [];\n return this.Xu.xt([ r, i ], (function(t) {\n var e = n.Zu(t.jh);\n o.push(e);\n })), cr.resolve(o);\n }, t.prototype.$r = function(t, e) {\n var n = this, r = new mt(L);\n return e.forEach((function(t) {\n var e = new _o(t, 0), i = new _o(t, Number.POSITIVE_INFINITY);\n n.Xu.xt([ e, i ], (function(t) {\n r = r.add(t.jh);\n }));\n })), cr.resolve(this.el(r));\n }, t.prototype.Qr = function(t, e) {\n // Use the query path as a prefix for testing if a document matches the\n // query.\n var n = e.path, r = n.length + 1, i = n;\n // Construct a document reference for actually scanning the index. Unlike\n // the prefix the document key in this reference must have an even number of\n // segments. The empty segment can be used a suffix of the query path\n // because it precedes all other segments in an ordered traversal.\n Z.X(i) || (i = i.child(\"\"));\n var o = new _o(new Z(i), 0), u = new mt(L);\n // Find unique batchIDs referenced by all documents potentially matching the\n // query.\n return this.Xu.Ft((function(t) {\n var e = t.key.path;\n return !!n.M(e) && (\n // Rows with document keys more than one segment longer than the query\n // path can't be matches. For example, a query on 'rooms' can't match\n // the document /rooms/abc/messages/xyx.\n // TODO(mcg): we'll need a different scanner when we implement\n // ancestor queries.\n e.length === r && (u = u.add(t.jh)), !0);\n }), o), cr.resolve(this.el(u));\n }, t.prototype.el = function(t) {\n var e = this, n = [];\n // Construct an array of matching batches, sorted by batchID to ensure that\n // multiple mutations affecting the same document key are applied in order.\n return t.forEach((function(t) {\n var r = e.Zu(t);\n null !== r && n.push(r);\n })), n;\n }, t.prototype.Qo = function(t, e) {\n var n = this;\n x(0 === this.nl(e.batchId, \"removed\")), this.Sr.shift();\n var r = this.Xu;\n return cr.forEach(e.mutations, (function(i) {\n var o = new _o(i.key, e.batchId);\n return r = r.delete(o), n.No.Go(t, i.key);\n })).next((function() {\n n.Xu = r;\n }));\n }, t.prototype.jo = function(t) {\n // No-op since the memory mutation queue does not maintain a separate cache.\n }, t.prototype.Ho = function(t, e) {\n var n = new _o(e, 0), r = this.Xu.kt(n);\n return cr.resolve(e.isEqual(r && r.key));\n }, t.prototype.zo = function(t) {\n return this.Sr.length, cr.resolve();\n }, \n /**\n * Finds the index of the given batchId in the mutation queue and asserts that\n * the resulting index is within the bounds of the queue.\n *\n * @param batchId The batchId to search for\n * @param action A description of what the caller is doing, phrased in passive\n * form (e.g. \"acknowledged\" in a routine that acknowledges batches).\n */\n t.prototype.nl = function(t, e) {\n return this.tl(t);\n }, \n /**\n * Finds the index of the given batchId in the mutation queue. This operation\n * is O(1).\n *\n * @return The computed index of the batch with the given batchId, based on\n * the state of the queue. Note this index can be negative if the requested\n * batchId has already been remvoed from the queue or past the end of the\n * queue if the batchId is larger than the last added batch.\n */\n t.prototype.tl = function(t) {\n return 0 === this.Sr.length ? 0 : t - this.Sr[0].batchId;\n // Examine the front of the queue to figure out the difference between the\n // batchId and indexes in the array. Note that since the queue is ordered\n // by batchId, if the first batch has a larger batchId then the requested\n // batchId doesn't exist in the queue.\n }, \n /**\n * A version of lookupMutationBatch that doesn't return a promise, this makes\n * other functions that uses this code easier to read and more efficent.\n */\n t.prototype.Zu = function(t) {\n var e = this.tl(t);\n return e < 0 || e >= this.Sr.length ? null : this.Sr[e];\n }, t;\n}(), Bu = /** @class */ function() {\n /**\n * @param sizer Used to assess the size of a document. For eager GC, this is expected to just\n * return 0 to avoid unnecessarily doing the work of calculating the size.\n */\n function t(t, e) {\n this.Dr = t, this.sl = e, \n /** Underlying cache of documents and their read times. */\n this.docs = new dt(Z.D), \n /** Size of all cached documents. */\n this.size = 0\n /**\n * Adds the supplied entry to the cache and updates the cache size as appropriate.\n *\n * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\n * returned by `newChangeBuffer()`.\n */;\n }\n return t.prototype.Ir = function(t, e, n) {\n var r = e.key, i = this.docs.get(r), o = i ? i.size : 0, u = this.sl(e);\n return this.docs = this.docs.ot(r, {\n ta: e,\n size: u,\n readTime: n\n }), this.size += u - o, this.Dr.Mo(t, r.path.F());\n }, \n /**\n * Removes the specified entry from the cache and updates the cache size as appropriate.\n *\n * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\n * returned by `newChangeBuffer()`.\n */\n t.prototype.Ar = function(t) {\n var e = this.docs.get(t);\n e && (this.docs = this.docs.remove(t), this.size -= e.size);\n }, t.prototype.Rr = function(t, e) {\n var n = this.docs.get(e);\n return cr.resolve(n ? n.ta : null);\n }, t.prototype.getEntries = function(t, e) {\n var n = this, r = It();\n return e.forEach((function(t) {\n var e = n.docs.get(t);\n r = r.ot(t, e ? e.ta : null);\n })), cr.resolve(r);\n }, t.prototype.Lr = function(t, e, n) {\n for (var r = _t(), i = new Z(e.path.child(\"\")), o = this.docs.ft(i)\n // Documents are ordered by key, so we can use a prefix scan to narrow down\n // the documents we need to match the query against.\n ; o.At(); ) {\n var u = o.It(), s = u.key, a = u.value, c = a.ta, h = a.readTime;\n if (!e.path.M(s.path)) break;\n h.h(n) <= 0 || c instanceof Tn && Bn(e, c) && (r = r.ot(c.key, c));\n }\n return cr.resolve(r);\n }, t.prototype.il = function(t, e) {\n return cr.forEach(this.docs, (function(t) {\n return e(t);\n }));\n }, t.prototype.ra = function(t) {\n // `trackRemovals` is ignores since the MemoryRemoteDocumentCache keeps\n // a separate changelog and does not need special handling for removals.\n return new zu(this);\n }, t.prototype.aa = function(t) {\n return cr.resolve(this.size);\n }, t;\n}(), zu = /** @class */ function(e) {\n function n(t) {\n var n = this;\n return (n = e.call(this) || this).ha = t, n;\n }\n return t(n, e), n.prototype.Vr = function(t) {\n var e = this, n = [];\n return this.wr.forEach((function(r, i) {\n i ? n.push(e.ha.Ir(t, i, e.readTime)) : e.ha.Ar(r);\n })), cr.kn(n);\n }, n.prototype.Pr = function(t, e) {\n return this.ha.Rr(t, e);\n }, n.prototype.gr = function(t, e) {\n return this.ha.getEntries(t, e);\n }, n;\n}(Wr), Ku = /** @class */ function() {\n function t(t) {\n this.persistence = t, \n /**\n * Maps a target to the data about that target\n */\n this.rl = new W((function(t) {\n return ot(t);\n }), ut), \n /** The last received snapshot version. */\n this.lastRemoteSnapshotVersion = H.min(), \n /** The highest numbered target ID encountered. */\n this.highestTargetId = 0, \n /** The highest sequence number encountered. */\n this.ol = 0, \n /**\n * A ordered bidirectional mapping between documents and the remote target\n * IDs.\n */\n this.al = new Eo, this.targetCount = 0, this.hl = Xi.fa();\n }\n return t.prototype.Ce = function(t, e) {\n return this.rl.forEach((function(t, n) {\n return e(n);\n })), cr.resolve();\n }, t.prototype.Ia = function(t) {\n return cr.resolve(this.lastRemoteSnapshotVersion);\n }, t.prototype.ma = function(t) {\n return cr.resolve(this.ol);\n }, t.prototype.wa = function(t) {\n return this.highestTargetId = this.hl.next(), cr.resolve(this.highestTargetId);\n }, t.prototype.Aa = function(t, e, n) {\n return n && (this.lastRemoteSnapshotVersion = n), e > this.ol && (this.ol = e), \n cr.resolve();\n }, t.prototype.Pa = function(t) {\n this.rl.set(t.target, t);\n var e = t.targetId;\n e > this.highestTargetId && (this.hl = new Xi(e), this.highestTargetId = e), t.sequenceNumber > this.ol && (this.ol = t.sequenceNumber);\n }, t.prototype.Ra = function(t, e) {\n return this.Pa(e), this.targetCount += 1, cr.resolve();\n }, t.prototype.Va = function(t, e) {\n return this.Pa(e), cr.resolve();\n }, t.prototype.ya = function(t, e) {\n return this.rl.delete(e.target), this.al.Kh(e.targetId), this.targetCount -= 1, \n cr.resolve();\n }, t.prototype.po = function(t, e, n) {\n var r = this, i = 0, o = [];\n return this.rl.forEach((function(u, s) {\n s.sequenceNumber <= e && null === n.get(s.targetId) && (r.rl.delete(u), o.push(r.pa(t, s.targetId)), \n i++);\n })), cr.kn(o).next((function() {\n return i;\n }));\n }, t.prototype.ba = function(t) {\n return cr.resolve(this.targetCount);\n }, t.prototype.va = function(t, e) {\n var n = this.rl.get(e) || null;\n return cr.resolve(n);\n }, t.prototype.Sa = function(t, e, n) {\n return this.al.Bh(e, n), cr.resolve();\n }, t.prototype.Ca = function(t, e, n) {\n this.al.Uh(e, n);\n var r = this.persistence.No, i = [];\n return r && e.forEach((function(e) {\n i.push(r.Go(t, e));\n })), cr.kn(i);\n }, t.prototype.pa = function(t, e) {\n return this.al.Kh(e), cr.resolve();\n }, t.prototype.xa = function(t, e) {\n var n = this.al.Wh(e);\n return cr.resolve(n);\n }, t.prototype.Ho = function(t, e) {\n return cr.resolve(this.al.Ho(e));\n }, t;\n}(), Wu = /** @class */ function() {\n /**\n * The constructor accepts a factory for creating a reference delegate. This\n * allows both the delegate and this instance to have strong references to\n * each other without having nullable fields that would then need to be\n * checked or asserted on every access.\n */\n function t(t) {\n var e = this;\n this.cl = {}, this.Ma = new Lr(0), this.$a = !1, this.$a = !0, this.No = t(this), \n this.ja = new Ku(this), this.Dr = new xi, this.vr = function(t, n) {\n return new Bu(t, (function(t) {\n return e.No.ul(t);\n }));\n }(this.Dr);\n }\n return t.prototype.start = function() {\n return Promise.resolve();\n }, t.prototype.Di = function() {\n // No durable state to ensure is closed on shutdown.\n return this.$a = !1, Promise.resolve();\n }, Object.defineProperty(t.prototype, \"Ii\", {\n get: function() {\n return this.$a;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.Za = function() {\n // No op.\n }, t.prototype.th = function() {\n // No op.\n }, t.prototype.Ah = function() {\n return this.Dr;\n }, t.prototype.Th = function(t) {\n var e = this.cl[t.ti()];\n return e || (e = new Gu(this.Dr, this.No), this.cl[t.ti()] = e), e;\n }, t.prototype.Ih = function() {\n return this.ja;\n }, t.prototype.mh = function() {\n return this.vr;\n }, t.prototype.runTransaction = function(t, e, n) {\n var r = this;\n T(\"MemoryPersistence\", \"Starting transaction:\", t);\n var i = new Qu(this.Ma.next());\n return this.No.ll(), n(i).next((function(t) {\n return r.No._l(i).next((function() {\n return t;\n }));\n })).xn().then((function(t) {\n return i.br(), t;\n }));\n }, t.prototype.fl = function(t, e) {\n return cr.On(Object.values(this.cl).map((function(n) {\n return function() {\n return n.Ho(t, e);\n };\n })));\n }, t;\n}(), Qu = /** @class */ function(e) {\n function n(t) {\n var n = this;\n return (n = e.call(this) || this).Fa = t, n;\n }\n return t(n, e), n;\n}(Hr), Hu = /** @class */ function() {\n function t(t) {\n this.persistence = t, \n /** Tracks all documents that are active in Query views. */\n this.dl = new Eo, \n /** The list of documents that are potentially GCed after each transaction. */\n this.wl = null;\n }\n return t.El = function(e) {\n return new t(e);\n }, Object.defineProperty(t.prototype, \"Tl\", {\n get: function() {\n if (this.wl) return this.wl;\n throw S();\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.Da = function(t, e, n) {\n return this.dl.Da(n, e), this.Tl.delete(n.toString()), cr.resolve();\n }, t.prototype.Na = function(t, e, n) {\n return this.dl.Na(n, e), this.Tl.add(n.toString()), cr.resolve();\n }, t.prototype.Go = function(t, e) {\n return this.Tl.add(e.toString()), cr.resolve();\n }, t.prototype.removeTarget = function(t, e) {\n var n = this;\n this.dl.Kh(e.targetId).forEach((function(t) {\n return n.Tl.add(t.toString());\n }));\n var r = this.persistence.Ih();\n return r.xa(t, e.targetId).next((function(t) {\n t.forEach((function(t) {\n return n.Tl.add(t.toString());\n }));\n })).next((function() {\n return r.ya(t, e);\n }));\n }, t.prototype.ll = function() {\n this.wl = new Set;\n }, t.prototype._l = function(t) {\n var e = this, n = this.persistence.mh().ra();\n // Remove newly orphaned documents.\n return cr.forEach(this.Tl, (function(r) {\n var i = Z.H(r);\n return e.Il(t, i).next((function(t) {\n t || n.Ar(i);\n }));\n })).next((function() {\n return e.wl = null, n.apply(t);\n }));\n }, t.prototype.yh = function(t, e) {\n var n = this;\n return this.Il(t, e).next((function(t) {\n t ? n.Tl.delete(e.toString()) : n.Tl.add(e.toString());\n }));\n }, t.prototype.ul = function(t) {\n // For eager GC, we don't care about the document size, there are no size thresholds.\n return 0;\n }, t.prototype.Il = function(t, e) {\n var n = this;\n return cr.On([ function() {\n return cr.resolve(n.dl.Ho(e));\n }, function() {\n return n.persistence.Ih().Ho(t, e);\n }, function() {\n return n.persistence.fl(t, e);\n } ]);\n }, t;\n}(), Yu = /** @class */ function() {\n function t(t) {\n this.ml = t.ml, this.Al = t.Al;\n }\n return t.prototype.gc = function(t) {\n this.Rl = t;\n }, t.prototype.Ic = function(t) {\n this.Pl = t;\n }, t.prototype.onMessage = function(t) {\n this.gl = t;\n }, t.prototype.close = function() {\n this.Al();\n }, t.prototype.send = function(t) {\n this.ml(t);\n }, t.prototype.Vl = function() {\n this.Rl();\n }, t.prototype.yl = function(t) {\n this.Pl(t);\n }, t.prototype.pl = function(t) {\n this.gl(t);\n }, t;\n}(), Xu = {\n BatchGetDocuments: \"batchGet\",\n Commit: \"commit\",\n RunQuery: \"runQuery\"\n}, Ju = /** @class */ function(e) {\n function n(t) {\n var n = this;\n return (n = e.call(this, t) || this).forceLongPolling = t.forceLongPolling, n.T = t.T, \n n;\n }\n /**\n * Base class for all Rest-based connections to the backend (WebChannel and\n * HTTP).\n */\n return t(n, e), n.prototype.Nl = function(t, e, n, r) {\n return new Promise((function(i, o) {\n var u = new d;\n u.listenOnce(v.COMPLETE, (function() {\n try {\n switch (u.getLastErrorCode()) {\n case y.NO_ERROR:\n var e = u.getResponseJson();\n T(\"Connection\", \"XHR received:\", JSON.stringify(e)), i(e);\n break;\n\n case y.TIMEOUT:\n T(\"Connection\", 'RPC \"' + t + '\" timed out'), o(new I(b.DEADLINE_EXCEEDED, \"Request time out\"));\n break;\n\n case y.HTTP_ERROR:\n var n = u.getStatus();\n if (T(\"Connection\", 'RPC \"' + t + '\" failed with status:', n, \"response text:\", u.getResponseText()), \n n > 0) {\n var r = u.getResponseJson().error;\n if (r && r.status && r.message) {\n var s = function(t) {\n var e = t.toLowerCase().replace(\"_\", \"-\");\n return Object.values(b).indexOf(e) >= 0 ? e : b.UNKNOWN;\n }(r.status);\n o(new I(s, r.message));\n } else o(new I(b.UNKNOWN, \"Server responded with status \" + u.getStatus()));\n } else \n // If we received an HTTP_ERROR but there's no status code,\n // it's most probably a connection issue\n o(new I(b.UNAVAILABLE, \"Connection failed.\"));\n break;\n\n default:\n S();\n }\n } finally {\n T(\"Connection\", 'RPC \"' + t + '\" completed.');\n }\n }));\n var s = JSON.stringify(r);\n u.send(e, \"POST\", s, n, 15);\n }));\n }, n.prototype.Vc = function(t, e) {\n var n = [ this.vl, \"/\", \"google.firestore.v1.Firestore\", \"/\", t, \"/channel\" ], r = m(), i = {\n // Required for backend stickiness, routing behavior is based on this\n // parameter.\n httpSessionIdParam: \"gsessionid\",\n initMessageHeaders: {},\n messageUrlParams: {\n // This param is used to improve routing and project isolation by the\n // backend and must be included in every request.\n database: \"projects/\" + this._.projectId + \"/databases/\" + this._.database\n },\n sendRawJson: !0,\n supportsCrossDomainXhr: !0,\n internalChannelParams: {\n // Override the default timeout (randomized between 10-20 seconds) since\n // a large write batch on a slow internet connection may take a long\n // time to send to the backend. Rather than have WebChannel impose a\n // tight timeout which could lead to infinite timeouts and retries, we\n // set it very large (5-10 minutes) and rely on the browser's builtin\n // timeouts to kick in if the request isn't working.\n forwardChannelRequestTimeoutMs: 6e5\n },\n forceLongPolling: this.forceLongPolling,\n detectBufferingProxy: this.T\n };\n this.Cl(i.initMessageHeaders, e), \n // Sending the custom headers we just added to request.initMessageHeaders\n // (Authorization, etc.) will trigger the browser to make a CORS preflight\n // request because the XHR will no longer meet the criteria for a \"simple\"\n // CORS request:\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests\n // Therefore to avoid the CORS preflight request (an extra network\n // roundtrip), we use the httpHeadersOverwriteParam option to specify that\n // the headers should instead be encoded into a special \"$httpHeaders\" query\n // parameter, which is recognized by the webchannel backend. This is\n // formally defined here:\n // https://github.com/google/closure-library/blob/b0e1815b13fb92a46d7c9b3c30de5d6a396a3245/closure/goog/net/rpc/httpcors.js#L32\n // TODO(b/145624756): There is a backend bug where $httpHeaders isn't respected if the request\n // doesn't have an Origin header. So we have to exclude a few browser environments that are\n // known to (sometimes) not include an Origin. See\n // https://github.com/firebase/firebase-js-sdk/issues/1491.\n a() || c() || h() || f() || l() || p() || (i.httpHeadersOverwriteParam = \"$httpHeaders\");\n var o = n.join(\"\");\n T(\"Connection\", \"Creating WebChannel: \" + o, i);\n var u = r.createWebChannel(o, i), s = !1, d = !1, v = new Yu({\n ml: function(t) {\n d ? T(\"Connection\", \"Not sending because WebChannel is closed:\", t) : (s || (T(\"Connection\", \"Opening WebChannel transport.\"), \n u.open(), s = !0), T(\"Connection\", \"WebChannel sending:\", t), u.send(t));\n },\n Al: function() {\n return u.close();\n }\n }), y = function(t, e) {\n // TODO(dimond): closure typing seems broken because WebChannel does\n // not implement goog.events.Listenable\n u.listen(t, (function(t) {\n try {\n e(t);\n } catch (t) {\n setTimeout((function() {\n throw t;\n }), 0);\n }\n }));\n };\n // WebChannel supports sending the first message with the handshake - saving\n // a network round trip. However, it will have to call send in the same\n // JS event loop as open. In order to enforce this, we delay actually\n // opening the WebChannel until send is called. Whether we have called\n // open is tracked with this variable.\n // Closure events are guarded and exceptions are swallowed, so catch any\n // exception and rethrow using a setTimeout so they become visible again.\n // Note that eventually this function could go away if we are confident\n // enough the code is exception free.\n return y(g.EventType.OPEN, (function() {\n d || T(\"Connection\", \"WebChannel transport opened.\");\n })), y(g.EventType.CLOSE, (function() {\n d || (d = !0, T(\"Connection\", \"WebChannel transport closed\"), v.yl());\n })), y(g.EventType.ERROR, (function(t) {\n d || (d = !0, A(\"Connection\", \"WebChannel transport errored:\", t), v.yl(new I(b.UNAVAILABLE, \"The operation could not be completed\")));\n })), y(g.EventType.MESSAGE, (function(t) {\n var e;\n if (!d) {\n var n = t.data[0];\n x(!!n);\n // TODO(b/35143891): There is a bug in One Platform that caused errors\n // (and only errors) to be wrapped in an extra array. To be forward\n // compatible with the bug we need to check either condition. The latter\n // can be removed once the fix has been rolled out.\n // Use any because msgData.error is not typed.\n var r = n, i = r.error || (null === (e = r[0]) || void 0 === e ? void 0 : e.error);\n if (i) {\n T(\"Connection\", \"WebChannel received error:\", i);\n // error.status will be a string like 'OK' or 'NOT_FOUND'.\n var o = i.status, s = function(t) {\n // lookup by string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var e = at[t];\n if (void 0 !== e) return pt(e);\n }(o), a = i.message;\n void 0 === s && (s = b.INTERNAL, a = \"Unknown error status: \" + o + \" with message \" + i.message), \n // Mark closed so no further events are propagated\n d = !0, v.yl(new I(s, a)), u.close();\n } else T(\"Connection\", \"WebChannel received:\", n), v.pl(n);\n }\n })), setTimeout((function() {\n // Technically we could/should wait for the WebChannel opened event,\n // but because we want to send the first message with the WebChannel\n // handshake we pretend the channel opened here (asynchronously), and\n // then delay the actual open until the first message is sent.\n v.Vl();\n }), 0), v;\n }, n;\n}(/** @class */ function() {\n function t(t) {\n this.bl = t, this._ = t._;\n var e = t.ssl ? \"https\" : \"http\";\n this.vl = e + \"://\" + t.host, this.Sl = \"projects/\" + this._.projectId + \"/databases/\" + this._.database + \"/documents\";\n }\n return t.prototype.Mc = function(t, e, n, r) {\n var i = this.Dl(t, e);\n T(\"RestConnection\", \"Sending: \", i, n);\n var o = {};\n return this.Cl(o, r), this.Nl(t, i, o, n).then((function(t) {\n return T(\"RestConnection\", \"Received: \", t), t;\n }), (function(e) {\n throw A(\"RestConnection\", t + \" failed with error: \", e, \"url: \", i, \"request:\", n), \n e;\n }));\n }, t.prototype.$c = function(t, e, n, r) {\n // The REST API automatically aggregates all of the streamed results, so we\n // can just use the normal invoke() method.\n return this.Mc(t, e, n, r);\n }, \n /**\n * Modifies the headers for a request, adding any authorization token if\n * present and any additional headers for the request.\n */\n t.prototype.Cl = function(t, e) {\n if (t[\"X-Goog-Api-Client\"] = \"gl-js/ fire/8.0.0\", \n // Content-Type: text/plain will avoid preflight requests which might\n // mess with CORS and redirects by proxies. If we add custom headers\n // we will need to change this code to potentially use the $httpOverwrite\n // parameter supported by ESF to avoid triggering preflight requests.\n t[\"Content-Type\"] = \"text/plain\", e) for (var n in e.Gh) e.Gh.hasOwnProperty(n) && (t[n] = e.Gh[n]);\n }, t.prototype.Dl = function(t, e) {\n var n = Xu[t];\n return this.vl + \"/v1/\" + e + \":\" + n;\n }, t;\n}()), $u = /** @class */ function() {\n function t() {\n var t = this;\n this.xl = function() {\n return t.Fl();\n }, this.kl = function() {\n return t.Ol();\n }, this.Ml = [], this.$l();\n }\n return t.prototype.eu = function(t) {\n this.Ml.push(t);\n }, t.prototype.Di = function() {\n window.removeEventListener(\"online\", this.xl), window.removeEventListener(\"offline\", this.kl);\n }, t.prototype.$l = function() {\n window.addEventListener(\"online\", this.xl), window.addEventListener(\"offline\", this.kl);\n }, t.prototype.Fl = function() {\n T(\"ConnectivityMonitor\", \"Network connectivity changed: AVAILABLE\");\n for (var t = 0, e = this.Ml; t < e.length; t++) {\n (0, e[t])(0 /* AVAILABLE */);\n }\n }, t.prototype.Ol = function() {\n T(\"ConnectivityMonitor\", \"Network connectivity changed: UNAVAILABLE\");\n for (var t = 0, e = this.Ml; t < e.length; t++) {\n (0, e[t])(1 /* UNAVAILABLE */);\n }\n }, \n // TODO(chenbrian): Consider passing in window either into this component or\n // here for testing via FakeWindow.\n /** Checks that all used attributes of window are available. */\n t.Ln = function() {\n return \"undefined\" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener;\n }, t;\n}(), Zu = /** @class */ function() {\n function t() {}\n return t.prototype.eu = function(t) {\n // No-op.\n }, t.prototype.Di = function() {\n // No-op.\n }, t;\n}();\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Initializes the WebChannelConnection for the browser. */\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction ts(t) {\n return new ce(t, /* useProto3Json= */ !0);\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Provides all components needed for Firestore with in-memory persistence.\n * Uses EagerGC garbage collection.\n */ var es = /** @class */ function() {\n function t() {\n this.synchronizeTabs = !1;\n }\n return t.prototype.initialize = function(t) {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n return this.Su = this.Ll(t), this.persistence = this.Bl(t), [ 4 /*yield*/ , this.persistence.start() ];\n\n case 1:\n return e.sent(), this.ql = this.Ul(t), this.Gc = this.Kl(t), [ 2 /*return*/ ];\n }\n }));\n }));\n }, t.prototype.Ul = function(t) {\n return null;\n }, t.prototype.Kl = function(t) {\n /** Manages our in-memory or durable persistence. */\n return e = this.persistence, n = new ju, r = t.Ql, new co(e, n, r);\n var e, n, r;\n }, t.prototype.Bl = function(t) {\n return new Wu(Hu.El);\n }, t.prototype.Ll = function(t) {\n return new Br;\n }, t.prototype.terminate = function() {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(t) {\n switch (t.label) {\n case 0:\n return this.ql && this.ql.stop(), [ 4 /*yield*/ , this.Su.Di() ];\n\n case 1:\n return t.sent(), [ 4 /*yield*/ , this.persistence.Di() ];\n\n case 2:\n return t.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }, t;\n}(), ns = /** @class */ function(r) {\n function i(t, e, n) {\n var i = this;\n return (i = r.call(this) || this).Wl = t, i.cacheSizeBytes = e, i.forceOwnership = n, \n i.synchronizeTabs = !1, i;\n }\n return t(i, r), i.prototype.initialize = function(t) {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n return [ 4 /*yield*/ , r.prototype.initialize.call(this, t) ];\n\n case 1:\n return e.sent(), [ 4 /*yield*/ , bo(this.Gc) ];\n\n case 2:\n return e.sent(), [ 4 /*yield*/ , this.Wl.initialize(this, t) ];\n\n case 3:\n // Enqueue writes from a previous session\n return e.sent(), [ 4 /*yield*/ , Fu(this.Wl.fi) ];\n\n case 4:\n // Enqueue writes from a previous session\n return e.sent(), [ 4 /*yield*/ , Jo(this.Wl.bu) ];\n\n case 5:\n return e.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }, i.prototype.Ul = function(t) {\n var e = this.persistence.No.wo;\n return new ei(e, t.hs);\n }, i.prototype.Bl = function(t) {\n var e = ao(t.bl._, t.bl.persistenceKey), n = void 0 !== this.cacheSizeBytes ? ti.ao(this.cacheSizeBytes) : ti.fo, r = ts(t.bl._);\n return new ro(this.synchronizeTabs, e, t.clientId, n, t.hs, wr(), br(), r, this.Su, !!this.forceOwnership);\n }, i.prototype.Ll = function(t) {\n return new Br;\n }, i;\n}(es), rs = /** @class */ function(r) {\n function i(t, e) {\n var n = this;\n return (n = r.call(this, t, e, /* forceOwnership= */ !1) || this).Wl = t, n.cacheSizeBytes = e, \n n.synchronizeTabs = !0, n;\n }\n return t(i, r), i.prototype.initialize = function(t) {\n return e(this, void 0, void 0, (function() {\n var i, o = this;\n return n(this, (function(u) {\n switch (u.label) {\n case 0:\n return [ 4 /*yield*/ , r.prototype.initialize.call(this, t) ];\n\n case 1:\n return u.sent(), i = this.Wl.fi, this.Su instanceof Gr ? (this.Su.fi = {\n er: Ou.bind(null, i),\n nr: Uu.bind(null, i),\n sr: Mu.bind(null, i),\n pi: Cu.bind(null, i)\n }, [ 4 /*yield*/ , this.Su.start() ]) : [ 3 /*break*/ , 3 ];\n\n case 2:\n u.sent(), u.label = 3;\n\n case 3:\n // NOTE: This will immediately call the listener, so we make sure to\n // set it after localStore / remoteStore are started.\n return [ 4 /*yield*/ , this.persistence.Xa((function(t) {\n return e(o, void 0, void 0, (function() {\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n return [ 4 /*yield*/ , Lu(this.Wl.fi, t) ];\n\n case 1:\n return e.sent(), this.ql && (t && !this.ql.Ii ? this.ql.start(this.Gc) : t || this.ql.stop()), \n [ 2 /*return*/ ];\n }\n }));\n }));\n })) ];\n\n case 4:\n // NOTE: This will immediately call the listener, so we make sure to\n // set it after localStore / remoteStore are started.\n return u.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }, i.prototype.Ll = function(t) {\n var e = wr();\n if (!Gr.Ln(e)) throw new I(b.UNIMPLEMENTED, \"IndexedDB persistence is only available on platforms that support LocalStorage.\");\n var n = ao(t.bl._, t.bl.persistenceKey);\n return new Gr(e, t.hs, n, t.clientId, t.Ql);\n }, i;\n}(ns), is = /** @class */ function() {\n function t() {}\n return t.prototype.initialize = function(t, r) {\n return e(this, void 0, void 0, (function() {\n var e = this;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return this.Gc ? [ 3 /*break*/ , 2 ] : (this.Gc = t.Gc, this.Su = t.Su, this.zc = this.jl(r), \n this.bu = this.Gl(r), this.vu = this.zl(r), this.fi = this.Hl(r, \n /* startAsPrimary=*/ !t.synchronizeTabs), this.Su.di = function(t) {\n return mu(e.fi, t, 1 /* SharedClientState */);\n }, this.bu.Hc.Jl = xu.bind(null, this.fi), [ 4 /*yield*/ , iu(this.bu, this.fi.Uu) ]);\n\n case 1:\n n.sent(), n.label = 2;\n\n case 2:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }, t.prototype.zl = function(t) {\n return new Nr;\n }, t.prototype.jl = function(t) {\n var e, n = ts(t.bl._), r = (e = t.bl, new Ju(e));\n /** Return the Platform-specific connectivity monitor. */ return function(t, e, n) {\n return new Oo(t, e, n);\n }(t.credentials, r, n);\n }, t.prototype.Gl = function(t) {\n var e, n, r, i, o, u = this;\n return e = this.Gc, n = this.zc, r = t.hs, i = function(t) {\n return mu(u.fi, t, 0 /* RemoteStore */);\n }, o = $u.Ln() ? new $u : new Zu, new Vo(e, n, r, i, o);\n }, t.prototype.Hl = function(t, e) {\n return function(t, e, n, \n // PORTING NOTE: Manages state synchronization in multi-tab environments.\n r, i, o, u) {\n var s = new lu(t, e, n, r, i, o);\n return u && (s.qu = !0), s;\n }(this.Gc, this.bu, this.vu, this.Su, t.Ql, t.Du, e);\n }, t.prototype.terminate = function() {\n return Uo(this.bu);\n }, t;\n}(), os = /** @class */ function() {\n function t(t) {\n this.observer = t, \n /**\n * When set to true, will not raise future events. Necessary to deal with\n * async detachment of listener.\n */\n this.muted = !1;\n }\n return t.prototype.next = function(t) {\n this.observer.next && this.Yl(this.observer.next, t);\n }, t.prototype.error = function(t) {\n this.observer.error ? this.Yl(this.observer.error, t) : console.error(\"Uncaught Error in snapshot listener:\", t);\n }, t.prototype.Xl = function() {\n this.muted = !0;\n }, t.prototype.Yl = function(t, e) {\n var n = this;\n this.muted || setTimeout((function() {\n n.muted || t(e);\n }), 0);\n }, t;\n}();\n\n/**\n * Provides all components needed for Firestore with IndexedDB persistence.\n */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction us(t, e, n) {\n if (!n) throw new I(b.INVALID_ARGUMENT, \"Function \" + t + \"() cannot be called with an empty \" + e + \".\");\n}\n\nfunction ss(t, e) {\n if (void 0 === e) return {\n merge: !1\n };\n if (void 0 !== e.mergeFields && void 0 !== e.merge) throw new I(b.INVALID_ARGUMENT, \"Invalid options passed to function \" + t + '(): You cannot specify both \"merge\" and \"mergeFields\".');\n return e;\n}\n\n/**\n * Validates that two boolean options are not set at the same time.\n */ function as(t, e, n, r) {\n if (!0 === e && !0 === r) throw new I(b.INVALID_ARGUMENT, t + \" and \" + n + \" cannot be used together.\");\n}\n\n/**\n * Returns true if it's a non-null object without a custom prototype\n * (i.e. excludes Array, Date, etc.).\n */\n/** Returns a string describing the type / value of the provided input. */ function cs(t) {\n if (void 0 === t) return \"undefined\";\n if (null === t) return \"null\";\n if (\"string\" == typeof t) return t.length > 20 && (t = t.substring(0, 20) + \"...\"), \n JSON.stringify(t);\n if (\"number\" == typeof t || \"boolean\" == typeof t) return \"\" + t;\n if (\"object\" == typeof t) {\n if (t instanceof Array) return \"an array\";\n var e = \n /** Hacky method to try to get the constructor name for an object. */\n function(t) {\n if (t.constructor) {\n var e = /function\\s+([^\\s(]+)\\s*\\(/.exec(t.constructor.toString());\n if (e && e.length > 1) return e[1];\n }\n return null;\n }(t);\n return e ? \"a custom \" + e + \" object\" : \"an object\";\n }\n return \"function\" == typeof t ? \"a function\" : S();\n}\n\nfunction hs(t, e) {\n if (e <= 0) throw new I(b.INVALID_ARGUMENT, \"Function \" + t + \"() requires a positive number, but it was: \" + e + \".\");\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// The objects that are a part of this API are exposed to third-parties as\n// compiled javascript so we want to flag our private members with a leading\n// underscore to discourage their use.\n/**\n * A field class base class that is shared by the lite, full and legacy SDK,\n * which supports shared code that deals with FieldPaths.\n */\n// Use underscore prefix to hide this class from our Public API.\n// eslint-disable-next-line @typescript-eslint/naming-convention\nvar fs = function(t) {\n for (var e = 0; e < t.length; ++e) if (0 === t[e].length) throw new I(b.INVALID_ARGUMENT, \"Invalid field name at argument $(i + 1). Field names must not be empty.\");\n this.Zl = new $(t);\n}, ls = /** @class */ function(e) {\n /**\n * Creates a FieldPath from the provided field names. If more than one field\n * name is provided, the path will point to a nested field in a document.\n *\n * @param fieldNames A list of field names.\n */\n function n() {\n for (var t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n];\n return e.call(this, t) || this;\n }\n return t(n, e), n.documentId = function() {\n /**\n * Internal Note: The backend doesn't technically support querying by\n * document ID. Instead it queries by the entire document name (full path\n * included), but in the cases we currently support documentId(), the net\n * effect is the same.\n */\n return new n($.j().B());\n }, n.prototype.isEqual = function(t) {\n return t instanceof n && this.Zl.isEqual(t.Zl);\n }, n;\n}(fs), ps = new RegExp(\"[~\\\\*/\\\\[\\\\]]\"), ds = \n/**\n * @param _methodName The public API endpoint that returns this class.\n */\nfunction(t) {\n this.t_ = t;\n}, vs = /** @class */ function(e) {\n function n() {\n return null !== e && e.apply(this, arguments) || this;\n }\n return t(n, e), n.prototype.e_ = function(t) {\n if (2 /* MergeSet */ !== t.n_) throw 1 /* Update */ === t.n_ ? t.s_(this.t_ + \"() can only appear at the top level of your update data\") : t.s_(this.t_ + \"() cannot be used with set() unless you pass {merge:true}\");\n // No transform to add for a delete, but we need to add it to our\n // fieldMask so it gets deleted.\n return t.Qe.push(t.path), null;\n }, n.prototype.isEqual = function(t) {\n return t instanceof n;\n }, n;\n}(ds);\n\n/**\n * A `FieldPath` refers to a field in a document. The path may consist of a\n * single field name (referring to a top-level field in the document), or a list\n * of field names (referring to a nested field in the document).\n */\n/**\n * Creates a child context for parsing SerializableFieldValues.\n *\n * This is different than calling `ParseContext.contextWith` because it keeps\n * the fieldTransforms and fieldMask separate.\n *\n * The created context has its `dataSource` set to `UserDataSource.Argument`.\n * Although these values are used with writes, any elements in these FieldValues\n * are not considered writes since they cannot contain any FieldValue sentinels,\n * etc.\n *\n * @param fieldValue The sentinel FieldValue for which to create a child\n * context.\n * @param context The parent context.\n * @param arrayElement Whether or not the FieldValue has an array.\n */\nfunction ys(t, e, n) {\n return new Ss({\n n_: 3 /* Argument */ ,\n i_: e.settings.i_,\n methodName: t.t_,\n r_: n\n }, e._, e.serializer, e.ignoreUndefinedProperties);\n}\n\nvar ms = /** @class */ function(e) {\n function n() {\n return null !== e && e.apply(this, arguments) || this;\n }\n return t(n, e), n.prototype.e_ = function(t) {\n return new en(t.path, new We);\n }, n.prototype.isEqual = function(t) {\n return t instanceof n;\n }, n;\n}(ds), gs = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this, t) || this).o_ = n, r;\n }\n return t(n, e), n.prototype.e_ = function(t) {\n var e = ys(this, t, \n /*array=*/ !0), n = this.o_.map((function(t) {\n return Vs(t, e);\n })), r = new Qe(n);\n return new en(t.path, r);\n }, n.prototype.isEqual = function(t) {\n // TODO(mrschmidt): Implement isEquals\n return this === t;\n }, n;\n}(ds), ws = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this, t) || this).o_ = n, r;\n }\n return t(n, e), n.prototype.e_ = function(t) {\n var e = ys(this, t, \n /*array=*/ !0), n = this.o_.map((function(t) {\n return Vs(t, e);\n })), r = new Ye(n);\n return new en(t.path, r);\n }, n.prototype.isEqual = function(t) {\n // TODO(mrschmidt): Implement isEquals\n return this === t;\n }, n;\n}(ds), bs = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this, t) || this).a_ = n, r;\n }\n return t(n, e), n.prototype.e_ = function(t) {\n var e = new Je(t.serializer, le(t.serializer, this.a_));\n return new en(t.path, e);\n }, n.prototype.isEqual = function(t) {\n // TODO(mrschmidt): Implement isEquals\n return this === t;\n }, n;\n}(ds), Is = /** @class */ function() {\n /**\n * Creates a new immutable `GeoPoint` object with the provided latitude and\n * longitude values.\n * @param latitude The latitude as number between -90 and 90.\n * @param longitude The longitude as number between -180 and 180.\n */\n function t(t, e) {\n if (!isFinite(t) || t < -90 || t > 90) throw new I(b.INVALID_ARGUMENT, \"Latitude must be a number between -90 and 90, but was: \" + t);\n if (!isFinite(e) || e < -180 || e > 180) throw new I(b.INVALID_ARGUMENT, \"Longitude must be a number between -180 and 180, but was: \" + e);\n this.h_ = t, this.c_ = e;\n }\n return Object.defineProperty(t.prototype, \"latitude\", {\n /**\n * The latitude of this `GeoPoint` instance.\n */\n get: function() {\n return this.h_;\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"longitude\", {\n /**\n * The longitude of this `GeoPoint` instance.\n */\n get: function() {\n return this.c_;\n },\n enumerable: !1,\n configurable: !0\n }), \n /**\n * Returns true if this `GeoPoint` is equal to the provided one.\n *\n * @param other The `GeoPoint` to compare against.\n * @return true if this `GeoPoint` is equal to the provided one.\n */\n t.prototype.isEqual = function(t) {\n return this.h_ === t.h_ && this.c_ === t.c_;\n }, t.prototype.toJSON = function() {\n return {\n latitude: this.h_,\n longitude: this.c_\n };\n }, \n /**\n * Actually private to JS consumers of our API, so this function is prefixed\n * with an underscore.\n */\n t.prototype.g = function(t) {\n return L(this.h_, t.h_) || L(this.c_, t.c_);\n }, t;\n}(), Es = function(t) {\n this.u_ = t;\n}, _s = /^__.*__$/, Ts = function(t, e, n) {\n this.l_ = t, this.__ = e, this.f_ = n;\n}, Ns = /** @class */ function() {\n function t(t, e, n) {\n this.data = t, this.Qe = e, this.fieldTransforms = n;\n }\n return t.prototype.d_ = function(t, e) {\n var n = [];\n return null !== this.Qe ? n.push(new pn(t, this.data, this.Qe, e)) : n.push(new ln(t, this.data, e)), \n this.fieldTransforms.length > 0 && n.push(new vn(t, this.fieldTransforms)), n;\n }, t;\n}(), As = /** @class */ function() {\n function t(t, e, n) {\n this.data = t, this.Qe = e, this.fieldTransforms = n;\n }\n return t.prototype.d_ = function(t, e) {\n var n = [ new pn(t, this.data, this.Qe, e) ];\n return this.fieldTransforms.length > 0 && n.push(new vn(t, this.fieldTransforms)), \n n;\n }, t;\n}();\n\nfunction Ds(t) {\n switch (t) {\n case 0 /* Set */ :\n // fall through\n case 2 /* MergeSet */ :\n // fall through\n case 1 /* Update */ :\n return !0;\n\n case 3 /* Argument */ :\n case 4 /* ArrayArgument */ :\n return !1;\n\n default:\n throw S();\n }\n}\n\n/** A \"context\" object passed around while parsing user data. */ var Ss = /** @class */ function() {\n /**\n * Initializes a ParseContext with the given source and path.\n *\n * @param settings The settings for the parser.\n * @param databaseId The database ID of the Firestore instance.\n * @param serializer The serializer to use to generate the Value proto.\n * @param ignoreUndefinedProperties Whether to ignore undefined properties\n * rather than throw.\n * @param fieldTransforms A mutable list of field transforms encountered while\n * parsing the data.\n * @param fieldMask A mutable list of field paths encountered while parsing\n * the data.\n *\n * TODO(b/34871131): We don't support array paths right now, so path can be\n * null to indicate the context represents any location within an array (in\n * which case certain features will not work and errors will be somewhat\n * compromised).\n */\n function t(t, e, n, r, i, o) {\n this.settings = t, this._ = e, this.serializer = n, this.ignoreUndefinedProperties = r, \n // Minor hack: If fieldTransforms is undefined, we assume this is an\n // external call and we need to validate the entire path.\n void 0 === i && this.w_(), this.fieldTransforms = i || [], this.Qe = o || [];\n }\n return Object.defineProperty(t.prototype, \"path\", {\n get: function() {\n return this.settings.path;\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"n_\", {\n get: function() {\n return this.settings.n_;\n },\n enumerable: !1,\n configurable: !0\n }), \n /** Returns a new context with the specified settings overwritten. */ t.prototype.E_ = function(e) {\n return new t(Object.assign(Object.assign({}, this.settings), e), this._, this.serializer, this.ignoreUndefinedProperties, this.fieldTransforms, this.Qe);\n }, t.prototype.T_ = function(t) {\n var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.E_({\n path: n,\n r_: !1\n });\n return r.I_(t), r;\n }, t.prototype.m_ = function(t) {\n var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.E_({\n path: n,\n r_: !1\n });\n return r.w_(), r;\n }, t.prototype.A_ = function(t) {\n // TODO(b/34871131): We don't support array paths right now; so make path\n // undefined.\n return this.E_({\n path: void 0,\n r_: !0\n });\n }, t.prototype.s_ = function(t) {\n return Fs(t, this.settings.methodName, this.settings.R_ || !1, this.path, this.settings.i_);\n }, \n /** Returns 'true' if 'fieldPath' was traversed when creating this context. */ t.prototype.contains = function(t) {\n return void 0 !== this.Qe.find((function(e) {\n return t.M(e);\n })) || void 0 !== this.fieldTransforms.find((function(e) {\n return t.M(e.field);\n }));\n }, t.prototype.w_ = function() {\n // TODO(b/34871131): Remove null check once we have proper paths for fields\n // within arrays.\n if (this.path) for (var t = 0; t < this.path.length; t++) this.I_(this.path.get(t));\n }, t.prototype.I_ = function(t) {\n if (0 === t.length) throw this.s_(\"Document fields must not be empty\");\n if (Ds(this.n_) && _s.test(t)) throw this.s_('Document fields cannot begin and end with \"__\"');\n }, t;\n}(), xs = /** @class */ function() {\n function t(t, e, n) {\n this._ = t, this.ignoreUndefinedProperties = e, this.serializer = n || ts(t)\n /** Creates a new top-level parse context. */;\n }\n return t.prototype.P_ = function(t, e, n, r) {\n return void 0 === r && (r = !1), new Ss({\n n_: t,\n methodName: e,\n i_: n,\n path: $.U(),\n r_: !1,\n R_: r\n }, this._, this.serializer, this.ignoreUndefinedProperties);\n }, t;\n}();\n\n/**\n * Helper for parsing raw user input (provided via the API) into internal model\n * classes.\n */\n/** Parse document data from a set() call. */ function ks(t, e, n, r, i, o) {\n void 0 === o && (o = {});\n var u = t.P_(o.merge || o.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);\n Us(\"Data must be an object, but it was:\", u, r);\n var s, a, c = Rs(r, u);\n if (o.merge) s = new tn(u.Qe), a = u.fieldTransforms; else if (o.mergeFields) {\n for (var h = [], f = 0, l = o.mergeFields; f < l.length; f++) {\n var p = l[f], d = void 0;\n if (p instanceof fs) d = p.Zl; else {\n if (\"string\" != typeof p) throw S();\n d = qs(e, p, n);\n }\n if (!u.contains(d)) throw new I(b.INVALID_ARGUMENT, \"Field '\" + d + \"' is specified in your field mask but missing from your input data.\");\n js(h, d) || h.push(d);\n }\n s = new tn(h), a = u.fieldTransforms.filter((function(t) {\n return s.Je(t.field);\n }));\n } else s = null, a = u.fieldTransforms;\n return new Ns(new bn(c), s, a);\n}\n\n/** Parse update data from an update() call. */ function Ps(t, e, n, r) {\n var i = t.P_(1 /* Update */ , e, n);\n Us(\"Data must be an object, but it was:\", i, r);\n var o = [], u = new In;\n z(r, (function(t, r) {\n var s = qs(e, t, n), a = i.m_(s);\n if (r instanceof vs || r instanceof Es && r.u_ instanceof vs) \n // Add it to the field mask, but don't add anything to updateData.\n o.push(s); else {\n var c = Vs(r, a);\n null != c && (o.push(s), u.set(s, c));\n }\n }));\n var s = new tn(o);\n return new As(u.Xe(), s, i.fieldTransforms);\n}\n\n/** Parse update data from a list of field/value arguments. */ function Os(t, e, n, r, i, o) {\n var u = t.P_(1 /* Update */ , e, n), s = [ Ms(e, r, n) ], a = [ i ];\n if (o.length % 2 != 0) throw new I(b.INVALID_ARGUMENT, \"Function \" + e + \"() needs to be called with an even number of arguments that alternate between field names and values.\");\n for (var c = 0; c < o.length; c += 2) s.push(Ms(e, o[c])), a.push(o[c + 1]);\n // We iterate in reverse order to pick the last value for a field if the\n // user specified the field multiple times.\n for (var h = [], f = new In, l = s.length - 1; l >= 0; --l) if (!js(h, s[l])) {\n var p = s[l], d = a[l], v = u.m_(p);\n if (d instanceof vs || d instanceof Es && d.u_ instanceof vs) \n // Add it to the field mask, but don't add anything to updateData.\n h.push(p); else {\n var y = Vs(d, v);\n null != y && (h.push(p), f.set(p, y));\n }\n }\n var m = new tn(h);\n return new As(f.Xe(), m, u.fieldTransforms);\n}\n\n/**\n * Parse a \"query value\" (e.g. value in a where filter or a value in a cursor\n * bound).\n *\n * @param allowArrays Whether the query value is an array that may directly\n * contain additional arrays (e.g. the operand of an `in` query).\n */ function Ls(t, e, n, r) {\n return void 0 === r && (r = !1), Vs(n, t.P_(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));\n}\n\n/**\n * Parses user data to Protobuf Values.\n *\n * @param input Data to be parsed.\n * @param context A context object representing the current path being parsed,\n * the source of the data being parsed, etc.\n * @return The parsed value, or null if the value was a FieldValue sentinel\n * that should not be included in the resulting parsed data.\n */ function Vs(t, e) {\n if (\n // Unwrap the API type from the Compat SDK. This will return the API type\n // from firestore-exp.\n t instanceof Es && (t = t.u_), Cs(t)) return Us(\"Unsupported field value:\", e, t), \n Rs(t, e);\n if (t instanceof ds) \n // FieldValues usually parse into transforms (except FieldValue.delete())\n // in which case we do not want to include this field in our parsed data\n // (as doing so will overwrite the field directly prior to the transform\n // trying to transform it). So we don't add this location to\n // context.fieldMask and we return null as our parsing result.\n /**\n * \"Parses\" the provided FieldValueImpl, adding any necessary transforms to\n * context.fieldTransforms.\n */\n return function(t, e) {\n // Sentinels are only supported with writes, and not within arrays.\n if (!Ds(e.n_)) throw e.s_(t.t_ + \"() can only be used with update() and set()\");\n if (!e.path) throw e.s_(t.t_ + \"() is not currently supported inside arrays\");\n var n = t.e_(e);\n n && e.fieldTransforms.push(n);\n }(t, e), null;\n if (\n // If context.path is null we are inside an array and we don't support\n // field mask paths more granular than the top-level array.\n e.path && e.Qe.push(e.path), t instanceof Array) {\n // TODO(b/34871131): Include the path containing the array in the error\n // message.\n // In the case of IN queries, the parsed data is an array (representing\n // the set of values to be included for the IN query) that may directly\n // contain additional arrays (each representing an individual field\n // value), so we disable this validation.\n if (e.settings.r_ && 4 /* ArrayArgument */ !== e.n_) throw e.s_(\"Nested arrays are not supported\");\n return function(t, e) {\n for (var n = [], r = 0, i = 0, o = t; i < o.length; i++) {\n var u = Vs(o[i], e.A_(r));\n null == u && (\n // Just include nulls in the array for fields being replaced with a\n // sentinel.\n u = {\n nullValue: \"NULL_VALUE\"\n }), n.push(u), r++;\n }\n return {\n arrayValue: {\n values: n\n }\n };\n }(t, e);\n }\n return function(t, e) {\n if (null === t) return {\n nullValue: \"NULL_VALUE\"\n };\n if (\"number\" == typeof t) return le(e.serializer, t);\n if (\"boolean\" == typeof t) return {\n booleanValue: t\n };\n if (\"string\" == typeof t) return {\n stringValue: t\n };\n if (t instanceof Date) {\n var n = Q.fromDate(t);\n return {\n timestampValue: pe(e.serializer, n)\n };\n }\n if (t instanceof Q) {\n // Firestore backend truncates precision down to microseconds. To ensure\n // offline mode works the same with regards to truncation, perform the\n // truncation immediately without waiting for the backend to do that.\n var r = new Q(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));\n return {\n timestampValue: pe(e.serializer, r)\n };\n }\n if (t instanceof Is) return {\n geoPointValue: {\n latitude: t.latitude,\n longitude: t.longitude\n }\n };\n if (t instanceof U) return {\n bytesValue: de(e.serializer, t.l)\n };\n if (t instanceof Ts) {\n var i = e._, o = t.l_;\n if (!o.isEqual(i)) throw e.s_(\"Document reference is for database \" + o.projectId + \"/\" + o.database + \" but should be for database \" + i.projectId + \"/\" + i.database);\n return {\n referenceValue: me(t.l_ || e._, t.__.path)\n };\n }\n if (void 0 === t && e.ignoreUndefinedProperties) return null;\n throw e.s_(\"Unsupported field value: \" + cs(t));\n }(t, e);\n}\n\nfunction Rs(t, e) {\n var n = {};\n return K(t) ? \n // If we encounter an empty object, we explicitly add it to the update\n // mask to ensure that the server creates a map entry.\n e.path && e.path.length > 0 && e.Qe.push(e.path) : z(t, (function(t, r) {\n var i = Vs(r, e.T_(t));\n null != i && (n[t] = i);\n })), {\n mapValue: {\n fields: n\n }\n };\n}\n\nfunction Cs(t) {\n return !(\"object\" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof Q || t instanceof Is || t instanceof U || t instanceof Ts || t instanceof ds);\n}\n\nfunction Us(t, e, n) {\n if (!Cs(n) || !function(t) {\n return \"object\" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));\n }(n)) {\n var r = cs(n);\n throw \"an object\" === r ? e.s_(t + \" a custom object\") : e.s_(t + \" \" + r);\n }\n}\n\n/**\n * Helper that calls fromDotSeparatedString() but wraps any error thrown.\n */ function Ms(t, e, n) {\n if (e instanceof fs) return e.Zl;\n if (\"string\" == typeof e) return qs(t, e);\n throw Fs(\"Field path arguments must be of type string or FieldPath.\", t, \n /* hasConverter= */ !1, \n /* path= */ void 0, n);\n}\n\n/**\n * Wraps fromDotSeparatedString with an error message about the method that\n * was thrown.\n * @param methodName The publicly visible method name\n * @param path The dot-separated string form of a field path which will be split\n * on dots.\n * @param targetDoc The document against which the field path will be evaluated.\n */ function qs(t, e, n) {\n try {\n return function(t) {\n if (t.search(ps) >= 0) throw new I(b.INVALID_ARGUMENT, \"Invalid field path (\" + t + \"). Paths must not contain '~', '*', '/', '[', or ']'\");\n try {\n return new (ls.bind.apply(ls, r([ void 0 ], t.split(\".\"))));\n } catch (e) {\n throw new I(b.INVALID_ARGUMENT, \"Invalid field path (\" + t + \"). Paths must not be empty, begin with '.', end with '.', or contain '..'\");\n }\n }(e).Zl;\n } catch (e) {\n throw Fs((i = e) instanceof Error ? i.message : i.toString(), t, \n /* hasConverter= */ !1, \n /* path= */ void 0, n);\n }\n /**\n * Extracts the message from a caught exception, which should be an Error object\n * though JS doesn't guarantee that.\n */ var i;\n /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */}\n\nfunction Fs(t, e, n, r, i) {\n var o = r && !r.P(), u = void 0 !== i, s = \"Function \" + e + \"() called with invalid data\";\n n && (s += \" (via `toFirestore()`)\");\n var a = \"\";\n return (o || u) && (a += \" (found\", o && (a += \" in field \" + r), u && (a += \" in document \" + i), \n a += \")\"), new I(b.INVALID_ARGUMENT, (s += \". \") + t + a);\n}\n\nfunction js(t, e) {\n return t.some((function(t) {\n return t.isEqual(e);\n }));\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Internal transaction object responsible for accumulating the mutations to\n * perform and the base versions for any documents read.\n */ var Gs = /** @class */ function() {\n function t(t) {\n this.zc = t, \n // The version of each document that was read during this transaction.\n this.g_ = new Map, this.mutations = [], this.V_ = !1, \n /**\n * A deferred usage error that occurred previously in this transaction that\n * will cause the transaction to fail once it actually commits.\n */\n this.y_ = null, \n /**\n * Set of documents that have been written in the transaction.\n *\n * When there's more than one write to the same key in a transaction, any\n * writes after the first are handled differently.\n */\n this.p_ = new Set;\n }\n return t.prototype.b_ = function(t) {\n return e(this, void 0, void 0, (function() {\n var r, i = this;\n return n(this, (function(o) {\n switch (o.label) {\n case 0:\n if (this.v_(), this.mutations.length > 0) throw new I(b.INVALID_ARGUMENT, \"Firestore transactions require all reads to be executed before all writes.\");\n return [ 4 /*yield*/ , function(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u, s, a;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e = k(t), i = _e(e.serializer) + \"/documents\", o = {\n documents: r.map((function(t) {\n return we(e.serializer, t);\n }))\n }, [ 4 /*yield*/ , e.$c(\"BatchGetDocuments\", i, o) ];\n\n case 1:\n return u = n.sent(), s = new Map, u.forEach((function(t) {\n var n = function(t, e) {\n return \"found\" in e ? function(t, e) {\n x(!!e.found), e.found.name, e.found.updateTime;\n var n = be(t, e.found.name), r = ye(e.found.updateTime), i = new bn({\n mapValue: {\n fields: e.found.fields\n }\n });\n return new Tn(n, r, i, {});\n }(t, e) : \"missing\" in e ? function(t, e) {\n x(!!e.missing), x(!!e.readTime);\n var n = be(t, e.missing), r = ye(e.readTime);\n return new Nn(n, r);\n }(t, e) : S();\n }(e.serializer, t);\n s.set(n.key.toString(), n);\n })), a = [], [ 2 /*return*/ , (r.forEach((function(t) {\n var e = s.get(t.toString());\n x(!!e), a.push(e);\n })), a) ];\n }\n }));\n }));\n }(this.zc, t) ];\n\n case 1:\n return [ 2 /*return*/ , ((r = o.sent()).forEach((function(t) {\n t instanceof Nn || t instanceof Tn ? i.S_(t) : S();\n })), r) ];\n }\n }));\n }));\n }, t.prototype.set = function(t, e) {\n this.write(e.d_(t, this.Ge(t))), this.p_.add(t.toString());\n }, t.prototype.update = function(t, e) {\n try {\n this.write(e.d_(t, this.D_(t)));\n } catch (t) {\n this.y_ = t;\n }\n this.p_.add(t.toString());\n }, t.prototype.delete = function(t) {\n this.write([ new gn(t, this.Ge(t)) ]), this.p_.add(t.toString());\n }, t.prototype.commit = function() {\n return e(this, void 0, void 0, (function() {\n var t, r = this;\n return n(this, (function(i) {\n switch (i.label) {\n case 0:\n if (this.v_(), this.y_) throw this.y_;\n return t = this.g_, \n // For each mutation, note that the doc was written.\n this.mutations.forEach((function(e) {\n t.delete(e.key.toString());\n })), \n // For each document that was read but not written to, we want to perform\n // a `verify` operation.\n t.forEach((function(t, e) {\n var n = Z.H(e);\n r.mutations.push(new wn(n, r.Ge(n)));\n })), [ 4 /*yield*/ , function(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e = k(t), i = _e(e.serializer) + \"/documents\", o = {\n writes: r.map((function(t) {\n return Ae(e.serializer, t);\n }))\n }, [ 4 /*yield*/ , e.Mc(\"Commit\", i, o) ];\n\n case 1:\n return n.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }(this.zc, this.mutations) ];\n\n case 1:\n // For each mutation, note that the doc was written.\n return i.sent(), this.V_ = !0, [ 2 /*return*/ ];\n }\n }));\n }));\n }, t.prototype.S_ = function(t) {\n var e;\n if (t instanceof Tn) e = t.version; else {\n if (!(t instanceof Nn)) throw S();\n // For deleted docs, we must use baseVersion 0 when we overwrite them.\n e = H.min();\n }\n var n = this.g_.get(t.key.toString());\n if (n) {\n if (!e.isEqual(n)) \n // This transaction will fail no matter what.\n throw new I(b.ABORTED, \"Document version changed between two reads.\");\n } else this.g_.set(t.key.toString(), e);\n }, \n /**\n * Returns the version of this document when it was read in this transaction,\n * as a precondition, or no precondition if it was not read.\n */\n t.prototype.Ge = function(t) {\n var e = this.g_.get(t.toString());\n return !this.p_.has(t.toString()) && e ? rn.updateTime(e) : rn.ze();\n }, \n /**\n * Returns the precondition for a document if the operation is an update.\n */\n t.prototype.D_ = function(t) {\n var e = this.g_.get(t.toString());\n // The first time a document is written, we want to take into account the\n // read time and existence\n if (!this.p_.has(t.toString()) && e) {\n if (e.isEqual(H.min())) \n // The document doesn't exist, so fail the transaction.\n // This has to be validated locally because you can't send a\n // precondition that a document does not exist without changing the\n // semantics of the backend write to be an insert. This is the reverse\n // of what we want, since we want to assert that the document doesn't\n // exist but then send the update and have it fail. Since we can't\n // express that to the backend, we have to validate locally.\n // Note: this can change once we can send separate verify writes in the\n // transaction.\n throw new I(b.INVALID_ARGUMENT, \"Can't update a document that doesn't exist.\");\n // Document exists, base precondition on document update time.\n return rn.updateTime(e);\n }\n // Document was not read, so we just use the preconditions for a blind\n // update.\n return rn.exists(!0);\n }, t.prototype.write = function(t) {\n this.v_(), this.mutations = this.mutations.concat(t);\n }, t.prototype.v_ = function() {}, t;\n}(), Bs = /** @class */ function() {\n function t(t, e, n, r) {\n this.hs = t, this.zc = e, this.updateFunction = n, this.ls = r, this.C_ = 5, this.Vs = new ar(this.hs, \"transaction_retry\" /* TransactionRetry */)\n /** Runs the transaction and sets the result on deferred. */;\n }\n return t.prototype.run = function() {\n this.N_();\n }, t.prototype.N_ = function() {\n var t = this;\n this.Vs.Pn((function() {\n return e(t, void 0, void 0, (function() {\n var t, e, r = this;\n return n(this, (function(n) {\n return t = new Gs(this.zc), (e = this.x_(t)) && e.then((function(e) {\n r.hs.ws((function() {\n return t.commit().then((function() {\n r.ls.resolve(e);\n })).catch((function(t) {\n r.F_(t);\n }));\n }));\n })).catch((function(t) {\n r.F_(t);\n })), [ 2 /*return*/ ];\n }));\n }));\n }));\n }, t.prototype.x_ = function(t) {\n try {\n var e = this.updateFunction(t);\n return !tt(e) && e.catch && e.then ? e : (this.ls.reject(Error(\"Transaction callback must return a Promise\")), \n null);\n } catch (t) {\n // Do not retry errors thrown by user provided updateFunction.\n return this.ls.reject(t), null;\n }\n }, t.prototype.F_ = function(t) {\n var e = this;\n this.C_ > 0 && this.k_(t) ? (this.C_ -= 1, this.hs.ws((function() {\n return e.N_(), Promise.resolve();\n }))) : this.ls.reject(t);\n }, t.prototype.k_ = function(t) {\n if (\"FirebaseError\" === t.name) {\n // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and\n // non-matching document versions with ABORTED. These errors should be retried.\n var e = t.code;\n return \"aborted\" === e || \"failed-precondition\" === e || !lt(e);\n }\n return !1;\n }, t;\n}(), zs = /** @class */ function() {\n function t(t, \n /**\n * Asynchronous queue responsible for all of our internal processing. When\n * we get incoming work from the user (via public API) or the network\n * (incoming GRPC messages), we should always schedule onto this queue.\n * This ensures all of our work is properly serialized (e.g. we don't\n * start processing a new operation while the previous one is waiting for\n * an async I/O to complete).\n */\n e) {\n this.credentials = t, this.hs = e, this.clientId = O.t(), \n // We defer our initialization until we get the current user from\n // setChangeListener(). We block the async queue until we got the initial\n // user and the initialization is completed. This will prevent any scheduled\n // work from happening before initialization is completed.\n // If initializationDone resolved then the FirestoreClient is in a usable\n // state.\n this.O_ = new sr\n /**\n * Starts up the FirestoreClient, returning only whether or not enabling\n * persistence succeeded.\n *\n * The intent here is to \"do the right thing\" as far as users are concerned.\n * Namely, in cases where offline persistence is requested and possible,\n * enable it, but otherwise fall back to persistence disabled. For the most\n * part we expect this to succeed one way or the other so we don't expect our\n * users to actually wait on the firestore.enablePersistence Promise since\n * they generally won't care.\n *\n * Of course some users actually do care about whether or not persistence\n * was successfully enabled, so the Promise returned from this method\n * indicates this outcome.\n *\n * This presents a problem though: even before enablePersistence resolves or\n * rejects, users may have made calls to e.g. firestore.collection() which\n * means that the FirestoreClient in there will be available and will be\n * enqueuing actions on the async queue.\n *\n * Meanwhile any failure of an operation on the async queue causes it to\n * panic and reject any further work, on the premise that unhandled errors\n * are fatal.\n *\n * Consequently the fallback is handled internally here in start, and if the\n * fallback succeeds we signal success to the async queue even though the\n * start() itself signals failure.\n *\n * @param databaseInfo The connection information for the current instance.\n * @param offlineComponentProvider Provider that returns all components\n * required for memory-only or IndexedDB persistence.\n * @param onlineComponentProvider Provider that returns all components\n * required for online support.\n * @returns A deferred result indicating the user-visible result of enabling\n * offline persistence. This method will reject this if IndexedDB fails to\n * start for any reason. If usePersistence is false this is\n * unconditionally resolved.\n */;\n }\n return t.prototype.start = function(t, r, i) {\n var o = this;\n this.M_(), this.bl = t;\n // If usePersistence is true, certain classes of errors while starting are\n // recoverable but only by falling back to persistence disabled.\n // If there's an error in the first case but not in recovery we cannot\n // reject the promise blocking the async queue because this will cause the\n // async queue to panic.\n var u = new sr, s = !1;\n // Return only the result of enabling persistence. Note that this does not\n // need to await the completion of initializationDone because the result of\n // this method should not reflect any other kind of failure to start.\n return this.credentials.Jh((function(t) {\n if (!s) return s = !0, T(\"FirestoreClient\", \"Initializing. user=\", t.uid), o.L_(r, i, t, u).then(o.O_.resolve, o.O_.reject);\n o.hs.Cs((function() {\n return function(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return (e = k(t)).hs.Fs(), T(\"RemoteStore\", \"RemoteStore received new credentials\"), \n i = zo(e), \n // Tear down and re-create our network streams. This will ensure we get a\n // fresh auth token for the new user and re-fill the write pipeline with\n // new mutations from the LocalStore (since mutations are per-user).\n e.Xc.add(3 /* CredentialChange */), [ 4 /*yield*/ , Co(e) ];\n\n case 1:\n return n.sent(), i && \n // Don't set the network status to Unknown if we are offline.\n e.nu.set(\"Unknown\" /* Unknown */), [ 4 /*yield*/ , e.Hc.Jl(r) ];\n\n case 2:\n return n.sent(), e.Xc.delete(3 /* CredentialChange */), [ 4 /*yield*/ , Ro(e) ];\n\n case 3:\n // Tear down and re-create our network streams. This will ensure we get a\n // fresh auth token for the new user and re-fill the write pipeline with\n // new mutations from the LocalStore (since mutations are per-user).\n return n.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }(o.bu, t);\n }));\n })), \n // Block the async queue until initialization is done\n this.hs.ws((function() {\n return o.O_.promise;\n })), u.promise;\n }, \n /** Enables the network connection and requeues all pending operations. */ t.prototype.enableNetwork = function() {\n var t = this;\n return this.M_(), this.hs.enqueue((function() {\n return t.persistence.th(!0), function(t) {\n var e = k(t);\n return e.Xc.delete(0 /* UserDisabled */), Ro(e);\n }(t.bu);\n }));\n }, \n /**\n * Initializes persistent storage, attempting to use IndexedDB if\n * usePersistence is true or memory-only if false.\n *\n * If IndexedDB fails because it's already open in another tab or because the\n * platform can't possibly support our implementation then this method rejects\n * the persistenceResult and falls back on memory-only persistence.\n *\n * @param offlineComponentProvider Provider that returns all components\n * required for memory-only or IndexedDB persistence.\n * @param onlineComponentProvider Provider that returns all components\n * required for online support.\n * @param user The initial user\n * @param persistenceResult A deferred result indicating the user-visible\n * result of enabling offline persistence. This method will reject this if\n * IndexedDB fails to start for any reason. If usePersistence is false\n * this is unconditionally resolved.\n * @returns a Promise indicating whether or not initialization should\n * continue, i.e. that one of the persistence implementations actually\n * succeeded.\n */\n t.prototype.L_ = function(t, r, i, o) {\n return e(this, void 0, void 0, (function() {\n var u, s, a = this;\n return n(this, (function(c) {\n switch (c.label) {\n case 0:\n return c.trys.push([ 0, 3, , 4 ]), u = {\n hs: this.hs,\n bl: this.bl,\n clientId: this.clientId,\n credentials: this.credentials,\n Ql: i,\n Du: 100\n }, [ 4 /*yield*/ , t.initialize(u) ];\n\n case 1:\n return c.sent(), [ 4 /*yield*/ , r.initialize(t, u) ];\n\n case 2:\n return c.sent(), this.persistence = t.persistence, this.Su = t.Su, this.Gc = t.Gc, \n this.ql = t.ql, this.zc = r.zc, this.bu = r.bu, this.fi = r.fi, this.B_ = r.vu, \n this.B_.Us = pu.bind(null, this.fi), this.B_.Ws = vu.bind(null, this.fi), \n // When a user calls clearPersistence() in one client, all other clients\n // need to be terminated to allow the delete to succeed.\n this.persistence.Za((function() {\n return e(a, void 0, void 0, (function() {\n return n(this, (function(t) {\n switch (t.label) {\n case 0:\n return [ 4 /*yield*/ , this.terminate() ];\n\n case 1:\n return t.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n })), o.resolve(), [ 3 /*break*/ , 4 ];\n\n case 3:\n // An unknown failure on the first stage shuts everything down.\n if (s = c.sent(), \n // Regardless of whether or not the retry succeeds, from an user\n // perspective, offline persistence has failed.\n o.reject(s), !\n /**\n * Decides whether the provided error allows us to gracefully disable\n * persistence (as opposed to crashing the client).\n */\n // TODO(schmidt-sebastian): Remove `export` in\n // https://github.com/firebase/firebase-js-sdk/pull/3901\n function(t) {\n return \"FirebaseError\" === t.name ? t.code === b.FAILED_PRECONDITION || t.code === b.UNIMPLEMENTED : !(\"undefined\" != typeof DOMException && t instanceof DOMException) || \n // When the browser is out of quota we could get either quota exceeded\n // or an aborted error depending on whether the error happened during\n // schema migration.\n 22 === t.code || 20 === t.code || \n // Firefox Private Browsing mode disables IndexedDb and returns\n // INVALID_STATE for any usage.\n 11 === t.code;\n }(s)) throw s;\n return [ 2 /*return*/ , (console.warn(\"Error enabling offline persistence. Falling back to persistence disabled: \" + s), \n this.L_(new es, new is, i, o)) ];\n\n case 4:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }, \n /**\n * Checks that the client has not been terminated. Ensures that other methods on\n * this class cannot be called after the client is terminated.\n */\n t.prototype.M_ = function() {\n if (this.hs.ps) throw new I(b.FAILED_PRECONDITION, \"The client has already been terminated.\");\n }, \n /** Disables the network connection. Pending operations will not complete. */ t.prototype.disableNetwork = function() {\n var t = this;\n return this.M_(), this.hs.enqueue((function() {\n return t.persistence.th(!1), function(t) {\n return e(this, void 0, void 0, (function() {\n var e;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return (e = k(t)).Xc.add(0 /* UserDisabled */), [ 4 /*yield*/ , Co(e) ];\n\n case 1:\n return n.sent(), \n // Set the OnlineState to Offline so get()s return from cache, etc.\n e.nu.set(\"Offline\" /* Offline */), [ 2 /*return*/ ];\n }\n }));\n }));\n }(t.bu);\n }));\n }, t.prototype.terminate = function() {\n var t = this;\n this.hs.Ds();\n var r = new sr;\n return this.hs.bs((function() {\n return e(t, void 0, void 0, (function() {\n var t, e;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return n.trys.push([ 0, 4, , 5 ]), \n // PORTING NOTE: LocalStore does not need an explicit shutdown on web.\n this.ql && this.ql.stop(), [ 4 /*yield*/ , Uo(this.bu) ];\n\n case 1:\n return n.sent(), [ 4 /*yield*/ , this.Su.Di() ];\n\n case 2:\n return n.sent(), [ 4 /*yield*/ , this.persistence.Di() ];\n\n case 3:\n // PORTING NOTE: LocalStore does not need an explicit shutdown on web.\n return n.sent(), \n // `removeChangeListener` must be called after shutting down the\n // RemoteStore as it will prevent the RemoteStore from retrieving\n // auth tokens.\n this.credentials.Yh(), r.resolve(), [ 3 /*break*/ , 5 ];\n\n case 4:\n return t = n.sent(), e = _r(t, \"Failed to shutdown persistence\"), r.reject(e), [ 3 /*break*/ , 5 ];\n\n case 5:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n })), r.promise;\n }, \n /**\n * Returns a Promise that resolves when all writes that were pending at the time this\n * method was called received server acknowledgement. An acknowledgement can be either acceptance\n * or rejection.\n */\n t.prototype.waitForPendingWrites = function() {\n var t = this;\n this.M_();\n var r = new sr;\n return this.hs.ws((function() {\n return function(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u, s;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n zo((e = k(t)).bu) || T(\"SyncEngine\", \"The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.\"), \n n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 3, , 4 ]), [ 4 /*yield*/ , function(t) {\n var e = k(t);\n return e.persistence.runTransaction(\"Get highest unacknowledged batch id\", \"readonly\", (function(t) {\n return e.Sr.qo(t);\n }));\n }(e.Gc) ];\n\n case 2:\n return -1 === (i = n.sent()) ? [ 2 /*return*/ , void r.resolve() ] : ((o = e.Lu.get(i) || []).push(r), \n e.Lu.set(i, o), [ 3 /*break*/ , 4 ]);\n\n case 3:\n return u = n.sent(), s = _r(u, \"Initialization of waitForPendingWrites() operation failed\"), \n r.reject(s), [ 3 /*break*/ , 4 ];\n\n case 4:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }(t.fi, r);\n })), r.promise;\n }, t.prototype.listen = function(t, e, n) {\n var r = this;\n this.M_();\n var i = new os(n), o = new Pr(t, i, e);\n return this.hs.ws((function() {\n return Ar(r.B_, o);\n })), function() {\n i.Xl(), r.hs.ws((function() {\n return Dr(r.B_, o);\n }));\n };\n }, t.prototype.q_ = function(t) {\n return e(this, void 0, void 0, (function() {\n var r, i = this;\n return n(this, (function(o) {\n switch (o.label) {\n case 0:\n return this.M_(), [ 4 /*yield*/ , this.O_.promise ];\n\n case 1:\n return o.sent(), r = new sr, [ 2 /*return*/ , (this.hs.ws((function() {\n return function(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var e, o, u;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return n.trys.push([ 0, 2, , 3 ]), [ 4 /*yield*/ , function(t, e) {\n var n = k(t);\n return n.persistence.runTransaction(\"read document\", \"readonly\", (function(t) {\n return n.Nh.Cr(t, e);\n }));\n }(t, r) ];\n\n case 1:\n return (e = n.sent()) instanceof Tn ? i.resolve(e) : e instanceof Nn ? i.resolve(null) : i.reject(new I(b.UNAVAILABLE, \"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)\")), \n [ 3 /*break*/ , 3 ];\n\n case 2:\n return o = n.sent(), u = _r(o, \"Failed to get document '\" + r + \" from cache\"), \n i.reject(u), [ 3 /*break*/ , 3 ];\n\n case 3:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }(i.Gc, t, r);\n })), r.promise) ];\n }\n }));\n }));\n }, t.prototype.U_ = function(t, r) {\n return void 0 === r && (r = {}), e(this, void 0, void 0, (function() {\n var e, i = this;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return this.M_(), [ 4 /*yield*/ , this.O_.promise ];\n\n case 1:\n return n.sent(), e = new sr, [ 2 /*return*/ , (this.hs.ws((function() {\n return function(t, e, n, r, i) {\n var o = new os({\n next: function(o) {\n // Remove query first before passing event to user to avoid\n // user actions affecting the now stale query.\n e.ws((function() {\n return Dr(t, u);\n }));\n var s = o.docs.has(n);\n !s && o.fromCache ? \n // TODO(dimond): If we're online and the document doesn't\n // exist then we resolve with a doc.exists set to false. If\n // we're offline however, we reject the Promise in this\n // case. Two options: 1) Cache the negative response from\n // the server so we can deliver that even when you're\n // offline 2) Actually reject the Promise in the online case\n // if the document doesn't exist.\n i.reject(new I(b.UNAVAILABLE, \"Failed to get document because the client is offline.\")) : s && o.fromCache && r && \"server\" === r.source ? i.reject(new I(b.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to \"server\" to retrieve the cached document.)')) : i.resolve(o);\n },\n error: function(t) {\n return i.reject(t);\n }\n }), u = new Pr(xn(n.path), o, {\n includeMetadataChanges: !0,\n Xs: !0\n });\n return Ar(t, u);\n }(i.B_, i.hs, t, r, e);\n })), e.promise) ];\n }\n }));\n }));\n }, t.prototype.K_ = function(t) {\n return e(this, void 0, void 0, (function() {\n var r, i = this;\n return n(this, (function(o) {\n switch (o.label) {\n case 0:\n return this.M_(), [ 4 /*yield*/ , this.O_.promise ];\n\n case 1:\n return o.sent(), r = new sr, [ 2 /*return*/ , (this.hs.ws((function() {\n return function(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var e, o, u, s, a, c;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return n.trys.push([ 0, 2, , 3 ]), [ 4 /*yield*/ , mo(t, r, \n /* usePreviousResults= */ !0) ];\n\n case 1:\n return e = n.sent(), o = new cu(r, e.Fh), u = o.Eu(e.documents), s = o.Vr(u, \n /* updateLimboDocuments= */ !1), i.resolve(s.snapshot), [ 3 /*break*/ , 3 ];\n\n case 2:\n return a = n.sent(), c = _r(a, \"Failed to execute query '\" + r + \" against cache\"), \n i.reject(c), [ 3 /*break*/ , 3 ];\n\n case 3:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }(i.Gc, t, r);\n })), r.promise) ];\n }\n }));\n }));\n }, t.prototype.Q_ = function(t, r) {\n return void 0 === r && (r = {}), e(this, void 0, void 0, (function() {\n var e, i = this;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return this.M_(), [ 4 /*yield*/ , this.O_.promise ];\n\n case 1:\n return n.sent(), e = new sr, [ 2 /*return*/ , (this.hs.ws((function() {\n return function(t, e, n, r, i) {\n var o = new os({\n next: function(n) {\n // Remove query first before passing event to user to avoid\n // user actions affecting the now stale query.\n e.ws((function() {\n return Dr(t, u);\n })), n.fromCache && \"server\" === r.source ? i.reject(new I(b.UNAVAILABLE, 'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to \"server\" to retrieve the cached documents.)')) : i.resolve(n);\n },\n error: function(t) {\n return i.reject(t);\n }\n }), u = new Pr(n, o, {\n includeMetadataChanges: !0,\n Xs: !0\n });\n return Ar(t, u);\n }(i.B_, i.hs, t, r, e);\n })), e.promise) ];\n }\n }));\n }));\n }, t.prototype.write = function(t) {\n var r = this;\n this.M_();\n var i = new sr;\n return this.hs.ws((function() {\n return function(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var e, o, u, s;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = Fu(t), n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 5, , 6 ]), [ 4 /*yield*/ , \n /* Accepts locally generated Mutations and commit them to storage. */\n function(t, e) {\n var n, r = k(t), i = Q.now(), o = e.reduce((function(t, e) {\n return t.add(e.key);\n }), At());\n return r.persistence.runTransaction(\"Locally write mutations\", \"readwrite\", (function(t) {\n return r.Nh.Or(t, o).next((function(o) {\n n = o;\n for (\n // For non-idempotent mutations (such as `FieldValue.increment()`),\n // we record the base state in a separate patch mutation. This is\n // later used to guarantee consistent values and prevents flicker\n // even if the backend sends us an update that already includes our\n // transform.\n var u = [], s = 0, a = e; s < a.length; s++) {\n var c = a[s], h = cn(c, n.get(c.key));\n null != h && \n // NOTE: The base state should only be applied if there's some\n // existing document to override, so use a Precondition of\n // exists=true\n u.push(new pn(c.key, h, En(h.proto.mapValue), rn.exists(!0)));\n }\n return r.Sr.Oo(t, i, u, e);\n }));\n })).then((function(t) {\n var e = t.lr(n);\n return {\n batchId: t.batchId,\n wr: e\n };\n }));\n }(e.Gc, r) ];\n\n case 2:\n return o = n.sent(), e.Su.Fi(o.batchId), function(t, e, n) {\n var r = t.$u[t.currentUser.ti()];\n r || (r = new dt(L)), r = r.ot(e, n), t.$u[t.currentUser.ti()] = r;\n }(e, o.batchId, i), [ 4 /*yield*/ , Su(e, o.wr) ];\n\n case 3:\n return n.sent(), [ 4 /*yield*/ , Jo(e.bu) ];\n\n case 4:\n return n.sent(), [ 3 /*break*/ , 6 ];\n\n case 5:\n return u = n.sent(), s = _r(u, \"Failed to persist write\"), i.reject(s), [ 3 /*break*/ , 6 ];\n\n case 6:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }(r.fi, t, i);\n })), i.promise;\n }, t.prototype._ = function() {\n return this.bl._;\n }, t.prototype.W_ = function(t) {\n var r = this;\n this.M_();\n var i = new os(t);\n return this.hs.ws((function() {\n return e(r, void 0, void 0, (function() {\n return n(this, (function(t) {\n return [ 2 /*return*/ , function(t, e) {\n k(t).qs.add(e), \n // Immediately fire an initial event, indicating all existing listeners\n // are in-sync.\n e.next();\n }(this.B_, i) ];\n }));\n }));\n })), function() {\n i.Xl(), r.hs.ws((function() {\n return e(r, void 0, void 0, (function() {\n return n(this, (function(t) {\n return [ 2 /*return*/ , function(t, e) {\n k(t).qs.delete(e);\n }(this.B_, i) ];\n }));\n }));\n }));\n };\n }, Object.defineProperty(t.prototype, \"j_\", {\n get: function() {\n // Technically, the asyncQueue is still running, but only accepting operations\n // related to termination or supposed to be run after termination. It is effectively\n // terminated to the eyes of users.\n return this.hs.ps;\n },\n enumerable: !1,\n configurable: !0\n }), \n /**\n * Takes an updateFunction in which a set of reads and writes can be performed\n * atomically. In the updateFunction, the client can read and write values\n * using the supplied transaction object. After the updateFunction, all\n * changes will be committed. If a retryable error occurs (ex: some other\n * client has changed any of the data referenced), then the updateFunction\n * will be called again after a backoff. If the updateFunction still fails\n * after all retries, then the transaction will be rejected.\n *\n * The transaction object passed to the updateFunction contains methods for\n * accessing documents and collections. Unlike other datastore access, data\n * accessed with the transaction will not reflect local changes that have not\n * been committed. For this reason, it is required that all reads are\n * performed before any writes. Transactions must be performed while online.\n */\n t.prototype.transaction = function(t) {\n var e = this;\n this.M_();\n var n = new sr;\n return this.hs.ws((function() {\n return new Bs(e.hs, e.zc, t, n).run(), Promise.resolve();\n })), n.promise;\n }, t;\n}();\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * TransactionRunner encapsulates the logic needed to run and retry transactions\n * with backoff.\n */ function Ks(t) {\n /**\n * Returns true if obj is an object and contains at least one of the specified\n * methods.\n */\n return function(t, e) {\n if (\"object\" != typeof t || null === t) return !1;\n for (var n = t, r = 0, i = [ \"next\", \"error\", \"complete\" ]; r < i.length; r++) {\n var o = i[r];\n if (o in n && \"function\" == typeof n[o]) return !0;\n }\n return !1;\n }(t);\n}\n\nvar Ws = /** @class */ function() {\n function t(t, e, n, r) {\n this._ = t, this.G_ = e, this.z_ = n, this.H_ = r;\n }\n return t.prototype.J_ = function(t) {\n switch (Kt(t)) {\n case 0 /* NullValue */ :\n return null;\n\n case 1 /* BooleanValue */ :\n return t.booleanValue;\n\n case 2 /* NumberValue */ :\n return Zt(t.integerValue || t.doubleValue);\n\n case 3 /* TimestampValue */ :\n return this.Y_(t.timestampValue);\n\n case 4 /* ServerTimestampValue */ :\n return this.X_(t);\n\n case 5 /* StringValue */ :\n return t.stringValue;\n\n case 6 /* BlobValue */ :\n return this.H_(te(t.bytesValue));\n\n case 7 /* RefValue */ :\n return this.Z_(t.referenceValue);\n\n case 8 /* GeoPointValue */ :\n return this.tf(t.geoPointValue);\n\n case 9 /* ArrayValue */ :\n return this.ef(t.arrayValue);\n\n case 10 /* ObjectValue */ :\n return this.nf(t.mapValue);\n\n default:\n throw S();\n }\n }, t.prototype.nf = function(t) {\n var e = this, n = {};\n return z(t.fields || {}, (function(t, r) {\n n[t] = e.J_(r);\n })), n;\n }, t.prototype.tf = function(t) {\n return new Is(Zt(t.latitude), Zt(t.longitude));\n }, t.prototype.ef = function(t) {\n var e = this;\n return (t.values || []).map((function(t) {\n return e.J_(t);\n }));\n }, t.prototype.X_ = function(t) {\n switch (this.G_) {\n case \"previous\":\n var e = Gt(t);\n return null == e ? null : this.J_(e);\n\n case \"estimate\":\n return this.Y_(Bt(t));\n\n default:\n return null;\n }\n }, t.prototype.Y_ = function(t) {\n var e = $t(t);\n return new Q(e.seconds, e.nanos);\n }, t.prototype.Z_ = function(t) {\n var e = X.q(t);\n x(je(e));\n var n = new G(e.get(1), e.get(3)), r = new Z(e.N(5));\n return n.isEqual(this._) || \n // TODO(b/64130202): Somehow support foreign references.\n N(\"Document \" + r + \" contains a document reference within a different database (\" + n.projectId + \"/\" + n.database + \") which is not supported. It will be treated as a reference in the current database (\" + this._.projectId + \"/\" + this._.database + \") instead.\"), \n this.z_(r);\n }, t;\n}(), Qs = ti.uo, Hs = /** @class */ function() {\n function t(t) {\n var e;\n if (void 0 === t.host) {\n if (void 0 !== t.ssl) throw new I(b.INVALID_ARGUMENT, \"Can't provide ssl option if host option is not set\");\n this.host = \"firestore.googleapis.com\", this.ssl = !0;\n } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;\n if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties, \n void 0 === t.cacheSizeBytes) this.cacheSizeBytes = ti._o; else {\n if (t.cacheSizeBytes !== Qs && t.cacheSizeBytes < ti.lo) throw new I(b.INVALID_ARGUMENT, \"cacheSizeBytes must be at least \" + ti.lo);\n this.cacheSizeBytes = t.cacheSizeBytes;\n }\n this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling, \n as(\"experimentalForceLongPolling\", t.experimentalForceLongPolling, \"experimentalAutoDetectLongPolling\", t.experimentalAutoDetectLongPolling);\n }\n return t.prototype.isEqual = function(t) {\n return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties;\n }, t;\n}(), Ys = \"You are using the memory-only build of Firestore. Persistence support is only available via the @firebase/firestore bundle or the firebase-firestore.js build.\", Xs = /** @class */ function() {\n function t() {}\n return t.prototype.enableIndexedDbPersistence = function(t, e) {\n throw new I(b.FAILED_PRECONDITION, Ys);\n }, t.prototype.enableMultiTabIndexedDbPersistence = function(t) {\n throw new I(b.FAILED_PRECONDITION, Ys);\n }, t.prototype.clearIndexedDbPersistence = function(t) {\n throw new I(b.FAILED_PRECONDITION, Ys);\n }, t;\n}(), Js = /** @class */ function() {\n function t() {}\n return t.prototype.enableIndexedDbPersistence = function(t, e) {\n var n = new is, r = new ns(n, t.sf().cacheSizeBytes, e);\n return t.if(r, n);\n }, t.prototype.enableMultiTabIndexedDbPersistence = function(t) {\n var e = new is, n = new rs(e, t.sf().cacheSizeBytes);\n return t.if(n, e);\n }, t.prototype.clearIndexedDbPersistence = function(t) {\n var r = this, i = new sr;\n return t.rf.bs((function() {\n return e(r, void 0, void 0, (function() {\n var r;\n return n(this, (function(o) {\n switch (o.label) {\n case 0:\n return o.trys.push([ 0, 2, , 3 ]), [ 4 /*yield*/ , function(t) {\n return e(this, void 0, void 0, (function() {\n var e;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return hr.Ln() ? (e = t + \"main\", [ 4 /*yield*/ , hr.delete(e) ]) : [ 2 /*return*/ , Promise.resolve() ];\n\n case 1:\n return n.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }(ao(t.l_, t.af)) ];\n\n case 1:\n return o.sent(), i.resolve(), [ 3 /*break*/ , 3 ];\n\n case 2:\n return r = o.sent(), i.reject(r), [ 3 /*break*/ , 3 ];\n\n case 3:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n })), i.promise;\n }, t;\n}(), $s = /** @class */ function() {\n // Note: We are using `MemoryPersistenceProvider` as a default\n // ComponentProvider to ensure backwards compatibility with the format\n // expected by the console build.\n function t(r, i, o) {\n var u = this;\n if (void 0 === o && (o = new Xs), this.hf = o, this.cf = null, \n // Public for use in tests.\n // TODO(mikelehen): Use modularized initialization instead.\n this.rf = new Er, this.INTERNAL = {\n delete: function() {\n return e(u, void 0, void 0, (function() {\n return n(this, (function(t) {\n switch (t.label) {\n case 0:\n // The client must be initalized to ensure that all subsequent API usage\n // throws an exception.\n return this.uf(), [ 4 /*yield*/ , this.lf.terminate() ];\n\n case 1:\n // The client must be initalized to ensure that all subsequent API usage\n // throws an exception.\n return t.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }\n }, \"object\" == typeof r.options) {\n // This is very likely a Firebase app object\n // TODO(b/34177605): Can we somehow use instanceof?\n var s = r;\n this.cf = s, this.l_ = t._f(s), this.af = s.name, this.ff = new Ao(i);\n } else {\n var a = r;\n if (!a.projectId) throw new I(b.INVALID_ARGUMENT, \"Must provide projectId\");\n this.l_ = new G(a.projectId, a.database), \n // Use a default persistenceKey that lines up with FirebaseApp.\n this.af = \"[DEFAULT]\", this.ff = new No;\n }\n this.df = new Hs({});\n }\n return Object.defineProperty(t.prototype, \"wf\", {\n get: function() {\n return this.Ef || (\n // Lazy initialize UserDataReader once the settings are frozen\n this.Ef = new xs(this.l_, this.df.ignoreUndefinedProperties)), this.Ef;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.settings = function(t) {\n t.merge && \n // Remove the property from the settings once the merge is completed\n delete (t = Object.assign(Object.assign({}, this.df), t)).merge;\n var e = new Hs(t);\n if (this.lf && !this.df.isEqual(e)) throw new I(b.FAILED_PRECONDITION, \"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.\");\n this.df = e, void 0 !== e.credentials && (this.ff = function(t) {\n if (!t) return new No;\n switch (t.type) {\n case \"gapi\":\n var e = t.client;\n // Make sure this really is a Gapi client.\n return x(!(\"object\" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)), \n new So(e, t.sessionIndex || \"0\");\n\n case \"provider\":\n return t.client;\n\n default:\n throw new I(b.INVALID_ARGUMENT, \"makeCredentialsProvider failed due to invalid credential type\");\n }\n }(e.credentials));\n }, t.prototype.useEmulator = function(t, e) {\n \"firestore.googleapis.com\" !== this.df.host && A(\"Host has been set in both settings() and useEmulator(), emulator host will be used\"), \n this.settings({\n host: t + \":\" + e,\n ssl: !1,\n merge: !0\n });\n }, t.prototype.enableNetwork = function() {\n return this.uf(), this.lf.enableNetwork();\n }, t.prototype.disableNetwork = function() {\n return this.uf(), this.lf.disableNetwork();\n }, t.prototype.enablePersistence = function(t) {\n if (this.lf) throw new I(b.FAILED_PRECONDITION, \"Firestore has already been started and persistence can no longer be enabled. You can only call enablePersistence() before calling any other methods on a Firestore object.\");\n var e = !1, n = !1;\n return t && as(\"synchronizeTabs\", e = !!t.synchronizeTabs, \"experimentalForceOwningTab\", n = !!t.experimentalForceOwningTab), \n e ? this.hf.enableMultiTabIndexedDbPersistence(this) : this.hf.enableIndexedDbPersistence(this, n);\n }, t.prototype.clearPersistence = function() {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(t) {\n if (void 0 !== this.lf && !this.lf.j_) throw new I(b.FAILED_PRECONDITION, \"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.\");\n return [ 2 /*return*/ , this.hf.clearIndexedDbPersistence(this) ];\n }));\n }));\n }, t.prototype.terminate = function() {\n return this.app._removeServiceInstance(\"firestore\"), this.INTERNAL.delete();\n }, Object.defineProperty(t.prototype, \"Tf\", {\n get: function() {\n return this.uf(), this.lf.j_;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.waitForPendingWrites = function() {\n return this.uf(), this.lf.waitForPendingWrites();\n }, t.prototype.onSnapshotsInSync = function(t) {\n if (this.uf(), Ks(t)) return this.lf.W_(t);\n var e = {\n next: t\n };\n return this.lf.W_(e);\n }, t.prototype.uf = function() {\n return this.lf || \n // Kick off starting the client but don't actually wait for it.\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.if(new es, new is), this.lf;\n }, t.prototype.If = function() {\n return new j(this.l_, this.af, this.df.host, this.df.ssl, this.df.experimentalForceLongPolling, this.df.experimentalAutoDetectLongPolling);\n }, \n // TODO(schmidt-sebastian): Make this private again in\n // https://github.com/firebase/firebase-js-sdk/pull/3901.\n t.prototype.if = function(t, e) {\n var n = this.If();\n return this.lf = new zs(this.ff, this.rf), this.lf.start(n, t, e);\n }, t._f = function(t) {\n if (e = t.options, \"projectId\", !Object.prototype.hasOwnProperty.call(e, \"projectId\")) throw new I(b.INVALID_ARGUMENT, '\"projectId\" not provided in firebase.initializeApp.');\n var e, n = t.options.projectId;\n if (!n || \"string\" != typeof n) throw new I(b.INVALID_ARGUMENT, \"projectId must be a string in FirebaseApp.options\");\n return new G(n);\n }, Object.defineProperty(t.prototype, \"app\", {\n get: function() {\n if (!this.cf) throw new I(b.FAILED_PRECONDITION, \"Firestore was not initialized using the Firebase SDK. 'app' is not available\");\n return this.cf;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.collection = function(t) {\n return us(\"Firestore.collection\", \"path\", t), this.uf(), new fa(X.q(t), this, \n /* converter= */ null);\n }, t.prototype.doc = function(t) {\n return us(\"Firestore.doc\", \"path\", t), this.uf(), ea.mf(X.q(t), this, \n /* converter= */ null);\n }, t.prototype.collectionGroup = function(t) {\n if (us(\"Firestore.collectionGroup\", \"collectionId\", t), t.indexOf(\"/\") >= 0) throw new I(b.INVALID_ARGUMENT, \"Invalid collection ID '\" + t + \"' passed to function Firestore.collectionGroup(). Collection IDs must not contain '/'.\");\n return this.uf(), new ca(\n /**\n * Creates a new Query for a collection group query that matches all documents\n * within the provided collection group.\n */\n function(t) {\n return new Dn(X.U(), t);\n }(t), this, \n /* converter= */ null);\n }, t.prototype.runTransaction = function(t) {\n var e = this;\n return this.uf().transaction((function(n) {\n return t(new Zs(e, n));\n }));\n }, t.prototype.batch = function() {\n return this.uf(), new ta(this);\n }, \n // Visible for testing.\n t.prototype.sf = function() {\n return this.df;\n }, t;\n}(), Zs = /** @class */ function() {\n function t(t, e) {\n this.Af = t, this.Rf = e;\n }\n return t.prototype.get = function(t) {\n var e = this, n = la(\"Transaction.get\", t, this.Af);\n return this.Rf.b_([ n.__ ]).then((function(t) {\n if (!t || 1 !== t.length) return S();\n var r = t[0];\n if (r instanceof Nn) return new ra(e.Af, n.__, null, \n /* fromCache= */ !1, \n /* hasPendingWrites= */ !1, n.f_);\n if (r instanceof Tn) return new ra(e.Af, n.__, r, \n /* fromCache= */ !1, \n /* hasPendingWrites= */ !1, n.f_);\n throw S();\n }));\n }, t.prototype.set = function(t, e, n) {\n var r = la(\"Transaction.set\", t, this.Af);\n n = ss(\"Transaction.set\", n);\n var i = da(r.f_, e, n), o = ks(this.Af.wf, \"Transaction.set\", r.__, i, null !== r.f_, n);\n return this.Rf.set(r.__, o), this;\n }, t.prototype.update = function(t, e, n) {\n for (var r, i, o = [], u = 3; u < arguments.length; u++) o[u - 3] = arguments[u];\n return \"string\" == typeof e || e instanceof ls ? (r = la(\"Transaction.update\", t, this.Af), \n i = Os(this.Af.wf, \"Transaction.update\", r.__, e, n, o)) : (r = la(\"Transaction.update\", t, this.Af), \n i = Ps(this.Af.wf, \"Transaction.update\", r.__, e)), this.Rf.update(r.__, i), this;\n }, t.prototype.delete = function(t) {\n var e = la(\"Transaction.delete\", t, this.Af);\n return this.Rf.delete(e.__), this;\n }, t;\n}(), ta = /** @class */ function() {\n function t(t) {\n this.Af = t, this.Pf = [], this.gf = !1;\n }\n return t.prototype.set = function(t, e, n) {\n this.Vf();\n var r = la(\"WriteBatch.set\", t, this.Af);\n n = ss(\"WriteBatch.set\", n);\n var i = da(r.f_, e, n), o = ks(this.Af.wf, \"WriteBatch.set\", r.__, i, null !== r.f_, n);\n return this.Pf = this.Pf.concat(o.d_(r.__, rn.ze())), this;\n }, t.prototype.update = function(t, e, n) {\n for (var r, i, o = [], u = 3; u < arguments.length; u++) o[u - 3] = arguments[u];\n return this.Vf(), \"string\" == typeof e || e instanceof ls ? (r = la(\"WriteBatch.update\", t, this.Af), \n i = Os(this.Af.wf, \"WriteBatch.update\", r.__, e, n, o)) : (r = la(\"WriteBatch.update\", t, this.Af), \n i = Ps(this.Af.wf, \"WriteBatch.update\", r.__, e)), this.Pf = this.Pf.concat(i.d_(r.__, rn.exists(!0))), \n this;\n }, t.prototype.delete = function(t) {\n this.Vf();\n var e = la(\"WriteBatch.delete\", t, this.Af);\n return this.Pf = this.Pf.concat(new gn(e.__, rn.ze())), this;\n }, t.prototype.commit = function() {\n return this.Vf(), this.gf = !0, this.Pf.length > 0 ? this.Af.uf().write(this.Pf) : Promise.resolve();\n }, t.prototype.Vf = function() {\n if (this.gf) throw new I(b.FAILED_PRECONDITION, \"A write batch can no longer be used after commit() has been called.\");\n }, t;\n}(), ea = /** @class */ function(e) {\n function n(t, n, r) {\n var i = this;\n return (i = e.call(this, n.l_, t, r) || this).__ = t, i.firestore = n, i.f_ = r, \n i.lf = i.firestore.uf(), i;\n }\n return t(n, e), n.mf = function(t, e, r) {\n if (t.length % 2 != 0) throw new I(b.INVALID_ARGUMENT, \"Invalid document reference. Document references must have an even number of segments, but \" + t.B() + \" has \" + t.length);\n return new n(new Z(t), e, r);\n }, Object.defineProperty(n.prototype, \"id\", {\n get: function() {\n return this.__.path.O();\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(n.prototype, \"parent\", {\n get: function() {\n return new fa(this.__.path.F(), this.firestore, this.f_);\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(n.prototype, \"path\", {\n get: function() {\n return this.__.path.B();\n },\n enumerable: !1,\n configurable: !0\n }), n.prototype.collection = function(t) {\n if (us(\"DocumentReference.collection\", \"path\", t), !t) throw new I(b.INVALID_ARGUMENT, \"Must provide a non-empty collection name to collection()\");\n var e = X.q(t);\n return new fa(this.__.path.child(e), this.firestore, \n /* converter= */ null);\n }, n.prototype.isEqual = function(t) {\n return t instanceof n && this.firestore === t.firestore && this.__.isEqual(t.__) && this.f_ === t.f_;\n }, n.prototype.set = function(t, e) {\n e = ss(\"DocumentReference.set\", e);\n var n = da(this.f_, t, e), r = ks(this.firestore.wf, \"DocumentReference.set\", this.__, n, null !== this.f_, e);\n return this.lf.write(r.d_(this.__, rn.ze()));\n }, n.prototype.update = function(t, e) {\n for (var n, r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i];\n return n = \"string\" == typeof t || t instanceof ls ? Os(this.firestore.wf, \"DocumentReference.update\", this.__, t, e, r) : Ps(this.firestore.wf, \"DocumentReference.update\", this.__, t), \n this.lf.write(n.d_(this.__, rn.exists(!0)));\n }, n.prototype.delete = function() {\n return this.lf.write([ new gn(this.__, rn.ze()) ]);\n }, n.prototype.onSnapshot = function() {\n for (var t, e, n, r = this, i = [], o = 0; o < arguments.length; o++) i[o] = arguments[o];\n var u = {\n includeMetadataChanges: !1\n }, s = 0;\n \"object\" != typeof i[s] || Ks(i[s]) || (u = i[s], s++);\n var a = {\n includeMetadataChanges: u.includeMetadataChanges\n };\n if (Ks(i[s])) {\n var c = i[s];\n i[s] = null === (t = c.next) || void 0 === t ? void 0 : t.bind(c), i[s + 1] = null === (e = c.error) || void 0 === e ? void 0 : e.bind(c), \n i[s + 2] = null === (n = c.complete) || void 0 === n ? void 0 : n.bind(c);\n }\n var h = {\n next: function(t) {\n i[s] && i[s](r.yf(t));\n },\n error: i[s + 1],\n complete: i[s + 2]\n };\n return this.lf.listen(xn(this.__.path), a, h);\n }, n.prototype.get = function(t) {\n var e = this, n = this.firestore.uf();\n return t && \"cache\" === t.source ? n.q_(this.__).then((function(t) {\n return new ra(e.firestore, e.__, t, \n /*fromCache=*/ !0, t instanceof Tn && t.Ye, e.f_);\n })) : n.U_(this.__, t).then((function(t) {\n return e.yf(t);\n }));\n }, n.prototype.withConverter = function(t) {\n return new n(this.__, this.firestore, t);\n }, \n /**\n * Converts a ViewSnapshot that contains the current document to a\n * DocumentSnapshot.\n */\n n.prototype.yf = function(t) {\n var e = t.docs.get(this.__);\n return new ra(this.firestore, this.__, e, t.fromCache, t.hasPendingWrites, this.f_);\n }, n;\n}(Ts), na = /** @class */ function() {\n function t(t, e) {\n this.hasPendingWrites = t, this.fromCache = e\n /**\n * Returns true if this `SnapshotMetadata` is equal to the provided one.\n *\n * @param other The `SnapshotMetadata` to compare against.\n * @return true if this `SnapshotMetadata` is equal to the provided one.\n */;\n }\n return t.prototype.isEqual = function(t) {\n return this.hasPendingWrites === t.hasPendingWrites && this.fromCache === t.fromCache;\n }, t;\n}(), ra = /** @class */ function() {\n function t(t, e, n, r, i, o) {\n this.Af = t, this.__ = e, this.pf = n, this.bf = r, this.vf = i, this.f_ = o;\n }\n return t.prototype.data = function(t) {\n var e = this;\n if (void 0 === t && (t = {}), this.pf) {\n // We only want to use the converter and create a new DocumentSnapshot\n // if a converter has been provided.\n if (this.f_) {\n var n = new ia(this.Af, this.__, this.pf, this.bf, this.vf, \n /* converter= */ null);\n return this.f_.fromFirestore(n, t);\n }\n return new Ws(this.Af.l_, t.serverTimestamps || \"none\", (function(t) {\n return new ea(t, e.Af, /* converter= */ null);\n }), (function(t) {\n return new F(t);\n })).J_(this.pf.rn());\n }\n }, t.prototype.get = function(t, e) {\n var n = this;\n if (void 0 === e && (e = {}), this.pf) {\n var r = this.pf.data().field(Ms(\"DocumentSnapshot.get\", t, this.__));\n if (null !== r) return new Ws(this.Af.l_, e.serverTimestamps || \"none\", (function(t) {\n return new ea(t, n.Af, n.f_);\n }), (function(t) {\n return new F(t);\n })).J_(r);\n }\n }, Object.defineProperty(t.prototype, \"id\", {\n get: function() {\n return this.__.path.O();\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"ref\", {\n get: function() {\n return new ea(this.__, this.Af, this.f_);\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"exists\", {\n get: function() {\n return null !== this.pf;\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"metadata\", {\n get: function() {\n return new na(this.vf, this.bf);\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.isEqual = function(e) {\n return e instanceof t && this.Af === e.Af && this.bf === e.bf && this.__.isEqual(e.__) && (null === this.pf ? null === e.pf : this.pf.isEqual(e.pf)) && this.f_ === e.f_;\n }, t;\n}(), ia = /** @class */ function(e) {\n function n() {\n return null !== e && e.apply(this, arguments) || this;\n }\n return t(n, e), n.prototype.data = function(t) {\n return e.prototype.data.call(this, t);\n }, n;\n}(ra);\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// settings() defaults:\n/**\n * Create a Bound from a query and a document.\n *\n * Note that the Bound will always include the key of the document\n * and so only the provided document will compare equal to the returned\n * position.\n *\n * Will throw if the document does not contain all fields of the order by\n * of the query or if any of the fields in the order by are an uncommitted\n * server timestamp.\n */\n/**\n * Parses the given documentIdValue into a ReferenceValue, throwing\n * appropriate errors if the value is anything other than a DocumentReference\n * or String, or if the string is malformed.\n */\nfunction oa(t, e, n) {\n if (\"string\" == typeof n) {\n if (\"\" === n) throw new I(b.INVALID_ARGUMENT, \"Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.\");\n if (!Vn(e) && -1 !== n.indexOf(\"/\")) throw new I(b.INVALID_ARGUMENT, \"Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '\" + n + \"' contains a '/' character.\");\n var r = e.path.child(X.q(n));\n if (!Z.X(r)) throw new I(b.INVALID_ARGUMENT, \"Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '\" + r + \"' is not because it has an odd number of segments (\" + r.length + \").\");\n return ee(t, new Z(r));\n }\n if (n instanceof Ts) return ee(t, n.__);\n throw new I(b.INVALID_ARGUMENT, \"Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: \" + cs(n) + \".\");\n}\n\n/**\n * Validates that the value passed into a disjunctive filter satisfies all\n * array requirements.\n */ function ua(t, e) {\n if (!Array.isArray(t) || 0 === t.length) throw new I(b.INVALID_ARGUMENT, \"Invalid Query. A non-empty array is required for '\" + e.toString() + \"' filters.\");\n if (t.length > 10) throw new I(b.INVALID_ARGUMENT, \"Invalid Query. '\" + e.toString() + \"' filters support a maximum of 10 elements in the value array.\");\n}\n\nfunction sa(t, e, n) {\n if (!n.isEqual(e)) throw new I(b.INVALID_ARGUMENT, \"Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '\" + e.toString() + \"' and so you must also use '\" + e.toString() + \"' as your first orderBy(), but your first orderBy() is on field '\" + n.toString() + \"' instead.\");\n}\n\nfunction aa(t) {\n if (Pn(t) && 0 === t.on.length) throw new I(b.UNIMPLEMENTED, \"limitToLast() queries require specifying at least one orderBy() clause\");\n}\n\nvar ca = /** @class */ function() {\n function t(t, e, n) {\n this.Sf = t, this.firestore = e, this.f_ = n;\n }\n return t.prototype.where = function(e, n, r) {\n var i = Ms(\"Query.where\", e), o = function(t, e, n, r, i, o, u) {\n var s;\n if (i.W()) {\n if (\"array-contains\" /* ARRAY_CONTAINS */ === o || \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ === o) throw new I(b.INVALID_ARGUMENT, \"Invalid Query. You can't perform '\" + o + \"' queries on FieldPath.documentId().\");\n if (\"in\" /* IN */ === o || \"not-in\" /* NOT_IN */ === o) {\n ua(u, o);\n for (var a = [], c = 0, h = u; c < h.length; c++) {\n var f = h[c];\n a.push(oa(r, t, f));\n }\n s = {\n arrayValue: {\n values: a\n }\n };\n } else s = oa(r, t, u);\n } else \"in\" /* IN */ !== o && \"not-in\" /* NOT_IN */ !== o && \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ !== o || ua(u, o), \n s = Ls(n, e, u, \n /* allowArrays= */ \"in\" /* IN */ === o || \"not-in\" /* NOT_IN */ === o);\n var l = Kn.create(i, o, s);\n return function(t, e) {\n if (e.un()) {\n var n = Ln(t);\n if (null !== n && !n.isEqual(e.field)) throw new I(b.INVALID_ARGUMENT, \"Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on '\" + n.toString() + \"' and '\" + e.field.toString() + \"'\");\n var r = On(t);\n null !== r && sa(0, e.field, r);\n }\n var i = function(t, e) {\n for (var n = 0, r = t.filters; n < r.length; n++) {\n var i = r[n];\n if (e.indexOf(i.op) >= 0) return i.op;\n }\n return null;\n }(t, \n /**\n * Given an operator, returns the set of operators that cannot be used with it.\n *\n * Operators in a query must adhere to the following set of rules:\n * 1. Only one array operator is allowed.\n * 2. Only one disjunctive operator is allowed.\n * 3. NOT_EQUAL cannot be used with another NOT_EQUAL operator.\n * 4. NOT_IN cannot be used with array, disjunctive, or NOT_EQUAL operators.\n *\n * Array operators: ARRAY_CONTAINS, ARRAY_CONTAINS_ANY\n * Disjunctive operators: IN, ARRAY_CONTAINS_ANY, NOT_IN\n */\n function(t) {\n switch (t) {\n case \"!=\" /* NOT_EQUAL */ :\n return [ \"!=\" /* NOT_EQUAL */ , \"not-in\" /* NOT_IN */ ];\n\n case \"array-contains\" /* ARRAY_CONTAINS */ :\n return [ \"array-contains\" /* ARRAY_CONTAINS */ , \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , \"not-in\" /* NOT_IN */ ];\n\n case \"in\" /* IN */ :\n return [ \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , \"in\" /* IN */ , \"not-in\" /* NOT_IN */ ];\n\n case \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ :\n return [ \"array-contains\" /* ARRAY_CONTAINS */ , \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , \"in\" /* IN */ , \"not-in\" /* NOT_IN */ ];\n\n case \"not-in\" /* NOT_IN */ :\n return [ \"array-contains\" /* ARRAY_CONTAINS */ , \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , \"in\" /* IN */ , \"not-in\" /* NOT_IN */ , \"!=\" /* NOT_EQUAL */ ];\n\n default:\n return [];\n }\n }(e.op));\n if (null !== i) \n // Special case when it's a duplicate op to give a slightly clearer error message.\n throw i === e.op ? new I(b.INVALID_ARGUMENT, \"Invalid query. You cannot use more than one '\" + e.op.toString() + \"' filter.\") : new I(b.INVALID_ARGUMENT, \"Invalid query. You cannot use '\" + e.op.toString() + \"' filters with '\" + i.toString() + \"' filters.\");\n }(t, l), l;\n }(this.Sf, \"Query.where\", this.firestore.wf, this.firestore.l_, i, n, r);\n return new t(function(t, e) {\n var n = t.filters.concat([ e ]);\n return new Dn(t.path, t.collectionGroup, t.on.slice(), n, t.limit, t.an, t.startAt, t.endAt);\n }(this.Sf, o), this.firestore, this.f_);\n }, t.prototype.orderBy = function(e, n) {\n var r;\n if (void 0 === n || \"asc\" === n) r = \"asc\" /* ASCENDING */; else {\n if (\"desc\" !== n) throw new I(b.INVALID_ARGUMENT, \"Function Query.orderBy() has unknown direction '\" + n + \"', expected 'asc' or 'desc'.\");\n r = \"desc\" /* DESCENDING */;\n }\n var i = Ms(\"Query.orderBy\", e), o = function(t, e, n) {\n if (null !== t.startAt) throw new I(b.INVALID_ARGUMENT, \"Invalid query. You must not call startAt() or startAfter() before calling orderBy().\");\n if (null !== t.endAt) throw new I(b.INVALID_ARGUMENT, \"Invalid query. You must not call endAt() or endBefore() before calling orderBy().\");\n var r = new ir(e, n);\n return function(t, e) {\n if (null === On(t)) {\n // This is the first order by. It must match any inequality.\n var n = Ln(t);\n null !== n && sa(0, n, e.field);\n }\n }(t, r), r;\n }(this.Sf, i, r);\n return new t(function(t, e) {\n // TODO(dimond): validate that orderBy does not list the same key twice.\n var n = t.on.concat([ e ]);\n return new Dn(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.an, t.startAt, t.endAt);\n }(this.Sf, o), this.firestore, this.f_);\n }, t.prototype.limit = function(e) {\n return hs(\"Query.limit\", e), new t(Un(this.Sf, e, \"F\" /* First */), this.firestore, this.f_);\n }, t.prototype.limitToLast = function(e) {\n return hs(\"Query.limitToLast\", e), new t(Un(this.Sf, e, \"L\" /* Last */), this.firestore, this.f_);\n }, t.prototype.startAt = function(e) {\n for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];\n var i = this.Df(\"Query.startAt\", e, n, \n /*before=*/ !0);\n return new t(Mn(this.Sf, i), this.firestore, this.f_);\n }, t.prototype.startAfter = function(e) {\n for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];\n var i = this.Df(\"Query.startAfter\", e, n, \n /*before=*/ !1);\n return new t(Mn(this.Sf, i), this.firestore, this.f_);\n }, t.prototype.endBefore = function(e) {\n for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];\n var i = this.Df(\"Query.endBefore\", e, n, \n /*before=*/ !0);\n return new t(qn(this.Sf, i), this.firestore, this.f_);\n }, t.prototype.endAt = function(e) {\n for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];\n var i = this.Df(\"Query.endAt\", e, n, \n /*before=*/ !1);\n return new t(qn(this.Sf, i), this.firestore, this.f_);\n }, t.prototype.isEqual = function(e) {\n return e instanceof t && this.firestore === e.firestore && Fn(this.Sf, e.Sf) && this.f_ === e.f_;\n }, t.prototype.withConverter = function(e) {\n return new t(this.Sf, this.firestore, e);\n }, \n /** Helper function to create a bound from a document or fields */ t.prototype.Df = function(t, e, n, r) {\n if (e instanceof ra) return function(t, e, n, r, i) {\n if (!r) throw new I(b.NOT_FOUND, \"Can't use a DocumentSnapshot that doesn't exist for \" + n + \"().\");\n // Because people expect to continue/end a query at the exact document\n // provided, we need to use the implicit sort order rather than the explicit\n // sort order, because it's guaranteed to contain the document key. That way\n // the position becomes unambiguous and the query continues/ends exactly at\n // the provided document. Without the key (by using the explicit sort\n // orders), multiple documents could match the position, yielding duplicate\n // results.\n for (var o = [], u = 0, s = Rn(t); u < s.length; u++) {\n var a = s[u];\n if (a.field.W()) o.push(ee(e, r.key)); else {\n var c = r.field(a.field);\n if (jt(c)) throw new I(b.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field \"' + a.field + '\" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');\n if (null === c) {\n var h = a.field.B();\n throw new I(b.INVALID_ARGUMENT, \"Invalid query. You are trying to start or end a query using a document for which the field '\" + h + \"' (used as the orderBy) does not exist.\");\n }\n o.push(c);\n }\n }\n return new tr(o, i);\n }(this.Sf, this.firestore.l_, t, e.pf, r);\n var i = [ e ].concat(n);\n return function(t, e, n, r, i, o) {\n // Use explicit order by's because it has to match the query the user made\n var u = t.on;\n if (i.length > u.length) throw new I(b.INVALID_ARGUMENT, \"Too many arguments provided to \" + r + \"(). The number of arguments must be less than or equal to the number of orderBy() clauses\");\n for (var s = [], a = 0; a < i.length; a++) {\n var c = i[a];\n if (u[a].field.W()) {\n if (\"string\" != typeof c) throw new I(b.INVALID_ARGUMENT, \"Invalid query. Expected a string for document ID in \" + r + \"(), but got a \" + typeof c);\n if (!Vn(t) && -1 !== c.indexOf(\"/\")) throw new I(b.INVALID_ARGUMENT, \"Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to \" + r + \"() must be a plain document ID, but '\" + c + \"' contains a slash.\");\n var h = t.path.child(X.q(c));\n if (!Z.X(h)) throw new I(b.INVALID_ARGUMENT, \"Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to \" + r + \"() must result in a valid document path, but '\" + h + \"' is not because it contains an odd number of segments.\");\n var f = new Z(h);\n s.push(ee(e, f));\n } else {\n var l = Ls(n, r, c);\n s.push(l);\n }\n }\n return new tr(s, o);\n }(this.Sf, this.firestore.l_, this.firestore.wf, t, i, r);\n }, t.prototype.onSnapshot = function() {\n for (var t, e, n, r = this, i = [], o = 0; o < arguments.length; o++) i[o] = arguments[o];\n var u = {}, s = 0;\n if (\"object\" != typeof i[s] || Ks(i[s]) || (u = i[s], s++), Ks(i[s])) {\n var a = i[s];\n i[s] = null === (t = a.next) || void 0 === t ? void 0 : t.bind(a), i[s + 1] = null === (e = a.error) || void 0 === e ? void 0 : e.bind(a), \n i[s + 2] = null === (n = a.complete) || void 0 === n ? void 0 : n.bind(a);\n }\n var c = {\n next: function(t) {\n i[s] && i[s](new ha(r.firestore, r.Sf, t, r.f_));\n },\n error: i[s + 1],\n complete: i[s + 2]\n };\n return aa(this.Sf), this.firestore.uf().listen(this.Sf, u, c);\n }, t.prototype.get = function(t) {\n var e = this;\n aa(this.Sf);\n var n = this.firestore.uf();\n return (t && \"cache\" === t.source ? n.K_(this.Sf) : n.Q_(this.Sf, t)).then((function(t) {\n return new ha(e.firestore, e.Sf, t, e.f_);\n }));\n }, t;\n}(), ha = /** @class */ function() {\n function t(t, e, n, r) {\n this.Af = t, this.Cf = e, this.Nf = n, this.f_ = r, this.xf = null, this.Ff = null, \n this.metadata = new na(n.hasPendingWrites, n.fromCache);\n }\n return Object.defineProperty(t.prototype, \"docs\", {\n get: function() {\n var t = [];\n return this.forEach((function(e) {\n return t.push(e);\n })), t;\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"empty\", {\n get: function() {\n return this.Nf.docs.P();\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"size\", {\n get: function() {\n return this.Nf.docs.size;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.forEach = function(t, e) {\n var n = this;\n this.Nf.docs.forEach((function(r) {\n t.call(e, n.kf(r, n.metadata.fromCache, n.Nf.Qt.has(r.key)));\n }));\n }, Object.defineProperty(t.prototype, \"query\", {\n get: function() {\n return new ca(this.Cf, this.Af, this.f_);\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.docChanges = function(t) {\n var e = !(!t || !t.includeMetadataChanges);\n if (e && this.Nf.jt) throw new I(b.INVALID_ARGUMENT, \"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().\");\n return this.xf && this.Ff === e || (this.xf = \n /**\n * Calculates the array of DocumentChanges for a given ViewSnapshot.\n *\n * Exported for testing.\n *\n * @param snapshot The ViewSnapshot that represents the expected state.\n * @param includeMetadataChanges Whether to include metadata changes.\n * @param converter A factory function that returns a QueryDocumentSnapshot.\n * @return An object that matches the DocumentChange API.\n */\n function(t, e, n) {\n if (t.Kt.P()) {\n // Special case the first snapshot because index calculation is easy and\n // fast\n var r = 0;\n return t.docChanges.map((function(e) {\n var i = n(e.doc, t.fromCache, t.Qt.has(e.doc.key));\n return e.doc, {\n type: \"added\",\n doc: i,\n oldIndex: -1,\n newIndex: r++\n };\n }));\n }\n // A DocumentSet that is updated incrementally as changes are applied to use\n // to lookup the index of a document.\n var i = t.Kt;\n return t.docChanges.filter((function(t) {\n return e || 3 /* Metadata */ !== t.type;\n })).map((function(e) {\n var r = n(e.doc, t.fromCache, t.Qt.has(e.doc.key)), o = -1, u = -1;\n return 0 /* Added */ !== e.type && (o = i.indexOf(e.doc.key), i = i.delete(e.doc.key)), \n 1 /* Removed */ !== e.type && (u = (i = i.add(e.doc)).indexOf(e.doc.key)), {\n type: pa(e.type),\n doc: r,\n oldIndex: o,\n newIndex: u\n };\n }));\n }(this.Nf, e, this.kf.bind(this)), this.Ff = e), this.xf;\n }, \n /** Check the equality. The call can be very expensive. */ t.prototype.isEqual = function(e) {\n return e instanceof t && this.Af === e.Af && Fn(this.Cf, e.Cf) && this.Nf.isEqual(e.Nf) && this.f_ === e.f_;\n }, t.prototype.kf = function(t, e, n) {\n return new ia(this.Af, t.key, t, e, n, this.f_);\n }, t;\n}(), fa = /** @class */ function(e) {\n function n(t, n, r) {\n var i = this;\n if ((i = e.call(this, xn(t), n, r) || this).Of = t, t.length % 2 != 1) throw new I(b.INVALID_ARGUMENT, \"Invalid collection reference. Collection references must have an odd number of segments, but \" + t.B() + \" has \" + t.length);\n return i;\n }\n return t(n, e), Object.defineProperty(n.prototype, \"id\", {\n get: function() {\n return this.Sf.path.O();\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(n.prototype, \"parent\", {\n get: function() {\n var t = this.Sf.path.F();\n return t.P() ? null : new ea(new Z(t), this.firestore, \n /* converter= */ null);\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(n.prototype, \"path\", {\n get: function() {\n return this.Sf.path.B();\n },\n enumerable: !1,\n configurable: !0\n }), n.prototype.doc = function(t) {\n // We allow omission of 'pathString' but explicitly prohibit passing in both\n // 'undefined' and 'null'.\n 0 === arguments.length && (t = O.t()), us(\"CollectionReference.doc\", \"path\", t);\n var e = X.q(t);\n return ea.mf(this.Sf.path.child(e), this.firestore, this.f_);\n }, n.prototype.add = function(t) {\n var e = this.f_ ? this.f_.toFirestore(t) : t, n = this.doc();\n // Call set() with the converted value directly to avoid calling toFirestore() a second time.\n return new ea(n.__, this.firestore, null).set(e).then((function() {\n return n;\n }));\n }, n.prototype.withConverter = function(t) {\n return new n(this.Of, this.firestore, t);\n }, n;\n}(ca);\n\nfunction la(t, e, n) {\n var r = function(t, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n e) {\n if (!(t instanceof e)) {\n if (e.name === t.constructor.name) throw new I(b.INVALID_ARGUMENT, \"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?\");\n var n = cs(t);\n throw new I(b.INVALID_ARGUMENT, \"Expected type '\" + e.name + \"', but it was: \" + n);\n }\n return t;\n }(e, ea);\n if (r.firestore !== n) throw new I(b.INVALID_ARGUMENT, \"Provided document reference is from a different Firestore instance.\");\n return r;\n}\n\nfunction pa(t) {\n switch (t) {\n case 0 /* Added */ :\n return \"added\";\n\n case 2 /* Modified */ :\n case 3 /* Metadata */ :\n return \"modified\";\n\n case 1 /* Removed */ :\n return \"removed\";\n\n default:\n return S();\n }\n}\n\n/**\n * Converts custom model object of type T into DocumentData by applying the\n * converter if it exists.\n *\n * This function is used when converting user objects to DocumentData\n * because we want to provide the user with a more specific error message if\n * their set() or fails due to invalid data originating from a toFirestore()\n * call.\n */ function da(t, e, n) {\n // Cast to `any` in order to satisfy the union type constraint on\n // toFirestore().\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e;\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ var va = /** @class */ function(e) {\n function n() {\n return null !== e && e.apply(this, arguments) || this;\n }\n return t(n, e), n.serverTimestamp = function() {\n var t = new ms(\"serverTimestamp\");\n return t.t_ = \"FieldValue.serverTimestamp\", new n(t);\n }, n.delete = function() {\n var t = new vs(\"deleteField\");\n return t.t_ = \"FieldValue.delete\", new n(t);\n }, n.arrayUnion = function() {\n for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];\n var r = \n /**\n * Returns a special value that can be used with {@link setDoc()} or {@link\n * updateDoc()} that tells the server to union the given elements with any array\n * value that already exists on the server. Each specified element that doesn't\n * already exist in the array will be added to the end. If the field being\n * modified is not already an array it will be overwritten with an array\n * containing exactly the specified elements.\n *\n * @param elements The elements to union into the array.\n * @return The `FieldValue` sentinel for use in a call to `setDoc()` or\n * `updateDoc()`.\n */\n function() {\n for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];\n // NOTE: We don't actually parse the data until it's used in set() or\n // update() since we'd need the Firestore instance to do this.\n return new gs(\"arrayUnion\", t);\n }.apply(void 0, t);\n return r.t_ = \"FieldValue.arrayUnion\", new n(r);\n }, n.arrayRemove = function() {\n for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];\n var r = function() {\n for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];\n // NOTE: We don't actually parse the data until it's used in set() or\n // update() since we'd need the Firestore instance to do this.\n return new ws(\"arrayRemove\", t);\n }.apply(void 0, t);\n return r.t_ = \"FieldValue.arrayRemove\", new n(r);\n }, n.increment = function(t) {\n var e = function(t) {\n return new bs(\"increment\", t);\n }(t);\n return e.t_ = \"FieldValue.increment\", new n(e);\n }, n.prototype.isEqual = function(t) {\n return this.u_.isEqual(t.u_);\n }, n;\n}(Es), ya = {\n Firestore: $s,\n GeoPoint: Is,\n Timestamp: Q,\n Blob: F,\n Transaction: Zs,\n WriteBatch: ta,\n DocumentReference: ea,\n DocumentSnapshot: ra,\n Query: ca,\n QueryDocumentSnapshot: ia,\n QuerySnapshot: ha,\n CollectionReference: fa,\n FieldPath: ls,\n FieldValue: va,\n setLogLevel: function(t) {\n var e;\n e = t, E.setLogLevel(e);\n },\n CACHE_SIZE_UNLIMITED: Qs\n};\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Configures Firestore as part of the Firebase SDK by calling registerService.\n *\n * @param firebase The FirebaseNamespace to register Firestore with\n * @param firestoreFactory A factory function that returns a new Firestore\n * instance.\n */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Registers the main Firestore build with the components framework.\n * Persistence can be enabled via `firebase.firestore().enablePersistence()`.\n */\nfunction ma(t) {\n !function(t, e) {\n t.INTERNAL.registerComponent(new w(\"firestore\", (function(t) {\n return function(t, e) {\n return new $s(t, e, new Js);\n }(t.getProvider(\"app\").getImmediate(), t.getProvider(\"auth-internal\"));\n }), \"PUBLIC\" /* PUBLIC */).setServiceProps(Object.assign({}, ya)));\n }(t), t.registerVersion(\"@firebase/firestore\", \"2.0.0\");\n}\n\nma(i);\n\nexport { ma as __PRIVATE_registerFirestore };\n//# sourceMappingURL=index.esm.js.map\n","import firebase from '@firebase/app';\nimport { __extends, __awaiter, __generator } from 'tslib';\nimport { Component } from '@firebase/component';\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Standard error codes for different ways a request can fail, as defined by:\r\n * https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto\r\n *\r\n * This map is used primarily to convert from a backend error code string to\r\n * a client SDK error code string, and make sure it's in the supported set.\r\n */\r\nvar errorCodeMap = {\r\n OK: 'ok',\r\n CANCELLED: 'cancelled',\r\n UNKNOWN: 'unknown',\r\n INVALID_ARGUMENT: 'invalid-argument',\r\n DEADLINE_EXCEEDED: 'deadline-exceeded',\r\n NOT_FOUND: 'not-found',\r\n ALREADY_EXISTS: 'already-exists',\r\n PERMISSION_DENIED: 'permission-denied',\r\n UNAUTHENTICATED: 'unauthenticated',\r\n RESOURCE_EXHAUSTED: 'resource-exhausted',\r\n FAILED_PRECONDITION: 'failed-precondition',\r\n ABORTED: 'aborted',\r\n OUT_OF_RANGE: 'out-of-range',\r\n UNIMPLEMENTED: 'unimplemented',\r\n INTERNAL: 'internal',\r\n UNAVAILABLE: 'unavailable',\r\n DATA_LOSS: 'data-loss'\r\n};\r\n/**\r\n * An explicit error that can be thrown from a handler to send an error to the\r\n * client that called the function.\r\n */\r\nvar HttpsErrorImpl = /** @class */ (function (_super) {\r\n __extends(HttpsErrorImpl, _super);\r\n function HttpsErrorImpl(code, message, details) {\r\n var _this = _super.call(this, message) || this;\r\n // This is a workaround for a bug in TypeScript when extending Error:\r\n // tslint:disable-next-line\r\n // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\r\n Object.setPrototypeOf(_this, HttpsErrorImpl.prototype);\r\n _this.code = code;\r\n _this.details = details;\r\n return _this;\r\n }\r\n return HttpsErrorImpl;\r\n}(Error));\r\n/**\r\n * Takes an HTTP status code and returns the corresponding ErrorCode.\r\n * This is the standard HTTP status code -> error mapping defined in:\r\n * https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto\r\n *\r\n * @param status An HTTP status code.\r\n * @return The corresponding ErrorCode, or ErrorCode.UNKNOWN if none.\r\n */\r\nfunction codeForHTTPStatus(status) {\r\n // Make sure any successful status is OK.\r\n if (status >= 200 && status < 300) {\r\n return 'ok';\r\n }\r\n switch (status) {\r\n case 0:\r\n // This can happen if the server returns 500.\r\n return 'internal';\r\n case 400:\r\n return 'invalid-argument';\r\n case 401:\r\n return 'unauthenticated';\r\n case 403:\r\n return 'permission-denied';\r\n case 404:\r\n return 'not-found';\r\n case 409:\r\n return 'aborted';\r\n case 429:\r\n return 'resource-exhausted';\r\n case 499:\r\n return 'cancelled';\r\n case 500:\r\n return 'internal';\r\n case 501:\r\n return 'unimplemented';\r\n case 503:\r\n return 'unavailable';\r\n case 504:\r\n return 'deadline-exceeded';\r\n }\r\n return 'unknown';\r\n}\r\n/**\r\n * Takes an HTTP response and returns the corresponding Error, if any.\r\n */\r\nfunction _errorForResponse(status, bodyJSON, serializer) {\r\n var code = codeForHTTPStatus(status);\r\n // Start with reasonable defaults from the status code.\r\n var description = code;\r\n var details = undefined;\r\n // Then look through the body for explicit details.\r\n try {\r\n var errorJSON = bodyJSON && bodyJSON.error;\r\n if (errorJSON) {\r\n var status_1 = errorJSON.status;\r\n if (typeof status_1 === 'string') {\r\n if (!errorCodeMap[status_1]) {\r\n // They must've included an unknown error code in the body.\r\n return new HttpsErrorImpl('internal', 'internal');\r\n }\r\n code = errorCodeMap[status_1];\r\n // TODO(klimt): Add better default descriptions for error enums.\r\n // The default description needs to be updated for the new code.\r\n description = status_1;\r\n }\r\n var message = errorJSON.message;\r\n if (typeof message === 'string') {\r\n description = message;\r\n }\r\n details = errorJSON.details;\r\n if (details !== undefined) {\r\n details = serializer.decode(details);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // If we couldn't parse explicit error data, that's fine.\r\n }\r\n if (code === 'ok') {\r\n // Technically, there's an edge case where a developer could explicitly\r\n // return an error code of OK, and we will treat it as success, but that\r\n // seems reasonable.\r\n return null;\r\n }\r\n return new HttpsErrorImpl(code, description, details);\r\n}\n\n/**\r\n * Helper class to get metadata that should be included with a function call.\r\n */\r\nvar ContextProvider = /** @class */ (function () {\r\n function ContextProvider(authProvider, messagingProvider) {\r\n var _this = this;\r\n this.auth = null;\r\n this.messaging = null;\r\n this.auth = authProvider.getImmediate({ optional: true });\r\n this.messaging = messagingProvider.getImmediate({\r\n optional: true\r\n });\r\n if (!this.auth) {\r\n authProvider.get().then(function (auth) { return (_this.auth = auth); }, function () {\r\n /* get() never rejects */\r\n });\r\n }\r\n if (!this.messaging) {\r\n messagingProvider.get().then(function (messaging) { return (_this.messaging = messaging); }, function () {\r\n /* get() never rejects */\r\n });\r\n }\r\n }\r\n ContextProvider.prototype.getAuthToken = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var token, e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!this.auth) {\r\n return [2 /*return*/, undefined];\r\n }\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, this.auth.getToken()];\r\n case 2:\r\n token = _a.sent();\r\n if (!token) {\r\n return [2 /*return*/, undefined];\r\n }\r\n return [2 /*return*/, token.accessToken];\r\n case 3:\r\n e_1 = _a.sent();\r\n // If there's any error when trying to get the auth token, leave it off.\r\n return [2 /*return*/, undefined];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n ContextProvider.prototype.getInstanceIdToken = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n if (!this.messaging ||\r\n !('Notification' in self) ||\r\n Notification.permission !== 'granted') {\r\n return [2 /*return*/, undefined];\r\n }\r\n try {\r\n return [2 /*return*/, this.messaging.getToken()];\r\n }\r\n catch (e) {\r\n // We don't warn on this, because it usually means messaging isn't set up.\r\n // console.warn('Failed to retrieve instance id token.', e);\r\n // If there's any error when trying to get the token, leave it off.\r\n return [2 /*return*/, undefined];\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n ContextProvider.prototype.getContext = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var authToken, instanceIdToken;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.getAuthToken()];\r\n case 1:\r\n authToken = _a.sent();\r\n return [4 /*yield*/, this.getInstanceIdToken()];\r\n case 2:\r\n instanceIdToken = _a.sent();\r\n return [2 /*return*/, { authToken: authToken, instanceIdToken: instanceIdToken }];\r\n }\r\n });\r\n });\r\n };\r\n return ContextProvider;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar LONG_TYPE = 'type.googleapis.com/google.protobuf.Int64Value';\r\nvar UNSIGNED_LONG_TYPE = 'type.googleapis.com/google.protobuf.UInt64Value';\r\nfunction mapValues(\r\n// { [k: string]: unknown } is no longer a wildcard assignment target after typescript 3.5\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\no, f) {\r\n var result = {};\r\n for (var key in o) {\r\n if (o.hasOwnProperty(key)) {\r\n result[key] = f(o[key]);\r\n }\r\n }\r\n return result;\r\n}\r\nvar Serializer = /** @class */ (function () {\r\n function Serializer() {\r\n }\r\n // Takes data and encodes it in a JSON-friendly way, such that types such as\r\n // Date are preserved.\r\n Serializer.prototype.encode = function (data) {\r\n var _this = this;\r\n if (data == null) {\r\n return null;\r\n }\r\n if (data instanceof Number) {\r\n data = data.valueOf();\r\n }\r\n if (typeof data === 'number' && isFinite(data)) {\r\n // Any number in JS is safe to put directly in JSON and parse as a double\r\n // without any loss of precision.\r\n return data;\r\n }\r\n if (data === true || data === false) {\r\n return data;\r\n }\r\n if (Object.prototype.toString.call(data) === '[object String]') {\r\n return data;\r\n }\r\n if (Array.isArray(data)) {\r\n return data.map(function (x) { return _this.encode(x); });\r\n }\r\n if (typeof data === 'function' || typeof data === 'object') {\r\n return mapValues(data, function (x) { return _this.encode(x); });\r\n }\r\n // If we got this far, the data is not encodable.\r\n throw new Error('Data cannot be encoded in JSON: ' + data);\r\n };\r\n // Takes data that's been encoded in a JSON-friendly form and returns a form\r\n // with richer datatypes, such as Dates, etc.\r\n Serializer.prototype.decode = function (json) {\r\n var _this = this;\r\n if (json == null) {\r\n return json;\r\n }\r\n if (json['@type']) {\r\n switch (json['@type']) {\r\n case LONG_TYPE:\r\n // Fall through and handle this the same as unsigned.\r\n case UNSIGNED_LONG_TYPE: {\r\n // Technically, this could work return a valid number for malformed\r\n // data if there was a number followed by garbage. But it's just not\r\n // worth all the extra code to detect that case.\r\n var value = Number(json['value']);\r\n if (isNaN(value)) {\r\n throw new Error('Data cannot be decoded from JSON: ' + json);\r\n }\r\n return value;\r\n }\r\n default: {\r\n throw new Error('Data cannot be decoded from JSON: ' + json);\r\n }\r\n }\r\n }\r\n if (Array.isArray(json)) {\r\n return json.map(function (x) { return _this.decode(x); });\r\n }\r\n if (typeof json === 'function' || typeof json === 'object') {\r\n return mapValues(json, function (x) { return _this.decode(x); });\r\n }\r\n // Anything else is safe to return.\r\n return json;\r\n };\r\n return Serializer;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns a Promise that will be rejected after the given duration.\r\n * The error will be of type HttpsErrorImpl.\r\n *\r\n * @param millis Number of milliseconds to wait before rejecting.\r\n */\r\nfunction failAfter(millis) {\r\n var timer;\r\n var promise = new Promise(function (_, reject) {\r\n timer = setTimeout(function () {\r\n reject(new HttpsErrorImpl('deadline-exceeded', 'deadline-exceeded'));\r\n }, millis);\r\n });\r\n return {\r\n timer: timer,\r\n promise: promise\r\n };\r\n}\r\n/**\r\n * The main class for the Firebase Functions SDK.\r\n */\r\nvar Service = /** @class */ (function () {\r\n /**\r\n * Creates a new Functions service for the given app and (optional) region or custom domain.\r\n * @param app_ The FirebaseApp to use.\r\n * @param regionOrCustomDomain_ one of:\r\n * a) A region to call functions from, such as us-central1\r\n * b) A custom domain to use as a functions prefix, such as https://mydomain.com\r\n */\r\n function Service(app_, authProvider, messagingProvider, regionOrCustomDomain_, fetchImpl) {\r\n var _this = this;\r\n if (regionOrCustomDomain_ === void 0) { regionOrCustomDomain_ = 'us-central1'; }\r\n this.app_ = app_;\r\n this.fetchImpl = fetchImpl;\r\n this.serializer = new Serializer();\r\n this.emulatorOrigin = null;\r\n this.INTERNAL = {\r\n delete: function () {\r\n return Promise.resolve(_this.deleteService());\r\n }\r\n };\r\n this.contextProvider = new ContextProvider(authProvider, messagingProvider);\r\n // Cancels all ongoing requests when resolved.\r\n this.cancelAllRequests = new Promise(function (resolve) {\r\n _this.deleteService = function () {\r\n return resolve();\r\n };\r\n });\r\n // Resolve the region or custom domain overload by attempting to parse it.\r\n try {\r\n var url = new URL(regionOrCustomDomain_);\r\n this.customDomain = url.origin;\r\n this.region = 'us-central1';\r\n }\r\n catch (e) {\r\n this.customDomain = null;\r\n this.region = regionOrCustomDomain_;\r\n }\r\n }\r\n Object.defineProperty(Service.prototype, \"app\", {\r\n get: function () {\r\n return this.app_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns the URL for a callable with the given name.\r\n * @param name The name of the callable.\r\n */\r\n Service.prototype._url = function (name) {\r\n var projectId = this.app_.options.projectId;\r\n if (this.emulatorOrigin !== null) {\r\n var origin_1 = this.emulatorOrigin;\r\n return origin_1 + \"/\" + projectId + \"/\" + this.region + \"/\" + name;\r\n }\r\n if (this.customDomain !== null) {\r\n return this.customDomain + \"/\" + name;\r\n }\r\n return \"https://\" + this.region + \"-\" + projectId + \".cloudfunctions.net/\" + name;\r\n };\r\n /**\r\n * Modify this instance to communicate with the Cloud Functions emulator.\r\n *\r\n * Note: this must be called before this instance has been used to do any operations.\r\n *\r\n * @param host The emulator host (ex: localhost)\r\n * @param port The emulator port (ex: 5001)\r\n */\r\n Service.prototype.useEmulator = function (host, port) {\r\n this.emulatorOrigin = \"http://\" + host + \":\" + port;\r\n };\r\n /**\r\n * Changes this instance to point to a Cloud Functions emulator running\r\n * locally. See https://firebase.google.com/docs/functions/local-emulator\r\n *\r\n * @deprecated Prefer the useEmulator(host, port) method.\r\n * @param origin The origin of the local emulator, such as\r\n * \"http://localhost:5005\".\r\n */\r\n Service.prototype.useFunctionsEmulator = function (origin) {\r\n this.emulatorOrigin = origin;\r\n };\r\n /**\r\n * Returns a reference to the callable https trigger with the given name.\r\n * @param name The name of the trigger.\r\n */\r\n Service.prototype.httpsCallable = function (name, options) {\r\n var _this = this;\r\n return function (data) {\r\n return _this.call(name, data, options || {});\r\n };\r\n };\r\n /**\r\n * Does an HTTP POST and returns the completed response.\r\n * @param url The url to post to.\r\n * @param body The JSON body of the post.\r\n * @param headers The HTTP headers to include in the request.\r\n * @return A Promise that will succeed when the request finishes.\r\n */\r\n Service.prototype.postJSON = function (url, body, headers) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var response, e_1, json, e_2;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n headers['Content-Type'] = 'application/json';\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, this.fetchImpl(url, {\r\n method: 'POST',\r\n body: JSON.stringify(body),\r\n headers: headers\r\n })];\r\n case 2:\r\n response = _a.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n e_1 = _a.sent();\r\n // This could be an unhandled error on the backend, or it could be a\r\n // network error. There's no way to know, since an unhandled error on the\r\n // backend will fail to set the proper CORS header, and thus will be\r\n // treated as a network error by fetch.\r\n return [2 /*return*/, {\r\n status: 0,\r\n json: null\r\n }];\r\n case 4:\r\n json = null;\r\n _a.label = 5;\r\n case 5:\r\n _a.trys.push([5, 7, , 8]);\r\n return [4 /*yield*/, response.json()];\r\n case 6:\r\n json = _a.sent();\r\n return [3 /*break*/, 8];\r\n case 7:\r\n e_2 = _a.sent();\r\n return [3 /*break*/, 8];\r\n case 8: return [2 /*return*/, {\r\n status: response.status,\r\n json: json\r\n }];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Calls a callable function asynchronously and returns the result.\r\n * @param name The name of the callable trigger.\r\n * @param data The data to pass as params to the function.s\r\n */\r\n Service.prototype.call = function (name, data, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var url, body, headers, context, timeout, _a, timer, failAfterPromise, response, error, responseData, decodedData;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n url = this._url(name);\r\n // Encode any special types, such as dates, in the input data.\r\n data = this.serializer.encode(data);\r\n body = { data: data };\r\n headers = {};\r\n return [4 /*yield*/, this.contextProvider.getContext()];\r\n case 1:\r\n context = _b.sent();\r\n if (context.authToken) {\r\n headers['Authorization'] = 'Bearer ' + context.authToken;\r\n }\r\n if (context.instanceIdToken) {\r\n headers['Firebase-Instance-ID-Token'] = context.instanceIdToken;\r\n }\r\n timeout = options.timeout || 70000;\r\n _a = failAfter(timeout), timer = _a.timer, failAfterPromise = _a.promise;\r\n return [4 /*yield*/, Promise.race([\r\n clearTimeoutWrapper(timer, this.postJSON(url, body, headers)),\r\n failAfterPromise,\r\n clearTimeoutWrapper(timer, this.cancelAllRequests)\r\n ])];\r\n case 2:\r\n response = _b.sent();\r\n // If service was deleted, interrupted response throws an error.\r\n if (!response) {\r\n throw new HttpsErrorImpl('cancelled', 'Firebase Functions instance was deleted.');\r\n }\r\n error = _errorForResponse(response.status, response.json, this.serializer);\r\n if (error) {\r\n throw error;\r\n }\r\n if (!response.json) {\r\n throw new HttpsErrorImpl('internal', 'Response is not valid JSON object.');\r\n }\r\n responseData = response.json.data;\r\n // TODO(klimt): For right now, allow \"result\" instead of \"data\", for\r\n // backwards compatibility.\r\n if (typeof responseData === 'undefined') {\r\n responseData = response.json.result;\r\n }\r\n if (typeof responseData === 'undefined') {\r\n // Consider the response malformed.\r\n throw new HttpsErrorImpl('internal', 'Response is missing data field.');\r\n }\r\n decodedData = this.serializer.decode(responseData);\r\n return [2 /*return*/, { data: decodedData }];\r\n }\r\n });\r\n });\r\n };\r\n return Service;\r\n}());\r\nfunction clearTimeoutWrapper(timer, promise) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var result;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, promise];\r\n case 1:\r\n result = _a.sent();\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n clearTimeout(timer);\r\n return [2 /*return*/, result];\r\n }\r\n });\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Type constant for Firebase Functions.\r\n */\r\nvar FUNCTIONS_TYPE = 'functions';\r\nfunction registerFunctions(instance, fetchImpl) {\r\n var namespaceExports = {\r\n // no-inline\r\n Functions: Service\r\n };\r\n function factory(container, regionOrCustomDomain) {\r\n // Dependencies\r\n var app = container.getProvider('app').getImmediate();\r\n var authProvider = container.getProvider('auth-internal');\r\n var messagingProvider = container.getProvider('messaging');\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return new Service(app, authProvider, messagingProvider, regionOrCustomDomain, fetchImpl);\r\n }\r\n instance.INTERNAL.registerComponent(new Component(FUNCTIONS_TYPE, factory, \"PUBLIC\" /* PUBLIC */)\r\n .setServiceProps(namespaceExports)\r\n .setMultipleInstances(true));\r\n}\n\nvar name = \"@firebase/functions\";\nvar version = \"0.6.0\";\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nregisterFunctions(firebase, fetch.bind(self));\r\nfirebase.registerVersion(name, version);\n//# sourceMappingURL=index.esm.js.map\n","import firebase from '@firebase/app';\nimport { Component } from '@firebase/component';\nimport { __awaiter, __generator, __spread, __values, __assign } from 'tslib';\nimport { ErrorFactory, FirebaseError } from '@firebase/util';\nimport { openDb } from 'idb';\n\nvar name = \"@firebase/installations\";\nvar version = \"0.4.18\";\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar PENDING_TIMEOUT_MS = 10000;\r\nvar PACKAGE_VERSION = \"w:\" + version;\r\nvar INTERNAL_AUTH_VERSION = 'FIS_v2';\r\nvar INSTALLATIONS_API_URL = 'https://firebaseinstallations.googleapis.com/v1';\r\nvar TOKEN_EXPIRATION_BUFFER = 60 * 60 * 1000; // One hour\r\nvar SERVICE = 'installations';\r\nvar SERVICE_NAME = 'Installations';\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar _a;\r\nvar ERROR_DESCRIPTION_MAP = (_a = {},\r\n _a[\"missing-app-config-values\" /* MISSING_APP_CONFIG_VALUES */] = 'Missing App configuration value: \"{$valueName}\"',\r\n _a[\"not-registered\" /* NOT_REGISTERED */] = 'Firebase Installation is not registered.',\r\n _a[\"installation-not-found\" /* INSTALLATION_NOT_FOUND */] = 'Firebase Installation not found.',\r\n _a[\"request-failed\" /* REQUEST_FAILED */] = '{$requestName} request failed with error \"{$serverCode} {$serverStatus}: {$serverMessage}\"',\r\n _a[\"app-offline\" /* APP_OFFLINE */] = 'Could not process request. Application offline.',\r\n _a[\"delete-pending-registration\" /* DELETE_PENDING_REGISTRATION */] = \"Can't delete installation while there is a pending registration request.\",\r\n _a);\r\nvar ERROR_FACTORY = new ErrorFactory(SERVICE, SERVICE_NAME, ERROR_DESCRIPTION_MAP);\r\n/** Returns true if error is a FirebaseError that is based on an error from the server. */\r\nfunction isServerError(error) {\r\n return (error instanceof FirebaseError &&\r\n error.code.includes(\"request-failed\" /* REQUEST_FAILED */));\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction getInstallationsEndpoint(_a) {\r\n var projectId = _a.projectId;\r\n return INSTALLATIONS_API_URL + \"/projects/\" + projectId + \"/installations\";\r\n}\r\nfunction extractAuthTokenInfoFromResponse(response) {\r\n return {\r\n token: response.token,\r\n requestStatus: 2 /* COMPLETED */,\r\n expiresIn: getExpiresInFromResponseExpiresIn(response.expiresIn),\r\n creationTime: Date.now()\r\n };\r\n}\r\nfunction getErrorFromResponse(requestName, response) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var responseJson, errorData;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, response.json()];\r\n case 1:\r\n responseJson = _a.sent();\r\n errorData = responseJson.error;\r\n return [2 /*return*/, ERROR_FACTORY.create(\"request-failed\" /* REQUEST_FAILED */, {\r\n requestName: requestName,\r\n serverCode: errorData.code,\r\n serverMessage: errorData.message,\r\n serverStatus: errorData.status\r\n })];\r\n }\r\n });\r\n });\r\n}\r\nfunction getHeaders(_a) {\r\n var apiKey = _a.apiKey;\r\n return new Headers({\r\n 'Content-Type': 'application/json',\r\n Accept: 'application/json',\r\n 'x-goog-api-key': apiKey\r\n });\r\n}\r\nfunction getHeadersWithAuth(appConfig, _a) {\r\n var refreshToken = _a.refreshToken;\r\n var headers = getHeaders(appConfig);\r\n headers.append('Authorization', getAuthorizationHeader(refreshToken));\r\n return headers;\r\n}\r\n/**\r\n * Calls the passed in fetch wrapper and returns the response.\r\n * If the returned response has a status of 5xx, re-runs the function once and\r\n * returns the response.\r\n */\r\nfunction retryIfServerError(fn) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var result;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, fn()];\r\n case 1:\r\n result = _a.sent();\r\n if (result.status >= 500 && result.status < 600) {\r\n // Internal Server Error. Retry request.\r\n return [2 /*return*/, fn()];\r\n }\r\n return [2 /*return*/, result];\r\n }\r\n });\r\n });\r\n}\r\nfunction getExpiresInFromResponseExpiresIn(responseExpiresIn) {\r\n // This works because the server will never respond with fractions of a second.\r\n return Number(responseExpiresIn.replace('s', '000'));\r\n}\r\nfunction getAuthorizationHeader(refreshToken) {\r\n return INTERNAL_AUTH_VERSION + \" \" + refreshToken;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction createInstallationRequest(appConfig, _a) {\r\n var fid = _a.fid;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var endpoint, headers, body, request, response, responseValue, registeredInstallationEntry;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n endpoint = getInstallationsEndpoint(appConfig);\r\n headers = getHeaders(appConfig);\r\n body = {\r\n fid: fid,\r\n authVersion: INTERNAL_AUTH_VERSION,\r\n appId: appConfig.appId,\r\n sdkVersion: PACKAGE_VERSION\r\n };\r\n request = {\r\n method: 'POST',\r\n headers: headers,\r\n body: JSON.stringify(body)\r\n };\r\n return [4 /*yield*/, retryIfServerError(function () { return fetch(endpoint, request); })];\r\n case 1:\r\n response = _b.sent();\r\n if (!response.ok) return [3 /*break*/, 3];\r\n return [4 /*yield*/, response.json()];\r\n case 2:\r\n responseValue = _b.sent();\r\n registeredInstallationEntry = {\r\n fid: responseValue.fid || fid,\r\n registrationStatus: 2 /* COMPLETED */,\r\n refreshToken: responseValue.refreshToken,\r\n authToken: extractAuthTokenInfoFromResponse(responseValue.authToken)\r\n };\r\n return [2 /*return*/, registeredInstallationEntry];\r\n case 3: return [4 /*yield*/, getErrorFromResponse('Create Installation', response)];\r\n case 4: throw _b.sent();\r\n }\r\n });\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Returns a promise that resolves after given time passes. */\r\nfunction sleep(ms) {\r\n return new Promise(function (resolve) {\r\n setTimeout(resolve, ms);\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction bufferToBase64UrlSafe(array) {\r\n var b64 = btoa(String.fromCharCode.apply(String, __spread(array)));\r\n return b64.replace(/\\+/g, '-').replace(/\\//g, '_');\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar VALID_FID_PATTERN = /^[cdef][\\w-]{21}$/;\r\nvar INVALID_FID = '';\r\n/**\r\n * Generates a new FID using random values from Web Crypto API.\r\n * Returns an empty string if FID generation fails for any reason.\r\n */\r\nfunction generateFid() {\r\n try {\r\n // A valid FID has exactly 22 base64 characters, which is 132 bits, or 16.5\r\n // bytes. our implementation generates a 17 byte array instead.\r\n var fidByteArray = new Uint8Array(17);\r\n var crypto_1 = self.crypto || self.msCrypto;\r\n crypto_1.getRandomValues(fidByteArray);\r\n // Replace the first 4 random bits with the constant FID header of 0b0111.\r\n fidByteArray[0] = 112 + (fidByteArray[0] % 16);\r\n var fid = encode(fidByteArray);\r\n return VALID_FID_PATTERN.test(fid) ? fid : INVALID_FID;\r\n }\r\n catch (_a) {\r\n // FID generation errored\r\n return INVALID_FID;\r\n }\r\n}\r\n/** Converts a FID Uint8Array to a base64 string representation. */\r\nfunction encode(fidByteArray) {\r\n var b64String = bufferToBase64UrlSafe(fidByteArray);\r\n // Remove the 23rd character that was added because of the extra 4 bits at the\r\n // end of our 17 byte array, and the '=' padding.\r\n return b64String.substr(0, 22);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Returns a string key that can be used to identify the app. */\r\nfunction getKey(appConfig) {\r\n return appConfig.appName + \"!\" + appConfig.appId;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar fidChangeCallbacks = new Map();\r\n/**\r\n * Calls the onIdChange callbacks with the new FID value, and broadcasts the\r\n * change to other tabs.\r\n */\r\nfunction fidChanged(appConfig, fid) {\r\n var key = getKey(appConfig);\r\n callFidChangeCallbacks(key, fid);\r\n broadcastFidChange(key, fid);\r\n}\r\nfunction addCallback(appConfig, callback) {\r\n // Open the broadcast channel if it's not already open,\r\n // to be able to listen to change events from other tabs.\r\n getBroadcastChannel();\r\n var key = getKey(appConfig);\r\n var callbackSet = fidChangeCallbacks.get(key);\r\n if (!callbackSet) {\r\n callbackSet = new Set();\r\n fidChangeCallbacks.set(key, callbackSet);\r\n }\r\n callbackSet.add(callback);\r\n}\r\nfunction removeCallback(appConfig, callback) {\r\n var key = getKey(appConfig);\r\n var callbackSet = fidChangeCallbacks.get(key);\r\n if (!callbackSet) {\r\n return;\r\n }\r\n callbackSet.delete(callback);\r\n if (callbackSet.size === 0) {\r\n fidChangeCallbacks.delete(key);\r\n }\r\n // Close broadcast channel if there are no more callbacks.\r\n closeBroadcastChannel();\r\n}\r\nfunction callFidChangeCallbacks(key, fid) {\r\n var e_1, _a;\r\n var callbacks = fidChangeCallbacks.get(key);\r\n if (!callbacks) {\r\n return;\r\n }\r\n try {\r\n for (var callbacks_1 = __values(callbacks), callbacks_1_1 = callbacks_1.next(); !callbacks_1_1.done; callbacks_1_1 = callbacks_1.next()) {\r\n var callback = callbacks_1_1.value;\r\n callback(fid);\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (callbacks_1_1 && !callbacks_1_1.done && (_a = callbacks_1.return)) _a.call(callbacks_1);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n}\r\nfunction broadcastFidChange(key, fid) {\r\n var channel = getBroadcastChannel();\r\n if (channel) {\r\n channel.postMessage({ key: key, fid: fid });\r\n }\r\n closeBroadcastChannel();\r\n}\r\nvar broadcastChannel = null;\r\n/** Opens and returns a BroadcastChannel if it is supported by the browser. */\r\nfunction getBroadcastChannel() {\r\n if (!broadcastChannel && 'BroadcastChannel' in self) {\r\n broadcastChannel = new BroadcastChannel('[Firebase] FID Change');\r\n broadcastChannel.onmessage = function (e) {\r\n callFidChangeCallbacks(e.data.key, e.data.fid);\r\n };\r\n }\r\n return broadcastChannel;\r\n}\r\nfunction closeBroadcastChannel() {\r\n if (fidChangeCallbacks.size === 0 && broadcastChannel) {\r\n broadcastChannel.close();\r\n broadcastChannel = null;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DATABASE_NAME = 'firebase-installations-database';\r\nvar DATABASE_VERSION = 1;\r\nvar OBJECT_STORE_NAME = 'firebase-installations-store';\r\nvar dbPromise = null;\r\nfunction getDbPromise() {\r\n if (!dbPromise) {\r\n dbPromise = openDb(DATABASE_NAME, DATABASE_VERSION, function (upgradeDB) {\r\n // We don't use 'break' in this switch statement, the fall-through\r\n // behavior is what we want, because if there are multiple versions between\r\n // the old version and the current version, we want ALL the migrations\r\n // that correspond to those versions to run, not only the last one.\r\n // eslint-disable-next-line default-case\r\n switch (upgradeDB.oldVersion) {\r\n case 0:\r\n upgradeDB.createObjectStore(OBJECT_STORE_NAME);\r\n }\r\n });\r\n }\r\n return dbPromise;\r\n}\r\n/** Assigns or overwrites the record for the given key with the given value. */\r\nfunction set(appConfig, value) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var key, db, tx, objectStore, oldValue;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n key = getKey(appConfig);\r\n return [4 /*yield*/, getDbPromise()];\r\n case 1:\r\n db = _a.sent();\r\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\r\n objectStore = tx.objectStore(OBJECT_STORE_NAME);\r\n return [4 /*yield*/, objectStore.get(key)];\r\n case 2:\r\n oldValue = _a.sent();\r\n return [4 /*yield*/, objectStore.put(value, key)];\r\n case 3:\r\n _a.sent();\r\n return [4 /*yield*/, tx.complete];\r\n case 4:\r\n _a.sent();\r\n if (!oldValue || oldValue.fid !== value.fid) {\r\n fidChanged(appConfig, value.fid);\r\n }\r\n return [2 /*return*/, value];\r\n }\r\n });\r\n });\r\n}\r\n/** Removes record(s) from the objectStore that match the given key. */\r\nfunction remove(appConfig) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var key, db, tx;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n key = getKey(appConfig);\r\n return [4 /*yield*/, getDbPromise()];\r\n case 1:\r\n db = _a.sent();\r\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\r\n return [4 /*yield*/, tx.objectStore(OBJECT_STORE_NAME).delete(key)];\r\n case 2:\r\n _a.sent();\r\n return [4 /*yield*/, tx.complete];\r\n case 3:\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Atomically updates a record with the result of updateFn, which gets\r\n * called with the current value. If newValue is undefined, the record is\r\n * deleted instead.\r\n * @return Updated value\r\n */\r\nfunction update(appConfig, updateFn) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var key, db, tx, store, oldValue, newValue;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n key = getKey(appConfig);\r\n return [4 /*yield*/, getDbPromise()];\r\n case 1:\r\n db = _a.sent();\r\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\r\n store = tx.objectStore(OBJECT_STORE_NAME);\r\n return [4 /*yield*/, store.get(key)];\r\n case 2:\r\n oldValue = _a.sent();\r\n newValue = updateFn(oldValue);\r\n if (!(newValue === undefined)) return [3 /*break*/, 4];\r\n return [4 /*yield*/, store.delete(key)];\r\n case 3:\r\n _a.sent();\r\n return [3 /*break*/, 6];\r\n case 4: return [4 /*yield*/, store.put(newValue, key)];\r\n case 5:\r\n _a.sent();\r\n _a.label = 6;\r\n case 6: return [4 /*yield*/, tx.complete];\r\n case 7:\r\n _a.sent();\r\n if (newValue && (!oldValue || oldValue.fid !== newValue.fid)) {\r\n fidChanged(appConfig, newValue.fid);\r\n }\r\n return [2 /*return*/, newValue];\r\n }\r\n });\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Updates and returns the InstallationEntry from the database.\r\n * Also triggers a registration request if it is necessary and possible.\r\n */\r\nfunction getInstallationEntry(appConfig) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var registrationPromise, installationEntry;\r\n var _a;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, update(appConfig, function (oldEntry) {\r\n var installationEntry = updateOrCreateInstallationEntry(oldEntry);\r\n var entryWithPromise = triggerRegistrationIfNecessary(appConfig, installationEntry);\r\n registrationPromise = entryWithPromise.registrationPromise;\r\n return entryWithPromise.installationEntry;\r\n })];\r\n case 1:\r\n installationEntry = _b.sent();\r\n if (!(installationEntry.fid === INVALID_FID)) return [3 /*break*/, 3];\r\n _a = {};\r\n return [4 /*yield*/, registrationPromise];\r\n case 2: \r\n // FID generation failed. Waiting for the FID from the server.\r\n return [2 /*return*/, (_a.installationEntry = _b.sent(), _a)];\r\n case 3: return [2 /*return*/, {\r\n installationEntry: installationEntry,\r\n registrationPromise: registrationPromise\r\n }];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Creates a new Installation Entry if one does not exist.\r\n * Also clears timed out pending requests.\r\n */\r\nfunction updateOrCreateInstallationEntry(oldEntry) {\r\n var entry = oldEntry || {\r\n fid: generateFid(),\r\n registrationStatus: 0 /* NOT_STARTED */\r\n };\r\n return clearTimedOutRequest(entry);\r\n}\r\n/**\r\n * If the Firebase Installation is not registered yet, this will trigger the\r\n * registration and return an InProgressInstallationEntry.\r\n *\r\n * If registrationPromise does not exist, the installationEntry is guaranteed\r\n * to be registered.\r\n */\r\nfunction triggerRegistrationIfNecessary(appConfig, installationEntry) {\r\n if (installationEntry.registrationStatus === 0 /* NOT_STARTED */) {\r\n if (!navigator.onLine) {\r\n // Registration required but app is offline.\r\n var registrationPromiseWithError = Promise.reject(ERROR_FACTORY.create(\"app-offline\" /* APP_OFFLINE */));\r\n return {\r\n installationEntry: installationEntry,\r\n registrationPromise: registrationPromiseWithError\r\n };\r\n }\r\n // Try registering. Change status to IN_PROGRESS.\r\n var inProgressEntry = {\r\n fid: installationEntry.fid,\r\n registrationStatus: 1 /* IN_PROGRESS */,\r\n registrationTime: Date.now()\r\n };\r\n var registrationPromise = registerInstallation(appConfig, inProgressEntry);\r\n return { installationEntry: inProgressEntry, registrationPromise: registrationPromise };\r\n }\r\n else if (installationEntry.registrationStatus === 1 /* IN_PROGRESS */) {\r\n return {\r\n installationEntry: installationEntry,\r\n registrationPromise: waitUntilFidRegistration(appConfig)\r\n };\r\n }\r\n else {\r\n return { installationEntry: installationEntry };\r\n }\r\n}\r\n/** This will be executed only once for each new Firebase Installation. */\r\nfunction registerInstallation(appConfig, installationEntry) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var registeredInstallationEntry, e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 2, , 7]);\r\n return [4 /*yield*/, createInstallationRequest(appConfig, installationEntry)];\r\n case 1:\r\n registeredInstallationEntry = _a.sent();\r\n return [2 /*return*/, set(appConfig, registeredInstallationEntry)];\r\n case 2:\r\n e_1 = _a.sent();\r\n if (!(isServerError(e_1) && e_1.customData.serverCode === 409)) return [3 /*break*/, 4];\r\n // Server returned a \"FID can not be used\" error.\r\n // Generate a new ID next time.\r\n return [4 /*yield*/, remove(appConfig)];\r\n case 3:\r\n // Server returned a \"FID can not be used\" error.\r\n // Generate a new ID next time.\r\n _a.sent();\r\n return [3 /*break*/, 6];\r\n case 4: \r\n // Registration failed. Set FID as not registered.\r\n return [4 /*yield*/, set(appConfig, {\r\n fid: installationEntry.fid,\r\n registrationStatus: 0 /* NOT_STARTED */\r\n })];\r\n case 5:\r\n // Registration failed. Set FID as not registered.\r\n _a.sent();\r\n _a.label = 6;\r\n case 6: throw e_1;\r\n case 7: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/** Call if FID registration is pending in another request. */\r\nfunction waitUntilFidRegistration(appConfig) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var entry, _a, installationEntry, registrationPromise;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, updateInstallationRequest(appConfig)];\r\n case 1:\r\n entry = _b.sent();\r\n _b.label = 2;\r\n case 2:\r\n if (!(entry.registrationStatus === 1 /* IN_PROGRESS */)) return [3 /*break*/, 5];\r\n // createInstallation request still in progress.\r\n return [4 /*yield*/, sleep(100)];\r\n case 3:\r\n // createInstallation request still in progress.\r\n _b.sent();\r\n return [4 /*yield*/, updateInstallationRequest(appConfig)];\r\n case 4:\r\n entry = _b.sent();\r\n return [3 /*break*/, 2];\r\n case 5:\r\n if (!(entry.registrationStatus === 0 /* NOT_STARTED */)) return [3 /*break*/, 7];\r\n return [4 /*yield*/, getInstallationEntry(appConfig)];\r\n case 6:\r\n _a = _b.sent(), installationEntry = _a.installationEntry, registrationPromise = _a.registrationPromise;\r\n if (registrationPromise) {\r\n return [2 /*return*/, registrationPromise];\r\n }\r\n else {\r\n // if there is no registrationPromise, entry is registered.\r\n return [2 /*return*/, installationEntry];\r\n }\r\n case 7: return [2 /*return*/, entry];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Called only if there is a CreateInstallation request in progress.\r\n *\r\n * Updates the InstallationEntry in the DB based on the status of the\r\n * CreateInstallation request.\r\n *\r\n * Returns the updated InstallationEntry.\r\n */\r\nfunction updateInstallationRequest(appConfig) {\r\n return update(appConfig, function (oldEntry) {\r\n if (!oldEntry) {\r\n throw ERROR_FACTORY.create(\"installation-not-found\" /* INSTALLATION_NOT_FOUND */);\r\n }\r\n return clearTimedOutRequest(oldEntry);\r\n });\r\n}\r\nfunction clearTimedOutRequest(entry) {\r\n if (hasInstallationRequestTimedOut(entry)) {\r\n return {\r\n fid: entry.fid,\r\n registrationStatus: 0 /* NOT_STARTED */\r\n };\r\n }\r\n return entry;\r\n}\r\nfunction hasInstallationRequestTimedOut(installationEntry) {\r\n return (installationEntry.registrationStatus === 1 /* IN_PROGRESS */ &&\r\n installationEntry.registrationTime + PENDING_TIMEOUT_MS < Date.now());\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction generateAuthTokenRequest(_a, installationEntry) {\r\n var appConfig = _a.appConfig, platformLoggerProvider = _a.platformLoggerProvider;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var endpoint, headers, platformLogger, body, request, response, responseValue, completedAuthToken;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n endpoint = getGenerateAuthTokenEndpoint(appConfig, installationEntry);\r\n headers = getHeadersWithAuth(appConfig, installationEntry);\r\n platformLogger = platformLoggerProvider.getImmediate({\r\n optional: true\r\n });\r\n if (platformLogger) {\r\n headers.append('x-firebase-client', platformLogger.getPlatformInfoString());\r\n }\r\n body = {\r\n installation: {\r\n sdkVersion: PACKAGE_VERSION\r\n }\r\n };\r\n request = {\r\n method: 'POST',\r\n headers: headers,\r\n body: JSON.stringify(body)\r\n };\r\n return [4 /*yield*/, retryIfServerError(function () { return fetch(endpoint, request); })];\r\n case 1:\r\n response = _b.sent();\r\n if (!response.ok) return [3 /*break*/, 3];\r\n return [4 /*yield*/, response.json()];\r\n case 2:\r\n responseValue = _b.sent();\r\n completedAuthToken = extractAuthTokenInfoFromResponse(responseValue);\r\n return [2 /*return*/, completedAuthToken];\r\n case 3: return [4 /*yield*/, getErrorFromResponse('Generate Auth Token', response)];\r\n case 4: throw _b.sent();\r\n }\r\n });\r\n });\r\n}\r\nfunction getGenerateAuthTokenEndpoint(appConfig, _a) {\r\n var fid = _a.fid;\r\n return getInstallationsEndpoint(appConfig) + \"/\" + fid + \"/authTokens:generate\";\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns a valid authentication token for the installation. Generates a new\r\n * token if one doesn't exist, is expired or about to expire.\r\n *\r\n * Should only be called if the Firebase Installation is registered.\r\n */\r\nfunction refreshAuthToken(dependencies, forceRefresh) {\r\n if (forceRefresh === void 0) { forceRefresh = false; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var tokenPromise, entry, authToken, _a;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, update(dependencies.appConfig, function (oldEntry) {\r\n if (!isEntryRegistered(oldEntry)) {\r\n throw ERROR_FACTORY.create(\"not-registered\" /* NOT_REGISTERED */);\r\n }\r\n var oldAuthToken = oldEntry.authToken;\r\n if (!forceRefresh && isAuthTokenValid(oldAuthToken)) {\r\n // There is a valid token in the DB.\r\n return oldEntry;\r\n }\r\n else if (oldAuthToken.requestStatus === 1 /* IN_PROGRESS */) {\r\n // There already is a token request in progress.\r\n tokenPromise = waitUntilAuthTokenRequest(dependencies, forceRefresh);\r\n return oldEntry;\r\n }\r\n else {\r\n // No token or token expired.\r\n if (!navigator.onLine) {\r\n throw ERROR_FACTORY.create(\"app-offline\" /* APP_OFFLINE */);\r\n }\r\n var inProgressEntry = makeAuthTokenRequestInProgressEntry(oldEntry);\r\n tokenPromise = fetchAuthTokenFromServer(dependencies, inProgressEntry);\r\n return inProgressEntry;\r\n }\r\n })];\r\n case 1:\r\n entry = _b.sent();\r\n if (!tokenPromise) return [3 /*break*/, 3];\r\n return [4 /*yield*/, tokenPromise];\r\n case 2:\r\n _a = _b.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n _a = entry.authToken;\r\n _b.label = 4;\r\n case 4:\r\n authToken = _a;\r\n return [2 /*return*/, authToken];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Call only if FID is registered and Auth Token request is in progress.\r\n *\r\n * Waits until the current pending request finishes. If the request times out,\r\n * tries once in this thread as well.\r\n */\r\nfunction waitUntilAuthTokenRequest(dependencies, forceRefresh) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var entry, authToken;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, updateAuthTokenRequest(dependencies.appConfig)];\r\n case 1:\r\n entry = _a.sent();\r\n _a.label = 2;\r\n case 2:\r\n if (!(entry.authToken.requestStatus === 1 /* IN_PROGRESS */)) return [3 /*break*/, 5];\r\n // generateAuthToken still in progress.\r\n return [4 /*yield*/, sleep(100)];\r\n case 3:\r\n // generateAuthToken still in progress.\r\n _a.sent();\r\n return [4 /*yield*/, updateAuthTokenRequest(dependencies.appConfig)];\r\n case 4:\r\n entry = _a.sent();\r\n return [3 /*break*/, 2];\r\n case 5:\r\n authToken = entry.authToken;\r\n if (authToken.requestStatus === 0 /* NOT_STARTED */) {\r\n // The request timed out or failed in a different call. Try again.\r\n return [2 /*return*/, refreshAuthToken(dependencies, forceRefresh)];\r\n }\r\n else {\r\n return [2 /*return*/, authToken];\r\n }\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Called only if there is a GenerateAuthToken request in progress.\r\n *\r\n * Updates the InstallationEntry in the DB based on the status of the\r\n * GenerateAuthToken request.\r\n *\r\n * Returns the updated InstallationEntry.\r\n */\r\nfunction updateAuthTokenRequest(appConfig) {\r\n return update(appConfig, function (oldEntry) {\r\n if (!isEntryRegistered(oldEntry)) {\r\n throw ERROR_FACTORY.create(\"not-registered\" /* NOT_REGISTERED */);\r\n }\r\n var oldAuthToken = oldEntry.authToken;\r\n if (hasAuthTokenRequestTimedOut(oldAuthToken)) {\r\n return __assign(__assign({}, oldEntry), { authToken: { requestStatus: 0 /* NOT_STARTED */ } });\r\n }\r\n return oldEntry;\r\n });\r\n}\r\nfunction fetchAuthTokenFromServer(dependencies, installationEntry) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var authToken, updatedInstallationEntry, e_1, updatedInstallationEntry;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 3, , 8]);\r\n return [4 /*yield*/, generateAuthTokenRequest(dependencies, installationEntry)];\r\n case 1:\r\n authToken = _a.sent();\r\n updatedInstallationEntry = __assign(__assign({}, installationEntry), { authToken: authToken });\r\n return [4 /*yield*/, set(dependencies.appConfig, updatedInstallationEntry)];\r\n case 2:\r\n _a.sent();\r\n return [2 /*return*/, authToken];\r\n case 3:\r\n e_1 = _a.sent();\r\n if (!(isServerError(e_1) &&\r\n (e_1.customData.serverCode === 401 || e_1.customData.serverCode === 404))) return [3 /*break*/, 5];\r\n // Server returned a \"FID not found\" or a \"Invalid authentication\" error.\r\n // Generate a new ID next time.\r\n return [4 /*yield*/, remove(dependencies.appConfig)];\r\n case 4:\r\n // Server returned a \"FID not found\" or a \"Invalid authentication\" error.\r\n // Generate a new ID next time.\r\n _a.sent();\r\n return [3 /*break*/, 7];\r\n case 5:\r\n updatedInstallationEntry = __assign(__assign({}, installationEntry), { authToken: { requestStatus: 0 /* NOT_STARTED */ } });\r\n return [4 /*yield*/, set(dependencies.appConfig, updatedInstallationEntry)];\r\n case 6:\r\n _a.sent();\r\n _a.label = 7;\r\n case 7: throw e_1;\r\n case 8: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\nfunction isEntryRegistered(installationEntry) {\r\n return (installationEntry !== undefined &&\r\n installationEntry.registrationStatus === 2 /* COMPLETED */);\r\n}\r\nfunction isAuthTokenValid(authToken) {\r\n return (authToken.requestStatus === 2 /* COMPLETED */ &&\r\n !isAuthTokenExpired(authToken));\r\n}\r\nfunction isAuthTokenExpired(authToken) {\r\n var now = Date.now();\r\n return (now < authToken.creationTime ||\r\n authToken.creationTime + authToken.expiresIn < now + TOKEN_EXPIRATION_BUFFER);\r\n}\r\n/** Returns an updated InstallationEntry with an InProgressAuthToken. */\r\nfunction makeAuthTokenRequestInProgressEntry(oldEntry) {\r\n var inProgressAuthToken = {\r\n requestStatus: 1 /* IN_PROGRESS */,\r\n requestTime: Date.now()\r\n };\r\n return __assign(__assign({}, oldEntry), { authToken: inProgressAuthToken });\r\n}\r\nfunction hasAuthTokenRequestTimedOut(authToken) {\r\n return (authToken.requestStatus === 1 /* IN_PROGRESS */ &&\r\n authToken.requestTime + PENDING_TIMEOUT_MS < Date.now());\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction getId(dependencies) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _a, installationEntry, registrationPromise;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, getInstallationEntry(dependencies.appConfig)];\r\n case 1:\r\n _a = _b.sent(), installationEntry = _a.installationEntry, registrationPromise = _a.registrationPromise;\r\n if (registrationPromise) {\r\n registrationPromise.catch(console.error);\r\n }\r\n else {\r\n // If the installation is already registered, update the authentication\r\n // token if needed.\r\n refreshAuthToken(dependencies).catch(console.error);\r\n }\r\n return [2 /*return*/, installationEntry.fid];\r\n }\r\n });\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction getToken(dependencies, forceRefresh) {\r\n if (forceRefresh === void 0) { forceRefresh = false; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var authToken;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, completeInstallationRegistration(dependencies.appConfig)];\r\n case 1:\r\n _a.sent();\r\n return [4 /*yield*/, refreshAuthToken(dependencies, forceRefresh)];\r\n case 2:\r\n authToken = _a.sent();\r\n return [2 /*return*/, authToken.token];\r\n }\r\n });\r\n });\r\n}\r\nfunction completeInstallationRegistration(appConfig) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var registrationPromise;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, getInstallationEntry(appConfig)];\r\n case 1:\r\n registrationPromise = (_a.sent()).registrationPromise;\r\n if (!registrationPromise) return [3 /*break*/, 3];\r\n // A createInstallation request is in progress. Wait until it finishes.\r\n return [4 /*yield*/, registrationPromise];\r\n case 2:\r\n // A createInstallation request is in progress. Wait until it finishes.\r\n _a.sent();\r\n _a.label = 3;\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction deleteInstallationRequest(appConfig, installationEntry) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var endpoint, headers, request, response;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n endpoint = getDeleteEndpoint(appConfig, installationEntry);\r\n headers = getHeadersWithAuth(appConfig, installationEntry);\r\n request = {\r\n method: 'DELETE',\r\n headers: headers\r\n };\r\n return [4 /*yield*/, retryIfServerError(function () { return fetch(endpoint, request); })];\r\n case 1:\r\n response = _a.sent();\r\n if (!!response.ok) return [3 /*break*/, 3];\r\n return [4 /*yield*/, getErrorFromResponse('Delete Installation', response)];\r\n case 2: throw _a.sent();\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\nfunction getDeleteEndpoint(appConfig, _a) {\r\n var fid = _a.fid;\r\n return getInstallationsEndpoint(appConfig) + \"/\" + fid;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction deleteInstallation(dependencies) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var appConfig, entry;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n appConfig = dependencies.appConfig;\r\n return [4 /*yield*/, update(appConfig, function (oldEntry) {\r\n if (oldEntry && oldEntry.registrationStatus === 0 /* NOT_STARTED */) {\r\n // Delete the unregistered entry without sending a deleteInstallation request.\r\n return undefined;\r\n }\r\n return oldEntry;\r\n })];\r\n case 1:\r\n entry = _a.sent();\r\n if (!entry) return [3 /*break*/, 6];\r\n if (!(entry.registrationStatus === 1 /* IN_PROGRESS */)) return [3 /*break*/, 2];\r\n // Can't delete while trying to register.\r\n throw ERROR_FACTORY.create(\"delete-pending-registration\" /* DELETE_PENDING_REGISTRATION */);\r\n case 2:\r\n if (!(entry.registrationStatus === 2 /* COMPLETED */)) return [3 /*break*/, 6];\r\n if (!!navigator.onLine) return [3 /*break*/, 3];\r\n throw ERROR_FACTORY.create(\"app-offline\" /* APP_OFFLINE */);\r\n case 3: return [4 /*yield*/, deleteInstallationRequest(appConfig, entry)];\r\n case 4:\r\n _a.sent();\r\n return [4 /*yield*/, remove(appConfig)];\r\n case 5:\r\n _a.sent();\r\n _a.label = 6;\r\n case 6: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Sets a new callback that will get called when Installation ID changes.\r\n * Returns an unsubscribe function that will remove the callback when called.\r\n */\r\nfunction onIdChange(_a, callback) {\r\n var appConfig = _a.appConfig;\r\n addCallback(appConfig, callback);\r\n return function () {\r\n removeCallback(appConfig, callback);\r\n };\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction extractAppConfig(app) {\r\n var e_1, _a;\r\n if (!app || !app.options) {\r\n throw getMissingValueError('App Configuration');\r\n }\r\n if (!app.name) {\r\n throw getMissingValueError('App Name');\r\n }\r\n // Required app config keys\r\n var configKeys = [\r\n 'projectId',\r\n 'apiKey',\r\n 'appId'\r\n ];\r\n try {\r\n for (var configKeys_1 = __values(configKeys), configKeys_1_1 = configKeys_1.next(); !configKeys_1_1.done; configKeys_1_1 = configKeys_1.next()) {\r\n var keyName = configKeys_1_1.value;\r\n if (!app.options[keyName]) {\r\n throw getMissingValueError(keyName);\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (configKeys_1_1 && !configKeys_1_1.done && (_a = configKeys_1.return)) _a.call(configKeys_1);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n return {\r\n appName: app.name,\r\n projectId: app.options.projectId,\r\n apiKey: app.options.apiKey,\r\n appId: app.options.appId\r\n };\r\n}\r\nfunction getMissingValueError(valueName) {\r\n return ERROR_FACTORY.create(\"missing-app-config-values\" /* MISSING_APP_CONFIG_VALUES */, {\r\n valueName: valueName\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction registerInstallations(instance) {\r\n var installationsName = 'installations';\r\n instance.INTERNAL.registerComponent(new Component(installationsName, function (container) {\r\n var app = container.getProvider('app').getImmediate();\r\n // Throws if app isn't configured properly.\r\n var appConfig = extractAppConfig(app);\r\n var platformLoggerProvider = container.getProvider('platform-logger');\r\n var dependencies = {\r\n appConfig: appConfig,\r\n platformLoggerProvider: platformLoggerProvider\r\n };\r\n var installations = {\r\n app: app,\r\n getId: function () { return getId(dependencies); },\r\n getToken: function (forceRefresh) {\r\n return getToken(dependencies, forceRefresh);\r\n },\r\n delete: function () { return deleteInstallation(dependencies); },\r\n onIdChange: function (callback) {\r\n return onIdChange(dependencies, callback);\r\n }\r\n };\r\n return installations;\r\n }, \"PUBLIC\" /* PUBLIC */));\r\n instance.registerVersion(name, version);\r\n}\r\nregisterInstallations(firebase);\n\nexport { registerInstallations };\n//# sourceMappingURL=index.esm.js.map\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n\r\nfunction __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar _a;\r\n/**\r\n * A container for all of the Logger instances\r\n */\r\nvar instances = [];\r\n/**\r\n * The JS SDK supports 5 log levels and also allows a user the ability to\r\n * silence the logs altogether.\r\n *\r\n * The order is a follows:\r\n * DEBUG < VERBOSE < INFO < WARN < ERROR\r\n *\r\n * All of the log types above the current log level will be captured (i.e. if\r\n * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and\r\n * `VERBOSE` logs will not)\r\n */\r\nvar LogLevel;\r\n(function (LogLevel) {\r\n LogLevel[LogLevel[\"DEBUG\"] = 0] = \"DEBUG\";\r\n LogLevel[LogLevel[\"VERBOSE\"] = 1] = \"VERBOSE\";\r\n LogLevel[LogLevel[\"INFO\"] = 2] = \"INFO\";\r\n LogLevel[LogLevel[\"WARN\"] = 3] = \"WARN\";\r\n LogLevel[LogLevel[\"ERROR\"] = 4] = \"ERROR\";\r\n LogLevel[LogLevel[\"SILENT\"] = 5] = \"SILENT\";\r\n})(LogLevel || (LogLevel = {}));\r\nvar levelStringToEnum = {\r\n 'debug': LogLevel.DEBUG,\r\n 'verbose': LogLevel.VERBOSE,\r\n 'info': LogLevel.INFO,\r\n 'warn': LogLevel.WARN,\r\n 'error': LogLevel.ERROR,\r\n 'silent': LogLevel.SILENT\r\n};\r\n/**\r\n * The default log level\r\n */\r\nvar defaultLogLevel = LogLevel.INFO;\r\n/**\r\n * By default, `console.debug` is not displayed in the developer console (in\r\n * chrome). To avoid forcing users to have to opt-in to these logs twice\r\n * (i.e. once for firebase, and once in the console), we are sending `DEBUG`\r\n * logs to the `console.log` function.\r\n */\r\nvar ConsoleMethod = (_a = {},\r\n _a[LogLevel.DEBUG] = 'log',\r\n _a[LogLevel.VERBOSE] = 'log',\r\n _a[LogLevel.INFO] = 'info',\r\n _a[LogLevel.WARN] = 'warn',\r\n _a[LogLevel.ERROR] = 'error',\r\n _a);\r\n/**\r\n * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR\r\n * messages on to their corresponding console counterparts (if the log method\r\n * is supported by the current log level)\r\n */\r\nvar defaultLogHandler = function (instance, logType) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n if (logType < instance.logLevel) {\r\n return;\r\n }\r\n var now = new Date().toISOString();\r\n var method = ConsoleMethod[logType];\r\n if (method) {\r\n console[method].apply(console, __spreadArrays([\"[\" + now + \"] \" + instance.name + \":\"], args));\r\n }\r\n else {\r\n throw new Error(\"Attempted to log a message with an invalid logType (value: \" + logType + \")\");\r\n }\r\n};\r\nvar Logger = /** @class */ (function () {\r\n /**\r\n * Gives you an instance of a Logger to capture messages according to\r\n * Firebase's logging scheme.\r\n *\r\n * @param name The name that the logs will be associated with\r\n */\r\n function Logger(name) {\r\n this.name = name;\r\n /**\r\n * The log level of the given Logger instance.\r\n */\r\n this._logLevel = defaultLogLevel;\r\n /**\r\n * The main (internal) log handler for the Logger instance.\r\n * Can be set to a new function in internal package code but not by user.\r\n */\r\n this._logHandler = defaultLogHandler;\r\n /**\r\n * The optional, additional, user-defined log handler for the Logger instance.\r\n */\r\n this._userLogHandler = null;\r\n /**\r\n * Capture the current instance for later use\r\n */\r\n instances.push(this);\r\n }\r\n Object.defineProperty(Logger.prototype, \"logLevel\", {\r\n get: function () {\r\n return this._logLevel;\r\n },\r\n set: function (val) {\r\n if (!(val in LogLevel)) {\r\n throw new TypeError(\"Invalid value \\\"\" + val + \"\\\" assigned to `logLevel`\");\r\n }\r\n this._logLevel = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Workaround for setter/getter having to be the same type.\r\n Logger.prototype.setLogLevel = function (val) {\r\n this._logLevel = typeof val === 'string' ? levelStringToEnum[val] : val;\r\n };\r\n Object.defineProperty(Logger.prototype, \"logHandler\", {\r\n get: function () {\r\n return this._logHandler;\r\n },\r\n set: function (val) {\r\n if (typeof val !== 'function') {\r\n throw new TypeError('Value assigned to `logHandler` must be a function');\r\n }\r\n this._logHandler = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Logger.prototype, \"userLogHandler\", {\r\n get: function () {\r\n return this._userLogHandler;\r\n },\r\n set: function (val) {\r\n this._userLogHandler = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * The functions below are all based on the `console` interface\r\n */\r\n Logger.prototype.debug = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._userLogHandler && this._userLogHandler.apply(this, __spreadArrays([this, LogLevel.DEBUG], args));\r\n this._logHandler.apply(this, __spreadArrays([this, LogLevel.DEBUG], args));\r\n };\r\n Logger.prototype.log = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._userLogHandler && this._userLogHandler.apply(this, __spreadArrays([this, LogLevel.VERBOSE], args));\r\n this._logHandler.apply(this, __spreadArrays([this, LogLevel.VERBOSE], args));\r\n };\r\n Logger.prototype.info = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._userLogHandler && this._userLogHandler.apply(this, __spreadArrays([this, LogLevel.INFO], args));\r\n this._logHandler.apply(this, __spreadArrays([this, LogLevel.INFO], args));\r\n };\r\n Logger.prototype.warn = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._userLogHandler && this._userLogHandler.apply(this, __spreadArrays([this, LogLevel.WARN], args));\r\n this._logHandler.apply(this, __spreadArrays([this, LogLevel.WARN], args));\r\n };\r\n Logger.prototype.error = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._userLogHandler && this._userLogHandler.apply(this, __spreadArrays([this, LogLevel.ERROR], args));\r\n this._logHandler.apply(this, __spreadArrays([this, LogLevel.ERROR], args));\r\n };\r\n return Logger;\r\n}());\r\nfunction setLogLevel(level) {\r\n instances.forEach(function (inst) {\r\n inst.setLogLevel(level);\r\n });\r\n}\r\nfunction setUserLogHandler(logCallback, options) {\r\n var _loop_1 = function (instance) {\r\n var customLogLevel = null;\r\n if (options && options.level) {\r\n customLogLevel = levelStringToEnum[options.level];\r\n }\r\n if (logCallback === null) {\r\n instance.userLogHandler = null;\r\n }\r\n else {\r\n instance.userLogHandler = function (instance, level) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n var message = args\r\n .map(function (arg) {\r\n if (arg == null) {\r\n return null;\r\n }\r\n else if (typeof arg === 'string') {\r\n return arg;\r\n }\r\n else if (typeof arg === 'number' || typeof arg === 'boolean') {\r\n return arg.toString();\r\n }\r\n else if (arg instanceof Error) {\r\n return arg.message;\r\n }\r\n else {\r\n try {\r\n return JSON.stringify(arg);\r\n }\r\n catch (ignored) {\r\n return null;\r\n }\r\n }\r\n })\r\n .filter(function (arg) { return arg; })\r\n .join(' ');\r\n if (level >= (customLogLevel !== null && customLogLevel !== void 0 ? customLogLevel : instance.logLevel)) {\r\n logCallback({\r\n level: LogLevel[level].toLowerCase(),\r\n message: message,\r\n args: args,\r\n type: instance.name\r\n });\r\n }\r\n };\r\n }\r\n };\r\n for (var _i = 0, instances_1 = instances; _i < instances_1.length; _i++) {\r\n var instance = instances_1[_i];\r\n _loop_1(instance);\r\n }\r\n}\n\nexport { LogLevel, Logger, setLogLevel, setUserLogHandler };\n//# sourceMappingURL=index.esm.js.map\n","import '@firebase/installations';\nimport { Component } from '@firebase/component';\nimport { ErrorFactory } from '@firebase/util';\nimport { __spread, __awaiter, __generator, __assign, __values } from 'tslib';\nimport { deleteDb, openDb } from 'idb';\nimport firebase from '@firebase/app';\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar _a;\r\nvar ERROR_MAP = (_a = {},\r\n _a[\"missing-app-config-values\" /* MISSING_APP_CONFIG_VALUES */] = 'Missing App configuration value: \"{$valueName}\"',\r\n _a[\"only-available-in-window\" /* AVAILABLE_IN_WINDOW */] = 'This method is available in a Window context.',\r\n _a[\"only-available-in-sw\" /* AVAILABLE_IN_SW */] = 'This method is available in a service worker context.',\r\n _a[\"permission-default\" /* PERMISSION_DEFAULT */] = 'The notification permission was not granted and dismissed instead.',\r\n _a[\"permission-blocked\" /* PERMISSION_BLOCKED */] = 'The notification permission was not granted and blocked instead.',\r\n _a[\"unsupported-browser\" /* UNSUPPORTED_BROWSER */] = \"This browser doesn't support the API's required to use the firebase SDK.\",\r\n _a[\"failed-service-worker-registration\" /* FAILED_DEFAULT_REGISTRATION */] = 'We are unable to register the default service worker. {$browserErrorMessage}',\r\n _a[\"token-subscribe-failed\" /* TOKEN_SUBSCRIBE_FAILED */] = 'A problem occurred while subscribing the user to FCM: {$errorInfo}',\r\n _a[\"token-subscribe-no-token\" /* TOKEN_SUBSCRIBE_NO_TOKEN */] = 'FCM returned no token when subscribing the user to push.',\r\n _a[\"token-unsubscribe-failed\" /* TOKEN_UNSUBSCRIBE_FAILED */] = 'A problem occurred while unsubscribing the ' +\r\n 'user from FCM: {$errorInfo}',\r\n _a[\"token-update-failed\" /* TOKEN_UPDATE_FAILED */] = 'A problem occurred while updating the user from FCM: {$errorInfo}',\r\n _a[\"token-update-no-token\" /* TOKEN_UPDATE_NO_TOKEN */] = 'FCM returned no token when updating the user to push.',\r\n _a[\"use-sw-after-get-token\" /* USE_SW_AFTER_GET_TOKEN */] = 'The useServiceWorker() method may only be called once and must be ' +\r\n 'called before calling getToken() to ensure your service worker is used.',\r\n _a[\"invalid-sw-registration\" /* INVALID_SW_REGISTRATION */] = 'The input to useServiceWorker() must be a ServiceWorkerRegistration.',\r\n _a[\"invalid-bg-handler\" /* INVALID_BG_HANDLER */] = 'The input to setBackgroundMessageHandler() must be a function.',\r\n _a[\"invalid-vapid-key\" /* INVALID_VAPID_KEY */] = 'The public VAPID key must be a string.',\r\n _a[\"use-vapid-key-after-get-token\" /* USE_VAPID_KEY_AFTER_GET_TOKEN */] = 'The usePublicVapidKey() method may only be called once and must be ' +\r\n 'called before calling getToken() to ensure your VAPID key is used.',\r\n _a);\r\nvar ERROR_FACTORY = new ErrorFactory('messaging', 'Messaging', ERROR_MAP);\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DEFAULT_SW_PATH = '/firebase-messaging-sw.js';\r\nvar DEFAULT_SW_SCOPE = '/firebase-cloud-messaging-push-scope';\r\nvar DEFAULT_VAPID_KEY = 'BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4';\r\nvar ENDPOINT = 'https://fcmregistrations.googleapis.com/v1';\r\n/** Key of FCM Payload in Notification's data field. */\r\nvar FCM_MSG = 'FCM_MSG';\r\nvar CONSOLE_CAMPAIGN_ID = 'google.c.a.c_id';\r\nvar CONSOLE_CAMPAIGN_NAME = 'google.c.a.c_l';\r\nvar CONSOLE_CAMPAIGN_TIME = 'google.c.a.ts';\r\n/** Set to '1' if Analytics is enabled for the campaign */\r\nvar CONSOLE_CAMPAIGN_ANALYTICS_ENABLED = 'google.c.a.e';\r\nvar TAG = 'FirebaseMessaging: ';\n\n/**\r\n * @license\r\n * Copyright 2018 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except\r\n * in compliance with the License. You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software distributed under the License\r\n * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\r\n * or implied. See the License for the specific language governing permissions and limitations under\r\n * the License.\r\n */\r\nvar MessageType;\r\n(function (MessageType) {\r\n MessageType[\"PUSH_RECEIVED\"] = \"push-received\";\r\n MessageType[\"NOTIFICATION_CLICKED\"] = \"notification-clicked\";\r\n})(MessageType || (MessageType = {}));\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction arrayToBase64(array) {\r\n var uint8Array = new Uint8Array(array);\r\n var base64String = btoa(String.fromCharCode.apply(String, __spread(uint8Array)));\r\n return base64String.replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_');\r\n}\r\nfunction base64ToArray(base64String) {\r\n var padding = '='.repeat((4 - (base64String.length % 4)) % 4);\r\n var base64 = (base64String + padding)\r\n .replace(/\\-/g, '+')\r\n .replace(/_/g, '/');\r\n var rawData = atob(base64);\r\n var outputArray = new Uint8Array(rawData.length);\r\n for (var i = 0; i < rawData.length; ++i) {\r\n outputArray[i] = rawData.charCodeAt(i);\r\n }\r\n return outputArray;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar OLD_DB_NAME = 'fcm_token_details_db';\r\n/**\r\n * The last DB version of 'fcm_token_details_db' was 4. This is one higher, so that the upgrade\r\n * callback is called for all versions of the old DB.\r\n */\r\nvar OLD_DB_VERSION = 5;\r\nvar OLD_OBJECT_STORE_NAME = 'fcm_token_object_Store';\r\nfunction migrateOldDatabase(senderId) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var databases, dbNames, tokenDetails, db;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!('databases' in indexedDB)) return [3 /*break*/, 2];\r\n return [4 /*yield*/, indexedDB.databases()];\r\n case 1:\r\n databases = _a.sent();\r\n dbNames = databases.map(function (db) { return db.name; });\r\n if (!dbNames.includes(OLD_DB_NAME)) {\r\n // old DB didn't exist, no need to open.\r\n return [2 /*return*/, null];\r\n }\r\n _a.label = 2;\r\n case 2:\r\n tokenDetails = null;\r\n return [4 /*yield*/, openDb(OLD_DB_NAME, OLD_DB_VERSION, function (db) { return __awaiter(_this, void 0, void 0, function () {\r\n var objectStore, value, oldDetails, oldDetails, oldDetails;\r\n var _a;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n if (db.oldVersion < 2) {\r\n // Database too old, skip migration.\r\n return [2 /*return*/];\r\n }\r\n if (!db.objectStoreNames.contains(OLD_OBJECT_STORE_NAME)) {\r\n // Database did not exist. Nothing to do.\r\n return [2 /*return*/];\r\n }\r\n objectStore = db.transaction.objectStore(OLD_OBJECT_STORE_NAME);\r\n return [4 /*yield*/, objectStore.index('fcmSenderId').get(senderId)];\r\n case 1:\r\n value = _b.sent();\r\n return [4 /*yield*/, objectStore.clear()];\r\n case 2:\r\n _b.sent();\r\n if (!value) {\r\n // No entry in the database, nothing to migrate.\r\n return [2 /*return*/];\r\n }\r\n if (db.oldVersion === 2) {\r\n oldDetails = value;\r\n if (!oldDetails.auth || !oldDetails.p256dh || !oldDetails.endpoint) {\r\n return [2 /*return*/];\r\n }\r\n tokenDetails = {\r\n token: oldDetails.fcmToken,\r\n createTime: (_a = oldDetails.createTime) !== null && _a !== void 0 ? _a : Date.now(),\r\n subscriptionOptions: {\r\n auth: oldDetails.auth,\r\n p256dh: oldDetails.p256dh,\r\n endpoint: oldDetails.endpoint,\r\n swScope: oldDetails.swScope,\r\n vapidKey: typeof oldDetails.vapidKey === 'string'\r\n ? oldDetails.vapidKey\r\n : arrayToBase64(oldDetails.vapidKey)\r\n }\r\n };\r\n }\r\n else if (db.oldVersion === 3) {\r\n oldDetails = value;\r\n tokenDetails = {\r\n token: oldDetails.fcmToken,\r\n createTime: oldDetails.createTime,\r\n subscriptionOptions: {\r\n auth: arrayToBase64(oldDetails.auth),\r\n p256dh: arrayToBase64(oldDetails.p256dh),\r\n endpoint: oldDetails.endpoint,\r\n swScope: oldDetails.swScope,\r\n vapidKey: arrayToBase64(oldDetails.vapidKey)\r\n }\r\n };\r\n }\r\n else if (db.oldVersion === 4) {\r\n oldDetails = value;\r\n tokenDetails = {\r\n token: oldDetails.fcmToken,\r\n createTime: oldDetails.createTime,\r\n subscriptionOptions: {\r\n auth: arrayToBase64(oldDetails.auth),\r\n p256dh: arrayToBase64(oldDetails.p256dh),\r\n endpoint: oldDetails.endpoint,\r\n swScope: oldDetails.swScope,\r\n vapidKey: arrayToBase64(oldDetails.vapidKey)\r\n }\r\n };\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n }); })];\r\n case 3:\r\n db = _a.sent();\r\n db.close();\r\n // Delete all old databases.\r\n return [4 /*yield*/, deleteDb(OLD_DB_NAME)];\r\n case 4:\r\n // Delete all old databases.\r\n _a.sent();\r\n return [4 /*yield*/, deleteDb('fcm_vapid_details_db')];\r\n case 5:\r\n _a.sent();\r\n return [4 /*yield*/, deleteDb('undefined')];\r\n case 6:\r\n _a.sent();\r\n return [2 /*return*/, checkTokenDetails(tokenDetails) ? tokenDetails : null];\r\n }\r\n });\r\n });\r\n}\r\nfunction checkTokenDetails(tokenDetails) {\r\n if (!tokenDetails || !tokenDetails.subscriptionOptions) {\r\n return false;\r\n }\r\n var subscriptionOptions = tokenDetails.subscriptionOptions;\r\n return (typeof tokenDetails.createTime === 'number' &&\r\n tokenDetails.createTime > 0 &&\r\n typeof tokenDetails.token === 'string' &&\r\n tokenDetails.token.length > 0 &&\r\n typeof subscriptionOptions.auth === 'string' &&\r\n subscriptionOptions.auth.length > 0 &&\r\n typeof subscriptionOptions.p256dh === 'string' &&\r\n subscriptionOptions.p256dh.length > 0 &&\r\n typeof subscriptionOptions.endpoint === 'string' &&\r\n subscriptionOptions.endpoint.length > 0 &&\r\n typeof subscriptionOptions.swScope === 'string' &&\r\n subscriptionOptions.swScope.length > 0 &&\r\n typeof subscriptionOptions.vapidKey === 'string' &&\r\n subscriptionOptions.vapidKey.length > 0);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// Exported for tests.\r\nvar DATABASE_NAME = 'firebase-messaging-database';\r\nvar DATABASE_VERSION = 1;\r\nvar OBJECT_STORE_NAME = 'firebase-messaging-store';\r\nvar dbPromise = null;\r\nfunction getDbPromise() {\r\n if (!dbPromise) {\r\n dbPromise = openDb(DATABASE_NAME, DATABASE_VERSION, function (upgradeDb) {\r\n // We don't use 'break' in this switch statement, the fall-through behavior is what we want,\r\n // because if there are multiple versions between the old version and the current version, we\r\n // want ALL the migrations that correspond to those versions to run, not only the last one.\r\n // eslint-disable-next-line default-case\r\n switch (upgradeDb.oldVersion) {\r\n case 0:\r\n upgradeDb.createObjectStore(OBJECT_STORE_NAME);\r\n }\r\n });\r\n }\r\n return dbPromise;\r\n}\r\n/** Gets record(s) from the objectStore that match the given key. */\r\nfunction dbGet(firebaseDependencies) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var key, db, tokenDetails, oldTokenDetails;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n key = getKey(firebaseDependencies);\r\n return [4 /*yield*/, getDbPromise()];\r\n case 1:\r\n db = _a.sent();\r\n return [4 /*yield*/, db\r\n .transaction(OBJECT_STORE_NAME)\r\n .objectStore(OBJECT_STORE_NAME)\r\n .get(key)];\r\n case 2:\r\n tokenDetails = _a.sent();\r\n if (!tokenDetails) return [3 /*break*/, 3];\r\n return [2 /*return*/, tokenDetails];\r\n case 3: return [4 /*yield*/, migrateOldDatabase(firebaseDependencies.appConfig.senderId)];\r\n case 4:\r\n oldTokenDetails = _a.sent();\r\n if (!oldTokenDetails) return [3 /*break*/, 6];\r\n return [4 /*yield*/, dbSet(firebaseDependencies, oldTokenDetails)];\r\n case 5:\r\n _a.sent();\r\n return [2 /*return*/, oldTokenDetails];\r\n case 6: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/** Assigns or overwrites the record for the given key with the given value. */\r\nfunction dbSet(firebaseDependencies, tokenDetails) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var key, db, tx;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n key = getKey(firebaseDependencies);\r\n return [4 /*yield*/, getDbPromise()];\r\n case 1:\r\n db = _a.sent();\r\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\r\n return [4 /*yield*/, tx.objectStore(OBJECT_STORE_NAME).put(tokenDetails, key)];\r\n case 2:\r\n _a.sent();\r\n return [4 /*yield*/, tx.complete];\r\n case 3:\r\n _a.sent();\r\n return [2 /*return*/, tokenDetails];\r\n }\r\n });\r\n });\r\n}\r\n/** Removes record(s) from the objectStore that match the given key. */\r\nfunction dbRemove(firebaseDependencies) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var key, db, tx;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n key = getKey(firebaseDependencies);\r\n return [4 /*yield*/, getDbPromise()];\r\n case 1:\r\n db = _a.sent();\r\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\r\n return [4 /*yield*/, tx.objectStore(OBJECT_STORE_NAME).delete(key)];\r\n case 2:\r\n _a.sent();\r\n return [4 /*yield*/, tx.complete];\r\n case 3:\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\nfunction getKey(_a) {\r\n var appConfig = _a.appConfig;\r\n return appConfig.appId;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction requestGetToken(firebaseDependencies, subscriptionOptions) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var headers, body, subscribeOptions, responseData, response, err_1, message;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, getHeaders(firebaseDependencies)];\r\n case 1:\r\n headers = _a.sent();\r\n body = getBody(subscriptionOptions);\r\n subscribeOptions = {\r\n method: 'POST',\r\n headers: headers,\r\n body: JSON.stringify(body)\r\n };\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 5, , 6]);\r\n return [4 /*yield*/, fetch(getEndpoint(firebaseDependencies.appConfig), subscribeOptions)];\r\n case 3:\r\n response = _a.sent();\r\n return [4 /*yield*/, response.json()];\r\n case 4:\r\n responseData = _a.sent();\r\n return [3 /*break*/, 6];\r\n case 5:\r\n err_1 = _a.sent();\r\n throw ERROR_FACTORY.create(\"token-subscribe-failed\" /* TOKEN_SUBSCRIBE_FAILED */, {\r\n errorInfo: err_1\r\n });\r\n case 6:\r\n if (responseData.error) {\r\n message = responseData.error.message;\r\n throw ERROR_FACTORY.create(\"token-subscribe-failed\" /* TOKEN_SUBSCRIBE_FAILED */, {\r\n errorInfo: message\r\n });\r\n }\r\n if (!responseData.token) {\r\n throw ERROR_FACTORY.create(\"token-subscribe-no-token\" /* TOKEN_SUBSCRIBE_NO_TOKEN */);\r\n }\r\n return [2 /*return*/, responseData.token];\r\n }\r\n });\r\n });\r\n}\r\nfunction requestUpdateToken(firebaseDependencies, tokenDetails) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var headers, body, updateOptions, responseData, response, err_2, message;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, getHeaders(firebaseDependencies)];\r\n case 1:\r\n headers = _a.sent();\r\n body = getBody(tokenDetails.subscriptionOptions);\r\n updateOptions = {\r\n method: 'PATCH',\r\n headers: headers,\r\n body: JSON.stringify(body)\r\n };\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 5, , 6]);\r\n return [4 /*yield*/, fetch(getEndpoint(firebaseDependencies.appConfig) + \"/\" + tokenDetails.token, updateOptions)];\r\n case 3:\r\n response = _a.sent();\r\n return [4 /*yield*/, response.json()];\r\n case 4:\r\n responseData = _a.sent();\r\n return [3 /*break*/, 6];\r\n case 5:\r\n err_2 = _a.sent();\r\n throw ERROR_FACTORY.create(\"token-update-failed\" /* TOKEN_UPDATE_FAILED */, {\r\n errorInfo: err_2\r\n });\r\n case 6:\r\n if (responseData.error) {\r\n message = responseData.error.message;\r\n throw ERROR_FACTORY.create(\"token-update-failed\" /* TOKEN_UPDATE_FAILED */, {\r\n errorInfo: message\r\n });\r\n }\r\n if (!responseData.token) {\r\n throw ERROR_FACTORY.create(\"token-update-no-token\" /* TOKEN_UPDATE_NO_TOKEN */);\r\n }\r\n return [2 /*return*/, responseData.token];\r\n }\r\n });\r\n });\r\n}\r\nfunction requestDeleteToken(firebaseDependencies, token) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var headers, unsubscribeOptions, response, responseData, message, err_3;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, getHeaders(firebaseDependencies)];\r\n case 1:\r\n headers = _a.sent();\r\n unsubscribeOptions = {\r\n method: 'DELETE',\r\n headers: headers\r\n };\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 5, , 6]);\r\n return [4 /*yield*/, fetch(getEndpoint(firebaseDependencies.appConfig) + \"/\" + token, unsubscribeOptions)];\r\n case 3:\r\n response = _a.sent();\r\n return [4 /*yield*/, response.json()];\r\n case 4:\r\n responseData = _a.sent();\r\n if (responseData.error) {\r\n message = responseData.error.message;\r\n throw ERROR_FACTORY.create(\"token-unsubscribe-failed\" /* TOKEN_UNSUBSCRIBE_FAILED */, {\r\n errorInfo: message\r\n });\r\n }\r\n return [3 /*break*/, 6];\r\n case 5:\r\n err_3 = _a.sent();\r\n throw ERROR_FACTORY.create(\"token-unsubscribe-failed\" /* TOKEN_UNSUBSCRIBE_FAILED */, {\r\n errorInfo: err_3\r\n });\r\n case 6: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\nfunction getEndpoint(_a) {\r\n var projectId = _a.projectId;\r\n return ENDPOINT + \"/projects/\" + projectId + \"/registrations\";\r\n}\r\nfunction getHeaders(_a) {\r\n var appConfig = _a.appConfig, installations = _a.installations;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var authToken;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, installations.getToken()];\r\n case 1:\r\n authToken = _b.sent();\r\n return [2 /*return*/, new Headers({\r\n 'Content-Type': 'application/json',\r\n Accept: 'application/json',\r\n 'x-goog-api-key': appConfig.apiKey,\r\n 'x-goog-firebase-installations-auth': \"FIS \" + authToken\r\n })];\r\n }\r\n });\r\n });\r\n}\r\nfunction getBody(_a) {\r\n var p256dh = _a.p256dh, auth = _a.auth, endpoint = _a.endpoint, vapidKey = _a.vapidKey;\r\n var body = {\r\n web: {\r\n endpoint: endpoint,\r\n auth: auth,\r\n p256dh: p256dh\r\n }\r\n };\r\n if (vapidKey !== DEFAULT_VAPID_KEY) {\r\n body.web.applicationPubKey = vapidKey;\r\n }\r\n return body;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** UpdateRegistration will be called once every week. */\r\nvar TOKEN_EXPIRATION_MS = 7 * 24 * 60 * 60 * 1000; // 7 days\r\nfunction getToken(firebaseDependencies, swRegistration, vapidKey) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var pushSubscription, tokenDetails, subscriptionOptions, e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (Notification.permission !== 'granted') {\r\n throw ERROR_FACTORY.create(\"permission-blocked\" /* PERMISSION_BLOCKED */);\r\n }\r\n return [4 /*yield*/, getPushSubscription(swRegistration, vapidKey)];\r\n case 1:\r\n pushSubscription = _a.sent();\r\n return [4 /*yield*/, dbGet(firebaseDependencies)];\r\n case 2:\r\n tokenDetails = _a.sent();\r\n subscriptionOptions = {\r\n vapidKey: vapidKey,\r\n swScope: swRegistration.scope,\r\n endpoint: pushSubscription.endpoint,\r\n auth: arrayToBase64(pushSubscription.getKey('auth')),\r\n p256dh: arrayToBase64(pushSubscription.getKey('p256dh'))\r\n };\r\n if (!!tokenDetails) return [3 /*break*/, 3];\r\n // No token, get a new one.\r\n return [2 /*return*/, getNewToken(firebaseDependencies, subscriptionOptions)];\r\n case 3:\r\n if (!!isTokenValid(tokenDetails.subscriptionOptions, subscriptionOptions)) return [3 /*break*/, 8];\r\n _a.label = 4;\r\n case 4:\r\n _a.trys.push([4, 6, , 7]);\r\n return [4 /*yield*/, requestDeleteToken(firebaseDependencies, tokenDetails.token)];\r\n case 5:\r\n _a.sent();\r\n return [3 /*break*/, 7];\r\n case 6:\r\n e_1 = _a.sent();\r\n // Suppress errors because of #2364\r\n console.warn(e_1);\r\n return [3 /*break*/, 7];\r\n case 7: return [2 /*return*/, getNewToken(firebaseDependencies, subscriptionOptions)];\r\n case 8:\r\n if (Date.now() >= tokenDetails.createTime + TOKEN_EXPIRATION_MS) {\r\n // Weekly token refresh\r\n return [2 /*return*/, updateToken({\r\n token: tokenDetails.token,\r\n createTime: Date.now(),\r\n subscriptionOptions: subscriptionOptions\r\n }, firebaseDependencies, swRegistration)];\r\n }\r\n else {\r\n // Valid token, nothing to do.\r\n return [2 /*return*/, tokenDetails.token];\r\n }\r\n case 9: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * This method deletes the token from the database, unsubscribes the token from FCM, and unregisters\r\n * the push subscription if it exists.\r\n */\r\nfunction deleteToken(firebaseDependencies, swRegistration) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var tokenDetails, pushSubscription;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, dbGet(firebaseDependencies)];\r\n case 1:\r\n tokenDetails = _a.sent();\r\n if (!tokenDetails) return [3 /*break*/, 4];\r\n return [4 /*yield*/, requestDeleteToken(firebaseDependencies, tokenDetails.token)];\r\n case 2:\r\n _a.sent();\r\n return [4 /*yield*/, dbRemove(firebaseDependencies)];\r\n case 3:\r\n _a.sent();\r\n _a.label = 4;\r\n case 4: return [4 /*yield*/, swRegistration.pushManager.getSubscription()];\r\n case 5:\r\n pushSubscription = _a.sent();\r\n if (pushSubscription) {\r\n return [2 /*return*/, pushSubscription.unsubscribe()];\r\n }\r\n // If there's no SW, consider it a success.\r\n return [2 /*return*/, true];\r\n }\r\n });\r\n });\r\n}\r\nfunction updateToken(tokenDetails, firebaseDependencies, swRegistration) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var updatedToken, updatedTokenDetails, e_2;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 3, , 5]);\r\n return [4 /*yield*/, requestUpdateToken(firebaseDependencies, tokenDetails)];\r\n case 1:\r\n updatedToken = _a.sent();\r\n updatedTokenDetails = __assign(__assign({}, tokenDetails), { token: updatedToken, createTime: Date.now() });\r\n return [4 /*yield*/, dbSet(firebaseDependencies, updatedTokenDetails)];\r\n case 2:\r\n _a.sent();\r\n return [2 /*return*/, updatedToken];\r\n case 3:\r\n e_2 = _a.sent();\r\n return [4 /*yield*/, deleteToken(firebaseDependencies, swRegistration)];\r\n case 4:\r\n _a.sent();\r\n throw e_2;\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\nfunction getNewToken(firebaseDependencies, subscriptionOptions) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var token, tokenDetails;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, requestGetToken(firebaseDependencies, subscriptionOptions)];\r\n case 1:\r\n token = _a.sent();\r\n tokenDetails = {\r\n token: token,\r\n createTime: Date.now(),\r\n subscriptionOptions: subscriptionOptions\r\n };\r\n return [4 /*yield*/, dbSet(firebaseDependencies, tokenDetails)];\r\n case 2:\r\n _a.sent();\r\n return [2 /*return*/, tokenDetails.token];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Gets a PushSubscription for the current user.\r\n */\r\nfunction getPushSubscription(swRegistration, vapidKey) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var subscription;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, swRegistration.pushManager.getSubscription()];\r\n case 1:\r\n subscription = _a.sent();\r\n if (subscription) {\r\n return [2 /*return*/, subscription];\r\n }\r\n return [2 /*return*/, swRegistration.pushManager.subscribe({\r\n userVisibleOnly: true,\r\n // Chrome <= 75 doesn't support base64-encoded VAPID key. For backward compatibility, VAPID key\r\n // submitted to pushManager#subscribe must be of type Uint8Array.\r\n applicationServerKey: base64ToArray(vapidKey)\r\n })];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Checks if the saved tokenDetails object matches the configuration provided.\r\n */\r\nfunction isTokenValid(dbOptions, currentOptions) {\r\n var isVapidKeyEqual = currentOptions.vapidKey === dbOptions.vapidKey;\r\n var isEndpointEqual = currentOptions.endpoint === dbOptions.endpoint;\r\n var isAuthEqual = currentOptions.auth === dbOptions.auth;\r\n var isP256dhEqual = currentOptions.p256dh === dbOptions.p256dh;\r\n return isVapidKeyEqual && isEndpointEqual && isAuthEqual && isP256dhEqual;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction externalizePayload(internalPayload) {\r\n var payload = {\r\n from: internalPayload.from,\r\n // eslint-disable-next-line camelcase\r\n collapseKey: internalPayload.collapse_key\r\n };\r\n propagateNotificationPayload(payload, internalPayload);\r\n propagateDataPayload(payload, internalPayload);\r\n propagateFcmOptions(payload, internalPayload);\r\n return payload;\r\n}\r\nfunction propagateNotificationPayload(payload, messagePayloadInternal) {\r\n if (!messagePayloadInternal.notification) {\r\n return;\r\n }\r\n payload.notification = {};\r\n var title = messagePayloadInternal.notification.title;\r\n if (!!title) {\r\n payload.notification.title = title;\r\n }\r\n var body = messagePayloadInternal.notification.body;\r\n if (!!body) {\r\n payload.notification.body = body;\r\n }\r\n var image = messagePayloadInternal.notification.image;\r\n if (!!image) {\r\n payload.notification.image = image;\r\n }\r\n}\r\nfunction propagateDataPayload(payload, messagePayloadInternal) {\r\n if (!messagePayloadInternal.data) {\r\n return;\r\n }\r\n payload.data = messagePayloadInternal.data;\r\n}\r\nfunction propagateFcmOptions(payload, messagePayloadInternal) {\r\n if (!messagePayloadInternal.fcmOptions) {\r\n return;\r\n }\r\n payload.fcmOptions = {};\r\n var link = messagePayloadInternal.fcmOptions.link;\r\n if (!!link) {\r\n payload.fcmOptions.link = link;\r\n }\r\n // eslint-disable-next-line camelcase\r\n var analyticsLabel = messagePayloadInternal.fcmOptions.analytics_label;\r\n if (!!analyticsLabel) {\r\n payload.fcmOptions.analyticsLabel = analyticsLabel;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction isConsoleMessage(data) {\r\n // This message has a campaign ID, meaning it was sent using the Firebase Console.\r\n return typeof data === 'object' && !!data && CONSOLE_CAMPAIGN_ID in data;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Returns a promise that resolves after given time passes. */\r\nfunction sleep(ms) {\r\n return new Promise(function (resolve) {\r\n setTimeout(resolve, ms);\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar SwController = /** @class */ (function () {\r\n function SwController(firebaseDependencies) {\r\n var _this = this;\r\n this.firebaseDependencies = firebaseDependencies;\r\n // A boolean flag to determine wether an app is using onBackgroundMessage or\r\n // setBackgroundMessageHandler. onBackgroundMessage will receive a MessagePayload regardless of if\r\n // a notification is displayed. Whereas, setBackgroundMessageHandler will swallow the\r\n // MessagePayload if a NotificationPayload is included.\r\n this.isOnBackgroundMessageUsed = null;\r\n this.vapidKey = null;\r\n this.bgMessageHandler = null;\r\n self.addEventListener('push', function (e) {\r\n e.waitUntil(_this.onPush(e));\r\n });\r\n self.addEventListener('pushsubscriptionchange', function (e) {\r\n e.waitUntil(_this.onSubChange(e));\r\n });\r\n self.addEventListener('notificationclick', function (e) {\r\n e.waitUntil(_this.onNotificationClick(e));\r\n });\r\n }\r\n Object.defineProperty(SwController.prototype, \"app\", {\r\n get: function () {\r\n return this.firebaseDependencies.app;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * @deprecated. Use onBackgroundMessage(nextOrObserver: NextFn<object> | Observer<object>):\r\n * Unsubscribe instead.\r\n *\r\n * Calling setBackgroundMessageHandler will opt in to some specific behaviors.\r\n *\r\n * 1.) If a notification doesn't need to be shown due to a window already being visible, then push\r\n * messages will be sent to the page. 2.) If a notification needs to be shown, and the message\r\n * contains no notification data this method will be called and the promise it returns will be\r\n * passed to event.waitUntil. If you do not set this callback then all push messages will let and\r\n * the developer can handle them in a their own 'push' event callback\r\n *\r\n * @param callback The callback to be called when a push message is received and a notification\r\n * must be shown. The callback will be given the data from the push message.\r\n */\r\n SwController.prototype.setBackgroundMessageHandler = function (callback) {\r\n this.isOnBackgroundMessageUsed = false;\r\n if (!callback || typeof callback !== 'function') {\r\n throw ERROR_FACTORY.create(\"invalid-bg-handler\" /* INVALID_BG_HANDLER */);\r\n }\r\n this.bgMessageHandler = callback;\r\n };\r\n SwController.prototype.onBackgroundMessage = function (nextOrObserver) {\r\n var _this = this;\r\n this.isOnBackgroundMessageUsed = true;\r\n this.bgMessageHandler = nextOrObserver;\r\n return function () {\r\n _this.bgMessageHandler = null;\r\n };\r\n };\r\n // TODO: Remove getToken from SW Controller. Calling this from an old SW can cause all kinds of\r\n // trouble.\r\n SwController.prototype.getToken = function () {\r\n var _a, _b;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var tokenDetails;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n if (!!this.vapidKey) return [3 /*break*/, 2];\r\n return [4 /*yield*/, dbGet(this.firebaseDependencies)];\r\n case 1:\r\n tokenDetails = _c.sent();\r\n this.vapidKey = (_b = (_a = tokenDetails === null || tokenDetails === void 0 ? void 0 : tokenDetails.subscriptionOptions) === null || _a === void 0 ? void 0 : _a.vapidKey) !== null && _b !== void 0 ? _b : DEFAULT_VAPID_KEY;\r\n _c.label = 2;\r\n case 2: return [2 /*return*/, getToken(this.firebaseDependencies, self.registration, this.vapidKey)];\r\n }\r\n });\r\n });\r\n };\r\n // TODO: Remove deleteToken from SW Controller. Calling this from an old SW can cause all kinds of\r\n // trouble.\r\n SwController.prototype.deleteToken = function () {\r\n return deleteToken(this.firebaseDependencies, self.registration);\r\n };\r\n SwController.prototype.requestPermission = function () {\r\n throw ERROR_FACTORY.create(\"only-available-in-window\" /* AVAILABLE_IN_WINDOW */);\r\n };\r\n // TODO: Remove this together with getToken from SW Controller.\r\n SwController.prototype.usePublicVapidKey = function (vapidKey) {\r\n if (this.vapidKey !== null) {\r\n throw ERROR_FACTORY.create(\"use-vapid-key-after-get-token\" /* USE_VAPID_KEY_AFTER_GET_TOKEN */);\r\n }\r\n if (typeof vapidKey !== 'string' || vapidKey.length === 0) {\r\n throw ERROR_FACTORY.create(\"invalid-vapid-key\" /* INVALID_VAPID_KEY */);\r\n }\r\n this.vapidKey = vapidKey;\r\n };\r\n SwController.prototype.useServiceWorker = function () {\r\n throw ERROR_FACTORY.create(\"only-available-in-window\" /* AVAILABLE_IN_WINDOW */);\r\n };\r\n SwController.prototype.onMessage = function () {\r\n throw ERROR_FACTORY.create(\"only-available-in-window\" /* AVAILABLE_IN_WINDOW */);\r\n };\r\n SwController.prototype.onTokenRefresh = function () {\r\n throw ERROR_FACTORY.create(\"only-available-in-window\" /* AVAILABLE_IN_WINDOW */);\r\n };\r\n /**\r\n * A handler for push events that shows notifications based on the content of the payload.\r\n *\r\n * The payload must be a JSON-encoded Object with a `notification` key. The value of the\r\n * `notification` property will be used as the NotificationOptions object passed to\r\n * showNotification. Additionally, the `title` property of the notification object will be used as\r\n * the title.\r\n *\r\n * If there is no notification data in the payload then no notification will be shown.\r\n */\r\n SwController.prototype.onPush = function (event) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var internalPayload, clientList, isNotificationShown, payload;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n internalPayload = getMessagePayloadInternal(event);\r\n if (!internalPayload) {\r\n console.debug(TAG +\r\n 'failed to get parsed MessagePayload from the PushEvent. Skip handling the push.');\r\n return [2 /*return*/];\r\n }\r\n return [4 /*yield*/, getClientList()];\r\n case 1:\r\n clientList = _a.sent();\r\n if (hasVisibleClients(clientList)) {\r\n return [2 /*return*/, sendMessagePayloadInternalToWindows(clientList, internalPayload)];\r\n }\r\n isNotificationShown = false;\r\n if (!!!internalPayload.notification) return [3 /*break*/, 3];\r\n return [4 /*yield*/, showNotification(wrapInternalPayload(internalPayload))];\r\n case 2:\r\n _a.sent();\r\n isNotificationShown = true;\r\n _a.label = 3;\r\n case 3:\r\n // MessagePayload is only passed to `onBackgroundMessage`. Skip passing MessagePayload for\r\n // the legacy `setBackgroundMessageHandler` to preserve the SDK behaviors.\r\n if (isNotificationShown === true &&\r\n this.isOnBackgroundMessageUsed === false) {\r\n return [2 /*return*/];\r\n }\r\n if (!!this.bgMessageHandler) {\r\n payload = externalizePayload(internalPayload);\r\n if (typeof this.bgMessageHandler === 'function') {\r\n this.bgMessageHandler(payload);\r\n }\r\n else {\r\n this.bgMessageHandler.next(payload);\r\n }\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n SwController.prototype.onSubChange = function (event) {\r\n var _a, _b;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var newSubscription, tokenDetails;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n newSubscription = event.newSubscription;\r\n if (!!newSubscription) return [3 /*break*/, 2];\r\n // Subscription revoked, delete token\r\n return [4 /*yield*/, deleteToken(this.firebaseDependencies, self.registration)];\r\n case 1:\r\n // Subscription revoked, delete token\r\n _c.sent();\r\n return [2 /*return*/];\r\n case 2: return [4 /*yield*/, dbGet(this.firebaseDependencies)];\r\n case 3:\r\n tokenDetails = _c.sent();\r\n return [4 /*yield*/, deleteToken(this.firebaseDependencies, self.registration)];\r\n case 4:\r\n _c.sent();\r\n return [4 /*yield*/, getToken(this.firebaseDependencies, self.registration, (_b = (_a = tokenDetails === null || tokenDetails === void 0 ? void 0 : tokenDetails.subscriptionOptions) === null || _a === void 0 ? void 0 : _a.vapidKey) !== null && _b !== void 0 ? _b : DEFAULT_VAPID_KEY)];\r\n case 5:\r\n _c.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n SwController.prototype.onNotificationClick = function (event) {\r\n var _a, _b;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var internalPayload, link, url, originUrl, client;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n internalPayload = (_b = (_a = event.notification) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b[FCM_MSG];\r\n if (!internalPayload) {\r\n return [2 /*return*/];\r\n }\r\n else if (event.action) {\r\n // User clicked on an action button. This will allow developers to act on action button clicks\r\n // by using a custom onNotificationClick listener that they define.\r\n return [2 /*return*/];\r\n }\r\n // Prevent other listeners from receiving the event\r\n event.stopImmediatePropagation();\r\n event.notification.close();\r\n link = getLink(internalPayload);\r\n if (!link) {\r\n return [2 /*return*/];\r\n }\r\n url = new URL(link, self.location.href);\r\n originUrl = new URL(self.location.origin);\r\n if (url.host !== originUrl.host) {\r\n return [2 /*return*/];\r\n }\r\n return [4 /*yield*/, getWindowClient(url)];\r\n case 1:\r\n client = _c.sent();\r\n if (!!client) return [3 /*break*/, 4];\r\n return [4 /*yield*/, self.clients.openWindow(link)];\r\n case 2:\r\n client = _c.sent();\r\n // Wait three seconds for the client to initialize and set up the message handler so that it\r\n // can receive the message.\r\n return [4 /*yield*/, sleep(3000)];\r\n case 3:\r\n // Wait three seconds for the client to initialize and set up the message handler so that it\r\n // can receive the message.\r\n _c.sent();\r\n return [3 /*break*/, 6];\r\n case 4: return [4 /*yield*/, client.focus()];\r\n case 5:\r\n client = _c.sent();\r\n _c.label = 6;\r\n case 6:\r\n if (!client) {\r\n // Window Client will not be returned if it's for a third party origin.\r\n return [2 /*return*/];\r\n }\r\n internalPayload.messageType = MessageType.NOTIFICATION_CLICKED;\r\n internalPayload.isFirebaseMessaging = true;\r\n return [2 /*return*/, client.postMessage(internalPayload)];\r\n }\r\n });\r\n });\r\n };\r\n return SwController;\r\n}());\r\nfunction wrapInternalPayload(internalPayload) {\r\n var _a;\r\n var wrappedInternalPayload = __assign({}, internalPayload.notification);\r\n // Put the message payload under FCM_MSG name so we can identify the notification as being an FCM\r\n // notification vs a notification from somewhere else (i.e. normal web push or developer generated\r\n // notification).\r\n wrappedInternalPayload.data = (_a = {},\r\n _a[FCM_MSG] = internalPayload,\r\n _a);\r\n return wrappedInternalPayload;\r\n}\r\nfunction getMessagePayloadInternal(_a) {\r\n var data = _a.data;\r\n if (!data) {\r\n return null;\r\n }\r\n try {\r\n return data.json();\r\n }\r\n catch (err) {\r\n // Not JSON so not an FCM message.\r\n return null;\r\n }\r\n}\r\n/**\r\n * @param url The URL to look for when focusing a client.\r\n * @return Returns an existing window client or a newly opened WindowClient.\r\n */\r\nfunction getWindowClient(url) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var clientList, clientList_1, clientList_1_1, client, clientUrl;\r\n var e_1, _a;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, getClientList()];\r\n case 1:\r\n clientList = _b.sent();\r\n try {\r\n for (clientList_1 = __values(clientList), clientList_1_1 = clientList_1.next(); !clientList_1_1.done; clientList_1_1 = clientList_1.next()) {\r\n client = clientList_1_1.value;\r\n clientUrl = new URL(client.url, self.location.href);\r\n if (url.host === clientUrl.host) {\r\n return [2 /*return*/, client];\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (clientList_1_1 && !clientList_1_1.done && (_a = clientList_1.return)) _a.call(clientList_1);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n return [2 /*return*/, null];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * @returns If there is currently a visible WindowClient, this method will resolve to true,\r\n * otherwise false.\r\n */\r\nfunction hasVisibleClients(clientList) {\r\n return clientList.some(function (client) {\r\n return client.visibilityState === 'visible' &&\r\n // Ignore chrome-extension clients as that matches the background pages of extensions, which\r\n // are always considered visible for some reason.\r\n !client.url.startsWith('chrome-extension://');\r\n });\r\n}\r\nfunction sendMessagePayloadInternalToWindows(clientList, internalPayload) {\r\n var e_2, _a;\r\n internalPayload.isFirebaseMessaging = true;\r\n internalPayload.messageType = MessageType.PUSH_RECEIVED;\r\n try {\r\n for (var clientList_2 = __values(clientList), clientList_2_1 = clientList_2.next(); !clientList_2_1.done; clientList_2_1 = clientList_2.next()) {\r\n var client = clientList_2_1.value;\r\n client.postMessage(internalPayload);\r\n }\r\n }\r\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\r\n finally {\r\n try {\r\n if (clientList_2_1 && !clientList_2_1.done && (_a = clientList_2.return)) _a.call(clientList_2);\r\n }\r\n finally { if (e_2) throw e_2.error; }\r\n }\r\n}\r\nfunction getClientList() {\r\n return self.clients.matchAll({\r\n type: 'window',\r\n includeUncontrolled: true\r\n // TS doesn't know that \"type: 'window'\" means it'll return WindowClient[]\r\n });\r\n}\r\nfunction showNotification(notificationPayloadInternal) {\r\n var _a;\r\n // Note: Firefox does not support the maxActions property.\r\n // https://developer.mozilla.org/en-US/docs/Web/API/notification/maxActions\r\n var actions = notificationPayloadInternal.actions;\r\n var maxActions = Notification.maxActions;\r\n if (actions && maxActions && actions.length > maxActions) {\r\n console.warn(\"This browser only supports \" + maxActions + \" actions. The remaining actions will not be displayed.\");\r\n }\r\n return self.registration.showNotification((_a = \r\n /* title= */ notificationPayloadInternal.title) !== null && _a !== void 0 ? _a : '', notificationPayloadInternal);\r\n}\r\nfunction getLink(payload) {\r\n var _a, _b, _c;\r\n // eslint-disable-next-line camelcase\r\n var link = (_b = (_a = payload.fcmOptions) === null || _a === void 0 ? void 0 : _a.link) !== null && _b !== void 0 ? _b : (_c = payload.notification) === null || _c === void 0 ? void 0 : _c.click_action;\r\n if (link) {\r\n return link;\r\n }\r\n if (isConsoleMessage(payload.data)) {\r\n // Notification created in the Firebase Console. Redirect to origin.\r\n return self.location.origin;\r\n }\r\n else {\r\n return null;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar WindowController = /** @class */ (function () {\r\n function WindowController(firebaseDependencies) {\r\n var _this = this;\r\n this.firebaseDependencies = firebaseDependencies;\r\n this.vapidKey = null;\r\n this.onMessageCallback = null;\r\n navigator.serviceWorker.addEventListener('message', function (e) {\r\n return _this.messageEventListener(e);\r\n });\r\n }\r\n Object.defineProperty(WindowController.prototype, \"app\", {\r\n get: function () {\r\n return this.firebaseDependencies.app;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n WindowController.prototype.messageEventListener = function (event) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var internalPayload, dataPayload;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n internalPayload = event.data;\r\n if (!internalPayload.isFirebaseMessaging) {\r\n return [2 /*return*/];\r\n }\r\n // onMessageCallback is either a function or observer/subscriber.\r\n // TODO: in the modularization release, have onMessage handle type MessagePayload as supposed to\r\n // the legacy payload where some fields are in snake cases.\r\n if (this.onMessageCallback &&\r\n internalPayload.messageType === MessageType.PUSH_RECEIVED) {\r\n if (typeof this.onMessageCallback === 'function') {\r\n this.onMessageCallback(stripInternalFields(Object.assign({}, internalPayload)));\r\n }\r\n else {\r\n this.onMessageCallback.next(Object.assign({}, internalPayload));\r\n }\r\n }\r\n dataPayload = internalPayload.data;\r\n if (!(isConsoleMessage(dataPayload) &&\r\n dataPayload[CONSOLE_CAMPAIGN_ANALYTICS_ENABLED] === '1')) return [3 /*break*/, 2];\r\n return [4 /*yield*/, this.logEvent(internalPayload.messageType, dataPayload)];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n WindowController.prototype.getVapidKey = function () {\r\n return this.vapidKey;\r\n };\r\n WindowController.prototype.getSwReg = function () {\r\n return this.swRegistration;\r\n };\r\n WindowController.prototype.getToken = function (options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!(Notification.permission === 'default')) return [3 /*break*/, 2];\r\n return [4 /*yield*/, Notification.requestPermission()];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2:\r\n if (Notification.permission !== 'granted') {\r\n throw ERROR_FACTORY.create(\"permission-blocked\" /* PERMISSION_BLOCKED */);\r\n }\r\n return [4 /*yield*/, this.updateVapidKey(options === null || options === void 0 ? void 0 : options.vapidKey)];\r\n case 3:\r\n _a.sent();\r\n return [4 /*yield*/, this.updateSwReg(options === null || options === void 0 ? void 0 : options.serviceWorkerRegistration)];\r\n case 4:\r\n _a.sent();\r\n return [2 /*return*/, getToken(this.firebaseDependencies, this.swRegistration, this.vapidKey)];\r\n }\r\n });\r\n });\r\n };\r\n WindowController.prototype.updateVapidKey = function (vapidKey) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n if (!!vapidKey) {\r\n this.vapidKey = vapidKey;\r\n }\r\n else if (!this.vapidKey) {\r\n this.vapidKey = DEFAULT_VAPID_KEY;\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n WindowController.prototype.updateSwReg = function (swRegistration) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!(!swRegistration && !this.swRegistration)) return [3 /*break*/, 2];\r\n return [4 /*yield*/, this.registerDefaultSw()];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2:\r\n if (!swRegistration && !!this.swRegistration) {\r\n return [2 /*return*/];\r\n }\r\n if (!(swRegistration instanceof ServiceWorkerRegistration)) {\r\n throw ERROR_FACTORY.create(\"invalid-sw-registration\" /* INVALID_SW_REGISTRATION */);\r\n }\r\n this.swRegistration = swRegistration;\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n WindowController.prototype.registerDefaultSw = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _a, e_1;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n _b.trys.push([0, 2, , 3]);\r\n _a = this;\r\n return [4 /*yield*/, navigator.serviceWorker.register(DEFAULT_SW_PATH, {\r\n scope: DEFAULT_SW_SCOPE\r\n })];\r\n case 1:\r\n _a.swRegistration = _b.sent();\r\n // The timing when browser updates sw when sw has an update is unreliable by my experiment. It\r\n // leads to version conflict when the SDK upgrades to a newer version in the main page, but sw\r\n // is stuck with the old version. For example,\r\n // https://github.com/firebase/firebase-js-sdk/issues/2590 The following line reliably updates\r\n // sw if there was an update.\r\n this.swRegistration.update().catch(function () {\r\n /* it is non blocking and we don't care if it failed */\r\n });\r\n return [3 /*break*/, 3];\r\n case 2:\r\n e_1 = _b.sent();\r\n throw ERROR_FACTORY.create(\"failed-service-worker-registration\" /* FAILED_DEFAULT_REGISTRATION */, {\r\n browserErrorMessage: e_1.message\r\n });\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n WindowController.prototype.deleteToken = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!!this.swRegistration) return [3 /*break*/, 2];\r\n return [4 /*yield*/, this.registerDefaultSw()];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2: return [2 /*return*/, deleteToken(this.firebaseDependencies, this.swRegistration)];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Request permission if it is not currently granted.\r\n *\r\n * @return Resolves if the permission was granted, rejects otherwise.\r\n *\r\n * @deprecated Use Notification.requestPermission() instead.\r\n * https://developer.mozilla.org/en-US/docs/Web/API/Notification/requestPermission\r\n */\r\n WindowController.prototype.requestPermission = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var permissionResult;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (Notification.permission === 'granted') {\r\n return [2 /*return*/];\r\n }\r\n return [4 /*yield*/, Notification.requestPermission()];\r\n case 1:\r\n permissionResult = _a.sent();\r\n if (permissionResult === 'granted') {\r\n return [2 /*return*/];\r\n }\r\n else if (permissionResult === 'denied') {\r\n throw ERROR_FACTORY.create(\"permission-blocked\" /* PERMISSION_BLOCKED */);\r\n }\r\n else {\r\n throw ERROR_FACTORY.create(\"permission-default\" /* PERMISSION_DEFAULT */);\r\n }\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * @deprecated. Use getToken(options?: {vapidKey?: string; serviceWorkerRegistration?:\r\n * ServiceWorkerRegistration;}): Promise<string> instead.\r\n */\r\n WindowController.prototype.usePublicVapidKey = function (vapidKey) {\r\n if (this.vapidKey !== null) {\r\n throw ERROR_FACTORY.create(\"use-vapid-key-after-get-token\" /* USE_VAPID_KEY_AFTER_GET_TOKEN */);\r\n }\r\n if (typeof vapidKey !== 'string' || vapidKey.length === 0) {\r\n throw ERROR_FACTORY.create(\"invalid-vapid-key\" /* INVALID_VAPID_KEY */);\r\n }\r\n this.vapidKey = vapidKey;\r\n };\r\n /**\r\n * @deprecated. Use getToken(options?: {vapidKey?: string; serviceWorkerRegistration?:\r\n * ServiceWorkerRegistration;}): Promise<string> instead.\r\n */\r\n WindowController.prototype.useServiceWorker = function (swRegistration) {\r\n if (!(swRegistration instanceof ServiceWorkerRegistration)) {\r\n throw ERROR_FACTORY.create(\"invalid-sw-registration\" /* INVALID_SW_REGISTRATION */);\r\n }\r\n if (this.swRegistration) {\r\n throw ERROR_FACTORY.create(\"use-sw-after-get-token\" /* USE_SW_AFTER_GET_TOKEN */);\r\n }\r\n this.swRegistration = swRegistration;\r\n };\r\n /**\r\n * @param nextOrObserver An observer object or a function triggered on message.\r\n *\r\n * @return The unsubscribe function for the observer.\r\n */\r\n WindowController.prototype.onMessage = function (nextOrObserver) {\r\n var _this = this;\r\n this.onMessageCallback = nextOrObserver;\r\n return function () {\r\n _this.onMessageCallback = null;\r\n };\r\n };\r\n WindowController.prototype.setBackgroundMessageHandler = function () {\r\n throw ERROR_FACTORY.create(\"only-available-in-sw\" /* AVAILABLE_IN_SW */);\r\n };\r\n WindowController.prototype.onBackgroundMessage = function () {\r\n throw ERROR_FACTORY.create(\"only-available-in-sw\" /* AVAILABLE_IN_SW */);\r\n };\r\n /**\r\n * @deprecated No-op. It was initially designed with token rotation requests from server in mind.\r\n * However, the plan to implement such feature was abandoned.\r\n */\r\n WindowController.prototype.onTokenRefresh = function () {\r\n return function () { };\r\n };\r\n WindowController.prototype.logEvent = function (messageType, data) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var eventType, analytics;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n eventType = getEventType(messageType);\r\n return [4 /*yield*/, this.firebaseDependencies.analyticsProvider.get()];\r\n case 1:\r\n analytics = _a.sent();\r\n analytics.logEvent(eventType, {\r\n /* eslint-disable camelcase */\r\n message_id: data[CONSOLE_CAMPAIGN_ID],\r\n message_name: data[CONSOLE_CAMPAIGN_NAME],\r\n message_time: data[CONSOLE_CAMPAIGN_TIME],\r\n message_device_time: Math.floor(Date.now() / 1000)\r\n /* eslint-enable camelcase */\r\n });\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n return WindowController;\r\n}());\r\nfunction getEventType(messageType) {\r\n switch (messageType) {\r\n case MessageType.NOTIFICATION_CLICKED:\r\n return 'notification_open';\r\n case MessageType.PUSH_RECEIVED:\r\n return 'notification_foreground';\r\n default:\r\n throw new Error();\r\n }\r\n}\r\nfunction stripInternalFields(internalPayload) {\r\n delete internalPayload.messageType;\r\n delete internalPayload.isFirebaseMessaging;\r\n return internalPayload;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction extractAppConfig(app) {\r\n var e_1, _a;\r\n if (!app || !app.options) {\r\n throw getMissingValueError('App Configuration Object');\r\n }\r\n if (!app.name) {\r\n throw getMissingValueError('App Name');\r\n }\r\n // Required app config keys\r\n var configKeys = [\r\n 'projectId',\r\n 'apiKey',\r\n 'appId',\r\n 'messagingSenderId'\r\n ];\r\n var options = app.options;\r\n try {\r\n for (var configKeys_1 = __values(configKeys), configKeys_1_1 = configKeys_1.next(); !configKeys_1_1.done; configKeys_1_1 = configKeys_1.next()) {\r\n var keyName = configKeys_1_1.value;\r\n if (!options[keyName]) {\r\n throw getMissingValueError(keyName);\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (configKeys_1_1 && !configKeys_1_1.done && (_a = configKeys_1.return)) _a.call(configKeys_1);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n return {\r\n appName: app.name,\r\n projectId: options.projectId,\r\n apiKey: options.apiKey,\r\n appId: options.appId,\r\n senderId: options.messagingSenderId\r\n };\r\n}\r\nfunction getMissingValueError(valueName) {\r\n return ERROR_FACTORY.create(\"missing-app-config-values\" /* MISSING_APP_CONFIG_VALUES */, {\r\n valueName: valueName\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar MESSAGING_NAME = 'messaging';\r\nfunction factoryMethod(container) {\r\n // Dependencies.\r\n var app = container.getProvider('app').getImmediate();\r\n var appConfig = extractAppConfig(app);\r\n var installations = container.getProvider('installations').getImmediate();\r\n var analyticsProvider = container.getProvider('analytics-internal');\r\n var firebaseDependencies = {\r\n app: app,\r\n appConfig: appConfig,\r\n installations: installations,\r\n analyticsProvider: analyticsProvider\r\n };\r\n if (!isSupported()) {\r\n throw ERROR_FACTORY.create(\"unsupported-browser\" /* UNSUPPORTED_BROWSER */);\r\n }\r\n if (self && 'ServiceWorkerGlobalScope' in self) {\r\n // Running in ServiceWorker context\r\n return new SwController(firebaseDependencies);\r\n }\r\n else {\r\n // Assume we are in the window context.\r\n return new WindowController(firebaseDependencies);\r\n }\r\n}\r\nvar NAMESPACE_EXPORTS = {\r\n isSupported: isSupported\r\n};\r\nfirebase.INTERNAL.registerComponent(new Component(MESSAGING_NAME, factoryMethod, \"PUBLIC\" /* PUBLIC */).setServiceProps(NAMESPACE_EXPORTS));\r\nfunction isSupported() {\r\n if (self && 'ServiceWorkerGlobalScope' in self) {\r\n // Running in ServiceWorker context\r\n return isSWControllerSupported();\r\n }\r\n else {\r\n // Assume we are in the window context.\r\n return isWindowControllerSupported();\r\n }\r\n}\r\n/**\r\n * Checks to see if the required APIs exist.\r\n */\r\nfunction isWindowControllerSupported() {\r\n return ('indexedDB' in window &&\r\n indexedDB !== null &&\r\n navigator.cookieEnabled &&\r\n 'serviceWorker' in navigator &&\r\n 'PushManager' in window &&\r\n 'Notification' in window &&\r\n 'fetch' in window &&\r\n ServiceWorkerRegistration.prototype.hasOwnProperty('showNotification') &&\r\n PushSubscription.prototype.hasOwnProperty('getKey'));\r\n}\r\n/**\r\n * Checks to see if the required APIs exist within SW Context.\r\n */\r\nfunction isSWControllerSupported() {\r\n return ('indexedDB' in self &&\r\n indexedDB !== null &&\r\n 'PushManager' in self &&\r\n 'Notification' in self &&\r\n ServiceWorkerRegistration.prototype.hasOwnProperty('showNotification') &&\r\n PushSubscription.prototype.hasOwnProperty('getKey'));\r\n}\n//# sourceMappingURL=index.esm.js.map\n","import firebase from '@firebase/app';\nimport '@firebase/installations';\nimport { __spreadArrays, __assign } from 'tslib';\nimport { ErrorFactory, isIndexedDBAvailable, validateIndexedDBOpenable } from '@firebase/util';\nimport { Logger, LogLevel } from '@firebase/logger';\nimport { Component } from '@firebase/component';\n\nvar name = \"@firebase/performance\";\nvar version = \"0.4.3\";\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar SDK_VERSION = version;\r\n/** The prefix for start User Timing marks used for creating Traces. */\r\nvar TRACE_START_MARK_PREFIX = 'FB-PERF-TRACE-START';\r\n/** The prefix for stop User Timing marks used for creating Traces. */\r\nvar TRACE_STOP_MARK_PREFIX = 'FB-PERF-TRACE-STOP';\r\n/** The prefix for User Timing measure used for creating Traces. */\r\nvar TRACE_MEASURE_PREFIX = 'FB-PERF-TRACE-MEASURE';\r\n/** The prefix for out of the box page load Trace name. */\r\nvar OOB_TRACE_PAGE_LOAD_PREFIX = '_wt_';\r\nvar FIRST_PAINT_COUNTER_NAME = '_fp';\r\nvar FIRST_CONTENTFUL_PAINT_COUNTER_NAME = '_fcp';\r\nvar FIRST_INPUT_DELAY_COUNTER_NAME = '_fid';\r\nvar CONFIG_LOCAL_STORAGE_KEY = '@firebase/performance/config';\r\nvar CONFIG_EXPIRY_LOCAL_STORAGE_KEY = '@firebase/performance/configexpire';\r\nvar SERVICE = 'performance';\r\nvar SERVICE_NAME = 'Performance';\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar _a;\r\nvar ERROR_DESCRIPTION_MAP = (_a = {},\r\n _a[\"trace started\" /* TRACE_STARTED_BEFORE */] = 'Trace {$traceName} was started before.',\r\n _a[\"trace stopped\" /* TRACE_STOPPED_BEFORE */] = 'Trace {$traceName} is not running.',\r\n _a[\"nonpositive trace startTime\" /* NONPOSITIVE_TRACE_START_TIME */] = 'Trace {$traceName} startTime should be positive.',\r\n _a[\"nonpositive trace duration\" /* NONPOSITIVE_TRACE_DURATION */] = 'Trace {$traceName} duration should be positive.',\r\n _a[\"no window\" /* NO_WINDOW */] = 'Window is not available.',\r\n _a[\"no app id\" /* NO_APP_ID */] = 'App id is not available.',\r\n _a[\"no project id\" /* NO_PROJECT_ID */] = 'Project id is not available.',\r\n _a[\"no api key\" /* NO_API_KEY */] = 'Api key is not available.',\r\n _a[\"invalid cc log\" /* INVALID_CC_LOG */] = 'Attempted to queue invalid cc event',\r\n _a[\"FB not default\" /* FB_NOT_DEFAULT */] = 'Performance can only start when Firebase app instance is the default one.',\r\n _a[\"RC response not ok\" /* RC_NOT_OK */] = 'RC response is not ok',\r\n _a[\"invalid attribute name\" /* INVALID_ATTRIBUTE_NAME */] = 'Attribute name {$attributeName} is invalid.',\r\n _a[\"invalid attribute value\" /* INVALID_ATTRIBUTE_VALUE */] = 'Attribute value {$attributeValue} is invalid.',\r\n _a[\"invalid custom metric name\" /* INVALID_CUSTOM_METRIC_NAME */] = 'Custom metric name {$customMetricName} is invalid',\r\n _a[\"invalid String merger input\" /* INVALID_STRING_MERGER_PARAMETER */] = 'Input for String merger is invalid, contact support team to resolve.',\r\n _a);\r\nvar ERROR_FACTORY = new ErrorFactory(SERVICE, SERVICE_NAME, ERROR_DESCRIPTION_MAP);\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar consoleLogger = new Logger(SERVICE_NAME);\r\nconsoleLogger.logLevel = LogLevel.INFO;\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar apiInstance;\r\nvar windowInstance;\r\n/**\r\n * This class holds a reference to various browser related objects injected by\r\n * set methods.\r\n */\r\nvar Api = /** @class */ (function () {\r\n function Api(window) {\r\n this.window = window;\r\n if (!window) {\r\n throw ERROR_FACTORY.create(\"no window\" /* NO_WINDOW */);\r\n }\r\n this.performance = window.performance;\r\n this.PerformanceObserver = window.PerformanceObserver;\r\n this.windowLocation = window.location;\r\n this.navigator = window.navigator;\r\n this.document = window.document;\r\n if (this.navigator && this.navigator.cookieEnabled) {\r\n // If user blocks cookies on the browser, accessing localStorage will\r\n // throw an exception.\r\n this.localStorage = window.localStorage;\r\n }\r\n if (window.perfMetrics && window.perfMetrics.onFirstInputDelay) {\r\n this.onFirstInputDelay = window.perfMetrics.onFirstInputDelay;\r\n }\r\n }\r\n Api.prototype.getUrl = function () {\r\n // Do not capture the string query part of url.\r\n return this.windowLocation.href.split('?')[0];\r\n };\r\n Api.prototype.mark = function (name) {\r\n if (!this.performance || !this.performance.mark) {\r\n return;\r\n }\r\n this.performance.mark(name);\r\n };\r\n Api.prototype.measure = function (measureName, mark1, mark2) {\r\n if (!this.performance || !this.performance.measure) {\r\n return;\r\n }\r\n this.performance.measure(measureName, mark1, mark2);\r\n };\r\n Api.prototype.getEntriesByType = function (type) {\r\n if (!this.performance || !this.performance.getEntriesByType) {\r\n return [];\r\n }\r\n return this.performance.getEntriesByType(type);\r\n };\r\n Api.prototype.getEntriesByName = function (name) {\r\n if (!this.performance || !this.performance.getEntriesByName) {\r\n return [];\r\n }\r\n return this.performance.getEntriesByName(name);\r\n };\r\n Api.prototype.getTimeOrigin = function () {\r\n // Polyfill the time origin with performance.timing.navigationStart.\r\n return (this.performance &&\r\n (this.performance.timeOrigin || this.performance.timing.navigationStart));\r\n };\r\n Api.prototype.requiredApisAvailable = function () {\r\n if (!fetch ||\r\n !Promise ||\r\n !this.navigator ||\r\n !this.navigator.cookieEnabled) {\r\n consoleLogger.info('Firebase Performance cannot start if browser does not support fetch and Promise or cookie is disabled.');\r\n return false;\r\n }\r\n if (!isIndexedDBAvailable()) {\r\n consoleLogger.info('IndexedDB is not supported by current browswer');\r\n return false;\r\n }\r\n return true;\r\n };\r\n Api.prototype.setupObserver = function (entryType, callback) {\r\n if (!this.PerformanceObserver) {\r\n return;\r\n }\r\n var observer = new this.PerformanceObserver(function (list) {\r\n for (var _i = 0, _a = list.getEntries(); _i < _a.length; _i++) {\r\n var entry = _a[_i];\r\n // `entry` is a PerformanceEntry instance.\r\n callback(entry);\r\n }\r\n });\r\n // Start observing the entry types you care about.\r\n observer.observe({ entryTypes: [entryType] });\r\n };\r\n Api.getInstance = function () {\r\n if (apiInstance === undefined) {\r\n apiInstance = new Api(windowInstance);\r\n }\r\n return apiInstance;\r\n };\r\n return Api;\r\n}());\r\nfunction setupApi(window) {\r\n windowInstance = window;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction mergeStrings(part1, part2) {\r\n var sizeDiff = part1.length - part2.length;\r\n if (sizeDiff < 0 || sizeDiff > 1) {\r\n throw ERROR_FACTORY.create(\"invalid String merger input\" /* INVALID_STRING_MERGER_PARAMETER */);\r\n }\r\n var resultArray = [];\r\n for (var i = 0; i < part1.length; i++) {\r\n resultArray.push(part1.charAt(i));\r\n if (part2.length > i) {\r\n resultArray.push(part2.charAt(i));\r\n }\r\n }\r\n return resultArray.join('');\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar settingsServiceInstance;\r\nvar SettingsService = /** @class */ (function () {\r\n function SettingsService() {\r\n // The variable which controls logging of automatic traces and HTTP/S network monitoring.\r\n this.instrumentationEnabled = true;\r\n // The variable which controls logging of custom traces.\r\n this.dataCollectionEnabled = true;\r\n // Configuration flags set through remote config.\r\n this.loggingEnabled = false;\r\n // Sampling rate between 0 and 1.\r\n this.tracesSamplingRate = 1;\r\n this.networkRequestsSamplingRate = 1;\r\n // Address of logging service.\r\n this.logEndPointUrl = 'https://firebaselogging.googleapis.com/v0cc/log?format=json_proto';\r\n // Performance event transport endpoint URL which should be compatible with proto3.\r\n // New Address for transport service, not configurable via Remote Config.\r\n this.flTransportEndpointUrl = mergeStrings('hts/frbslgigp.ogepscmv/ieo/eaylg', 'tp:/ieaeogn-agolai.o/1frlglgc/o');\r\n this.transportKey = mergeStrings('AzSC8r6ReiGqFMyfvgow', 'Iayx0u-XT3vksVM-pIV');\r\n // Source type for performance event logs.\r\n this.logSource = 462;\r\n // Flags which control per session logging of traces and network requests.\r\n this.logTraceAfterSampling = false;\r\n this.logNetworkAfterSampling = false;\r\n // TTL of config retrieved from remote config in hours.\r\n this.configTimeToLive = 12;\r\n }\r\n SettingsService.prototype.getAppId = function () {\r\n var appId = this.firebaseAppInstance &&\r\n this.firebaseAppInstance.options &&\r\n this.firebaseAppInstance.options.appId;\r\n if (!appId) {\r\n throw ERROR_FACTORY.create(\"no app id\" /* NO_APP_ID */);\r\n }\r\n return appId;\r\n };\r\n SettingsService.prototype.getProjectId = function () {\r\n var projectId = this.firebaseAppInstance &&\r\n this.firebaseAppInstance.options &&\r\n this.firebaseAppInstance.options.projectId;\r\n if (!projectId) {\r\n throw ERROR_FACTORY.create(\"no project id\" /* NO_PROJECT_ID */);\r\n }\r\n return projectId;\r\n };\r\n SettingsService.prototype.getApiKey = function () {\r\n var apiKey = this.firebaseAppInstance &&\r\n this.firebaseAppInstance.options &&\r\n this.firebaseAppInstance.options.apiKey;\r\n if (!apiKey) {\r\n throw ERROR_FACTORY.create(\"no api key\" /* NO_API_KEY */);\r\n }\r\n return apiKey;\r\n };\r\n SettingsService.prototype.getFlTransportFullUrl = function () {\r\n return this.flTransportEndpointUrl.concat('?key=', this.transportKey);\r\n };\r\n SettingsService.getInstance = function () {\r\n if (settingsServiceInstance === undefined) {\r\n settingsServiceInstance = new SettingsService();\r\n }\r\n return settingsServiceInstance;\r\n };\r\n return SettingsService;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar iid;\r\nfunction getIidPromise() {\r\n var iidPromise = SettingsService.getInstance().installationsService.getId();\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n iidPromise.then(function (iidVal) {\r\n iid = iidVal;\r\n });\r\n return iidPromise;\r\n}\r\n// This method should be used after the iid is retrieved by getIidPromise method.\r\nfunction getIid() {\r\n return iid;\r\n}\r\nfunction getAuthTokenPromise() {\r\n var authTokenPromise = SettingsService.getInstance().installationsService.getToken();\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n authTokenPromise.then(function (authTokenVal) {\r\n });\r\n return authTokenPromise;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar VisibilityState;\r\n(function (VisibilityState) {\r\n VisibilityState[VisibilityState[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\r\n VisibilityState[VisibilityState[\"VISIBLE\"] = 1] = \"VISIBLE\";\r\n VisibilityState[VisibilityState[\"HIDDEN\"] = 2] = \"HIDDEN\";\r\n})(VisibilityState || (VisibilityState = {}));\r\nvar RESERVED_ATTRIBUTE_PREFIXES = ['firebase_', 'google_', 'ga_'];\r\nvar ATTRIBUTE_FORMAT_REGEX = new RegExp('^[a-zA-Z]\\\\w*$');\r\nvar MAX_ATTRIBUTE_NAME_LENGTH = 40;\r\nvar MAX_ATTRIBUTE_VALUE_LENGTH = 100;\r\nfunction getServiceWorkerStatus() {\r\n var navigator = Api.getInstance().navigator;\r\n if ('serviceWorker' in navigator) {\r\n if (navigator.serviceWorker.controller) {\r\n return 2 /* CONTROLLED */;\r\n }\r\n else {\r\n return 3 /* UNCONTROLLED */;\r\n }\r\n }\r\n else {\r\n return 1 /* UNSUPPORTED */;\r\n }\r\n}\r\nfunction getVisibilityState() {\r\n var document = Api.getInstance().document;\r\n var visibilityState = document.visibilityState;\r\n switch (visibilityState) {\r\n case 'visible':\r\n return VisibilityState.VISIBLE;\r\n case 'hidden':\r\n return VisibilityState.HIDDEN;\r\n default:\r\n return VisibilityState.UNKNOWN;\r\n }\r\n}\r\nfunction getEffectiveConnectionType() {\r\n var navigator = Api.getInstance().navigator;\r\n var navigatorConnection = navigator.connection;\r\n var effectiveType = navigatorConnection && navigatorConnection.effectiveType;\r\n switch (effectiveType) {\r\n case 'slow-2g':\r\n return 1 /* CONNECTION_SLOW_2G */;\r\n case '2g':\r\n return 2 /* CONNECTION_2G */;\r\n case '3g':\r\n return 3 /* CONNECTION_3G */;\r\n case '4g':\r\n return 4 /* CONNECTION_4G */;\r\n default:\r\n return 0 /* UNKNOWN */;\r\n }\r\n}\r\nfunction isValidCustomAttributeName(name) {\r\n if (name.length === 0 || name.length > MAX_ATTRIBUTE_NAME_LENGTH) {\r\n return false;\r\n }\r\n var matchesReservedPrefix = RESERVED_ATTRIBUTE_PREFIXES.some(function (prefix) {\r\n return name.startsWith(prefix);\r\n });\r\n return !matchesReservedPrefix && !!name.match(ATTRIBUTE_FORMAT_REGEX);\r\n}\r\nfunction isValidCustomAttributeValue(value) {\r\n return value.length !== 0 && value.length <= MAX_ATTRIBUTE_VALUE_LENGTH;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar REMOTE_CONFIG_SDK_VERSION = '0.0.1';\r\n// These values will be used if the remote config object is successfully\r\n// retrieved, but the template does not have these fields.\r\nvar DEFAULT_CONFIGS = {\r\n loggingEnabled: true\r\n};\r\nvar FIS_AUTH_PREFIX = 'FIREBASE_INSTALLATIONS_AUTH';\r\nfunction getConfig(iid) {\r\n var config = getStoredConfig();\r\n if (config) {\r\n processConfig(config);\r\n return Promise.resolve();\r\n }\r\n return getRemoteConfig(iid)\r\n .then(processConfig)\r\n .then(function (config) { return storeConfig(config); }, \r\n /** Do nothing for error, use defaults set in settings service. */\r\n function () { });\r\n}\r\nfunction getStoredConfig() {\r\n var localStorage = Api.getInstance().localStorage;\r\n if (!localStorage) {\r\n return;\r\n }\r\n var expiryString = localStorage.getItem(CONFIG_EXPIRY_LOCAL_STORAGE_KEY);\r\n if (!expiryString || !configValid(expiryString)) {\r\n return;\r\n }\r\n var configStringified = localStorage.getItem(CONFIG_LOCAL_STORAGE_KEY);\r\n if (!configStringified) {\r\n return;\r\n }\r\n try {\r\n var configResponse = JSON.parse(configStringified);\r\n return configResponse;\r\n }\r\n catch (_a) {\r\n return;\r\n }\r\n}\r\nfunction storeConfig(config) {\r\n var localStorage = Api.getInstance().localStorage;\r\n if (!config || !localStorage) {\r\n return;\r\n }\r\n localStorage.setItem(CONFIG_LOCAL_STORAGE_KEY, JSON.stringify(config));\r\n localStorage.setItem(CONFIG_EXPIRY_LOCAL_STORAGE_KEY, String(Date.now() +\r\n SettingsService.getInstance().configTimeToLive * 60 * 60 * 1000));\r\n}\r\nvar COULD_NOT_GET_CONFIG_MSG = 'Could not fetch config, will use default configs';\r\nfunction getRemoteConfig(iid) {\r\n // Perf needs auth token only to retrieve remote config.\r\n return getAuthTokenPromise()\r\n .then(function (authToken) {\r\n var projectId = SettingsService.getInstance().getProjectId();\r\n var configEndPoint = \"https://firebaseremoteconfig.googleapis.com/v1/projects/\" + projectId + \"/namespaces/fireperf:fetch?key=\" + SettingsService.getInstance().getApiKey();\r\n var request = new Request(configEndPoint, {\r\n method: 'POST',\r\n headers: { Authorization: FIS_AUTH_PREFIX + \" \" + authToken },\r\n /* eslint-disable camelcase */\r\n body: JSON.stringify({\r\n app_instance_id: iid,\r\n app_instance_id_token: authToken,\r\n app_id: SettingsService.getInstance().getAppId(),\r\n app_version: SDK_VERSION,\r\n sdk_version: REMOTE_CONFIG_SDK_VERSION\r\n })\r\n /* eslint-enable camelcase */\r\n });\r\n return fetch(request).then(function (response) {\r\n if (response.ok) {\r\n return response.json();\r\n }\r\n // In case response is not ok. This will be caught by catch.\r\n throw ERROR_FACTORY.create(\"RC response not ok\" /* RC_NOT_OK */);\r\n });\r\n })\r\n .catch(function () {\r\n consoleLogger.info(COULD_NOT_GET_CONFIG_MSG);\r\n return undefined;\r\n });\r\n}\r\n/**\r\n * Processes config coming either from calling RC or from local storage.\r\n * This method only runs if call is successful or config in storage\r\n * is valid.\r\n */\r\nfunction processConfig(config) {\r\n if (!config) {\r\n return config;\r\n }\r\n var settingsServiceInstance = SettingsService.getInstance();\r\n var entries = config.entries || {};\r\n if (entries.fpr_enabled !== undefined) {\r\n // TODO: Change the assignment of loggingEnabled once the received type is\r\n // known.\r\n settingsServiceInstance.loggingEnabled =\r\n String(entries.fpr_enabled) === 'true';\r\n }\r\n else {\r\n // Config retrieved successfully, but there is no fpr_enabled in template.\r\n // Use secondary configs value.\r\n settingsServiceInstance.loggingEnabled = DEFAULT_CONFIGS.loggingEnabled;\r\n }\r\n if (entries.fpr_log_source) {\r\n settingsServiceInstance.logSource = Number(entries.fpr_log_source);\r\n }\r\n if (entries.fpr_log_endpoint_url) {\r\n settingsServiceInstance.logEndPointUrl = entries.fpr_log_endpoint_url;\r\n }\r\n // Key from Remote Config has to be non-empty string, otherwsie use local value.\r\n if (entries.fpr_log_transport_key) {\r\n settingsServiceInstance.transportKey = entries.fpr_log_transport_key;\r\n }\r\n if (entries.fpr_vc_network_request_sampling_rate !== undefined) {\r\n settingsServiceInstance.networkRequestsSamplingRate = Number(entries.fpr_vc_network_request_sampling_rate);\r\n }\r\n if (entries.fpr_vc_trace_sampling_rate !== undefined) {\r\n settingsServiceInstance.tracesSamplingRate = Number(entries.fpr_vc_trace_sampling_rate);\r\n }\r\n // Set the per session trace and network logging flags.\r\n settingsServiceInstance.logTraceAfterSampling = shouldLogAfterSampling(settingsServiceInstance.tracesSamplingRate);\r\n settingsServiceInstance.logNetworkAfterSampling = shouldLogAfterSampling(settingsServiceInstance.networkRequestsSamplingRate);\r\n return config;\r\n}\r\nfunction configValid(expiry) {\r\n return Number(expiry) > Date.now();\r\n}\r\nfunction shouldLogAfterSampling(samplingRate) {\r\n return Math.random() <= samplingRate;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar initializationStatus = 1 /* notInitialized */;\r\nvar initializationPromise;\r\nfunction getInitializationPromise() {\r\n initializationStatus = 2 /* initializationPending */;\r\n initializationPromise = initializationPromise || initializePerf();\r\n return initializationPromise;\r\n}\r\nfunction isPerfInitialized() {\r\n return initializationStatus === 3 /* initialized */;\r\n}\r\nfunction initializePerf() {\r\n return getDocumentReadyComplete()\r\n .then(function () { return getIidPromise(); })\r\n .then(function (iid) { return getConfig(iid); })\r\n .then(function () { return changeInitializationStatus(); }, function () { return changeInitializationStatus(); });\r\n}\r\n/**\r\n * Returns a promise which resolves whenever the document readystate is complete or\r\n * immediately if it is called after page load complete.\r\n */\r\nfunction getDocumentReadyComplete() {\r\n var document = Api.getInstance().document;\r\n return new Promise(function (resolve) {\r\n if (document && document.readyState !== 'complete') {\r\n var handler_1 = function () {\r\n if (document.readyState === 'complete') {\r\n document.removeEventListener('readystatechange', handler_1);\r\n resolve();\r\n }\r\n };\r\n document.addEventListener('readystatechange', handler_1);\r\n }\r\n else {\r\n resolve();\r\n }\r\n });\r\n}\r\nfunction changeInitializationStatus() {\r\n initializationStatus = 3 /* initialized */;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DEFAULT_SEND_INTERVAL_MS = 10 * 1000;\r\nvar INITIAL_SEND_TIME_DELAY_MS = 5.5 * 1000;\r\n// If end point does not work, the call will be tried for these many times.\r\nvar DEFAULT_REMAINING_TRIES = 3;\r\nvar remainingTries = DEFAULT_REMAINING_TRIES;\r\n/* eslint-enable camelcase */\r\nvar queue = [];\r\nvar isTransportSetup = false;\r\nfunction setupTransportService() {\r\n if (!isTransportSetup) {\r\n processQueue(INITIAL_SEND_TIME_DELAY_MS);\r\n isTransportSetup = true;\r\n }\r\n}\r\nfunction processQueue(timeOffset) {\r\n setTimeout(function () {\r\n // If there is no remainingTries left, stop retrying.\r\n if (remainingTries === 0) {\r\n return;\r\n }\r\n // If there are no events to process, wait for DEFAULT_SEND_INTERVAL_MS and try again.\r\n if (!queue.length) {\r\n return processQueue(DEFAULT_SEND_INTERVAL_MS);\r\n }\r\n dispatchQueueEvents();\r\n }, timeOffset);\r\n}\r\nfunction dispatchQueueEvents() {\r\n // Capture a snapshot of the queue and empty the \"official queue\".\r\n var staged = __spreadArrays(queue);\r\n queue = [];\r\n /* eslint-disable camelcase */\r\n // We will pass the JSON serialized event to the backend.\r\n var log_event = staged.map(function (evt) { return ({\r\n source_extension_json_proto3: evt.message,\r\n event_time_ms: String(evt.eventTime)\r\n }); });\r\n var data = {\r\n request_time_ms: String(Date.now()),\r\n client_info: {\r\n client_type: 1,\r\n js_client_info: {}\r\n },\r\n log_source: SettingsService.getInstance().logSource,\r\n log_event: log_event\r\n };\r\n /* eslint-enable camelcase */\r\n sendEventsToFl(data, staged).catch(function () {\r\n // If the request fails for some reason, add the events that were attempted\r\n // back to the primary queue to retry later.\r\n queue = __spreadArrays(staged, queue);\r\n remainingTries--;\r\n consoleLogger.info(\"Tries left: \" + remainingTries + \".\");\r\n processQueue(DEFAULT_SEND_INTERVAL_MS);\r\n });\r\n}\r\nfunction sendEventsToFl(data, staged) {\r\n return postToFlEndpoint(data)\r\n .then(function (res) {\r\n if (!res.ok) {\r\n consoleLogger.info('Call to Firebase backend failed.');\r\n }\r\n return res.json();\r\n })\r\n .then(function (res) {\r\n // Find the next call wait time from the response.\r\n var transportWait = Number(res.nextRequestWaitMillis);\r\n var requestOffset = DEFAULT_SEND_INTERVAL_MS;\r\n if (!isNaN(transportWait)) {\r\n requestOffset = Math.max(transportWait, requestOffset);\r\n }\r\n // Delete request if response include RESPONSE_ACTION_UNKNOWN or DELETE_REQUEST action.\r\n // Otherwise, retry request using normal scheduling if response include RETRY_REQUEST_LATER.\r\n var logResponseDetails = res.logResponseDetails;\r\n if (Array.isArray(logResponseDetails) &&\r\n logResponseDetails.length > 0 &&\r\n logResponseDetails[0].responseAction === 'RETRY_REQUEST_LATER') {\r\n queue = __spreadArrays(staged, queue);\r\n consoleLogger.info(\"Retry transport request later.\");\r\n }\r\n remainingTries = DEFAULT_REMAINING_TRIES;\r\n // Schedule the next process.\r\n processQueue(requestOffset);\r\n });\r\n}\r\nfunction postToFlEndpoint(data) {\r\n var flTransportFullUrl = SettingsService.getInstance().getFlTransportFullUrl();\r\n return fetch(flTransportFullUrl, {\r\n method: 'POST',\r\n body: JSON.stringify(data)\r\n });\r\n}\r\nfunction addToQueue(evt) {\r\n if (!evt.eventTime || !evt.message) {\r\n throw ERROR_FACTORY.create(\"invalid cc log\" /* INVALID_CC_LOG */);\r\n }\r\n // Add the new event to the queue.\r\n queue = __spreadArrays(queue, [evt]);\r\n}\r\n/** Log handler for cc service to send the performance logs to the server. */\r\nfunction transportHandler(\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nserializer) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var message = serializer.apply(void 0, args);\r\n addToQueue({\r\n message: message,\r\n eventTime: Date.now()\r\n });\r\n };\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/* eslint-enble camelcase */\r\nvar logger;\r\n// This method is not called before initialization.\r\nfunction sendLog(resource, resourceType) {\r\n if (!logger) {\r\n logger = transportHandler(serializer);\r\n }\r\n logger(resource, resourceType);\r\n}\r\nfunction logTrace(trace) {\r\n var settingsService = SettingsService.getInstance();\r\n // Do not log if trace is auto generated and instrumentation is disabled.\r\n if (!settingsService.instrumentationEnabled && trace.isAuto) {\r\n return;\r\n }\r\n // Do not log if trace is custom and data collection is disabled.\r\n if (!settingsService.dataCollectionEnabled && !trace.isAuto) {\r\n return;\r\n }\r\n // Do not log if required apis are not available.\r\n if (!Api.getInstance().requiredApisAvailable()) {\r\n return;\r\n }\r\n // Only log the page load auto traces if page is visible.\r\n if (trace.isAuto && getVisibilityState() !== VisibilityState.VISIBLE) {\r\n return;\r\n }\r\n if (isPerfInitialized()) {\r\n sendTraceLog(trace);\r\n }\r\n else {\r\n // Custom traces can be used before the initialization but logging\r\n // should wait until after.\r\n getInitializationPromise().then(function () { return sendTraceLog(trace); }, function () { return sendTraceLog(trace); });\r\n }\r\n}\r\nfunction sendTraceLog(trace) {\r\n if (!getIid()) {\r\n return;\r\n }\r\n var settingsService = SettingsService.getInstance();\r\n if (!settingsService.loggingEnabled ||\r\n !settingsService.logTraceAfterSampling) {\r\n return;\r\n }\r\n setTimeout(function () { return sendLog(trace, 1 /* Trace */); }, 0);\r\n}\r\nfunction logNetworkRequest(networkRequest) {\r\n var settingsService = SettingsService.getInstance();\r\n // Do not log network requests if instrumentation is disabled.\r\n if (!settingsService.instrumentationEnabled) {\r\n return;\r\n }\r\n // Do not log the js sdk's call to transport service domain to avoid unnecessary cycle.\r\n // Need to blacklist both old and new endpoints to avoid migration gap.\r\n var networkRequestUrl = networkRequest.url;\r\n // Blacklist old log endpoint and new transport endpoint.\r\n // Because Performance SDK doesn't instrument requests sent from SDK itself.\r\n var logEndpointUrl = settingsService.logEndPointUrl.split('?')[0];\r\n var flEndpointUrl = settingsService.flTransportEndpointUrl.split('?')[0];\r\n if (networkRequestUrl === logEndpointUrl ||\r\n networkRequestUrl === flEndpointUrl) {\r\n return;\r\n }\r\n if (!settingsService.loggingEnabled ||\r\n !settingsService.logNetworkAfterSampling) {\r\n return;\r\n }\r\n setTimeout(function () { return sendLog(networkRequest, 0 /* NetworkRequest */); }, 0);\r\n}\r\nfunction serializer(resource, resourceType) {\r\n if (resourceType === 0 /* NetworkRequest */) {\r\n return serializeNetworkRequest(resource);\r\n }\r\n return serializeTrace(resource);\r\n}\r\nfunction serializeNetworkRequest(networkRequest) {\r\n var networkRequestMetric = {\r\n url: networkRequest.url,\r\n http_method: networkRequest.httpMethod || 0,\r\n http_response_code: 200,\r\n response_payload_bytes: networkRequest.responsePayloadBytes,\r\n client_start_time_us: networkRequest.startTimeUs,\r\n time_to_response_initiated_us: networkRequest.timeToResponseInitiatedUs,\r\n time_to_response_completed_us: networkRequest.timeToResponseCompletedUs\r\n };\r\n var perfMetric = {\r\n application_info: getApplicationInfo(),\r\n network_request_metric: networkRequestMetric\r\n };\r\n return JSON.stringify(perfMetric);\r\n}\r\nfunction serializeTrace(trace) {\r\n var traceMetric = {\r\n name: trace.name,\r\n is_auto: trace.isAuto,\r\n client_start_time_us: trace.startTimeUs,\r\n duration_us: trace.durationUs\r\n };\r\n if (Object.keys(trace.counters).length !== 0) {\r\n traceMetric.counters = trace.counters;\r\n }\r\n var customAttributes = trace.getAttributes();\r\n if (Object.keys(customAttributes).length !== 0) {\r\n traceMetric.custom_attributes = customAttributes;\r\n }\r\n var perfMetric = {\r\n application_info: getApplicationInfo(),\r\n trace_metric: traceMetric\r\n };\r\n return JSON.stringify(perfMetric);\r\n}\r\nfunction getApplicationInfo() {\r\n return {\r\n google_app_id: SettingsService.getInstance().getAppId(),\r\n app_instance_id: getIid(),\r\n web_app_info: {\r\n sdk_version: SDK_VERSION,\r\n page_url: Api.getInstance().getUrl(),\r\n service_worker_status: getServiceWorkerStatus(),\r\n visibility_state: getVisibilityState(),\r\n effective_connection_type: getEffectiveConnectionType()\r\n },\r\n application_process_state: 0\r\n };\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar MAX_METRIC_NAME_LENGTH = 100;\r\nvar RESERVED_AUTO_PREFIX = '_';\r\nvar oobMetrics = [\r\n FIRST_PAINT_COUNTER_NAME,\r\n FIRST_CONTENTFUL_PAINT_COUNTER_NAME,\r\n FIRST_INPUT_DELAY_COUNTER_NAME\r\n];\r\n/**\r\n * Returns true if the metric is custom and does not start with reserved prefix, or if\r\n * the metric is one of out of the box page load trace metrics.\r\n */\r\nfunction isValidMetricName(name, traceName) {\r\n if (name.length === 0 || name.length > MAX_METRIC_NAME_LENGTH) {\r\n return false;\r\n }\r\n return ((traceName &&\r\n traceName.startsWith(OOB_TRACE_PAGE_LOAD_PREFIX) &&\r\n oobMetrics.indexOf(name) > -1) ||\r\n !name.startsWith(RESERVED_AUTO_PREFIX));\r\n}\r\n/**\r\n * Converts the provided value to an integer value to be used in case of a metric.\r\n * @param providedValue Provided number value of the metric that needs to be converted to an integer.\r\n *\r\n * @returns Converted integer number to be set for the metric.\r\n */\r\nfunction convertMetricValueToInteger(providedValue) {\r\n var valueAsInteger = Math.floor(providedValue);\r\n if (valueAsInteger < providedValue) {\r\n consoleLogger.info(\"Metric value should be an Integer, setting the value as : \" + valueAsInteger + \".\");\r\n }\r\n return valueAsInteger;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar Trace = /** @class */ (function () {\r\n /**\r\n * @param name The name of the trace.\r\n * @param isAuto If the trace is auto-instrumented.\r\n * @param traceMeasureName The name of the measure marker in user timing specification. This field\r\n * is only set when the trace is built for logging when the user directly uses the user timing\r\n * api (performance.mark and performance.measure).\r\n */\r\n function Trace(name, isAuto, traceMeasureName) {\r\n if (isAuto === void 0) { isAuto = false; }\r\n this.name = name;\r\n this.isAuto = isAuto;\r\n this.state = 1 /* UNINITIALIZED */;\r\n this.customAttributes = {};\r\n this.counters = {};\r\n this.api = Api.getInstance();\r\n this.randomId = Math.floor(Math.random() * 1000000);\r\n if (!this.isAuto) {\r\n this.traceStartMark = TRACE_START_MARK_PREFIX + \"-\" + this.randomId + \"-\" + this.name;\r\n this.traceStopMark = TRACE_STOP_MARK_PREFIX + \"-\" + this.randomId + \"-\" + this.name;\r\n this.traceMeasure =\r\n traceMeasureName ||\r\n TRACE_MEASURE_PREFIX + \"-\" + this.randomId + \"-\" + this.name;\r\n if (traceMeasureName) {\r\n // For the case of direct user timing traces, no start stop will happen. The measure object\r\n // is already available.\r\n this.calculateTraceMetrics();\r\n }\r\n }\r\n }\r\n /**\r\n * Starts a trace. The measurement of the duration starts at this point.\r\n */\r\n Trace.prototype.start = function () {\r\n if (this.state !== 1 /* UNINITIALIZED */) {\r\n throw ERROR_FACTORY.create(\"trace started\" /* TRACE_STARTED_BEFORE */, {\r\n traceName: this.name\r\n });\r\n }\r\n this.api.mark(this.traceStartMark);\r\n this.state = 2 /* RUNNING */;\r\n };\r\n /**\r\n * Stops the trace. The measurement of the duration of the trace stops at this point and trace\r\n * is logged.\r\n */\r\n Trace.prototype.stop = function () {\r\n if (this.state !== 2 /* RUNNING */) {\r\n throw ERROR_FACTORY.create(\"trace stopped\" /* TRACE_STOPPED_BEFORE */, {\r\n traceName: this.name\r\n });\r\n }\r\n this.state = 3 /* TERMINATED */;\r\n this.api.mark(this.traceStopMark);\r\n this.api.measure(this.traceMeasure, this.traceStartMark, this.traceStopMark);\r\n this.calculateTraceMetrics();\r\n logTrace(this);\r\n };\r\n /**\r\n * Records a trace with predetermined values. If this method is used a trace is created and logged\r\n * directly. No need to use start and stop methods.\r\n * @param startTime Trace start time since epoch in millisec\r\n * @param duration The duraction of the trace in millisec\r\n * @param options An object which can optionally hold maps of custom metrics and custom attributes\r\n */\r\n Trace.prototype.record = function (startTime, duration, options) {\r\n if (startTime <= 0) {\r\n throw ERROR_FACTORY.create(\"nonpositive trace startTime\" /* NONPOSITIVE_TRACE_START_TIME */, {\r\n traceName: this.name\r\n });\r\n }\r\n if (duration <= 0) {\r\n throw ERROR_FACTORY.create(\"nonpositive trace duration\" /* NONPOSITIVE_TRACE_DURATION */, {\r\n traceName: this.name\r\n });\r\n }\r\n this.durationUs = Math.floor(duration * 1000);\r\n this.startTimeUs = Math.floor(startTime * 1000);\r\n if (options && options.attributes) {\r\n this.customAttributes = __assign({}, options.attributes);\r\n }\r\n if (options && options.metrics) {\r\n for (var _i = 0, _a = Object.keys(options.metrics); _i < _a.length; _i++) {\r\n var metric = _a[_i];\r\n if (!isNaN(Number(options.metrics[metric]))) {\r\n this.counters[metric] = Number(Math.floor(options.metrics[metric]));\r\n }\r\n }\r\n }\r\n logTrace(this);\r\n };\r\n /**\r\n * Increments a custom metric by a certain number or 1 if number not specified. Will create a new\r\n * custom metric if one with the given name does not exist. The value will be floored down to an\r\n * integer.\r\n * @param counter Name of the custom metric\r\n * @param numAsInteger Increment by value\r\n */\r\n Trace.prototype.incrementMetric = function (counter, numAsInteger) {\r\n if (numAsInteger === void 0) { numAsInteger = 1; }\r\n if (this.counters[counter] === undefined) {\r\n this.putMetric(counter, numAsInteger);\r\n }\r\n else {\r\n this.putMetric(counter, this.counters[counter] + numAsInteger);\r\n }\r\n };\r\n /**\r\n * Sets a custom metric to a specified value. Will create a new custom metric if one with the\r\n * given name does not exist. The value will be floored down to an integer.\r\n * @param counter Name of the custom metric\r\n * @param numAsInteger Set custom metric to this value\r\n */\r\n Trace.prototype.putMetric = function (counter, numAsInteger) {\r\n if (isValidMetricName(counter, this.name)) {\r\n this.counters[counter] = convertMetricValueToInteger(numAsInteger);\r\n }\r\n else {\r\n throw ERROR_FACTORY.create(\"invalid custom metric name\" /* INVALID_CUSTOM_METRIC_NAME */, {\r\n customMetricName: counter\r\n });\r\n }\r\n };\r\n /**\r\n * Returns the value of the custom metric by that name. If a custom metric with that name does\r\n * not exist will return zero.\r\n * @param counter\r\n */\r\n Trace.prototype.getMetric = function (counter) {\r\n return this.counters[counter] || 0;\r\n };\r\n /**\r\n * Sets a custom attribute of a trace to a certain value.\r\n * @param attr\r\n * @param value\r\n */\r\n Trace.prototype.putAttribute = function (attr, value) {\r\n var isValidName = isValidCustomAttributeName(attr);\r\n var isValidValue = isValidCustomAttributeValue(value);\r\n if (isValidName && isValidValue) {\r\n this.customAttributes[attr] = value;\r\n return;\r\n }\r\n // Throw appropriate error when the attribute name or value is invalid.\r\n if (!isValidName) {\r\n throw ERROR_FACTORY.create(\"invalid attribute name\" /* INVALID_ATTRIBUTE_NAME */, {\r\n attributeName: attr\r\n });\r\n }\r\n if (!isValidValue) {\r\n throw ERROR_FACTORY.create(\"invalid attribute value\" /* INVALID_ATTRIBUTE_VALUE */, {\r\n attributeValue: value\r\n });\r\n }\r\n };\r\n /**\r\n * Retrieves the value a custom attribute of a trace is set to.\r\n * @param attr\r\n */\r\n Trace.prototype.getAttribute = function (attr) {\r\n return this.customAttributes[attr];\r\n };\r\n Trace.prototype.removeAttribute = function (attr) {\r\n if (this.customAttributes[attr] === undefined) {\r\n return;\r\n }\r\n delete this.customAttributes[attr];\r\n };\r\n Trace.prototype.getAttributes = function () {\r\n return __assign({}, this.customAttributes);\r\n };\r\n Trace.prototype.setStartTime = function (startTime) {\r\n this.startTimeUs = startTime;\r\n };\r\n Trace.prototype.setDuration = function (duration) {\r\n this.durationUs = duration;\r\n };\r\n /**\r\n * Calculates and assigns the duration and start time of the trace using the measure performance\r\n * entry.\r\n */\r\n Trace.prototype.calculateTraceMetrics = function () {\r\n var perfMeasureEntries = this.api.getEntriesByName(this.traceMeasure);\r\n var perfMeasureEntry = perfMeasureEntries && perfMeasureEntries[0];\r\n if (perfMeasureEntry) {\r\n this.durationUs = Math.floor(perfMeasureEntry.duration * 1000);\r\n this.startTimeUs = Math.floor((perfMeasureEntry.startTime + this.api.getTimeOrigin()) * 1000);\r\n }\r\n };\r\n /**\r\n * @param navigationTimings A single element array which contains the navigationTIming object of\r\n * the page load\r\n * @param paintTimings A array which contains paintTiming object of the page load\r\n * @param firstInputDelay First input delay in millisec\r\n */\r\n Trace.createOobTrace = function (navigationTimings, paintTimings, firstInputDelay) {\r\n var route = Api.getInstance().getUrl();\r\n if (!route) {\r\n return;\r\n }\r\n var trace = new Trace(OOB_TRACE_PAGE_LOAD_PREFIX + route, true);\r\n var timeOriginUs = Math.floor(Api.getInstance().getTimeOrigin() * 1000);\r\n trace.setStartTime(timeOriginUs);\r\n // navigationTimings includes only one element.\r\n if (navigationTimings && navigationTimings[0]) {\r\n trace.setDuration(Math.floor(navigationTimings[0].duration * 1000));\r\n trace.putMetric('domInteractive', Math.floor(navigationTimings[0].domInteractive * 1000));\r\n trace.putMetric('domContentLoadedEventEnd', Math.floor(navigationTimings[0].domContentLoadedEventEnd * 1000));\r\n trace.putMetric('loadEventEnd', Math.floor(navigationTimings[0].loadEventEnd * 1000));\r\n }\r\n var FIRST_PAINT = 'first-paint';\r\n var FIRST_CONTENTFUL_PAINT = 'first-contentful-paint';\r\n if (paintTimings) {\r\n var firstPaint = paintTimings.find(function (paintObject) { return paintObject.name === FIRST_PAINT; });\r\n if (firstPaint && firstPaint.startTime) {\r\n trace.putMetric(FIRST_PAINT_COUNTER_NAME, Math.floor(firstPaint.startTime * 1000));\r\n }\r\n var firstContentfulPaint = paintTimings.find(function (paintObject) { return paintObject.name === FIRST_CONTENTFUL_PAINT; });\r\n if (firstContentfulPaint && firstContentfulPaint.startTime) {\r\n trace.putMetric(FIRST_CONTENTFUL_PAINT_COUNTER_NAME, Math.floor(firstContentfulPaint.startTime * 1000));\r\n }\r\n if (firstInputDelay) {\r\n trace.putMetric(FIRST_INPUT_DELAY_COUNTER_NAME, Math.floor(firstInputDelay * 1000));\r\n }\r\n }\r\n logTrace(trace);\r\n };\r\n Trace.createUserTimingTrace = function (measureName) {\r\n var trace = new Trace(measureName, false, measureName);\r\n logTrace(trace);\r\n };\r\n return Trace;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction createNetworkRequestEntry(entry) {\r\n var performanceEntry = entry;\r\n if (!performanceEntry || performanceEntry.responseStart === undefined) {\r\n return;\r\n }\r\n var timeOrigin = Api.getInstance().getTimeOrigin();\r\n var startTimeUs = Math.floor((performanceEntry.startTime + timeOrigin) * 1000);\r\n var timeToResponseInitiatedUs = performanceEntry.responseStart\r\n ? Math.floor((performanceEntry.responseStart - performanceEntry.startTime) * 1000)\r\n : undefined;\r\n var timeToResponseCompletedUs = Math.floor((performanceEntry.responseEnd - performanceEntry.startTime) * 1000);\r\n // Remove the query params from logged network request url.\r\n var url = performanceEntry.name && performanceEntry.name.split('?')[0];\r\n var networkRequest = {\r\n url: url,\r\n responsePayloadBytes: performanceEntry.transferSize,\r\n startTimeUs: startTimeUs,\r\n timeToResponseInitiatedUs: timeToResponseInitiatedUs,\r\n timeToResponseCompletedUs: timeToResponseCompletedUs\r\n };\r\n logNetworkRequest(networkRequest);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar FID_WAIT_TIME_MS = 5000;\r\nfunction setupOobResources() {\r\n // Do not initialize unless iid is available.\r\n if (!getIid()) {\r\n return;\r\n }\r\n // The load event might not have fired yet, and that means performance navigation timing\r\n // object has a duration of 0. The setup should run after all current tasks in js queue.\r\n setTimeout(function () { return setupOobTraces(); }, 0);\r\n setTimeout(function () { return setupNetworkRequests(); }, 0);\r\n setTimeout(function () { return setupUserTimingTraces(); }, 0);\r\n}\r\nfunction setupNetworkRequests() {\r\n var api = Api.getInstance();\r\n var resources = api.getEntriesByType('resource');\r\n for (var _i = 0, resources_1 = resources; _i < resources_1.length; _i++) {\r\n var resource = resources_1[_i];\r\n createNetworkRequestEntry(resource);\r\n }\r\n api.setupObserver('resource', createNetworkRequestEntry);\r\n}\r\nfunction setupOobTraces() {\r\n var api = Api.getInstance();\r\n var navigationTimings = api.getEntriesByType('navigation');\r\n var paintTimings = api.getEntriesByType('paint');\r\n // If First Input Desly polyfill is added to the page, report the fid value.\r\n // https://github.com/GoogleChromeLabs/first-input-delay\r\n if (api.onFirstInputDelay) {\r\n // If the fid call back is not called for certain time, continue without it.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n var timeoutId_1 = setTimeout(function () {\r\n Trace.createOobTrace(navigationTimings, paintTimings);\r\n timeoutId_1 = undefined;\r\n }, FID_WAIT_TIME_MS);\r\n api.onFirstInputDelay(function (fid) {\r\n if (timeoutId_1) {\r\n clearTimeout(timeoutId_1);\r\n Trace.createOobTrace(navigationTimings, paintTimings, fid);\r\n }\r\n });\r\n }\r\n else {\r\n Trace.createOobTrace(navigationTimings, paintTimings);\r\n }\r\n}\r\nfunction setupUserTimingTraces() {\r\n var api = Api.getInstance();\r\n // Run through the measure performance entries collected up to this point.\r\n var measures = api.getEntriesByType('measure');\r\n for (var _i = 0, measures_1 = measures; _i < measures_1.length; _i++) {\r\n var measure = measures_1[_i];\r\n createUserTimingTrace(measure);\r\n }\r\n // Setup an observer to capture the measures from this point on.\r\n api.setupObserver('measure', createUserTimingTrace);\r\n}\r\nfunction createUserTimingTrace(measure) {\r\n var measureName = measure.name;\r\n // Do not create a trace, if the user timing marks and measures are created by the sdk itself.\r\n if (measureName.substring(0, TRACE_MEASURE_PREFIX.length) ===\r\n TRACE_MEASURE_PREFIX) {\r\n return;\r\n }\r\n Trace.createUserTimingTrace(measureName);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar PerformanceController = /** @class */ (function () {\r\n function PerformanceController(app) {\r\n this.app = app;\r\n if (Api.getInstance().requiredApisAvailable()) {\r\n validateIndexedDBOpenable()\r\n .then(function (isAvailable) {\r\n if (isAvailable) {\r\n setupTransportService();\r\n getInitializationPromise().then(setupOobResources, setupOobResources);\r\n }\r\n })\r\n .catch(function (error) {\r\n consoleLogger.info(\"Environment doesn't support IndexedDB: \" + error);\r\n });\r\n }\r\n }\r\n PerformanceController.prototype.trace = function (name) {\r\n return new Trace(name);\r\n };\r\n Object.defineProperty(PerformanceController.prototype, \"instrumentationEnabled\", {\r\n get: function () {\r\n return SettingsService.getInstance().instrumentationEnabled;\r\n },\r\n set: function (val) {\r\n SettingsService.getInstance().instrumentationEnabled = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(PerformanceController.prototype, \"dataCollectionEnabled\", {\r\n get: function () {\r\n return SettingsService.getInstance().dataCollectionEnabled;\r\n },\r\n set: function (val) {\r\n SettingsService.getInstance().dataCollectionEnabled = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return PerformanceController;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DEFAULT_ENTRY_NAME = '[DEFAULT]';\r\nfunction registerPerformance(instance) {\r\n var factoryMethod = function (app, installations) {\r\n if (app.name !== DEFAULT_ENTRY_NAME) {\r\n throw ERROR_FACTORY.create(\"FB not default\" /* FB_NOT_DEFAULT */);\r\n }\r\n if (typeof window === 'undefined') {\r\n throw ERROR_FACTORY.create(\"no window\" /* NO_WINDOW */);\r\n }\r\n setupApi(window);\r\n SettingsService.getInstance().firebaseAppInstance = app;\r\n SettingsService.getInstance().installationsService = installations;\r\n return new PerformanceController(app);\r\n };\r\n // Register performance with firebase-app.\r\n instance.INTERNAL.registerComponent(new Component('performance', function (container) {\r\n /* Dependencies */\r\n // getImmediate for FirebaseApp will always succeed\r\n var app = container.getProvider('app').getImmediate();\r\n // The following call will always succeed because perf has `import '@firebase/installations'`\r\n var installations = container\r\n .getProvider('installations')\r\n .getImmediate();\r\n return factoryMethod(app, installations);\r\n }, \"PUBLIC\" /* PUBLIC */));\r\n instance.registerVersion(name, version);\r\n}\r\nregisterPerformance(firebase);\n\nexport { registerPerformance };\n//# sourceMappingURL=index.esm.js.map\n","import firebase from '@firebase/app';\nimport '@firebase/installations';\nimport { __awaiter, __generator, __assign } from 'tslib';\nimport { ErrorFactory, FirebaseError, calculateBackoffMillis } from '@firebase/util';\nimport { LogLevel, Logger } from '@firebase/logger';\nimport { Component } from '@firebase/component';\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Implements the {@link RemoteConfigClient} abstraction with success response caching.\r\n *\r\n * <p>Comparable to the browser's Cache API for responses, but the Cache API requires a Service\r\n * Worker, which requires HTTPS, which would significantly complicate SDK installation. Also, the\r\n * Cache API doesn't support matching entries by time.\r\n */\r\nvar CachingClient = /** @class */ (function () {\r\n function CachingClient(client, storage, storageCache, logger) {\r\n this.client = client;\r\n this.storage = storage;\r\n this.storageCache = storageCache;\r\n this.logger = logger;\r\n }\r\n /**\r\n * Returns true if the age of the cached fetched configs is less than or equal to\r\n * {@link Settings#minimumFetchIntervalInSeconds}.\r\n *\r\n * <p>This is comparable to passing `headers = { 'Cache-Control': max-age <maxAge> }` to the\r\n * native Fetch API.\r\n *\r\n * <p>Visible for testing.\r\n */\r\n CachingClient.prototype.isCachedDataFresh = function (cacheMaxAgeMillis, lastSuccessfulFetchTimestampMillis) {\r\n // Cache can only be fresh if it's populated.\r\n if (!lastSuccessfulFetchTimestampMillis) {\r\n this.logger.debug('Config fetch cache check. Cache unpopulated.');\r\n return false;\r\n }\r\n // Calculates age of cache entry.\r\n var cacheAgeMillis = Date.now() - lastSuccessfulFetchTimestampMillis;\r\n var isCachedDataFresh = cacheAgeMillis <= cacheMaxAgeMillis;\r\n this.logger.debug('Config fetch cache check.' +\r\n (\" Cache age millis: \" + cacheAgeMillis + \".\") +\r\n (\" Cache max age millis (minimumFetchIntervalMillis setting): \" + cacheMaxAgeMillis + \".\") +\r\n (\" Is cache hit: \" + isCachedDataFresh + \".\"));\r\n return isCachedDataFresh;\r\n };\r\n CachingClient.prototype.fetch = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _a, lastSuccessfulFetchTimestampMillis, lastSuccessfulFetchResponse, response, storageOperations;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, Promise.all([\r\n this.storage.getLastSuccessfulFetchTimestampMillis(),\r\n this.storage.getLastSuccessfulFetchResponse()\r\n ])];\r\n case 1:\r\n _a = _b.sent(), lastSuccessfulFetchTimestampMillis = _a[0], lastSuccessfulFetchResponse = _a[1];\r\n // Exits early on cache hit.\r\n if (lastSuccessfulFetchResponse &&\r\n this.isCachedDataFresh(request.cacheMaxAgeMillis, lastSuccessfulFetchTimestampMillis)) {\r\n return [2 /*return*/, lastSuccessfulFetchResponse];\r\n }\r\n // Deviates from pure decorator by not honoring a passed ETag since we don't have a public API\r\n // that allows the caller to pass an ETag.\r\n request.eTag =\r\n lastSuccessfulFetchResponse && lastSuccessfulFetchResponse.eTag;\r\n return [4 /*yield*/, this.client.fetch(request)];\r\n case 2:\r\n response = _b.sent();\r\n storageOperations = [\r\n // Uses write-through cache for consistency with synchronous public API.\r\n this.storageCache.setLastSuccessfulFetchTimestampMillis(Date.now())\r\n ];\r\n if (response.status === 200) {\r\n // Caches response only if it has changed, ie non-304 responses.\r\n storageOperations.push(this.storage.setLastSuccessfulFetchResponse(response));\r\n }\r\n return [4 /*yield*/, Promise.all(storageOperations)];\r\n case 3:\r\n _b.sent();\r\n return [2 /*return*/, response];\r\n }\r\n });\r\n });\r\n };\r\n return CachingClient;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar _a;\r\nvar ERROR_DESCRIPTION_MAP = (_a = {},\r\n _a[\"registration-window\" /* REGISTRATION_WINDOW */] = 'Undefined window object. This SDK only supports usage in a browser environment.',\r\n _a[\"registration-project-id\" /* REGISTRATION_PROJECT_ID */] = 'Undefined project identifier. Check Firebase app initialization.',\r\n _a[\"registration-api-key\" /* REGISTRATION_API_KEY */] = 'Undefined API key. Check Firebase app initialization.',\r\n _a[\"registration-app-id\" /* REGISTRATION_APP_ID */] = 'Undefined app identifier. Check Firebase app initialization.',\r\n _a[\"storage-open\" /* STORAGE_OPEN */] = 'Error thrown when opening storage. Original error: {$originalErrorMessage}.',\r\n _a[\"storage-get\" /* STORAGE_GET */] = 'Error thrown when reading from storage. Original error: {$originalErrorMessage}.',\r\n _a[\"storage-set\" /* STORAGE_SET */] = 'Error thrown when writing to storage. Original error: {$originalErrorMessage}.',\r\n _a[\"storage-delete\" /* STORAGE_DELETE */] = 'Error thrown when deleting from storage. Original error: {$originalErrorMessage}.',\r\n _a[\"fetch-client-network\" /* FETCH_NETWORK */] = 'Fetch client failed to connect to a network. Check Internet connection.' +\r\n ' Original error: {$originalErrorMessage}.',\r\n _a[\"fetch-timeout\" /* FETCH_TIMEOUT */] = 'The config fetch request timed out. ' +\r\n ' Configure timeout using \"fetchTimeoutMillis\" SDK setting.',\r\n _a[\"fetch-throttle\" /* FETCH_THROTTLE */] = 'The config fetch request timed out while in an exponential backoff state.' +\r\n ' Configure timeout using \"fetchTimeoutMillis\" SDK setting.' +\r\n ' Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.',\r\n _a[\"fetch-client-parse\" /* FETCH_PARSE */] = 'Fetch client could not parse response.' +\r\n ' Original error: {$originalErrorMessage}.',\r\n _a[\"fetch-status\" /* FETCH_STATUS */] = 'Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.',\r\n _a);\r\nvar ERROR_FACTORY = new ErrorFactory('remoteconfig' /* service */, 'Remote Config' /* service name */, ERROR_DESCRIPTION_MAP);\r\n// Note how this is like typeof/instanceof, but for ErrorCode.\r\nfunction hasErrorCode(e, errorCode) {\r\n return e instanceof FirebaseError && e.code.indexOf(errorCode) !== -1;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Attempts to get the most accurate browser language setting.\r\n *\r\n * <p>Adapted from getUserLanguage in packages/auth/src/utils.js for TypeScript.\r\n *\r\n * <p>Defers default language specification to server logic for consistency.\r\n *\r\n * @param navigatorLanguage Enables tests to override read-only {@link NavigatorLanguage}.\r\n */\r\nfunction getUserLanguage(navigatorLanguage) {\r\n if (navigatorLanguage === void 0) { navigatorLanguage = navigator; }\r\n return (\r\n // Most reliable, but only supported in Chrome/Firefox.\r\n (navigatorLanguage.languages && navigatorLanguage.languages[0]) ||\r\n // Supported in most browsers, but returns the language of the browser\r\n // UI, not the language set in browser settings.\r\n navigatorLanguage.language\r\n // Polyfill otherwise.\r\n );\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Implements the Client abstraction for the Remote Config REST API.\r\n */\r\nvar RestClient = /** @class */ (function () {\r\n function RestClient(firebaseInstallations, sdkVersion, namespace, projectId, apiKey, appId) {\r\n this.firebaseInstallations = firebaseInstallations;\r\n this.sdkVersion = sdkVersion;\r\n this.namespace = namespace;\r\n this.projectId = projectId;\r\n this.apiKey = apiKey;\r\n this.appId = appId;\r\n }\r\n /**\r\n * Fetches from the Remote Config REST API.\r\n *\r\n * @throws a {@link ErrorCode.FETCH_NETWORK} error if {@link GlobalFetch#fetch} can't\r\n * connect to the network.\r\n * @throws a {@link ErrorCode.FETCH_PARSE} error if {@link Response#json} can't parse the\r\n * fetch response.\r\n * @throws a {@link ErrorCode.FETCH_STATUS} error if the service returns an HTTP error status.\r\n */\r\n RestClient.prototype.fetch = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _a, installationId, installationToken, urlBase, url, headers, requestBody, options, fetchPromise, timeoutPromise, response, originalError_1, errorCode, status, responseEtag, config, state, responseBody, originalError_2;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, Promise.all([\r\n this.firebaseInstallations.getId(),\r\n this.firebaseInstallations.getToken()\r\n ])];\r\n case 1:\r\n _a = _b.sent(), installationId = _a[0], installationToken = _a[1];\r\n urlBase = window.FIREBASE_REMOTE_CONFIG_URL_BASE ||\r\n 'https://firebaseremoteconfig.googleapis.com';\r\n url = urlBase + \"/v1/projects/\" + this.projectId + \"/namespaces/\" + this.namespace + \":fetch?key=\" + this.apiKey;\r\n headers = {\r\n 'Content-Type': 'application/json',\r\n 'Content-Encoding': 'gzip',\r\n // Deviates from pure decorator by not passing max-age header since we don't currently have\r\n // service behavior using that header.\r\n 'If-None-Match': request.eTag || '*'\r\n };\r\n requestBody = {\r\n /* eslint-disable camelcase */\r\n sdk_version: this.sdkVersion,\r\n app_instance_id: installationId,\r\n app_instance_id_token: installationToken,\r\n app_id: this.appId,\r\n language_code: getUserLanguage()\r\n /* eslint-enable camelcase */\r\n };\r\n options = {\r\n method: 'POST',\r\n headers: headers,\r\n body: JSON.stringify(requestBody)\r\n };\r\n fetchPromise = fetch(url, options);\r\n timeoutPromise = new Promise(function (_resolve, reject) {\r\n // Maps async event listener to Promise API.\r\n request.signal.addEventListener(function () {\r\n // Emulates https://heycam.github.io/webidl/#aborterror\r\n var error = new Error('The operation was aborted.');\r\n error.name = 'AbortError';\r\n reject(error);\r\n });\r\n });\r\n _b.label = 2;\r\n case 2:\r\n _b.trys.push([2, 5, , 6]);\r\n return [4 /*yield*/, Promise.race([fetchPromise, timeoutPromise])];\r\n case 3:\r\n _b.sent();\r\n return [4 /*yield*/, fetchPromise];\r\n case 4:\r\n response = _b.sent();\r\n return [3 /*break*/, 6];\r\n case 5:\r\n originalError_1 = _b.sent();\r\n errorCode = \"fetch-client-network\" /* FETCH_NETWORK */;\r\n if (originalError_1.name === 'AbortError') {\r\n errorCode = \"fetch-timeout\" /* FETCH_TIMEOUT */;\r\n }\r\n throw ERROR_FACTORY.create(errorCode, {\r\n originalErrorMessage: originalError_1.message\r\n });\r\n case 6:\r\n status = response.status;\r\n responseEtag = response.headers.get('ETag') || undefined;\r\n if (!(response.status === 200)) return [3 /*break*/, 11];\r\n responseBody = void 0;\r\n _b.label = 7;\r\n case 7:\r\n _b.trys.push([7, 9, , 10]);\r\n return [4 /*yield*/, response.json()];\r\n case 8:\r\n responseBody = _b.sent();\r\n return [3 /*break*/, 10];\r\n case 9:\r\n originalError_2 = _b.sent();\r\n throw ERROR_FACTORY.create(\"fetch-client-parse\" /* FETCH_PARSE */, {\r\n originalErrorMessage: originalError_2.message\r\n });\r\n case 10:\r\n config = responseBody['entries'];\r\n state = responseBody['state'];\r\n _b.label = 11;\r\n case 11:\r\n // Normalizes based on legacy state.\r\n if (state === 'INSTANCE_STATE_UNSPECIFIED') {\r\n status = 500;\r\n }\r\n else if (state === 'NO_CHANGE') {\r\n status = 304;\r\n }\r\n else if (state === 'NO_TEMPLATE' || state === 'EMPTY_CONFIG') {\r\n // These cases can be fixed remotely, so normalize to safe value.\r\n config = {};\r\n }\r\n // Normalize to exception-based control flow for non-success cases.\r\n // Encapsulates HTTP specifics in this class as much as possible. Status is still the best for\r\n // differentiating success states (200 from 304; the state body param is undefined in a\r\n // standard 304).\r\n if (status !== 304 && status !== 200) {\r\n throw ERROR_FACTORY.create(\"fetch-status\" /* FETCH_STATUS */, {\r\n httpStatus: status\r\n });\r\n }\r\n return [2 /*return*/, { status: status, eTag: responseEtag, config: config }];\r\n }\r\n });\r\n });\r\n };\r\n return RestClient;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Shims a minimal AbortSignal.\r\n *\r\n * <p>AbortController's AbortSignal conveniently decouples fetch timeout logic from other aspects\r\n * of networking, such as retries. Firebase doesn't use AbortController enough to justify a\r\n * polyfill recommendation, like we do with the Fetch API, but this minimal shim can easily be\r\n * swapped out if/when we do.\r\n */\r\nvar RemoteConfigAbortSignal = /** @class */ (function () {\r\n function RemoteConfigAbortSignal() {\r\n this.listeners = [];\r\n }\r\n RemoteConfigAbortSignal.prototype.addEventListener = function (listener) {\r\n this.listeners.push(listener);\r\n };\r\n RemoteConfigAbortSignal.prototype.abort = function () {\r\n this.listeners.forEach(function (listener) { return listener(); });\r\n };\r\n return RemoteConfigAbortSignal;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DEFAULT_VALUE_FOR_BOOLEAN = false;\r\nvar DEFAULT_VALUE_FOR_STRING = '';\r\nvar DEFAULT_VALUE_FOR_NUMBER = 0;\r\nvar BOOLEAN_TRUTHY_VALUES = ['1', 'true', 't', 'yes', 'y', 'on'];\r\nvar Value = /** @class */ (function () {\r\n function Value(_source, _value) {\r\n if (_value === void 0) { _value = DEFAULT_VALUE_FOR_STRING; }\r\n this._source = _source;\r\n this._value = _value;\r\n }\r\n Value.prototype.asString = function () {\r\n return this._value;\r\n };\r\n Value.prototype.asBoolean = function () {\r\n if (this._source === 'static') {\r\n return DEFAULT_VALUE_FOR_BOOLEAN;\r\n }\r\n return BOOLEAN_TRUTHY_VALUES.indexOf(this._value.toLowerCase()) >= 0;\r\n };\r\n Value.prototype.asNumber = function () {\r\n if (this._source === 'static') {\r\n return DEFAULT_VALUE_FOR_NUMBER;\r\n }\r\n var num = Number(this._value);\r\n if (isNaN(num)) {\r\n num = DEFAULT_VALUE_FOR_NUMBER;\r\n }\r\n return num;\r\n };\r\n Value.prototype.getSource = function () {\r\n return this._source;\r\n };\r\n return Value;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DEFAULT_FETCH_TIMEOUT_MILLIS = 60 * 1000; // One minute\r\nvar DEFAULT_CACHE_MAX_AGE_MILLIS = 12 * 60 * 60 * 1000; // Twelve hours.\r\n/**\r\n * Encapsulates business logic mapping network and storage dependencies to the public SDK API.\r\n *\r\n * See {@link https://github.com/FirebasePrivate/firebase-js-sdk/blob/master/packages/firebase/index.d.ts|interface documentation} for method descriptions.\r\n */\r\nvar RemoteConfig = /** @class */ (function () {\r\n function RemoteConfig(\r\n // Required by FirebaseServiceFactory interface.\r\n app, \r\n // JS doesn't support private yet\r\n // (https://github.com/tc39/proposal-class-fields#private-fields), so we hint using an\r\n // underscore prefix.\r\n _client, _storageCache, _storage, _logger) {\r\n this.app = app;\r\n this._client = _client;\r\n this._storageCache = _storageCache;\r\n this._storage = _storage;\r\n this._logger = _logger;\r\n // Tracks completion of initialization promise.\r\n this._isInitializationComplete = false;\r\n this.settings = {\r\n fetchTimeoutMillis: DEFAULT_FETCH_TIMEOUT_MILLIS,\r\n minimumFetchIntervalMillis: DEFAULT_CACHE_MAX_AGE_MILLIS\r\n };\r\n this.defaultConfig = {};\r\n }\r\n // Based on packages/firestore/src/util/log.ts but not static because we need per-instance levels\r\n // to differentiate 2p and 3p use-cases.\r\n RemoteConfig.prototype.setLogLevel = function (logLevel) {\r\n switch (logLevel) {\r\n case 'debug':\r\n this._logger.logLevel = LogLevel.DEBUG;\r\n break;\r\n case 'silent':\r\n this._logger.logLevel = LogLevel.SILENT;\r\n break;\r\n default:\r\n this._logger.logLevel = LogLevel.ERROR;\r\n }\r\n };\r\n Object.defineProperty(RemoteConfig.prototype, \"fetchTimeMillis\", {\r\n get: function () {\r\n return this._storageCache.getLastSuccessfulFetchTimestampMillis() || -1;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(RemoteConfig.prototype, \"lastFetchStatus\", {\r\n get: function () {\r\n return this._storageCache.getLastFetchStatus() || 'no-fetch-yet';\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n RemoteConfig.prototype.activate = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _a, lastSuccessfulFetchResponse, activeConfigEtag;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, Promise.all([\r\n this._storage.getLastSuccessfulFetchResponse(),\r\n this._storage.getActiveConfigEtag()\r\n ])];\r\n case 1:\r\n _a = _b.sent(), lastSuccessfulFetchResponse = _a[0], activeConfigEtag = _a[1];\r\n if (!lastSuccessfulFetchResponse ||\r\n !lastSuccessfulFetchResponse.config ||\r\n !lastSuccessfulFetchResponse.eTag ||\r\n lastSuccessfulFetchResponse.eTag === activeConfigEtag) {\r\n // Either there is no successful fetched config, or is the same as current active\r\n // config.\r\n return [2 /*return*/, false];\r\n }\r\n return [4 /*yield*/, Promise.all([\r\n this._storageCache.setActiveConfig(lastSuccessfulFetchResponse.config),\r\n this._storage.setActiveConfigEtag(lastSuccessfulFetchResponse.eTag)\r\n ])];\r\n case 2:\r\n _b.sent();\r\n return [2 /*return*/, true];\r\n }\r\n });\r\n });\r\n };\r\n RemoteConfig.prototype.ensureInitialized = function () {\r\n var _this = this;\r\n if (!this._initializePromise) {\r\n this._initializePromise = this._storageCache\r\n .loadFromStorage()\r\n .then(function () {\r\n _this._isInitializationComplete = true;\r\n });\r\n }\r\n return this._initializePromise;\r\n };\r\n /**\r\n * @throws a {@link ErrorCode.FETCH_CLIENT_TIMEOUT} if the request takes longer than\r\n * {@link Settings.fetchTimeoutInSeconds} or\r\n * {@link DEFAULT_FETCH_TIMEOUT_SECONDS}.\r\n */\r\n RemoteConfig.prototype.fetch = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var abortSignal, e_1, lastFetchStatus;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n abortSignal = new RemoteConfigAbortSignal();\r\n setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n // Note a very low delay, eg < 10ms, can elapse before listeners are initialized.\r\n abortSignal.abort();\r\n return [2 /*return*/];\r\n });\r\n }); }, this.settings.fetchTimeoutMillis);\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 4, , 6]);\r\n return [4 /*yield*/, this._client.fetch({\r\n cacheMaxAgeMillis: this.settings.minimumFetchIntervalMillis,\r\n signal: abortSignal\r\n })];\r\n case 2:\r\n _a.sent();\r\n return [4 /*yield*/, this._storageCache.setLastFetchStatus('success')];\r\n case 3:\r\n _a.sent();\r\n return [3 /*break*/, 6];\r\n case 4:\r\n e_1 = _a.sent();\r\n lastFetchStatus = hasErrorCode(e_1, \"fetch-throttle\" /* FETCH_THROTTLE */)\r\n ? 'throttle'\r\n : 'failure';\r\n return [4 /*yield*/, this._storageCache.setLastFetchStatus(lastFetchStatus)];\r\n case 5:\r\n _a.sent();\r\n throw e_1;\r\n case 6: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n RemoteConfig.prototype.fetchAndActivate = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.fetch()];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/, this.activate()];\r\n }\r\n });\r\n });\r\n };\r\n RemoteConfig.prototype.getAll = function () {\r\n var _this = this;\r\n return getAllKeys(this._storageCache.getActiveConfig(), this.defaultConfig).reduce(function (allConfigs, key) {\r\n allConfigs[key] = _this.getValue(key);\r\n return allConfigs;\r\n }, {});\r\n };\r\n RemoteConfig.prototype.getBoolean = function (key) {\r\n return this.getValue(key).asBoolean();\r\n };\r\n RemoteConfig.prototype.getNumber = function (key) {\r\n return this.getValue(key).asNumber();\r\n };\r\n RemoteConfig.prototype.getString = function (key) {\r\n return this.getValue(key).asString();\r\n };\r\n RemoteConfig.prototype.getValue = function (key) {\r\n if (!this._isInitializationComplete) {\r\n this._logger.debug(\"A value was requested for key \\\"\" + key + \"\\\" before SDK initialization completed.\" +\r\n ' Await on ensureInitialized if the intent was to get a previously activated value.');\r\n }\r\n var activeConfig = this._storageCache.getActiveConfig();\r\n if (activeConfig && activeConfig[key] !== undefined) {\r\n return new Value('remote', activeConfig[key]);\r\n }\r\n else if (this.defaultConfig && this.defaultConfig[key] !== undefined) {\r\n return new Value('default', String(this.defaultConfig[key]));\r\n }\r\n this._logger.debug(\"Returning static value for key \\\"\" + key + \"\\\".\" +\r\n ' Define a default or remote value if this is unintentional.');\r\n return new Value('static');\r\n };\r\n return RemoteConfig;\r\n}());\r\n/**\r\n * Dedupes and returns an array of all the keys of the received objects.\r\n */\r\nfunction getAllKeys(obj1, obj2) {\r\n if (obj1 === void 0) { obj1 = {}; }\r\n if (obj2 === void 0) { obj2 = {}; }\r\n return Object.keys(__assign(__assign({}, obj1), obj2));\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Converts an error event associated with a {@link IDBRequest} to a {@link FirebaseError}.\r\n */\r\nfunction toFirebaseError(event, errorCode) {\r\n var originalError = event.target.error || undefined;\r\n return ERROR_FACTORY.create(errorCode, {\r\n originalErrorMessage: originalError && originalError.message\r\n });\r\n}\r\n/**\r\n * A general-purpose store keyed by app + namespace + {@link\r\n * ProjectNamespaceKeyFieldValue}.\r\n *\r\n * <p>The Remote Config SDK can be used with multiple app installations, and each app can interact\r\n * with multiple namespaces, so this store uses app (ID + name) and namespace as common parent keys\r\n * for a set of key-value pairs. See {@link Storage#createCompositeKey}.\r\n *\r\n * <p>Visible for testing.\r\n */\r\nvar APP_NAMESPACE_STORE = 'app_namespace_store';\r\nvar DB_NAME = 'firebase_remote_config';\r\nvar DB_VERSION = 1;\r\n// Visible for testing.\r\nfunction openDatabase() {\r\n return new Promise(function (resolve, reject) {\r\n var request = indexedDB.open(DB_NAME, DB_VERSION);\r\n request.onerror = function (event) {\r\n reject(toFirebaseError(event, \"storage-open\" /* STORAGE_OPEN */));\r\n };\r\n request.onsuccess = function (event) {\r\n resolve(event.target.result);\r\n };\r\n request.onupgradeneeded = function (event) {\r\n var db = event.target.result;\r\n // We don't use 'break' in this switch statement, the fall-through\r\n // behavior is what we want, because if there are multiple versions between\r\n // the old version and the current version, we want ALL the migrations\r\n // that correspond to those versions to run, not only the last one.\r\n // eslint-disable-next-line default-case\r\n switch (event.oldVersion) {\r\n case 0:\r\n db.createObjectStore(APP_NAMESPACE_STORE, {\r\n keyPath: 'compositeKey'\r\n });\r\n }\r\n };\r\n });\r\n}\r\n/**\r\n * Abstracts data persistence.\r\n */\r\nvar Storage = /** @class */ (function () {\r\n /**\r\n * @param appId enables storage segmentation by app (ID + name).\r\n * @param appName enables storage segmentation by app (ID + name).\r\n * @param namespace enables storage segmentation by namespace.\r\n */\r\n function Storage(appId, appName, namespace, openDbPromise) {\r\n if (openDbPromise === void 0) { openDbPromise = openDatabase(); }\r\n this.appId = appId;\r\n this.appName = appName;\r\n this.namespace = namespace;\r\n this.openDbPromise = openDbPromise;\r\n }\r\n Storage.prototype.getLastFetchStatus = function () {\r\n return this.get('last_fetch_status');\r\n };\r\n Storage.prototype.setLastFetchStatus = function (status) {\r\n return this.set('last_fetch_status', status);\r\n };\r\n // This is comparable to a cache entry timestamp. If we need to expire other data, we could\r\n // consider adding timestamp to all storage records and an optional max age arg to getters.\r\n Storage.prototype.getLastSuccessfulFetchTimestampMillis = function () {\r\n return this.get('last_successful_fetch_timestamp_millis');\r\n };\r\n Storage.prototype.setLastSuccessfulFetchTimestampMillis = function (timestamp) {\r\n return this.set('last_successful_fetch_timestamp_millis', timestamp);\r\n };\r\n Storage.prototype.getLastSuccessfulFetchResponse = function () {\r\n return this.get('last_successful_fetch_response');\r\n };\r\n Storage.prototype.setLastSuccessfulFetchResponse = function (response) {\r\n return this.set('last_successful_fetch_response', response);\r\n };\r\n Storage.prototype.getActiveConfig = function () {\r\n return this.get('active_config');\r\n };\r\n Storage.prototype.setActiveConfig = function (config) {\r\n return this.set('active_config', config);\r\n };\r\n Storage.prototype.getActiveConfigEtag = function () {\r\n return this.get('active_config_etag');\r\n };\r\n Storage.prototype.setActiveConfigEtag = function (etag) {\r\n return this.set('active_config_etag', etag);\r\n };\r\n Storage.prototype.getThrottleMetadata = function () {\r\n return this.get('throttle_metadata');\r\n };\r\n Storage.prototype.setThrottleMetadata = function (metadata) {\r\n return this.set('throttle_metadata', metadata);\r\n };\r\n Storage.prototype.deleteThrottleMetadata = function () {\r\n return this.delete('throttle_metadata');\r\n };\r\n Storage.prototype.get = function (key) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var db;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.openDbPromise];\r\n case 1:\r\n db = _a.sent();\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n var transaction = db.transaction([APP_NAMESPACE_STORE], 'readonly');\r\n var objectStore = transaction.objectStore(APP_NAMESPACE_STORE);\r\n var compositeKey = _this.createCompositeKey(key);\r\n try {\r\n var request = objectStore.get(compositeKey);\r\n request.onerror = function (event) {\r\n reject(toFirebaseError(event, \"storage-get\" /* STORAGE_GET */));\r\n };\r\n request.onsuccess = function (event) {\r\n var result = event.target.result;\r\n if (result) {\r\n resolve(result.value);\r\n }\r\n else {\r\n resolve(undefined);\r\n }\r\n };\r\n }\r\n catch (e) {\r\n reject(ERROR_FACTORY.create(\"storage-get\" /* STORAGE_GET */, {\r\n originalErrorMessage: e && e.message\r\n }));\r\n }\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n Storage.prototype.set = function (key, value) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var db;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.openDbPromise];\r\n case 1:\r\n db = _a.sent();\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n var transaction = db.transaction([APP_NAMESPACE_STORE], 'readwrite');\r\n var objectStore = transaction.objectStore(APP_NAMESPACE_STORE);\r\n var compositeKey = _this.createCompositeKey(key);\r\n try {\r\n var request = objectStore.put({\r\n compositeKey: compositeKey,\r\n value: value\r\n });\r\n request.onerror = function (event) {\r\n reject(toFirebaseError(event, \"storage-set\" /* STORAGE_SET */));\r\n };\r\n request.onsuccess = function () {\r\n resolve();\r\n };\r\n }\r\n catch (e) {\r\n reject(ERROR_FACTORY.create(\"storage-set\" /* STORAGE_SET */, {\r\n originalErrorMessage: e && e.message\r\n }));\r\n }\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n Storage.prototype.delete = function (key) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var db;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.openDbPromise];\r\n case 1:\r\n db = _a.sent();\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n var transaction = db.transaction([APP_NAMESPACE_STORE], 'readwrite');\r\n var objectStore = transaction.objectStore(APP_NAMESPACE_STORE);\r\n var compositeKey = _this.createCompositeKey(key);\r\n try {\r\n var request = objectStore.delete(compositeKey);\r\n request.onerror = function (event) {\r\n reject(toFirebaseError(event, \"storage-delete\" /* STORAGE_DELETE */));\r\n };\r\n request.onsuccess = function () {\r\n resolve();\r\n };\r\n }\r\n catch (e) {\r\n reject(ERROR_FACTORY.create(\"storage-delete\" /* STORAGE_DELETE */, {\r\n originalErrorMessage: e && e.message\r\n }));\r\n }\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n // Facilitates composite key functionality (which is unsupported in IE).\r\n Storage.prototype.createCompositeKey = function (key) {\r\n return [this.appId, this.appName, this.namespace, key].join();\r\n };\r\n return Storage;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A memory cache layer over storage to support the SDK's synchronous read requirements.\r\n */\r\nvar StorageCache = /** @class */ (function () {\r\n function StorageCache(storage) {\r\n this.storage = storage;\r\n }\r\n /**\r\n * Memory-only getters\r\n */\r\n StorageCache.prototype.getLastFetchStatus = function () {\r\n return this.lastFetchStatus;\r\n };\r\n StorageCache.prototype.getLastSuccessfulFetchTimestampMillis = function () {\r\n return this.lastSuccessfulFetchTimestampMillis;\r\n };\r\n StorageCache.prototype.getActiveConfig = function () {\r\n return this.activeConfig;\r\n };\r\n /**\r\n * Read-ahead getter\r\n */\r\n StorageCache.prototype.loadFromStorage = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var lastFetchStatusPromise, lastSuccessfulFetchTimestampMillisPromise, activeConfigPromise, lastFetchStatus, lastSuccessfulFetchTimestampMillis, activeConfig;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n lastFetchStatusPromise = this.storage.getLastFetchStatus();\r\n lastSuccessfulFetchTimestampMillisPromise = this.storage.getLastSuccessfulFetchTimestampMillis();\r\n activeConfigPromise = this.storage.getActiveConfig();\r\n return [4 /*yield*/, lastFetchStatusPromise];\r\n case 1:\r\n lastFetchStatus = _a.sent();\r\n if (lastFetchStatus) {\r\n this.lastFetchStatus = lastFetchStatus;\r\n }\r\n return [4 /*yield*/, lastSuccessfulFetchTimestampMillisPromise];\r\n case 2:\r\n lastSuccessfulFetchTimestampMillis = _a.sent();\r\n if (lastSuccessfulFetchTimestampMillis) {\r\n this.lastSuccessfulFetchTimestampMillis = lastSuccessfulFetchTimestampMillis;\r\n }\r\n return [4 /*yield*/, activeConfigPromise];\r\n case 3:\r\n activeConfig = _a.sent();\r\n if (activeConfig) {\r\n this.activeConfig = activeConfig;\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Write-through setters\r\n */\r\n StorageCache.prototype.setLastFetchStatus = function (status) {\r\n this.lastFetchStatus = status;\r\n return this.storage.setLastFetchStatus(status);\r\n };\r\n StorageCache.prototype.setLastSuccessfulFetchTimestampMillis = function (timestampMillis) {\r\n this.lastSuccessfulFetchTimestampMillis = timestampMillis;\r\n return this.storage.setLastSuccessfulFetchTimestampMillis(timestampMillis);\r\n };\r\n StorageCache.prototype.setActiveConfig = function (activeConfig) {\r\n this.activeConfig = activeConfig;\r\n return this.storage.setActiveConfig(activeConfig);\r\n };\r\n return StorageCache;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Supports waiting on a backoff by:\r\n *\r\n * <ul>\r\n * <li>Promisifying setTimeout, so we can set a timeout in our Promise chain</li>\r\n * <li>Listening on a signal bus for abort events, just like the Fetch API</li>\r\n * <li>Failing in the same way the Fetch API fails, so timing out a live request and a throttled\r\n * request appear the same.</li>\r\n * </ul>\r\n *\r\n * <p>Visible for testing.\r\n */\r\nfunction setAbortableTimeout(signal, throttleEndTimeMillis) {\r\n return new Promise(function (resolve, reject) {\r\n // Derives backoff from given end time, normalizing negative numbers to zero.\r\n var backoffMillis = Math.max(throttleEndTimeMillis - Date.now(), 0);\r\n var timeout = setTimeout(resolve, backoffMillis);\r\n // Adds listener, rather than sets onabort, because signal is a shared object.\r\n signal.addEventListener(function () {\r\n clearTimeout(timeout);\r\n // If the request completes before this timeout, the rejection has no effect.\r\n reject(ERROR_FACTORY.create(\"fetch-throttle\" /* FETCH_THROTTLE */, {\r\n throttleEndTimeMillis: throttleEndTimeMillis\r\n }));\r\n });\r\n });\r\n}\r\n/**\r\n * Returns true if the {@link Error} indicates a fetch request may succeed later.\r\n */\r\nfunction isRetriableError(e) {\r\n if (!(e instanceof FirebaseError) || !e.customData) {\r\n return false;\r\n }\r\n // Uses string index defined by ErrorData, which FirebaseError implements.\r\n var httpStatus = Number(e.customData['httpStatus']);\r\n return (httpStatus === 429 ||\r\n httpStatus === 500 ||\r\n httpStatus === 503 ||\r\n httpStatus === 504);\r\n}\r\n/**\r\n * Decorates a Client with retry logic.\r\n *\r\n * <p>Comparable to CachingClient, but uses backoff logic instead of cache max age and doesn't cache\r\n * responses (because the SDK has no use for error responses).\r\n */\r\nvar RetryingClient = /** @class */ (function () {\r\n function RetryingClient(client, storage) {\r\n this.client = client;\r\n this.storage = storage;\r\n }\r\n RetryingClient.prototype.fetch = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var throttleMetadata;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.storage.getThrottleMetadata()];\r\n case 1:\r\n throttleMetadata = (_a.sent()) || {\r\n backoffCount: 0,\r\n throttleEndTimeMillis: Date.now()\r\n };\r\n return [2 /*return*/, this.attemptFetch(request, throttleMetadata)];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * A recursive helper for attempting a fetch request repeatedly.\r\n *\r\n * @throws any non-retriable errors.\r\n */\r\n RetryingClient.prototype.attemptFetch = function (request, _a) {\r\n var throttleEndTimeMillis = _a.throttleEndTimeMillis, backoffCount = _a.backoffCount;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var response, e_1, throttleMetadata;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: \r\n // Starts with a (potentially zero) timeout to support resumption from stored state.\r\n // Ensures the throttle end time is honored if the last attempt timed out.\r\n // Note the SDK will never make a request if the fetch timeout expires at this point.\r\n return [4 /*yield*/, setAbortableTimeout(request.signal, throttleEndTimeMillis)];\r\n case 1:\r\n // Starts with a (potentially zero) timeout to support resumption from stored state.\r\n // Ensures the throttle end time is honored if the last attempt timed out.\r\n // Note the SDK will never make a request if the fetch timeout expires at this point.\r\n _b.sent();\r\n _b.label = 2;\r\n case 2:\r\n _b.trys.push([2, 5, , 7]);\r\n return [4 /*yield*/, this.client.fetch(request)];\r\n case 3:\r\n response = _b.sent();\r\n // Note the SDK only clears throttle state if response is success or non-retriable.\r\n return [4 /*yield*/, this.storage.deleteThrottleMetadata()];\r\n case 4:\r\n // Note the SDK only clears throttle state if response is success or non-retriable.\r\n _b.sent();\r\n return [2 /*return*/, response];\r\n case 5:\r\n e_1 = _b.sent();\r\n if (!isRetriableError(e_1)) {\r\n throw e_1;\r\n }\r\n throttleMetadata = {\r\n throttleEndTimeMillis: Date.now() + calculateBackoffMillis(backoffCount),\r\n backoffCount: backoffCount + 1\r\n };\r\n // Persists state.\r\n return [4 /*yield*/, this.storage.setThrottleMetadata(throttleMetadata)];\r\n case 6:\r\n // Persists state.\r\n _b.sent();\r\n return [2 /*return*/, this.attemptFetch(request, throttleMetadata)];\r\n case 7: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n return RetryingClient;\r\n}());\n\nvar name = \"@firebase/remote-config\";\nvar version = \"0.1.29\";\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction registerRemoteConfig(firebaseInstance) {\r\n firebaseInstance.INTERNAL.registerComponent(new Component('remoteConfig', remoteConfigFactory, \"PUBLIC\" /* PUBLIC */).setMultipleInstances(true));\r\n firebaseInstance.registerVersion(name, version);\r\n function remoteConfigFactory(container, namespace) {\r\n /* Dependencies */\r\n // getImmediate for FirebaseApp will always succeed\r\n var app = container.getProvider('app').getImmediate();\r\n // The following call will always succeed because rc has `import '@firebase/installations'`\r\n var installations = container.getProvider('installations').getImmediate();\r\n // Guards against the SDK being used in non-browser environments.\r\n if (typeof window === 'undefined') {\r\n throw ERROR_FACTORY.create(\"registration-window\" /* REGISTRATION_WINDOW */);\r\n }\r\n // Normalizes optional inputs.\r\n var _a = app.options, projectId = _a.projectId, apiKey = _a.apiKey, appId = _a.appId;\r\n if (!projectId) {\r\n throw ERROR_FACTORY.create(\"registration-project-id\" /* REGISTRATION_PROJECT_ID */);\r\n }\r\n if (!apiKey) {\r\n throw ERROR_FACTORY.create(\"registration-api-key\" /* REGISTRATION_API_KEY */);\r\n }\r\n if (!appId) {\r\n throw ERROR_FACTORY.create(\"registration-app-id\" /* REGISTRATION_APP_ID */);\r\n }\r\n namespace = namespace || 'firebase';\r\n var storage = new Storage(appId, app.name, namespace);\r\n var storageCache = new StorageCache(storage);\r\n var logger = new Logger(name);\r\n // Sets ERROR as the default log level.\r\n // See RemoteConfig#setLogLevel for corresponding normalization to ERROR log level.\r\n logger.logLevel = LogLevel.ERROR;\r\n var restClient = new RestClient(installations, \r\n // Uses the JS SDK version, by which the RC package version can be deduced, if necessary.\r\n firebaseInstance.SDK_VERSION, namespace, projectId, apiKey, appId);\r\n var retryingClient = new RetryingClient(restClient, storage);\r\n var cachingClient = new CachingClient(retryingClient, storage, storageCache, logger);\r\n var remoteConfigInstance = new RemoteConfig(app, cachingClient, storageCache, storage, logger);\r\n // Starts warming cache.\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n remoteConfigInstance.ensureInitialized();\r\n return remoteConfigInstance;\r\n }\r\n}\r\nregisterRemoteConfig(firebase);\n\nexport { registerRemoteConfig };\n//# sourceMappingURL=index.esm.js.map\n","import firebase from '@firebase/app';\nimport { __extends, __awaiter, __generator, __spreadArrays } from 'tslib';\nimport { FirebaseError } from '@firebase/util';\nimport { Component } from '@firebase/component';\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @fileoverview Constants used in the Firebase Storage library.\r\n */\r\n/**\r\n * Domain name for firebase storage.\r\n */\r\nvar DEFAULT_HOST = 'firebasestorage.googleapis.com';\r\n/**\r\n * The key in Firebase config json for the storage bucket.\r\n */\r\nvar CONFIG_STORAGE_BUCKET_KEY = 'storageBucket';\r\n/**\r\n * 2 minutes\r\n *\r\n * The timeout for all operations except upload.\r\n */\r\nvar DEFAULT_MAX_OPERATION_RETRY_TIME = 2 * 60 * 1000;\r\n/**\r\n * 10 minutes\r\n *\r\n * The timeout for upload.\r\n */\r\nvar DEFAULT_MAX_UPLOAD_RETRY_TIME = 10 * 60 * 1000;\n\nvar FirebaseStorageError = /** @class */ (function (_super) {\r\n __extends(FirebaseStorageError, _super);\r\n function FirebaseStorageError(code, message) {\r\n var _this = _super.call(this, prependCode(code), 'Firebase Storage: ' + message) || this;\r\n _this.customData = { serverResponse: null };\r\n // Without this, `instanceof FirebaseStorageError`, in tests for example,\r\n // returns false.\r\n Object.setPrototypeOf(_this, FirebaseStorageError.prototype);\r\n return _this;\r\n }\r\n FirebaseStorageError.prototype.codeEquals = function (code) {\r\n return prependCode(code) === this.code;\r\n };\r\n Object.defineProperty(FirebaseStorageError.prototype, \"message\", {\r\n get: function () {\r\n if (this.customData.serverResponse) {\r\n return this.message + '\\n' + this.customData.serverResponse;\r\n }\r\n else {\r\n return this.message;\r\n }\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(FirebaseStorageError.prototype, \"serverResponse\", {\r\n get: function () {\r\n return this.customData.serverResponse;\r\n },\r\n set: function (serverResponse) {\r\n this.customData.serverResponse = serverResponse;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return FirebaseStorageError;\r\n}(FirebaseError));\r\nvar Code = {\r\n // Shared between all platforms\r\n UNKNOWN: 'unknown',\r\n OBJECT_NOT_FOUND: 'object-not-found',\r\n BUCKET_NOT_FOUND: 'bucket-not-found',\r\n PROJECT_NOT_FOUND: 'project-not-found',\r\n QUOTA_EXCEEDED: 'quota-exceeded',\r\n UNAUTHENTICATED: 'unauthenticated',\r\n UNAUTHORIZED: 'unauthorized',\r\n RETRY_LIMIT_EXCEEDED: 'retry-limit-exceeded',\r\n INVALID_CHECKSUM: 'invalid-checksum',\r\n CANCELED: 'canceled',\r\n // JS specific\r\n INVALID_EVENT_NAME: 'invalid-event-name',\r\n INVALID_URL: 'invalid-url',\r\n INVALID_DEFAULT_BUCKET: 'invalid-default-bucket',\r\n NO_DEFAULT_BUCKET: 'no-default-bucket',\r\n CANNOT_SLICE_BLOB: 'cannot-slice-blob',\r\n SERVER_FILE_WRONG_SIZE: 'server-file-wrong-size',\r\n NO_DOWNLOAD_URL: 'no-download-url',\r\n INVALID_ARGUMENT: 'invalid-argument',\r\n INVALID_ARGUMENT_COUNT: 'invalid-argument-count',\r\n APP_DELETED: 'app-deleted',\r\n INVALID_ROOT_OPERATION: 'invalid-root-operation',\r\n INVALID_FORMAT: 'invalid-format',\r\n INTERNAL_ERROR: 'internal-error'\r\n};\r\nfunction prependCode(code) {\r\n return 'storage/' + code;\r\n}\r\nfunction unknown() {\r\n var message = 'An unknown error occurred, please check the error payload for ' +\r\n 'server response.';\r\n return new FirebaseStorageError(Code.UNKNOWN, message);\r\n}\r\nfunction objectNotFound(path) {\r\n return new FirebaseStorageError(Code.OBJECT_NOT_FOUND, \"Object '\" + path + \"' does not exist.\");\r\n}\r\nfunction quotaExceeded(bucket) {\r\n return new FirebaseStorageError(Code.QUOTA_EXCEEDED, \"Quota for bucket '\" +\r\n bucket +\r\n \"' exceeded, please view quota on \" +\r\n 'https://firebase.google.com/pricing/.');\r\n}\r\nfunction unauthenticated() {\r\n var message = 'User is not authenticated, please authenticate using Firebase ' +\r\n 'Authentication and try again.';\r\n return new FirebaseStorageError(Code.UNAUTHENTICATED, message);\r\n}\r\nfunction unauthorized(path) {\r\n return new FirebaseStorageError(Code.UNAUTHORIZED, \"User does not have permission to access '\" + path + \"'.\");\r\n}\r\nfunction retryLimitExceeded() {\r\n return new FirebaseStorageError(Code.RETRY_LIMIT_EXCEEDED, 'Max retry time for operation exceeded, please try again.');\r\n}\r\nfunction canceled() {\r\n return new FirebaseStorageError(Code.CANCELED, 'User canceled the upload/download.');\r\n}\r\nfunction invalidUrl(url) {\r\n return new FirebaseStorageError(Code.INVALID_URL, \"Invalid URL '\" + url + \"'.\");\r\n}\r\nfunction invalidDefaultBucket(bucket) {\r\n return new FirebaseStorageError(Code.INVALID_DEFAULT_BUCKET, \"Invalid default bucket '\" + bucket + \"'.\");\r\n}\r\nfunction cannotSliceBlob() {\r\n return new FirebaseStorageError(Code.CANNOT_SLICE_BLOB, 'Cannot slice blob for upload. Please retry the upload.');\r\n}\r\nfunction serverFileWrongSize() {\r\n return new FirebaseStorageError(Code.SERVER_FILE_WRONG_SIZE, 'Server recorded incorrect upload file size, please retry the upload.');\r\n}\r\nfunction noDownloadURL() {\r\n return new FirebaseStorageError(Code.NO_DOWNLOAD_URL, 'The given file does not have any download URLs.');\r\n}\r\nfunction appDeleted() {\r\n return new FirebaseStorageError(Code.APP_DELETED, 'The Firebase app was deleted.');\r\n}\r\n/**\r\n * @param name The name of the operation that was invalid.\r\n */\r\nfunction invalidRootOperation(name) {\r\n return new FirebaseStorageError(Code.INVALID_ROOT_OPERATION, \"The operation '\" +\r\n name +\r\n \"' cannot be performed on a root reference, create a non-root \" +\r\n \"reference using child, such as .child('file.png').\");\r\n}\r\n/**\r\n * @param format The format that was not valid.\r\n * @param message A message describing the format violation.\r\n */\r\nfunction invalidFormat(format, message) {\r\n return new FirebaseStorageError(Code.INVALID_FORMAT, \"String does not match format '\" + format + \"': \" + message);\r\n}\r\n/**\r\n * @param message A message describing the internal error.\r\n */\r\nfunction internalError(message) {\r\n throw new FirebaseStorageError(Code.INTERNAL_ERROR, 'Internal error: ' + message);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar StringFormat = {\r\n RAW: 'raw',\r\n BASE64: 'base64',\r\n BASE64URL: 'base64url',\r\n DATA_URL: 'data_url'\r\n};\r\n/**\r\n * @struct\r\n */\r\nvar StringData = /** @class */ (function () {\r\n function StringData(data, contentType) {\r\n this.data = data;\r\n this.contentType = contentType || null;\r\n }\r\n return StringData;\r\n}());\r\nfunction dataFromString(format, stringData) {\r\n switch (format) {\r\n case StringFormat.RAW:\r\n return new StringData(utf8Bytes_(stringData));\r\n case StringFormat.BASE64:\r\n case StringFormat.BASE64URL:\r\n return new StringData(base64Bytes_(format, stringData));\r\n case StringFormat.DATA_URL:\r\n return new StringData(dataURLBytes_(stringData), dataURLContentType_(stringData));\r\n // do nothing\r\n }\r\n // assert(false);\r\n throw unknown();\r\n}\r\nfunction utf8Bytes_(value) {\r\n var b = [];\r\n for (var i = 0; i < value.length; i++) {\r\n var c = value.charCodeAt(i);\r\n if (c <= 127) {\r\n b.push(c);\r\n }\r\n else {\r\n if (c <= 2047) {\r\n b.push(192 | (c >> 6), 128 | (c & 63));\r\n }\r\n else {\r\n if ((c & 64512) === 55296) {\r\n // The start of a surrogate pair.\r\n var valid = i < value.length - 1 && (value.charCodeAt(i + 1) & 64512) === 56320;\r\n if (!valid) {\r\n // The second surrogate wasn't there.\r\n b.push(239, 191, 189);\r\n }\r\n else {\r\n var hi = c;\r\n var lo = value.charCodeAt(++i);\r\n c = 65536 | ((hi & 1023) << 10) | (lo & 1023);\r\n b.push(240 | (c >> 18), 128 | ((c >> 12) & 63), 128 | ((c >> 6) & 63), 128 | (c & 63));\r\n }\r\n }\r\n else {\r\n if ((c & 64512) === 56320) {\r\n // Invalid low surrogate.\r\n b.push(239, 191, 189);\r\n }\r\n else {\r\n b.push(224 | (c >> 12), 128 | ((c >> 6) & 63), 128 | (c & 63));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return new Uint8Array(b);\r\n}\r\nfunction percentEncodedBytes_(value) {\r\n var decoded;\r\n try {\r\n decoded = decodeURIComponent(value);\r\n }\r\n catch (e) {\r\n throw invalidFormat(StringFormat.DATA_URL, 'Malformed data URL.');\r\n }\r\n return utf8Bytes_(decoded);\r\n}\r\nfunction base64Bytes_(format, value) {\r\n switch (format) {\r\n case StringFormat.BASE64: {\r\n var hasMinus = value.indexOf('-') !== -1;\r\n var hasUnder = value.indexOf('_') !== -1;\r\n if (hasMinus || hasUnder) {\r\n var invalidChar = hasMinus ? '-' : '_';\r\n throw invalidFormat(format, \"Invalid character '\" +\r\n invalidChar +\r\n \"' found: is it base64url encoded?\");\r\n }\r\n break;\r\n }\r\n case StringFormat.BASE64URL: {\r\n var hasPlus = value.indexOf('+') !== -1;\r\n var hasSlash = value.indexOf('/') !== -1;\r\n if (hasPlus || hasSlash) {\r\n var invalidChar = hasPlus ? '+' : '/';\r\n throw invalidFormat(format, \"Invalid character '\" + invalidChar + \"' found: is it base64 encoded?\");\r\n }\r\n value = value.replace(/-/g, '+').replace(/_/g, '/');\r\n break;\r\n }\r\n // do nothing\r\n }\r\n var bytes;\r\n try {\r\n bytes = atob(value);\r\n }\r\n catch (e) {\r\n throw invalidFormat(format, 'Invalid character found');\r\n }\r\n var array = new Uint8Array(bytes.length);\r\n for (var i = 0; i < bytes.length; i++) {\r\n array[i] = bytes.charCodeAt(i);\r\n }\r\n return array;\r\n}\r\n/**\r\n * @struct\r\n */\r\nvar DataURLParts = /** @class */ (function () {\r\n function DataURLParts(dataURL) {\r\n this.base64 = false;\r\n this.contentType = null;\r\n var matches = dataURL.match(/^data:([^,]+)?,/);\r\n if (matches === null) {\r\n throw invalidFormat(StringFormat.DATA_URL, \"Must be formatted 'data:[<mediatype>][;base64],<data>\");\r\n }\r\n var middle = matches[1] || null;\r\n if (middle != null) {\r\n this.base64 = endsWith(middle, ';base64');\r\n this.contentType = this.base64\r\n ? middle.substring(0, middle.length - ';base64'.length)\r\n : middle;\r\n }\r\n this.rest = dataURL.substring(dataURL.indexOf(',') + 1);\r\n }\r\n return DataURLParts;\r\n}());\r\nfunction dataURLBytes_(dataUrl) {\r\n var parts = new DataURLParts(dataUrl);\r\n if (parts.base64) {\r\n return base64Bytes_(StringFormat.BASE64, parts.rest);\r\n }\r\n else {\r\n return percentEncodedBytes_(parts.rest);\r\n }\r\n}\r\nfunction dataURLContentType_(dataUrl) {\r\n var parts = new DataURLParts(dataUrl);\r\n return parts.contentType;\r\n}\r\nfunction endsWith(s, end) {\r\n var longEnough = s.length >= end.length;\r\n if (!longEnough) {\r\n return false;\r\n }\r\n return s.substring(s.length - end.length) === end;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar TaskEvent = {\r\n /** Triggered whenever the task changes or progress is updated. */\r\n STATE_CHANGED: 'state_changed'\r\n};\r\nvar InternalTaskState = {\r\n RUNNING: 'running',\r\n PAUSING: 'pausing',\r\n PAUSED: 'paused',\r\n SUCCESS: 'success',\r\n CANCELING: 'canceling',\r\n CANCELED: 'canceled',\r\n ERROR: 'error'\r\n};\r\nvar TaskState = {\r\n /** The task is currently transferring data. */\r\n RUNNING: 'running',\r\n /** The task was paused by the user. */\r\n PAUSED: 'paused',\r\n /** The task completed successfully. */\r\n SUCCESS: 'success',\r\n /** The task was canceled. */\r\n CANCELED: 'canceled',\r\n /** The task failed with an error. */\r\n ERROR: 'error'\r\n};\r\nfunction taskStateFromInternalTaskState(state) {\r\n switch (state) {\r\n case InternalTaskState.RUNNING:\r\n case InternalTaskState.PAUSING:\r\n case InternalTaskState.CANCELING:\r\n return TaskState.RUNNING;\r\n case InternalTaskState.PAUSED:\r\n return TaskState.PAUSED;\r\n case InternalTaskState.SUCCESS:\r\n return TaskState.SUCCESS;\r\n case InternalTaskState.CANCELED:\r\n return TaskState.CANCELED;\r\n case InternalTaskState.ERROR:\r\n return TaskState.ERROR;\r\n default:\r\n // TODO(andysoto): assert(false);\r\n return TaskState.ERROR;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @return False if the object is undefined or null, true otherwise.\r\n */\r\nfunction isDef(p) {\r\n return p != null;\r\n}\r\nfunction isJustDef(p) {\r\n return p !== void 0;\r\n}\r\n// eslint-disable-next-line @typescript-eslint/ban-types\r\nfunction isFunction(p) {\r\n return typeof p === 'function';\r\n}\r\nfunction isNonArrayObject(p) {\r\n return typeof p === 'object' && !Array.isArray(p);\r\n}\r\nfunction isString(p) {\r\n return typeof p === 'string' || p instanceof String;\r\n}\r\nfunction isNativeBlob(p) {\r\n return isNativeBlobDefined() && p instanceof Blob;\r\n}\r\nfunction isNativeBlobDefined() {\r\n return typeof Blob !== 'undefined';\r\n}\r\nfunction validateNumber(argument, minValue, maxValue, value) {\r\n if (value < minValue) {\r\n throw new FirebaseStorageError(Code.INVALID_ARGUMENT, \"Invalid value for '\" + argument + \"'. Expected \" + minValue + \" or greater.\");\r\n }\r\n if (value > maxValue) {\r\n throw new FirebaseStorageError(Code.INVALID_ARGUMENT, \"Invalid value for '\" + argument + \"'. Expected \" + maxValue + \" or less.\");\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @enum{number}\r\n */\r\nvar ErrorCode;\r\n(function (ErrorCode) {\r\n ErrorCode[ErrorCode[\"NO_ERROR\"] = 0] = \"NO_ERROR\";\r\n ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 1] = \"NETWORK_ERROR\";\r\n ErrorCode[ErrorCode[\"ABORT\"] = 2] = \"ABORT\";\r\n})(ErrorCode || (ErrorCode = {}));\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * We use this instead of goog.net.XhrIo because goog.net.XhrIo is hyuuuuge and\r\n * doesn't work in React Native on Android.\r\n */\r\nvar NetworkXhrIo = /** @class */ (function () {\r\n function NetworkXhrIo() {\r\n var _this = this;\r\n this.sent_ = false;\r\n this.xhr_ = new XMLHttpRequest();\r\n this.errorCode_ = ErrorCode.NO_ERROR;\r\n this.sendPromise_ = new Promise(function (resolve) {\r\n _this.xhr_.addEventListener('abort', function () {\r\n _this.errorCode_ = ErrorCode.ABORT;\r\n resolve(_this);\r\n });\r\n _this.xhr_.addEventListener('error', function () {\r\n _this.errorCode_ = ErrorCode.NETWORK_ERROR;\r\n resolve(_this);\r\n });\r\n _this.xhr_.addEventListener('load', function () {\r\n resolve(_this);\r\n });\r\n });\r\n }\r\n /**\r\n * @override\r\n */\r\n NetworkXhrIo.prototype.send = function (url, method, body, headers) {\r\n if (this.sent_) {\r\n throw internalError('cannot .send() more than once');\r\n }\r\n this.sent_ = true;\r\n this.xhr_.open(method, url, true);\r\n if (isDef(headers)) {\r\n for (var key in headers) {\r\n if (headers.hasOwnProperty(key)) {\r\n this.xhr_.setRequestHeader(key, headers[key].toString());\r\n }\r\n }\r\n }\r\n if (isDef(body)) {\r\n this.xhr_.send(body);\r\n }\r\n else {\r\n this.xhr_.send();\r\n }\r\n return this.sendPromise_;\r\n };\r\n /**\r\n * @override\r\n */\r\n NetworkXhrIo.prototype.getErrorCode = function () {\r\n if (!this.sent_) {\r\n throw internalError('cannot .getErrorCode() before sending');\r\n }\r\n return this.errorCode_;\r\n };\r\n /**\r\n * @override\r\n */\r\n NetworkXhrIo.prototype.getStatus = function () {\r\n if (!this.sent_) {\r\n throw internalError('cannot .getStatus() before sending');\r\n }\r\n try {\r\n return this.xhr_.status;\r\n }\r\n catch (e) {\r\n return -1;\r\n }\r\n };\r\n /**\r\n * @override\r\n */\r\n NetworkXhrIo.prototype.getResponseText = function () {\r\n if (!this.sent_) {\r\n throw internalError('cannot .getResponseText() before sending');\r\n }\r\n return this.xhr_.responseText;\r\n };\r\n /**\r\n * Aborts the request.\r\n * @override\r\n */\r\n NetworkXhrIo.prototype.abort = function () {\r\n this.xhr_.abort();\r\n };\r\n /**\r\n * @override\r\n */\r\n NetworkXhrIo.prototype.getResponseHeader = function (header) {\r\n return this.xhr_.getResponseHeader(header);\r\n };\r\n /**\r\n * @override\r\n */\r\n NetworkXhrIo.prototype.addUploadProgressListener = function (listener) {\r\n if (isDef(this.xhr_.upload)) {\r\n this.xhr_.upload.addEventListener('progress', listener);\r\n }\r\n };\r\n /**\r\n * @override\r\n */\r\n NetworkXhrIo.prototype.removeUploadProgressListener = function (listener) {\r\n if (isDef(this.xhr_.upload)) {\r\n this.xhr_.upload.removeEventListener('progress', listener);\r\n }\r\n };\r\n return NetworkXhrIo;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Factory-like class for creating XhrIo instances.\r\n */\r\nvar XhrIoPool = /** @class */ (function () {\r\n function XhrIoPool() {\r\n }\r\n XhrIoPool.prototype.createXhrIo = function () {\r\n return new NetworkXhrIo();\r\n };\r\n return XhrIoPool;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction getBlobBuilder() {\r\n if (typeof BlobBuilder !== 'undefined') {\r\n return BlobBuilder;\r\n }\r\n else if (typeof WebKitBlobBuilder !== 'undefined') {\r\n return WebKitBlobBuilder;\r\n }\r\n else {\r\n return undefined;\r\n }\r\n}\r\n/**\r\n * Concatenates one or more values together and converts them to a Blob.\r\n *\r\n * @param args The values that will make up the resulting blob.\r\n * @return The blob.\r\n */\r\nfunction getBlob() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var BlobBuilder = getBlobBuilder();\r\n if (BlobBuilder !== undefined) {\r\n var bb = new BlobBuilder();\r\n for (var i = 0; i < args.length; i++) {\r\n bb.append(args[i]);\r\n }\r\n return bb.getBlob();\r\n }\r\n else {\r\n if (isNativeBlobDefined()) {\r\n return new Blob(args);\r\n }\r\n else {\r\n throw Error(\"This browser doesn't seem to support creating Blobs\");\r\n }\r\n }\r\n}\r\n/**\r\n * Slices the blob. The returned blob contains data from the start byte\r\n * (inclusive) till the end byte (exclusive). Negative indices cannot be used.\r\n *\r\n * @param blob The blob to be sliced.\r\n * @param start Index of the starting byte.\r\n * @param end Index of the ending byte.\r\n * @return The blob slice or null if not supported.\r\n */\r\nfunction sliceBlob(blob, start, end) {\r\n if (blob.webkitSlice) {\r\n return blob.webkitSlice(start, end);\r\n }\r\n else if (blob.mozSlice) {\r\n return blob.mozSlice(start, end);\r\n }\r\n else if (blob.slice) {\r\n return blob.slice(start, end);\r\n }\r\n return null;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @param opt_elideCopy If true, doesn't copy mutable input data\r\n * (e.g. Uint8Arrays). Pass true only if you know the objects will not be\r\n * modified after this blob's construction.\r\n */\r\nvar FbsBlob = /** @class */ (function () {\r\n function FbsBlob(data, elideCopy) {\r\n var size = 0;\r\n var blobType = '';\r\n if (isNativeBlob(data)) {\r\n this.data_ = data;\r\n size = data.size;\r\n blobType = data.type;\r\n }\r\n else if (data instanceof ArrayBuffer) {\r\n if (elideCopy) {\r\n this.data_ = new Uint8Array(data);\r\n }\r\n else {\r\n this.data_ = new Uint8Array(data.byteLength);\r\n this.data_.set(new Uint8Array(data));\r\n }\r\n size = this.data_.length;\r\n }\r\n else if (data instanceof Uint8Array) {\r\n if (elideCopy) {\r\n this.data_ = data;\r\n }\r\n else {\r\n this.data_ = new Uint8Array(data.length);\r\n this.data_.set(data);\r\n }\r\n size = data.length;\r\n }\r\n this.size_ = size;\r\n this.type_ = blobType;\r\n }\r\n FbsBlob.prototype.size = function () {\r\n return this.size_;\r\n };\r\n FbsBlob.prototype.type = function () {\r\n return this.type_;\r\n };\r\n FbsBlob.prototype.slice = function (startByte, endByte) {\r\n if (isNativeBlob(this.data_)) {\r\n var realBlob = this.data_;\r\n var sliced = sliceBlob(realBlob, startByte, endByte);\r\n if (sliced === null) {\r\n return null;\r\n }\r\n return new FbsBlob(sliced);\r\n }\r\n else {\r\n var slice = new Uint8Array(this.data_.buffer, startByte, endByte - startByte);\r\n return new FbsBlob(slice, true);\r\n }\r\n };\r\n FbsBlob.getBlob = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (isNativeBlobDefined()) {\r\n var blobby = args.map(function (val) {\r\n if (val instanceof FbsBlob) {\r\n return val.data_;\r\n }\r\n else {\r\n return val;\r\n }\r\n });\r\n return new FbsBlob(getBlob.apply(null, blobby));\r\n }\r\n else {\r\n var uint8Arrays = args.map(function (val) {\r\n if (isString(val)) {\r\n return dataFromString(StringFormat.RAW, val).data;\r\n }\r\n else {\r\n // Blobs don't exist, so this has to be a Uint8Array.\r\n return val.data_;\r\n }\r\n });\r\n var finalLength_1 = 0;\r\n uint8Arrays.forEach(function (array) {\r\n finalLength_1 += array.byteLength;\r\n });\r\n var merged_1 = new Uint8Array(finalLength_1);\r\n var index_1 = 0;\r\n uint8Arrays.forEach(function (array) {\r\n for (var i = 0; i < array.length; i++) {\r\n merged_1[index_1++] = array[i];\r\n }\r\n });\r\n return new FbsBlob(merged_1, true);\r\n }\r\n };\r\n FbsBlob.prototype.uploadData = function () {\r\n return this.data_;\r\n };\r\n return FbsBlob;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @struct\r\n */\r\nvar Location = /** @class */ (function () {\r\n function Location(bucket, path) {\r\n this.bucket = bucket;\r\n this.path_ = path;\r\n }\r\n Object.defineProperty(Location.prototype, \"path\", {\r\n get: function () {\r\n return this.path_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Location.prototype, \"isRoot\", {\r\n get: function () {\r\n return this.path.length === 0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Location.prototype.fullServerUrl = function () {\r\n var encode = encodeURIComponent;\r\n return '/b/' + encode(this.bucket) + '/o/' + encode(this.path);\r\n };\r\n Location.prototype.bucketOnlyServerUrl = function () {\r\n var encode = encodeURIComponent;\r\n return '/b/' + encode(this.bucket) + '/o';\r\n };\r\n Location.makeFromBucketSpec = function (bucketString) {\r\n var bucketLocation;\r\n try {\r\n bucketLocation = Location.makeFromUrl(bucketString);\r\n }\r\n catch (e) {\r\n // Not valid URL, use as-is. This lets you put bare bucket names in\r\n // config.\r\n return new Location(bucketString, '');\r\n }\r\n if (bucketLocation.path === '') {\r\n return bucketLocation;\r\n }\r\n else {\r\n throw invalidDefaultBucket(bucketString);\r\n }\r\n };\r\n Location.makeFromUrl = function (url) {\r\n var location = null;\r\n var bucketDomain = '([A-Za-z0-9.\\\\-_]+)';\r\n function gsModify(loc) {\r\n if (loc.path.charAt(loc.path.length - 1) === '/') {\r\n loc.path_ = loc.path_.slice(0, -1);\r\n }\r\n }\r\n var gsPath = '(/(.*))?$';\r\n var gsRegex = new RegExp('^gs://' + bucketDomain + gsPath, 'i');\r\n var gsIndices = { bucket: 1, path: 3 };\r\n function httpModify(loc) {\r\n loc.path_ = decodeURIComponent(loc.path);\r\n }\r\n var version = 'v[A-Za-z0-9_]+';\r\n var firebaseStorageHost = DEFAULT_HOST.replace(/[.]/g, '\\\\.');\r\n var firebaseStoragePath = '(/([^?#]*).*)?$';\r\n var firebaseStorageRegExp = new RegExp(\"^https?://\" + firebaseStorageHost + \"/\" + version + \"/b/\" + bucketDomain + \"/o\" + firebaseStoragePath, 'i');\r\n var firebaseStorageIndices = { bucket: 1, path: 3 };\r\n var cloudStorageHost = '(?:storage.googleapis.com|storage.cloud.google.com)';\r\n var cloudStoragePath = '([^?#]*)';\r\n var cloudStorageRegExp = new RegExp(\"^https?://\" + cloudStorageHost + \"/\" + bucketDomain + \"/\" + cloudStoragePath, 'i');\r\n var cloudStorageIndices = { bucket: 1, path: 2 };\r\n var groups = [\r\n { regex: gsRegex, indices: gsIndices, postModify: gsModify },\r\n {\r\n regex: firebaseStorageRegExp,\r\n indices: firebaseStorageIndices,\r\n postModify: httpModify\r\n },\r\n {\r\n regex: cloudStorageRegExp,\r\n indices: cloudStorageIndices,\r\n postModify: httpModify\r\n }\r\n ];\r\n for (var i = 0; i < groups.length; i++) {\r\n var group = groups[i];\r\n var captures = group.regex.exec(url);\r\n if (captures) {\r\n var bucketValue = captures[group.indices.bucket];\r\n var pathValue = captures[group.indices.path];\r\n if (!pathValue) {\r\n pathValue = '';\r\n }\r\n location = new Location(bucketValue, pathValue);\r\n group.postModify(location);\r\n break;\r\n }\r\n }\r\n if (location == null) {\r\n throw invalidUrl(url);\r\n }\r\n return location;\r\n };\r\n return Location;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns the Object resulting from parsing the given JSON, or null if the\r\n * given string does not represent a JSON object.\r\n */\r\nfunction jsonObjectOrNull(s) {\r\n var obj;\r\n try {\r\n obj = JSON.parse(s);\r\n }\r\n catch (e) {\r\n return null;\r\n }\r\n if (isNonArrayObject(obj)) {\r\n return obj;\r\n }\r\n else {\r\n return null;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @fileoverview Contains helper methods for manipulating paths.\r\n */\r\n/**\r\n * @return Null if the path is already at the root.\r\n */\r\nfunction parent(path) {\r\n if (path.length === 0) {\r\n return null;\r\n }\r\n var index = path.lastIndexOf('/');\r\n if (index === -1) {\r\n return '';\r\n }\r\n var newPath = path.slice(0, index);\r\n return newPath;\r\n}\r\nfunction child(path, childPath) {\r\n var canonicalChildPath = childPath\r\n .split('/')\r\n .filter(function (component) { return component.length > 0; })\r\n .join('/');\r\n if (path.length === 0) {\r\n return canonicalChildPath;\r\n }\r\n else {\r\n return path + '/' + canonicalChildPath;\r\n }\r\n}\r\n/**\r\n * Returns the last component of a path.\r\n * '/foo/bar' -> 'bar'\r\n * '/foo/bar/baz/' -> 'baz/'\r\n * '/a' -> 'a'\r\n */\r\nfunction lastComponent(path) {\r\n var index = path.lastIndexOf('/', path.length - 2);\r\n if (index === -1) {\r\n return path;\r\n }\r\n else {\r\n return path.slice(index + 1);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction makeUrl(urlPart) {\r\n return \"https://\" + DEFAULT_HOST + \"/v0\" + urlPart;\r\n}\r\nfunction makeQueryString(params) {\r\n var encode = encodeURIComponent;\r\n var queryPart = '?';\r\n for (var key in params) {\r\n if (params.hasOwnProperty(key)) {\r\n // @ts-ignore TODO: remove once typescript is upgraded to 3.5.x\r\n var nextPart = encode(key) + '=' + encode(params[key]);\r\n queryPart = queryPart + nextPart + '&';\r\n }\r\n }\r\n // Chop off the extra '&' or '?' on the end\r\n queryPart = queryPart.slice(0, -1);\r\n return queryPart;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction noXform_(metadata, value) {\r\n return value;\r\n}\r\n/**\r\n * @struct\r\n */\r\nvar Mapping = /** @class */ (function () {\r\n function Mapping(server, local, writable, xform) {\r\n this.server = server;\r\n this.local = local || server;\r\n this.writable = !!writable;\r\n this.xform = xform || noXform_;\r\n }\r\n return Mapping;\r\n}());\r\nvar mappings_ = null;\r\nfunction xformPath(fullPath) {\r\n if (!isString(fullPath) || fullPath.length < 2) {\r\n return fullPath;\r\n }\r\n else {\r\n return lastComponent(fullPath);\r\n }\r\n}\r\nfunction getMappings() {\r\n if (mappings_) {\r\n return mappings_;\r\n }\r\n var mappings = [];\r\n mappings.push(new Mapping('bucket'));\r\n mappings.push(new Mapping('generation'));\r\n mappings.push(new Mapping('metageneration'));\r\n mappings.push(new Mapping('name', 'fullPath', true));\r\n function mappingsXformPath(_metadata, fullPath) {\r\n return xformPath(fullPath);\r\n }\r\n var nameMapping = new Mapping('name');\r\n nameMapping.xform = mappingsXformPath;\r\n mappings.push(nameMapping);\r\n /**\r\n * Coerces the second param to a number, if it is defined.\r\n */\r\n function xformSize(_metadata, size) {\r\n if (isDef(size)) {\r\n return Number(size);\r\n }\r\n else {\r\n return size;\r\n }\r\n }\r\n var sizeMapping = new Mapping('size');\r\n sizeMapping.xform = xformSize;\r\n mappings.push(sizeMapping);\r\n mappings.push(new Mapping('timeCreated'));\r\n mappings.push(new Mapping('updated'));\r\n mappings.push(new Mapping('md5Hash', null, true));\r\n mappings.push(new Mapping('cacheControl', null, true));\r\n mappings.push(new Mapping('contentDisposition', null, true));\r\n mappings.push(new Mapping('contentEncoding', null, true));\r\n mappings.push(new Mapping('contentLanguage', null, true));\r\n mappings.push(new Mapping('contentType', null, true));\r\n mappings.push(new Mapping('metadata', 'customMetadata', true));\r\n mappings_ = mappings;\r\n return mappings_;\r\n}\r\nfunction addRef(metadata, service) {\r\n function generateRef() {\r\n var bucket = metadata['bucket'];\r\n var path = metadata['fullPath'];\r\n var loc = new Location(bucket, path);\r\n return service.makeStorageReference(loc);\r\n }\r\n Object.defineProperty(metadata, 'ref', { get: generateRef });\r\n}\r\nfunction fromResource(service, resource, mappings) {\r\n var metadata = {};\r\n metadata['type'] = 'file';\r\n var len = mappings.length;\r\n for (var i = 0; i < len; i++) {\r\n var mapping = mappings[i];\r\n metadata[mapping.local] = mapping.xform(metadata, resource[mapping.server]);\r\n }\r\n addRef(metadata, service);\r\n return metadata;\r\n}\r\nfunction fromResourceString(service, resourceString, mappings) {\r\n var obj = jsonObjectOrNull(resourceString);\r\n if (obj === null) {\r\n return null;\r\n }\r\n var resource = obj;\r\n return fromResource(service, resource, mappings);\r\n}\r\nfunction downloadUrlFromResourceString(metadata, resourceString) {\r\n var obj = jsonObjectOrNull(resourceString);\r\n if (obj === null) {\r\n return null;\r\n }\r\n if (!isString(obj['downloadTokens'])) {\r\n // This can happen if objects are uploaded through GCS and retrieved\r\n // through list, so we don't want to throw an Error.\r\n return null;\r\n }\r\n var tokens = obj['downloadTokens'];\r\n if (tokens.length === 0) {\r\n return null;\r\n }\r\n var encode = encodeURIComponent;\r\n var tokensList = tokens.split(',');\r\n var urls = tokensList.map(function (token) {\r\n var bucket = metadata['bucket'];\r\n var path = metadata['fullPath'];\r\n var urlPart = '/b/' + encode(bucket) + '/o/' + encode(path);\r\n var base = makeUrl(urlPart);\r\n var queryString = makeQueryString({\r\n alt: 'media',\r\n token: token\r\n });\r\n return base + queryString;\r\n });\r\n return urls[0];\r\n}\r\nfunction toResourceString(metadata, mappings) {\r\n var resource = {};\r\n var len = mappings.length;\r\n for (var i = 0; i < len; i++) {\r\n var mapping = mappings[i];\r\n if (mapping.writable) {\r\n resource[mapping.server] = metadata[mapping.local];\r\n }\r\n }\r\n return JSON.stringify(resource);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar PREFIXES_KEY = 'prefixes';\r\nvar ITEMS_KEY = 'items';\r\nfunction fromBackendResponse(service, bucket, resource) {\r\n var listResult = {\r\n prefixes: [],\r\n items: [],\r\n nextPageToken: resource['nextPageToken']\r\n };\r\n if (resource[PREFIXES_KEY]) {\r\n for (var _i = 0, _a = resource[PREFIXES_KEY]; _i < _a.length; _i++) {\r\n var path = _a[_i];\r\n var pathWithoutTrailingSlash = path.replace(/\\/$/, '');\r\n var reference = service.makeStorageReference(new Location(bucket, pathWithoutTrailingSlash));\r\n listResult.prefixes.push(reference);\r\n }\r\n }\r\n if (resource[ITEMS_KEY]) {\r\n for (var _b = 0, _c = resource[ITEMS_KEY]; _b < _c.length; _b++) {\r\n var item = _c[_b];\r\n var reference = service.makeStorageReference(new Location(bucket, item['name']));\r\n listResult.items.push(reference);\r\n }\r\n }\r\n return listResult;\r\n}\r\nfunction fromResponseString(service, bucket, resourceString) {\r\n var obj = jsonObjectOrNull(resourceString);\r\n if (obj === null) {\r\n return null;\r\n }\r\n var resource = obj;\r\n return fromBackendResponse(service, bucket, resource);\r\n}\n\nvar RequestInfo = /** @class */ (function () {\r\n function RequestInfo(url, method, \r\n /**\r\n * Returns the value with which to resolve the request's promise. Only called\r\n * if the request is successful. Throw from this function to reject the\r\n * returned Request's promise with the thrown error.\r\n * Note: The XhrIo passed to this function may be reused after this callback\r\n * returns. Do not keep a reference to it in any way.\r\n */\r\n handler, timeout) {\r\n this.url = url;\r\n this.method = method;\r\n this.handler = handler;\r\n this.timeout = timeout;\r\n this.urlParams = {};\r\n this.headers = {};\r\n this.body = null;\r\n this.errorHandler = null;\r\n /**\r\n * Called with the current number of bytes uploaded and total size (-1 if not\r\n * computable) of the request body (i.e. used to report upload progress).\r\n */\r\n this.progressCallback = null;\r\n this.successCodes = [200];\r\n this.additionalRetryCodes = [];\r\n }\r\n return RequestInfo;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Throws the UNKNOWN FirebaseStorageError if cndn is false.\r\n */\r\nfunction handlerCheck(cndn) {\r\n if (!cndn) {\r\n throw unknown();\r\n }\r\n}\r\nfunction metadataHandler(service, mappings) {\r\n function handler(xhr, text) {\r\n var metadata = fromResourceString(service, text, mappings);\r\n handlerCheck(metadata !== null);\r\n return metadata;\r\n }\r\n return handler;\r\n}\r\nfunction listHandler(service, bucket) {\r\n function handler(xhr, text) {\r\n var listResult = fromResponseString(service, bucket, text);\r\n handlerCheck(listResult !== null);\r\n return listResult;\r\n }\r\n return handler;\r\n}\r\nfunction downloadUrlHandler(service, mappings) {\r\n function handler(xhr, text) {\r\n var metadata = fromResourceString(service, text, mappings);\r\n handlerCheck(metadata !== null);\r\n return downloadUrlFromResourceString(metadata, text);\r\n }\r\n return handler;\r\n}\r\nfunction sharedErrorHandler(location) {\r\n function errorHandler(xhr, err) {\r\n var newErr;\r\n if (xhr.getStatus() === 401) {\r\n newErr = unauthenticated();\r\n }\r\n else {\r\n if (xhr.getStatus() === 402) {\r\n newErr = quotaExceeded(location.bucket);\r\n }\r\n else {\r\n if (xhr.getStatus() === 403) {\r\n newErr = unauthorized(location.path);\r\n }\r\n else {\r\n newErr = err;\r\n }\r\n }\r\n }\r\n newErr.serverResponse = err.serverResponse;\r\n return newErr;\r\n }\r\n return errorHandler;\r\n}\r\nfunction objectErrorHandler(location) {\r\n var shared = sharedErrorHandler(location);\r\n function errorHandler(xhr, err) {\r\n var newErr = shared(xhr, err);\r\n if (xhr.getStatus() === 404) {\r\n newErr = objectNotFound(location.path);\r\n }\r\n newErr.serverResponse = err.serverResponse;\r\n return newErr;\r\n }\r\n return errorHandler;\r\n}\r\nfunction getMetadata(service, location, mappings) {\r\n var urlPart = location.fullServerUrl();\r\n var url = makeUrl(urlPart);\r\n var method = 'GET';\r\n var timeout = service.maxOperationRetryTime;\r\n var requestInfo = new RequestInfo(url, method, metadataHandler(service, mappings), timeout);\r\n requestInfo.errorHandler = objectErrorHandler(location);\r\n return requestInfo;\r\n}\r\nfunction list(service, location, delimiter, pageToken, maxResults) {\r\n var urlParams = {};\r\n if (location.isRoot) {\r\n urlParams['prefix'] = '';\r\n }\r\n else {\r\n urlParams['prefix'] = location.path + '/';\r\n }\r\n if (delimiter && delimiter.length > 0) {\r\n urlParams['delimiter'] = delimiter;\r\n }\r\n if (pageToken) {\r\n urlParams['pageToken'] = pageToken;\r\n }\r\n if (maxResults) {\r\n urlParams['maxResults'] = maxResults;\r\n }\r\n var urlPart = location.bucketOnlyServerUrl();\r\n var url = makeUrl(urlPart);\r\n var method = 'GET';\r\n var timeout = service.maxOperationRetryTime;\r\n var requestInfo = new RequestInfo(url, method, listHandler(service, location.bucket), timeout);\r\n requestInfo.urlParams = urlParams;\r\n requestInfo.errorHandler = sharedErrorHandler(location);\r\n return requestInfo;\r\n}\r\nfunction getDownloadUrl(service, location, mappings) {\r\n var urlPart = location.fullServerUrl();\r\n var url = makeUrl(urlPart);\r\n var method = 'GET';\r\n var timeout = service.maxOperationRetryTime;\r\n var requestInfo = new RequestInfo(url, method, downloadUrlHandler(service, mappings), timeout);\r\n requestInfo.errorHandler = objectErrorHandler(location);\r\n return requestInfo;\r\n}\r\nfunction updateMetadata(service, location, metadata, mappings) {\r\n var urlPart = location.fullServerUrl();\r\n var url = makeUrl(urlPart);\r\n var method = 'PATCH';\r\n var body = toResourceString(metadata, mappings);\r\n var headers = { 'Content-Type': 'application/json; charset=utf-8' };\r\n var timeout = service.maxOperationRetryTime;\r\n var requestInfo = new RequestInfo(url, method, metadataHandler(service, mappings), timeout);\r\n requestInfo.headers = headers;\r\n requestInfo.body = body;\r\n requestInfo.errorHandler = objectErrorHandler(location);\r\n return requestInfo;\r\n}\r\nfunction deleteObject(service, location) {\r\n var urlPart = location.fullServerUrl();\r\n var url = makeUrl(urlPart);\r\n var method = 'DELETE';\r\n var timeout = service.maxOperationRetryTime;\r\n function handler(_xhr, _text) { }\r\n var requestInfo = new RequestInfo(url, method, handler, timeout);\r\n requestInfo.successCodes = [200, 204];\r\n requestInfo.errorHandler = objectErrorHandler(location);\r\n return requestInfo;\r\n}\r\nfunction determineContentType_(metadata, blob) {\r\n return ((metadata && metadata['contentType']) ||\r\n (blob && blob.type()) ||\r\n 'application/octet-stream');\r\n}\r\nfunction metadataForUpload_(location, blob, metadata) {\r\n var metadataClone = Object.assign({}, metadata);\r\n metadataClone['fullPath'] = location.path;\r\n metadataClone['size'] = blob.size();\r\n if (!metadataClone['contentType']) {\r\n metadataClone['contentType'] = determineContentType_(null, blob);\r\n }\r\n return metadataClone;\r\n}\r\nfunction multipartUpload(service, location, mappings, blob, metadata) {\r\n var urlPart = location.bucketOnlyServerUrl();\r\n var headers = {\r\n 'X-Goog-Upload-Protocol': 'multipart'\r\n };\r\n function genBoundary() {\r\n var str = '';\r\n for (var i = 0; i < 2; i++) {\r\n str = str + Math.random().toString().slice(2);\r\n }\r\n return str;\r\n }\r\n var boundary = genBoundary();\r\n headers['Content-Type'] = 'multipart/related; boundary=' + boundary;\r\n var metadata_ = metadataForUpload_(location, blob, metadata);\r\n var metadataString = toResourceString(metadata_, mappings);\r\n var preBlobPart = '--' +\r\n boundary +\r\n '\\r\\n' +\r\n 'Content-Type: application/json; charset=utf-8\\r\\n\\r\\n' +\r\n metadataString +\r\n '\\r\\n--' +\r\n boundary +\r\n '\\r\\n' +\r\n 'Content-Type: ' +\r\n metadata_['contentType'] +\r\n '\\r\\n\\r\\n';\r\n var postBlobPart = '\\r\\n--' + boundary + '--';\r\n var body = FbsBlob.getBlob(preBlobPart, blob, postBlobPart);\r\n if (body === null) {\r\n throw cannotSliceBlob();\r\n }\r\n var urlParams = { name: metadata_['fullPath'] };\r\n var url = makeUrl(urlPart);\r\n var method = 'POST';\r\n var timeout = service.maxUploadRetryTime;\r\n var requestInfo = new RequestInfo(url, method, metadataHandler(service, mappings), timeout);\r\n requestInfo.urlParams = urlParams;\r\n requestInfo.headers = headers;\r\n requestInfo.body = body.uploadData();\r\n requestInfo.errorHandler = sharedErrorHandler(location);\r\n return requestInfo;\r\n}\r\n/**\r\n * @param current The number of bytes that have been uploaded so far.\r\n * @param total The total number of bytes in the upload.\r\n * @param opt_finalized True if the server has finished the upload.\r\n * @param opt_metadata The upload metadata, should\r\n * only be passed if opt_finalized is true.\r\n * @struct\r\n */\r\nvar ResumableUploadStatus = /** @class */ (function () {\r\n function ResumableUploadStatus(current, total, finalized, metadata) {\r\n this.current = current;\r\n this.total = total;\r\n this.finalized = !!finalized;\r\n this.metadata = metadata || null;\r\n }\r\n return ResumableUploadStatus;\r\n}());\r\nfunction checkResumeHeader_(xhr, allowed) {\r\n var status = null;\r\n try {\r\n status = xhr.getResponseHeader('X-Goog-Upload-Status');\r\n }\r\n catch (e) {\r\n handlerCheck(false);\r\n }\r\n var allowedStatus = allowed || ['active'];\r\n handlerCheck(!!status && allowedStatus.indexOf(status) !== -1);\r\n return status;\r\n}\r\nfunction createResumableUpload(service, location, mappings, blob, metadata) {\r\n var urlPart = location.bucketOnlyServerUrl();\r\n var metadataForUpload = metadataForUpload_(location, blob, metadata);\r\n var urlParams = { name: metadataForUpload['fullPath'] };\r\n var url = makeUrl(urlPart);\r\n var method = 'POST';\r\n var headers = {\r\n 'X-Goog-Upload-Protocol': 'resumable',\r\n 'X-Goog-Upload-Command': 'start',\r\n 'X-Goog-Upload-Header-Content-Length': blob.size(),\r\n 'X-Goog-Upload-Header-Content-Type': metadataForUpload['contentType'],\r\n 'Content-Type': 'application/json; charset=utf-8'\r\n };\r\n var body = toResourceString(metadataForUpload, mappings);\r\n var timeout = service.maxUploadRetryTime;\r\n function handler(xhr) {\r\n checkResumeHeader_(xhr);\r\n var url;\r\n try {\r\n url = xhr.getResponseHeader('X-Goog-Upload-URL');\r\n }\r\n catch (e) {\r\n handlerCheck(false);\r\n }\r\n handlerCheck(isString(url));\r\n return url;\r\n }\r\n var requestInfo = new RequestInfo(url, method, handler, timeout);\r\n requestInfo.urlParams = urlParams;\r\n requestInfo.headers = headers;\r\n requestInfo.body = body;\r\n requestInfo.errorHandler = sharedErrorHandler(location);\r\n return requestInfo;\r\n}\r\n/**\r\n * @param url From a call to fbs.requests.createResumableUpload.\r\n */\r\nfunction getResumableUploadStatus(service, location, url, blob) {\r\n var headers = { 'X-Goog-Upload-Command': 'query' };\r\n function handler(xhr) {\r\n var status = checkResumeHeader_(xhr, ['active', 'final']);\r\n var sizeString = null;\r\n try {\r\n sizeString = xhr.getResponseHeader('X-Goog-Upload-Size-Received');\r\n }\r\n catch (e) {\r\n handlerCheck(false);\r\n }\r\n if (!sizeString) {\r\n // null or empty string\r\n handlerCheck(false);\r\n }\r\n var size = Number(sizeString);\r\n handlerCheck(!isNaN(size));\r\n return new ResumableUploadStatus(size, blob.size(), status === 'final');\r\n }\r\n var method = 'POST';\r\n var timeout = service.maxUploadRetryTime;\r\n var requestInfo = new RequestInfo(url, method, handler, timeout);\r\n requestInfo.headers = headers;\r\n requestInfo.errorHandler = sharedErrorHandler(location);\r\n return requestInfo;\r\n}\r\n/**\r\n * Any uploads via the resumable upload API must transfer a number of bytes\r\n * that is a multiple of this number.\r\n */\r\nvar resumableUploadChunkSize = 256 * 1024;\r\n/**\r\n * @param url From a call to fbs.requests.createResumableUpload.\r\n * @param chunkSize Number of bytes to upload.\r\n * @param status The previous status.\r\n * If not passed or null, we start from the beginning.\r\n * @throws fbs.Error If the upload is already complete, the passed in status\r\n * has a final size inconsistent with the blob, or the blob cannot be sliced\r\n * for upload.\r\n */\r\nfunction continueResumableUpload(location, service, url, blob, chunkSize, mappings, status, progressCallback) {\r\n // TODO(andysoto): standardize on internal asserts\r\n // assert(!(opt_status && opt_status.finalized));\r\n var status_ = new ResumableUploadStatus(0, 0);\r\n if (status) {\r\n status_.current = status.current;\r\n status_.total = status.total;\r\n }\r\n else {\r\n status_.current = 0;\r\n status_.total = blob.size();\r\n }\r\n if (blob.size() !== status_.total) {\r\n throw serverFileWrongSize();\r\n }\r\n var bytesLeft = status_.total - status_.current;\r\n var bytesToUpload = bytesLeft;\r\n if (chunkSize > 0) {\r\n bytesToUpload = Math.min(bytesToUpload, chunkSize);\r\n }\r\n var startByte = status_.current;\r\n var endByte = startByte + bytesToUpload;\r\n var uploadCommand = bytesToUpload === bytesLeft ? 'upload, finalize' : 'upload';\r\n var headers = {\r\n 'X-Goog-Upload-Command': uploadCommand,\r\n 'X-Goog-Upload-Offset': status_.current\r\n };\r\n var body = blob.slice(startByte, endByte);\r\n if (body === null) {\r\n throw cannotSliceBlob();\r\n }\r\n function handler(xhr, text) {\r\n // TODO(andysoto): Verify the MD5 of each uploaded range:\r\n // the 'x-range-md5' header comes back with status code 308 responses.\r\n // We'll only be able to bail out though, because you can't re-upload a\r\n // range that you previously uploaded.\r\n var uploadStatus = checkResumeHeader_(xhr, ['active', 'final']);\r\n var newCurrent = status_.current + bytesToUpload;\r\n var size = blob.size();\r\n var metadata;\r\n if (uploadStatus === 'final') {\r\n metadata = metadataHandler(service, mappings)(xhr, text);\r\n }\r\n else {\r\n metadata = null;\r\n }\r\n return new ResumableUploadStatus(newCurrent, size, uploadStatus === 'final', metadata);\r\n }\r\n var method = 'POST';\r\n var timeout = service.maxUploadRetryTime;\r\n var requestInfo = new RequestInfo(url, method, handler, timeout);\r\n requestInfo.headers = headers;\r\n requestInfo.body = body.uploadData();\r\n requestInfo.progressCallback = progressCallback || null;\r\n requestInfo.errorHandler = sharedErrorHandler(location);\r\n return requestInfo;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @struct\r\n */\r\nvar Observer = /** @class */ (function () {\r\n function Observer(nextOrObserver, error, complete) {\r\n var asFunctions = isFunction(nextOrObserver) ||\r\n isDef(error) ||\r\n isDef(complete);\r\n if (asFunctions) {\r\n this.next = nextOrObserver;\r\n this.error = error || null;\r\n this.complete = complete || null;\r\n }\r\n else {\r\n var observer = nextOrObserver;\r\n this.next = observer.next || null;\r\n this.error = observer.error || null;\r\n this.complete = observer.complete || null;\r\n }\r\n }\r\n return Observer;\r\n}());\n\nvar UploadTaskSnapshot = /** @class */ (function () {\r\n function UploadTaskSnapshot(bytesTransferred, totalBytes, state, metadata, task, ref) {\r\n this.bytesTransferred = bytesTransferred;\r\n this.totalBytes = totalBytes;\r\n this.state = state;\r\n this.metadata = metadata;\r\n this.task = task;\r\n this.ref = ref;\r\n }\r\n return UploadTaskSnapshot;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns a function that invokes f with its arguments asynchronously as a\r\n * microtask, i.e. as soon as possible after the current script returns back\r\n * into browser code.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/ban-types\r\nfunction async(f) {\r\n return function () {\r\n var argsToForward = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n argsToForward[_i] = arguments[_i];\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n Promise.resolve().then(function () { return f.apply(void 0, argsToForward); });\r\n };\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Represents a blob being uploaded. Can be used to pause/resume/cancel the\r\n * upload and manage callbacks for various events.\r\n */\r\nvar UploadTask = /** @class */ (function () {\r\n /**\r\n * @param ref The firebaseStorage.Reference object this task came\r\n * from, untyped to avoid cyclic dependencies.\r\n * @param blob The blob to upload.\r\n */\r\n function UploadTask(ref, service, location, mappings, blob, metadata) {\r\n var _this = this;\r\n if (metadata === void 0) { metadata = null; }\r\n this.transferred_ = 0;\r\n this.needToFetchStatus_ = false;\r\n this.needToFetchMetadata_ = false;\r\n this.observers_ = [];\r\n this.error_ = null;\r\n this.uploadUrl_ = null;\r\n this.request_ = null;\r\n this.chunkMultiplier_ = 1;\r\n this.resolve_ = null;\r\n this.reject_ = null;\r\n this.ref_ = ref;\r\n this.service_ = service;\r\n this.location_ = location;\r\n this.blob_ = blob;\r\n this.metadata_ = metadata;\r\n this.mappings_ = mappings;\r\n this.resumable_ = this.shouldDoResumable_(this.blob_);\r\n this.state_ = InternalTaskState.RUNNING;\r\n this.errorHandler_ = function (error) {\r\n _this.request_ = null;\r\n _this.chunkMultiplier_ = 1;\r\n if (error.codeEquals(Code.CANCELED)) {\r\n _this.needToFetchStatus_ = true;\r\n _this.completeTransitions_();\r\n }\r\n else {\r\n _this.error_ = error;\r\n _this.transition_(InternalTaskState.ERROR);\r\n }\r\n };\r\n this.metadataErrorHandler_ = function (error) {\r\n _this.request_ = null;\r\n if (error.codeEquals(Code.CANCELED)) {\r\n _this.completeTransitions_();\r\n }\r\n else {\r\n _this.error_ = error;\r\n _this.transition_(InternalTaskState.ERROR);\r\n }\r\n };\r\n this.promise_ = new Promise(function (resolve, reject) {\r\n _this.resolve_ = resolve;\r\n _this.reject_ = reject;\r\n _this.start_();\r\n });\r\n // Prevent uncaught rejections on the internal promise from bubbling out\r\n // to the top level with a dummy handler.\r\n this.promise_.then(null, function () { });\r\n }\r\n UploadTask.prototype.makeProgressCallback_ = function () {\r\n var _this = this;\r\n var sizeBefore = this.transferred_;\r\n return function (loaded) { return _this.updateProgress_(sizeBefore + loaded); };\r\n };\r\n UploadTask.prototype.shouldDoResumable_ = function (blob) {\r\n return blob.size() > 256 * 1024;\r\n };\r\n UploadTask.prototype.start_ = function () {\r\n if (this.state_ !== InternalTaskState.RUNNING) {\r\n // This can happen if someone pauses us in a resume callback, for example.\r\n return;\r\n }\r\n if (this.request_ !== null) {\r\n return;\r\n }\r\n if (this.resumable_) {\r\n if (this.uploadUrl_ === null) {\r\n this.createResumable_();\r\n }\r\n else {\r\n if (this.needToFetchStatus_) {\r\n this.fetchStatus_();\r\n }\r\n else {\r\n if (this.needToFetchMetadata_) {\r\n // Happens if we miss the metadata on upload completion.\r\n this.fetchMetadata_();\r\n }\r\n else {\r\n this.continueUpload_();\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n this.oneShotUpload_();\r\n }\r\n };\r\n UploadTask.prototype.resolveToken_ = function (callback) {\r\n var _this = this;\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.service_.getAuthToken().then(function (authToken) {\r\n switch (_this.state_) {\r\n case InternalTaskState.RUNNING:\r\n callback(authToken);\r\n break;\r\n case InternalTaskState.CANCELING:\r\n _this.transition_(InternalTaskState.CANCELED);\r\n break;\r\n case InternalTaskState.PAUSING:\r\n _this.transition_(InternalTaskState.PAUSED);\r\n break;\r\n }\r\n });\r\n };\r\n // TODO(andysoto): assert false\r\n UploadTask.prototype.createResumable_ = function () {\r\n var _this = this;\r\n this.resolveToken_(function (authToken) {\r\n var requestInfo = createResumableUpload(_this.service_, _this.location_, _this.mappings_, _this.blob_, _this.metadata_);\r\n var createRequest = _this.service_.makeRequest(requestInfo, authToken);\r\n _this.request_ = createRequest;\r\n createRequest.getPromise().then(function (url) {\r\n _this.request_ = null;\r\n _this.uploadUrl_ = url;\r\n _this.needToFetchStatus_ = false;\r\n _this.completeTransitions_();\r\n }, _this.errorHandler_);\r\n });\r\n };\r\n UploadTask.prototype.fetchStatus_ = function () {\r\n var _this = this;\r\n // TODO(andysoto): assert(this.uploadUrl_ !== null);\r\n var url = this.uploadUrl_;\r\n this.resolveToken_(function (authToken) {\r\n var requestInfo = getResumableUploadStatus(_this.service_, _this.location_, url, _this.blob_);\r\n var statusRequest = _this.service_.makeRequest(requestInfo, authToken);\r\n _this.request_ = statusRequest;\r\n statusRequest.getPromise().then(function (status) {\r\n status = status;\r\n _this.request_ = null;\r\n _this.updateProgress_(status.current);\r\n _this.needToFetchStatus_ = false;\r\n if (status.finalized) {\r\n _this.needToFetchMetadata_ = true;\r\n }\r\n _this.completeTransitions_();\r\n }, _this.errorHandler_);\r\n });\r\n };\r\n UploadTask.prototype.continueUpload_ = function () {\r\n var _this = this;\r\n var chunkSize = resumableUploadChunkSize * this.chunkMultiplier_;\r\n var status = new ResumableUploadStatus(this.transferred_, this.blob_.size());\r\n // TODO(andysoto): assert(this.uploadUrl_ !== null);\r\n var url = this.uploadUrl_;\r\n this.resolveToken_(function (authToken) {\r\n var requestInfo;\r\n try {\r\n requestInfo = continueResumableUpload(_this.location_, _this.service_, url, _this.blob_, chunkSize, _this.mappings_, status, _this.makeProgressCallback_());\r\n }\r\n catch (e) {\r\n _this.error_ = e;\r\n _this.transition_(InternalTaskState.ERROR);\r\n return;\r\n }\r\n var uploadRequest = _this.service_.makeRequest(requestInfo, authToken);\r\n _this.request_ = uploadRequest;\r\n uploadRequest\r\n .getPromise()\r\n .then(function (newStatus) {\r\n _this.increaseMultiplier_();\r\n _this.request_ = null;\r\n _this.updateProgress_(newStatus.current);\r\n if (newStatus.finalized) {\r\n _this.metadata_ = newStatus.metadata;\r\n _this.transition_(InternalTaskState.SUCCESS);\r\n }\r\n else {\r\n _this.completeTransitions_();\r\n }\r\n }, _this.errorHandler_);\r\n });\r\n };\r\n UploadTask.prototype.increaseMultiplier_ = function () {\r\n var currentSize = resumableUploadChunkSize * this.chunkMultiplier_;\r\n // Max chunk size is 32M.\r\n if (currentSize < 32 * 1024 * 1024) {\r\n this.chunkMultiplier_ *= 2;\r\n }\r\n };\r\n UploadTask.prototype.fetchMetadata_ = function () {\r\n var _this = this;\r\n this.resolveToken_(function (authToken) {\r\n var requestInfo = getMetadata(_this.service_, _this.location_, _this.mappings_);\r\n var metadataRequest = _this.service_.makeRequest(requestInfo, authToken);\r\n _this.request_ = metadataRequest;\r\n metadataRequest.getPromise().then(function (metadata) {\r\n _this.request_ = null;\r\n _this.metadata_ = metadata;\r\n _this.transition_(InternalTaskState.SUCCESS);\r\n }, _this.metadataErrorHandler_);\r\n });\r\n };\r\n UploadTask.prototype.oneShotUpload_ = function () {\r\n var _this = this;\r\n this.resolveToken_(function (authToken) {\r\n var requestInfo = multipartUpload(_this.service_, _this.location_, _this.mappings_, _this.blob_, _this.metadata_);\r\n var multipartRequest = _this.service_.makeRequest(requestInfo, authToken);\r\n _this.request_ = multipartRequest;\r\n multipartRequest.getPromise().then(function (metadata) {\r\n _this.request_ = null;\r\n _this.metadata_ = metadata;\r\n _this.updateProgress_(_this.blob_.size());\r\n _this.transition_(InternalTaskState.SUCCESS);\r\n }, _this.errorHandler_);\r\n });\r\n };\r\n UploadTask.prototype.updateProgress_ = function (transferred) {\r\n var old = this.transferred_;\r\n this.transferred_ = transferred;\r\n // A progress update can make the \"transferred\" value smaller (e.g. a\r\n // partial upload not completed by server, after which the \"transferred\"\r\n // value may reset to the value at the beginning of the request).\r\n if (this.transferred_ !== old) {\r\n this.notifyObservers_();\r\n }\r\n };\r\n UploadTask.prototype.transition_ = function (state) {\r\n if (this.state_ === state) {\r\n return;\r\n }\r\n switch (state) {\r\n case InternalTaskState.CANCELING:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.RUNNING ||\r\n // this.state_ === InternalTaskState.PAUSING);\r\n this.state_ = state;\r\n if (this.request_ !== null) {\r\n this.request_.cancel();\r\n }\r\n break;\r\n case InternalTaskState.PAUSING:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.RUNNING);\r\n this.state_ = state;\r\n if (this.request_ !== null) {\r\n this.request_.cancel();\r\n }\r\n break;\r\n case InternalTaskState.RUNNING:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.PAUSED ||\r\n // this.state_ === InternalTaskState.PAUSING);\r\n var wasPaused = this.state_ === InternalTaskState.PAUSED;\r\n this.state_ = state;\r\n if (wasPaused) {\r\n this.notifyObservers_();\r\n this.start_();\r\n }\r\n break;\r\n case InternalTaskState.PAUSED:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.PAUSING);\r\n this.state_ = state;\r\n this.notifyObservers_();\r\n break;\r\n case InternalTaskState.CANCELED:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.PAUSED ||\r\n // this.state_ === InternalTaskState.CANCELING);\r\n this.error_ = canceled();\r\n this.state_ = state;\r\n this.notifyObservers_();\r\n break;\r\n case InternalTaskState.ERROR:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.RUNNING ||\r\n // this.state_ === InternalTaskState.PAUSING ||\r\n // this.state_ === InternalTaskState.CANCELING);\r\n this.state_ = state;\r\n this.notifyObservers_();\r\n break;\r\n case InternalTaskState.SUCCESS:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.RUNNING ||\r\n // this.state_ === InternalTaskState.PAUSING ||\r\n // this.state_ === InternalTaskState.CANCELING);\r\n this.state_ = state;\r\n this.notifyObservers_();\r\n break;\r\n }\r\n };\r\n UploadTask.prototype.completeTransitions_ = function () {\r\n switch (this.state_) {\r\n case InternalTaskState.PAUSING:\r\n this.transition_(InternalTaskState.PAUSED);\r\n break;\r\n case InternalTaskState.CANCELING:\r\n this.transition_(InternalTaskState.CANCELED);\r\n break;\r\n case InternalTaskState.RUNNING:\r\n this.start_();\r\n break;\r\n }\r\n };\r\n Object.defineProperty(UploadTask.prototype, \"snapshot\", {\r\n get: function () {\r\n var externalState = taskStateFromInternalTaskState(this.state_);\r\n return new UploadTaskSnapshot(this.transferred_, this.blob_.size(), externalState, this.metadata_, this, this.ref_);\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Adds a callback for an event.\r\n * @param type The type of event to listen for.\r\n */\r\n UploadTask.prototype.on = function (type, nextOrObserver, error, completed) {\r\n var _this = this;\r\n var observer = new Observer(nextOrObserver, error, completed);\r\n this.addObserver_(observer);\r\n return function () {\r\n _this.removeObserver_(observer);\r\n };\r\n };\r\n /**\r\n * This object behaves like a Promise, and resolves with its snapshot data\r\n * when the upload completes.\r\n * @param onFulfilled The fulfillment callback. Promise chaining works as normal.\r\n * @param onRejected The rejection callback.\r\n */\r\n UploadTask.prototype.then = function (onFulfilled, onRejected) {\r\n // These casts are needed so that TypeScript can infer the types of the\r\n // resulting Promise.\r\n return this.promise_.then(onFulfilled, onRejected);\r\n };\r\n /**\r\n * Equivalent to calling `then(null, onRejected)`.\r\n */\r\n UploadTask.prototype.catch = function (onRejected) {\r\n return this.then(null, onRejected);\r\n };\r\n /**\r\n * Adds the given observer.\r\n */\r\n UploadTask.prototype.addObserver_ = function (observer) {\r\n this.observers_.push(observer);\r\n this.notifyObserver_(observer);\r\n };\r\n /**\r\n * Removes the given observer.\r\n */\r\n UploadTask.prototype.removeObserver_ = function (observer) {\r\n var i = this.observers_.indexOf(observer);\r\n if (i !== -1) {\r\n this.observers_.splice(i, 1);\r\n }\r\n };\r\n UploadTask.prototype.notifyObservers_ = function () {\r\n var _this = this;\r\n this.finishPromise_();\r\n var observers = this.observers_.slice();\r\n observers.forEach(function (observer) {\r\n _this.notifyObserver_(observer);\r\n });\r\n };\r\n UploadTask.prototype.finishPromise_ = function () {\r\n if (this.resolve_ !== null) {\r\n var triggered = true;\r\n switch (taskStateFromInternalTaskState(this.state_)) {\r\n case TaskState.SUCCESS:\r\n async(this.resolve_.bind(null, this.snapshot))();\r\n break;\r\n case TaskState.CANCELED:\r\n case TaskState.ERROR:\r\n var toCall = this.reject_;\r\n async(toCall.bind(null, this.error_))();\r\n break;\r\n default:\r\n triggered = false;\r\n break;\r\n }\r\n if (triggered) {\r\n this.resolve_ = null;\r\n this.reject_ = null;\r\n }\r\n }\r\n };\r\n UploadTask.prototype.notifyObserver_ = function (observer) {\r\n var externalState = taskStateFromInternalTaskState(this.state_);\r\n switch (externalState) {\r\n case TaskState.RUNNING:\r\n case TaskState.PAUSED:\r\n if (observer.next) {\r\n async(observer.next.bind(observer, this.snapshot))();\r\n }\r\n break;\r\n case TaskState.SUCCESS:\r\n if (observer.complete) {\r\n async(observer.complete.bind(observer))();\r\n }\r\n break;\r\n case TaskState.CANCELED:\r\n case TaskState.ERROR:\r\n if (observer.error) {\r\n async(observer.error.bind(observer, this.error_))();\r\n }\r\n break;\r\n default:\r\n // TODO(andysoto): assert(false);\r\n if (observer.error) {\r\n async(observer.error.bind(observer, this.error_))();\r\n }\r\n }\r\n };\r\n /**\r\n * Resumes a paused task. Has no effect on a currently running or failed task.\r\n * @return True if the operation took effect, false if ignored.\r\n */\r\n UploadTask.prototype.resume = function () {\r\n var valid = this.state_ === InternalTaskState.PAUSED ||\r\n this.state_ === InternalTaskState.PAUSING;\r\n if (valid) {\r\n this.transition_(InternalTaskState.RUNNING);\r\n }\r\n return valid;\r\n };\r\n /**\r\n * Pauses a currently running task. Has no effect on a paused or failed task.\r\n * @return True if the operation took effect, false if ignored.\r\n */\r\n UploadTask.prototype.pause = function () {\r\n var valid = this.state_ === InternalTaskState.RUNNING;\r\n if (valid) {\r\n this.transition_(InternalTaskState.PAUSING);\r\n }\r\n return valid;\r\n };\r\n /**\r\n * Cancels a currently running or paused task. Has no effect on a complete or\r\n * failed task.\r\n * @return True if the operation took effect, false if ignored.\r\n */\r\n UploadTask.prototype.cancel = function () {\r\n var valid = this.state_ === InternalTaskState.RUNNING ||\r\n this.state_ === InternalTaskState.PAUSING;\r\n if (valid) {\r\n this.transition_(InternalTaskState.CANCELING);\r\n }\r\n return valid;\r\n };\r\n return UploadTask;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Provides methods to interact with a bucket in the Firebase Storage service.\r\n * @param location An fbs.location, or the URL at\r\n * which to base this object, in one of the following forms:\r\n * gs://<bucket>/<object-path>\r\n * http[s]://firebasestorage.googleapis.com/\r\n * <api-version>/b/<bucket>/o/<object-path>\r\n * Any query or fragment strings will be ignored in the http[s]\r\n * format. If no value is passed, the storage object will use a URL based on\r\n * the project ID of the base firebase.App instance.\r\n */\r\nvar Reference = /** @class */ (function () {\r\n function Reference(service, location) {\r\n this.service = service;\r\n if (location instanceof Location) {\r\n this.location = location;\r\n }\r\n else {\r\n this.location = Location.makeFromUrl(location);\r\n }\r\n }\r\n /**\r\n * @return The URL for the bucket and path this object references,\r\n * in the form gs://<bucket>/<object-path>\r\n * @override\r\n */\r\n Reference.prototype.toString = function () {\r\n return 'gs://' + this.location.bucket + '/' + this.location.path;\r\n };\r\n Reference.prototype.newRef = function (service, location) {\r\n return new Reference(service, location);\r\n };\r\n Reference.prototype.mappings = function () {\r\n return getMappings();\r\n };\r\n /**\r\n * @return A reference to the object obtained by\r\n * appending childPath, removing any duplicate, beginning, or trailing\r\n * slashes.\r\n */\r\n Reference.prototype.child = function (childPath) {\r\n var newPath = child(this.location.path, childPath);\r\n var location = new Location(this.location.bucket, newPath);\r\n return this.newRef(this.service, location);\r\n };\r\n Object.defineProperty(Reference.prototype, \"parent\", {\r\n /**\r\n * @return A reference to the parent of the\r\n * current object, or null if the current object is the root.\r\n */\r\n get: function () {\r\n var newPath = parent(this.location.path);\r\n if (newPath === null) {\r\n return null;\r\n }\r\n var location = new Location(this.location.bucket, newPath);\r\n return this.newRef(this.service, location);\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Reference.prototype, \"root\", {\r\n /**\r\n * @return An reference to the root of this\r\n * object's bucket.\r\n */\r\n get: function () {\r\n var location = new Location(this.location.bucket, '');\r\n return this.newRef(this.service, location);\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Reference.prototype, \"bucket\", {\r\n get: function () {\r\n return this.location.bucket;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Reference.prototype, \"fullPath\", {\r\n get: function () {\r\n return this.location.path;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Reference.prototype, \"name\", {\r\n get: function () {\r\n return lastComponent(this.location.path);\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Reference.prototype, \"storage\", {\r\n get: function () {\r\n return this.service;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Uploads a blob to this object's location.\r\n * @param data The blob to upload.\r\n * @return An UploadTask that lets you control and\r\n * observe the upload.\r\n */\r\n Reference.prototype.put = function (data, metadata) {\r\n if (metadata === void 0) { metadata = null; }\r\n this.throwIfRoot_('put');\r\n return new UploadTask(this, this.service, this.location, this.mappings(), new FbsBlob(data), metadata);\r\n };\r\n /**\r\n * Uploads a string to this object's location.\r\n * @param value The string to upload.\r\n * @param format The format of the string to upload.\r\n * @return An UploadTask that lets you control and\r\n * observe the upload.\r\n */\r\n Reference.prototype.putString = function (value, format, metadata) {\r\n if (format === void 0) { format = StringFormat.RAW; }\r\n this.throwIfRoot_('putString');\r\n var data = dataFromString(format, value);\r\n var metadataClone = Object.assign({}, metadata);\r\n if (!isDef(metadataClone['contentType']) &&\r\n isDef(data.contentType)) {\r\n metadataClone['contentType'] = data.contentType;\r\n }\r\n return new UploadTask(this, this.service, this.location, this.mappings(), new FbsBlob(data.data, true), metadataClone);\r\n };\r\n /**\r\n * Deletes the object at this location.\r\n * @return A promise that resolves if the deletion succeeds.\r\n */\r\n Reference.prototype.delete = function () {\r\n var _this = this;\r\n this.throwIfRoot_('delete');\r\n return this.service.getAuthToken().then(function (authToken) {\r\n var requestInfo = deleteObject(_this.service, _this.location);\r\n return _this.service.makeRequest(requestInfo, authToken).getPromise();\r\n });\r\n };\r\n /**\r\n * List all items (files) and prefixes (folders) under this storage reference.\r\n *\r\n * This is a helper method for calling list() repeatedly until there are\r\n * no more results. The default pagination size is 1000.\r\n *\r\n * Note: The results may not be consistent if objects are changed while this\r\n * operation is running.\r\n *\r\n * Warning: listAll may potentially consume too many resources if there are\r\n * too many results.\r\n *\r\n * @return A Promise that resolves with all the items and prefixes under\r\n * the current storage reference. `prefixes` contains references to\r\n * sub-directories and `items` contains references to objects in this\r\n * folder. `nextPageToken` is never returned.\r\n */\r\n Reference.prototype.listAll = function () {\r\n var accumulator = {\r\n prefixes: [],\r\n items: []\r\n };\r\n return this.listAllHelper(accumulator).then(function () { return accumulator; });\r\n };\r\n Reference.prototype.listAllHelper = function (accumulator, pageToken) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var opt, nextPage;\r\n var _a, _b;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n opt = {\r\n // maxResults is 1000 by default.\r\n pageToken: pageToken\r\n };\r\n return [4 /*yield*/, this.list(opt)];\r\n case 1:\r\n nextPage = _c.sent();\r\n (_a = accumulator.prefixes).push.apply(_a, nextPage.prefixes);\r\n (_b = accumulator.items).push.apply(_b, nextPage.items);\r\n if (!(nextPage.nextPageToken != null)) return [3 /*break*/, 3];\r\n return [4 /*yield*/, this.listAllHelper(accumulator, nextPage.nextPageToken)];\r\n case 2:\r\n _c.sent();\r\n _c.label = 3;\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * List items (files) and prefixes (folders) under this storage reference.\r\n *\r\n * List API is only available for Firebase Rules Version 2.\r\n *\r\n * GCS is a key-blob store. Firebase Storage imposes the semantic of '/'\r\n * delimited folder structure.\r\n * Refer to GCS's List API if you want to learn more.\r\n *\r\n * To adhere to Firebase Rules's Semantics, Firebase Storage does not\r\n * support objects whose paths end with \"/\" or contain two consecutive\r\n * \"/\"s. Firebase Storage List API will filter these unsupported objects.\r\n * list() may fail if there are too many unsupported objects in the bucket.\r\n *\r\n * @param options See ListOptions for details.\r\n * @return A Promise that resolves with the items and prefixes.\r\n * `prefixes` contains references to sub-folders and `items`\r\n * contains references to objects in this folder. `nextPageToken`\r\n * can be used to get the rest of the results.\r\n */\r\n Reference.prototype.list = function (options) {\r\n var _this = this;\r\n var op = options || {};\r\n if (typeof op.maxResults === 'number') {\r\n validateNumber('options.maxResults', \r\n /* minValue= */ 1, \r\n /* maxValue= */ 1000, op.maxResults);\r\n }\r\n return this.service.getAuthToken().then(function (authToken) {\r\n var requestInfo = list(_this.service, _this.location, \r\n /*delimiter= */ '/', op.pageToken, op.maxResults);\r\n return _this.service.makeRequest(requestInfo, authToken).getPromise();\r\n });\r\n };\r\n /**\r\n * A promise that resolves with the metadata for this object. If this\r\n * object doesn't exist or metadata cannot be retreived, the promise is\r\n * rejected.\r\n */\r\n Reference.prototype.getMetadata = function () {\r\n var _this = this;\r\n this.throwIfRoot_('getMetadata');\r\n return this.service.getAuthToken().then(function (authToken) {\r\n var requestInfo = getMetadata(_this.service, _this.location, _this.mappings());\r\n return _this.service.makeRequest(requestInfo, authToken).getPromise();\r\n });\r\n };\r\n /**\r\n * Updates the metadata for this object.\r\n * @param metadata The new metadata for the object.\r\n * Only values that have been explicitly set will be changed. Explicitly\r\n * setting a value to null will remove the metadata.\r\n * @return A promise that resolves\r\n * with the new metadata for this object.\r\n * @see firebaseStorage.Reference.prototype.getMetadata\r\n */\r\n Reference.prototype.updateMetadata = function (metadata) {\r\n var _this = this;\r\n this.throwIfRoot_('updateMetadata');\r\n return this.service.getAuthToken().then(function (authToken) {\r\n var requestInfo = updateMetadata(_this.service, _this.location, metadata, _this.mappings());\r\n return _this.service.makeRequest(requestInfo, authToken).getPromise();\r\n });\r\n };\r\n /**\r\n * @return A promise that resolves with the download\r\n * URL for this object.\r\n */\r\n Reference.prototype.getDownloadURL = function () {\r\n var _this = this;\r\n this.throwIfRoot_('getDownloadURL');\r\n return this.service.getAuthToken().then(function (authToken) {\r\n var requestInfo = getDownloadUrl(_this.service, _this.location, _this.mappings());\r\n return _this.service\r\n .makeRequest(requestInfo, authToken)\r\n .getPromise()\r\n .then(function (url) {\r\n if (url === null) {\r\n throw noDownloadURL();\r\n }\r\n return url;\r\n });\r\n });\r\n };\r\n Reference.prototype.throwIfRoot_ = function (name) {\r\n if (this.location.path === '') {\r\n throw invalidRootOperation(name);\r\n }\r\n };\r\n return Reference;\r\n}());\n\n/**\r\n * A request whose promise always fails.\r\n * @struct\r\n * @template T\r\n */\r\nvar FailRequest = /** @class */ (function () {\r\n function FailRequest(error) {\r\n this.promise_ = Promise.reject(error);\r\n }\r\n /** @inheritDoc */\r\n FailRequest.prototype.getPromise = function () {\r\n return this.promise_;\r\n };\r\n /** @inheritDoc */\r\n FailRequest.prototype.cancel = function (_appDelete) {\r\n };\r\n return FailRequest;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @param f May be invoked\r\n * before the function returns.\r\n * @param callback Get all the arguments passed to the function\r\n * passed to f, including the initial boolean.\r\n */\r\nfunction start(f, \r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\ncallback, timeout) {\r\n // TODO(andysoto): make this code cleaner (probably refactor into an actual\r\n // type instead of a bunch of functions with state shared in the closure)\r\n var waitSeconds = 1;\r\n // Would type this as \"number\" but that doesn't work for Node so ¯\\_(ツ)_/¯\r\n // TODO: find a way to exclude Node type definition for storage because storage only works in browser\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n var timeoutId = null;\r\n var hitTimeout = false;\r\n var cancelState = 0;\r\n function canceled() {\r\n return cancelState === 2;\r\n }\r\n var triggeredCallback = false;\r\n // TODO: This disable can be removed and the 'ignoreRestArgs' option added to\r\n // the no-explicit-any rule when ESlint releases it.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n function triggerCallback() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (!triggeredCallback) {\r\n triggeredCallback = true;\r\n callback.apply(null, args);\r\n }\r\n }\r\n function callWithDelay(millis) {\r\n timeoutId = setTimeout(function () {\r\n timeoutId = null;\r\n f(handler, canceled());\r\n }, millis);\r\n }\r\n // TODO: This disable can be removed and the 'ignoreRestArgs' option added to\r\n // the no-explicit-any rule when ESlint releases it.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n function handler(success) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n if (triggeredCallback) {\r\n return;\r\n }\r\n if (success) {\r\n triggerCallback.call.apply(triggerCallback, __spreadArrays([null, success], args));\r\n return;\r\n }\r\n var mustStop = canceled() || hitTimeout;\r\n if (mustStop) {\r\n triggerCallback.call.apply(triggerCallback, __spreadArrays([null, success], args));\r\n return;\r\n }\r\n if (waitSeconds < 64) {\r\n /* TODO(andysoto): don't back off so quickly if we know we're offline. */\r\n waitSeconds *= 2;\r\n }\r\n var waitMillis;\r\n if (cancelState === 1) {\r\n cancelState = 2;\r\n waitMillis = 0;\r\n }\r\n else {\r\n waitMillis = (waitSeconds + Math.random()) * 1000;\r\n }\r\n callWithDelay(waitMillis);\r\n }\r\n var stopped = false;\r\n function stop(wasTimeout) {\r\n if (stopped) {\r\n return;\r\n }\r\n stopped = true;\r\n if (triggeredCallback) {\r\n return;\r\n }\r\n if (timeoutId !== null) {\r\n if (!wasTimeout) {\r\n cancelState = 2;\r\n }\r\n clearTimeout(timeoutId);\r\n callWithDelay(0);\r\n }\r\n else {\r\n if (!wasTimeout) {\r\n cancelState = 1;\r\n }\r\n }\r\n }\r\n callWithDelay(0);\r\n setTimeout(function () {\r\n hitTimeout = true;\r\n stop(true);\r\n }, timeout);\r\n return stop;\r\n}\r\n/**\r\n * Stops the retry loop from repeating.\r\n * If the function is currently \"in between\" retries, it is invoked immediately\r\n * with the second parameter as \"true\". Otherwise, it will be invoked once more\r\n * after the current invocation finishes iff the current invocation would have\r\n * triggered another retry.\r\n */\r\nfunction stop(id) {\r\n id(false);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @struct\r\n * @template T\r\n */\r\nvar NetworkRequest = /** @class */ (function () {\r\n function NetworkRequest(url, method, headers, body, successCodes, additionalRetryCodes, callback, errorCallback, timeout, progressCallback, pool) {\r\n var _this = this;\r\n this.pendingXhr_ = null;\r\n this.backoffId_ = null;\r\n this.canceled_ = false;\r\n this.appDelete_ = false;\r\n this.url_ = url;\r\n this.method_ = method;\r\n this.headers_ = headers;\r\n this.body_ = body;\r\n this.successCodes_ = successCodes.slice();\r\n this.additionalRetryCodes_ = additionalRetryCodes.slice();\r\n this.callback_ = callback;\r\n this.errorCallback_ = errorCallback;\r\n this.progressCallback_ = progressCallback;\r\n this.timeout_ = timeout;\r\n this.pool_ = pool;\r\n this.promise_ = new Promise(function (resolve, reject) {\r\n _this.resolve_ = resolve;\r\n _this.reject_ = reject;\r\n _this.start_();\r\n });\r\n }\r\n /**\r\n * Actually starts the retry loop.\r\n */\r\n NetworkRequest.prototype.start_ = function () {\r\n var self = this;\r\n function doTheRequest(backoffCallback, canceled) {\r\n if (canceled) {\r\n backoffCallback(false, new RequestEndStatus(false, null, true));\r\n return;\r\n }\r\n var xhr = self.pool_.createXhrIo();\r\n self.pendingXhr_ = xhr;\r\n function progressListener(progressEvent) {\r\n var loaded = progressEvent.loaded;\r\n var total = progressEvent.lengthComputable ? progressEvent.total : -1;\r\n if (self.progressCallback_ !== null) {\r\n self.progressCallback_(loaded, total);\r\n }\r\n }\r\n if (self.progressCallback_ !== null) {\r\n xhr.addUploadProgressListener(progressListener);\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n xhr\r\n .send(self.url_, self.method_, self.body_, self.headers_)\r\n .then(function (xhr) {\r\n if (self.progressCallback_ !== null) {\r\n xhr.removeUploadProgressListener(progressListener);\r\n }\r\n self.pendingXhr_ = null;\r\n xhr = xhr;\r\n var hitServer = xhr.getErrorCode() === ErrorCode.NO_ERROR;\r\n var status = xhr.getStatus();\r\n if (!hitServer || self.isRetryStatusCode_(status)) {\r\n var wasCanceled = xhr.getErrorCode() === ErrorCode.ABORT;\r\n backoffCallback(false, new RequestEndStatus(false, null, wasCanceled));\r\n return;\r\n }\r\n var successCode = self.successCodes_.indexOf(status) !== -1;\r\n backoffCallback(true, new RequestEndStatus(successCode, xhr));\r\n });\r\n }\r\n /**\r\n * @param requestWentThrough True if the request eventually went\r\n * through, false if it hit the retry limit or was canceled.\r\n */\r\n function backoffDone(requestWentThrough, status) {\r\n var resolve = self.resolve_;\r\n var reject = self.reject_;\r\n var xhr = status.xhr;\r\n if (status.wasSuccessCode) {\r\n try {\r\n var result = self.callback_(xhr, xhr.getResponseText());\r\n if (isJustDef(result)) {\r\n resolve(result);\r\n }\r\n else {\r\n resolve();\r\n }\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n }\r\n else {\r\n if (xhr !== null) {\r\n var err = unknown();\r\n err.serverResponse = xhr.getResponseText();\r\n if (self.errorCallback_) {\r\n reject(self.errorCallback_(xhr, err));\r\n }\r\n else {\r\n reject(err);\r\n }\r\n }\r\n else {\r\n if (status.canceled) {\r\n var err = self.appDelete_ ? appDeleted() : canceled();\r\n reject(err);\r\n }\r\n else {\r\n var err = retryLimitExceeded();\r\n reject(err);\r\n }\r\n }\r\n }\r\n }\r\n if (this.canceled_) {\r\n backoffDone(false, new RequestEndStatus(false, null, true));\r\n }\r\n else {\r\n this.backoffId_ = start(doTheRequest, backoffDone, this.timeout_);\r\n }\r\n };\r\n /** @inheritDoc */\r\n NetworkRequest.prototype.getPromise = function () {\r\n return this.promise_;\r\n };\r\n /** @inheritDoc */\r\n NetworkRequest.prototype.cancel = function (appDelete) {\r\n this.canceled_ = true;\r\n this.appDelete_ = appDelete || false;\r\n if (this.backoffId_ !== null) {\r\n stop(this.backoffId_);\r\n }\r\n if (this.pendingXhr_ !== null) {\r\n this.pendingXhr_.abort();\r\n }\r\n };\r\n NetworkRequest.prototype.isRetryStatusCode_ = function (status) {\r\n // The codes for which to retry came from this page:\r\n // https://cloud.google.com/storage/docs/exponential-backoff\r\n var isFiveHundredCode = status >= 500 && status < 600;\r\n var extraRetryCodes = [\r\n // Request Timeout: web server didn't receive full request in time.\r\n 408,\r\n // Too Many Requests: you're getting rate-limited, basically.\r\n 429\r\n ];\r\n var isExtraRetryCode = extraRetryCodes.indexOf(status) !== -1;\r\n var isRequestSpecificRetryCode = this.additionalRetryCodes_.indexOf(status) !== -1;\r\n return isFiveHundredCode || isExtraRetryCode || isRequestSpecificRetryCode;\r\n };\r\n return NetworkRequest;\r\n}());\r\n/**\r\n * A collection of information about the result of a network request.\r\n * @param opt_canceled Defaults to false.\r\n * @struct\r\n */\r\nvar RequestEndStatus = /** @class */ (function () {\r\n function RequestEndStatus(wasSuccessCode, xhr, canceled) {\r\n this.wasSuccessCode = wasSuccessCode;\r\n this.xhr = xhr;\r\n this.canceled = !!canceled;\r\n }\r\n return RequestEndStatus;\r\n}());\r\nfunction addAuthHeader_(headers, authToken) {\r\n if (authToken !== null && authToken.length > 0) {\r\n headers['Authorization'] = 'Firebase ' + authToken;\r\n }\r\n}\r\nfunction addVersionHeader_(headers) {\r\n var version = typeof firebase !== 'undefined' ? firebase.SDK_VERSION : 'AppManager';\r\n headers['X-Firebase-Storage-Version'] = 'webjs/' + version;\r\n}\r\nfunction addGmpidHeader_(headers, appId) {\r\n if (appId) {\r\n headers['X-Firebase-GMPID'] = appId;\r\n }\r\n}\r\n/**\r\n * @template T\r\n */\r\nfunction makeRequest(requestInfo, appId, authToken, pool) {\r\n var queryPart = makeQueryString(requestInfo.urlParams);\r\n var url = requestInfo.url + queryPart;\r\n var headers = Object.assign({}, requestInfo.headers);\r\n addGmpidHeader_(headers, appId);\r\n addAuthHeader_(headers, authToken);\r\n addVersionHeader_(headers);\r\n return new NetworkRequest(url, requestInfo.method, headers, requestInfo.body, requestInfo.successCodes, requestInfo.additionalRetryCodes, requestInfo.handler, requestInfo.errorHandler, requestInfo.timeout, requestInfo.progressCallback, pool);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A service that provides firebaseStorage.Reference instances.\r\n * @param opt_url gs:// url to a custom Storage Bucket\r\n *\r\n * @struct\r\n */\r\nvar StorageService = /** @class */ (function () {\r\n function StorageService(app, authProvider, pool, url) {\r\n var _a;\r\n this.bucket_ = null;\r\n this.appId_ = null;\r\n this.deleted_ = false;\r\n this.app_ = app;\r\n this.authProvider_ = authProvider;\r\n this.maxOperationRetryTime_ = DEFAULT_MAX_OPERATION_RETRY_TIME;\r\n this.maxUploadRetryTime_ = DEFAULT_MAX_UPLOAD_RETRY_TIME;\r\n this.requests_ = new Set();\r\n this.pool_ = pool;\r\n if (url != null) {\r\n this.bucket_ = Location.makeFromBucketSpec(url);\r\n }\r\n else {\r\n this.bucket_ = StorageService.extractBucket_((_a = this.app_) === null || _a === void 0 ? void 0 : _a.options);\r\n }\r\n this.internals_ = new ServiceInternals(this);\r\n }\r\n StorageService.extractBucket_ = function (config) {\r\n var bucketString = config === null || config === void 0 ? void 0 : config[CONFIG_STORAGE_BUCKET_KEY];\r\n if (bucketString == null) {\r\n return null;\r\n }\r\n return Location.makeFromBucketSpec(bucketString);\r\n };\r\n StorageService.prototype.getAuthToken = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var auth, tokenData;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n auth = this.authProvider_.getImmediate({ optional: true });\r\n if (!auth) return [3 /*break*/, 2];\r\n return [4 /*yield*/, auth.getToken()];\r\n case 1:\r\n tokenData = _a.sent();\r\n if (tokenData !== null) {\r\n return [2 /*return*/, tokenData.accessToken];\r\n }\r\n _a.label = 2;\r\n case 2: return [2 /*return*/, null];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Stop running requests and prevent more from being created.\r\n */\r\n StorageService.prototype.deleteApp = function () {\r\n this.deleted_ = true;\r\n this.app_ = null;\r\n this.requests_.forEach(function (request) { return request.cancel(); });\r\n this.requests_.clear();\r\n };\r\n /**\r\n * Returns a new firebaseStorage.Reference object referencing this StorageService\r\n * at the given Location.\r\n * @param loc The Location.\r\n * @return A firebaseStorage.Reference.\r\n */\r\n StorageService.prototype.makeStorageReference = function (loc) {\r\n return new Reference(this, loc);\r\n };\r\n StorageService.prototype.makeRequest = function (requestInfo, authToken) {\r\n var _this = this;\r\n if (!this.deleted_) {\r\n var request_1 = makeRequest(requestInfo, this.appId_, authToken, this.pool_);\r\n this.requests_.add(request_1);\r\n // Request removes itself from set when complete.\r\n request_1.getPromise().then(function () { return _this.requests_.delete(request_1); }, function () { return _this.requests_.delete(request_1); });\r\n return request_1;\r\n }\r\n else {\r\n return new FailRequest(appDeleted());\r\n }\r\n };\r\n /**\r\n * Returns a firebaseStorage.Reference for the given path in the default\r\n * bucket.\r\n */\r\n StorageService.prototype.ref = function (path) {\r\n if (/^[A-Za-z]+:\\/\\//.test(path)) {\r\n throw new FirebaseStorageError(Code.INVALID_ARGUMENT, 'Expected child path but got a URL, use refFromURL instead.');\r\n }\r\n if (this.bucket_ == null) {\r\n throw new Error('No Storage Bucket defined in Firebase Options.');\r\n }\r\n var ref = new Reference(this, this.bucket_);\r\n if (path != null) {\r\n return ref.child(path);\r\n }\r\n else {\r\n return ref;\r\n }\r\n };\r\n /**\r\n * Returns a firebaseStorage.Reference object for the given absolute URL,\r\n * which must be a gs:// or http[s]:// URL.\r\n */\r\n StorageService.prototype.refFromURL = function (url) {\r\n if (!/^[A-Za-z]+:\\/\\//.test(url)) {\r\n throw new FirebaseStorageError(Code.INVALID_ARGUMENT, 'Expected full URL but got a child path, use ref instead.');\r\n }\r\n try {\r\n Location.makeFromUrl(url);\r\n }\r\n catch (e) {\r\n throw new FirebaseStorageError(Code.INVALID_ARGUMENT, 'Expected valid full URL but got an invalid one.');\r\n }\r\n return new Reference(this, url);\r\n };\r\n Object.defineProperty(StorageService.prototype, \"maxUploadRetryTime\", {\r\n get: function () {\r\n return this.maxUploadRetryTime_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n StorageService.prototype.setMaxUploadRetryTime = function (time) {\r\n validateNumber('time', \r\n /* minValue=*/ 0, \r\n /* maxValue= */ Number.POSITIVE_INFINITY, time);\r\n this.maxUploadRetryTime_ = time;\r\n };\r\n Object.defineProperty(StorageService.prototype, \"maxOperationRetryTime\", {\r\n get: function () {\r\n return this.maxOperationRetryTime_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n StorageService.prototype.setMaxOperationRetryTime = function (time) {\r\n validateNumber('time', \r\n /* minValue=*/ 0, \r\n /* maxValue= */ Number.POSITIVE_INFINITY, time);\r\n this.maxOperationRetryTime_ = time;\r\n };\r\n Object.defineProperty(StorageService.prototype, \"app\", {\r\n get: function () {\r\n return this.app_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(StorageService.prototype, \"INTERNAL\", {\r\n get: function () {\r\n return this.internals_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return StorageService;\r\n}());\r\n/**\r\n * @struct\r\n */\r\nvar ServiceInternals = /** @class */ (function () {\r\n function ServiceInternals(service) {\r\n this.service_ = service;\r\n }\r\n /**\r\n * Called when the associated app is deleted.\r\n */\r\n ServiceInternals.prototype.delete = function () {\r\n this.service_.deleteApp();\r\n return Promise.resolve();\r\n };\r\n return ServiceInternals;\r\n}());\n\nvar name = \"@firebase/storage\";\nvar version = \"0.4.0\";\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Type constant for Firebase Storage.\r\n */\r\nvar STORAGE_TYPE = 'storage';\r\nfunction factory(container, url) {\r\n // Dependencies\r\n var app = container.getProvider('app').getImmediate();\r\n var authProvider = container.getProvider('auth-internal');\r\n return new StorageService(app, authProvider, new XhrIoPool(), url);\r\n}\r\nfunction registerStorage(instance) {\r\n var namespaceExports = {\r\n // no-inline\r\n TaskState: TaskState,\r\n TaskEvent: TaskEvent,\r\n StringFormat: StringFormat,\r\n Storage: StorageService,\r\n Reference: Reference\r\n };\r\n instance.INTERNAL.registerComponent(new Component(STORAGE_TYPE, factory, \"PUBLIC\" /* PUBLIC */)\r\n .setServiceProps(namespaceExports)\r\n .setMultipleInstances(true));\r\n instance.registerVersion(name, version);\r\n}\r\nregisterStorage(firebase);\n\nexport { registerStorage };\n//# sourceMappingURL=index.esm.js.map\n","import { __extends } from 'tslib';\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @fileoverview Firebase constants. Some of these (@defines) can be overridden at compile-time.\r\n */\r\nvar CONSTANTS = {\r\n /**\r\n * @define {boolean} Whether this is the client Node.js SDK.\r\n */\r\n NODE_CLIENT: false,\r\n /**\r\n * @define {boolean} Whether this is the Admin Node.js SDK.\r\n */\r\n NODE_ADMIN: false,\r\n /**\r\n * Firebase SDK Version\r\n */\r\n SDK_VERSION: '${JSCORE_VERSION}'\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Throws an error if the provided assertion is falsy\r\n */\r\nvar assert = function (assertion, message) {\r\n if (!assertion) {\r\n throw assertionError(message);\r\n }\r\n};\r\n/**\r\n * Returns an Error object suitable for throwing.\r\n */\r\nvar assertionError = function (message) {\r\n return new Error('Firebase Database (' +\r\n CONSTANTS.SDK_VERSION +\r\n ') INTERNAL ASSERT FAILED: ' +\r\n message);\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar stringToByteArray = function (str) {\r\n // TODO(user): Use native implementations if/when available\r\n var out = [];\r\n var p = 0;\r\n for (var i = 0; i < str.length; i++) {\r\n var c = str.charCodeAt(i);\r\n if (c < 128) {\r\n out[p++] = c;\r\n }\r\n else if (c < 2048) {\r\n out[p++] = (c >> 6) | 192;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n else if ((c & 0xfc00) === 0xd800 &&\r\n i + 1 < str.length &&\r\n (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\r\n // Surrogate Pair\r\n c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);\r\n out[p++] = (c >> 18) | 240;\r\n out[p++] = ((c >> 12) & 63) | 128;\r\n out[p++] = ((c >> 6) & 63) | 128;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n else {\r\n out[p++] = (c >> 12) | 224;\r\n out[p++] = ((c >> 6) & 63) | 128;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n }\r\n return out;\r\n};\r\n/**\r\n * Turns an array of numbers into the string given by the concatenation of the\r\n * characters to which the numbers correspond.\r\n * @param bytes Array of numbers representing characters.\r\n * @return Stringification of the array.\r\n */\r\nvar byteArrayToString = function (bytes) {\r\n // TODO(user): Use native implementations if/when available\r\n var out = [];\r\n var pos = 0, c = 0;\r\n while (pos < bytes.length) {\r\n var c1 = bytes[pos++];\r\n if (c1 < 128) {\r\n out[c++] = String.fromCharCode(c1);\r\n }\r\n else if (c1 > 191 && c1 < 224) {\r\n var c2 = bytes[pos++];\r\n out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\r\n }\r\n else if (c1 > 239 && c1 < 365) {\r\n // Surrogate Pair\r\n var c2 = bytes[pos++];\r\n var c3 = bytes[pos++];\r\n var c4 = bytes[pos++];\r\n var u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -\r\n 0x10000;\r\n out[c++] = String.fromCharCode(0xd800 + (u >> 10));\r\n out[c++] = String.fromCharCode(0xdc00 + (u & 1023));\r\n }\r\n else {\r\n var c2 = bytes[pos++];\r\n var c3 = bytes[pos++];\r\n out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\r\n }\r\n }\r\n return out.join('');\r\n};\r\n// We define it as an object literal instead of a class because a class compiled down to es5 can't\r\n// be treeshaked. https://github.com/rollup/rollup/issues/1691\r\n// Static lookup maps, lazily populated by init_()\r\nvar base64 = {\r\n /**\r\n * Maps bytes to characters.\r\n */\r\n byteToCharMap_: null,\r\n /**\r\n * Maps characters to bytes.\r\n */\r\n charToByteMap_: null,\r\n /**\r\n * Maps bytes to websafe characters.\r\n * @private\r\n */\r\n byteToCharMapWebSafe_: null,\r\n /**\r\n * Maps websafe characters to bytes.\r\n * @private\r\n */\r\n charToByteMapWebSafe_: null,\r\n /**\r\n * Our default alphabet, shared between\r\n * ENCODED_VALS and ENCODED_VALS_WEBSAFE\r\n */\r\n ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789',\r\n /**\r\n * Our default alphabet. Value 64 (=) is special; it means \"nothing.\"\r\n */\r\n get ENCODED_VALS() {\r\n return this.ENCODED_VALS_BASE + '+/=';\r\n },\r\n /**\r\n * Our websafe alphabet.\r\n */\r\n get ENCODED_VALS_WEBSAFE() {\r\n return this.ENCODED_VALS_BASE + '-_.';\r\n },\r\n /**\r\n * Whether this browser supports the atob and btoa functions. This extension\r\n * started at Mozilla but is now implemented by many browsers. We use the\r\n * ASSUME_* variables to avoid pulling in the full useragent detection library\r\n * but still allowing the standard per-browser compilations.\r\n *\r\n */\r\n HAS_NATIVE_SUPPORT: typeof atob === 'function',\r\n /**\r\n * Base64-encode an array of bytes.\r\n *\r\n * @param input An array of bytes (numbers with\r\n * value in [0, 255]) to encode.\r\n * @param webSafe Boolean indicating we should use the\r\n * alternative alphabet.\r\n * @return The base64 encoded string.\r\n */\r\n encodeByteArray: function (input, webSafe) {\r\n if (!Array.isArray(input)) {\r\n throw Error('encodeByteArray takes an array as a parameter');\r\n }\r\n this.init_();\r\n var byteToCharMap = webSafe\r\n ? this.byteToCharMapWebSafe_\r\n : this.byteToCharMap_;\r\n var output = [];\r\n for (var i = 0; i < input.length; i += 3) {\r\n var byte1 = input[i];\r\n var haveByte2 = i + 1 < input.length;\r\n var byte2 = haveByte2 ? input[i + 1] : 0;\r\n var haveByte3 = i + 2 < input.length;\r\n var byte3 = haveByte3 ? input[i + 2] : 0;\r\n var outByte1 = byte1 >> 2;\r\n var outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4);\r\n var outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6);\r\n var outByte4 = byte3 & 0x3f;\r\n if (!haveByte3) {\r\n outByte4 = 64;\r\n if (!haveByte2) {\r\n outByte3 = 64;\r\n }\r\n }\r\n output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]);\r\n }\r\n return output.join('');\r\n },\r\n /**\r\n * Base64-encode a string.\r\n *\r\n * @param input A string to encode.\r\n * @param webSafe If true, we should use the\r\n * alternative alphabet.\r\n * @return The base64 encoded string.\r\n */\r\n encodeString: function (input, webSafe) {\r\n // Shortcut for Mozilla browsers that implement\r\n // a native base64 encoder in the form of \"btoa/atob\"\r\n if (this.HAS_NATIVE_SUPPORT && !webSafe) {\r\n return btoa(input);\r\n }\r\n return this.encodeByteArray(stringToByteArray(input), webSafe);\r\n },\r\n /**\r\n * Base64-decode a string.\r\n *\r\n * @param input to decode.\r\n * @param webSafe True if we should use the\r\n * alternative alphabet.\r\n * @return string representing the decoded value.\r\n */\r\n decodeString: function (input, webSafe) {\r\n // Shortcut for Mozilla browsers that implement\r\n // a native base64 encoder in the form of \"btoa/atob\"\r\n if (this.HAS_NATIVE_SUPPORT && !webSafe) {\r\n return atob(input);\r\n }\r\n return byteArrayToString(this.decodeStringToByteArray(input, webSafe));\r\n },\r\n /**\r\n * Base64-decode a string.\r\n *\r\n * In base-64 decoding, groups of four characters are converted into three\r\n * bytes. If the encoder did not apply padding, the input length may not\r\n * be a multiple of 4.\r\n *\r\n * In this case, the last group will have fewer than 4 characters, and\r\n * padding will be inferred. If the group has one or two characters, it decodes\r\n * to one byte. If the group has three characters, it decodes to two bytes.\r\n *\r\n * @param input Input to decode.\r\n * @param webSafe True if we should use the web-safe alphabet.\r\n * @return bytes representing the decoded value.\r\n */\r\n decodeStringToByteArray: function (input, webSafe) {\r\n this.init_();\r\n var charToByteMap = webSafe\r\n ? this.charToByteMapWebSafe_\r\n : this.charToByteMap_;\r\n var output = [];\r\n for (var i = 0; i < input.length;) {\r\n var byte1 = charToByteMap[input.charAt(i++)];\r\n var haveByte2 = i < input.length;\r\n var byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;\r\n ++i;\r\n var haveByte3 = i < input.length;\r\n var byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;\r\n ++i;\r\n var haveByte4 = i < input.length;\r\n var byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;\r\n ++i;\r\n if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {\r\n throw Error();\r\n }\r\n var outByte1 = (byte1 << 2) | (byte2 >> 4);\r\n output.push(outByte1);\r\n if (byte3 !== 64) {\r\n var outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);\r\n output.push(outByte2);\r\n if (byte4 !== 64) {\r\n var outByte3 = ((byte3 << 6) & 0xc0) | byte4;\r\n output.push(outByte3);\r\n }\r\n }\r\n }\r\n return output;\r\n },\r\n /**\r\n * Lazy static initialization function. Called before\r\n * accessing any of the static map variables.\r\n * @private\r\n */\r\n init_: function () {\r\n if (!this.byteToCharMap_) {\r\n this.byteToCharMap_ = {};\r\n this.charToByteMap_ = {};\r\n this.byteToCharMapWebSafe_ = {};\r\n this.charToByteMapWebSafe_ = {};\r\n // We want quick mappings back and forth, so we precompute two maps.\r\n for (var i = 0; i < this.ENCODED_VALS.length; i++) {\r\n this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);\r\n this.charToByteMap_[this.byteToCharMap_[i]] = i;\r\n this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);\r\n this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;\r\n // Be forgiving when decoding and correctly decode both encodings.\r\n if (i >= this.ENCODED_VALS_BASE.length) {\r\n this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;\r\n this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;\r\n }\r\n }\r\n }\r\n }\r\n};\r\n/**\r\n * URL-safe base64 encoding\r\n */\r\nvar base64Encode = function (str) {\r\n var utf8Bytes = stringToByteArray(str);\r\n return base64.encodeByteArray(utf8Bytes, true);\r\n};\r\n/**\r\n * URL-safe base64 decoding\r\n *\r\n * NOTE: DO NOT use the global atob() function - it does NOT support the\r\n * base64Url variant encoding.\r\n *\r\n * @param str To be decoded\r\n * @return Decoded result, if possible\r\n */\r\nvar base64Decode = function (str) {\r\n try {\r\n return base64.decodeString(str, true);\r\n }\r\n catch (e) {\r\n console.error('base64Decode failed: ', e);\r\n }\r\n return null;\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Do a deep-copy of basic JavaScript Objects or Arrays.\r\n */\r\nfunction deepCopy(value) {\r\n return deepExtend(undefined, value);\r\n}\r\n/**\r\n * Copy properties from source to target (recursively allows extension\r\n * of Objects and Arrays). Scalar values in the target are over-written.\r\n * If target is undefined, an object of the appropriate type will be created\r\n * (and returned).\r\n *\r\n * We recursively copy all child properties of plain Objects in the source- so\r\n * that namespace- like dictionaries are merged.\r\n *\r\n * Note that the target can be a function, in which case the properties in\r\n * the source Object are copied onto it as static properties of the Function.\r\n */\r\nfunction deepExtend(target, source) {\r\n if (!(source instanceof Object)) {\r\n return source;\r\n }\r\n switch (source.constructor) {\r\n case Date:\r\n // Treat Dates like scalars; if the target date object had any child\r\n // properties - they will be lost!\r\n var dateValue = source;\r\n return new Date(dateValue.getTime());\r\n case Object:\r\n if (target === undefined) {\r\n target = {};\r\n }\r\n break;\r\n case Array:\r\n // Always copy the array source and overwrite the target.\r\n target = [];\r\n break;\r\n default:\r\n // Not a plain Object - treat it as a scalar.\r\n return source;\r\n }\r\n for (var prop in source) {\r\n if (!source.hasOwnProperty(prop)) {\r\n continue;\r\n }\r\n target[prop] = deepExtend(target[prop], source[prop]);\r\n }\r\n return target;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar Deferred = /** @class */ (function () {\r\n function Deferred() {\r\n var _this = this;\r\n this.reject = function () { };\r\n this.resolve = function () { };\r\n this.promise = new Promise(function (resolve, reject) {\r\n _this.resolve = resolve;\r\n _this.reject = reject;\r\n });\r\n }\r\n /**\r\n * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around\r\n * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback\r\n * and returns a node-style callback which will resolve or reject the Deferred's promise.\r\n */\r\n Deferred.prototype.wrapCallback = function (callback) {\r\n var _this = this;\r\n return function (error, value) {\r\n if (error) {\r\n _this.reject(error);\r\n }\r\n else {\r\n _this.resolve(value);\r\n }\r\n if (typeof callback === 'function') {\r\n // Attaching noop handler just in case developer wasn't expecting\r\n // promises\r\n _this.promise.catch(function () { });\r\n // Some of our callbacks don't expect a value and our own tests\r\n // assert that the parameter length is 1\r\n if (callback.length === 1) {\r\n callback(error);\r\n }\r\n else {\r\n callback(error, value);\r\n }\r\n }\r\n };\r\n };\r\n return Deferred;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns navigator.userAgent string or '' if it's not defined.\r\n * @return user agent string\r\n */\r\nfunction getUA() {\r\n if (typeof navigator !== 'undefined' &&\r\n typeof navigator['userAgent'] === 'string') {\r\n return navigator['userAgent'];\r\n }\r\n else {\r\n return '';\r\n }\r\n}\r\n/**\r\n * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.\r\n *\r\n * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap\r\n * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally\r\n * wait for a callback.\r\n */\r\nfunction isMobileCordova() {\r\n return (typeof window !== 'undefined' &&\r\n // @ts-ignore Setting up an broadly applicable index signature for Window\r\n // just to deal with this case would probably be a bad idea.\r\n !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&\r\n /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA()));\r\n}\r\n/**\r\n * Detect Node.js.\r\n *\r\n * @return true if Node.js environment is detected.\r\n */\r\n// Node detection logic from: https://github.com/iliakan/detect-node/\r\nfunction isNode() {\r\n try {\r\n return (Object.prototype.toString.call(global.process) === '[object process]');\r\n }\r\n catch (e) {\r\n return false;\r\n }\r\n}\r\n/**\r\n * Detect Browser Environment\r\n */\r\nfunction isBrowser() {\r\n return typeof self === 'object' && self.self === self;\r\n}\r\nfunction isBrowserExtension() {\r\n var runtime = typeof chrome === 'object'\r\n ? chrome.runtime\r\n : typeof browser === 'object'\r\n ? browser.runtime\r\n : undefined;\r\n return typeof runtime === 'object' && runtime.id !== undefined;\r\n}\r\n/**\r\n * Detect React Native.\r\n *\r\n * @return true if ReactNative environment is detected.\r\n */\r\nfunction isReactNative() {\r\n return (typeof navigator === 'object' && navigator['product'] === 'ReactNative');\r\n}\r\n/** Detects Electron apps. */\r\nfunction isElectron() {\r\n return getUA().indexOf('Electron/') >= 0;\r\n}\r\n/** Detects Internet Explorer. */\r\nfunction isIE() {\r\n var ua = getUA();\r\n return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;\r\n}\r\n/** Detects Universal Windows Platform apps. */\r\nfunction isUWP() {\r\n return getUA().indexOf('MSAppHost/') >= 0;\r\n}\r\n/**\r\n * Detect whether the current SDK build is the Node version.\r\n *\r\n * @return true if it's the Node SDK build.\r\n */\r\nfunction isNodeSdk() {\r\n return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;\r\n}\r\n/** Returns true if we are running in Safari. */\r\nfunction isSafari() {\r\n return (!isNode() &&\r\n navigator.userAgent.includes('Safari') &&\r\n !navigator.userAgent.includes('Chrome'));\r\n}\r\n/**\r\n * This method checks if indexedDB is supported by current browser/service worker context\r\n * @return true if indexedDB is supported by current browser/service worker context\r\n */\r\nfunction isIndexedDBAvailable() {\r\n return 'indexedDB' in self && indexedDB != null;\r\n}\r\n/**\r\n * This method validates browser context for indexedDB by opening a dummy indexedDB database and reject\r\n * if errors occur during the database open operation.\r\n */\r\nfunction validateIndexedDBOpenable() {\r\n return new Promise(function (resolve, reject) {\r\n try {\r\n var preExist_1 = true;\r\n var DB_CHECK_NAME_1 = 'validate-browser-context-for-indexeddb-analytics-module';\r\n var request_1 = window.indexedDB.open(DB_CHECK_NAME_1);\r\n request_1.onsuccess = function () {\r\n request_1.result.close();\r\n // delete database only when it doesn't pre-exist\r\n if (!preExist_1) {\r\n window.indexedDB.deleteDatabase(DB_CHECK_NAME_1);\r\n }\r\n resolve(true);\r\n };\r\n request_1.onupgradeneeded = function () {\r\n preExist_1 = false;\r\n };\r\n request_1.onerror = function () {\r\n var _a;\r\n reject(((_a = request_1.error) === null || _a === void 0 ? void 0 : _a.message) || '');\r\n };\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n}\r\n/**\r\n *\r\n * This method checks whether cookie is enabled within current browser\r\n * @return true if cookie is enabled within current browser\r\n */\r\nfunction areCookiesEnabled() {\r\n if (!navigator || !navigator.cookieEnabled) {\r\n return false;\r\n }\r\n return true;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar ERROR_NAME = 'FirebaseError';\r\n// Based on code from:\r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types\r\nvar FirebaseError = /** @class */ (function (_super) {\r\n __extends(FirebaseError, _super);\r\n function FirebaseError(code, message, customData) {\r\n var _this = _super.call(this, message) || this;\r\n _this.code = code;\r\n _this.customData = customData;\r\n _this.name = ERROR_NAME;\r\n // Fix For ES5\r\n // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\r\n Object.setPrototypeOf(_this, FirebaseError.prototype);\r\n // Maintains proper stack trace for where our error was thrown.\r\n // Only available on V8.\r\n if (Error.captureStackTrace) {\r\n Error.captureStackTrace(_this, ErrorFactory.prototype.create);\r\n }\r\n return _this;\r\n }\r\n return FirebaseError;\r\n}(Error));\r\nvar ErrorFactory = /** @class */ (function () {\r\n function ErrorFactory(service, serviceName, errors) {\r\n this.service = service;\r\n this.serviceName = serviceName;\r\n this.errors = errors;\r\n }\r\n ErrorFactory.prototype.create = function (code) {\r\n var data = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n data[_i - 1] = arguments[_i];\r\n }\r\n var customData = data[0] || {};\r\n var fullCode = this.service + \"/\" + code;\r\n var template = this.errors[code];\r\n var message = template ? replaceTemplate(template, customData) : 'Error';\r\n // Service Name: Error message (service/code).\r\n var fullMessage = this.serviceName + \": \" + message + \" (\" + fullCode + \").\";\r\n var error = new FirebaseError(fullCode, fullMessage, customData);\r\n return error;\r\n };\r\n return ErrorFactory;\r\n}());\r\nfunction replaceTemplate(template, data) {\r\n return template.replace(PATTERN, function (_, key) {\r\n var value = data[key];\r\n return value != null ? String(value) : \"<\" + key + \"?>\";\r\n });\r\n}\r\nvar PATTERN = /\\{\\$([^}]+)}/g;\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Evaluates a JSON string into a javascript object.\r\n *\r\n * @param {string} str A string containing JSON.\r\n * @return {*} The javascript object representing the specified JSON.\r\n */\r\nfunction jsonEval(str) {\r\n return JSON.parse(str);\r\n}\r\n/**\r\n * Returns JSON representing a javascript object.\r\n * @param {*} data Javascript object to be stringified.\r\n * @return {string} The JSON contents of the object.\r\n */\r\nfunction stringify(data) {\r\n return JSON.stringify(data);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Decodes a Firebase auth. token into constituent parts.\r\n *\r\n * Notes:\r\n * - May return with invalid / incomplete claims if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n */\r\nvar decode = function (token) {\r\n var header = {}, claims = {}, data = {}, signature = '';\r\n try {\r\n var parts = token.split('.');\r\n header = jsonEval(base64Decode(parts[0]) || '');\r\n claims = jsonEval(base64Decode(parts[1]) || '');\r\n signature = parts[2];\r\n data = claims['d'] || {};\r\n delete claims['d'];\r\n }\r\n catch (e) { }\r\n return {\r\n header: header,\r\n claims: claims,\r\n data: data,\r\n signature: signature\r\n };\r\n};\r\n/**\r\n * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the\r\n * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.\r\n *\r\n * Notes:\r\n * - May return a false negative if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n */\r\nvar isValidTimestamp = function (token) {\r\n var claims = decode(token).claims;\r\n var now = Math.floor(new Date().getTime() / 1000);\r\n var validSince = 0, validUntil = 0;\r\n if (typeof claims === 'object') {\r\n if (claims.hasOwnProperty('nbf')) {\r\n validSince = claims['nbf'];\r\n }\r\n else if (claims.hasOwnProperty('iat')) {\r\n validSince = claims['iat'];\r\n }\r\n if (claims.hasOwnProperty('exp')) {\r\n validUntil = claims['exp'];\r\n }\r\n else {\r\n // token will expire after 24h by default\r\n validUntil = validSince + 86400;\r\n }\r\n }\r\n return (!!now &&\r\n !!validSince &&\r\n !!validUntil &&\r\n now >= validSince &&\r\n now <= validUntil);\r\n};\r\n/**\r\n * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.\r\n *\r\n * Notes:\r\n * - May return null if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n */\r\nvar issuedAtTime = function (token) {\r\n var claims = decode(token).claims;\r\n if (typeof claims === 'object' && claims.hasOwnProperty('iat')) {\r\n return claims['iat'];\r\n }\r\n return null;\r\n};\r\n/**\r\n * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.\r\n *\r\n * Notes:\r\n * - May return a false negative if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n */\r\nvar isValidFormat = function (token) {\r\n var decoded = decode(token), claims = decoded.claims;\r\n return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat');\r\n};\r\n/**\r\n * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.\r\n *\r\n * Notes:\r\n * - May return a false negative if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n */\r\nvar isAdmin = function (token) {\r\n var claims = decode(token).claims;\r\n return typeof claims === 'object' && claims['admin'] === true;\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction contains(obj, key) {\r\n return Object.prototype.hasOwnProperty.call(obj, key);\r\n}\r\nfunction safeGet(obj, key) {\r\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n return obj[key];\r\n }\r\n else {\r\n return undefined;\r\n }\r\n}\r\nfunction isEmpty(obj) {\r\n for (var key in obj) {\r\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\nfunction map(obj, fn, contextObj) {\r\n var res = {};\r\n for (var key in obj) {\r\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n res[key] = fn.call(contextObj, obj[key], key, obj);\r\n }\r\n }\r\n return res;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a\r\n * params object (e.g. {arg: 'val', arg2: 'val2'})\r\n * Note: You must prepend it with ? when adding it to a URL.\r\n */\r\nfunction querystring(querystringParams) {\r\n var params = [];\r\n var _loop_1 = function (key, value) {\r\n if (Array.isArray(value)) {\r\n value.forEach(function (arrayVal) {\r\n params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal));\r\n });\r\n }\r\n else {\r\n params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\r\n }\r\n };\r\n for (var _i = 0, _a = Object.entries(querystringParams); _i < _a.length; _i++) {\r\n var _b = _a[_i], key = _b[0], value = _b[1];\r\n _loop_1(key, value);\r\n }\r\n return params.length ? '&' + params.join('&') : '';\r\n}\r\n/**\r\n * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object\r\n * (e.g. {arg: 'val', arg2: 'val2'})\r\n */\r\nfunction querystringDecode(querystring) {\r\n var obj = {};\r\n var tokens = querystring.replace(/^\\?/, '').split('&');\r\n tokens.forEach(function (token) {\r\n if (token) {\r\n var key = token.split('=');\r\n obj[key[0]] = key[1];\r\n }\r\n });\r\n return obj;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @fileoverview SHA-1 cryptographic hash.\r\n * Variable names follow the notation in FIPS PUB 180-3:\r\n * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.\r\n *\r\n * Usage:\r\n * var sha1 = new sha1();\r\n * sha1.update(bytes);\r\n * var hash = sha1.digest();\r\n *\r\n * Performance:\r\n * Chrome 23: ~400 Mbit/s\r\n * Firefox 16: ~250 Mbit/s\r\n *\r\n */\r\n/**\r\n * SHA-1 cryptographic hash constructor.\r\n *\r\n * The properties declared here are discussed in the above algorithm document.\r\n * @constructor\r\n * @final\r\n * @struct\r\n */\r\nvar Sha1 = /** @class */ (function () {\r\n function Sha1() {\r\n /**\r\n * Holds the previous values of accumulated variables a-e in the compress_\r\n * function.\r\n * @private\r\n */\r\n this.chain_ = [];\r\n /**\r\n * A buffer holding the partially computed hash result.\r\n * @private\r\n */\r\n this.buf_ = [];\r\n /**\r\n * An array of 80 bytes, each a part of the message to be hashed. Referred to\r\n * as the message schedule in the docs.\r\n * @private\r\n */\r\n this.W_ = [];\r\n /**\r\n * Contains data needed to pad messages less than 64 bytes.\r\n * @private\r\n */\r\n this.pad_ = [];\r\n /**\r\n * @private {number}\r\n */\r\n this.inbuf_ = 0;\r\n /**\r\n * @private {number}\r\n */\r\n this.total_ = 0;\r\n this.blockSize = 512 / 8;\r\n this.pad_[0] = 128;\r\n for (var i = 1; i < this.blockSize; ++i) {\r\n this.pad_[i] = 0;\r\n }\r\n this.reset();\r\n }\r\n Sha1.prototype.reset = function () {\r\n this.chain_[0] = 0x67452301;\r\n this.chain_[1] = 0xefcdab89;\r\n this.chain_[2] = 0x98badcfe;\r\n this.chain_[3] = 0x10325476;\r\n this.chain_[4] = 0xc3d2e1f0;\r\n this.inbuf_ = 0;\r\n this.total_ = 0;\r\n };\r\n /**\r\n * Internal compress helper function.\r\n * @param buf Block to compress.\r\n * @param offset Offset of the block in the buffer.\r\n * @private\r\n */\r\n Sha1.prototype.compress_ = function (buf, offset) {\r\n if (!offset) {\r\n offset = 0;\r\n }\r\n var W = this.W_;\r\n // get 16 big endian words\r\n if (typeof buf === 'string') {\r\n for (var i = 0; i < 16; i++) {\r\n // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS\r\n // have a bug that turns the post-increment ++ operator into pre-increment\r\n // during JIT compilation. We have code that depends heavily on SHA-1 for\r\n // correctness and which is affected by this bug, so I've removed all uses\r\n // of post-increment ++ in which the result value is used. We can revert\r\n // this change once the Safari bug\r\n // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and\r\n // most clients have been updated.\r\n W[i] =\r\n (buf.charCodeAt(offset) << 24) |\r\n (buf.charCodeAt(offset + 1) << 16) |\r\n (buf.charCodeAt(offset + 2) << 8) |\r\n buf.charCodeAt(offset + 3);\r\n offset += 4;\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < 16; i++) {\r\n W[i] =\r\n (buf[offset] << 24) |\r\n (buf[offset + 1] << 16) |\r\n (buf[offset + 2] << 8) |\r\n buf[offset + 3];\r\n offset += 4;\r\n }\r\n }\r\n // expand to 80 words\r\n for (var i = 16; i < 80; i++) {\r\n var t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\r\n W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;\r\n }\r\n var a = this.chain_[0];\r\n var b = this.chain_[1];\r\n var c = this.chain_[2];\r\n var d = this.chain_[3];\r\n var e = this.chain_[4];\r\n var f, k;\r\n // TODO(user): Try to unroll this loop to speed up the computation.\r\n for (var i = 0; i < 80; i++) {\r\n if (i < 40) {\r\n if (i < 20) {\r\n f = d ^ (b & (c ^ d));\r\n k = 0x5a827999;\r\n }\r\n else {\r\n f = b ^ c ^ d;\r\n k = 0x6ed9eba1;\r\n }\r\n }\r\n else {\r\n if (i < 60) {\r\n f = (b & c) | (d & (b | c));\r\n k = 0x8f1bbcdc;\r\n }\r\n else {\r\n f = b ^ c ^ d;\r\n k = 0xca62c1d6;\r\n }\r\n }\r\n var t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;\r\n e = d;\r\n d = c;\r\n c = ((b << 30) | (b >>> 2)) & 0xffffffff;\r\n b = a;\r\n a = t;\r\n }\r\n this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;\r\n this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;\r\n this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;\r\n this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;\r\n this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;\r\n };\r\n Sha1.prototype.update = function (bytes, length) {\r\n // TODO(johnlenz): tighten the function signature and remove this check\r\n if (bytes == null) {\r\n return;\r\n }\r\n if (length === undefined) {\r\n length = bytes.length;\r\n }\r\n var lengthMinusBlock = length - this.blockSize;\r\n var n = 0;\r\n // Using local instead of member variables gives ~5% speedup on Firefox 16.\r\n var buf = this.buf_;\r\n var inbuf = this.inbuf_;\r\n // The outer while loop should execute at most twice.\r\n while (n < length) {\r\n // When we have no data in the block to top up, we can directly process the\r\n // input buffer (assuming it contains sufficient data). This gives ~25%\r\n // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that\r\n // the data is provided in large chunks (or in multiples of 64 bytes).\r\n if (inbuf === 0) {\r\n while (n <= lengthMinusBlock) {\r\n this.compress_(bytes, n);\r\n n += this.blockSize;\r\n }\r\n }\r\n if (typeof bytes === 'string') {\r\n while (n < length) {\r\n buf[inbuf] = bytes.charCodeAt(n);\r\n ++inbuf;\r\n ++n;\r\n if (inbuf === this.blockSize) {\r\n this.compress_(buf);\r\n inbuf = 0;\r\n // Jump to the outer loop so we use the full-block optimization.\r\n break;\r\n }\r\n }\r\n }\r\n else {\r\n while (n < length) {\r\n buf[inbuf] = bytes[n];\r\n ++inbuf;\r\n ++n;\r\n if (inbuf === this.blockSize) {\r\n this.compress_(buf);\r\n inbuf = 0;\r\n // Jump to the outer loop so we use the full-block optimization.\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n this.inbuf_ = inbuf;\r\n this.total_ += length;\r\n };\r\n /** @override */\r\n Sha1.prototype.digest = function () {\r\n var digest = [];\r\n var totalBits = this.total_ * 8;\r\n // Add pad 0x80 0x00*.\r\n if (this.inbuf_ < 56) {\r\n this.update(this.pad_, 56 - this.inbuf_);\r\n }\r\n else {\r\n this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));\r\n }\r\n // Add # bits.\r\n for (var i = this.blockSize - 1; i >= 56; i--) {\r\n this.buf_[i] = totalBits & 255;\r\n totalBits /= 256; // Don't use bit-shifting here!\r\n }\r\n this.compress_(this.buf_);\r\n var n = 0;\r\n for (var i = 0; i < 5; i++) {\r\n for (var j = 24; j >= 0; j -= 8) {\r\n digest[n] = (this.chain_[i] >> j) & 255;\r\n ++n;\r\n }\r\n }\r\n return digest;\r\n };\r\n return Sha1;\r\n}());\n\n/**\r\n * Helper to make a Subscribe function (just like Promise helps make a\r\n * Thenable).\r\n *\r\n * @param executor Function which can make calls to a single Observer\r\n * as a proxy.\r\n * @param onNoObservers Callback when count of Observers goes to zero.\r\n */\r\nfunction createSubscribe(executor, onNoObservers) {\r\n var proxy = new ObserverProxy(executor, onNoObservers);\r\n return proxy.subscribe.bind(proxy);\r\n}\r\n/**\r\n * Implement fan-out for any number of Observers attached via a subscribe\r\n * function.\r\n */\r\nvar ObserverProxy = /** @class */ (function () {\r\n /**\r\n * @param executor Function which can make calls to a single Observer\r\n * as a proxy.\r\n * @param onNoObservers Callback when count of Observers goes to zero.\r\n */\r\n function ObserverProxy(executor, onNoObservers) {\r\n var _this = this;\r\n this.observers = [];\r\n this.unsubscribes = [];\r\n this.observerCount = 0;\r\n // Micro-task scheduling by calling task.then().\r\n this.task = Promise.resolve();\r\n this.finalized = false;\r\n this.onNoObservers = onNoObservers;\r\n // Call the executor asynchronously so subscribers that are called\r\n // synchronously after the creation of the subscribe function\r\n // can still receive the very first value generated in the executor.\r\n this.task\r\n .then(function () {\r\n executor(_this);\r\n })\r\n .catch(function (e) {\r\n _this.error(e);\r\n });\r\n }\r\n ObserverProxy.prototype.next = function (value) {\r\n this.forEachObserver(function (observer) {\r\n observer.next(value);\r\n });\r\n };\r\n ObserverProxy.prototype.error = function (error) {\r\n this.forEachObserver(function (observer) {\r\n observer.error(error);\r\n });\r\n this.close(error);\r\n };\r\n ObserverProxy.prototype.complete = function () {\r\n this.forEachObserver(function (observer) {\r\n observer.complete();\r\n });\r\n this.close();\r\n };\r\n /**\r\n * Subscribe function that can be used to add an Observer to the fan-out list.\r\n *\r\n * - We require that no event is sent to a subscriber sychronously to their\r\n * call to subscribe().\r\n */\r\n ObserverProxy.prototype.subscribe = function (nextOrObserver, error, complete) {\r\n var _this = this;\r\n var observer;\r\n if (nextOrObserver === undefined &&\r\n error === undefined &&\r\n complete === undefined) {\r\n throw new Error('Missing Observer.');\r\n }\r\n // Assemble an Observer object when passed as callback functions.\r\n if (implementsAnyMethods(nextOrObserver, [\r\n 'next',\r\n 'error',\r\n 'complete'\r\n ])) {\r\n observer = nextOrObserver;\r\n }\r\n else {\r\n observer = {\r\n next: nextOrObserver,\r\n error: error,\r\n complete: complete\r\n };\r\n }\r\n if (observer.next === undefined) {\r\n observer.next = noop;\r\n }\r\n if (observer.error === undefined) {\r\n observer.error = noop;\r\n }\r\n if (observer.complete === undefined) {\r\n observer.complete = noop;\r\n }\r\n var unsub = this.unsubscribeOne.bind(this, this.observers.length);\r\n // Attempt to subscribe to a terminated Observable - we\r\n // just respond to the Observer with the final error or complete\r\n // event.\r\n if (this.finalized) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.task.then(function () {\r\n try {\r\n if (_this.finalError) {\r\n observer.error(_this.finalError);\r\n }\r\n else {\r\n observer.complete();\r\n }\r\n }\r\n catch (e) {\r\n // nothing\r\n }\r\n return;\r\n });\r\n }\r\n this.observers.push(observer);\r\n return unsub;\r\n };\r\n // Unsubscribe is synchronous - we guarantee that no events are sent to\r\n // any unsubscribed Observer.\r\n ObserverProxy.prototype.unsubscribeOne = function (i) {\r\n if (this.observers === undefined || this.observers[i] === undefined) {\r\n return;\r\n }\r\n delete this.observers[i];\r\n this.observerCount -= 1;\r\n if (this.observerCount === 0 && this.onNoObservers !== undefined) {\r\n this.onNoObservers(this);\r\n }\r\n };\r\n ObserverProxy.prototype.forEachObserver = function (fn) {\r\n if (this.finalized) {\r\n // Already closed by previous event....just eat the additional values.\r\n return;\r\n }\r\n // Since sendOne calls asynchronously - there is no chance that\r\n // this.observers will become undefined.\r\n for (var i = 0; i < this.observers.length; i++) {\r\n this.sendOne(i, fn);\r\n }\r\n };\r\n // Call the Observer via one of it's callback function. We are careful to\r\n // confirm that the observe has not been unsubscribed since this asynchronous\r\n // function had been queued.\r\n ObserverProxy.prototype.sendOne = function (i, fn) {\r\n var _this = this;\r\n // Execute the callback asynchronously\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.task.then(function () {\r\n if (_this.observers !== undefined && _this.observers[i] !== undefined) {\r\n try {\r\n fn(_this.observers[i]);\r\n }\r\n catch (e) {\r\n // Ignore exceptions raised in Observers or missing methods of an\r\n // Observer.\r\n // Log error to console. b/31404806\r\n if (typeof console !== 'undefined' && console.error) {\r\n console.error(e);\r\n }\r\n }\r\n }\r\n });\r\n };\r\n ObserverProxy.prototype.close = function (err) {\r\n var _this = this;\r\n if (this.finalized) {\r\n return;\r\n }\r\n this.finalized = true;\r\n if (err !== undefined) {\r\n this.finalError = err;\r\n }\r\n // Proxy is no longer needed - garbage collect references\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.task.then(function () {\r\n _this.observers = undefined;\r\n _this.onNoObservers = undefined;\r\n });\r\n };\r\n return ObserverProxy;\r\n}());\r\n/** Turn synchronous function into one called asynchronously. */\r\n// eslint-disable-next-line @typescript-eslint/ban-types\r\nfunction async(fn, onError) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n Promise.resolve(true)\r\n .then(function () {\r\n fn.apply(void 0, args);\r\n })\r\n .catch(function (error) {\r\n if (onError) {\r\n onError(error);\r\n }\r\n });\r\n };\r\n}\r\n/**\r\n * Return true if the object passed in implements any of the named methods.\r\n */\r\nfunction implementsAnyMethods(obj, methods) {\r\n if (typeof obj !== 'object' || obj === null) {\r\n return false;\r\n }\r\n for (var _i = 0, methods_1 = methods; _i < methods_1.length; _i++) {\r\n var method = methods_1[_i];\r\n if (method in obj && typeof obj[method] === 'function') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction noop() {\r\n // do nothing\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Check to make sure the appropriate number of arguments are provided for a public function.\r\n * Throws an error if it fails.\r\n *\r\n * @param fnName The function name\r\n * @param minCount The minimum number of arguments to allow for the function call\r\n * @param maxCount The maximum number of argument to allow for the function call\r\n * @param argCount The actual number of arguments provided.\r\n */\r\nvar validateArgCount = function (fnName, minCount, maxCount, argCount) {\r\n var argError;\r\n if (argCount < minCount) {\r\n argError = 'at least ' + minCount;\r\n }\r\n else if (argCount > maxCount) {\r\n argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount;\r\n }\r\n if (argError) {\r\n var error = fnName +\r\n ' failed: Was called with ' +\r\n argCount +\r\n (argCount === 1 ? ' argument.' : ' arguments.') +\r\n ' Expects ' +\r\n argError +\r\n '.';\r\n throw new Error(error);\r\n }\r\n};\r\n/**\r\n * Generates a string to prefix an error message about failed argument validation\r\n *\r\n * @param fnName The function name\r\n * @param argumentNumber The index of the argument\r\n * @param optional Whether or not the argument is optional\r\n * @return The prefix to add to the error thrown for validation.\r\n */\r\nfunction errorPrefix(fnName, argumentNumber, optional) {\r\n var argName = '';\r\n switch (argumentNumber) {\r\n case 1:\r\n argName = optional ? 'first' : 'First';\r\n break;\r\n case 2:\r\n argName = optional ? 'second' : 'Second';\r\n break;\r\n case 3:\r\n argName = optional ? 'third' : 'Third';\r\n break;\r\n case 4:\r\n argName = optional ? 'fourth' : 'Fourth';\r\n break;\r\n default:\r\n throw new Error('errorPrefix called with argumentNumber > 4. Need to update it?');\r\n }\r\n var error = fnName + ' failed: ';\r\n error += argName + ' argument ';\r\n return error;\r\n}\r\n/**\r\n * @param fnName\r\n * @param argumentNumber\r\n * @param namespace\r\n * @param optional\r\n */\r\nfunction validateNamespace(fnName, argumentNumber, namespace, optional) {\r\n if (optional && !namespace) {\r\n return;\r\n }\r\n if (typeof namespace !== 'string') {\r\n //TODO: I should do more validation here. We only allow certain chars in namespaces.\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) +\r\n 'must be a valid firebase namespace.');\r\n }\r\n}\r\nfunction validateCallback(fnName, argumentNumber, \r\n// eslint-disable-next-line @typescript-eslint/ban-types\r\ncallback, optional) {\r\n if (optional && !callback) {\r\n return;\r\n }\r\n if (typeof callback !== 'function') {\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) +\r\n 'must be a valid function.');\r\n }\r\n}\r\nfunction validateContextObject(fnName, argumentNumber, context, optional) {\r\n if (optional && !context) {\r\n return;\r\n }\r\n if (typeof context !== 'object' || context === null) {\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) +\r\n 'must be a valid context object.');\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they\r\n// automatically replaced '\\r\\n' with '\\n', and they didn't handle surrogate pairs,\r\n// so it's been modified.\r\n// Note that not all Unicode characters appear as single characters in JavaScript strings.\r\n// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters\r\n// use 2 characters in Javascript. All 4-byte UTF-8 characters begin with a first\r\n// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate\r\n// pair).\r\n// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3\r\n/**\r\n * @param {string} str\r\n * @return {Array}\r\n */\r\nvar stringToByteArray$1 = function (str) {\r\n var out = [];\r\n var p = 0;\r\n for (var i = 0; i < str.length; i++) {\r\n var c = str.charCodeAt(i);\r\n // Is this the lead surrogate in a surrogate pair?\r\n if (c >= 0xd800 && c <= 0xdbff) {\r\n var high = c - 0xd800; // the high 10 bits.\r\n i++;\r\n assert(i < str.length, 'Surrogate pair missing trail surrogate.');\r\n var low = str.charCodeAt(i) - 0xdc00; // the low 10 bits.\r\n c = 0x10000 + (high << 10) + low;\r\n }\r\n if (c < 128) {\r\n out[p++] = c;\r\n }\r\n else if (c < 2048) {\r\n out[p++] = (c >> 6) | 192;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n else if (c < 65536) {\r\n out[p++] = (c >> 12) | 224;\r\n out[p++] = ((c >> 6) & 63) | 128;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n else {\r\n out[p++] = (c >> 18) | 240;\r\n out[p++] = ((c >> 12) & 63) | 128;\r\n out[p++] = ((c >> 6) & 63) | 128;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n }\r\n return out;\r\n};\r\n/**\r\n * Calculate length without actually converting; useful for doing cheaper validation.\r\n * @param {string} str\r\n * @return {number}\r\n */\r\nvar stringLength = function (str) {\r\n var p = 0;\r\n for (var i = 0; i < str.length; i++) {\r\n var c = str.charCodeAt(i);\r\n if (c < 128) {\r\n p++;\r\n }\r\n else if (c < 2048) {\r\n p += 2;\r\n }\r\n else if (c >= 0xd800 && c <= 0xdbff) {\r\n // Lead surrogate of a surrogate pair. The pair together will take 4 bytes to represent.\r\n p += 4;\r\n i++; // skip trail surrogate.\r\n }\r\n else {\r\n p += 3;\r\n }\r\n }\r\n return p;\r\n};\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * The amount of milliseconds to exponentially increase.\r\n */\r\nvar DEFAULT_INTERVAL_MILLIS = 1000;\r\n/**\r\n * The factor to backoff by.\r\n * Should be a number greater than 1.\r\n */\r\nvar DEFAULT_BACKOFF_FACTOR = 2;\r\n/**\r\n * The maximum milliseconds to increase to.\r\n *\r\n * <p>Visible for testing\r\n */\r\nvar MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android.\r\n/**\r\n * The percentage of backoff time to randomize by.\r\n * See\r\n * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic\r\n * for context.\r\n *\r\n * <p>Visible for testing\r\n */\r\nvar RANDOM_FACTOR = 0.5;\r\n/**\r\n * Based on the backoff method from\r\n * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js.\r\n * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around.\r\n */\r\nfunction calculateBackoffMillis(backoffCount, intervalMillis, backoffFactor) {\r\n if (intervalMillis === void 0) { intervalMillis = DEFAULT_INTERVAL_MILLIS; }\r\n if (backoffFactor === void 0) { backoffFactor = DEFAULT_BACKOFF_FACTOR; }\r\n // Calculates an exponentially increasing value.\r\n // Deviation: calculates value from count and a constant interval, so we only need to save value\r\n // and count to restore state.\r\n var currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount);\r\n // A random \"fuzz\" to avoid waves of retries.\r\n // Deviation: randomFactor is required.\r\n var randomWait = Math.round(\r\n // A fraction of the backoff value to add/subtract.\r\n // Deviation: changes multiplication order to improve readability.\r\n RANDOM_FACTOR *\r\n currBaseValue *\r\n // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines\r\n // if we add or subtract.\r\n (Math.random() - 0.5) *\r\n 2);\r\n // Limits backoff to max to avoid effectively permanent backoff.\r\n return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Provide English ordinal letters after a number\r\n */\r\nfunction ordinal(i) {\r\n if (!Number.isFinite(i)) {\r\n return \"\" + i;\r\n }\r\n return i + indicator(i);\r\n}\r\nfunction indicator(i) {\r\n i = Math.abs(i);\r\n var cent = i % 100;\r\n if (cent >= 10 && cent <= 20) {\r\n return 'th';\r\n }\r\n var dec = i % 10;\r\n if (dec === 1) {\r\n return 'st';\r\n }\r\n if (dec === 2) {\r\n return 'nd';\r\n }\r\n if (dec === 3) {\r\n return 'rd';\r\n }\r\n return 'th';\r\n}\n\nexport { CONSTANTS, Deferred, ErrorFactory, FirebaseError, MAX_VALUE_MILLIS, RANDOM_FACTOR, Sha1, areCookiesEnabled, assert, assertionError, async, base64, base64Decode, base64Encode, calculateBackoffMillis, contains, createSubscribe, decode, deepCopy, deepExtend, errorPrefix, getUA, isAdmin, isBrowser, isBrowserExtension, isElectron, isEmpty, isIE, isIndexedDBAvailable, isMobileCordova, isNode, isNodeSdk, isReactNative, isSafari, isUWP, isValidFormat, isValidTimestamp, issuedAtTime, jsonEval, map, ordinal, querystring, querystringDecode, safeGet, stringLength, stringToByteArray$1 as stringToByteArray, stringify, validateArgCount, validateCallback, validateContextObject, validateIndexedDBOpenable, validateNamespace };\n//# sourceMappingURL=index.esm.js.map\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nfunction __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\n\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nvar g, goog = goog || {}, k = commonjsGlobal || self;\r\nfunction aa() { }\r\nfunction ba(a) { var b = typeof a; return \"object\" != b ? b : a ? Array.isArray(a) ? \"array\" : b : \"null\"; }\r\nfunction ca(a) { var b = ba(a); return \"array\" == b || \"object\" == b && \"number\" == typeof a.length; }\r\nfunction n(a) { var b = typeof a; return \"object\" == b && null != a || \"function\" == b; }\r\nfunction da(a) { return Object.prototype.hasOwnProperty.call(a, ea) && a[ea] || (a[ea] = ++fa); }\r\nvar ea = \"closure_uid_\" + (1E9 * Math.random() >>> 0), fa = 0;\r\nfunction ha(a, b, c) { return a.call.apply(a.bind, arguments); }\r\nfunction ja(a, b, c) { if (!a)\r\n throw Error(); if (2 < arguments.length) {\r\n var d = Array.prototype.slice.call(arguments, 2);\r\n return function () { var e = Array.prototype.slice.call(arguments); Array.prototype.unshift.apply(e, d); return a.apply(b, e); };\r\n} return function () { return a.apply(b, arguments); }; }\r\nfunction p(a, b, c) { Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf(\"native code\") ? p = ha : p = ja; return p.apply(null, arguments); }\r\nfunction ka(a, b) { var c = Array.prototype.slice.call(arguments, 1); return function () { var d = c.slice(); d.push.apply(d, arguments); return a.apply(this, d); }; }\r\nvar q = Date.now;\r\nfunction r(a, b) { function c() { } c.prototype = b.prototype; a.S = b.prototype; a.prototype = new c; a.prototype.constructor = a; }\r\nfunction u() { this.j = this.j; this.i = this.i; }\r\nvar la = 0;\r\nu.prototype.j = !1;\r\nu.prototype.ja = function () { if (!this.j && (this.j = !0, this.G(), 0 != la)) {\r\n var a = da(this);\r\n} };\r\nu.prototype.G = function () { if (this.i)\r\n for (; this.i.length;)\r\n this.i.shift()(); };\r\nvar na = Array.prototype.indexOf ? function (a, b) { return Array.prototype.indexOf.call(a, b, void 0); } : function (a, b) { if (\"string\" === typeof a)\r\n return \"string\" !== typeof b || 1 != b.length ? -1 : a.indexOf(b, 0); for (var c = 0; c < a.length; c++)\r\n if (c in a && a[c] === b)\r\n return c; return -1; }, oa = Array.prototype.forEach ? function (a, b, c) { Array.prototype.forEach.call(a, b, c); } : function (a, b, c) { for (var d = a.length, e = \"string\" === typeof a ? a.split(\"\") : a, f = 0; f < d; f++)\r\n f in e && b.call(c, e[f], f, a); };\r\nfunction pa(a) { a: {\r\n var b = qa;\r\n for (var c = a.length, d = \"string\" === typeof a ? a.split(\"\") : a, e = 0; e < c; e++)\r\n if (e in d && b.call(void 0, d[e], e, a)) {\r\n b = e;\r\n break a;\r\n }\r\n b = -1;\r\n} return 0 > b ? null : \"string\" === typeof a ? a.charAt(b) : a[b]; }\r\nfunction ra(a) { return Array.prototype.concat.apply([], arguments); }\r\nfunction sa(a) { var b = a.length; if (0 < b) {\r\n for (var c = Array(b), d = 0; d < b; d++)\r\n c[d] = a[d];\r\n return c;\r\n} return []; }\r\nfunction ta(a) { return /^[\\s\\xa0]*$/.test(a); }\r\nvar ua = String.prototype.trim ? function (a) { return a.trim(); } : function (a) { return /^[\\s\\xa0]*([\\s\\S]*?)[\\s\\xa0]*$/.exec(a)[1]; };\r\nfunction v(a, b) { return -1 != a.indexOf(b); }\r\nfunction xa(a, b) { return a < b ? -1 : a > b ? 1 : 0; }\r\nvar w;\r\na: {\r\n var ya = k.navigator;\r\n if (ya) {\r\n var za = ya.userAgent;\r\n if (za) {\r\n w = za;\r\n break a;\r\n }\r\n }\r\n w = \"\";\r\n}\r\nfunction Aa(a, b, c) { for (var d in a)\r\n b.call(c, a[d], d, a); }\r\nfunction Ba(a) { var b = {}; for (var c in a)\r\n b[c] = a[c]; return b; }\r\nvar Ca = \"constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf\".split(\" \");\r\nfunction Da(a, b) { var c, d; for (var e = 1; e < arguments.length; e++) {\r\n d = arguments[e];\r\n for (c in d)\r\n a[c] = d[c];\r\n for (var f = 0; f < Ca.length; f++)\r\n c = Ca[f], Object.prototype.hasOwnProperty.call(d, c) && (a[c] = d[c]);\r\n} }\r\nfunction Ea(a) { Ea[\" \"](a); return a; }\r\nEa[\" \"] = aa;\r\nfunction Fa(a, b) { var c = Ga; return Object.prototype.hasOwnProperty.call(c, a) ? c[a] : c[a] = b(a); }\r\nvar Ha = v(w, \"Opera\"), x = v(w, \"Trident\") || v(w, \"MSIE\"), Ia = v(w, \"Edge\"), Ja = Ia || x, Ka = v(w, \"Gecko\") && !(v(w.toLowerCase(), \"webkit\") && !v(w, \"Edge\")) && !(v(w, \"Trident\") || v(w, \"MSIE\")) && !v(w, \"Edge\"), La = v(w.toLowerCase(), \"webkit\") && !v(w, \"Edge\");\r\nfunction Ma() { var a = k.document; return a ? a.documentMode : void 0; }\r\nvar Na;\r\na: {\r\n var Oa = \"\", Pa = function () { var a = w; if (Ka)\r\n return /rv:([^\\);]+)(\\)|;)/.exec(a); if (Ia)\r\n return /Edge\\/([\\d\\.]+)/.exec(a); if (x)\r\n return /\\b(?:MSIE|rv)[: ]([^\\);]+)(\\)|;)/.exec(a); if (La)\r\n return /WebKit\\/(\\S+)/.exec(a); if (Ha)\r\n return /(?:Version)[ \\/]?(\\S+)/.exec(a); }();\r\n Pa && (Oa = Pa ? Pa[1] : \"\");\r\n if (x) {\r\n var Qa = Ma();\r\n if (null != Qa && Qa > parseFloat(Oa)) {\r\n Na = String(Qa);\r\n break a;\r\n }\r\n }\r\n Na = Oa;\r\n}\r\nvar Ga = {};\r\nfunction Ra(a) { return Fa(a, function () { {\r\n var b = 0;\r\n var e = ua(String(Na)).split(\".\"), f = ua(String(a)).split(\".\"), h = Math.max(e.length, f.length);\r\n for (var m = 0; 0 == b && m < h; m++) {\r\n var c = e[m] || \"\", d = f[m] || \"\";\r\n do {\r\n c = /(\\d*)(\\D*)(.*)/.exec(c) || [\"\", \"\", \"\", \"\"];\r\n d = /(\\d*)(\\D*)(.*)/.exec(d) || [\"\", \"\", \"\", \"\"];\r\n if (0 == c[0].length && 0 == d[0].length)\r\n break;\r\n b = xa(0 == c[1].length ? 0 : parseInt(c[1], 10), 0 == d[1].length ? 0 : parseInt(d[1], 10)) || xa(0 == c[2].length, 0 == d[2].length) || xa(c[2], d[2]);\r\n c = c[3];\r\n d = d[3];\r\n } while (0 == b);\r\n }\r\n} return 0 <= b; }); }\r\nvar Sa;\r\nif (k.document && x) {\r\n var Ta = Ma();\r\n Sa = Ta ? Ta : parseInt(Na, 10) || void 0;\r\n}\r\nelse\r\n Sa = void 0;\r\nvar Ua = Sa;\r\nvar Va = !x || 9 <= Number(Ua), Wa = x && !Ra(\"9\"), Xa = function () { if (!k.addEventListener || !Object.defineProperty)\r\n return !1; var a = !1, b = Object.defineProperty({}, \"passive\", { get: function () { a = !0; } }); try {\r\n k.addEventListener(\"test\", aa, b), k.removeEventListener(\"test\", aa, b);\r\n}\r\ncatch (c) { } return a; }();\r\nfunction y(a, b) { this.type = a; this.a = this.target = b; this.defaultPrevented = !1; }\r\ny.prototype.b = function () { this.defaultPrevented = !0; };\r\nfunction A(a, b) {\r\n y.call(this, a ? a.type : \"\");\r\n this.relatedTarget = this.a = this.target = null;\r\n this.button = this.screenY = this.screenX = this.clientY = this.clientX = 0;\r\n this.key = \"\";\r\n this.metaKey = this.shiftKey = this.altKey = this.ctrlKey = !1;\r\n this.pointerId = 0;\r\n this.pointerType = \"\";\r\n this.c = null;\r\n if (a) {\r\n var c = this.type = a.type, d = a.changedTouches && a.changedTouches.length ? a.changedTouches[0] : null;\r\n this.target = a.target || a.srcElement;\r\n this.a = b;\r\n if (b = a.relatedTarget) {\r\n if (Ka) {\r\n a: {\r\n try {\r\n Ea(b.nodeName);\r\n var e = !0;\r\n break a;\r\n }\r\n catch (f) { }\r\n e = !1;\r\n }\r\n e || (b = null);\r\n }\r\n }\r\n else\r\n \"mouseover\" ==\r\n c ? b = a.fromElement : \"mouseout\" == c && (b = a.toElement);\r\n this.relatedTarget = b;\r\n d ? (this.clientX = void 0 !== d.clientX ? d.clientX : d.pageX, this.clientY = void 0 !== d.clientY ? d.clientY : d.pageY, this.screenX = d.screenX || 0, this.screenY = d.screenY || 0) : (this.clientX = void 0 !== a.clientX ? a.clientX : a.pageX, this.clientY = void 0 !== a.clientY ? a.clientY : a.pageY, this.screenX = a.screenX || 0, this.screenY = a.screenY || 0);\r\n this.button = a.button;\r\n this.key = a.key || \"\";\r\n this.ctrlKey = a.ctrlKey;\r\n this.altKey = a.altKey;\r\n this.shiftKey = a.shiftKey;\r\n this.metaKey =\r\n a.metaKey;\r\n this.pointerId = a.pointerId || 0;\r\n this.pointerType = \"string\" === typeof a.pointerType ? a.pointerType : Ya[a.pointerType] || \"\";\r\n this.c = a;\r\n a.defaultPrevented && this.b();\r\n }\r\n}\r\nr(A, y);\r\nvar Ya = { 2: \"touch\", 3: \"pen\", 4: \"mouse\" };\r\nA.prototype.b = function () { A.S.b.call(this); var a = this.c; if (a.preventDefault)\r\n a.preventDefault();\r\nelse if (a.returnValue = !1, Wa)\r\n try {\r\n if (a.ctrlKey || 112 <= a.keyCode && 123 >= a.keyCode)\r\n a.keyCode = -1;\r\n }\r\n catch (b) { } };\r\nvar C = \"closure_listenable_\" + (1E6 * Math.random() | 0), Za = 0;\r\nfunction $a(a, b, c, d, e) { this.listener = a; this.proxy = null; this.src = b; this.type = c; this.capture = !!d; this.ca = e; this.key = ++Za; this.Y = this.Z = !1; }\r\nfunction ab(a) { a.Y = !0; a.listener = null; a.proxy = null; a.src = null; a.ca = null; }\r\nfunction bb(a) { this.src = a; this.a = {}; this.b = 0; }\r\nbb.prototype.add = function (a, b, c, d, e) { var f = a.toString(); a = this.a[f]; a || (a = this.a[f] = [], this.b++); var h = cb(a, b, d, e); -1 < h ? (b = a[h], c || (b.Z = !1)) : (b = new $a(b, this.src, f, !!d, e), b.Z = c, a.push(b)); return b; };\r\nfunction db(a, b) { var c = b.type; if (c in a.a) {\r\n var d = a.a[c], e = na(d, b), f;\r\n (f = 0 <= e) && Array.prototype.splice.call(d, e, 1);\r\n f && (ab(b), 0 == a.a[c].length && (delete a.a[c], a.b--));\r\n} }\r\nfunction cb(a, b, c, d) { for (var e = 0; e < a.length; ++e) {\r\n var f = a[e];\r\n if (!f.Y && f.listener == b && f.capture == !!c && f.ca == d)\r\n return e;\r\n} return -1; }\r\nvar eb = \"closure_lm_\" + (1E6 * Math.random() | 0), fb = {};\r\nfunction hb(a, b, c, d, e) { if (d && d.once)\r\n return ib(a, b, c, d, e); if (Array.isArray(b)) {\r\n for (var f = 0; f < b.length; f++)\r\n hb(a, b[f], c, d, e);\r\n return null;\r\n} c = jb(c); return a && a[C] ? a.va(b, c, n(d) ? !!d.capture : !!d, e) : kb(a, b, c, !1, d, e); }\r\nfunction kb(a, b, c, d, e, f) {\r\n if (!b)\r\n throw Error(\"Invalid event type\");\r\n var h = n(e) ? !!e.capture : !!e;\r\n if (h && !Va)\r\n return null;\r\n var m = lb(a);\r\n m || (a[eb] = m = new bb(a));\r\n c = m.add(b, c, d, h, f);\r\n if (c.proxy)\r\n return c;\r\n d = mb();\r\n c.proxy = d;\r\n d.src = a;\r\n d.listener = c;\r\n if (a.addEventListener)\r\n Xa || (e = h), void 0 === e && (e = !1), a.addEventListener(b.toString(), d, e);\r\n else if (a.attachEvent)\r\n a.attachEvent(nb(b.toString()), d);\r\n else if (a.addListener && a.removeListener)\r\n a.addListener(d);\r\n else\r\n throw Error(\"addEventListener and attachEvent are unavailable.\");\r\n return c;\r\n}\r\nfunction mb() { var a = ob, b = Va ? function (c) { return a.call(b.src, b.listener, c); } : function (c) { c = a.call(b.src, b.listener, c); if (!c)\r\n return c; }; return b; }\r\nfunction ib(a, b, c, d, e) { if (Array.isArray(b)) {\r\n for (var f = 0; f < b.length; f++)\r\n ib(a, b[f], c, d, e);\r\n return null;\r\n} c = jb(c); return a && a[C] ? a.wa(b, c, n(d) ? !!d.capture : !!d, e) : kb(a, b, c, !0, d, e); }\r\nfunction pb(a, b, c, d, e) { if (Array.isArray(b))\r\n for (var f = 0; f < b.length; f++)\r\n pb(a, b[f], c, d, e);\r\nelse\r\n (d = n(d) ? !!d.capture : !!d, c = jb(c), a && a[C]) ? (a = a.c, b = String(b).toString(), b in a.a && (f = a.a[b], c = cb(f, c, d, e), -1 < c && (ab(f[c]), Array.prototype.splice.call(f, c, 1), 0 == f.length && (delete a.a[b], a.b--)))) : a && (a = lb(a)) && (b = a.a[b.toString()], a = -1, b && (a = cb(b, c, d, e)), (c = -1 < a ? b[a] : null) && rb(c)); }\r\nfunction rb(a) { if (\"number\" !== typeof a && a && !a.Y) {\r\n var b = a.src;\r\n if (b && b[C])\r\n db(b.c, a);\r\n else {\r\n var c = a.type, d = a.proxy;\r\n b.removeEventListener ? b.removeEventListener(c, d, a.capture) : b.detachEvent ? b.detachEvent(nb(c), d) : b.addListener && b.removeListener && b.removeListener(d);\r\n (c = lb(b)) ? (db(c, a), 0 == c.b && (c.src = null, b[eb] = null)) : ab(a);\r\n }\r\n} }\r\nfunction nb(a) { return a in fb ? fb[a] : fb[a] = \"on\" + a; }\r\nfunction sb(a, b) { var c = a.listener, d = a.ca || a.src; a.Z && rb(a); return c.call(d, b); }\r\nfunction ob(a, b) { if (a.Y)\r\n return !0; if (!Va) {\r\n if (!b)\r\n a: {\r\n b = [\"window\", \"event\"];\r\n for (var c = k, d = 0; d < b.length; d++)\r\n if (c = c[b[d]], null == c) {\r\n b = null;\r\n break a;\r\n }\r\n b = c;\r\n }\r\n b = new A(b, this);\r\n return sb(a, b);\r\n} return sb(a, new A(b, this)); }\r\nfunction lb(a) { a = a[eb]; return a instanceof bb ? a : null; }\r\nvar tb = \"__closure_events_fn_\" + (1E9 * Math.random() >>> 0);\r\nfunction jb(a) { if (\"function\" == ba(a))\r\n return a; a[tb] || (a[tb] = function (b) { return a.handleEvent(b); }); return a[tb]; }\r\nfunction D() { u.call(this); this.c = new bb(this); this.J = this; this.C = null; }\r\nr(D, u);\r\nD.prototype[C] = !0;\r\ng = D.prototype;\r\ng.addEventListener = function (a, b, c, d) { hb(this, a, b, c, d); };\r\ng.removeEventListener = function (a, b, c, d) { pb(this, a, b, c, d); };\r\ng.dispatchEvent = function (a) { var b, c = this.C; if (c)\r\n for (b = []; c; c = c.C)\r\n b.push(c); c = this.J; var d = a.type || a; if (\"string\" === typeof a)\r\n a = new y(a, c);\r\nelse if (a instanceof y)\r\n a.target = a.target || c;\r\nelse {\r\n var e = a;\r\n a = new y(d, c);\r\n Da(a, e);\r\n} e = !0; if (b)\r\n for (var f = b.length - 1; 0 <= f; f--) {\r\n var h = a.a = b[f];\r\n e = ub(h, d, !0, a) && e;\r\n } h = a.a = c; e = ub(h, d, !0, a) && e; e = ub(h, d, !1, a) && e; if (b)\r\n for (f = 0; f < b.length; f++)\r\n h = a.a = b[f], e = ub(h, d, !1, a) && e; return e; };\r\ng.G = function () { D.S.G.call(this); if (this.c) {\r\n var a = this.c, c;\r\n for (c in a.a) {\r\n for (var d = a.a[c], e = 0; e < d.length; e++)\r\n ab(d[e]);\r\n delete a.a[c];\r\n a.b--;\r\n }\r\n} this.C = null; };\r\ng.va = function (a, b, c, d) { return this.c.add(String(a), b, !1, c, d); };\r\ng.wa = function (a, b, c, d) { return this.c.add(String(a), b, !0, c, d); };\r\nfunction ub(a, b, c, d) { b = a.c.a[String(b)]; if (!b)\r\n return !0; b = b.concat(); for (var e = !0, f = 0; f < b.length; ++f) {\r\n var h = b[f];\r\n if (h && !h.Y && h.capture == c) {\r\n var m = h.listener, l = h.ca || h.src;\r\n h.Z && db(a.c, h);\r\n e = !1 !== m.call(l, d) && e;\r\n }\r\n} return e && !d.defaultPrevented; }\r\nvar vb = k.JSON.stringify;\r\nfunction wb() { this.b = this.a = null; }\r\nvar yb = new /** @class */ (function () {\r\n function class_1(a, b, c) {\r\n this.f = c;\r\n this.c = a;\r\n this.g = b;\r\n this.b = 0;\r\n this.a = null;\r\n }\r\n class_1.prototype.get = function () { var a; 0 < this.b ? (this.b--, a = this.a, this.a = a.next, a.next = null) : a = this.c(); return a; };\r\n return class_1;\r\n}())(function () { return new xb; }, function (a) { a.reset(); }, 100);\r\nwb.prototype.add = function (a, b) { var c = yb.get(); c.set(a, b); this.b ? this.b.next = c : this.a = c; this.b = c; };\r\nfunction zb() { var a = Ab, b = null; a.a && (b = a.a, a.a = a.a.next, a.a || (a.b = null), b.next = null); return b; }\r\nfunction xb() { this.next = this.b = this.a = null; }\r\nxb.prototype.set = function (a, b) { this.a = a; this.b = b; this.next = null; };\r\nxb.prototype.reset = function () { this.next = this.b = this.a = null; };\r\nfunction Bb(a) { k.setTimeout(function () { throw a; }, 0); }\r\nfunction Cb(a, b) { Db || Eb(); Fb || (Db(), Fb = !0); Ab.add(a, b); }\r\nvar Db;\r\nfunction Eb() { var a = k.Promise.resolve(void 0); Db = function () { a.then(Gb); }; }\r\nvar Fb = !1, Ab = new wb;\r\nfunction Gb() { for (var a; a = zb();) {\r\n try {\r\n a.a.call(a.b);\r\n }\r\n catch (c) {\r\n Bb(c);\r\n }\r\n var b = yb;\r\n b.g(a);\r\n b.b < b.f && (b.b++, a.next = b.a, b.a = a);\r\n} Fb = !1; }\r\nfunction Hb(a, b) { D.call(this); this.b = a || 1; this.a = b || k; this.f = p(this.Ya, this); this.g = q(); }\r\nr(Hb, D);\r\ng = Hb.prototype;\r\ng.aa = !1;\r\ng.M = null;\r\ng.Ya = function () { if (this.aa) {\r\n var a = q() - this.g;\r\n 0 < a && a < .8 * this.b ? this.M = this.a.setTimeout(this.f, this.b - a) : (this.M && (this.a.clearTimeout(this.M), this.M = null), this.dispatchEvent(\"tick\"), this.aa && (Ib(this), this.start()));\r\n} };\r\ng.start = function () { this.aa = !0; this.M || (this.M = this.a.setTimeout(this.f, this.b), this.g = q()); };\r\nfunction Ib(a) { a.aa = !1; a.M && (a.a.clearTimeout(a.M), a.M = null); }\r\ng.G = function () { Hb.S.G.call(this); Ib(this); delete this.a; };\r\nfunction Jb(a, b, c) { if (\"function\" == ba(a))\r\n c && (a = p(a, c));\r\nelse if (a && \"function\" == typeof a.handleEvent)\r\n a = p(a.handleEvent, a);\r\nelse\r\n throw Error(\"Invalid listener argument\"); return 2147483647 < Number(b) ? -1 : k.setTimeout(a, b || 0); }\r\nfunction Kb(a) { a.a = Jb(function () { a.a = null; a.c && (a.c = !1, Kb(a)); }, a.h); var b = a.b; a.b = null; a.g.apply(null, b); }\r\nvar Lb = /** @class */ (function (_super) {\r\n __extends(Lb, _super);\r\n function Lb(a, b, c) {\r\n var _this = _super.call(this) || this;\r\n _this.g = null != c ? a.bind(c) : a;\r\n _this.h = b;\r\n _this.b = null;\r\n _this.c = !1;\r\n _this.a = null;\r\n return _this;\r\n }\r\n Lb.prototype.f = function (a) { this.b = arguments; this.a ? this.c = !0 : Kb(this); };\r\n Lb.prototype.G = function () { _super.prototype.G.call(this); this.a && (k.clearTimeout(this.a), this.a = null, this.c = !1, this.b = null); };\r\n return Lb;\r\n}(u));\r\nfunction E(a) { u.call(this); this.b = a; this.a = {}; }\r\nr(E, u);\r\nvar Mb = [];\r\nfunction Nb(a, b, c, d) { Array.isArray(c) || (c && (Mb[0] = c.toString()), c = Mb); for (var e = 0; e < c.length; e++) {\r\n var f = hb(b, c[e], d || a.handleEvent, !1, a.b || a);\r\n if (!f)\r\n break;\r\n a.a[f.key] = f;\r\n} }\r\nfunction Ob(a) { Aa(a.a, function (b, c) { this.a.hasOwnProperty(c) && rb(b); }, a); a.a = {}; }\r\nE.prototype.G = function () { E.S.G.call(this); Ob(this); };\r\nE.prototype.handleEvent = function () { throw Error(\"EventHandler.handleEvent not implemented\"); };\r\nfunction Pb() { this.a = !0; }\r\nfunction Qb(a, b, c, d, e, f) { a.info(function () { if (a.a)\r\n if (f) {\r\n var h = \"\";\r\n for (var m = f.split(\"&\"), l = 0; l < m.length; l++) {\r\n var t = m[l].split(\"=\");\r\n if (1 < t.length) {\r\n var B = t[0];\r\n t = t[1];\r\n var z = B.split(\"_\");\r\n h = 2 <= z.length && \"type\" == z[1] ? h + (B + \"=\" + t + \"&\") : h + (B + \"=redacted&\");\r\n }\r\n }\r\n }\r\n else\r\n h = null;\r\nelse\r\n h = f; return \"XMLHTTP REQ (\" + d + \") [attempt \" + e + \"]: \" + b + \"\\n\" + c + \"\\n\" + h; }); }\r\nfunction Rb(a, b, c, d, e, f, h) { a.info(function () { return \"XMLHTTP RESP (\" + d + \") [ attempt \" + e + \"]: \" + b + \"\\n\" + c + \"\\n\" + f + \" \" + h; }); }\r\nfunction F(a, b, c, d) { a.info(function () { return \"XMLHTTP TEXT (\" + b + \"): \" + Sb(a, c) + (d ? \" \" + d : \"\"); }); }\r\nfunction Tb(a, b) { a.info(function () { return \"TIMEOUT: \" + b; }); }\r\nPb.prototype.info = function () { };\r\nfunction Sb(a, b) { if (!a.a)\r\n return b; if (!b)\r\n return null; try {\r\n var c = JSON.parse(b);\r\n if (c)\r\n for (a = 0; a < c.length; a++)\r\n if (Array.isArray(c[a])) {\r\n var d = c[a];\r\n if (!(2 > d.length)) {\r\n var e = d[1];\r\n if (Array.isArray(e) && !(1 > e.length)) {\r\n var f = e[0];\r\n if (\"noop\" != f && \"stop\" != f && \"close\" != f)\r\n for (var h = 1; h < e.length; h++)\r\n e[h] = \"\";\r\n }\r\n }\r\n }\r\n return vb(c);\r\n}\r\ncatch (m) {\r\n return b;\r\n} }\r\nvar Ub = null;\r\nfunction Vb() { return Ub = Ub || new D; }\r\nfunction Wb(a) { y.call(this, \"serverreachability\", a); }\r\nr(Wb, y);\r\nfunction G(a) { var b = Vb(); b.dispatchEvent(new Wb(b, a)); }\r\nfunction Xb(a) { y.call(this, \"statevent\", a); }\r\nr(Xb, y);\r\nfunction H(a) { var b = Vb(); b.dispatchEvent(new Xb(b, a)); }\r\nfunction Yb(a) { y.call(this, \"timingevent\", a); }\r\nr(Yb, y);\r\nfunction I(a, b) { if (\"function\" != ba(a))\r\n throw Error(\"Fn must not be null and must be a function\"); return k.setTimeout(function () { a(); }, b); }\r\nvar Zb = { NO_ERROR: 0, Za: 1, gb: 2, fb: 3, bb: 4, eb: 5, hb: 6, Da: 7, TIMEOUT: 8, kb: 9 };\r\nvar $b = { ab: \"complete\", ob: \"success\", Ea: \"error\", Da: \"abort\", mb: \"ready\", nb: \"readystatechange\", TIMEOUT: \"timeout\", ib: \"incrementaldata\", lb: \"progress\", cb: \"downloadprogress\", pb: \"uploadprogress\" };\r\nfunction ac() { }\r\nac.prototype.a = null;\r\nfunction bc(a) { var b; (b = a.a) || (b = a.a = {}); return b; }\r\nfunction cc() { }\r\nvar J = { OPEN: \"a\", $a: \"b\", Ea: \"c\", jb: \"d\" };\r\nfunction dc() { y.call(this, \"d\"); }\r\nr(dc, y);\r\nfunction ec() { y.call(this, \"c\"); }\r\nr(ec, y);\r\nvar fc;\r\nfunction gc() { }\r\nr(gc, ac);\r\nfc = new gc;\r\nfunction K(a, b, c, d) { this.g = a; this.c = b; this.f = c; this.T = d || 1; this.J = new E(this); this.P = hc; a = Ja ? 125 : void 0; this.R = new Hb(a); this.B = null; this.b = !1; this.j = this.l = this.i = this.H = this.u = this.U = this.o = null; this.s = []; this.a = null; this.D = 0; this.h = this.m = null; this.N = -1; this.A = !1; this.O = 0; this.F = null; this.W = this.C = this.V = this.I = !1; }\r\nvar hc = 45E3, ic = {}, jc = {};\r\ng = K.prototype;\r\ng.setTimeout = function (a) { this.P = a; };\r\nfunction kc(a, b, c) { a.H = 1; a.i = lc(L(b)); a.j = c; a.I = !0; mc(a, null); }\r\nfunction mc(a, b) { a.u = q(); M(a); a.l = L(a.i); var c = a.l, d = a.T; Array.isArray(d) || (d = [String(d)]); nc(c.b, \"t\", d); a.D = 0; a.a = oc(a.g, a.g.C ? b : null); 0 < a.O && (a.F = new Lb(p(a.Ca, a, a.a), a.O)); Nb(a.J, a.a, \"readystatechange\", a.Wa); b = a.B ? Ba(a.B) : {}; a.j ? (a.m || (a.m = \"POST\"), b[\"Content-Type\"] = \"application/x-www-form-urlencoded\", a.a.ba(a.l, a.m, a.j, b)) : (a.m = \"GET\", a.a.ba(a.l, a.m, null, b)); G(1); Qb(a.c, a.m, a.l, a.f, a.T, a.j); }\r\ng.Wa = function (a) { a = a.target; var b = this.F; b && 3 == N(a) ? b.f() : this.Ca(a); };\r\ng.Ca = function (a) {\r\n try {\r\n if (a == this.a)\r\n a: {\r\n var b = N(this.a), c = this.a.ua(), d = this.a.X();\r\n if (!(3 > b || 3 == b && !Ja && !this.a.$())) {\r\n this.A || 4 != b || 7 == c || (8 == c || 0 >= d ? G(3) : G(2));\r\n pc(this);\r\n var e = this.a.X();\r\n this.N = e;\r\n var f = this.a.$();\r\n this.b = 200 == e;\r\n Rb(this.c, this.m, this.l, this.f, this.T, b, e);\r\n if (this.b) {\r\n if (this.V && !this.C) {\r\n b: {\r\n if (this.a) {\r\n var h, m = this.a;\r\n if ((h = m.a ? m.a.getResponseHeader(\"X-HTTP-Initial-Response\") : null) && !ta(h)) {\r\n var l = h;\r\n break b;\r\n }\r\n }\r\n l = null;\r\n }\r\n if (l)\r\n F(this.c, this.f, l, \"Initial handshake response via X-HTTP-Initial-Response\"),\r\n this.C = !0, qc(this, l);\r\n else {\r\n this.b = !1;\r\n this.h = 3;\r\n H(12);\r\n O(this);\r\n rc(this);\r\n break a;\r\n }\r\n }\r\n this.I ? (tc(this, b, f), Ja && this.b && 3 == b && (Nb(this.J, this.R, \"tick\", this.Va), this.R.start())) : (F(this.c, this.f, f, null), qc(this, f));\r\n 4 == b && O(this);\r\n this.b && !this.A && (4 == b ? uc(this.g, this) : (this.b = !1, M(this)));\r\n }\r\n else\r\n 400 == e && 0 < f.indexOf(\"Unknown SID\") ? (this.h = 3, H(12)) : (this.h = 0, H(13)), O(this), rc(this);\r\n }\r\n }\r\n }\r\n catch (t) { }\r\n finally { }\r\n};\r\nfunction tc(a, b, c) { for (var d = !0; !a.A && a.D < c.length;) {\r\n var e = vc(a, c);\r\n if (e == jc) {\r\n 4 == b && (a.h = 4, H(14), d = !1);\r\n F(a.c, a.f, null, \"[Incomplete Response]\");\r\n break;\r\n }\r\n else if (e == ic) {\r\n a.h = 4;\r\n H(15);\r\n F(a.c, a.f, c, \"[Invalid Chunk]\");\r\n d = !1;\r\n break;\r\n }\r\n else\r\n F(a.c, a.f, e, null), qc(a, e);\r\n} 4 == b && 0 == c.length && (a.h = 1, H(16), d = !1); a.b = a.b && d; d ? 0 < c.length && !a.W && (a.W = !0, b = a.g, b.a == a && b.V && !b.F && (b.c.info(\"Great, no buffering proxy detected. Bytes received: \" + c.length), xc(b), b.F = !0)) : (F(a.c, a.f, c, \"[Invalid Chunked Response]\"), O(a), rc(a)); }\r\ng.Va = function () { if (this.a) {\r\n var a = N(this.a), b = this.a.$();\r\n this.D < b.length && (pc(this), tc(this, a, b), this.b && 4 != a && M(this));\r\n} };\r\nfunction vc(a, b) { var c = a.D, d = b.indexOf(\"\\n\", c); if (-1 == d)\r\n return jc; c = Number(b.substring(c, d)); if (isNaN(c))\r\n return ic; d += 1; if (d + c > b.length)\r\n return jc; b = b.substr(d, c); a.D = d + c; return b; }\r\ng.cancel = function () { this.A = !0; O(this); };\r\nfunction M(a) { a.U = q() + a.P; yc(a, a.P); }\r\nfunction yc(a, b) { if (null != a.o)\r\n throw Error(\"WatchDog timer not null\"); a.o = I(p(a.Ua, a), b); }\r\nfunction pc(a) { a.o && (k.clearTimeout(a.o), a.o = null); }\r\ng.Ua = function () { this.o = null; var a = q(); 0 <= a - this.U ? (Tb(this.c, this.l), 2 != this.H && (G(3), H(17)), O(this), this.h = 2, rc(this)) : yc(this, this.U - a); };\r\nfunction rc(a) { 0 == a.g.v || a.A || uc(a.g, a); }\r\nfunction O(a) { pc(a); var b = a.F; b && \"function\" == typeof b.ja && b.ja(); a.F = null; Ib(a.R); Ob(a.J); a.a && (b = a.a, a.a = null, b.abort(), b.ja()); }\r\nfunction qc(a, b) {\r\n try {\r\n var c = a.g;\r\n if (0 != c.v && (c.a == a || zc(c.b, a)))\r\n if (c.I = a.N, !a.C && zc(c.b, a) && 3 == c.v) {\r\n try {\r\n var d = c.ka.a.parse(b);\r\n }\r\n catch (sc) {\r\n d = null;\r\n }\r\n if (Array.isArray(d) && 3 == d.length) {\r\n var e = d;\r\n if (0 == e[0])\r\n a: {\r\n if (!c.j) {\r\n if (c.a)\r\n if (c.a.u + 3E3 < a.u)\r\n Ac(c), Bc(c);\r\n else\r\n break a;\r\n Cc(c);\r\n H(18);\r\n }\r\n }\r\n else\r\n c.oa = e[1], 0 < c.oa - c.P && 37500 > e[2] && c.H && 0 == c.o && !c.m && (c.m = I(p(c.Ra, c), 6E3));\r\n if (1 >= Dc(c.b) && c.ea) {\r\n try {\r\n c.ea();\r\n }\r\n catch (sc) { }\r\n c.ea = void 0;\r\n }\r\n }\r\n else\r\n P(c, 11);\r\n }\r\n else if ((a.C || c.a == a) && Ac(c), !ta(b))\r\n for (b = d = c.ka.a.parse(b), d = 0; d < b.length; d++)\r\n if (e =\r\n b[d], c.P = e[0], e = e[1], 2 == c.v)\r\n if (\"c\" == e[0]) {\r\n c.J = e[1];\r\n c.ga = e[2];\r\n var f = e[3];\r\n null != f && (c.ha = f, c.c.info(\"VER=\" + c.ha));\r\n var h = e[4];\r\n null != h && (c.pa = h, c.c.info(\"SVER=\" + c.pa));\r\n var m = e[5];\r\n if (null != m && \"number\" === typeof m && 0 < m) {\r\n var l = 1.5 * m;\r\n c.D = l;\r\n c.c.info(\"backChannelRequestTimeoutMs_=\" + l);\r\n }\r\n l = c;\r\n var t = a.a;\r\n if (t) {\r\n var B = t.a ? t.a.getResponseHeader(\"X-Client-Wire-Protocol\") : null;\r\n if (B) {\r\n var z = l.b;\r\n !z.a && (v(B, \"spdy\") || v(B, \"quic\") || v(B, \"h2\")) && (z.f = z.g, z.a = new Set, z.b && (Ec(z, z.b), z.b = null));\r\n }\r\n if (l.A) {\r\n var qb = t.a ? t.a.getResponseHeader(\"X-HTTP-Session-Id\") :\r\n null;\r\n qb && (l.na = qb, Q(l.B, l.A, qb));\r\n }\r\n }\r\n c.v = 3;\r\n c.f && c.f.ta();\r\n c.V && (c.N = q() - a.u, c.c.info(\"Handshake RTT: \" + c.N + \"ms\"));\r\n l = c;\r\n var va = a;\r\n l.la = Fc(l, l.C ? l.ga : null, l.fa);\r\n if (va.C) {\r\n Gc(l.b, va);\r\n var wa = va, wc = l.D;\r\n wc && wa.setTimeout(wc);\r\n wa.o && (pc(wa), M(wa));\r\n l.a = va;\r\n }\r\n else\r\n Hc(l);\r\n 0 < c.g.length && Ic(c);\r\n }\r\n else\r\n \"stop\" != e[0] && \"close\" != e[0] || P(c, 7);\r\n else\r\n 3 == c.v && (\"stop\" == e[0] || \"close\" == e[0] ? \"stop\" == e[0] ? P(c, 7) : Jc(c) : \"noop\" != e[0] && c.f && c.f.sa(e), c.o = 0);\r\n G(4);\r\n }\r\n catch (sc) { }\r\n}\r\nfunction Kc(a) { if (a.K && \"function\" == typeof a.K)\r\n return a.K(); if (\"string\" === typeof a)\r\n return a.split(\"\"); if (ca(a)) {\r\n for (var b = [], c = a.length, d = 0; d < c; d++)\r\n b.push(a[d]);\r\n return b;\r\n} b = []; c = 0; for (d in a)\r\n b[c++] = a[d]; return a = b; }\r\nfunction Lc(a, b) { if (a.forEach && \"function\" == typeof a.forEach)\r\n a.forEach(b, void 0);\r\nelse if (ca(a) || \"string\" === typeof a)\r\n oa(a, b, void 0);\r\nelse {\r\n if (a.L && \"function\" == typeof a.L)\r\n var c = a.L();\r\n else if (a.K && \"function\" == typeof a.K)\r\n c = void 0;\r\n else if (ca(a) || \"string\" === typeof a) {\r\n c = [];\r\n for (var d = a.length, e = 0; e < d; e++)\r\n c.push(e);\r\n }\r\n else\r\n for (e in c = [], d = 0, a)\r\n c[d++] = e;\r\n d = Kc(a);\r\n e = d.length;\r\n for (var f = 0; f < e; f++)\r\n b.call(void 0, d[f], c && c[f], a);\r\n} }\r\nfunction R(a, b) { this.b = {}; this.a = []; this.c = 0; var c = arguments.length; if (1 < c) {\r\n if (c % 2)\r\n throw Error(\"Uneven number of arguments\");\r\n for (var d = 0; d < c; d += 2)\r\n this.set(arguments[d], arguments[d + 1]);\r\n}\r\nelse if (a)\r\n if (a instanceof R)\r\n for (c = a.L(), d = 0; d < c.length; d++)\r\n this.set(c[d], a.get(c[d]));\r\n else\r\n for (d in a)\r\n this.set(d, a[d]); }\r\ng = R.prototype;\r\ng.K = function () { Mc(this); for (var a = [], b = 0; b < this.a.length; b++)\r\n a.push(this.b[this.a[b]]); return a; };\r\ng.L = function () { Mc(this); return this.a.concat(); };\r\nfunction Mc(a) { if (a.c != a.a.length) {\r\n for (var b = 0, c = 0; b < a.a.length;) {\r\n var d = a.a[b];\r\n S(a.b, d) && (a.a[c++] = d);\r\n b++;\r\n }\r\n a.a.length = c;\r\n} if (a.c != a.a.length) {\r\n var e = {};\r\n for (c = b = 0; b < a.a.length;)\r\n d = a.a[b], S(e, d) || (a.a[c++] = d, e[d] = 1), b++;\r\n a.a.length = c;\r\n} }\r\ng.get = function (a, b) { return S(this.b, a) ? this.b[a] : b; };\r\ng.set = function (a, b) { S(this.b, a) || (this.c++, this.a.push(a)); this.b[a] = b; };\r\ng.forEach = function (a, b) { for (var c = this.L(), d = 0; d < c.length; d++) {\r\n var e = c[d], f = this.get(e);\r\n a.call(b, f, e, this);\r\n} };\r\nfunction S(a, b) { return Object.prototype.hasOwnProperty.call(a, b); }\r\nvar Nc = /^(?:([^:/?#.]+):)?(?:\\/\\/(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$/;\r\nfunction Oc(a, b) { if (a) {\r\n a = a.split(\"&\");\r\n for (var c = 0; c < a.length; c++) {\r\n var d = a[c].indexOf(\"=\"), e = null;\r\n if (0 <= d) {\r\n var f = a[c].substring(0, d);\r\n e = a[c].substring(d + 1);\r\n }\r\n else\r\n f = a[c];\r\n b(f, e ? decodeURIComponent(e.replace(/\\+/g, \" \")) : \"\");\r\n }\r\n} }\r\nfunction T(a, b) { this.c = this.j = this.f = \"\"; this.h = null; this.i = this.g = \"\"; this.a = !1; if (a instanceof T) {\r\n this.a = void 0 !== b ? b : a.a;\r\n Pc(this, a.f);\r\n this.j = a.j;\r\n Qc(this, a.c);\r\n Rc(this, a.h);\r\n this.g = a.g;\r\n b = a.b;\r\n var c = new U;\r\n c.c = b.c;\r\n b.a && (c.a = new R(b.a), c.b = b.b);\r\n Sc(this, c);\r\n this.i = a.i;\r\n}\r\nelse\r\n a && (c = String(a).match(Nc)) ? (this.a = !!b, Pc(this, c[1] || \"\", !0), this.j = Tc(c[2] || \"\"), Qc(this, c[3] || \"\", !0), Rc(this, c[4]), this.g = Tc(c[5] || \"\", !0), Sc(this, c[6] || \"\", !0), this.i = Tc(c[7] || \"\")) : (this.a = !!b, this.b = new U(null, this.a)); }\r\nT.prototype.toString = function () { var a = [], b = this.f; b && a.push(Uc(b, Vc, !0), \":\"); var c = this.c; if (c || \"file\" == b)\r\n a.push(\"//\"), (b = this.j) && a.push(Uc(b, Vc, !0), \"@\"), a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g, \"%$1\")), c = this.h, null != c && a.push(\":\", String(c)); if (c = this.g)\r\n this.c && \"/\" != c.charAt(0) && a.push(\"/\"), a.push(Uc(c, \"/\" == c.charAt(0) ? Wc : Xc, !0)); (c = this.b.toString()) && a.push(\"?\", c); (c = this.i) && a.push(\"#\", Uc(c, Yc)); return a.join(\"\"); };\r\nfunction L(a) { return new T(a); }\r\nfunction Pc(a, b, c) { a.f = c ? Tc(b, !0) : b; a.f && (a.f = a.f.replace(/:$/, \"\")); }\r\nfunction Qc(a, b, c) { a.c = c ? Tc(b, !0) : b; }\r\nfunction Rc(a, b) { if (b) {\r\n b = Number(b);\r\n if (isNaN(b) || 0 > b)\r\n throw Error(\"Bad port number \" + b);\r\n a.h = b;\r\n}\r\nelse\r\n a.h = null; }\r\nfunction Sc(a, b, c) { b instanceof U ? (a.b = b, Zc(a.b, a.a)) : (c || (b = Uc(b, $c)), a.b = new U(b, a.a)); }\r\nfunction Q(a, b, c) { a.b.set(b, c); }\r\nfunction lc(a) { Q(a, \"zx\", Math.floor(2147483648 * Math.random()).toString(36) + Math.abs(Math.floor(2147483648 * Math.random()) ^ q()).toString(36)); return a; }\r\nfunction ad(a) { return a instanceof T ? L(a) : new T(a, void 0); }\r\nfunction bd(a, b, c, d) { var e = new T(null, void 0); a && Pc(e, a); b && Qc(e, b); c && Rc(e, c); d && (e.g = d); return e; }\r\nfunction Tc(a, b) { return a ? b ? decodeURI(a.replace(/%25/g, \"%2525\")) : decodeURIComponent(a) : \"\"; }\r\nfunction Uc(a, b, c) { return \"string\" === typeof a ? (a = encodeURI(a).replace(b, cd), c && (a = a.replace(/%25([0-9a-fA-F]{2})/g, \"%$1\")), a) : null; }\r\nfunction cd(a) { a = a.charCodeAt(0); return \"%\" + (a >> 4 & 15).toString(16) + (a & 15).toString(16); }\r\nvar Vc = /[#\\/\\?@]/g, Xc = /[#\\?:]/g, Wc = /[#\\?]/g, $c = /[#\\?@]/g, Yc = /#/g;\r\nfunction U(a, b) { this.b = this.a = null; this.c = a || null; this.f = !!b; }\r\nfunction V(a) { a.a || (a.a = new R, a.b = 0, a.c && Oc(a.c, function (b, c) { a.add(decodeURIComponent(b.replace(/\\+/g, \" \")), c); })); }\r\ng = U.prototype;\r\ng.add = function (a, b) { V(this); this.c = null; a = W(this, a); var c = this.a.get(a); c || this.a.set(a, c = []); c.push(b); this.b += 1; return this; };\r\nfunction dd(a, b) { V(a); b = W(a, b); S(a.a.b, b) && (a.c = null, a.b -= a.a.get(b).length, a = a.a, S(a.b, b) && (delete a.b[b], a.c--, a.a.length > 2 * a.c && Mc(a))); }\r\nfunction ed(a, b) { V(a); b = W(a, b); return S(a.a.b, b); }\r\ng.forEach = function (a, b) { V(this); this.a.forEach(function (c, d) { oa(c, function (e) { a.call(b, e, d, this); }, this); }, this); };\r\ng.L = function () { V(this); for (var a = this.a.K(), b = this.a.L(), c = [], d = 0; d < b.length; d++)\r\n for (var e = a[d], f = 0; f < e.length; f++)\r\n c.push(b[d]); return c; };\r\ng.K = function (a) { V(this); var b = []; if (\"string\" === typeof a)\r\n ed(this, a) && (b = ra(b, this.a.get(W(this, a))));\r\nelse {\r\n a = this.a.K();\r\n for (var c = 0; c < a.length; c++)\r\n b = ra(b, a[c]);\r\n} return b; };\r\ng.set = function (a, b) { V(this); this.c = null; a = W(this, a); ed(this, a) && (this.b -= this.a.get(a).length); this.a.set(a, [b]); this.b += 1; return this; };\r\ng.get = function (a, b) { if (!a)\r\n return b; a = this.K(a); return 0 < a.length ? String(a[0]) : b; };\r\nfunction nc(a, b, c) { dd(a, b); 0 < c.length && (a.c = null, a.a.set(W(a, b), sa(c)), a.b += c.length); }\r\ng.toString = function () { if (this.c)\r\n return this.c; if (!this.a)\r\n return \"\"; for (var a = [], b = this.a.L(), c = 0; c < b.length; c++) {\r\n var d = b[c], e = encodeURIComponent(String(d));\r\n d = this.K(d);\r\n for (var f = 0; f < d.length; f++) {\r\n var h = e;\r\n \"\" !== d[f] && (h += \"=\" + encodeURIComponent(String(d[f])));\r\n a.push(h);\r\n }\r\n} return this.c = a.join(\"&\"); };\r\nfunction W(a, b) { b = String(b); a.f && (b = b.toLowerCase()); return b; }\r\nfunction Zc(a, b) { b && !a.f && (V(a), a.c = null, a.a.forEach(function (c, d) { var e = d.toLowerCase(); d != e && (dd(this, d), nc(this, e, c)); }, a)); a.f = b; }\r\nfunction fd(a, b) { this.b = a; this.a = b; }\r\nfunction gd(a) { this.g = a || hd; k.PerformanceNavigationTiming ? (a = k.performance.getEntriesByType(\"navigation\"), a = 0 < a.length && (\"hq\" == a[0].nextHopProtocol || \"h2\" == a[0].nextHopProtocol)) : a = !!(k.ia && k.ia.ya && k.ia.ya() && k.ia.ya().qb); this.f = a ? this.g : 1; this.a = null; 1 < this.f && (this.a = new Set); this.b = null; this.c = []; }\r\nvar hd = 10;\r\nfunction id(a) { return a.b ? !0 : a.a ? a.a.size >= a.f : !1; }\r\nfunction Dc(a) { return a.b ? 1 : a.a ? a.a.size : 0; }\r\nfunction zc(a, b) { return a.b ? a.b == b : a.a ? a.a.has(b) : !1; }\r\nfunction Ec(a, b) { a.a ? a.a.add(b) : a.b = b; }\r\nfunction Gc(a, b) { a.b && a.b == b ? a.b = null : a.a && a.a.has(b) && a.a.delete(b); }\r\ngd.prototype.cancel = function () {\r\n var e_1, _a;\r\n this.c = jd(this);\r\n if (this.b)\r\n this.b.cancel(), this.b = null;\r\n else if (this.a && 0 !== this.a.size) {\r\n try {\r\n for (var _b = __values(this.a.values()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var a = _c.value;\r\n a.cancel();\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n this.a.clear();\r\n }\r\n};\r\nfunction jd(a) {\r\n var e_2, _a;\r\n if (null != a.b)\r\n return a.c.concat(a.b.s);\r\n if (null != a.a && 0 !== a.a.size) {\r\n var b = a.c;\r\n try {\r\n for (var _b = __values(a.a.values()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var c = _c.value;\r\n b = b.concat(c.s);\r\n }\r\n }\r\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_2) throw e_2.error; }\r\n }\r\n return b;\r\n }\r\n return sa(a.c);\r\n}\r\nfunction kd() { }\r\nkd.prototype.stringify = function (a) { return k.JSON.stringify(a, void 0); };\r\nkd.prototype.parse = function (a) { return k.JSON.parse(a, void 0); };\r\nfunction ld() { this.a = new kd; }\r\nfunction md(a, b, c) { var d = c || \"\"; try {\r\n Lc(a, function (e, f) { var h = e; n(e) && (h = vb(e)); b.push(d + f + \"=\" + encodeURIComponent(h)); });\r\n}\r\ncatch (e) {\r\n throw b.push(d + \"type=\" + encodeURIComponent(\"_badmap\")), e;\r\n} }\r\nfunction nd(a, b) { var c = new Pb; if (k.Image) {\r\n var d = new Image;\r\n d.onload = ka(od, c, d, \"TestLoadImage: loaded\", !0, b);\r\n d.onerror = ka(od, c, d, \"TestLoadImage: error\", !1, b);\r\n d.onabort = ka(od, c, d, \"TestLoadImage: abort\", !1, b);\r\n d.ontimeout = ka(od, c, d, \"TestLoadImage: timeout\", !1, b);\r\n k.setTimeout(function () { if (d.ontimeout)\r\n d.ontimeout(); }, 1E4);\r\n d.src = a;\r\n}\r\nelse\r\n b(!1); }\r\nfunction od(a, b, c, d, e) { try {\r\n b.onload = null, b.onerror = null, b.onabort = null, b.ontimeout = null, e(d);\r\n}\r\ncatch (f) { } }\r\nvar pd = k.JSON.parse;\r\nfunction X(a) { D.call(this); this.headers = new R; this.H = a || null; this.b = !1; this.s = this.a = null; this.B = \"\"; this.h = 0; this.f = \"\"; this.g = this.A = this.l = this.u = !1; this.o = 0; this.m = null; this.I = qd; this.D = this.F = !1; }\r\nr(X, D);\r\nvar qd = \"\", rd = /^https?$/i, sd = [\"POST\", \"PUT\"];\r\ng = X.prototype;\r\ng.ba = function (a, b, c, d) {\r\n if (this.a)\r\n throw Error(\"[goog.net.XhrIo] Object is active with another request=\" + this.B + \"; newUri=\" + a);\r\n b = b ? b.toUpperCase() : \"GET\";\r\n this.B = a;\r\n this.f = \"\";\r\n this.h = 0;\r\n this.u = !1;\r\n this.b = !0;\r\n this.a = new XMLHttpRequest;\r\n this.s = this.H ? bc(this.H) : bc(fc);\r\n this.a.onreadystatechange = p(this.za, this);\r\n try {\r\n this.A = !0, this.a.open(b, String(a), !0), this.A = !1;\r\n }\r\n catch (f) {\r\n td(this, f);\r\n return;\r\n }\r\n a = c || \"\";\r\n var e = new R(this.headers);\r\n d && Lc(d, function (f, h) { e.set(h, f); });\r\n d = pa(e.L());\r\n c = k.FormData && a instanceof k.FormData;\r\n !(0 <=\r\n na(sd, b)) || d || c || e.set(\"Content-Type\", \"application/x-www-form-urlencoded;charset=utf-8\");\r\n e.forEach(function (f, h) { this.a.setRequestHeader(h, f); }, this);\r\n this.I && (this.a.responseType = this.I);\r\n \"withCredentials\" in this.a && this.a.withCredentials !== this.F && (this.a.withCredentials = this.F);\r\n try {\r\n ud(this), 0 < this.o && ((this.D = vd(this.a)) ? (this.a.timeout = this.o, this.a.ontimeout = p(this.xa, this)) : this.m = Jb(this.xa, this.o, this)), this.l = !0, this.a.send(a), this.l = !1;\r\n }\r\n catch (f) {\r\n td(this, f);\r\n }\r\n};\r\nfunction vd(a) { return x && Ra(9) && \"number\" === typeof a.timeout && void 0 !== a.ontimeout; }\r\nfunction qa(a) { return \"content-type\" == a.toLowerCase(); }\r\ng.xa = function () { \"undefined\" != typeof goog && this.a && (this.f = \"Timed out after \" + this.o + \"ms, aborting\", this.h = 8, this.dispatchEvent(\"timeout\"), this.abort(8)); };\r\nfunction td(a, b) { a.b = !1; a.a && (a.g = !0, a.a.abort(), a.g = !1); a.f = b; a.h = 5; wd(a); xd(a); }\r\nfunction wd(a) { a.u || (a.u = !0, a.dispatchEvent(\"complete\"), a.dispatchEvent(\"error\")); }\r\ng.abort = function (a) { this.a && this.b && (this.b = !1, this.g = !0, this.a.abort(), this.g = !1, this.h = a || 7, this.dispatchEvent(\"complete\"), this.dispatchEvent(\"abort\"), xd(this)); };\r\ng.G = function () { this.a && (this.b && (this.b = !1, this.g = !0, this.a.abort(), this.g = !1), xd(this, !0)); X.S.G.call(this); };\r\ng.za = function () { this.j || (this.A || this.l || this.g ? yd(this) : this.Ta()); };\r\ng.Ta = function () { yd(this); };\r\nfunction yd(a) {\r\n if (a.b && \"undefined\" != typeof goog && (!a.s[1] || 4 != N(a) || 2 != a.X()))\r\n if (a.l && 4 == N(a))\r\n Jb(a.za, 0, a);\r\n else if (a.dispatchEvent(\"readystatechange\"), 4 == N(a)) {\r\n a.b = !1;\r\n try {\r\n var b = a.X();\r\n a: switch (b) {\r\n case 200:\r\n case 201:\r\n case 202:\r\n case 204:\r\n case 206:\r\n case 304:\r\n case 1223:\r\n var c = !0;\r\n break a;\r\n default: c = !1;\r\n }\r\n var d;\r\n if (!(d = c)) {\r\n var e;\r\n if (e = 0 === b) {\r\n var f = String(a.B).match(Nc)[1] || null;\r\n if (!f && k.self && k.self.location) {\r\n var h = k.self.location.protocol;\r\n f = h.substr(0, h.length - 1);\r\n }\r\n e = !rd.test(f ? f.toLowerCase() : \"\");\r\n }\r\n d = e;\r\n }\r\n if (d)\r\n a.dispatchEvent(\"complete\"),\r\n a.dispatchEvent(\"success\");\r\n else {\r\n a.h = 6;\r\n try {\r\n var m = 2 < N(a) ? a.a.statusText : \"\";\r\n }\r\n catch (l) {\r\n m = \"\";\r\n }\r\n a.f = m + \" [\" + a.X() + \"]\";\r\n wd(a);\r\n }\r\n }\r\n finally {\r\n xd(a);\r\n }\r\n }\r\n}\r\nfunction xd(a, b) { if (a.a) {\r\n ud(a);\r\n var c = a.a, d = a.s[0] ? aa : null;\r\n a.a = null;\r\n a.s = null;\r\n b || a.dispatchEvent(\"ready\");\r\n try {\r\n c.onreadystatechange = d;\r\n }\r\n catch (e) { }\r\n} }\r\nfunction ud(a) { a.a && a.D && (a.a.ontimeout = null); a.m && (k.clearTimeout(a.m), a.m = null); }\r\nfunction N(a) { return a.a ? a.a.readyState : 0; }\r\ng.X = function () { try {\r\n return 2 < N(this) ? this.a.status : -1;\r\n}\r\ncatch (a) {\r\n return -1;\r\n} };\r\ng.$ = function () { try {\r\n return this.a ? this.a.responseText : \"\";\r\n}\r\ncatch (a) {\r\n return \"\";\r\n} };\r\ng.Na = function (a) { if (this.a) {\r\n var b = this.a.responseText;\r\n a && 0 == b.indexOf(a) && (b = b.substring(a.length));\r\n return pd(b);\r\n} };\r\ng.ua = function () { return this.h; };\r\ng.Qa = function () { return \"string\" === typeof this.f ? this.f : String(this.f); };\r\nfunction zd(a) { var b = \"\"; Aa(a, function (c, d) { b += d; b += \":\"; b += c; b += \"\\r\\n\"; }); return b; }\r\nfunction Ad(a, b, c) { a: {\r\n for (d in c) {\r\n var d = !1;\r\n break a;\r\n }\r\n d = !0;\r\n} d || (c = zd(c), \"string\" === typeof a ? (null != c && encodeURIComponent(String(c))) : Q(a, b, c)); }\r\nfunction Bd(a, b, c) { return c && c.internalChannelParams ? c.internalChannelParams[a] || b : b; }\r\nfunction Cd(a) {\r\n this.pa = 0;\r\n this.g = [];\r\n this.c = new Pb;\r\n this.ga = this.la = this.B = this.fa = this.a = this.na = this.A = this.W = this.i = this.O = this.l = null;\r\n this.La = this.R = 0;\r\n this.Ia = Bd(\"failFast\", !1, a);\r\n this.H = this.m = this.j = this.h = this.f = null;\r\n this.T = !0;\r\n this.I = this.oa = this.P = -1;\r\n this.U = this.o = this.u = 0;\r\n this.Fa = Bd(\"baseRetryDelayMs\", 5E3, a);\r\n this.Ma = Bd(\"retryDelaySeedMs\", 1E4, a);\r\n this.Ja = Bd(\"forwardChannelMaxRetries\", 2, a);\r\n this.ma = Bd(\"forwardChannelRequestTimeoutMs\", 2E4, a);\r\n this.Ka = a && a.g || void 0;\r\n this.D = void 0;\r\n this.C = a && a.supportsCrossDomainXhr ||\r\n !1;\r\n this.J = \"\";\r\n this.b = new gd(a && a.concurrentRequestLimit);\r\n this.ka = new ld;\r\n this.da = a && a.fastHandshake || !1;\r\n this.Ga = a && a.b || !1;\r\n a && a.f && (this.c.a = !1);\r\n a && a.forceLongPolling && (this.T = !1);\r\n this.V = !this.da && this.T && a && a.c || !1;\r\n this.ea = void 0;\r\n this.N = 0;\r\n this.F = !1;\r\n this.s = null;\r\n}\r\ng = Cd.prototype;\r\ng.ha = 8;\r\ng.v = 1;\r\nfunction Jc(a) { Dd(a); if (3 == a.v) {\r\n var b = a.R++, c = L(a.B);\r\n Q(c, \"SID\", a.J);\r\n Q(c, \"RID\", b);\r\n Q(c, \"TYPE\", \"terminate\");\r\n Ed(a, c);\r\n b = new K(a, a.c, b, void 0);\r\n b.H = 2;\r\n b.i = lc(L(c));\r\n c = !1;\r\n k.navigator && k.navigator.sendBeacon && (c = k.navigator.sendBeacon(b.i.toString(), \"\"));\r\n !c && k.Image && ((new Image).src = b.i, c = !0);\r\n c || (b.a = oc(b.g, null), b.a.ba(b.i));\r\n b.u = q();\r\n M(b);\r\n} Fd(a); }\r\nfunction Bc(a) { a.a && (xc(a), a.a.cancel(), a.a = null); }\r\nfunction Dd(a) { Bc(a); a.j && (k.clearTimeout(a.j), a.j = null); Ac(a); a.b.cancel(); a.h && (\"number\" === typeof a.h && k.clearTimeout(a.h), a.h = null); }\r\nfunction Gd(a, b) { a.g.push(new fd(a.La++, b)); 3 == a.v && Ic(a); }\r\nfunction Ic(a) { id(a.b) || a.h || (a.h = !0, Cb(a.Ba, a), a.u = 0); }\r\nfunction Hd(a, b) { if (Dc(a.b) >= a.b.f - (a.h ? 1 : 0))\r\n return !1; if (a.h)\r\n return a.g = b.s.concat(a.g), !0; if (1 == a.v || 2 == a.v || a.u >= (a.Ia ? 0 : a.Ja))\r\n return !1; a.h = I(p(a.Ba, a, b), Id(a, a.u)); a.u++; return !0; }\r\ng.Ba = function (a) {\r\n if (this.h)\r\n if (this.h = null, 1 == this.v) {\r\n if (!a) {\r\n this.R = Math.floor(1E5 * Math.random());\r\n a = this.R++;\r\n var b = new K(this, this.c, a, void 0), c = this.l;\r\n this.O && (c ? (c = Ba(c), Da(c, this.O)) : c = this.O);\r\n null === this.i && (b.B = c);\r\n var d;\r\n if (this.da)\r\n a: {\r\n for (var e = d = 0; e < this.g.length; e++) {\r\n b: {\r\n var f = this.g[e];\r\n if (\"__data__\" in f.a && (f = f.a.__data__, \"string\" === typeof f)) {\r\n f = f.length;\r\n break b;\r\n }\r\n f = void 0;\r\n }\r\n if (void 0 === f)\r\n break;\r\n d += f;\r\n if (4096 < d) {\r\n d = e;\r\n break a;\r\n }\r\n if (4096 === d || e === this.g.length - 1) {\r\n d = e + 1;\r\n break a;\r\n }\r\n }\r\n d = 1E3;\r\n }\r\n else\r\n d = 1E3;\r\n d = Jd(this, b, d);\r\n e = L(this.B);\r\n Q(e, \"RID\", a);\r\n Q(e, \"CVER\", 22);\r\n this.A && Q(e, \"X-HTTP-Session-Id\", this.A);\r\n Ed(this, e);\r\n this.i && c && Ad(e, this.i, c);\r\n Ec(this.b, b);\r\n this.Ga && Q(e, \"TYPE\", \"init\");\r\n this.da ? (Q(e, \"$req\", d), Q(e, \"SID\", \"null\"), b.V = !0, kc(b, e, null)) : kc(b, e, d);\r\n this.v = 2;\r\n }\r\n }\r\n else\r\n 3 == this.v && (a ? Kd(this, a) : 0 == this.g.length || id(this.b) || Kd(this));\r\n};\r\nfunction Kd(a, b) { var c; b ? c = b.f : c = a.R++; var d = L(a.B); Q(d, \"SID\", a.J); Q(d, \"RID\", c); Q(d, \"AID\", a.P); Ed(a, d); a.i && a.l && Ad(d, a.i, a.l); c = new K(a, a.c, c, a.u + 1); null === a.i && (c.B = a.l); b && (a.g = b.s.concat(a.g)); b = Jd(a, c, 1E3); c.setTimeout(Math.round(.5 * a.ma) + Math.round(.5 * a.ma * Math.random())); Ec(a.b, c); kc(c, d, b); }\r\nfunction Ed(a, b) { a.f && Lc({}, function (c, d) { Q(b, d, c); }); }\r\nfunction Jd(a, b, c) { c = Math.min(a.g.length, c); var d = a.f ? p(a.f.Ha, a.f, a) : null; a: for (var e = a.g, f = -1;;) {\r\n var h = [\"count=\" + c];\r\n -1 == f ? 0 < c ? (f = e[0].b, h.push(\"ofs=\" + f)) : f = 0 : h.push(\"ofs=\" + f);\r\n for (var m = !0, l = 0; l < c; l++) {\r\n var t = e[l].b, B = e[l].a;\r\n t -= f;\r\n if (0 > t)\r\n f = Math.max(0, e[l].b - 100), m = !1;\r\n else\r\n try {\r\n md(B, h, \"req\" + t + \"_\");\r\n }\r\n catch (z) {\r\n d && d(B);\r\n }\r\n }\r\n if (m) {\r\n d = h.join(\"&\");\r\n break a;\r\n }\r\n} a = a.g.splice(0, c); b.s = a; return d; }\r\nfunction Hc(a) { a.a || a.j || (a.U = 1, Cb(a.Aa, a), a.o = 0); }\r\nfunction Cc(a) { if (a.a || a.j || 3 <= a.o)\r\n return !1; a.U++; a.j = I(p(a.Aa, a), Id(a, a.o)); a.o++; return !0; }\r\ng.Aa = function () { this.j = null; Ld(this); if (this.V && !(this.F || null == this.a || 0 >= this.N)) {\r\n var a = 2 * this.N;\r\n this.c.info(\"BP detection timer enabled: \" + a);\r\n this.s = I(p(this.Sa, this), a);\r\n} };\r\ng.Sa = function () { this.s && (this.s = null, this.c.info(\"BP detection timeout reached.\"), this.c.info(\"Buffering proxy detected and switch to long-polling!\"), this.H = !1, this.F = !0, Bc(this), Ld(this)); };\r\nfunction xc(a) { null != a.s && (k.clearTimeout(a.s), a.s = null); }\r\nfunction Ld(a) { a.a = new K(a, a.c, \"rpc\", a.U); null === a.i && (a.a.B = a.l); a.a.O = 0; var b = L(a.la); Q(b, \"RID\", \"rpc\"); Q(b, \"SID\", a.J); Q(b, \"CI\", a.H ? \"0\" : \"1\"); Q(b, \"AID\", a.P); Ed(a, b); Q(b, \"TYPE\", \"xmlhttp\"); a.i && a.l && Ad(b, a.i, a.l); a.D && a.a.setTimeout(a.D); var c = a.a; a = a.ga; c.H = 1; c.i = lc(L(b)); c.j = null; c.I = !0; mc(c, a); }\r\ng.Ra = function () { null != this.m && (this.m = null, Bc(this), Cc(this), H(19)); };\r\nfunction Ac(a) { null != a.m && (k.clearTimeout(a.m), a.m = null); }\r\nfunction uc(a, b) { var c = null; if (a.a == b) {\r\n Ac(a);\r\n xc(a);\r\n a.a = null;\r\n var d = 2;\r\n}\r\nelse if (zc(a.b, b))\r\n c = b.s, Gc(a.b, b), d = 1;\r\nelse\r\n return; a.I = b.N; if (0 != a.v)\r\n if (b.b)\r\n if (1 == d) {\r\n c = b.j ? b.j.length : 0;\r\n b = q() - b.u;\r\n var e = a.u;\r\n d = Vb();\r\n d.dispatchEvent(new Yb(d, c, b, e));\r\n Ic(a);\r\n }\r\n else\r\n Hc(a);\r\n else if (e = b.h, 3 == e || 0 == e && 0 < a.I || !(1 == d && Hd(a, b) || 2 == d && Cc(a)))\r\n switch (c && 0 < c.length && (b = a.b, b.c = b.c.concat(c)), e) {\r\n case 1:\r\n P(a, 5);\r\n break;\r\n case 4:\r\n P(a, 10);\r\n break;\r\n case 3:\r\n P(a, 6);\r\n break;\r\n default: P(a, 2);\r\n } }\r\nfunction Id(a, b) { var c = a.Fa + Math.floor(Math.random() * a.Ma); a.f || (c *= 2); return c * b; }\r\nfunction P(a, b) { a.c.info(\"Error code \" + b); if (2 == b) {\r\n var c = null;\r\n a.f && (c = null);\r\n var d = p(a.Xa, a);\r\n c || (c = new T(\"//www.google.com/images/cleardot.gif\"), k.location && \"http\" == k.location.protocol || Pc(c, \"https\"), lc(c));\r\n nd(c.toString(), d);\r\n}\r\nelse\r\n H(2); a.v = 0; a.f && a.f.ra(b); Fd(a); Dd(a); }\r\ng.Xa = function (a) { a ? (this.c.info(\"Successfully pinged google.com\"), H(2)) : (this.c.info(\"Failed to ping google.com\"), H(1)); };\r\nfunction Fd(a) { a.v = 0; a.I = -1; if (a.f) {\r\n if (0 != jd(a.b).length || 0 != a.g.length)\r\n a.b.c.length = 0, sa(a.g), a.g.length = 0;\r\n a.f.qa();\r\n} }\r\nfunction Fc(a, b, c) { var d = ad(c); if (\"\" != d.c)\r\n b && Qc(d, b + \".\" + d.c), Rc(d, d.h);\r\nelse {\r\n var e = k.location;\r\n d = bd(e.protocol, b ? b + \".\" + e.hostname : e.hostname, +e.port, c);\r\n} a.W && Aa(a.W, function (f, h) { Q(d, h, f); }); b = a.A; c = a.na; b && c && Q(d, b, c); Q(d, \"VER\", a.ha); Ed(a, d); return d; }\r\nfunction oc(a, b) { if (b && !a.C)\r\n throw Error(\"Can't create secondary domain capable XhrIo object.\"); b = new X(a.Ka); b.F = a.C; return b; }\r\nfunction Md() { }\r\ng = Md.prototype;\r\ng.ta = function () { };\r\ng.sa = function () { };\r\ng.ra = function () { };\r\ng.qa = function () { };\r\ng.Ha = function () { };\r\nfunction Nd() { if (x && !(10 <= Number(Ua)))\r\n throw Error(\"Environmental error: no available transport.\"); }\r\nNd.prototype.a = function (a, b) { return new Y(a, b); };\r\nfunction Y(a, b) {\r\n D.call(this);\r\n this.a = new Cd(b);\r\n this.l = a;\r\n this.b = b && b.messageUrlParams || null;\r\n a = b && b.messageHeaders || null;\r\n b && b.clientProtocolHeaderRequired && (a ? a[\"X-Client-Protocol\"] = \"webchannel\" : a = { \"X-Client-Protocol\": \"webchannel\" });\r\n this.a.l = a;\r\n a = b && b.initMessageHeaders || null;\r\n b && b.messageContentType && (a ? a[\"X-WebChannel-Content-Type\"] = b.messageContentType : a = { \"X-WebChannel-Content-Type\": b.messageContentType });\r\n b && b.a && (a ? a[\"X-WebChannel-Client-Profile\"] = b.a : a = { \"X-WebChannel-Client-Profile\": b.a });\r\n this.a.O =\r\n a;\r\n (a = b && b.httpHeadersOverwriteParam) && !ta(a) && (this.a.i = a);\r\n this.h = b && b.supportsCrossDomainXhr || !1;\r\n this.g = b && b.sendRawJson || !1;\r\n (b = b && b.httpSessionIdParam) && !ta(b) && (this.a.A = b, a = this.b, null !== a && b in a && (a = this.b, b in a && delete a[b]));\r\n this.f = new Z(this);\r\n}\r\nr(Y, D);\r\ng = Y.prototype;\r\ng.addEventListener = function (a, b, c, d) { Y.S.addEventListener.call(this, a, b, c, d); };\r\ng.removeEventListener = function (a, b, c, d) { Y.S.removeEventListener.call(this, a, b, c, d); };\r\ng.Oa = function () { this.a.f = this.f; this.h && (this.a.C = !0); var a = this.a, b = this.l, c = this.b || void 0; H(0); a.fa = b; a.W = c || {}; a.H = a.T; a.B = Fc(a, null, a.fa); Ic(a); };\r\ng.close = function () { Jc(this.a); };\r\ng.Pa = function (a) { if (\"string\" === typeof a) {\r\n var b = {};\r\n b.__data__ = a;\r\n Gd(this.a, b);\r\n}\r\nelse\r\n this.g ? (b = {}, b.__data__ = vb(a), Gd(this.a, b)) : Gd(this.a, a); };\r\ng.G = function () { this.a.f = null; delete this.f; Jc(this.a); delete this.a; Y.S.G.call(this); };\r\nfunction Od(a) { dc.call(this); var b = a.__sm__; if (b) {\r\n a: {\r\n for (var c in b) {\r\n a = c;\r\n break a;\r\n }\r\n a = void 0;\r\n }\r\n (this.c = a) ? (a = this.c, this.data = null !== b && a in b ? b[a] : void 0) : this.data = b;\r\n}\r\nelse\r\n this.data = a; }\r\nr(Od, dc);\r\nfunction Pd() { ec.call(this); this.status = 1; }\r\nr(Pd, ec);\r\nfunction Z(a) { this.a = a; }\r\nr(Z, Md);\r\nZ.prototype.ta = function () { this.a.dispatchEvent(\"a\"); };\r\nZ.prototype.sa = function (a) { this.a.dispatchEvent(new Od(a)); };\r\nZ.prototype.ra = function (a) { this.a.dispatchEvent(new Pd(a)); };\r\nZ.prototype.qa = function () { this.a.dispatchEvent(\"b\"); }; /*\r\n\n Copyright 2017 Google LLC\r\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\n http://www.apache.org/licenses/LICENSE-2.0\r\n\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n*/\r\nNd.prototype.createWebChannel = Nd.prototype.a;\r\nY.prototype.send = Y.prototype.Pa;\r\nY.prototype.open = Y.prototype.Oa;\r\nY.prototype.close = Y.prototype.close;\r\nZb.NO_ERROR = 0;\r\nZb.TIMEOUT = 8;\r\nZb.HTTP_ERROR = 6;\r\n$b.COMPLETE = \"complete\";\r\ncc.EventType = J;\r\nJ.OPEN = \"a\";\r\nJ.CLOSE = \"b\";\r\nJ.ERROR = \"c\";\r\nJ.MESSAGE = \"d\";\r\nD.prototype.listen = D.prototype.va;\r\nX.prototype.listenOnce = X.prototype.wa;\r\nX.prototype.getLastError = X.prototype.Qa;\r\nX.prototype.getLastErrorCode = X.prototype.ua;\r\nX.prototype.getStatus = X.prototype.X;\r\nX.prototype.getResponseJson = X.prototype.Na;\r\nX.prototype.getResponseText = X.prototype.$;\r\nX.prototype.send = X.prototype.ba;\r\nvar createWebChannelTransport = function () { return new Nd; };\r\nvar ErrorCode = Zb;\r\nvar EventType = $b;\r\nvar WebChannel = cc;\r\nvar XhrIo = X;\r\n\r\nvar esm = {\r\n createWebChannelTransport: createWebChannelTransport,\r\n ErrorCode: ErrorCode,\r\n EventType: EventType,\r\n WebChannel: WebChannel,\r\n XhrIo: XhrIo\r\n};\n\nexport default esm;\nexport { ErrorCode, EventType, WebChannel, XhrIo, createWebChannelTransport };\n//# sourceMappingURL=index.esm.js.map\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <http://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return '<Buffer ' + str + '>'\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","\"use strict\";\n\nvar deselectCurrent = require(\"toggle-selection\");\n\nvar clipboardToIE11Formatting = {\n \"text/plain\": \"Text\",\n \"text/html\": \"Url\",\n \"default\": \"Text\"\n}\n\nvar defaultMessage = \"Copy to clipboard: #{key}, Enter\";\n\nfunction format(message) {\n var copyKey = (/mac os x/i.test(navigator.userAgent) ? \"⌘\" : \"Ctrl\") + \"+C\";\n return message.replace(/#{\\s*key\\s*}/g, copyKey);\n}\n\nfunction copy(text, options) {\n var debug,\n message,\n reselectPrevious,\n range,\n selection,\n mark,\n success = false;\n if (!options) {\n options = {};\n }\n debug = options.debug || false;\n try {\n reselectPrevious = deselectCurrent();\n\n range = document.createRange();\n selection = document.getSelection();\n\n mark = document.createElement(\"span\");\n mark.textContent = text;\n // reset user styles for span element\n mark.style.all = \"unset\";\n // prevents scrolling to the end of the page\n mark.style.position = \"fixed\";\n mark.style.top = 0;\n mark.style.clip = \"rect(0, 0, 0, 0)\";\n // used to preserve spaces and line breaks\n mark.style.whiteSpace = \"pre\";\n // do not inherit user-select (it may be `none`)\n mark.style.webkitUserSelect = \"text\";\n mark.style.MozUserSelect = \"text\";\n mark.style.msUserSelect = \"text\";\n mark.style.userSelect = \"text\";\n mark.addEventListener(\"copy\", function(e) {\n e.stopPropagation();\n if (options.format) {\n e.preventDefault();\n if (typeof e.clipboardData === \"undefined\") { // IE 11\n debug && console.warn(\"unable to use e.clipboardData\");\n debug && console.warn(\"trying IE specific stuff\");\n window.clipboardData.clearData();\n var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting[\"default\"]\n window.clipboardData.setData(format, text);\n } else { // all other browsers\n e.clipboardData.clearData();\n e.clipboardData.setData(options.format, text);\n }\n }\n if (options.onCopy) {\n e.preventDefault();\n options.onCopy(e.clipboardData);\n }\n });\n\n document.body.appendChild(mark);\n\n range.selectNodeContents(mark);\n selection.addRange(range);\n\n var successful = document.execCommand(\"copy\");\n if (!successful) {\n throw new Error(\"copy command was unsuccessful\");\n }\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using execCommand: \", err);\n debug && console.warn(\"trying IE specific stuff\");\n try {\n window.clipboardData.setData(options.format || \"text\", text);\n options.onCopy && options.onCopy(window.clipboardData);\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using clipboardData: \", err);\n debug && console.error(\"falling back to prompt\");\n message = format(\"message\" in options ? options.message : defaultMessage);\n window.prompt(message, text);\n }\n } finally {\n if (selection) {\n if (typeof selection.removeRange == \"function\") {\n selection.removeRange(range);\n } else {\n selection.removeAllRanges();\n }\n }\n\n if (mark) {\n document.body.removeChild(mark);\n }\n reselectPrevious();\n }\n\n return success;\n}\n\nmodule.exports = copy;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (useSourceMap) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item, useSourceMap);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join('');\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === 'string') {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, '']];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring\n\n var cssMapping = item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (useSourceMap && typeof btoa === 'function') {\n var sourceMapping = toComment(cssMapping);\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || '').concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n }\n\n return [content].join('\\n');\n} // Adapted from convert-source-map (MIT)\n\n\nfunction toComment(sourceMap) {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n return \"/*# \".concat(data, \" */\");\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function eventListener() {\n if (errorListener !== undefined) {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n var errorListener;\n\n // Adding an error listener is not optional because\n // if an error is thrown on an event emitter we cannot\n // guarantee that the actual event we are waiting will\n // be fired. The result could be a silent way to create\n // memory or file descriptor leaks, which is something\n // we should avoid.\n if (name !== 'error') {\n errorListener = function errorListener(err) {\n emitter.removeListener(name, eventListener);\n reject(err);\n };\n\n emitter.once('error', errorListener);\n }\n\n emitter.once(name, eventListener);\n });\n}\n","import firebase from '@firebase/app';\nexport { default } from '@firebase/app';\nimport '@firebase/auth';\nimport '@firebase/database';\nimport '@firebase/firestore';\nimport '@firebase/functions';\nimport '@firebase/messaging';\nimport '@firebase/storage';\nimport '@firebase/performance';\nimport '@firebase/analytics';\nimport '@firebase/remote-config';\n\nvar name = \"firebase\";\nvar version = \"8.0.0\";\n\n/**\r\n * @license\r\n * Copyright 2018 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfirebase.registerVersion(name, version, 'app');\n\nvar name$1 = \"firebase\";\nvar version$1 = \"8.0.0\";\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconsole.warn(\"\\nIt looks like you're using the development build of the Firebase JS SDK.\\nWhen deploying Firebase apps to production, it is advisable to only import\\nthe individual SDK components you intend to use.\\n\\nFor the module builds, these are available in the following manner\\n(replace <PACKAGE> with the name of a component - i.e. auth, database, etc):\\n\\nCommonJS Modules:\\nconst firebase = require('firebase/app');\\nrequire('firebase/<PACKAGE>');\\n\\nES Modules:\\nimport firebase from 'firebase/app';\\nimport 'firebase/<PACKAGE>';\\n\\nTypescript:\\nimport firebase from 'firebase/app';\\nimport 'firebase/<PACKAGE>';\\n\");\r\nfirebase.registerVersion(name$1, version$1);\n//# sourceMappingURL=index.esm.js.map\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\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;\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","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = global || self, factory(global.idb = {}));\n}(this, function (exports) { 'use strict';\n\n function toArray(arr) {\n return Array.prototype.slice.call(arr);\n }\n\n function promisifyRequest(request) {\n return new Promise(function(resolve, reject) {\n request.onsuccess = function() {\n resolve(request.result);\n };\n\n request.onerror = function() {\n reject(request.error);\n };\n });\n }\n\n function promisifyRequestCall(obj, method, args) {\n var request;\n var p = new Promise(function(resolve, reject) {\n request = obj[method].apply(obj, args);\n promisifyRequest(request).then(resolve, reject);\n });\n\n p.request = request;\n return p;\n }\n\n function promisifyCursorRequestCall(obj, method, args) {\n var p = promisifyRequestCall(obj, method, args);\n return p.then(function(value) {\n if (!value) return;\n return new Cursor(value, p.request);\n });\n }\n\n function proxyProperties(ProxyClass, targetProp, properties) {\n properties.forEach(function(prop) {\n Object.defineProperty(ProxyClass.prototype, prop, {\n get: function() {\n return this[targetProp][prop];\n },\n set: function(val) {\n this[targetProp][prop] = val;\n }\n });\n });\n }\n\n function proxyRequestMethods(ProxyClass, targetProp, Constructor, properties) {\n properties.forEach(function(prop) {\n if (!(prop in Constructor.prototype)) return;\n ProxyClass.prototype[prop] = function() {\n return promisifyRequestCall(this[targetProp], prop, arguments);\n };\n });\n }\n\n function proxyMethods(ProxyClass, targetProp, Constructor, properties) {\n properties.forEach(function(prop) {\n if (!(prop in Constructor.prototype)) return;\n ProxyClass.prototype[prop] = function() {\n return this[targetProp][prop].apply(this[targetProp], arguments);\n };\n });\n }\n\n function proxyCursorRequestMethods(ProxyClass, targetProp, Constructor, properties) {\n properties.forEach(function(prop) {\n if (!(prop in Constructor.prototype)) return;\n ProxyClass.prototype[prop] = function() {\n return promisifyCursorRequestCall(this[targetProp], prop, arguments);\n };\n });\n }\n\n function Index(index) {\n this._index = index;\n }\n\n proxyProperties(Index, '_index', [\n 'name',\n 'keyPath',\n 'multiEntry',\n 'unique'\n ]);\n\n proxyRequestMethods(Index, '_index', IDBIndex, [\n 'get',\n 'getKey',\n 'getAll',\n 'getAllKeys',\n 'count'\n ]);\n\n proxyCursorRequestMethods(Index, '_index', IDBIndex, [\n 'openCursor',\n 'openKeyCursor'\n ]);\n\n function Cursor(cursor, request) {\n this._cursor = cursor;\n this._request = request;\n }\n\n proxyProperties(Cursor, '_cursor', [\n 'direction',\n 'key',\n 'primaryKey',\n 'value'\n ]);\n\n proxyRequestMethods(Cursor, '_cursor', IDBCursor, [\n 'update',\n 'delete'\n ]);\n\n // proxy 'next' methods\n ['advance', 'continue', 'continuePrimaryKey'].forEach(function(methodName) {\n if (!(methodName in IDBCursor.prototype)) return;\n Cursor.prototype[methodName] = function() {\n var cursor = this;\n var args = arguments;\n return Promise.resolve().then(function() {\n cursor._cursor[methodName].apply(cursor._cursor, args);\n return promisifyRequest(cursor._request).then(function(value) {\n if (!value) return;\n return new Cursor(value, cursor._request);\n });\n });\n };\n });\n\n function ObjectStore(store) {\n this._store = store;\n }\n\n ObjectStore.prototype.createIndex = function() {\n return new Index(this._store.createIndex.apply(this._store, arguments));\n };\n\n ObjectStore.prototype.index = function() {\n return new Index(this._store.index.apply(this._store, arguments));\n };\n\n proxyProperties(ObjectStore, '_store', [\n 'name',\n 'keyPath',\n 'indexNames',\n 'autoIncrement'\n ]);\n\n proxyRequestMethods(ObjectStore, '_store', IDBObjectStore, [\n 'put',\n 'add',\n 'delete',\n 'clear',\n 'get',\n 'getAll',\n 'getKey',\n 'getAllKeys',\n 'count'\n ]);\n\n proxyCursorRequestMethods(ObjectStore, '_store', IDBObjectStore, [\n 'openCursor',\n 'openKeyCursor'\n ]);\n\n proxyMethods(ObjectStore, '_store', IDBObjectStore, [\n 'deleteIndex'\n ]);\n\n function Transaction(idbTransaction) {\n this._tx = idbTransaction;\n this.complete = new Promise(function(resolve, reject) {\n idbTransaction.oncomplete = function() {\n resolve();\n };\n idbTransaction.onerror = function() {\n reject(idbTransaction.error);\n };\n idbTransaction.onabort = function() {\n reject(idbTransaction.error);\n };\n });\n }\n\n Transaction.prototype.objectStore = function() {\n return new ObjectStore(this._tx.objectStore.apply(this._tx, arguments));\n };\n\n proxyProperties(Transaction, '_tx', [\n 'objectStoreNames',\n 'mode'\n ]);\n\n proxyMethods(Transaction, '_tx', IDBTransaction, [\n 'abort'\n ]);\n\n function UpgradeDB(db, oldVersion, transaction) {\n this._db = db;\n this.oldVersion = oldVersion;\n this.transaction = new Transaction(transaction);\n }\n\n UpgradeDB.prototype.createObjectStore = function() {\n return new ObjectStore(this._db.createObjectStore.apply(this._db, arguments));\n };\n\n proxyProperties(UpgradeDB, '_db', [\n 'name',\n 'version',\n 'objectStoreNames'\n ]);\n\n proxyMethods(UpgradeDB, '_db', IDBDatabase, [\n 'deleteObjectStore',\n 'close'\n ]);\n\n function DB(db) {\n this._db = db;\n }\n\n DB.prototype.transaction = function() {\n return new Transaction(this._db.transaction.apply(this._db, arguments));\n };\n\n proxyProperties(DB, '_db', [\n 'name',\n 'version',\n 'objectStoreNames'\n ]);\n\n proxyMethods(DB, '_db', IDBDatabase, [\n 'close'\n ]);\n\n // Add cursor iterators\n // TODO: remove this once browsers do the right thing with promises\n ['openCursor', 'openKeyCursor'].forEach(function(funcName) {\n [ObjectStore, Index].forEach(function(Constructor) {\n // Don't create iterateKeyCursor if openKeyCursor doesn't exist.\n if (!(funcName in Constructor.prototype)) return;\n\n Constructor.prototype[funcName.replace('open', 'iterate')] = function() {\n var args = toArray(arguments);\n var callback = args[args.length - 1];\n var nativeObject = this._store || this._index;\n var request = nativeObject[funcName].apply(nativeObject, args.slice(0, -1));\n request.onsuccess = function() {\n callback(request.result);\n };\n };\n });\n });\n\n // polyfill getAll\n [Index, ObjectStore].forEach(function(Constructor) {\n if (Constructor.prototype.getAll) return;\n Constructor.prototype.getAll = function(query, count) {\n var instance = this;\n var items = [];\n\n return new Promise(function(resolve) {\n instance.iterateCursor(query, function(cursor) {\n if (!cursor) {\n resolve(items);\n return;\n }\n items.push(cursor.value);\n\n if (count !== undefined && items.length == count) {\n resolve(items);\n return;\n }\n cursor.continue();\n });\n });\n };\n });\n\n function openDb(name, version, upgradeCallback) {\n var p = promisifyRequestCall(indexedDB, 'open', [name, version]);\n var request = p.request;\n\n if (request) {\n request.onupgradeneeded = function(event) {\n if (upgradeCallback) {\n upgradeCallback(new UpgradeDB(request.result, event.oldVersion, request.transaction));\n }\n };\n }\n\n return p.then(function(db) {\n return new DB(db);\n });\n }\n\n function deleteDb(name) {\n return promisifyRequestCall(indexedDB, 'deleteDatabase', [name]);\n }\n\n exports.openDb = openDb;\n exports.deleteDb = deleteDb;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","/* jshint node:true */\n'use strict';\n\nmodule.exports = require('os').EOL","/* jshint node:true */\n'use strict';\n\n// Escape the textDelimiters contained in the field\n/*(https://tools.ietf.org/html/rfc4180)\n 7. If double-quotes are used to enclose fields, then a double-quote\n appearing inside a field must be escaped by preceding it with\n another double quote.\n For example: \"aaa\",\"b\"\"bb\",\"ccc\"\n*/\n\nmodule.exports = function escapedDelimiters(textDelimiter, rowDelimiter, forceTextDelimiter) { \n let endOfLine = '\\n';\n\n if (typeof textDelimiter !== 'string') {\n throw new TypeError('Invalid param \"textDelimiter\", must be a string.');\n }\n\n if (typeof rowDelimiter !== 'string') {\n throw new TypeError('Invalid param \"rowDelimiter\", must be a string.');\n }\n\n let textDelimiterRegex = new RegExp(\"\\\\\" + textDelimiter, 'g');\n let escapedDelimiter = textDelimiter + textDelimiter;\n\n const enclosingCondition = (textDelimiter === '\"') ? \n (value) => (value.indexOf(rowDelimiter) >= 0 || \n value.indexOf(endOfLine) >= 0 ||\n value.indexOf('\"') >= 0)\n : (value) => (value.indexOf(rowDelimiter) >= 0 || \n value.indexOf(endOfLine) >= 0);\n\n return function(value) {\n if(forceTextDelimiter) value = \"\" + value;\n\n if (!value.replace) return value;\n // Escape the textDelimiters contained in the field\n value = value.replace(textDelimiterRegex, escapedDelimiter);\n \n // Escape the whole field if it contains a rowDelimiter or a linebreak or double quote\n if (forceTextDelimiter || enclosingCondition(value)) {\n value = textDelimiter + value + textDelimiter;\n }\n\n return value;\n };\n};\n","'use strict';\n\nmodule.exports.isFunction = (fn) => {\n var getType = {};\n return fn && getType.toString.call(fn) === '[object Function]';\n};\n\nmodule.exports.isArray = (arr) => Array.isArray(arr);\n\nmodule.exports.isObject = (obj) => obj instanceof Object;\n\nmodule.exports.isString = (str) => typeof str === 'string';\n\nmodule.exports.isNumber = (num) => typeof num === 'number';\n\nmodule.exports.isBoolean = (bool) => typeof bool === 'boolean';\n\nmodule.exports.isDate = (date) => date instanceof Date;\n","const EOL = require('./eol');\nconst helper = require('./helper');\n\nmodule.exports = function joinRows(rows, join) {\n if (!rows || !helper.isArray(rows)) {\n throw new TypeError('Invalid params \"rows\" for joinRows.' +\n ' Must be an array of string.');\n }\n //Merge all rows in a single output with the correct End of Line string\n var r = rows.join(join || EOL || '\\n');\n return r;\n};\n","/* jshint node:true */\n'use strict';\n\nconst Transform = require('stream').Transform;\n\nclass Stream extends Transform {\n\n constructor(parser) {\n super();\n this._parser = parser;\n this._options = parser._options;\n this._headers = this._options.headers || [];\n this._hasHeaders = false;\n this._lastError = null;\n }\n\n _mergeChunk(chunk) {\n let self = this;\n self._extra = self._extra || \"\";\n // Remove starting comma\n if (self._extra.charAt(0) == ',') self._extra = self._extra.substr(1);\n // Append extra to chunk\n chunk = self._extra + chunk.toString();\n // Clear extra memory\n if (self._extra.length > 0) self._extra = \"\";\n return chunk;\n }\n \n _wrapArray(data) {\n if (data.charAt(0) != '[') data = '[' + data;\n if (data.charAt(data.length - 1) != ']') data += ']';\n return data;\n }\n\n _transform(chunk, encoding, done) {\n let self = this;\n let json = null;\n // Append extra data to chunk data\n chunk = this._mergeChunk(chunk); \n if (!chunk) return done(this._lastError);\n // Split chunk in objects\n let parts = chunk.split('}');\n while (json === null && parts.length > 0) {\n try {\n let data = self._wrapArray(parts.join('}'));\n json = JSON.parse(data);\n } catch (ex) {\n this._lastError = ex;\n let extraChunk = parts.pop();\n self._extra = extraChunk + (self._extra || \"\");\n if (parts.length > 0) parts[parts.length - 1] += \"}\";\n }\n } \n if (!json) return done();\n this._parser.parse(json, (err, csvChunk) => {\n if (err) return done(err);\n if (!self.hasHeaders) {\n self.hasHeaders = true;\n self.push(self._parser.headers);\n }\n self.push(self._options.endOfLine + csvChunk);\n done();\n }, true);\n }\n}\n\nmodule.exports = Stream;\n","/* jshint node:true */\n'use strict';\n/**\n * Module dependencies.\n */\n//const _ = require('underscore');\nconst Parser = require('./parser/csv');\nconst Stream = require('./core/stream');\nconst helper = require('./core/helper');\nconst EOL = require('./core/eol');\n\n/**\n * Main function that converts json to csv\n *\n * @param {Object|Array} json\n * @param {Object} [options]\n * @param {Function} callback(err, csv) - Callback function\n * if error, returning error in call back.\n * if csv is created successfully, returning csv output to callback.\n */\nmodule.exports = function() {\n const DEFAULT_OPTIONS = {\n headers: [], // Array\n rename: [], // Array\n headerPathString: '.', // String\n rowDelimiter: ',', // String\n textDelimiter: '\"', // String\n arrayPathString: ';', // String\n undefinedString: '', // String\n endOfLine: EOL || '\\n', // String\n mainPathItem: null, // String\n booleanTrueString: null, // String\n booleanFalseString: null, // String\n includeHeaders: true, // Boolean\n fillGaps: false, // Boolean\n verticalOutput: true, // Boolean\n forceTextDelimiter: false, //Boolean\n };\n // argument parsing\n let json, userOptions, callback;\n if (arguments.length === 3) {\n [json, userOptions, callback] = arguments;\n } else if (arguments.length === 2) {\n let any;\n [json, any] = arguments;\n if (typeof any === 'function') {\n callback = any;\n } else if (typeof any === 'object') {\n userOptions = any;\n }\n } else if (arguments.length === 1) {\n const [any] = arguments;\n if (typeof any === 'object') {\n const defaultKeys = Object.keys(DEFAULT_OPTIONS);\n const objectKeys = Object.keys(any);\n const isOptions = objectKeys.every((key) => defaultKeys.includes(key)); \n if (objectKeys.length > 0 && isOptions) {\n userOptions = any;\n } else {\n json = any;\n }\n } else {\n json = any;\n }\n } else {\n return new Stream(new Parser(DEFAULT_OPTIONS));\n }\n const options = Object.assign({}, DEFAULT_OPTIONS, userOptions);\n const parser = new Parser(options);\n // if no json is provided Stream API will be used\n if (!json) {\n return new Stream(parser);\n }\n // always return an promise\n return new Promise((resolve, reject) => {\n parser.parse(json, (err, result) => {\n if (callback) return callback(err, result);\n if (err) return reject(err);\n if (reject) return resolve(result);\n });\n });\n};\n","/* jshint node:true */\n'use strict';\n\n/**\n * Module dependencies.\n */\nconst joinRows = require('../core/join-rows');\nconst Handler = require('./handler');\nconst helper = require('../core/helper');\n\nclass Parser {\n constructor(options) {\n this._options = options || {};\n this._handler = new Handler(this._options);\n this._headers = this._options.headers || [];\n this._escape = require('../core/escape-delimiters')(\n this._options.textDelimiter,\n this._options.rowDelimiter,\n this._options.forceTextDelimiter\n );\n }\n\n /**\n * Generates a CSV file with optional headers based on the passed JSON,\n * with can be an Object or Array.\n *\n * @param {Object|Array} json\n * @param {Function} done(err,csv) - Callback function\n * if error, returning error in call back.\n * if csv is created successfully, returning csv output to callback.\n */\n parse(json, done, stream) {\n if (helper.isArray(json)) return done(null, this._parseArray(json, stream));\n else if (helper.isObject(json)) return done(null, this._parseObject(json));\n return done(new Error('Unable to parse the JSON object, its not an Array or Object.'));\n }\n\n get headers() {\n let headers = this._headers;\n\n if (this._options.rename && this._options.rename.length > 0)\n headers = headers.map((header) => this._options.rename[this._options.headers.indexOf(header)] || header);\n \n if (this._options.forceTextDelimiter) {\n headers = headers.map((header) => {\n return `${this._options.textDelimiter}${header}${this._options.textDelimiter}`;\n });\n }\n\n if (this._options.mapHeaders)\n headers = headers.map(this._options.mapHeaders);\n\n return headers.join(this._options.rowDelimiter);\n }\n\n _checkRows(rows) {\n let lastRow = null;\n let finalRows = [];\n let fillGaps = (col, index) => col === '' || col === undefined ? lastRow[index] : col;\n for (let row of rows) {\n let missing = this._headers.length - row.length;\n if (missing > 0) row = row.concat(Array(missing).join(\".\").split(\".\"));\n if (lastRow && this._options.fillGaps) row = row.map(fillGaps);\n finalRows.push(row.join(this._options.rowDelimiter));\n lastRow = row;\n }\n return finalRows;\n }\n\n _parseArray(json, stream) {\n let self = this;\n this._headers = this._headers || [];\n let fileRows = [];\n let outputFile;\n let fillRows;\n\n let getHeaderIndex = function(header) {\n var index = self._headers.indexOf(header);\n if (index === -1) {\n self._headers.push(header);\n index = self._headers.indexOf(header);\n }\n return index;\n };\n\n //Generate the csv output\n fillRows = function(result) {\n const rows = [];\n const fillAndPush = (row) => rows.push(row.map(col => col != null ? col : ''));\n // initialize the array with empty strings to handle 'unpopular' headers\n const newRow = () => new Array(self._headers.length).fill(null);\n const emptyRowIndexByHeader = {};\n let currentRow = newRow();\n for (let element of result) {\n let elementHeaderIndex = getHeaderIndex(element.item);\n if (currentRow[elementHeaderIndex] != undefined) {\n fillAndPush(currentRow);\n currentRow = newRow();\n }\n emptyRowIndexByHeader[elementHeaderIndex] = emptyRowIndexByHeader[elementHeaderIndex] || 0;\n // make sure there isnt a empty row for this header\n if (self._options.fillTopRow && emptyRowIndexByHeader[elementHeaderIndex] < rows.length) {\n rows[emptyRowIndexByHeader[elementHeaderIndex]][elementHeaderIndex] = self._escape(element.value);\n emptyRowIndexByHeader[elementHeaderIndex] += 1;\n continue;\n }\n currentRow[elementHeaderIndex] = self._escape(element.value);\n emptyRowIndexByHeader[elementHeaderIndex] += 1;\n }\n // push last row\n if (currentRow.length > 0) {\n fillAndPush(currentRow);\n }\n fileRows = fileRows.concat(self._checkRows(rows));\n };\n for (let item of json) {\n //Call checkType to list all items inside this object\n //Items are returned as a object {item: 'Prop Value, Item Name', value: 'Prop Data Value'}\n let itemResult = self._handler.check(item, self._options.mainPathItem, item, json);\n fillRows(itemResult);\n }\n\n if (!stream && self._options.includeHeaders) {\n //Add the headers to the first line\n fileRows.unshift(this.headers);\n }\n\n return joinRows(fileRows, self._options.endOfLine);\n }\n\n _parseObject(json) {\n let self = this;\n let fileRows = [];\n let parseResult = [];\n let outputFile;\n let fillRows;\n let horizontalRows = [\n [],\n []\n ];\n\n fillRows = function(result) {\n var value = result.value ? result.value.toString() : self._options.undefinedString;\n value = self._escape(value);\n\n //Type header;value\n if (self._options.verticalOutput) {\n var row = [result.item, value];\n fileRows.push(row.join(self._options.rowDelimiter));\n } else {\n horizontalRows[0].push(result.item);\n horizontalRows[1].push(value);\n }\n };\n for (var prop in json) {\n var prefix = \"\";\n if (this._options.mainPathItem)\n prefix = this._options.mainPathItem + this._options.headerPathString;\n parseResult = this._handler.check(json[prop], prefix + prop, prop, json);\n\n parseResult.forEach(fillRows);\n }\n if (!this._options.verticalOutput) {\n fileRows.push(horizontalRows[0].join(this._options.rowDelimiter));\n fileRows.push(horizontalRows[1].join(this._options.rowDelimiter));\n }\n return joinRows(fileRows, this._options.endOfLine);\n }\n}\n\nmodule.exports = Parser;\n","/* jshint node:true */\n'use strict';\n\nconst helper = require('../core/helper');\n\nclass Handler {\n constructor(options) {\n this._options = options;\n\n // an object of {typeName:(value,index,parent)=>any}\n this._options.typeHandlers = this._options.typeHandlers || {};\n }\n\n /**\n * Check if results needing mapping to alternate value\n *\n * @returns [{item, value}] result\n */\n _setHeaders(result, item) {\n let self = this;\n if (!item) return result;\n return result.map(function(element) {\n element.item = element.item ? item + self._options.headerPathString + element.item : item;\n return element;\n });\n }\n\n castValue(element, item, index, parent){\n //cast by matching constructor\n const types = this._options.typeHandlers;\n for (let type in types ) {\n if( isInstanceOfTypeName(element,type) ){\n element = types[type].call(types, element, index, parent);\n break;//first match we move on\n }\n }\n\n return element;\n }\n\n checkComplex(element, item){\n //Check if element is a Date\n if (helper.isDate(element)) {\n return [{\n item: item,\n value: this._options.handleDate(element, item),\n }];\n }\n //Check if element is an Array\n else if (helper.isArray(element)) {\n var resultArray = this._handleArray(element, item);\n return this._setHeaders(resultArray, item);\n }\n //Check if element is a Object\n else if (helper.isObject(element)) {\n var resultObject = this._handleObject(element);\n return this._setHeaders(resultObject, item);\n }\n\n return [{\n item: item,\n value: '',\n }];\n }\n \n /**\n * Check the element type of the element call the correct handle function\n *\n * @param element Element that will be checked\n * @param item Used to make the headers/path breadcrumb\n * @returns [{item, value}] result\n */\n check(element, item, index, parent) {\n element = this.castValue(element, item, index, parent);\n // try simple value by highier performance switch\n switch(typeof element){\n case 'string':\n return [{\n item: item,\n value: this._handleString(element, item),\n }];\n\n case 'number':\n return [{\n item: item,\n value: this._handleNumber(element, item),\n }];\n\n case 'boolean':\n return [{\n item: item,\n value: this._handleBoolean.bind(this)(element, item),\n }];\n }\n\n return this.checkComplex(element, item);\n }\n\n\n /**\n * Handle all Objects\n *\n * @param {Object} obj\n * @returns [{item, value}] result\n */\n _handleObject(obj) {\n var result = [];\n //Look every object props\n for (var prop in obj) {\n var propData = obj[prop];\n //Check the propData type\n var resultCheckType = this.check(propData, prop, prop, obj);\n //Append to results aka merge results aka array-append-array\n result = result.concat(resultCheckType);\n }\n return result;\n }\n \n /**\n * Handle all Arrays, merges arrays with primitive types in a single value\n *\n * @param {Array} array\n * @returns [{item, value}] result\n */\n _handleArray(array) {\n let self = this;\n let result = [];\n var firstElementWithoutItem;\n for (let aIndex=0; aIndex < array.length; ++aIndex) {\n let element = array[aIndex];\n //Check the propData type\n var resultCheckType = self.check(element, null, aIndex, array);\n //Check for results without itens, merge all itens with the first occurrence\n if (resultCheckType.length === 0) continue;\n var firstResult = resultCheckType[0];\n if (!firstResult.item && firstElementWithoutItem !== undefined) {\n firstElementWithoutItem.value += self._options.arrayPathString + firstResult.value;\n continue;\n } else if (resultCheckType.length > 0 && !firstResult.item && firstElementWithoutItem === undefined) {\n firstElementWithoutItem = firstResult;\n }\n //Append to results\n result = result.concat(resultCheckType);\n }\n return result;\n }\n /**\n * Handle all Boolean variables, can be replaced with options.handleBoolean\n *\n * @param {Boolean} boolean\n * @returns {String} result\n */\n _handleBoolean(boolean) {\n var result;\n //Check for booolean options\n if (boolean) {\n result = this._options.booleanTrueString || 'true';\n } else {\n result = this._options.booleanFalseString || 'false';\n }\n return result;\n }\n /**\n * Handle all String variables, can be replaced with options.handleString\n *\n * @param {String} string\n * @returns {String} string\n */\n _handleString(string) {\n return string;\n }\n /**\n * Handle all Number variables, can be replaced with options.handleNumber\n *\n * @param {Number} number\n * @returns {Number} number\n */\n _handleNumber(number) {\n return number;\n }\n /**\n * Handle all Date variables, can be replaced with options.handleDate\n *\n * @param {Date} number\n * @returns {string} result\n */\n _handleDate(date) {\n return date.toLocaleDateString();\n }\n\n}\n\nmodule.exports = Handler;\n\nconst globalScope = typeof(window)===\"undefined\" ? global : window;\nfunction isInstanceOfTypeName(element, typeName){\n if( element instanceof globalScope[typeName] ){\n return true;//Buffer and complex objects\n }\n\n //literals in javascript cannot be checked by instance of\n switch( typeof(element) ){\n case 'string':return typeName===\"String\";\n case 'boolean':return typeName===\"Boolean\";\n case 'number':return typeName===\"Number\";\n }\n\n return false;\n}\n","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","exports.endianness = function () { return 'LE' };\n\nexports.hostname = function () {\n if (typeof location !== 'undefined') {\n return location.hostname\n }\n else return '';\n};\n\nexports.loadavg = function () { return [] };\n\nexports.uptime = function () { return 0 };\n\nexports.freemem = function () {\n return Number.MAX_VALUE;\n};\n\nexports.totalmem = function () {\n return Number.MAX_VALUE;\n};\n\nexports.cpus = function () { return [] };\n\nexports.type = function () { return 'Browser' };\n\nexports.release = function () {\n if (typeof navigator !== 'undefined') {\n return navigator.appVersion;\n }\n return '';\n};\n\nexports.networkInterfaces\n= exports.getNetworkInterfaces\n= function () { return {} };\n\nexports.arch = function () { return 'javascript' };\n\nexports.platform = function () { return 'browser' };\n\nexports.tmpdir = exports.tmpDir = function () {\n return '/tmp';\n};\n\nexports.EOL = '\\n';\n\nexports.homedir = function () {\n\treturn '/'\n};\n","'use strict';\n\nif (typeof process === 'undefined' ||\n !process.version ||\n process.version.indexOf('v0.') === 0 ||\n process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {\n module.exports = { nextTick: nextTick };\n} else {\n module.exports = process\n}\n\nfunction nextTick(fn, arg1, arg2, arg3) {\n if (typeof fn !== 'function') {\n throw new TypeError('\"callback\" argument must be a function');\n }\n var len = arguments.length;\n var args, i;\n switch (len) {\n case 0:\n case 1:\n return process.nextTick(fn);\n case 2:\n return process.nextTick(function afterTickOne() {\n fn.call(null, arg1);\n });\n case 3:\n return process.nextTick(function afterTickTwo() {\n fn.call(null, arg1, arg2);\n });\n case 4:\n return process.nextTick(function afterTickThree() {\n fn.call(null, arg1, arg2, arg3);\n });\n default:\n args = new Array(len - 1);\n i = 0;\n while (i < args.length) {\n args[i++] = arguments[i];\n }\n return process.nextTick(function afterTick() {\n fn.apply(null, args);\n });\n }\n}\n\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// 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}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\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 try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\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\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\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\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\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 if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\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) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\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\n'use strict';\n\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n var has = Function.call.bind(Object.prototype.hasOwnProperty);\n\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\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 * 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 */\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;\n // 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 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(\n (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'\n );\n err.name = 'Invariant Violation';\n throw err;\n }\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n if (error && !(error instanceof Error)) {\n printWarning(\n (componentName || 'React class') + ': type specification of ' +\n location + ' `' + typeSpecName + '` is invalid; the type checker ' +\n 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +\n 'You may have forgotten to pass an argument to the type checker ' +\n 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +\n '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\n var stack = getStack ? getStack() : '';\n\n printWarning(\n 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')\n );\n }\n }\n }\n }\n}\n\n/**\n * Resets warning cache when testing.\n *\n * @private\n */\ncheckPropTypes.resetWarningCache = function() {\n if (process.env.NODE_ENV !== 'production') {\n loggedTypeFailures = {};\n }\n}\n\nmodule.exports = checkPropTypes;\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\n'use strict';\n\nvar ReactIs = require('react-is');\nvar assign = require('object-assign');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\nvar checkPropTypes = require('./checkPropTypes');\n\nvar has = Function.call.bind(Object.prototype.hasOwnProperty);\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\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 function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\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 var ANONYMOUS = '<<anonymous>>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\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\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 /**\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 /*eslint-disable no-self-compare*/\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 function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\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 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(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\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 if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n printWarning(\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\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 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\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\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 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\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n return null;\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 var propValue = props[propName];\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 for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\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 return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\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 return null;\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 return null;\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(\n 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +\n 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'\n );\n } else {\n printWarning('Invalid argument supplied to oneOf, expected an array.');\n }\n }\n return emptyFunctionThatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\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 if (type === 'symbol') {\n return String(value);\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 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 var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (has(propValue, key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\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 if (typeof checker !== 'function') {\n printWarning(\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\n 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'\n );\n return emptyFunctionThatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\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 return null;\n }\n return createChainableTypeChecker(validate);\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 if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (!checker) {\n continue;\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\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 if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from\n // props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (!checker) {\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\n );\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\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 case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\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 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 default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // falsy value can't be a Symbol\n if (!propValue) {\n return false;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\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 if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\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\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\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","/**\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 ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.CopyToClipboard = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _copyToClipboard = _interopRequireDefault(require(\"copy-to-clipboard\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar CopyToClipboard =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inherits(CopyToClipboard, _React$PureComponent);\n\n function CopyToClipboard() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, CopyToClipboard);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(CopyToClipboard)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"onClick\", function (event) {\n var _this$props = _this.props,\n text = _this$props.text,\n onCopy = _this$props.onCopy,\n children = _this$props.children,\n options = _this$props.options;\n\n var elem = _react[\"default\"].Children.only(children);\n\n var result = (0, _copyToClipboard[\"default\"])(text, options);\n\n if (onCopy) {\n onCopy(text, result);\n } // Bypass onClick if it was present\n\n\n if (elem && elem.props && typeof elem.props.onClick === 'function') {\n elem.props.onClick(event);\n }\n });\n\n return _this;\n }\n\n _createClass(CopyToClipboard, [{\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n _text = _this$props2.text,\n _onCopy = _this$props2.onCopy,\n _options = _this$props2.options,\n children = _this$props2.children,\n props = _objectWithoutProperties(_this$props2, [\"text\", \"onCopy\", \"options\", \"children\"]);\n\n var elem = _react[\"default\"].Children.only(children);\n\n return _react[\"default\"].cloneElement(elem, _objectSpread({}, props, {\n onClick: this.onClick\n }));\n }\n }]);\n\n return CopyToClipboard;\n}(_react[\"default\"].PureComponent);\n\nexports.CopyToClipboard = CopyToClipboard;\n\n_defineProperty(CopyToClipboard, \"defaultProps\", {\n onCopy: undefined,\n options: undefined\n});","\"use strict\";\n\nvar _require = require('./Component'),\n CopyToClipboard = _require.CopyToClipboard;\n\nCopyToClipboard.CopyToClipboard = CopyToClipboard;\nmodule.exports = CopyToClipboard;","/** @license React v16.13.1\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\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\nvar _assign = require('object-assign');\nvar Scheduler = require('scheduler');\nvar checkPropTypes = require('prop-types/checkPropTypes');\nvar tracing = require('scheduler/tracing');\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions.\n// Current owner and dispatcher used to share the same ref,\n// but PR #14548 split them out to better support the react-debug-tools package.\n\nif (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {\n ReactSharedInternals.ReactCurrentDispatcher = {\n current: null\n };\n}\n\nif (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {\n ReactSharedInternals.ReactCurrentBatchConfig = {\n suspense: null\n };\n}\n\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\nfunction warn(format) {\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}\nfunction error(format) {\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\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\\n in') === 0;\n\n if (!hasExistingStack) {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n }\n }\n\n var argsWithFormat = args.map(function (item) {\n return '' + 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 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 var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n throw new Error(message);\n } catch (x) {}\n }\n}\n\nif (!React) {\n {\n throw Error( \"ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.\" );\n }\n}\n\nvar invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) {\n var funcArgs = Array.prototype.slice.call(arguments, 3);\n\n try {\n func.apply(context, funcArgs);\n } catch (error) {\n this.onError(error);\n }\n};\n\n{\n // In DEV mode, we swap out invokeGuardedCallback for a special version\n // that plays more nicely with the browser's DevTools. The idea is to preserve\n // \"Pause on exceptions\" behavior. Because React wraps all user-provided\n // functions in invokeGuardedCallback, and the production version of\n // invokeGuardedCallback uses a try-catch, all user exceptions are treated\n // like caught exceptions, and the DevTools won't pause unless the developer\n // takes the extra step of enabling pause on caught exceptions. This is\n // unintuitive, though, because even though React has caught the error, from\n // the developer's perspective, the error is uncaught.\n //\n // To preserve the expected \"Pause on exceptions\" behavior, we don't use a\n // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake\n // DOM node, and call the user-provided callback from inside an event handler\n // for that fake event. If the callback throws, the error is \"captured\" using\n // a global event handler. But because the error happens in a different\n // event loop context, it does not interrupt the normal program flow.\n // Effectively, this gives us try-catch behavior without actually using\n // try-catch. Neat!\n // Check that the browser supports the APIs we need to implement our special\n // DEV version of invokeGuardedCallback\n if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {\n var fakeNode = document.createElement('react');\n\n var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {\n // If document doesn't exist we know for sure we will crash in this method\n // when we call document.createEvent(). However this can cause confusing\n // errors: https://github.com/facebookincubator/create-react-app/issues/3482\n // So we preemptively throw with a better message instead.\n if (!(typeof document !== 'undefined')) {\n {\n throw Error( \"The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.\" );\n }\n }\n\n var evt = document.createEvent('Event'); // Keeps track of whether the user-provided callback threw an error. We\n // set this to true at the beginning, then set it to false right after\n // calling the function. If the function errors, `didError` will never be\n // set to false. This strategy works even if the browser is flaky and\n // fails to call our global error handler, because it doesn't rely on\n // the error event at all.\n\n var didError = true; // Keeps track of the value of window.event so that we can reset it\n // during the callback to let user code access window.event in the\n // browsers that support it.\n\n var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event\n // dispatching: https://github.com/facebook/react/issues/13688\n\n var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); // Create an event handler for our fake event. We will synchronously\n // dispatch our fake event using `dispatchEvent`. Inside the handler, we\n // call the user-provided callback.\n\n var funcArgs = Array.prototype.slice.call(arguments, 3);\n\n function callCallback() {\n // We immediately remove the callback from event listeners so that\n // nested `invokeGuardedCallback` calls do not clash. Otherwise, a\n // nested call would trigger the fake event handlers of any call higher\n // in the stack.\n fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the\n // window.event assignment in both IE <= 10 as they throw an error\n // \"Member not found\" in strict mode, and in Firefox which does not\n // support window.event.\n\n if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {\n window.event = windowEvent;\n }\n\n func.apply(context, funcArgs);\n didError = false;\n } // Create a global error event handler. We use this to capture the value\n // that was thrown. It's possible that this error handler will fire more\n // than once; for example, if non-React code also calls `dispatchEvent`\n // and a handler for that event throws. We should be resilient to most of\n // those cases. Even if our error event handler fires more than once, the\n // last error event is always used. If the callback actually does error,\n // we know that the last error event is the correct one, because it's not\n // possible for anything else to have happened in between our callback\n // erroring and the code that follows the `dispatchEvent` call below. If\n // the callback doesn't error, but the error event was fired, we know to\n // ignore it because `didError` will be false, as described above.\n\n\n var error; // Use this to track whether the error event is ever called.\n\n var didSetError = false;\n var isCrossOriginError = false;\n\n function handleWindowError(event) {\n error = event.error;\n didSetError = true;\n\n if (error === null && event.colno === 0 && event.lineno === 0) {\n isCrossOriginError = true;\n }\n\n if (event.defaultPrevented) {\n // Some other error handler has prevented default.\n // Browsers silence the error report if this happens.\n // We'll remember this to later decide whether to log it or not.\n if (error != null && typeof error === 'object') {\n try {\n error._suppressLogging = true;\n } catch (inner) {// Ignore.\n }\n }\n }\n } // Create a fake event type.\n\n\n var evtType = \"react-\" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers\n\n window.addEventListener('error', handleWindowError);\n fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function\n // errors, it will trigger our global error handler.\n\n evt.initEvent(evtType, false, false);\n fakeNode.dispatchEvent(evt);\n\n if (windowEventDescriptor) {\n Object.defineProperty(window, 'event', windowEventDescriptor);\n }\n\n if (didError) {\n if (!didSetError) {\n // The callback errored, but the error event never fired.\n error = new Error('An error was thrown inside one of your components, but React ' + \"doesn't know what it was. This is likely due to browser \" + 'flakiness. React does its best to preserve the \"Pause on ' + 'exceptions\" behavior of the DevTools, which requires some ' + \"DEV-mode only tricks. It's possible that these don't work in \" + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');\n } else if (isCrossOriginError) {\n error = new Error(\"A cross-origin error was thrown. React doesn't have access to \" + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');\n }\n\n this.onError(error);\n } // Remove our event listeners\n\n\n window.removeEventListener('error', handleWindowError);\n };\n\n invokeGuardedCallbackImpl = invokeGuardedCallbackDev;\n }\n}\n\nvar invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;\n\nvar hasError = false;\nvar caughtError = null; // Used by event system to capture/rethrow the first error.\n\nvar hasRethrowError = false;\nvar rethrowError = null;\nvar reporter = {\n onError: function (error) {\n hasError = true;\n caughtError = error;\n }\n};\n/**\n * Call a function while guarding against errors that happens within it.\n * Returns an error if it throws, otherwise null.\n *\n * In production, this is implemented using a try-catch. The reason we don't\n * use a try-catch directly is so that we can swap out a different\n * implementation in DEV mode.\n *\n * @param {String} name of the guard to use for logging or debugging\n * @param {Function} func The function to invoke\n * @param {*} context The context to use when calling the function\n * @param {...*} args Arguments for function\n */\n\nfunction invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {\n hasError = false;\n caughtError = null;\n invokeGuardedCallbackImpl$1.apply(reporter, arguments);\n}\n/**\n * Same as invokeGuardedCallback, but instead of returning an error, it stores\n * it in a global so it can be rethrown by `rethrowCaughtError` later.\n * TODO: See if caughtError and rethrowError can be unified.\n *\n * @param {String} name of the guard to use for logging or debugging\n * @param {Function} func The function to invoke\n * @param {*} context The context to use when calling the function\n * @param {...*} args Arguments for function\n */\n\nfunction invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {\n invokeGuardedCallback.apply(this, arguments);\n\n if (hasError) {\n var error = clearCaughtError();\n\n if (!hasRethrowError) {\n hasRethrowError = true;\n rethrowError = error;\n }\n }\n}\n/**\n * During execution of guarded functions we will capture the first error which\n * we will rethrow to be handled by the top level error handler.\n */\n\nfunction rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n}\nfunction hasCaughtError() {\n return hasError;\n}\nfunction clearCaughtError() {\n if (hasError) {\n var error = caughtError;\n hasError = false;\n caughtError = null;\n return error;\n } else {\n {\n {\n throw Error( \"clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n }\n}\n\nvar getFiberCurrentPropsFromNode = null;\nvar getInstanceFromNode = null;\nvar getNodeFromInstance = null;\nfunction setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) {\n getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;\n getInstanceFromNode = getInstanceFromNodeImpl;\n getNodeFromInstance = getNodeFromInstanceImpl;\n\n {\n if (!getNodeFromInstance || !getInstanceFromNode) {\n error('EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.');\n }\n }\n}\nvar validateEventDispatches;\n\n{\n validateEventDispatches = function (event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n var listenersIsArr = Array.isArray(dispatchListeners);\n var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;\n var instancesIsArr = Array.isArray(dispatchInstances);\n var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;\n\n if (instancesIsArr !== listenersIsArr || instancesLen !== listenersLen) {\n error('EventPluginUtils: Invalid `event`.');\n }\n };\n}\n/**\n * Dispatch the event to the listener.\n * @param {SyntheticEvent} event SyntheticEvent to handle\n * @param {function} listener Application-level callback\n * @param {*} inst Internal component instance\n */\n\n\nfunction executeDispatch(event, listener, inst) {\n var type = event.type || 'unknown-event';\n event.currentTarget = getNodeFromInstance(inst);\n invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);\n event.currentTarget = null;\n}\n/**\n * Standard/simple iteration through an event's collected dispatches.\n */\n\nfunction executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n}\n\nvar FunctionComponent = 0;\nvar ClassComponent = 1;\nvar IndeterminateComponent = 2; // Before we know whether it is function or class\n\nvar HostRoot = 3; // Root of a host tree. Could be nested inside another node.\n\nvar HostPortal = 4; // A subtree. Could be an entry point to a different renderer.\n\nvar HostComponent = 5;\nvar HostText = 6;\nvar Fragment = 7;\nvar Mode = 8;\nvar ContextConsumer = 9;\nvar ContextProvider = 10;\nvar ForwardRef = 11;\nvar Profiler = 12;\nvar SuspenseComponent = 13;\nvar MemoComponent = 14;\nvar SimpleMemoComponent = 15;\nvar LazyComponent = 16;\nvar IncompleteClassComponent = 17;\nvar DehydratedFragment = 18;\nvar SuspenseListComponent = 19;\nvar FundamentalComponent = 20;\nvar ScopeComponent = 21;\nvar Block = 22;\n\n/**\n * Injectable ordering of event plugins.\n */\nvar eventPluginOrder = null;\n/**\n * Injectable mapping from names to event plugin modules.\n */\n\nvar namesToPlugins = {};\n/**\n * Recomputes the plugin list using the injected plugins and plugin ordering.\n *\n * @private\n */\n\nfunction recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n if (!(pluginIndex > -1)) {\n {\n throw Error( \"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\" );\n }\n }\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n if (!pluginModule.extractEvents) {\n {\n throw Error( \"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\" );\n }\n }\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw Error( \"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\" );\n }\n }\n }\n }\n}\n/**\n * Publishes an event so that it can be dispatched by the supplied plugin.\n *\n * @param {object} dispatchConfig Dispatch configuration for the event.\n * @param {object} PluginModule Plugin publishing the event.\n * @return {boolean} True if the event was successfully published.\n * @private\n */\n\n\nfunction publishEventForPlugin(dispatchConfig, pluginModule, eventName) {\n if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) {\n {\n throw Error( \"EventPluginRegistry: More than one plugin attempted to publish the same event name, `\" + eventName + \"`.\" );\n }\n }\n\n eventNameDispatchConfigs[eventName] = dispatchConfig;\n var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;\n\n if (phasedRegistrationNames) {\n for (var phaseName in phasedRegistrationNames) {\n if (phasedRegistrationNames.hasOwnProperty(phaseName)) {\n var phasedRegistrationName = phasedRegistrationNames[phaseName];\n publishRegistrationName(phasedRegistrationName, pluginModule, eventName);\n }\n }\n\n return true;\n } else if (dispatchConfig.registrationName) {\n publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);\n return true;\n }\n\n return false;\n}\n/**\n * Publishes a registration name that is used to identify dispatched events.\n *\n * @param {string} registrationName Registration name to add.\n * @param {object} PluginModule Plugin publishing the event.\n * @private\n */\n\n\nfunction publishRegistrationName(registrationName, pluginModule, eventName) {\n if (!!registrationNameModules[registrationName]) {\n {\n throw Error( \"EventPluginRegistry: More than one plugin attempted to publish the same registration name, `\" + registrationName + \"`.\" );\n }\n }\n\n registrationNameModules[registrationName] = pluginModule;\n registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;\n\n {\n var lowerCasedName = registrationName.toLowerCase();\n possibleRegistrationNames[lowerCasedName] = registrationName;\n\n if (registrationName === 'onDoubleClick') {\n possibleRegistrationNames.ondblclick = registrationName;\n }\n }\n}\n/**\n * Registers plugins so that they can extract and dispatch events.\n */\n\n/**\n * Ordered list of injected plugins.\n */\n\n\nvar plugins = [];\n/**\n * Mapping from event name to dispatch config\n */\n\nvar eventNameDispatchConfigs = {};\n/**\n * Mapping from registration name to plugin module\n */\n\nvar registrationNameModules = {};\n/**\n * Mapping from registration name to event name\n */\n\nvar registrationNameDependencies = {};\n/**\n * Mapping from lowercase registration names to the properly cased version,\n * used to warn in the case of missing event handlers. Available\n * only in true.\n * @type {Object}\n */\n\nvar possibleRegistrationNames = {} ; // Trust the developer to only use possibleRegistrationNames in true\n\n/**\n * Injects an ordering of plugins (by plugin name). This allows the ordering\n * to be decoupled from injection of the actual plugins so that ordering is\n * always deterministic regardless of packaging, on-the-fly injection, etc.\n *\n * @param {array} InjectedEventPluginOrder\n * @internal\n */\n\nfunction injectEventPluginOrder(injectedEventPluginOrder) {\n if (!!eventPluginOrder) {\n {\n throw Error( \"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.\" );\n }\n } // Clone the ordering so it cannot be dynamically mutated.\n\n\n eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);\n recomputePluginOrdering();\n}\n/**\n * Injects plugins to be used by plugin event system. The plugin names must be\n * in the ordering injected by `injectEventPluginOrder`.\n *\n * Plugins can be injected as part of page initialization or on-the-fly.\n *\n * @param {object} injectedNamesToPlugins Map from names to plugin modules.\n * @internal\n */\n\nfunction injectEventPluginsByName(injectedNamesToPlugins) {\n var isOrderingDirty = false;\n\n for (var pluginName in injectedNamesToPlugins) {\n if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {\n continue;\n }\n\n var pluginModule = injectedNamesToPlugins[pluginName];\n\n if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {\n if (!!namesToPlugins[pluginName]) {\n {\n throw Error( \"EventPluginRegistry: Cannot inject two different event plugins using the same name, `\" + pluginName + \"`.\" );\n }\n }\n\n namesToPlugins[pluginName] = pluginModule;\n isOrderingDirty = true;\n }\n }\n\n if (isOrderingDirty) {\n recomputePluginOrdering();\n }\n}\n\nvar canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');\n\nvar PLUGIN_EVENT_SYSTEM = 1;\nvar IS_REPLAYED = 1 << 5;\nvar IS_FIRST_ANCESTOR = 1 << 6;\n\nvar restoreImpl = null;\nvar restoreTarget = null;\nvar restoreQueue = null;\n\nfunction restoreStateOfTarget(target) {\n // We perform this translation at the end of the event loop so that we\n // always receive the correct fiber here\n var internalInstance = getInstanceFromNode(target);\n\n if (!internalInstance) {\n // Unmounted\n return;\n }\n\n if (!(typeof restoreImpl === 'function')) {\n {\n throw Error( \"setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n var stateNode = internalInstance.stateNode; // Guard against Fiber being unmounted.\n\n if (stateNode) {\n var _props = getFiberCurrentPropsFromNode(stateNode);\n\n restoreImpl(internalInstance.stateNode, internalInstance.type, _props);\n }\n}\n\nfunction setRestoreImplementation(impl) {\n restoreImpl = impl;\n}\nfunction enqueueStateRestore(target) {\n if (restoreTarget) {\n if (restoreQueue) {\n restoreQueue.push(target);\n } else {\n restoreQueue = [target];\n }\n } else {\n restoreTarget = target;\n }\n}\nfunction needsStateRestore() {\n return restoreTarget !== null || restoreQueue !== null;\n}\nfunction restoreStateIfNeeded() {\n if (!restoreTarget) {\n return;\n }\n\n var target = restoreTarget;\n var queuedTargets = restoreQueue;\n restoreTarget = null;\n restoreQueue = null;\n restoreStateOfTarget(target);\n\n if (queuedTargets) {\n for (var i = 0; i < queuedTargets.length; i++) {\n restoreStateOfTarget(queuedTargets[i]);\n }\n }\n}\n\nvar enableProfilerTimer = true; // Trace which interactions trigger each commit.\n\nvar enableDeprecatedFlareAPI = false; // Experimental Host Component support.\n\nvar enableFundamentalAPI = false; // Experimental Scope support.\nvar warnAboutStringRefs = false;\n\n// the renderer. Such as when we're dispatching events or if third party\n// libraries need to call batchedUpdates. Eventually, this API will go away when\n// everything is batched by default. We'll then have a similar API to opt-out of\n// scheduled work and instead do synchronous work.\n// Defaults\n\nvar batchedUpdatesImpl = function (fn, bookkeeping) {\n return fn(bookkeeping);\n};\n\nvar discreteUpdatesImpl = function (fn, a, b, c, d) {\n return fn(a, b, c, d);\n};\n\nvar flushDiscreteUpdatesImpl = function () {};\n\nvar batchedEventUpdatesImpl = batchedUpdatesImpl;\nvar isInsideEventHandler = false;\nvar isBatchingEventUpdates = false;\n\nfunction finishEventHandler() {\n // Here we wait until all updates have propagated, which is important\n // when using controlled components within layers:\n // https://github.com/facebook/react/issues/1698\n // Then we restore state of any controlled component.\n var controlledComponentsHavePendingUpdates = needsStateRestore();\n\n if (controlledComponentsHavePendingUpdates) {\n // If a controlled event was fired, we may need to restore the state of\n // the DOM node back to the controlled value. This is necessary when React\n // bails out of the update without touching the DOM.\n flushDiscreteUpdatesImpl();\n restoreStateIfNeeded();\n }\n}\n\nfunction batchedUpdates(fn, bookkeeping) {\n if (isInsideEventHandler) {\n // If we are currently inside another batch, we need to wait until it\n // fully completes before restoring state.\n return fn(bookkeeping);\n }\n\n isInsideEventHandler = true;\n\n try {\n return batchedUpdatesImpl(fn, bookkeeping);\n } finally {\n isInsideEventHandler = false;\n finishEventHandler();\n }\n}\nfunction batchedEventUpdates(fn, a, b) {\n if (isBatchingEventUpdates) {\n // If we are currently inside another batch, we need to wait until it\n // fully completes before restoring state.\n return fn(a, b);\n }\n\n isBatchingEventUpdates = true;\n\n try {\n return batchedEventUpdatesImpl(fn, a, b);\n } finally {\n isBatchingEventUpdates = false;\n finishEventHandler();\n }\n} // This is for the React Flare event system\nfunction discreteUpdates(fn, a, b, c, d) {\n var prevIsInsideEventHandler = isInsideEventHandler;\n isInsideEventHandler = true;\n\n try {\n return discreteUpdatesImpl(fn, a, b, c, d);\n } finally {\n isInsideEventHandler = prevIsInsideEventHandler;\n\n if (!isInsideEventHandler) {\n finishEventHandler();\n }\n }\n}\nfunction flushDiscreteUpdatesIfNeeded(timeStamp) {\n // event.timeStamp isn't overly reliable due to inconsistencies in\n // how different browsers have historically provided the time stamp.\n // Some browsers provide high-resolution time stamps for all events,\n // some provide low-resolution time stamps for all events. FF < 52\n // even mixes both time stamps together. Some browsers even report\n // negative time stamps or time stamps that are 0 (iOS9) in some cases.\n // Given we are only comparing two time stamps with equality (!==),\n // we are safe from the resolution differences. If the time stamp is 0\n // we bail-out of preventing the flush, which can affect semantics,\n // such as if an earlier flush removes or adds event listeners that\n // are fired in the subsequent flush. However, this is the same\n // behaviour as we had before this change, so the risks are low.\n if (!isInsideEventHandler && (!enableDeprecatedFlareAPI )) {\n flushDiscreteUpdatesImpl();\n }\n}\nfunction setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {\n batchedUpdatesImpl = _batchedUpdatesImpl;\n discreteUpdatesImpl = _discreteUpdatesImpl;\n flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;\n batchedEventUpdatesImpl = _batchedEventUpdatesImpl;\n}\n\nvar DiscreteEvent = 0;\nvar UserBlockingEvent = 1;\nvar ContinuousEvent = 2;\n\n// A reserved attribute.\n// It is handled by React separately and shouldn't be written to the DOM.\nvar RESERVED = 0; // A simple string attribute.\n// Attributes that aren't in the whitelist are presumed to have this type.\n\nvar 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\nvar 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\nvar 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\nvar OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.\n// When falsy, it should be removed.\n\nvar NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.\n// When falsy, it should be removed.\n\nvar POSITIVE_NUMERIC = 6;\n\n/* eslint-disable max-len */\nvar 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\nvar ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + \"\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040\";\nvar ROOT_ATTRIBUTE_NAME = 'data-reactroot';\nvar VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar illegalAttributeNameCache = {};\nvar validatedAttributeNameCache = {};\nfunction 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 {\n error('Invalid attribute name: `%s`', attributeName);\n }\n\n return false;\n}\nfunction shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {\n if (propertyInfo !== null) {\n return propertyInfo.type === RESERVED;\n }\n\n if (isCustomComponentTag) {\n return false;\n }\n\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return true;\n }\n\n return false;\n}\nfunction 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}\nfunction shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {\n if (value === null || typeof value === 'undefined') {\n return true;\n }\n\n if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {\n return true;\n }\n\n if (isCustomComponentTag) {\n return false;\n }\n\n if (propertyInfo !== null) {\n switch (propertyInfo.type) {\n case BOOLEAN:\n return !value;\n\n case OVERLOADED_BOOLEAN:\n return value === false;\n\n case NUMERIC:\n return isNaN(value);\n\n case POSITIVE_NUMERIC:\n return isNaN(value) || value < 1;\n }\n }\n\n return false;\n}\nfunction getPropertyInfo(name) {\n return properties.hasOwnProperty(name) ? properties[name] : null;\n}\n\nfunction PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) {\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} // 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\nvar properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.\n\nvar 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\nreservedProps.forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\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);\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);\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);\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', '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);\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);\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);\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);\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);\n});\nvar CAMELIZE = /[\\-\\:]([a-z])/g;\n\nvar capitalize = function (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 whitelist.\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);\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);\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);\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);\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\nvar xlinkHref = 'xlinkHref';\nproperties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty\n'xlink:href', 'http://www.w3.org/1999/xlink', true);\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);\n});\n\nvar ReactDebugCurrentFrame = null;\n\n{\n ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n} // A javascript: URL can contain leading C0 control or \\u0020 SPACE,\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\nvar 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;\nvar didWarn = false;\n\nfunction sanitizeURL(url) {\n {\n if (!didWarn && isJavaScriptProtocol.test(url)) {\n didWarn = true;\n\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/**\n * Get the value for a property on a node. Only used in DEV for SSR validation.\n * The \"expected\" argument is used as a hint of what the expected value is.\n * Some properties have multiple equivalent values.\n */\nfunction getValueForProperty(node, name, expected, propertyInfo) {\n {\n if (propertyInfo.mustUseProperty) {\n var propertyName = propertyInfo.propertyName;\n return node[propertyName];\n } else {\n if ( propertyInfo.sanitizeURL) {\n // If we haven't fully disabled javascript: URLs, and if\n // the hydration is successful of a javascript: URL, we\n // still want to warn on the client.\n sanitizeURL('' + expected);\n }\n\n var attributeName = propertyInfo.attributeName;\n var stringValue = null;\n\n if (propertyInfo.type === OVERLOADED_BOOLEAN) {\n if (node.hasAttribute(attributeName)) {\n var value = node.getAttribute(attributeName);\n\n if (value === '') {\n return true;\n }\n\n if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n return value;\n }\n\n if (value === '' + expected) {\n return expected;\n }\n\n return value;\n }\n } else if (node.hasAttribute(attributeName)) {\n if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n // We had an attribute but shouldn't have had one, so read it\n // for the error message.\n return node.getAttribute(attributeName);\n }\n\n if (propertyInfo.type === BOOLEAN) {\n // If this was a boolean, it doesn't matter what the value is\n // the fact that we have it is the same as the expected.\n return expected;\n } // Even if this property uses a namespace we use getAttribute\n // because we assume its namespaced name is the same as our config.\n // To use getAttributeNS we need the local name which we don't have\n // in our config atm.\n\n\n stringValue = node.getAttribute(attributeName);\n }\n\n if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n return stringValue === null ? expected : stringValue;\n } else if (stringValue === '' + expected) {\n return expected;\n } else {\n return stringValue;\n }\n }\n }\n}\n/**\n * Get the value for a attribute on a node. Only used in DEV for SSR validation.\n * The third argument is used as a hint of what the expected value is. Some\n * attributes have multiple equivalent values.\n */\n\nfunction getValueForAttribute(node, name, expected) {\n {\n if (!isAttributeNameSafe(name)) {\n return;\n }\n\n if (!node.hasAttribute(name)) {\n return expected === undefined ? undefined : null;\n }\n\n var value = node.getAttribute(name);\n\n if (value === '' + expected) {\n return expected;\n }\n\n return value;\n }\n}\n/**\n * Sets the value for a property on a node.\n *\n * @param {DOMElement} node\n * @param {string} name\n * @param {*} value\n */\n\nfunction setValueForProperty(node, name, value, isCustomComponentTag) {\n var propertyInfo = getPropertyInfo(name);\n\n if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {\n return;\n }\n\n if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {\n value = null;\n } // If the prop isn't in the special list, treat it as a simple attribute.\n\n\n if (isCustomComponentTag || propertyInfo === null) {\n if (isAttributeNameSafe(name)) {\n var _attributeName = name;\n\n if (value === null) {\n node.removeAttribute(_attributeName);\n } else {\n node.setAttribute(_attributeName, '' + value);\n }\n }\n\n return;\n }\n\n var mustUseProperty = propertyInfo.mustUseProperty;\n\n if (mustUseProperty) {\n var propertyName = propertyInfo.propertyName;\n\n if (value === null) {\n var type = propertyInfo.type;\n node[propertyName] = type === BOOLEAN ? false : '';\n } else {\n // Contrary to `setAttribute`, object properties are properly\n // `toString`ed by IE8/9.\n node[propertyName] = value;\n }\n\n return;\n } // The rest are treated as attributes with special cases.\n\n\n var attributeName = propertyInfo.attributeName,\n attributeNamespace = propertyInfo.attributeNamespace;\n\n if (value === null) {\n node.removeAttribute(attributeName);\n } else {\n var _type = propertyInfo.type;\n var attributeValue;\n\n if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {\n // If attribute type is boolean, we know for sure it won't be an execution sink\n // and we won't require Trusted Type here.\n attributeValue = '';\n } else {\n // `setAttribute` with objects becomes only `[object]` in IE8/9,\n // ('' + value) makes it output the correct toString()-value.\n {\n attributeValue = '' + value;\n }\n\n if (propertyInfo.sanitizeURL) {\n sanitizeURL(attributeValue.toString());\n }\n }\n\n if (attributeNamespace) {\n node.setAttributeNS(attributeNamespace, attributeName, attributeValue);\n } else {\n node.setAttribute(attributeName, attributeValue);\n }\n }\n}\n\nvar BEFORE_SLASH_RE = /^(.*)[\\\\\\/]/;\nfunction describeComponentFrame (name, source, ownerName) {\n var sourceInfo = '';\n\n if (source) {\n var path = source.fileName;\n var fileName = path.replace(BEFORE_SLASH_RE, '');\n\n {\n // In DEV, include code for a common special case:\n // prefer \"folder/index.js\" instead of just \"index.js\".\n if (/^index\\./.test(fileName)) {\n var match = path.match(BEFORE_SLASH_RE);\n\n if (match) {\n var pathBeforeSlash = match[1];\n\n if (pathBeforeSlash) {\n var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');\n fileName = folderName + '/' + fileName;\n }\n }\n }\n }\n\n sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';\n } else if (ownerName) {\n sourceInfo = ' (created by ' + ownerName + ')';\n }\n\n return '\\n in ' + (name || 'Unknown') + sourceInfo;\n}\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;\nvar MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction 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\nvar Uninitialized = -1;\nvar Pending = 0;\nvar Resolved = 1;\nvar Rejected = 2;\nfunction refineResolvedLazyComponent(lazyComponent) {\n return lazyComponent._status === Resolved ? lazyComponent._result : null;\n}\nfunction initializeLazyComponentType(lazyComponent) {\n if (lazyComponent._status === Uninitialized) {\n lazyComponent._status = Pending;\n var ctor = lazyComponent._ctor;\n var thenable = ctor();\n lazyComponent._result = thenable;\n thenable.then(function (moduleObject) {\n if (lazyComponent._status === Pending) {\n var defaultExport = moduleObject.default;\n\n {\n if (defaultExport === undefined) {\n error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + \"const MyComponent = lazy(() => import('./MyComponent'))\", moduleObject);\n }\n }\n\n lazyComponent._status = Resolved;\n lazyComponent._result = defaultExport;\n }\n }, function (error) {\n if (lazyComponent._status === Pending) {\n lazyComponent._status = Rejected;\n lazyComponent._result = error;\n }\n });\n }\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var functionName = innerType.displayName || innerType.name || '';\n return outerType.displayName || (functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName);\n}\n\nfunction getComponentName(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 getComponentName(). ' + '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 return 'Context.Consumer';\n\n case REACT_PROVIDER_TYPE:\n return 'Context.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n return getComponentName(type.type);\n\n case REACT_BLOCK_TYPE:\n return getComponentName(type.render);\n\n case REACT_LAZY_TYPE:\n {\n var thenable = type;\n var resolvedThenable = refineResolvedLazyComponent(thenable);\n\n if (resolvedThenable) {\n return getComponentName(resolvedThenable);\n }\n\n break;\n }\n }\n }\n\n return null;\n}\n\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction describeFiber(fiber) {\n switch (fiber.tag) {\n case HostRoot:\n case HostPortal:\n case HostText:\n case Fragment:\n case ContextProvider:\n case ContextConsumer:\n return '';\n\n default:\n var owner = fiber._debugOwner;\n var source = fiber._debugSource;\n var name = getComponentName(fiber.type);\n var ownerName = null;\n\n if (owner) {\n ownerName = getComponentName(owner.type);\n }\n\n return describeComponentFrame(name, source, ownerName);\n }\n}\n\nfunction getStackByFiberInDevAndProd(workInProgress) {\n var info = '';\n var node = workInProgress;\n\n do {\n info += describeFiber(node);\n node = node.return;\n } while (node);\n\n return info;\n}\nvar current = null;\nvar isRendering = false;\nfunction getCurrentFiberOwnerNameInDevOrNull() {\n {\n if (current === null) {\n return null;\n }\n\n var owner = current._debugOwner;\n\n if (owner !== null && typeof owner !== 'undefined') {\n return getComponentName(owner.type);\n }\n }\n\n return null;\n}\nfunction getCurrentFiberStackInDev() {\n {\n if (current === null) {\n return '';\n } // Safe because if current fiber exists, we are reconciling,\n // and it is guaranteed to be the work-in-progress version.\n\n\n return getStackByFiberInDevAndProd(current);\n }\n}\nfunction resetCurrentFiber() {\n {\n ReactDebugCurrentFrame$1.getCurrentStack = null;\n current = null;\n isRendering = false;\n }\n}\nfunction setCurrentFiber(fiber) {\n {\n ReactDebugCurrentFrame$1.getCurrentStack = getCurrentFiberStackInDev;\n current = fiber;\n isRendering = false;\n }\n}\nfunction setIsRendering(rendering) {\n {\n isRendering = rendering;\n }\n}\n\n// Flow does not allow string concatenation of most non-string types. To work\n// around this limitation, we use an opaque type that can only be obtained by\n// passing the value through getToStringValue first.\nfunction toString(value) {\n return '' + value;\n}\nfunction getToStringValue(value) {\n switch (typeof value) {\n case 'boolean':\n case 'number':\n case 'object':\n case 'string':\n case 'undefined':\n return value;\n\n default:\n // function, symbol are assigned as empty strings\n return '';\n }\n}\n\nvar ReactDebugCurrentFrame$2 = null;\nvar ReactControlledValuePropTypes = {\n checkPropTypes: null\n};\n\n{\n ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;\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 var propTypes = {\n value: function (props, propName, componentName) {\n if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) {\n return null;\n }\n\n return new 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 checked: function (props, propName, componentName) {\n if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) {\n return null;\n }\n\n return new 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 * Provide a linked `value` attribute for controlled forms. You should not use\n * this outside of the ReactDOM controlled form components.\n */\n\n ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {\n checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum);\n };\n}\n\nfunction isCheckable(elem) {\n var type = elem.type;\n var nodeName = elem.nodeName;\n return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');\n}\n\nfunction getTracker(node) {\n return node._valueTracker;\n}\n\nfunction detachTracker(node) {\n node._valueTracker = null;\n}\n\nfunction getValueFromNode(node) {\n var value = '';\n\n if (!node) {\n return value;\n }\n\n if (isCheckable(node)) {\n value = node.checked ? 'true' : 'false';\n } else {\n value = node.value;\n }\n\n return value;\n}\n\nfunction trackValueOnNode(node) {\n var valueField = isCheckable(node) ? 'checked' : 'value';\n var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);\n var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail\n // and don't track value will cause over reporting of changes,\n // but it's better then a hard failure\n // (needed for certain tests that spyOn input values and Safari)\n\n if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {\n return;\n }\n\n var get = descriptor.get,\n set = descriptor.set;\n Object.defineProperty(node, valueField, {\n configurable: true,\n get: function () {\n return get.call(this);\n },\n set: function (value) {\n currentValue = '' + value;\n set.call(this, value);\n }\n }); // We could've passed this the first time\n // but it triggers a bug in IE11 and Edge 14/15.\n // Calling defineProperty() again should be equivalent.\n // https://github.com/facebook/react/issues/11768\n\n Object.defineProperty(node, valueField, {\n enumerable: descriptor.enumerable\n });\n var tracker = {\n getValue: function () {\n return currentValue;\n },\n setValue: function (value) {\n currentValue = '' + value;\n },\n stopTracking: function () {\n detachTracker(node);\n delete node[valueField];\n }\n };\n return tracker;\n}\n\nfunction track(node) {\n if (getTracker(node)) {\n return;\n } // TODO: Once it's just Fiber we can move this to node._wrapperState\n\n\n node._valueTracker = trackValueOnNode(node);\n}\nfunction updateValueIfChanged(node) {\n if (!node) {\n return false;\n }\n\n var tracker = getTracker(node); // if there is no tracker at this point it's unlikely\n // that trying again will succeed\n\n if (!tracker) {\n return true;\n }\n\n var lastValue = tracker.getValue();\n var nextValue = getValueFromNode(node);\n\n if (nextValue !== lastValue) {\n tracker.setValue(nextValue);\n return true;\n }\n\n return false;\n}\n\nvar didWarnValueDefaultValue = false;\nvar didWarnCheckedDefaultChecked = false;\nvar didWarnControlledToUncontrolled = false;\nvar didWarnUncontrolledToControlled = false;\n\nfunction isControlled(props) {\n var usesChecked = props.type === 'checkbox' || props.type === 'radio';\n return usesChecked ? props.checked != null : props.value != null;\n}\n/**\n * Implements an <input> host component that allows setting these optional\n * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.\n *\n * If `checked` or `value` are not supplied (or null/undefined), user actions\n * that affect the checked state or value will trigger updates to the element.\n *\n * If they are supplied (and not null/undefined), the rendered element will not\n * trigger updates to the element. Instead, the props must change in order for\n * the rendered element to be updated.\n *\n * The rendered element will be initialized as unchecked (or `defaultChecked`)\n * with an empty value (or `defaultValue`).\n *\n * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html\n */\n\n\nfunction getHostProps(element, props) {\n var node = element;\n var checked = props.checked;\n\n var hostProps = _assign({}, props, {\n defaultChecked: undefined,\n defaultValue: undefined,\n value: undefined,\n checked: checked != null ? checked : node._wrapperState.initialChecked\n });\n\n return hostProps;\n}\nfunction initWrapperState(element, props) {\n {\n ReactControlledValuePropTypes.checkPropTypes('input', props);\n\n if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {\n error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);\n\n didWarnCheckedDefaultChecked = true;\n }\n\n if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {\n error('%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);\n\n didWarnValueDefaultValue = true;\n }\n }\n\n var node = element;\n var defaultValue = props.defaultValue == null ? '' : props.defaultValue;\n node._wrapperState = {\n initialChecked: props.checked != null ? props.checked : props.defaultChecked,\n initialValue: getToStringValue(props.value != null ? props.value : defaultValue),\n controlled: isControlled(props)\n };\n}\nfunction updateChecked(element, props) {\n var node = element;\n var checked = props.checked;\n\n if (checked != null) {\n setValueForProperty(node, 'checked', checked, false);\n }\n}\nfunction updateWrapper(element, props) {\n var node = element;\n\n {\n var controlled = isControlled(props);\n\n if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {\n error('A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);\n\n didWarnUncontrolledToControlled = true;\n }\n\n if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {\n error('A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);\n\n didWarnControlledToUncontrolled = true;\n }\n }\n\n updateChecked(element, props);\n var value = getToStringValue(props.value);\n var type = props.type;\n\n if (value != null) {\n if (type === 'number') {\n if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible.\n // eslint-disable-next-line\n node.value != value) {\n node.value = toString(value);\n }\n } else if (node.value !== toString(value)) {\n node.value = toString(value);\n }\n } else if (type === 'submit' || type === 'reset') {\n // Submit/reset inputs need the attribute removed completely to avoid\n // blank-text buttons.\n node.removeAttribute('value');\n return;\n }\n\n {\n // When syncing the value attribute, the value comes from a cascade of\n // properties:\n // 1. The value React property\n // 2. The defaultValue React property\n // 3. Otherwise there should be no change\n if (props.hasOwnProperty('value')) {\n setDefaultValue(node, props.type, value);\n } else if (props.hasOwnProperty('defaultValue')) {\n setDefaultValue(node, props.type, getToStringValue(props.defaultValue));\n }\n }\n\n {\n // When syncing the checked attribute, it only changes when it needs\n // to be removed, such as transitioning from a checkbox into a text input\n if (props.checked == null && props.defaultChecked != null) {\n node.defaultChecked = !!props.defaultChecked;\n }\n }\n}\nfunction postMountWrapper(element, props, isHydrating) {\n var node = element; // Do not assign value if it is already set. This prevents user text input\n // from being lost during SSR hydration.\n\n if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {\n var type = props.type;\n var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the\n // default value provided by the browser. See: #12872\n\n if (isButton && (props.value === undefined || props.value === null)) {\n return;\n }\n\n var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input\n // from being lost during SSR hydration.\n\n if (!isHydrating) {\n {\n // When syncing the value attribute, the value property should use\n // the wrapperState._initialValue property. This uses:\n //\n // 1. The value React property when present\n // 2. The defaultValue React property when present\n // 3. An empty string\n if (initialValue !== node.value) {\n node.value = initialValue;\n }\n }\n }\n\n {\n // Otherwise, the value attribute is synchronized to the property,\n // so we assign defaultValue to the same thing as the value property\n // assignment step above.\n node.defaultValue = initialValue;\n }\n } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug\n // this is needed to work around a chrome bug where setting defaultChecked\n // will sometimes influence the value of checked (even after detachment).\n // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416\n // We need to temporarily unset name to avoid disrupting radio button groups.\n\n\n var name = node.name;\n\n if (name !== '') {\n node.name = '';\n }\n\n {\n // When syncing the checked attribute, both the checked property and\n // attribute are assigned at the same time using defaultChecked. This uses:\n //\n // 1. The checked React property when present\n // 2. The defaultChecked React property when present\n // 3. Otherwise, false\n node.defaultChecked = !node.defaultChecked;\n node.defaultChecked = !!node._wrapperState.initialChecked;\n }\n\n if (name !== '') {\n node.name = name;\n }\n}\nfunction restoreControlledState(element, props) {\n var node = element;\n updateWrapper(node, props);\n updateNamedCousins(node, props);\n}\n\nfunction updateNamedCousins(rootNode, props) {\n var name = props.name;\n\n if (props.type === 'radio' && name != null) {\n var queryRoot = rootNode;\n\n while (queryRoot.parentNode) {\n queryRoot = queryRoot.parentNode;\n } // If `rootNode.form` was non-null, then we could try `form.elements`,\n // but that sometimes behaves strangely in IE8. We could also try using\n // `form.getElementsByName`, but that will only return direct children\n // and won't include inputs that use the HTML5 `form=` attribute. Since\n // the input might not even be in a form. It might not even be in the\n // document. Let's just use the local `querySelectorAll` to ensure we don't\n // miss anything.\n\n\n var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type=\"radio\"]');\n\n for (var i = 0; i < group.length; i++) {\n var otherNode = group[i];\n\n if (otherNode === rootNode || otherNode.form !== rootNode.form) {\n continue;\n } // This will throw if radio buttons rendered by different copies of React\n // and the same name are rendered into the same form (same as #1939).\n // That's probably okay; we don't support it just as we don't support\n // mixing React radio buttons with non-React ones.\n\n\n var otherProps = getFiberCurrentPropsFromNode$1(otherNode);\n\n if (!otherProps) {\n {\n throw Error( \"ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.\" );\n }\n } // We need update the tracked value on the named cousin since the value\n // was changed but the input saw no event or value set\n\n\n updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that\n // was previously checked to update will cause it to be come re-checked\n // as appropriate.\n\n updateWrapper(otherNode, otherProps);\n }\n }\n} // In Chrome, assigning defaultValue to certain input types triggers input validation.\n// For number inputs, the display value loses trailing decimal points. For email inputs,\n// Chrome raises \"The specified value <x> is not a valid email address\".\n//\n// Here we check to see if the defaultValue has actually changed, avoiding these problems\n// when the user is inputting text\n//\n// https://github.com/facebook/react/issues/7253\n\n\nfunction setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}\n\nvar didWarnSelectedSetOnOption = false;\nvar didWarnInvalidChild = false;\n\nfunction flattenChildren(children) {\n var content = ''; // Flatten children. We'll warn if they are invalid\n // during validateProps() which runs for hydration too.\n // Note that this would throw on non-element objects.\n // Elements are stringified (which is normally irrelevant\n // but matters for <fbt>).\n\n React.Children.forEach(children, function (child) {\n if (child == null) {\n return;\n }\n\n content += child; // Note: we don't warn about invalid children here.\n // Instead, this is done separately below so that\n // it happens during the hydration codepath too.\n });\n return content;\n}\n/**\n * Implements an <option> host component that warns when `selected` is set.\n */\n\n\nfunction validateProps(element, props) {\n {\n // This mirrors the codepath above, but runs for hydration too.\n // Warn about invalid children here so that client and hydration are consistent.\n // TODO: this seems like it could cause a DEV-only throw for hydration\n // if children contains a non-element object. We should try to avoid that.\n if (typeof props.children === 'object' && props.children !== null) {\n React.Children.forEach(props.children, function (child) {\n if (child == null) {\n return;\n }\n\n if (typeof child === 'string' || typeof child === 'number') {\n return;\n }\n\n if (typeof child.type !== 'string') {\n return;\n }\n\n if (!didWarnInvalidChild) {\n didWarnInvalidChild = true;\n\n error('Only strings and numbers are supported as <option> children.');\n }\n });\n } // TODO: Remove support for `selected` in <option>.\n\n\n if (props.selected != null && !didWarnSelectedSetOnOption) {\n error('Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.');\n\n didWarnSelectedSetOnOption = true;\n }\n }\n}\nfunction postMountWrapper$1(element, props) {\n // value=\"\" should make a value attribute (#6219)\n if (props.value != null) {\n element.setAttribute('value', toString(getToStringValue(props.value)));\n }\n}\nfunction getHostProps$1(element, props) {\n var hostProps = _assign({\n children: undefined\n }, props);\n\n var content = flattenChildren(props.children);\n\n if (content) {\n hostProps.children = content;\n }\n\n return hostProps;\n}\n\nvar didWarnValueDefaultValue$1;\n\n{\n didWarnValueDefaultValue$1 = false;\n}\n\nfunction getDeclarationErrorAddendum() {\n var ownerName = getCurrentFiberOwnerNameInDevOrNull();\n\n if (ownerName) {\n return '\\n\\nCheck the render method of `' + ownerName + '`.';\n }\n\n return '';\n}\n\nvar valuePropNames = ['value', 'defaultValue'];\n/**\n * Validation function for `value` and `defaultValue`.\n */\n\nfunction checkSelectPropTypes(props) {\n {\n ReactControlledValuePropTypes.checkPropTypes('select', props);\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n\n if (props[propName] == null) {\n continue;\n }\n\n var isArray = Array.isArray(props[propName]);\n\n if (props.multiple && !isArray) {\n error('The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());\n } else if (!props.multiple && isArray) {\n error('The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());\n }\n }\n }\n}\n\nfunction updateOptions(node, multiple, propValue, setDefaultSelected) {\n var options = node.options;\n\n if (multiple) {\n var selectedValues = propValue;\n var selectedValue = {};\n\n for (var i = 0; i < selectedValues.length; i++) {\n // Prefix to avoid chaos with special keys.\n selectedValue['$' + selectedValues[i]] = true;\n }\n\n for (var _i = 0; _i < options.length; _i++) {\n var selected = selectedValue.hasOwnProperty('$' + options[_i].value);\n\n if (options[_i].selected !== selected) {\n options[_i].selected = selected;\n }\n\n if (selected && setDefaultSelected) {\n options[_i].defaultSelected = true;\n }\n }\n } else {\n // Do not set `select.value` as exact behavior isn't consistent across all\n // browsers for all cases.\n var _selectedValue = toString(getToStringValue(propValue));\n\n var defaultSelected = null;\n\n for (var _i2 = 0; _i2 < options.length; _i2++) {\n if (options[_i2].value === _selectedValue) {\n options[_i2].selected = true;\n\n if (setDefaultSelected) {\n options[_i2].defaultSelected = true;\n }\n\n return;\n }\n\n if (defaultSelected === null && !options[_i2].disabled) {\n defaultSelected = options[_i2];\n }\n }\n\n if (defaultSelected !== null) {\n defaultSelected.selected = true;\n }\n }\n}\n/**\n * Implements a <select> host component that allows optionally setting the\n * props `value` and `defaultValue`. If `multiple` is false, the prop must be a\n * stringable. If `multiple` is true, the prop must be an array of stringables.\n *\n * If `value` is not supplied (or null/undefined), user actions that change the\n * selected option will trigger updates to the rendered options.\n *\n * If it is supplied (and not null/undefined), the rendered options will not\n * update in response to user actions. Instead, the `value` prop must change in\n * order for the rendered options to update.\n *\n * If `defaultValue` is provided, any options with the supplied values will be\n * selected.\n */\n\n\nfunction getHostProps$2(element, props) {\n return _assign({}, props, {\n value: undefined\n });\n}\nfunction initWrapperState$1(element, props) {\n var node = element;\n\n {\n checkSelectPropTypes(props);\n }\n\n node._wrapperState = {\n wasMultiple: !!props.multiple\n };\n\n {\n if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {\n error('Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');\n\n didWarnValueDefaultValue$1 = true;\n }\n }\n}\nfunction postMountWrapper$2(element, props) {\n var node = element;\n node.multiple = !!props.multiple;\n var value = props.value;\n\n if (value != null) {\n updateOptions(node, !!props.multiple, value, false);\n } else if (props.defaultValue != null) {\n updateOptions(node, !!props.multiple, props.defaultValue, true);\n }\n}\nfunction postUpdateWrapper(element, props) {\n var node = element;\n var wasMultiple = node._wrapperState.wasMultiple;\n node._wrapperState.wasMultiple = !!props.multiple;\n var value = props.value;\n\n if (value != null) {\n updateOptions(node, !!props.multiple, value, false);\n } else if (wasMultiple !== !!props.multiple) {\n // For simplicity, reapply `defaultValue` if `multiple` is toggled.\n if (props.defaultValue != null) {\n updateOptions(node, !!props.multiple, props.defaultValue, true);\n } else {\n // Revert the select back to its default unselected state.\n updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);\n }\n }\n}\nfunction restoreControlledState$1(element, props) {\n var node = element;\n var value = props.value;\n\n if (value != null) {\n updateOptions(node, !!props.multiple, value, false);\n }\n}\n\nvar didWarnValDefaultVal = false;\n\n/**\n * Implements a <textarea> host component that allows setting `value`, and\n * `defaultValue`. This differs from the traditional DOM API because value is\n * usually set as PCDATA children.\n *\n * If `value` is not supplied (or null/undefined), user actions that affect the\n * value will trigger updates to the element.\n *\n * If `value` is supplied (and not null/undefined), the rendered element will\n * not trigger updates to the element. Instead, the `value` prop must change in\n * order for the rendered element to be updated.\n *\n * The rendered element will be initialized with an empty value, the prop\n * `defaultValue` if specified, or the children content (deprecated).\n */\nfunction getHostProps$3(element, props) {\n var node = element;\n\n if (!(props.dangerouslySetInnerHTML == null)) {\n {\n throw Error( \"`dangerouslySetInnerHTML` does not make sense on <textarea>.\" );\n }\n } // Always set children to the same thing. In IE9, the selection range will\n // get reset if `textContent` is mutated. We could add a check in setTextContent\n // to only set the value if/when the value differs from the node value (which would\n // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this\n // solution. The value can be a boolean or object so that's why it's forced\n // to be a string.\n\n\n var hostProps = _assign({}, props, {\n value: undefined,\n defaultValue: undefined,\n children: toString(node._wrapperState.initialValue)\n });\n\n return hostProps;\n}\nfunction initWrapperState$2(element, props) {\n var node = element;\n\n {\n ReactControlledValuePropTypes.checkPropTypes('textarea', props);\n\n if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {\n error('%s contains a textarea with both value and defaultValue props. ' + 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component');\n\n didWarnValDefaultVal = true;\n }\n }\n\n var initialValue = props.value; // Only bother fetching default value if we're going to use it\n\n if (initialValue == null) {\n var children = props.children,\n defaultValue = props.defaultValue;\n\n if (children != null) {\n {\n error('Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');\n }\n\n {\n if (!(defaultValue == null)) {\n {\n throw Error( \"If you supply `defaultValue` on a <textarea>, do not pass children.\" );\n }\n }\n\n if (Array.isArray(children)) {\n if (!(children.length <= 1)) {\n {\n throw Error( \"<textarea> can only have at most one child.\" );\n }\n }\n\n children = children[0];\n }\n\n defaultValue = children;\n }\n }\n\n if (defaultValue == null) {\n defaultValue = '';\n }\n\n initialValue = defaultValue;\n }\n\n node._wrapperState = {\n initialValue: getToStringValue(initialValue)\n };\n}\nfunction updateWrapper$1(element, props) {\n var node = element;\n var value = getToStringValue(props.value);\n var defaultValue = getToStringValue(props.defaultValue);\n\n if (value != null) {\n // Cast `value` to a string to ensure the value is set correctly. While\n // browsers typically do this as necessary, jsdom doesn't.\n var newValue = toString(value); // To avoid side effects (such as losing text selection), only set value if changed\n\n if (newValue !== node.value) {\n node.value = newValue;\n }\n\n if (props.defaultValue == null && node.defaultValue !== newValue) {\n node.defaultValue = newValue;\n }\n }\n\n if (defaultValue != null) {\n node.defaultValue = toString(defaultValue);\n }\n}\nfunction postMountWrapper$3(element, props) {\n var node = element; // This is in postMount because we need access to the DOM node, which is not\n // available until after the component has mounted.\n\n var textContent = node.textContent; // Only set node.value if textContent is equal to the expected\n // initial value. In IE10/IE11 there is a bug where the placeholder attribute\n // will populate textContent as well.\n // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/\n\n if (textContent === node._wrapperState.initialValue) {\n if (textContent !== '' && textContent !== null) {\n node.value = textContent;\n }\n }\n}\nfunction restoreControlledState$2(element, props) {\n // DOM component is still mounted; update\n updateWrapper$1(element, props);\n}\n\nvar HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nvar MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\nvar SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nvar Namespaces = {\n html: HTML_NAMESPACE,\n mathml: MATH_NAMESPACE,\n svg: SVG_NAMESPACE\n}; // Assumes there is no parent namespace.\n\nfunction getIntrinsicNamespace(type) {\n switch (type) {\n case 'svg':\n return SVG_NAMESPACE;\n\n case 'math':\n return MATH_NAMESPACE;\n\n default:\n return HTML_NAMESPACE;\n }\n}\nfunction getChildNamespace(parentNamespace, type) {\n if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {\n // No (or default) parent namespace: potential entry point.\n return getIntrinsicNamespace(type);\n }\n\n if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {\n // We're leaving SVG.\n return HTML_NAMESPACE;\n } // By default, pass namespace below.\n\n\n return parentNamespace;\n}\n\n/* globals MSApp */\n\n/**\n * Create a function which has 'unsafe' privileges (required by windows8 apps)\n */\nvar createMicrosoftUnsafeLocalFunction = function (func) {\n if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {\n return function (arg0, arg1, arg2, arg3) {\n MSApp.execUnsafeLocalFunction(function () {\n return func(arg0, arg1, arg2, arg3);\n });\n };\n } else {\n return func;\n }\n};\n\nvar reusableSVGContainer;\n/**\n * Set the innerHTML property of a node\n *\n * @param {DOMElement} node\n * @param {string} html\n * @internal\n */\n\nvar setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {\n if (node.namespaceURI === Namespaces.svg) {\n\n if (!('innerHTML' in node)) {\n // IE does not have innerHTML for SVG nodes, so instead we inject the\n // new markup in a temp node and then move the child nodes across into\n // the target node\n reusableSVGContainer = reusableSVGContainer || document.createElement('div');\n reusableSVGContainer.innerHTML = '<svg>' + html.valueOf().toString() + '</svg>';\n var svgNode = reusableSVGContainer.firstChild;\n\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n\n while (svgNode.firstChild) {\n node.appendChild(svgNode.firstChild);\n }\n\n return;\n }\n }\n\n node.innerHTML = html;\n});\n\n/**\n * HTML nodeType values that represent the type of the node\n */\nvar ELEMENT_NODE = 1;\nvar TEXT_NODE = 3;\nvar COMMENT_NODE = 8;\nvar DOCUMENT_NODE = 9;\nvar DOCUMENT_FRAGMENT_NODE = 11;\n\n/**\n * Set the textContent property of a node. For text updates, it's faster\n * to set the `nodeValue` of the Text node directly instead of using\n * `.textContent` which will remove the existing node and create a new one.\n *\n * @param {DOMElement} node\n * @param {string} text\n * @internal\n */\n\nvar setTextContent = function (node, text) {\n if (text) {\n var firstChild = node.firstChild;\n\n if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {\n firstChild.nodeValue = text;\n return;\n }\n }\n\n node.textContent = text;\n};\n\n// Do not use the below two methods directly!\n// Instead use constants exported from DOMTopLevelEventTypes in ReactDOM.\n// (It is the only module that is allowed to access these methods.)\nfunction unsafeCastStringToDOMTopLevelType(topLevelType) {\n return topLevelType;\n}\nfunction unsafeCastDOMTopLevelTypeToString(topLevelType) {\n return topLevelType;\n}\n\n/**\n * Generate a mapping of standard vendor prefixes using the defined style property and event name.\n *\n * @param {string} styleProp\n * @param {string} eventName\n * @returns {object}\n */\n\nfunction makePrefixMap(styleProp, eventName) {\n var prefixes = {};\n prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();\n prefixes['Webkit' + styleProp] = 'webkit' + eventName;\n prefixes['Moz' + styleProp] = 'moz' + eventName;\n return prefixes;\n}\n/**\n * A list of event names to a configurable list of vendor prefixes.\n */\n\n\nvar vendorPrefixes = {\n animationend: makePrefixMap('Animation', 'AnimationEnd'),\n animationiteration: makePrefixMap('Animation', 'AnimationIteration'),\n animationstart: makePrefixMap('Animation', 'AnimationStart'),\n transitionend: makePrefixMap('Transition', 'TransitionEnd')\n};\n/**\n * Event names that have already been detected and prefixed (if applicable).\n */\n\nvar prefixedEventNames = {};\n/**\n * Element to check for prefixes on.\n */\n\nvar style = {};\n/**\n * Bootstrap if a DOM exists.\n */\n\nif (canUseDOM) {\n style = document.createElement('div').style; // On some platforms, in particular some releases of Android 4.x,\n // the un-prefixed \"animation\" and \"transition\" properties are defined on the\n // style object but the events that fire will still be prefixed, so we need\n // to check if the un-prefixed events are usable, and if not remove them from the map.\n\n if (!('AnimationEvent' in window)) {\n delete vendorPrefixes.animationend.animation;\n delete vendorPrefixes.animationiteration.animation;\n delete vendorPrefixes.animationstart.animation;\n } // Same as above\n\n\n if (!('TransitionEvent' in window)) {\n delete vendorPrefixes.transitionend.transition;\n }\n}\n/**\n * Attempts to determine the correct vendor prefixed event name.\n *\n * @param {string} eventName\n * @returns {string}\n */\n\n\nfunction getVendorPrefixedEventName(eventName) {\n if (prefixedEventNames[eventName]) {\n return prefixedEventNames[eventName];\n } else if (!vendorPrefixes[eventName]) {\n return eventName;\n }\n\n var prefixMap = vendorPrefixes[eventName];\n\n for (var styleProp in prefixMap) {\n if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {\n return prefixedEventNames[eventName] = prefixMap[styleProp];\n }\n }\n\n return eventName;\n}\n\n/**\n * To identify top level events in ReactDOM, we use constants defined by this\n * module. This is the only module that uses the unsafe* methods to express\n * that the constants actually correspond to the browser event names. This lets\n * us save some bundle size by avoiding a top level type -> event name map.\n * The rest of ReactDOM code should import top level types from this file.\n */\n\nvar TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort');\nvar TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend'));\nvar TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration'));\nvar TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart'));\nvar TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur');\nvar TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay');\nvar TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough');\nvar TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel');\nvar TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change');\nvar TOP_CLICK = unsafeCastStringToDOMTopLevelType('click');\nvar TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close');\nvar TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend');\nvar TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart');\nvar TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate');\nvar TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu');\nvar TOP_COPY = unsafeCastStringToDOMTopLevelType('copy');\nvar TOP_CUT = unsafeCastStringToDOMTopLevelType('cut');\nvar TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick');\nvar TOP_AUX_CLICK = unsafeCastStringToDOMTopLevelType('auxclick');\nvar TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag');\nvar TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend');\nvar TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter');\nvar TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit');\nvar TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave');\nvar TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover');\nvar TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart');\nvar TOP_DROP = unsafeCastStringToDOMTopLevelType('drop');\nvar TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange');\nvar TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied');\nvar TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted');\nvar TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended');\nvar TOP_ERROR = unsafeCastStringToDOMTopLevelType('error');\nvar TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus');\nvar TOP_GOT_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('gotpointercapture');\nvar TOP_INPUT = unsafeCastStringToDOMTopLevelType('input');\nvar TOP_INVALID = unsafeCastStringToDOMTopLevelType('invalid');\nvar TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown');\nvar TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress');\nvar TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup');\nvar TOP_LOAD = unsafeCastStringToDOMTopLevelType('load');\nvar TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart');\nvar TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata');\nvar TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata');\nvar TOP_LOST_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('lostpointercapture');\nvar TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown');\nvar TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove');\nvar TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout');\nvar TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover');\nvar TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup');\nvar TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste');\nvar TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause');\nvar TOP_PLAY = unsafeCastStringToDOMTopLevelType('play');\nvar TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing');\nvar TOP_POINTER_CANCEL = unsafeCastStringToDOMTopLevelType('pointercancel');\nvar TOP_POINTER_DOWN = unsafeCastStringToDOMTopLevelType('pointerdown');\nvar TOP_POINTER_MOVE = unsafeCastStringToDOMTopLevelType('pointermove');\nvar TOP_POINTER_OUT = unsafeCastStringToDOMTopLevelType('pointerout');\nvar TOP_POINTER_OVER = unsafeCastStringToDOMTopLevelType('pointerover');\nvar TOP_POINTER_UP = unsafeCastStringToDOMTopLevelType('pointerup');\nvar TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress');\nvar TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange');\nvar TOP_RESET = unsafeCastStringToDOMTopLevelType('reset');\nvar TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll');\nvar TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked');\nvar TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking');\nvar TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange');\nvar TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled');\nvar TOP_SUBMIT = unsafeCastStringToDOMTopLevelType('submit');\nvar TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend');\nvar TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput');\nvar TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate');\nvar TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle');\nvar TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel');\nvar TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend');\nvar TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove');\nvar TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart');\nvar TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend'));\nvar TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange');\nvar TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting');\nvar TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel'); // List of events that need to be individually attached to media elements.\n// Note that events in this list will *not* be listened to at the top level\n// unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`.\n\nvar mediaEventTypes = [TOP_ABORT, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_VOLUME_CHANGE, TOP_WAITING];\nfunction getRawEventName(topLevelType) {\n return unsafeCastDOMTopLevelTypeToString(topLevelType);\n}\n\nvar PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; // prettier-ignore\n\nvar elementListenerMap = new PossiblyWeakMap();\nfunction getListenerMapForElement(element) {\n var listenerMap = elementListenerMap.get(element);\n\n if (listenerMap === undefined) {\n listenerMap = new Map();\n elementListenerMap.set(element, listenerMap);\n }\n\n return listenerMap;\n}\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 */\nfunction get(key) {\n return key._reactInternalFiber;\n}\nfunction has(key) {\n return key._reactInternalFiber !== undefined;\n}\nfunction set(key, value) {\n key._reactInternalFiber = value;\n}\n\n// Don't change these two values. They're used by React Dev Tools.\nvar NoEffect =\n/* */\n0;\nvar PerformedWork =\n/* */\n1; // You can change the rest (and add more).\n\nvar Placement =\n/* */\n2;\nvar Update =\n/* */\n4;\nvar PlacementAndUpdate =\n/* */\n6;\nvar Deletion =\n/* */\n8;\nvar ContentReset =\n/* */\n16;\nvar Callback =\n/* */\n32;\nvar DidCapture =\n/* */\n64;\nvar Ref =\n/* */\n128;\nvar Snapshot =\n/* */\n256;\nvar Passive =\n/* */\n512;\nvar Hydrating =\n/* */\n1024;\nvar HydratingAndUpdate =\n/* */\n1028; // Passive & Update & Callback & Ref & Snapshot\n\nvar LifecycleEffectMask =\n/* */\n932; // Union of all host effects\n\nvar HostEffectMask =\n/* */\n2047;\nvar Incomplete =\n/* */\n2048;\nvar ShouldCapture =\n/* */\n4096;\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nfunction getNearestMountedFiber(fiber) {\n var node = fiber;\n var nearestMounted = fiber;\n\n if (!fiber.alternate) {\n // If there is no alternate, this might be a new tree that isn't inserted\n // yet. If it is, then it will have a pending insertion effect on it.\n var nextNode = node;\n\n do {\n node = nextNode;\n\n if ((node.effectTag & (Placement | Hydrating)) !== NoEffect) {\n // This is an insertion or in-progress hydration. The nearest possible\n // mounted fiber is the parent but we need to continue to figure out\n // if that one is still mounted.\n nearestMounted = node.return;\n }\n\n nextNode = node.return;\n } while (nextNode);\n } else {\n while (node.return) {\n node = node.return;\n }\n }\n\n if (node.tag === HostRoot) {\n // TODO: Check if this was a nested HostRoot when used with\n // renderContainerIntoSubtree.\n return nearestMounted;\n } // If we didn't hit the root, that means that we're in an disconnected tree\n // that has been unmounted.\n\n\n return null;\n}\nfunction getSuspenseInstanceFromFiber(fiber) {\n if (fiber.tag === SuspenseComponent) {\n var suspenseState = fiber.memoizedState;\n\n if (suspenseState === null) {\n var current = fiber.alternate;\n\n if (current !== null) {\n suspenseState = current.memoizedState;\n }\n }\n\n if (suspenseState !== null) {\n return suspenseState.dehydrated;\n }\n }\n\n return null;\n}\nfunction getContainerFromFiber(fiber) {\n return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;\n}\nfunction isFiberMounted(fiber) {\n return getNearestMountedFiber(fiber) === fiber;\n}\nfunction isMounted(component) {\n {\n var owner = ReactCurrentOwner.current;\n\n if (owner !== null && owner.tag === ClassComponent) {\n var ownerFiber = owner;\n var instance = ownerFiber.stateNode;\n\n if (!instance._warnedAboutRefsInRender) {\n error('%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber.type) || 'A component');\n }\n\n instance._warnedAboutRefsInRender = true;\n }\n }\n\n var fiber = get(component);\n\n if (!fiber) {\n return false;\n }\n\n return getNearestMountedFiber(fiber) === fiber;\n}\n\nfunction assertIsMounted(fiber) {\n if (!(getNearestMountedFiber(fiber) === fiber)) {\n {\n throw Error( \"Unable to find node on an unmounted component.\" );\n }\n }\n}\n\nfunction findCurrentFiberUsingSlowPath(fiber) {\n var alternate = fiber.alternate;\n\n if (!alternate) {\n // If there is no alternate, then we only need to check if it is mounted.\n var nearestMounted = getNearestMountedFiber(fiber);\n\n if (!(nearestMounted !== null)) {\n {\n throw Error( \"Unable to find node on an unmounted component.\" );\n }\n }\n\n if (nearestMounted !== fiber) {\n return null;\n }\n\n return fiber;\n } // If we have two possible branches, we'll walk backwards up to the root\n // to see what path the root points to. On the way we may hit one of the\n // special cases and we'll deal with them.\n\n\n var a = fiber;\n var b = alternate;\n\n while (true) {\n var parentA = a.return;\n\n if (parentA === null) {\n // We're at the root.\n break;\n }\n\n var parentB = parentA.alternate;\n\n if (parentB === null) {\n // There is no alternate. This is an unusual case. Currently, it only\n // happens when a Suspense component is hidden. An extra fragment fiber\n // is inserted in between the Suspense fiber and its children. Skip\n // over this extra fragment fiber and proceed to the next parent.\n var nextParent = parentA.return;\n\n if (nextParent !== null) {\n a = b = nextParent;\n continue;\n } // If there's no parent, we're at the root.\n\n\n break;\n } // If both copies of the parent fiber point to the same child, we can\n // assume that the child is current. This happens when we bailout on low\n // priority: the bailed out fiber's child reuses the current child.\n\n\n if (parentA.child === parentB.child) {\n var child = parentA.child;\n\n while (child) {\n if (child === a) {\n // We've determined that A is the current branch.\n assertIsMounted(parentA);\n return fiber;\n }\n\n if (child === b) {\n // We've determined that B is the current branch.\n assertIsMounted(parentA);\n return alternate;\n }\n\n child = child.sibling;\n } // We should never have an alternate for any mounting node. So the only\n // way this could possibly happen is if this was unmounted, if at all.\n\n\n {\n {\n throw Error( \"Unable to find node on an unmounted component.\" );\n }\n }\n }\n\n if (a.return !== b.return) {\n // The return pointer of A and the return pointer of B point to different\n // fibers. We assume that return pointers never criss-cross, so A must\n // belong to the child set of A.return, and B must belong to the child\n // set of B.return.\n a = parentA;\n b = parentB;\n } else {\n // The return pointers point to the same fiber. We'll have to use the\n // default, slow path: scan the child sets of each parent alternate to see\n // which child belongs to which set.\n //\n // Search parent A's child set\n var didFindChild = false;\n var _child = parentA.child;\n\n while (_child) {\n if (_child === a) {\n didFindChild = true;\n a = parentA;\n b = parentB;\n break;\n }\n\n if (_child === b) {\n didFindChild = true;\n b = parentA;\n a = parentB;\n break;\n }\n\n _child = _child.sibling;\n }\n\n if (!didFindChild) {\n // Search parent B's child set\n _child = parentB.child;\n\n while (_child) {\n if (_child === a) {\n didFindChild = true;\n a = parentB;\n b = parentA;\n break;\n }\n\n if (_child === b) {\n didFindChild = true;\n b = parentB;\n a = parentA;\n break;\n }\n\n _child = _child.sibling;\n }\n\n if (!didFindChild) {\n {\n throw Error( \"Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.\" );\n }\n }\n }\n }\n\n if (!(a.alternate === b)) {\n {\n throw Error( \"Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n } // If the root is not a host container, we're in a disconnected tree. I.e.\n // unmounted.\n\n\n if (!(a.tag === HostRoot)) {\n {\n throw Error( \"Unable to find node on an unmounted component.\" );\n }\n }\n\n if (a.stateNode.current === a) {\n // We've determined that A is the current branch.\n return fiber;\n } // Otherwise B has to be current branch.\n\n\n return alternate;\n}\nfunction findCurrentHostFiber(parent) {\n var currentParent = findCurrentFiberUsingSlowPath(parent);\n\n if (!currentParent) {\n return null;\n } // Next we'll drill down this component to find the first HostComponent/Text.\n\n\n var node = currentParent;\n\n while (true) {\n if (node.tag === HostComponent || node.tag === HostText) {\n return node;\n } else if (node.child) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === currentParent) {\n return null;\n }\n\n while (!node.sibling) {\n if (!node.return || node.return === currentParent) {\n return null;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n } // Flow needs the return null here, but ESLint complains about it.\n // eslint-disable-next-line no-unreachable\n\n\n return null;\n}\nfunction findCurrentHostFiberWithNoPortals(parent) {\n var currentParent = findCurrentFiberUsingSlowPath(parent);\n\n if (!currentParent) {\n return null;\n } // Next we'll drill down this component to find the first HostComponent/Text.\n\n\n var node = currentParent;\n\n while (true) {\n if (node.tag === HostComponent || node.tag === HostText || enableFundamentalAPI ) {\n return node;\n } else if (node.child && node.tag !== HostPortal) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === currentParent) {\n return null;\n }\n\n while (!node.sibling) {\n if (!node.return || node.return === currentParent) {\n return null;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n } // Flow needs the return null here, but ESLint complains about it.\n // eslint-disable-next-line no-unreachable\n\n\n return null;\n}\n\n/**\n * Accumulates items that must not be null or undefined into the first one. This\n * is used to conserve memory by avoiding array allocations, and thus sacrifices\n * API cleanness. Since `current` can be null before being passed in and not\n * null after this function, make sure to assign it back to `current`:\n *\n * `a = accumulateInto(a, b);`\n *\n * This API should be sparingly used. Try `accumulate` for something cleaner.\n *\n * @return {*|array<*>} An accumulation of items.\n */\n\nfunction accumulateInto(current, next) {\n if (!(next != null)) {\n {\n throw Error( \"accumulateInto(...): Accumulated items must not be null or undefined.\" );\n }\n }\n\n if (current == null) {\n return next;\n } // Both are not empty. Warning: Never call x.concat(y) when you are not\n // certain that x is an Array (x could be a string with concat method).\n\n\n if (Array.isArray(current)) {\n if (Array.isArray(next)) {\n current.push.apply(current, next);\n return current;\n }\n\n current.push(next);\n return current;\n }\n\n if (Array.isArray(next)) {\n // A bit too dangerous to mutate `next`.\n return [current].concat(next);\n }\n\n return [current, next];\n}\n\n/**\n * @param {array} arr an \"accumulation\" of items which is either an Array or\n * a single item. Useful when paired with the `accumulate` module. This is a\n * simple utility that allows us to reason about a collection of items, but\n * handling the case when there is exactly one item (and we do not need to\n * allocate an array).\n * @param {function} cb Callback invoked with each element or a collection.\n * @param {?} [scope] Scope used as `this` in a callback.\n */\nfunction forEachAccumulated(arr, cb, scope) {\n if (Array.isArray(arr)) {\n arr.forEach(cb, scope);\n } else if (arr) {\n cb.call(scope, arr);\n }\n}\n\n/**\n * Internal queue of events that have accumulated their dispatches and are\n * waiting to have their dispatches executed.\n */\n\nvar eventQueue = null;\n/**\n * Dispatches an event and releases it back into the pool, unless persistent.\n *\n * @param {?object} event Synthetic event to be dispatched.\n * @private\n */\n\nvar executeDispatchesAndRelease = function (event) {\n if (event) {\n executeDispatchesInOrder(event);\n\n if (!event.isPersistent()) {\n event.constructor.release(event);\n }\n }\n};\n\nvar executeDispatchesAndReleaseTopLevel = function (e) {\n return executeDispatchesAndRelease(e);\n};\n\nfunction runEventsInBatch(events) {\n if (events !== null) {\n eventQueue = accumulateInto(eventQueue, events);\n } // Set `eventQueue` to null before processing it so that we can tell if more\n // events get enqueued while processing.\n\n\n var processingEventQueue = eventQueue;\n eventQueue = null;\n\n if (!processingEventQueue) {\n return;\n }\n\n forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);\n\n if (!!eventQueue) {\n {\n throw Error( \"processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.\" );\n }\n } // This would be a good time to rethrow if any of the event handlers threw.\n\n\n rethrowCaughtError();\n}\n\n/**\n * Gets the target node from a native browser event by accounting for\n * inconsistencies in browser DOM APIs.\n *\n * @param {object} nativeEvent Native browser event.\n * @return {DOMEventTarget} Target node.\n */\n\nfunction getEventTarget(nativeEvent) {\n // Fallback to nativeEvent.srcElement for IE9\n // https://github.com/facebook/react/issues/12506\n var target = nativeEvent.target || nativeEvent.srcElement || window; // Normalize SVG <use> element events #4963\n\n if (target.correspondingUseElement) {\n target = target.correspondingUseElement;\n } // Safari may fire events on text nodes (Node.TEXT_NODE is 3).\n // @see http://www.quirksmode.org/js/events_properties.html\n\n\n return target.nodeType === TEXT_NODE ? target.parentNode : target;\n}\n\n/**\n * Checks if an event is supported in the current execution environment.\n *\n * NOTE: This will not work correctly for non-generic events such as `change`,\n * `reset`, `load`, `error`, and `select`.\n *\n * Borrows from Modernizr.\n *\n * @param {string} eventNameSuffix Event name, e.g. \"click\".\n * @return {boolean} True if the event is supported.\n * @internal\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\n\nfunction isEventSupported(eventNameSuffix) {\n if (!canUseDOM) {\n return false;\n }\n\n var eventName = 'on' + eventNameSuffix;\n var isSupported = eventName in document;\n\n if (!isSupported) {\n var element = document.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof element[eventName] === 'function';\n }\n\n return isSupported;\n}\n\n/**\n * Summary of `DOMEventPluginSystem` event handling:\n *\n * - Top-level delegation is used to trap most native browser events. This\n * may only occur in the main thread and is the responsibility of\n * ReactDOMEventListener, which is injected and can therefore support\n * pluggable event sources. This is the only work that occurs in the main\n * thread.\n *\n * - We normalize and de-duplicate events to account for browser quirks. This\n * may be done in the worker thread.\n *\n * - Forward these native events (with the associated top-level type used to\n * trap it) to `EventPluginRegistry`, which in turn will ask plugins if they want\n * to extract any synthetic events.\n *\n * - The `EventPluginRegistry` will then process each event by annotating them with\n * \"dispatches\", a sequence of listeners and IDs that care about that event.\n *\n * - The `EventPluginRegistry` then dispatches the events.\n *\n * Overview of React and the event system:\n *\n * +------------+ .\n * | DOM | .\n * +------------+ .\n * | .\n * v .\n * +------------+ .\n * | ReactEvent | .\n * | Listener | .\n * +------------+ . +-----------+\n * | . +--------+|SimpleEvent|\n * | . | |Plugin |\n * +-----|------+ . v +-----------+\n * | | | . +--------------+ +------------+\n * | +-----------.--->|PluginRegistry| | Event |\n * | | . | | +-----------+ | Propagators|\n * | ReactEvent | . | | |TapEvent | |------------|\n * | Emitter | . | |<---+|Plugin | |other plugin|\n * | | . | | +-----------+ | utilities |\n * | +-----------.--->| | +------------+\n * | | | . +--------------+\n * +-----|------+ . ^ +-----------+\n * | . | |Enter/Leave|\n * + . +-------+|Plugin |\n * +-------------+ . +-----------+\n * | application | .\n * |-------------| .\n * | | .\n * | | .\n * +-------------+ .\n * .\n * React Core . General Purpose Event Plugin System\n */\n\nvar CALLBACK_BOOKKEEPING_POOL_SIZE = 10;\nvar callbackBookkeepingPool = [];\n\nfunction releaseTopLevelCallbackBookKeeping(instance) {\n instance.topLevelType = null;\n instance.nativeEvent = null;\n instance.targetInst = null;\n instance.ancestors.length = 0;\n\n if (callbackBookkeepingPool.length < CALLBACK_BOOKKEEPING_POOL_SIZE) {\n callbackBookkeepingPool.push(instance);\n }\n} // Used to store ancestor hierarchy in top level callback\n\n\nfunction getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags) {\n if (callbackBookkeepingPool.length) {\n var instance = callbackBookkeepingPool.pop();\n instance.topLevelType = topLevelType;\n instance.eventSystemFlags = eventSystemFlags;\n instance.nativeEvent = nativeEvent;\n instance.targetInst = targetInst;\n return instance;\n }\n\n return {\n topLevelType: topLevelType,\n eventSystemFlags: eventSystemFlags,\n nativeEvent: nativeEvent,\n targetInst: targetInst,\n ancestors: []\n };\n}\n/**\n * Find the deepest React component completely containing the root of the\n * passed-in instance (for use when entire React trees are nested within each\n * other). If React trees are not nested, returns null.\n */\n\n\nfunction findRootContainerNode(inst) {\n if (inst.tag === HostRoot) {\n return inst.stateNode.containerInfo;\n } // TODO: It may be a good idea to cache this to prevent unnecessary DOM\n // traversal, but caching is difficult to do correctly without using a\n // mutation observer to listen for all DOM changes.\n\n\n while (inst.return) {\n inst = inst.return;\n }\n\n if (inst.tag !== HostRoot) {\n // This can happen if we're in a detached tree.\n return null;\n }\n\n return inst.stateNode.containerInfo;\n}\n/**\n * Allows registered plugins an opportunity to extract events from top-level\n * native browser events.\n *\n * @return {*} An accumulation of synthetic events.\n * @internal\n */\n\n\nfunction extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n var events = null;\n\n for (var i = 0; i < plugins.length; i++) {\n // Not every plugin in the ordering may be loaded at runtime.\n var possiblePlugin = plugins[i];\n\n if (possiblePlugin) {\n var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);\n\n if (extractedEvents) {\n events = accumulateInto(events, extractedEvents);\n }\n }\n }\n\n return events;\n}\n\nfunction runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);\n runEventsInBatch(events);\n}\n\nfunction handleTopLevel(bookKeeping) {\n var targetInst = bookKeeping.targetInst; // Loop through the hierarchy, in case there's any nested components.\n // It's important that we build the array of ancestors before calling any\n // event handlers, because event handlers can modify the DOM, leading to\n // inconsistencies with ReactMount's node cache. See #1105.\n\n var ancestor = targetInst;\n\n do {\n if (!ancestor) {\n var ancestors = bookKeeping.ancestors;\n ancestors.push(ancestor);\n break;\n }\n\n var root = findRootContainerNode(ancestor);\n\n if (!root) {\n break;\n }\n\n var tag = ancestor.tag;\n\n if (tag === HostComponent || tag === HostText) {\n bookKeeping.ancestors.push(ancestor);\n }\n\n ancestor = getClosestInstanceFromNode(root);\n } while (ancestor);\n\n for (var i = 0; i < bookKeeping.ancestors.length; i++) {\n targetInst = bookKeeping.ancestors[i];\n var eventTarget = getEventTarget(bookKeeping.nativeEvent);\n var topLevelType = bookKeeping.topLevelType;\n var nativeEvent = bookKeeping.nativeEvent;\n var eventSystemFlags = bookKeeping.eventSystemFlags; // If this is the first ancestor, we mark it on the system flags\n\n if (i === 0) {\n eventSystemFlags |= IS_FIRST_ANCESTOR;\n }\n\n runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, eventTarget, eventSystemFlags);\n }\n}\n\nfunction dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst) {\n var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags);\n\n try {\n // Event queue being processed in the same cycle allows\n // `preventDefault`.\n batchedEventUpdates(handleTopLevel, bookKeeping);\n } finally {\n releaseTopLevelCallbackBookKeeping(bookKeeping);\n }\n}\n/**\n * We listen for bubbled touch events on the document object.\n *\n * Firefox v8.01 (and possibly others) exhibited strange behavior when\n * mounting `onmousemove` events at some node that was not the document\n * element. The symptoms were that if your mouse is not moving over something\n * contained within that mount point (for example on the background) the\n * top-level listeners for `onmousemove` won't be called. However, if you\n * register the `mousemove` on the document object, then it will of course\n * catch all `mousemove`s. This along with iOS quirks, justifies restricting\n * top-level listeners to the document object only, at least for these\n * movement types of events and possibly all events.\n *\n * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html\n *\n * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but\n * they bubble to document.\n *\n * @param {string} registrationName Name of listener (e.g. `onClick`).\n * @param {object} mountAt Container where to mount the listener\n */\n\nfunction legacyListenToEvent(registrationName, mountAt) {\n var listenerMap = getListenerMapForElement(mountAt);\n var dependencies = registrationNameDependencies[registrationName];\n\n for (var i = 0; i < dependencies.length; i++) {\n var dependency = dependencies[i];\n legacyListenToTopLevelEvent(dependency, mountAt, listenerMap);\n }\n}\nfunction legacyListenToTopLevelEvent(topLevelType, mountAt, listenerMap) {\n if (!listenerMap.has(topLevelType)) {\n switch (topLevelType) {\n case TOP_SCROLL:\n trapCapturedEvent(TOP_SCROLL, mountAt);\n break;\n\n case TOP_FOCUS:\n case TOP_BLUR:\n trapCapturedEvent(TOP_FOCUS, mountAt);\n trapCapturedEvent(TOP_BLUR, mountAt); // We set the flag for a single dependency later in this function,\n // but this ensures we mark both as attached rather than just one.\n\n listenerMap.set(TOP_BLUR, null);\n listenerMap.set(TOP_FOCUS, null);\n break;\n\n case TOP_CANCEL:\n case TOP_CLOSE:\n if (isEventSupported(getRawEventName(topLevelType))) {\n trapCapturedEvent(topLevelType, mountAt);\n }\n\n break;\n\n case TOP_INVALID:\n case TOP_SUBMIT:\n case TOP_RESET:\n // We listen to them on the target DOM elements.\n // Some of them bubble so we don't want them to fire twice.\n break;\n\n default:\n // By default, listen on the top level to all non-media events.\n // Media events don't bubble so adding the listener wouldn't do anything.\n var isMediaEvent = mediaEventTypes.indexOf(topLevelType) !== -1;\n\n if (!isMediaEvent) {\n trapBubbledEvent(topLevelType, mountAt);\n }\n\n break;\n }\n\n listenerMap.set(topLevelType, null);\n }\n}\nfunction isListeningToAllDependencies(registrationName, mountAt) {\n var listenerMap = getListenerMapForElement(mountAt);\n var dependencies = registrationNameDependencies[registrationName];\n\n for (var i = 0; i < dependencies.length; i++) {\n var dependency = dependencies[i];\n\n if (!listenerMap.has(dependency)) {\n return false;\n }\n }\n\n return true;\n}\n\nvar attemptUserBlockingHydration;\nfunction setAttemptUserBlockingHydration(fn) {\n attemptUserBlockingHydration = fn;\n}\nvar attemptContinuousHydration;\nfunction setAttemptContinuousHydration(fn) {\n attemptContinuousHydration = fn;\n}\nvar attemptHydrationAtCurrentPriority;\nfunction setAttemptHydrationAtCurrentPriority(fn) {\n attemptHydrationAtCurrentPriority = fn;\n} // TODO: Upgrade this definition once we're on a newer version of Flow that\nvar hasScheduledReplayAttempt = false; // The queue of discrete events to be replayed.\n\nvar queuedDiscreteEvents = []; // Indicates if any continuous event targets are non-null for early bailout.\n// if the last target was dehydrated.\n\nvar queuedFocus = null;\nvar queuedDrag = null;\nvar queuedMouse = null; // For pointer events there can be one latest event per pointerId.\n\nvar queuedPointers = new Map();\nvar queuedPointerCaptures = new Map(); // We could consider replaying selectionchange and touchmoves too.\n\nvar queuedExplicitHydrationTargets = [];\nfunction hasQueuedDiscreteEvents() {\n return queuedDiscreteEvents.length > 0;\n}\nvar discreteReplayableEvents = [TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_TOUCH_CANCEL, TOP_TOUCH_END, TOP_TOUCH_START, TOP_AUX_CLICK, TOP_DOUBLE_CLICK, TOP_POINTER_CANCEL, TOP_POINTER_DOWN, TOP_POINTER_UP, TOP_DRAG_END, TOP_DRAG_START, TOP_DROP, TOP_COMPOSITION_END, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_INPUT, TOP_TEXT_INPUT, TOP_CLOSE, TOP_CANCEL, TOP_COPY, TOP_CUT, TOP_PASTE, TOP_CLICK, TOP_CHANGE, TOP_CONTEXT_MENU, TOP_RESET, TOP_SUBMIT];\nvar continuousReplayableEvents = [TOP_FOCUS, TOP_BLUR, TOP_DRAG_ENTER, TOP_DRAG_LEAVE, TOP_MOUSE_OVER, TOP_MOUSE_OUT, TOP_POINTER_OVER, TOP_POINTER_OUT, TOP_GOT_POINTER_CAPTURE, TOP_LOST_POINTER_CAPTURE];\nfunction isReplayableDiscreteEvent(eventType) {\n return discreteReplayableEvents.indexOf(eventType) > -1;\n}\n\nfunction trapReplayableEventForDocument(topLevelType, document, listenerMap) {\n legacyListenToTopLevelEvent(topLevelType, document, listenerMap);\n}\n\nfunction eagerlyTrapReplayableEvents(container, document) {\n var listenerMapForDoc = getListenerMapForElement(document); // Discrete\n\n discreteReplayableEvents.forEach(function (topLevelType) {\n trapReplayableEventForDocument(topLevelType, document, listenerMapForDoc);\n }); // Continuous\n\n continuousReplayableEvents.forEach(function (topLevelType) {\n trapReplayableEventForDocument(topLevelType, document, listenerMapForDoc);\n });\n}\n\nfunction createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {\n return {\n blockedOn: blockedOn,\n topLevelType: topLevelType,\n eventSystemFlags: eventSystemFlags | IS_REPLAYED,\n nativeEvent: nativeEvent,\n container: container\n };\n}\n\nfunction queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {\n var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent);\n queuedDiscreteEvents.push(queuedEvent);\n} // Resets the replaying for this type of continuous event to no event.\n\nfunction clearIfContinuousEvent(topLevelType, nativeEvent) {\n switch (topLevelType) {\n case TOP_FOCUS:\n case TOP_BLUR:\n queuedFocus = null;\n break;\n\n case TOP_DRAG_ENTER:\n case TOP_DRAG_LEAVE:\n queuedDrag = null;\n break;\n\n case TOP_MOUSE_OVER:\n case TOP_MOUSE_OUT:\n queuedMouse = null;\n break;\n\n case TOP_POINTER_OVER:\n case TOP_POINTER_OUT:\n {\n var pointerId = nativeEvent.pointerId;\n queuedPointers.delete(pointerId);\n break;\n }\n\n case TOP_GOT_POINTER_CAPTURE:\n case TOP_LOST_POINTER_CAPTURE:\n {\n var _pointerId = nativeEvent.pointerId;\n queuedPointerCaptures.delete(_pointerId);\n break;\n }\n }\n}\n\nfunction accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {\n if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {\n var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent);\n\n if (blockedOn !== null) {\n var _fiber2 = getInstanceFromNode$1(blockedOn);\n\n if (_fiber2 !== null) {\n // Attempt to increase the priority of this target.\n attemptContinuousHydration(_fiber2);\n }\n }\n\n return queuedEvent;\n } // If we have already queued this exact event, then it's because\n // the different event systems have different DOM event listeners.\n // We can accumulate the flags and store a single event to be\n // replayed.\n\n\n existingQueuedEvent.eventSystemFlags |= eventSystemFlags;\n return existingQueuedEvent;\n}\n\nfunction queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {\n // These set relatedTarget to null because the replayed event will be treated as if we\n // moved from outside the window (no target) onto the target once it hydrates.\n // Instead of mutating we could clone the event.\n switch (topLevelType) {\n case TOP_FOCUS:\n {\n var focusEvent = nativeEvent;\n queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, topLevelType, eventSystemFlags, container, focusEvent);\n return true;\n }\n\n case TOP_DRAG_ENTER:\n {\n var dragEvent = nativeEvent;\n queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, topLevelType, eventSystemFlags, container, dragEvent);\n return true;\n }\n\n case TOP_MOUSE_OVER:\n {\n var mouseEvent = nativeEvent;\n queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, topLevelType, eventSystemFlags, container, mouseEvent);\n return true;\n }\n\n case TOP_POINTER_OVER:\n {\n var pointerEvent = nativeEvent;\n var pointerId = pointerEvent.pointerId;\n queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, topLevelType, eventSystemFlags, container, pointerEvent));\n return true;\n }\n\n case TOP_GOT_POINTER_CAPTURE:\n {\n var _pointerEvent = nativeEvent;\n var _pointerId2 = _pointerEvent.pointerId;\n queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, topLevelType, eventSystemFlags, container, _pointerEvent));\n return true;\n }\n }\n\n return false;\n} // Check if this target is unblocked. Returns true if it's unblocked.\n\nfunction attemptExplicitHydrationTarget(queuedTarget) {\n // TODO: This function shares a lot of logic with attemptToDispatchEvent.\n // Try to unify them. It's a bit tricky since it would require two return\n // values.\n var targetInst = getClosestInstanceFromNode(queuedTarget.target);\n\n if (targetInst !== null) {\n var nearestMounted = getNearestMountedFiber(targetInst);\n\n if (nearestMounted !== null) {\n var tag = nearestMounted.tag;\n\n if (tag === SuspenseComponent) {\n var instance = getSuspenseInstanceFromFiber(nearestMounted);\n\n if (instance !== null) {\n // We're blocked on hydrating this boundary.\n // Increase its priority.\n queuedTarget.blockedOn = instance;\n Scheduler.unstable_runWithPriority(queuedTarget.priority, function () {\n attemptHydrationAtCurrentPriority(nearestMounted);\n });\n return;\n }\n } else if (tag === HostRoot) {\n var root = nearestMounted.stateNode;\n\n if (root.hydrate) {\n queuedTarget.blockedOn = getContainerFromFiber(nearestMounted); // We don't currently have a way to increase the priority of\n // a root other than sync.\n\n return;\n }\n }\n }\n }\n\n queuedTarget.blockedOn = null;\n}\n\nfunction attemptReplayContinuousQueuedEvent(queuedEvent) {\n if (queuedEvent.blockedOn !== null) {\n return false;\n }\n\n var nextBlockedOn = attemptToDispatchEvent(queuedEvent.topLevelType, queuedEvent.eventSystemFlags, queuedEvent.container, queuedEvent.nativeEvent);\n\n if (nextBlockedOn !== null) {\n // We're still blocked. Try again later.\n var _fiber3 = getInstanceFromNode$1(nextBlockedOn);\n\n if (_fiber3 !== null) {\n attemptContinuousHydration(_fiber3);\n }\n\n queuedEvent.blockedOn = nextBlockedOn;\n return false;\n }\n\n return true;\n}\n\nfunction attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {\n if (attemptReplayContinuousQueuedEvent(queuedEvent)) {\n map.delete(key);\n }\n}\n\nfunction replayUnblockedEvents() {\n hasScheduledReplayAttempt = false; // First replay discrete events.\n\n while (queuedDiscreteEvents.length > 0) {\n var nextDiscreteEvent = queuedDiscreteEvents[0];\n\n if (nextDiscreteEvent.blockedOn !== null) {\n // We're still blocked.\n // Increase the priority of this boundary to unblock\n // the next discrete event.\n var _fiber4 = getInstanceFromNode$1(nextDiscreteEvent.blockedOn);\n\n if (_fiber4 !== null) {\n attemptUserBlockingHydration(_fiber4);\n }\n\n break;\n }\n\n var nextBlockedOn = attemptToDispatchEvent(nextDiscreteEvent.topLevelType, nextDiscreteEvent.eventSystemFlags, nextDiscreteEvent.container, nextDiscreteEvent.nativeEvent);\n\n if (nextBlockedOn !== null) {\n // We're still blocked. Try again later.\n nextDiscreteEvent.blockedOn = nextBlockedOn;\n } else {\n // We've successfully replayed the first event. Let's try the next one.\n queuedDiscreteEvents.shift();\n }\n } // Next replay any continuous events.\n\n\n if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {\n queuedFocus = null;\n }\n\n if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {\n queuedDrag = null;\n }\n\n if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {\n queuedMouse = null;\n }\n\n queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);\n queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);\n}\n\nfunction scheduleCallbackIfUnblocked(queuedEvent, unblocked) {\n if (queuedEvent.blockedOn === unblocked) {\n queuedEvent.blockedOn = null;\n\n if (!hasScheduledReplayAttempt) {\n hasScheduledReplayAttempt = true; // Schedule a callback to attempt replaying as many events as are\n // now unblocked. This first might not actually be unblocked yet.\n // We could check it early to avoid scheduling an unnecessary callback.\n\n Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);\n }\n }\n}\n\nfunction retryIfBlockedOn(unblocked) {\n // Mark anything that was blocked on this as no longer blocked\n // and eligible for a replay.\n if (queuedDiscreteEvents.length > 0) {\n scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); // This is a exponential search for each boundary that commits. I think it's\n // worth it because we expect very few discrete events to queue up and once\n // we are actually fully unblocked it will be fast to replay them.\n\n for (var i = 1; i < queuedDiscreteEvents.length; i++) {\n var queuedEvent = queuedDiscreteEvents[i];\n\n if (queuedEvent.blockedOn === unblocked) {\n queuedEvent.blockedOn = null;\n }\n }\n }\n\n if (queuedFocus !== null) {\n scheduleCallbackIfUnblocked(queuedFocus, unblocked);\n }\n\n if (queuedDrag !== null) {\n scheduleCallbackIfUnblocked(queuedDrag, unblocked);\n }\n\n if (queuedMouse !== null) {\n scheduleCallbackIfUnblocked(queuedMouse, unblocked);\n }\n\n var unblock = function (queuedEvent) {\n return scheduleCallbackIfUnblocked(queuedEvent, unblocked);\n };\n\n queuedPointers.forEach(unblock);\n queuedPointerCaptures.forEach(unblock);\n\n for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {\n var queuedTarget = queuedExplicitHydrationTargets[_i];\n\n if (queuedTarget.blockedOn === unblocked) {\n queuedTarget.blockedOn = null;\n }\n }\n\n while (queuedExplicitHydrationTargets.length > 0) {\n var nextExplicitTarget = queuedExplicitHydrationTargets[0];\n\n if (nextExplicitTarget.blockedOn !== null) {\n // We're still blocked.\n break;\n } else {\n attemptExplicitHydrationTarget(nextExplicitTarget);\n\n if (nextExplicitTarget.blockedOn === null) {\n // We're unblocked.\n queuedExplicitHydrationTargets.shift();\n }\n }\n }\n}\n\nfunction addEventBubbleListener(element, eventType, listener) {\n element.addEventListener(eventType, listener, false);\n}\nfunction addEventCaptureListener(element, eventType, listener) {\n element.addEventListener(eventType, listener, true);\n}\n\n// do it in two places, which duplicates logic\n// and increases the bundle size, we do it all\n// here once. If we remove or refactor the\n// SimpleEventPlugin, we should also remove or\n// update the below line.\n\nvar simpleEventPluginEventTypes = {};\nvar topLevelEventsToDispatchConfig = new Map();\nvar eventPriorities = new Map(); // We store most of the events in this module in pairs of two strings so we can re-use\n// the code required to apply the same logic for event prioritization and that of the\n// SimpleEventPlugin. This complicates things slightly, but the aim is to reduce code\n// duplication (for which there would be quite a bit). For the events that are not needed\n// for the SimpleEventPlugin (otherDiscreteEvents) we process them separately as an\n// array of top level events.\n// Lastly, we ignore prettier so we can keep the formatting sane.\n// prettier-ignore\n\nvar discreteEventPairsForSimpleEventPlugin = [TOP_BLUR, 'blur', TOP_CANCEL, 'cancel', TOP_CLICK, 'click', TOP_CLOSE, 'close', TOP_CONTEXT_MENU, 'contextMenu', TOP_COPY, 'copy', TOP_CUT, 'cut', TOP_AUX_CLICK, 'auxClick', TOP_DOUBLE_CLICK, 'doubleClick', TOP_DRAG_END, 'dragEnd', TOP_DRAG_START, 'dragStart', TOP_DROP, 'drop', TOP_FOCUS, 'focus', TOP_INPUT, 'input', TOP_INVALID, 'invalid', TOP_KEY_DOWN, 'keyDown', TOP_KEY_PRESS, 'keyPress', TOP_KEY_UP, 'keyUp', TOP_MOUSE_DOWN, 'mouseDown', TOP_MOUSE_UP, 'mouseUp', TOP_PASTE, 'paste', TOP_PAUSE, 'pause', TOP_PLAY, 'play', TOP_POINTER_CANCEL, 'pointerCancel', TOP_POINTER_DOWN, 'pointerDown', TOP_POINTER_UP, 'pointerUp', TOP_RATE_CHANGE, 'rateChange', TOP_RESET, 'reset', TOP_SEEKED, 'seeked', TOP_SUBMIT, 'submit', TOP_TOUCH_CANCEL, 'touchCancel', TOP_TOUCH_END, 'touchEnd', TOP_TOUCH_START, 'touchStart', TOP_VOLUME_CHANGE, 'volumeChange'];\nvar otherDiscreteEvents = [TOP_CHANGE, TOP_SELECTION_CHANGE, TOP_TEXT_INPUT, TOP_COMPOSITION_START, TOP_COMPOSITION_END, TOP_COMPOSITION_UPDATE]; // prettier-ignore\n\nvar userBlockingPairsForSimpleEventPlugin = [TOP_DRAG, 'drag', TOP_DRAG_ENTER, 'dragEnter', TOP_DRAG_EXIT, 'dragExit', TOP_DRAG_LEAVE, 'dragLeave', TOP_DRAG_OVER, 'dragOver', TOP_MOUSE_MOVE, 'mouseMove', TOP_MOUSE_OUT, 'mouseOut', TOP_MOUSE_OVER, 'mouseOver', TOP_POINTER_MOVE, 'pointerMove', TOP_POINTER_OUT, 'pointerOut', TOP_POINTER_OVER, 'pointerOver', TOP_SCROLL, 'scroll', TOP_TOGGLE, 'toggle', TOP_TOUCH_MOVE, 'touchMove', TOP_WHEEL, 'wheel']; // prettier-ignore\n\nvar continuousPairsForSimpleEventPlugin = [TOP_ABORT, 'abort', TOP_ANIMATION_END, 'animationEnd', TOP_ANIMATION_ITERATION, 'animationIteration', TOP_ANIMATION_START, 'animationStart', TOP_CAN_PLAY, 'canPlay', TOP_CAN_PLAY_THROUGH, 'canPlayThrough', TOP_DURATION_CHANGE, 'durationChange', TOP_EMPTIED, 'emptied', TOP_ENCRYPTED, 'encrypted', TOP_ENDED, 'ended', TOP_ERROR, 'error', TOP_GOT_POINTER_CAPTURE, 'gotPointerCapture', TOP_LOAD, 'load', TOP_LOADED_DATA, 'loadedData', TOP_LOADED_METADATA, 'loadedMetadata', TOP_LOAD_START, 'loadStart', TOP_LOST_POINTER_CAPTURE, 'lostPointerCapture', TOP_PLAYING, 'playing', TOP_PROGRESS, 'progress', TOP_SEEKING, 'seeking', TOP_STALLED, 'stalled', TOP_SUSPEND, 'suspend', TOP_TIME_UPDATE, 'timeUpdate', TOP_TRANSITION_END, 'transitionEnd', TOP_WAITING, 'waiting'];\n/**\n * Turns\n * ['abort', ...]\n * into\n * eventTypes = {\n * 'abort': {\n * phasedRegistrationNames: {\n * bubbled: 'onAbort',\n * captured: 'onAbortCapture',\n * },\n * dependencies: [TOP_ABORT],\n * },\n * ...\n * };\n * topLevelEventsToDispatchConfig = new Map([\n * [TOP_ABORT, { sameConfig }],\n * ]);\n */\n\nfunction processSimpleEventPluginPairsByPriority(eventTypes, priority) {\n // As the event types are in pairs of two, we need to iterate\n // through in twos. The events are in pairs of two to save code\n // and improve init perf of processing this array, as it will\n // result in far fewer object allocations and property accesses\n // if we only use three arrays to process all the categories of\n // instead of tuples.\n for (var i = 0; i < eventTypes.length; i += 2) {\n var topEvent = eventTypes[i];\n var event = eventTypes[i + 1];\n var capitalizedEvent = event[0].toUpperCase() + event.slice(1);\n var onEvent = 'on' + capitalizedEvent;\n var config = {\n phasedRegistrationNames: {\n bubbled: onEvent,\n captured: onEvent + 'Capture'\n },\n dependencies: [topEvent],\n eventPriority: priority\n };\n eventPriorities.set(topEvent, priority);\n topLevelEventsToDispatchConfig.set(topEvent, config);\n simpleEventPluginEventTypes[event] = config;\n }\n}\n\nfunction processTopEventPairsByPriority(eventTypes, priority) {\n for (var i = 0; i < eventTypes.length; i++) {\n eventPriorities.set(eventTypes[i], priority);\n }\n} // SimpleEventPlugin\n\n\nprocessSimpleEventPluginPairsByPriority(discreteEventPairsForSimpleEventPlugin, DiscreteEvent);\nprocessSimpleEventPluginPairsByPriority(userBlockingPairsForSimpleEventPlugin, UserBlockingEvent);\nprocessSimpleEventPluginPairsByPriority(continuousPairsForSimpleEventPlugin, ContinuousEvent); // Not used by SimpleEventPlugin\n\nprocessTopEventPairsByPriority(otherDiscreteEvents, DiscreteEvent);\nfunction getEventPriorityForPluginSystem(topLevelType) {\n var priority = eventPriorities.get(topLevelType); // Default to a ContinuousEvent. Note: we might\n // want to warn if we can't detect the priority\n // for the event.\n\n return priority === undefined ? ContinuousEvent : priority;\n}\n\n// Intentionally not named imports because Rollup would use dynamic dispatch for\nvar UserBlockingPriority = Scheduler.unstable_UserBlockingPriority,\n runWithPriority = Scheduler.unstable_runWithPriority; // TODO: can we stop exporting these?\n\nvar _enabled = true;\nfunction setEnabled(enabled) {\n _enabled = !!enabled;\n}\nfunction isEnabled() {\n return _enabled;\n}\nfunction trapBubbledEvent(topLevelType, element) {\n trapEventForPluginEventSystem(element, topLevelType, false);\n}\nfunction trapCapturedEvent(topLevelType, element) {\n trapEventForPluginEventSystem(element, topLevelType, true);\n}\n\nfunction trapEventForPluginEventSystem(container, topLevelType, capture) {\n var listener;\n\n switch (getEventPriorityForPluginSystem(topLevelType)) {\n case DiscreteEvent:\n listener = dispatchDiscreteEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container);\n break;\n\n case UserBlockingEvent:\n listener = dispatchUserBlockingUpdate.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container);\n break;\n\n case ContinuousEvent:\n default:\n listener = dispatchEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container);\n break;\n }\n\n var rawEventName = getRawEventName(topLevelType);\n\n if (capture) {\n addEventCaptureListener(container, rawEventName, listener);\n } else {\n addEventBubbleListener(container, rawEventName, listener);\n }\n}\n\nfunction dispatchDiscreteEvent(topLevelType, eventSystemFlags, container, nativeEvent) {\n flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp);\n discreteUpdates(dispatchEvent, topLevelType, eventSystemFlags, container, nativeEvent);\n}\n\nfunction dispatchUserBlockingUpdate(topLevelType, eventSystemFlags, container, nativeEvent) {\n runWithPriority(UserBlockingPriority, dispatchEvent.bind(null, topLevelType, eventSystemFlags, container, nativeEvent));\n}\n\nfunction dispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent) {\n if (!_enabled) {\n return;\n }\n\n if (hasQueuedDiscreteEvents() && isReplayableDiscreteEvent(topLevelType)) {\n // If we already have a queue of discrete events, and this is another discrete\n // event, then we can't dispatch it regardless of its target, since they\n // need to dispatch in order.\n queueDiscreteEvent(null, // Flags that we're not actually blocked on anything as far as we know.\n topLevelType, eventSystemFlags, container, nativeEvent);\n return;\n }\n\n var blockedOn = attemptToDispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent);\n\n if (blockedOn === null) {\n // We successfully dispatched this event.\n clearIfContinuousEvent(topLevelType, nativeEvent);\n return;\n }\n\n if (isReplayableDiscreteEvent(topLevelType)) {\n // This this to be replayed later once the target is available.\n queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent);\n return;\n }\n\n if (queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent)) {\n return;\n } // We need to clear only if we didn't queue because\n // queueing is accummulative.\n\n\n clearIfContinuousEvent(topLevelType, nativeEvent); // This is not replayable so we'll invoke it but without a target,\n // in case the event system needs to trace it.\n\n {\n dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, null);\n }\n} // Attempt dispatching an event. Returns a SuspenseInstance or Container if it's blocked.\n\nfunction attemptToDispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent) {\n // TODO: Warn if _enabled is false.\n var nativeEventTarget = getEventTarget(nativeEvent);\n var targetInst = getClosestInstanceFromNode(nativeEventTarget);\n\n if (targetInst !== null) {\n var nearestMounted = getNearestMountedFiber(targetInst);\n\n if (nearestMounted === null) {\n // This tree has been unmounted already. Dispatch without a target.\n targetInst = null;\n } else {\n var tag = nearestMounted.tag;\n\n if (tag === SuspenseComponent) {\n var instance = getSuspenseInstanceFromFiber(nearestMounted);\n\n if (instance !== null) {\n // Queue the event to be replayed later. Abort dispatching since we\n // don't want this event dispatched twice through the event system.\n // TODO: If this is the first discrete event in the queue. Schedule an increased\n // priority for this boundary.\n return instance;\n } // This shouldn't happen, something went wrong but to avoid blocking\n // the whole system, dispatch the event without a target.\n // TODO: Warn.\n\n\n targetInst = null;\n } else if (tag === HostRoot) {\n var root = nearestMounted.stateNode;\n\n if (root.hydrate) {\n // If this happens during a replay something went wrong and it might block\n // the whole system.\n return getContainerFromFiber(nearestMounted);\n }\n\n targetInst = null;\n } else if (nearestMounted !== targetInst) {\n // If we get an event (ex: img onload) before committing that\n // component's mount, ignore it for now (that is, treat it as if it was an\n // event on a non-React tree). We might also consider queueing events and\n // dispatching them after the mount.\n targetInst = null;\n }\n }\n }\n\n {\n dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst);\n } // We're not blocked on anything.\n\n\n return null;\n}\n\n// List derived from Gecko source code:\n// https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js\nvar shorthandToLonghand = {\n animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'],\n background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'],\n backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],\n border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'],\n borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'],\n borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'],\n borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'],\n borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'],\n borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'],\n borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'],\n borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'],\n borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'],\n borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'],\n borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'],\n borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'],\n borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'],\n borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'],\n columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'],\n columns: ['columnCount', 'columnWidth'],\n flex: ['flexBasis', 'flexGrow', 'flexShrink'],\n flexFlow: ['flexDirection', 'flexWrap'],\n font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'],\n fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'],\n gap: ['columnGap', 'rowGap'],\n grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],\n gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'],\n gridColumn: ['gridColumnEnd', 'gridColumnStart'],\n gridColumnGap: ['columnGap'],\n gridGap: ['columnGap', 'rowGap'],\n gridRow: ['gridRowEnd', 'gridRowStart'],\n gridRowGap: ['rowGap'],\n gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],\n listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'],\n margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'],\n marker: ['markerEnd', 'markerMid', 'markerStart'],\n mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'],\n maskPosition: ['maskPositionX', 'maskPositionY'],\n outline: ['outlineColor', 'outlineStyle', 'outlineWidth'],\n overflow: ['overflowX', 'overflowY'],\n padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],\n placeContent: ['alignContent', 'justifyContent'],\n placeItems: ['alignItems', 'justifyItems'],\n placeSelf: ['alignSelf', 'justifySelf'],\n textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'],\n textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'],\n transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'],\n wordWrap: ['overflowWrap']\n};\n\n/**\n * CSS properties which accept numbers but are not in units of \"px\".\n */\nvar isUnitlessNumber = {\n animationIterationCount: 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\nfunction 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\nvar 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\nObject.keys(isUnitlessNumber).forEach(function (prop) {\n prefixes.forEach(function (prefix) {\n isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];\n });\n});\n\n/**\n * Convert a value into the proper css writable value. The style name `name`\n * should be logical (no hyphens), as specified\n * in `CSSProperty.isUnitlessNumber`.\n *\n * @param {string} name CSS property name such as `topMargin`.\n * @param {*} value CSS property value such as `10px`.\n * @return {string} Normalized style value with dimensions applied.\n */\n\nfunction dangerousStyleValue(name, value, isCustomProperty) {\n // Note that we've removed escapeTextForBrowser() calls here since the\n // whole string will be escaped when the attribute is injected into\n // the markup. If you provide unsafe user data here they can inject\n // arbitrary CSS which may be problematic (I couldn't repro this):\n // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet\n // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/\n // This is not an XSS hole but instead a potential CSS injection issue\n // which has lead to a greater discussion about how we're going to\n // trust URLs moving forward. See #2115901\n var isEmpty = value == null || typeof value === 'boolean' || value === '';\n\n if (isEmpty) {\n return '';\n }\n\n if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {\n return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers\n }\n\n return ('' + value).trim();\n}\n\nvar uppercasePattern = /([A-Z])/g;\nvar msPattern = /^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\nfunction hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}\n\nvar warnValidStyle = function () {};\n\n{\n // 'msTransform' is correct, but the other prefixes should be capitalized\n var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;\n var msPattern$1 = /^-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 (string) {\n return string.replace(hyphenPattern, function (_, character) {\n return character.toUpperCase();\n });\n };\n\n var warnHyphenatedStyleName = function (name) {\n if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n return;\n }\n\n warnedStyleNames[name] = true;\n\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$1, 'ms-')));\n };\n\n var warnBadVendoredStyleName = function (name) {\n if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n return;\n }\n\n warnedStyleNames[name] = true;\n\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 (name, value) {\n if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {\n return;\n }\n\n warnedStyleValues[value] = true;\n\n error(\"Style property values shouldn't contain a semicolon. \" + 'Try \"%s: %s\" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));\n };\n\n var warnStyleValueIsNaN = function (name, value) {\n if (warnedForNaNValue) {\n return;\n }\n\n warnedForNaNValue = true;\n\n error('`NaN` is an invalid value for the `%s` css style property.', name);\n };\n\n var warnStyleValueIsInfinity = function (name, value) {\n if (warnedForInfinityValue) {\n return;\n }\n\n warnedForInfinityValue = true;\n\n error('`Infinity` is an invalid value for the `%s` css style property.', name);\n };\n\n warnValidStyle = function (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\nvar warnValidStyle$1 = warnValidStyle;\n\n/**\n * Operations for dealing with CSS properties.\n */\n\n/**\n * This creates a string that is expected to be equivalent to the style\n * attribute generated by server-side rendering. It by-passes warnings and\n * security checks so it's not safe to use this value for anything other than\n * comparison. It is only used in DEV for SSR validation.\n */\n\nfunction createDangerousStringForStyles(styles) {\n {\n var serialized = '';\n var delimiter = '';\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var styleValue = styles[styleName];\n\n if (styleValue != null) {\n var isCustomProperty = styleName.indexOf('--') === 0;\n serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';\n serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n delimiter = ';';\n }\n }\n\n return serialized || null;\n }\n}\n/**\n * Sets the value for multiple styles on a node. If a value is specified as\n * '' (empty string), the corresponding style property will be unset.\n *\n * @param {DOMElement} node\n * @param {object} styles\n */\n\nfunction setValueForStyles(node, styles) {\n var style = node.style;\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var isCustomProperty = styleName.indexOf('--') === 0;\n\n {\n if (!isCustomProperty) {\n warnValidStyle$1(styleName, styles[styleName]);\n }\n }\n\n var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);\n\n if (styleName === 'float') {\n styleName = 'cssFloat';\n }\n\n if (isCustomProperty) {\n style.setProperty(styleName, styleValue);\n } else {\n style[styleName] = styleValue;\n }\n }\n}\n\nfunction isValueEmpty(value) {\n return value == null || typeof value === 'boolean' || value === '';\n}\n/**\n * Given {color: 'red', overflow: 'hidden'} returns {\n * color: 'color',\n * overflowX: 'overflow',\n * overflowY: 'overflow',\n * }. This can be read as \"the overflowY property was set by the overflow\n * shorthand\". That is, the values are the property that each was derived from.\n */\n\n\nfunction expandShorthandMap(styles) {\n var expanded = {};\n\n for (var key in styles) {\n var longhands = shorthandToLonghand[key] || [key];\n\n for (var i = 0; i < longhands.length; i++) {\n expanded[longhands[i]] = key;\n }\n }\n\n return expanded;\n}\n/**\n * When mixing shorthand and longhand property names, we warn during updates if\n * we expect an incorrect result to occur. In particular, we warn for:\n *\n * Updating a shorthand property (longhand gets overwritten):\n * {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'}\n * becomes .style.font = 'baz'\n * Removing a shorthand property (longhand gets lost too):\n * {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'}\n * becomes .style.font = ''\n * Removing a longhand property (should revert to shorthand; doesn't):\n * {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'}\n * becomes .style.fontVariant = ''\n */\n\n\nfunction validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {\n {\n\n if (!nextStyles) {\n return;\n }\n\n var expandedUpdates = expandShorthandMap(styleUpdates);\n var expandedStyles = expandShorthandMap(nextStyles);\n var warnedAbout = {};\n\n for (var key in expandedUpdates) {\n var originalKey = expandedUpdates[key];\n var correctOriginalKey = expandedStyles[key];\n\n if (correctOriginalKey && originalKey !== correctOriginalKey) {\n var warningKey = originalKey + ',' + correctOriginalKey;\n\n if (warnedAbout[warningKey]) {\n continue;\n }\n\n warnedAbout[warningKey] = true;\n\n error('%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + \"avoid this, don't mix shorthand and non-shorthand properties \" + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey);\n }\n }\n }\n}\n\n// For HTML, certain tags should omit their close tag. We keep a whitelist for\n// those special-case tags.\nvar omittedCloseTags = {\n area: true,\n base: true,\n br: true,\n col: true,\n embed: true,\n hr: true,\n img: true,\n input: true,\n keygen: true,\n link: true,\n meta: true,\n param: true,\n source: true,\n track: true,\n wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems.\n\n};\n\n// `omittedCloseTags` except that `menuitem` should still have its closing tag.\n\nvar voidElementTags = _assign({\n menuitem: true\n}, omittedCloseTags);\n\nvar HTML = '__html';\nvar ReactDebugCurrentFrame$3 = null;\n\n{\n ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;\n}\n\nfunction assertValidProps(tag, props) {\n if (!props) {\n return;\n } // Note the use of `==` which checks for null or undefined.\n\n\n if (voidElementTags[tag]) {\n if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {\n {\n throw Error( tag + \" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.\" + ( ReactDebugCurrentFrame$3.getStackAddendum() ) );\n }\n }\n }\n\n if (props.dangerouslySetInnerHTML != null) {\n if (!(props.children == null)) {\n {\n throw Error( \"Can only set one of `children` or `props.dangerouslySetInnerHTML`.\" );\n }\n }\n\n if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) {\n {\n throw Error( \"`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.\" );\n }\n }\n }\n\n {\n if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {\n error('A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.');\n }\n }\n\n if (!(props.style == null || typeof props.style === 'object')) {\n {\n throw Error( \"The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.\" + ( ReactDebugCurrentFrame$3.getStackAddendum() ) );\n }\n }\n}\n\nfunction 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 whitelist 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// When adding attributes to the HTML or SVG whitelist, be sure to\n// also add them to this module to ensure casing and incorrect name\n// warnings.\nvar 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 download: 'download',\n draggable: 'draggable',\n enctype: 'encType',\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 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\nvar ariaProperties = {\n 'aria-current': 0,\n // state\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\nvar warnedProperties = {};\nvar rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar hasOwnProperty$1 = Object.prototype.hasOwnProperty;\n\nfunction validateProperty(tagName, name) {\n {\n if (hasOwnProperty$1.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\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\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\n warnedProperties[name] = true;\n return true;\n }\n }\n }\n\n return true;\n}\n\nfunction 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://fb.me/invalid-aria-prop', unknownPropString, type);\n } else if (invalidProps.length > 1) {\n error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);\n }\n }\n}\n\nfunction validateProperties(type, props) {\n if (isCustomComponent(type, props)) {\n return;\n }\n\n warnInvalidARIAProps(type, props);\n}\n\nvar didWarnValueNull = false;\nfunction 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}\n\nvar validateProperty$1 = function () {};\n\n{\n var warnedProperties$1 = {};\n var _hasOwnProperty = Object.prototype.hasOwnProperty;\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 (tagName, name, value, canUseEventSystem) {\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\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 (canUseEventSystem) {\n if (registrationNameModules.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\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\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\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\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\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\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\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\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\n warnedProperties$1[name] = true;\n return true;\n }\n\n return true;\n };\n}\n\nvar warnUnknownProperties = function (type, props, canUseEventSystem) {\n {\n var unknownProps = [];\n\n for (var key in props) {\n var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);\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://fb.me/react-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://fb.me/react-attribute-behavior', unknownPropString, type);\n }\n }\n};\n\nfunction validateProperties$2(type, props, canUseEventSystem) {\n if (isCustomComponent(type, props)) {\n return;\n }\n\n warnUnknownProperties(type, props, canUseEventSystem);\n}\n\nvar didWarnInvalidHydration = false;\nvar DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';\nvar SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';\nvar SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning';\nvar AUTOFOCUS = 'autoFocus';\nvar CHILDREN = 'children';\nvar STYLE = 'style';\nvar HTML$1 = '__html';\nvar HTML_NAMESPACE$1 = Namespaces.html;\nvar warnedUnknownTags;\nvar suppressHydrationWarning;\nvar validatePropertiesInDevelopment;\nvar warnForTextDifference;\nvar warnForPropDifference;\nvar warnForExtraAttributes;\nvar warnForInvalidEventListener;\nvar canDiffStyleForHydrationWarning;\nvar normalizeMarkupForTextOrAttribute;\nvar normalizeHTML;\n\n{\n warnedUnknownTags = {\n // Chrome is the only major browser not shipping <time>. But as of July\n // 2017 it intends to ship it due to widespread usage. We intentionally\n // *don't* warn for <time> even if it's unrecognized by Chrome because\n // it soon will be, and many apps have been using it anyway.\n time: true,\n // There are working polyfills for <dialog>. Let people use it.\n dialog: true,\n // Electron ships a custom <webview> tag to display external web content in\n // an isolated frame and process.\n // This tag is not present in non Electron environments such as JSDom which\n // is often used for testing purposes.\n // @see https://electronjs.org/docs/api/webview-tag\n webview: true\n };\n\n validatePropertiesInDevelopment = function (type, props) {\n validateProperties(type, props);\n validateProperties$1(type, props);\n validateProperties$2(type, props,\n /* canUseEventSystem */\n true);\n }; // IE 11 parses & normalizes the style attribute as opposed to other\n // browsers. It adds spaces and sorts the properties in some\n // non-alphabetical order. Handling that would require sorting CSS\n // properties in the client & server versions or applying\n // `expectedStyle` to a temporary DOM node to read its `style` attribute\n // normalized. Since it only affects IE, we're skipping style warnings\n // in that browser completely in favor of doing all that work.\n // See https://github.com/facebook/react/issues/11807\n\n\n canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode; // HTML parsing normalizes CR and CRLF to LF.\n // It also can turn \\u0000 into \\uFFFD inside attributes.\n // https://www.w3.org/TR/html5/single-page.html#preprocessing-the-input-stream\n // If we have a mismatch, it might be caused by that.\n // We will still patch up in this case but not fire the warning.\n\n var NORMALIZE_NEWLINES_REGEX = /\\r\\n?/g;\n var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\\u0000|\\uFFFD/g;\n\n normalizeMarkupForTextOrAttribute = function (markup) {\n var markupString = typeof markup === 'string' ? markup : '' + markup;\n return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, '');\n };\n\n warnForTextDifference = function (serverText, clientText) {\n if (didWarnInvalidHydration) {\n return;\n }\n\n var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);\n var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);\n\n if (normalizedServerText === normalizedClientText) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Text content did not match. Server: \"%s\" Client: \"%s\"', normalizedServerText, normalizedClientText);\n };\n\n warnForPropDifference = function (propName, serverValue, clientValue) {\n if (didWarnInvalidHydration) {\n return;\n }\n\n var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);\n var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);\n\n if (normalizedServerValue === normalizedClientValue) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));\n };\n\n warnForExtraAttributes = function (attributeNames) {\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n var names = [];\n attributeNames.forEach(function (name) {\n names.push(name);\n });\n\n error('Extra attributes from the server: %s', names);\n };\n\n warnForInvalidEventListener = function (registrationName, listener) {\n if (listener === false) {\n error('Expected `%s` listener to be a function, instead got `false`.\\n\\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName);\n } else {\n error('Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener);\n }\n }; // Parse the HTML and read it back to normalize the HTML string so that it\n // can be used for comparison.\n\n\n normalizeHTML = function (parent, html) {\n // We could have created a separate document here to avoid\n // re-initializing custom elements if they exist. But this breaks\n // how <noscript> is being handled. So we use the same document.\n // See the discussion in https://github.com/facebook/react/pull/11157.\n var testElement = parent.namespaceURI === HTML_NAMESPACE$1 ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);\n testElement.innerHTML = html;\n return testElement.innerHTML;\n };\n}\n\nfunction ensureListeningTo(rootContainerElement, registrationName) {\n var isDocumentOrFragment = rootContainerElement.nodeType === DOCUMENT_NODE || rootContainerElement.nodeType === DOCUMENT_FRAGMENT_NODE;\n var doc = isDocumentOrFragment ? rootContainerElement : rootContainerElement.ownerDocument;\n legacyListenToEvent(registrationName, doc);\n}\n\nfunction getOwnerDocumentFromRootContainer(rootContainerElement) {\n return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;\n}\n\nfunction noop() {}\n\nfunction trapClickOnNonInteractiveElement(node) {\n // Mobile Safari does not fire properly bubble click events on\n // non-interactive elements, which means delegated click listeners do not\n // fire. The workaround for this bug involves attaching an empty click\n // listener on the target node.\n // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html\n // Just set it using the onclick property so that we don't have to manage any\n // bookkeeping for it. Not sure if we need to clear it when the listener is\n // removed.\n // TODO: Only do this for the relevant Safaris maybe?\n node.onclick = noop;\n}\n\nfunction setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {\n for (var propKey in nextProps) {\n if (!nextProps.hasOwnProperty(propKey)) {\n continue;\n }\n\n var nextProp = nextProps[propKey];\n\n if (propKey === STYLE) {\n {\n if (nextProp) {\n // Freeze the next style object so that we can assume it won't be\n // mutated. We have already warned for this in the past.\n Object.freeze(nextProp);\n }\n } // Relies on `updateStylesByID` not mutating `styleUpdates`.\n\n\n setValueForStyles(domElement, nextProp);\n } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n var nextHtml = nextProp ? nextProp[HTML$1] : undefined;\n\n if (nextHtml != null) {\n setInnerHTML(domElement, nextHtml);\n }\n } else if (propKey === CHILDREN) {\n if (typeof nextProp === 'string') {\n // Avoid setting initial textContent when the text is empty. In IE11 setting\n // textContent on a <textarea> will cause the placeholder to not\n // show within the <textarea> until it has been focused and blurred again.\n // https://github.com/facebook/react/issues/6731#issuecomment-254874553\n var canSetTextContent = tag !== 'textarea' || nextProp !== '';\n\n if (canSetTextContent) {\n setTextContent(domElement, nextProp);\n }\n } else if (typeof nextProp === 'number') {\n setTextContent(domElement, '' + nextProp);\n }\n } else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameModules.hasOwnProperty(propKey)) {\n if (nextProp != null) {\n if ( typeof nextProp !== 'function') {\n warnForInvalidEventListener(propKey, nextProp);\n }\n\n ensureListeningTo(rootContainerElement, propKey);\n }\n } else if (nextProp != null) {\n setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);\n }\n }\n}\n\nfunction updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {\n // TODO: Handle wasCustomComponentTag\n for (var i = 0; i < updatePayload.length; i += 2) {\n var propKey = updatePayload[i];\n var propValue = updatePayload[i + 1];\n\n if (propKey === STYLE) {\n setValueForStyles(domElement, propValue);\n } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n setInnerHTML(domElement, propValue);\n } else if (propKey === CHILDREN) {\n setTextContent(domElement, propValue);\n } else {\n setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);\n }\n }\n}\n\nfunction createElement(type, props, rootContainerElement, parentNamespace) {\n var isCustomComponentTag; // We create tags in the namespace of their parent container, except HTML\n // tags get no namespace.\n\n var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);\n var domElement;\n var namespaceURI = parentNamespace;\n\n if (namespaceURI === HTML_NAMESPACE$1) {\n namespaceURI = getIntrinsicNamespace(type);\n }\n\n if (namespaceURI === HTML_NAMESPACE$1) {\n {\n isCustomComponentTag = isCustomComponent(type, props); // Should this check be gated by parent namespace? Not sure we want to\n // allow <SVG> or <mATH>.\n\n if (!isCustomComponentTag && type !== type.toLowerCase()) {\n error('<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type);\n }\n }\n\n if (type === 'script') {\n // Create the script via .innerHTML so its \"parser-inserted\" flag is\n // set to true and it does not execute\n var div = ownerDocument.createElement('div');\n\n div.innerHTML = '<script><' + '/script>'; // eslint-disable-line\n // This is guaranteed to yield a script element.\n\n var firstChild = div.firstChild;\n domElement = div.removeChild(firstChild);\n } else if (typeof props.is === 'string') {\n // $FlowIssue `createElement` should be updated for Web Components\n domElement = ownerDocument.createElement(type, {\n is: props.is\n });\n } else {\n // Separate else branch instead of using `props.is || undefined` above because of a Firefox bug.\n // See discussion in https://github.com/facebook/react/pull/6896\n // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240\n domElement = ownerDocument.createElement(type); // Normally attributes are assigned in `setInitialDOMProperties`, however the `multiple` and `size`\n // attributes on `select`s needs to be added before `option`s are inserted.\n // This prevents:\n // - a bug where the `select` does not scroll to the correct option because singular\n // `select` elements automatically pick the first item #13222\n // - a bug where the `select` set the first item as selected despite the `size` attribute #14239\n // See https://github.com/facebook/react/issues/13222\n // and https://github.com/facebook/react/issues/14239\n\n if (type === 'select') {\n var node = domElement;\n\n if (props.multiple) {\n node.multiple = true;\n } else if (props.size) {\n // Setting a size greater than 1 causes a select to behave like `multiple=true`, where\n // it is possible that no option is selected.\n //\n // This is only necessary when a select in \"single selection mode\".\n node.size = props.size;\n }\n }\n }\n } else {\n domElement = ownerDocument.createElementNS(namespaceURI, type);\n }\n\n {\n if (namespaceURI === HTML_NAMESPACE$1) {\n if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {\n warnedUnknownTags[type] = true;\n\n error('The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type);\n }\n }\n }\n\n return domElement;\n}\nfunction createTextNode(text, rootContainerElement) {\n return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);\n}\nfunction setInitialProperties(domElement, tag, rawProps, rootContainerElement) {\n var isCustomComponentTag = isCustomComponent(tag, rawProps);\n\n {\n validatePropertiesInDevelopment(tag, rawProps);\n } // TODO: Make sure that we check isMounted before firing any of these events.\n\n\n var props;\n\n switch (tag) {\n case 'iframe':\n case 'object':\n case 'embed':\n trapBubbledEvent(TOP_LOAD, domElement);\n props = rawProps;\n break;\n\n case 'video':\n case 'audio':\n // Create listener for each media event\n for (var i = 0; i < mediaEventTypes.length; i++) {\n trapBubbledEvent(mediaEventTypes[i], domElement);\n }\n\n props = rawProps;\n break;\n\n case 'source':\n trapBubbledEvent(TOP_ERROR, domElement);\n props = rawProps;\n break;\n\n case 'img':\n case 'image':\n case 'link':\n trapBubbledEvent(TOP_ERROR, domElement);\n trapBubbledEvent(TOP_LOAD, domElement);\n props = rawProps;\n break;\n\n case 'form':\n trapBubbledEvent(TOP_RESET, domElement);\n trapBubbledEvent(TOP_SUBMIT, domElement);\n props = rawProps;\n break;\n\n case 'details':\n trapBubbledEvent(TOP_TOGGLE, domElement);\n props = rawProps;\n break;\n\n case 'input':\n initWrapperState(domElement, rawProps);\n props = getHostProps(domElement, rawProps);\n trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening\n // to onChange. Even if there is no listener.\n\n ensureListeningTo(rootContainerElement, 'onChange');\n break;\n\n case 'option':\n validateProps(domElement, rawProps);\n props = getHostProps$1(domElement, rawProps);\n break;\n\n case 'select':\n initWrapperState$1(domElement, rawProps);\n props = getHostProps$2(domElement, rawProps);\n trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening\n // to onChange. Even if there is no listener.\n\n ensureListeningTo(rootContainerElement, 'onChange');\n break;\n\n case 'textarea':\n initWrapperState$2(domElement, rawProps);\n props = getHostProps$3(domElement, rawProps);\n trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening\n // to onChange. Even if there is no listener.\n\n ensureListeningTo(rootContainerElement, 'onChange');\n break;\n\n default:\n props = rawProps;\n }\n\n assertValidProps(tag, props);\n setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);\n\n switch (tag) {\n case 'input':\n // TODO: Make sure we check if this is still unmounted or do any clean\n // up necessary since we never stop tracking anymore.\n track(domElement);\n postMountWrapper(domElement, rawProps, false);\n break;\n\n case 'textarea':\n // TODO: Make sure we check if this is still unmounted or do any clean\n // up necessary since we never stop tracking anymore.\n track(domElement);\n postMountWrapper$3(domElement);\n break;\n\n case 'option':\n postMountWrapper$1(domElement, rawProps);\n break;\n\n case 'select':\n postMountWrapper$2(domElement, rawProps);\n break;\n\n default:\n if (typeof props.onClick === 'function') {\n // TODO: This cast may not be sound for SVG, MathML or custom elements.\n trapClickOnNonInteractiveElement(domElement);\n }\n\n break;\n }\n} // Calculate the diff between the two objects.\n\nfunction diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {\n {\n validatePropertiesInDevelopment(tag, nextRawProps);\n }\n\n var updatePayload = null;\n var lastProps;\n var nextProps;\n\n switch (tag) {\n case 'input':\n lastProps = getHostProps(domElement, lastRawProps);\n nextProps = getHostProps(domElement, nextRawProps);\n updatePayload = [];\n break;\n\n case 'option':\n lastProps = getHostProps$1(domElement, lastRawProps);\n nextProps = getHostProps$1(domElement, nextRawProps);\n updatePayload = [];\n break;\n\n case 'select':\n lastProps = getHostProps$2(domElement, lastRawProps);\n nextProps = getHostProps$2(domElement, nextRawProps);\n updatePayload = [];\n break;\n\n case 'textarea':\n lastProps = getHostProps$3(domElement, lastRawProps);\n nextProps = getHostProps$3(domElement, nextRawProps);\n updatePayload = [];\n break;\n\n default:\n lastProps = lastRawProps;\n nextProps = nextRawProps;\n\n if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') {\n // TODO: This cast may not be sound for SVG, MathML or custom elements.\n trapClickOnNonInteractiveElement(domElement);\n }\n\n break;\n }\n\n assertValidProps(tag, nextProps);\n var propKey;\n var styleName;\n var styleUpdates = null;\n\n for (propKey in lastProps) {\n if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {\n continue;\n }\n\n if (propKey === STYLE) {\n var lastStyle = lastProps[propKey];\n\n for (styleName in lastStyle) {\n if (lastStyle.hasOwnProperty(styleName)) {\n if (!styleUpdates) {\n styleUpdates = {};\n }\n\n styleUpdates[styleName] = '';\n }\n }\n } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) ; else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameModules.hasOwnProperty(propKey)) {\n // This is a special case. If any listener updates we need to ensure\n // that the \"current\" fiber pointer gets updated so we need a commit\n // to update this element.\n if (!updatePayload) {\n updatePayload = [];\n }\n } else {\n // For all other deleted properties we add it to the queue. We use\n // the whitelist in the commit phase instead.\n (updatePayload = updatePayload || []).push(propKey, null);\n }\n }\n\n for (propKey in nextProps) {\n var nextProp = nextProps[propKey];\n var lastProp = lastProps != null ? lastProps[propKey] : undefined;\n\n if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {\n continue;\n }\n\n if (propKey === STYLE) {\n {\n if (nextProp) {\n // Freeze the next style object so that we can assume it won't be\n // mutated. We have already warned for this in the past.\n Object.freeze(nextProp);\n }\n }\n\n if (lastProp) {\n // Unset styles on `lastProp` but not on `nextProp`.\n for (styleName in lastProp) {\n if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {\n if (!styleUpdates) {\n styleUpdates = {};\n }\n\n styleUpdates[styleName] = '';\n }\n } // Update styles that changed since `lastProp`.\n\n\n for (styleName in nextProp) {\n if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {\n if (!styleUpdates) {\n styleUpdates = {};\n }\n\n styleUpdates[styleName] = nextProp[styleName];\n }\n }\n } else {\n // Relies on `updateStylesByID` not mutating `styleUpdates`.\n if (!styleUpdates) {\n if (!updatePayload) {\n updatePayload = [];\n }\n\n updatePayload.push(propKey, styleUpdates);\n }\n\n styleUpdates = nextProp;\n }\n } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n var nextHtml = nextProp ? nextProp[HTML$1] : undefined;\n var lastHtml = lastProp ? lastProp[HTML$1] : undefined;\n\n if (nextHtml != null) {\n if (lastHtml !== nextHtml) {\n (updatePayload = updatePayload || []).push(propKey, nextHtml);\n }\n }\n } else if (propKey === CHILDREN) {\n if (lastProp !== nextProp && (typeof nextProp === 'string' || typeof nextProp === 'number')) {\n (updatePayload = updatePayload || []).push(propKey, '' + nextProp);\n }\n } else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (registrationNameModules.hasOwnProperty(propKey)) {\n if (nextProp != null) {\n // We eagerly listen to this even though we haven't committed yet.\n if ( typeof nextProp !== 'function') {\n warnForInvalidEventListener(propKey, nextProp);\n }\n\n ensureListeningTo(rootContainerElement, propKey);\n }\n\n if (!updatePayload && lastProp !== nextProp) {\n // This is a special case. If any listener updates we need to ensure\n // that the \"current\" props pointer gets updated so we need a commit\n // to update this element.\n updatePayload = [];\n }\n } else {\n // For any other property we always add it to the queue and then we\n // filter it out using the whitelist during the commit.\n (updatePayload = updatePayload || []).push(propKey, nextProp);\n }\n }\n\n if (styleUpdates) {\n {\n validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]);\n }\n\n (updatePayload = updatePayload || []).push(STYLE, styleUpdates);\n }\n\n return updatePayload;\n} // Apply the diff.\n\nfunction updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {\n // Update checked *before* name.\n // In the middle of an update, it is possible to have multiple checked.\n // When a checked radio tries to change name, browser makes another radio's checked false.\n if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {\n updateChecked(domElement, nextRawProps);\n }\n\n var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);\n var isCustomComponentTag = isCustomComponent(tag, nextRawProps); // Apply the diff.\n\n updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag); // TODO: Ensure that an update gets scheduled if any of the special props\n // changed.\n\n switch (tag) {\n case 'input':\n // Update the wrapper around inputs *after* updating props. This has to\n // happen after `updateDOMProperties`. Otherwise HTML5 input validations\n // raise warnings and prevent the new value from being assigned.\n updateWrapper(domElement, nextRawProps);\n break;\n\n case 'textarea':\n updateWrapper$1(domElement, nextRawProps);\n break;\n\n case 'select':\n // <select> value update needs to occur after <option> children\n // reconciliation\n postUpdateWrapper(domElement, nextRawProps);\n break;\n }\n}\n\nfunction getPossibleStandardName(propName) {\n {\n var lowerCasedName = propName.toLowerCase();\n\n if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {\n return null;\n }\n\n return possibleStandardNames[lowerCasedName] || null;\n }\n}\n\nfunction diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement) {\n var isCustomComponentTag;\n var extraAttributeNames;\n\n {\n suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING] === true;\n isCustomComponentTag = isCustomComponent(tag, rawProps);\n validatePropertiesInDevelopment(tag, rawProps);\n } // TODO: Make sure that we check isMounted before firing any of these events.\n\n\n switch (tag) {\n case 'iframe':\n case 'object':\n case 'embed':\n trapBubbledEvent(TOP_LOAD, domElement);\n break;\n\n case 'video':\n case 'audio':\n // Create listener for each media event\n for (var i = 0; i < mediaEventTypes.length; i++) {\n trapBubbledEvent(mediaEventTypes[i], domElement);\n }\n\n break;\n\n case 'source':\n trapBubbledEvent(TOP_ERROR, domElement);\n break;\n\n case 'img':\n case 'image':\n case 'link':\n trapBubbledEvent(TOP_ERROR, domElement);\n trapBubbledEvent(TOP_LOAD, domElement);\n break;\n\n case 'form':\n trapBubbledEvent(TOP_RESET, domElement);\n trapBubbledEvent(TOP_SUBMIT, domElement);\n break;\n\n case 'details':\n trapBubbledEvent(TOP_TOGGLE, domElement);\n break;\n\n case 'input':\n initWrapperState(domElement, rawProps);\n trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening\n // to onChange. Even if there is no listener.\n\n ensureListeningTo(rootContainerElement, 'onChange');\n break;\n\n case 'option':\n validateProps(domElement, rawProps);\n break;\n\n case 'select':\n initWrapperState$1(domElement, rawProps);\n trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening\n // to onChange. Even if there is no listener.\n\n ensureListeningTo(rootContainerElement, 'onChange');\n break;\n\n case 'textarea':\n initWrapperState$2(domElement, rawProps);\n trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening\n // to onChange. Even if there is no listener.\n\n ensureListeningTo(rootContainerElement, 'onChange');\n break;\n }\n\n assertValidProps(tag, rawProps);\n\n {\n extraAttributeNames = new Set();\n var attributes = domElement.attributes;\n\n for (var _i = 0; _i < attributes.length; _i++) {\n var name = attributes[_i].name.toLowerCase();\n\n switch (name) {\n // Built-in SSR attribute is whitelisted\n case 'data-reactroot':\n break;\n // Controlled attributes are not validated\n // TODO: Only ignore them on controlled tags.\n\n case 'value':\n break;\n\n case 'checked':\n break;\n\n case 'selected':\n break;\n\n default:\n // Intentionally use the original name.\n // See discussion in https://github.com/facebook/react/pull/10676.\n extraAttributeNames.add(attributes[_i].name);\n }\n }\n }\n\n var updatePayload = null;\n\n for (var propKey in rawProps) {\n if (!rawProps.hasOwnProperty(propKey)) {\n continue;\n }\n\n var nextProp = rawProps[propKey];\n\n if (propKey === CHILDREN) {\n // For text content children we compare against textContent. This\n // might match additional HTML that is hidden when we read it using\n // textContent. E.g. \"foo\" will match \"f<span>oo</span>\" but that still\n // satisfies our requirement. Our requirement is not to produce perfect\n // HTML and attributes. Ideally we should preserve structure but it's\n // ok not to if the visible content is still enough to indicate what\n // even listeners these nodes might be wired up to.\n // TODO: Warn if there is more than a single textNode as a child.\n // TODO: Should we use domElement.firstChild.nodeValue to compare?\n if (typeof nextProp === 'string') {\n if (domElement.textContent !== nextProp) {\n if ( !suppressHydrationWarning) {\n warnForTextDifference(domElement.textContent, nextProp);\n }\n\n updatePayload = [CHILDREN, nextProp];\n }\n } else if (typeof nextProp === 'number') {\n if (domElement.textContent !== '' + nextProp) {\n if ( !suppressHydrationWarning) {\n warnForTextDifference(domElement.textContent, nextProp);\n }\n\n updatePayload = [CHILDREN, '' + nextProp];\n }\n }\n } else if (registrationNameModules.hasOwnProperty(propKey)) {\n if (nextProp != null) {\n if ( typeof nextProp !== 'function') {\n warnForInvalidEventListener(propKey, nextProp);\n }\n\n ensureListeningTo(rootContainerElement, propKey);\n }\n } else if ( // Convince Flow we've calculated it (it's DEV-only in this method.)\n typeof isCustomComponentTag === 'boolean') {\n // Validate that the properties correspond to their expected values.\n var serverValue = void 0;\n var propertyInfo = getPropertyInfo(propKey);\n\n if (suppressHydrationWarning) ; else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || // Controlled attributes are not validated\n // TODO: Only ignore them on controlled tags.\n propKey === 'value' || propKey === 'checked' || propKey === 'selected') ; else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n var serverHTML = domElement.innerHTML;\n var nextHtml = nextProp ? nextProp[HTML$1] : undefined;\n var expectedHTML = normalizeHTML(domElement, nextHtml != null ? nextHtml : '');\n\n if (expectedHTML !== serverHTML) {\n warnForPropDifference(propKey, serverHTML, expectedHTML);\n }\n } else if (propKey === STYLE) {\n // $FlowFixMe - Should be inferred as not undefined.\n extraAttributeNames.delete(propKey);\n\n if (canDiffStyleForHydrationWarning) {\n var expectedStyle = createDangerousStringForStyles(nextProp);\n serverValue = domElement.getAttribute('style');\n\n if (expectedStyle !== serverValue) {\n warnForPropDifference(propKey, serverValue, expectedStyle);\n }\n }\n } else if (isCustomComponentTag) {\n // $FlowFixMe - Should be inferred as not undefined.\n extraAttributeNames.delete(propKey.toLowerCase());\n serverValue = getValueForAttribute(domElement, propKey, nextProp);\n\n if (nextProp !== serverValue) {\n warnForPropDifference(propKey, serverValue, nextProp);\n }\n } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {\n var isMismatchDueToBadCasing = false;\n\n if (propertyInfo !== null) {\n // $FlowFixMe - Should be inferred as not undefined.\n extraAttributeNames.delete(propertyInfo.attributeName);\n serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);\n } else {\n var ownNamespace = parentNamespace;\n\n if (ownNamespace === HTML_NAMESPACE$1) {\n ownNamespace = getIntrinsicNamespace(tag);\n }\n\n if (ownNamespace === HTML_NAMESPACE$1) {\n // $FlowFixMe - Should be inferred as not undefined.\n extraAttributeNames.delete(propKey.toLowerCase());\n } else {\n var standardName = getPossibleStandardName(propKey);\n\n if (standardName !== null && standardName !== propKey) {\n // If an SVG prop is supplied with bad casing, it will\n // be successfully parsed from HTML, but will produce a mismatch\n // (and would be incorrectly rendered on the client).\n // However, we already warn about bad casing elsewhere.\n // So we'll skip the misleading extra mismatch warning in this case.\n isMismatchDueToBadCasing = true; // $FlowFixMe - Should be inferred as not undefined.\n\n extraAttributeNames.delete(standardName);\n } // $FlowFixMe - Should be inferred as not undefined.\n\n\n extraAttributeNames.delete(propKey);\n }\n\n serverValue = getValueForAttribute(domElement, propKey, nextProp);\n }\n\n if (nextProp !== serverValue && !isMismatchDueToBadCasing) {\n warnForPropDifference(propKey, serverValue, nextProp);\n }\n }\n }\n }\n\n {\n // $FlowFixMe - Should be inferred as not undefined.\n if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {\n // $FlowFixMe - Should be inferred as not undefined.\n warnForExtraAttributes(extraAttributeNames);\n }\n }\n\n switch (tag) {\n case 'input':\n // TODO: Make sure we check if this is still unmounted or do any clean\n // up necessary since we never stop tracking anymore.\n track(domElement);\n postMountWrapper(domElement, rawProps, true);\n break;\n\n case 'textarea':\n // TODO: Make sure we check if this is still unmounted or do any clean\n // up necessary since we never stop tracking anymore.\n track(domElement);\n postMountWrapper$3(domElement);\n break;\n\n case 'select':\n case 'option':\n // For input and textarea we current always set the value property at\n // post mount to force it to diverge from attributes. However, for\n // option and select we don't quite do the same thing and select\n // is not resilient to the DOM state changing so we don't do that here.\n // TODO: Consider not doing this for input and textarea.\n break;\n\n default:\n if (typeof rawProps.onClick === 'function') {\n // TODO: This cast may not be sound for SVG, MathML or custom elements.\n trapClickOnNonInteractiveElement(domElement);\n }\n\n break;\n }\n\n return updatePayload;\n}\nfunction diffHydratedText(textNode, text) {\n var isDifferent = textNode.nodeValue !== text;\n return isDifferent;\n}\nfunction warnForUnmatchedText(textNode, text) {\n {\n warnForTextDifference(textNode.nodeValue, text);\n }\n}\nfunction warnForDeletedHydratableElement(parentNode, child) {\n {\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());\n }\n}\nfunction warnForDeletedHydratableText(parentNode, child) {\n {\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Did not expect server HTML to contain the text node \"%s\" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());\n }\n}\nfunction warnForInsertedHydratedElement(parentNode, tag, props) {\n {\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase());\n }\n}\nfunction warnForInsertedHydratedText(parentNode, text) {\n {\n if (text === '') {\n // We expect to insert empty text nodes since they're not represented in\n // the HTML.\n // TODO: Remove this special case if we can just avoid inserting empty\n // text nodes.\n return;\n }\n\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Expected server HTML to contain a matching text node for \"%s\" in <%s>.', text, parentNode.nodeName.toLowerCase());\n }\n}\nfunction restoreControlledState$3(domElement, tag, props) {\n switch (tag) {\n case 'input':\n restoreControlledState(domElement, props);\n return;\n\n case 'textarea':\n restoreControlledState$2(domElement, props);\n return;\n\n case 'select':\n restoreControlledState$1(domElement, props);\n return;\n }\n}\n\nfunction getActiveElement(doc) {\n doc = doc || (typeof document !== 'undefined' ? document : undefined);\n\n if (typeof doc === 'undefined') {\n return null;\n }\n\n try {\n return doc.activeElement || doc.body;\n } catch (e) {\n return doc.body;\n }\n}\n\n/**\n * Given any node return the first leaf node without children.\n *\n * @param {DOMElement|DOMTextNode} node\n * @return {DOMElement|DOMTextNode}\n */\n\nfunction getLeafNode(node) {\n while (node && node.firstChild) {\n node = node.firstChild;\n }\n\n return node;\n}\n/**\n * Get the next sibling within a container. This will walk up the\n * DOM if a node's siblings have been exhausted.\n *\n * @param {DOMElement|DOMTextNode} node\n * @return {?DOMElement|DOMTextNode}\n */\n\n\nfunction getSiblingNode(node) {\n while (node) {\n if (node.nextSibling) {\n return node.nextSibling;\n }\n\n node = node.parentNode;\n }\n}\n/**\n * Get object describing the nodes which contain characters at offset.\n *\n * @param {DOMElement|DOMTextNode} root\n * @param {number} offset\n * @return {?object}\n */\n\n\nfunction getNodeForCharacterOffset(root, offset) {\n var node = getLeafNode(root);\n var nodeStart = 0;\n var nodeEnd = 0;\n\n while (node) {\n if (node.nodeType === TEXT_NODE) {\n nodeEnd = nodeStart + node.textContent.length;\n\n if (nodeStart <= offset && nodeEnd >= offset) {\n return {\n node: node,\n offset: offset - nodeStart\n };\n }\n\n nodeStart = nodeEnd;\n }\n\n node = getLeafNode(getSiblingNode(node));\n }\n}\n\n/**\n * @param {DOMElement} outerNode\n * @return {?object}\n */\n\nfunction getOffsets(outerNode) {\n var ownerDocument = outerNode.ownerDocument;\n var win = ownerDocument && ownerDocument.defaultView || window;\n var selection = win.getSelection && win.getSelection();\n\n if (!selection || selection.rangeCount === 0) {\n return null;\n }\n\n var anchorNode = selection.anchorNode,\n anchorOffset = selection.anchorOffset,\n focusNode = selection.focusNode,\n focusOffset = selection.focusOffset; // In Firefox, anchorNode and focusNode can be \"anonymous divs\", e.g. the\n // up/down buttons on an <input type=\"number\">. Anonymous divs do not seem to\n // expose properties, triggering a \"Permission denied error\" if any of its\n // properties are accessed. The only seemingly possible way to avoid erroring\n // is to access a property that typically works for non-anonymous divs and\n // catch any error that may otherwise arise. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=208427\n\n try {\n /* eslint-disable no-unused-expressions */\n anchorNode.nodeType;\n focusNode.nodeType;\n /* eslint-enable no-unused-expressions */\n } catch (e) {\n return null;\n }\n\n return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);\n}\n/**\n * Returns {start, end} where `start` is the character/codepoint index of\n * (anchorNode, anchorOffset) within the textContent of `outerNode`, and\n * `end` is the index of (focusNode, focusOffset).\n *\n * Returns null if you pass in garbage input but we should probably just crash.\n *\n * Exported only for testing.\n */\n\nfunction getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {\n var length = 0;\n var start = -1;\n var end = -1;\n var indexWithinAnchor = 0;\n var indexWithinFocus = 0;\n var node = outerNode;\n var parentNode = null;\n\n outer: while (true) {\n var next = null;\n\n while (true) {\n if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {\n start = length + anchorOffset;\n }\n\n if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {\n end = length + focusOffset;\n }\n\n if (node.nodeType === TEXT_NODE) {\n length += node.nodeValue.length;\n }\n\n if ((next = node.firstChild) === null) {\n break;\n } // Moving from `node` to its first child `next`.\n\n\n parentNode = node;\n node = next;\n }\n\n while (true) {\n if (node === outerNode) {\n // If `outerNode` has children, this is always the second time visiting\n // it. If it has no children, this is still the first loop, and the only\n // valid selection is anchorNode and focusNode both equal to this node\n // and both offsets 0, in which case we will have handled above.\n break outer;\n }\n\n if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {\n start = length;\n }\n\n if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {\n end = length;\n }\n\n if ((next = node.nextSibling) !== null) {\n break;\n }\n\n node = parentNode;\n parentNode = node.parentNode;\n } // Moving from `node` to its next sibling `next`.\n\n\n node = next;\n }\n\n if (start === -1 || end === -1) {\n // This should never happen. (Would happen if the anchor/focus nodes aren't\n // actually inside the passed-in node.)\n return null;\n }\n\n return {\n start: start,\n end: end\n };\n}\n/**\n * In modern non-IE browsers, we can support both forward and backward\n * selections.\n *\n * Note: IE10+ supports the Selection object, but it does not support\n * the `extend` method, which means that even in modern IE, it's not possible\n * to programmatically create a backward selection. Thus, for all IE\n * versions, we use the old IE API to create our selections.\n *\n * @param {DOMElement|DOMTextNode} node\n * @param {object} offsets\n */\n\nfunction setOffsets(node, offsets) {\n var doc = node.ownerDocument || document;\n var win = doc && doc.defaultView || window; // Edge fails with \"Object expected\" in some scenarios.\n // (For instance: TinyMCE editor used in a list component that supports pasting to add more,\n // fails when pasting 100+ items)\n\n if (!win.getSelection) {\n return;\n }\n\n var selection = win.getSelection();\n var length = node.textContent.length;\n var start = Math.min(offsets.start, length);\n var end = offsets.end === undefined ? start : Math.min(offsets.end, length); // IE 11 uses modern selection, but doesn't support the extend method.\n // Flip backward selections, so we can set with a single range.\n\n if (!selection.extend && start > end) {\n var temp = end;\n end = start;\n start = temp;\n }\n\n var startMarker = getNodeForCharacterOffset(node, start);\n var endMarker = getNodeForCharacterOffset(node, end);\n\n if (startMarker && endMarker) {\n if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {\n return;\n }\n\n var range = doc.createRange();\n range.setStart(startMarker.node, startMarker.offset);\n selection.removeAllRanges();\n\n if (start > end) {\n selection.addRange(range);\n selection.extend(endMarker.node, endMarker.offset);\n } else {\n range.setEnd(endMarker.node, endMarker.offset);\n selection.addRange(range);\n }\n }\n}\n\nfunction isTextNode(node) {\n return node && node.nodeType === TEXT_NODE;\n}\n\nfunction containsNode(outerNode, innerNode) {\n if (!outerNode || !innerNode) {\n return false;\n } else if (outerNode === innerNode) {\n return true;\n } else if (isTextNode(outerNode)) {\n return false;\n } else if (isTextNode(innerNode)) {\n return containsNode(outerNode, innerNode.parentNode);\n } else if ('contains' in outerNode) {\n return outerNode.contains(innerNode);\n } else if (outerNode.compareDocumentPosition) {\n return !!(outerNode.compareDocumentPosition(innerNode) & 16);\n } else {\n return false;\n }\n}\n\nfunction isInDocument(node) {\n return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);\n}\n\nfunction isSameOriginFrame(iframe) {\n try {\n // Accessing the contentDocument of a HTMLIframeElement can cause the browser\n // to throw, e.g. if it has a cross-origin src attribute.\n // Safari will show an error in the console when the access results in \"Blocked a frame with origin\". e.g:\n // iframe.contentDocument.defaultView;\n // A safety way is to access one of the cross origin properties: Window or Location\n // Which might result in \"SecurityError\" DOM Exception and it is compatible to Safari.\n // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl\n return typeof iframe.contentWindow.location.href === 'string';\n } catch (err) {\n return false;\n }\n}\n\nfunction getActiveElementDeep() {\n var win = window;\n var element = getActiveElement();\n\n while (element instanceof win.HTMLIFrameElement) {\n if (isSameOriginFrame(element)) {\n win = element.contentWindow;\n } else {\n return element;\n }\n\n element = getActiveElement(win.document);\n }\n\n return element;\n}\n/**\n * @ReactInputSelection: React input selection module. Based on Selection.js,\n * but modified to be suitable for react and has a couple of bug fixes (doesn't\n * assume buttons have range selections allowed).\n * Input selection module for React.\n */\n\n/**\n * @hasSelectionCapabilities: we get the element types that support selection\n * from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart`\n * and `selectionEnd` rows.\n */\n\n\nfunction hasSelectionCapabilities(elem) {\n var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true');\n}\nfunction getSelectionInformation() {\n var focusedElem = getActiveElementDeep();\n return {\n // Used by Flare\n activeElementDetached: null,\n focusedElem: focusedElem,\n selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null\n };\n}\n/**\n * @restoreSelection: If any selection information was potentially lost,\n * restore it. This is useful when performing operations that could remove dom\n * nodes and place them back in, resulting in focus being lost.\n */\n\nfunction restoreSelection(priorSelectionInformation) {\n var curFocusedElem = getActiveElementDeep();\n var priorFocusedElem = priorSelectionInformation.focusedElem;\n var priorSelectionRange = priorSelectionInformation.selectionRange;\n\n if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {\n if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {\n setSelection(priorFocusedElem, priorSelectionRange);\n } // Focusing a node can change the scroll position, which is undesirable\n\n\n var ancestors = [];\n var ancestor = priorFocusedElem;\n\n while (ancestor = ancestor.parentNode) {\n if (ancestor.nodeType === ELEMENT_NODE) {\n ancestors.push({\n element: ancestor,\n left: ancestor.scrollLeft,\n top: ancestor.scrollTop\n });\n }\n }\n\n if (typeof priorFocusedElem.focus === 'function') {\n priorFocusedElem.focus();\n }\n\n for (var i = 0; i < ancestors.length; i++) {\n var info = ancestors[i];\n info.element.scrollLeft = info.left;\n info.element.scrollTop = info.top;\n }\n }\n}\n/**\n * @getSelection: Gets the selection bounds of a focused textarea, input or\n * contentEditable node.\n * -@input: Look up selection bounds of this input\n * -@return {start: selectionStart, end: selectionEnd}\n */\n\nfunction getSelection(input) {\n var selection;\n\n if ('selectionStart' in input) {\n // Modern browser with input or textarea.\n selection = {\n start: input.selectionStart,\n end: input.selectionEnd\n };\n } else {\n // Content editable or old IE textarea.\n selection = getOffsets(input);\n }\n\n return selection || {\n start: 0,\n end: 0\n };\n}\n/**\n * @setSelection: Sets the selection bounds of a textarea or input and focuses\n * the input.\n * -@input Set selection bounds of this input or textarea\n * -@offsets Object of same form that is returned from get*\n */\n\nfunction setSelection(input, offsets) {\n var start = offsets.start,\n end = offsets.end;\n\n if (end === undefined) {\n end = start;\n }\n\n if ('selectionStart' in input) {\n input.selectionStart = start;\n input.selectionEnd = Math.min(end, input.value.length);\n } else {\n setOffsets(input, offsets);\n }\n}\n\nvar validateDOMNesting = function () {};\n\nvar updatedAncestorInfo = function () {};\n\n{\n // This validation code was written based on the HTML5 parsing spec:\n // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope\n //\n // Note: this does not catch all invalid nesting, nor does it try to (as it's\n // not clear what practical benefit doing so provides); instead, we warn only\n // for cases where the parser will give a parse tree differing from what React\n // intended. For example, <b><div></div></b> is invalid but we don't warn\n // because it still parses correctly; we do warn for other cases like nested\n // <p> tags where the beginning of the second element implicitly closes the\n // first, causing a confusing mess.\n // https://html.spec.whatwg.org/multipage/syntax.html#special\n var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope\n\n var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template', // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point\n // TODO: Distinguish by namespace here -- for <title>, including it here\n // errs on the side of fewer warnings\n 'foreignObject', 'desc', 'title']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope\n\n var buttonScopeTags = inScopeTags.concat(['button']); // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags\n\n var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];\n var emptyAncestorInfo = {\n current: null,\n formTag: null,\n aTagInScope: null,\n buttonTagInScope: null,\n nobrTagInScope: null,\n pTagInButtonScope: null,\n listItemTagAutoclosing: null,\n dlItemTagAutoclosing: null\n };\n\n updatedAncestorInfo = function (oldInfo, tag) {\n var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);\n\n var info = {\n tag: tag\n };\n\n if (inScopeTags.indexOf(tag) !== -1) {\n ancestorInfo.aTagInScope = null;\n ancestorInfo.buttonTagInScope = null;\n ancestorInfo.nobrTagInScope = null;\n }\n\n if (buttonScopeTags.indexOf(tag) !== -1) {\n ancestorInfo.pTagInButtonScope = null;\n } // See rules for 'li', 'dd', 'dt' start tags in\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody\n\n\n if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {\n ancestorInfo.listItemTagAutoclosing = null;\n ancestorInfo.dlItemTagAutoclosing = null;\n }\n\n ancestorInfo.current = info;\n\n if (tag === 'form') {\n ancestorInfo.formTag = info;\n }\n\n if (tag === 'a') {\n ancestorInfo.aTagInScope = info;\n }\n\n if (tag === 'button') {\n ancestorInfo.buttonTagInScope = info;\n }\n\n if (tag === 'nobr') {\n ancestorInfo.nobrTagInScope = info;\n }\n\n if (tag === 'p') {\n ancestorInfo.pTagInButtonScope = info;\n }\n\n if (tag === 'li') {\n ancestorInfo.listItemTagAutoclosing = info;\n }\n\n if (tag === 'dd' || tag === 'dt') {\n ancestorInfo.dlItemTagAutoclosing = info;\n }\n\n return ancestorInfo;\n };\n /**\n * Returns whether\n */\n\n\n var isTagValidWithParent = function (tag, parentTag) {\n // First, let's check if we're in an unusual parsing mode...\n switch (parentTag) {\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect\n case 'select':\n return tag === 'option' || tag === 'optgroup' || tag === '#text';\n\n case 'optgroup':\n return tag === 'option' || tag === '#text';\n // Strictly speaking, seeing an <option> doesn't mean we're in a <select>\n // but\n\n case 'option':\n return tag === '#text';\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption\n // No special behavior since these rules fall back to \"in body\" mode for\n // all except special table nodes which cause bad parsing behavior anyway.\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr\n\n case 'tr':\n return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody\n\n case 'tbody':\n case 'thead':\n case 'tfoot':\n return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup\n\n case 'colgroup':\n return tag === 'col' || tag === 'template';\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable\n\n case 'table':\n return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead\n\n case 'head':\n return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';\n // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element\n\n case 'html':\n return tag === 'head' || tag === 'body' || tag === 'frameset';\n\n case 'frameset':\n return tag === 'frame';\n\n case '#document':\n return tag === 'html';\n } // Probably in the \"in body\" parsing mode, so we outlaw only tag combos\n // where the parsing rules cause implicit opens or closes to be added.\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody\n\n\n switch (tag) {\n case 'h1':\n case 'h2':\n case 'h3':\n case 'h4':\n case 'h5':\n case 'h6':\n return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';\n\n case 'rp':\n case 'rt':\n return impliedEndTags.indexOf(parentTag) === -1;\n\n case 'body':\n case 'caption':\n case 'col':\n case 'colgroup':\n case 'frameset':\n case 'frame':\n case 'head':\n case 'html':\n case 'tbody':\n case 'td':\n case 'tfoot':\n case 'th':\n case 'thead':\n case 'tr':\n // These tags are only valid with a few parents that have special child\n // parsing rules -- if we're down here, then none of those matched and\n // so we allow it only if we don't know what the parent is, as all other\n // cases are invalid.\n return parentTag == null;\n }\n\n return true;\n };\n /**\n * Returns whether\n */\n\n\n var findInvalidAncestorForTag = function (tag, ancestorInfo) {\n switch (tag) {\n case 'address':\n case 'article':\n case 'aside':\n case 'blockquote':\n case 'center':\n case 'details':\n case 'dialog':\n case 'dir':\n case 'div':\n case 'dl':\n case 'fieldset':\n case 'figcaption':\n case 'figure':\n case 'footer':\n case 'header':\n case 'hgroup':\n case 'main':\n case 'menu':\n case 'nav':\n case 'ol':\n case 'p':\n case 'section':\n case 'summary':\n case 'ul':\n case 'pre':\n case 'listing':\n case 'table':\n case 'hr':\n case 'xmp':\n case 'h1':\n case 'h2':\n case 'h3':\n case 'h4':\n case 'h5':\n case 'h6':\n return ancestorInfo.pTagInButtonScope;\n\n case 'form':\n return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;\n\n case 'li':\n return ancestorInfo.listItemTagAutoclosing;\n\n case 'dd':\n case 'dt':\n return ancestorInfo.dlItemTagAutoclosing;\n\n case 'button':\n return ancestorInfo.buttonTagInScope;\n\n case 'a':\n // Spec says something about storing a list of markers, but it sounds\n // equivalent to this check.\n return ancestorInfo.aTagInScope;\n\n case 'nobr':\n return ancestorInfo.nobrTagInScope;\n }\n\n return null;\n };\n\n var didWarn$1 = {};\n\n validateDOMNesting = function (childTag, childText, ancestorInfo) {\n ancestorInfo = ancestorInfo || emptyAncestorInfo;\n var parentInfo = ancestorInfo.current;\n var parentTag = parentInfo && parentInfo.tag;\n\n if (childText != null) {\n if (childTag != null) {\n error('validateDOMNesting: when childText is passed, childTag should be null');\n }\n\n childTag = '#text';\n }\n\n var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;\n var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);\n var invalidParentOrAncestor = invalidParent || invalidAncestor;\n\n if (!invalidParentOrAncestor) {\n return;\n }\n\n var ancestorTag = invalidParentOrAncestor.tag;\n var addendum = getCurrentFiberStackInDev();\n var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + addendum;\n\n if (didWarn$1[warnKey]) {\n return;\n }\n\n didWarn$1[warnKey] = true;\n var tagDisplayName = childTag;\n var whitespaceInfo = '';\n\n if (childTag === '#text') {\n if (/\\S/.test(childText)) {\n tagDisplayName = 'Text nodes';\n } else {\n tagDisplayName = 'Whitespace text nodes';\n whitespaceInfo = \" Make sure you don't have any extra whitespace between tags on \" + 'each line of your source code.';\n }\n } else {\n tagDisplayName = '<' + childTag + '>';\n }\n\n if (invalidParent) {\n var info = '';\n\n if (ancestorTag === 'table' && childTag === 'tr') {\n info += ' Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by ' + 'the browser.';\n }\n\n error('validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info);\n } else {\n error('validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.', tagDisplayName, ancestorTag);\n }\n };\n}\n\nvar SUPPRESS_HYDRATION_WARNING$1;\n\n{\n SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning';\n}\n\nvar SUSPENSE_START_DATA = '$';\nvar SUSPENSE_END_DATA = '/$';\nvar SUSPENSE_PENDING_START_DATA = '$?';\nvar SUSPENSE_FALLBACK_START_DATA = '$!';\nvar STYLE$1 = 'style';\nvar eventsEnabled = null;\nvar selectionInformation = null;\n\nfunction shouldAutoFocusHostComponent(type, props) {\n switch (type) {\n case 'button':\n case 'input':\n case 'select':\n case 'textarea':\n return !!props.autoFocus;\n }\n\n return false;\n}\nfunction getRootHostContext(rootContainerInstance) {\n var type;\n var namespace;\n var nodeType = rootContainerInstance.nodeType;\n\n switch (nodeType) {\n case DOCUMENT_NODE:\n case DOCUMENT_FRAGMENT_NODE:\n {\n type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment';\n var root = rootContainerInstance.documentElement;\n namespace = root ? root.namespaceURI : getChildNamespace(null, '');\n break;\n }\n\n default:\n {\n var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;\n var ownNamespace = container.namespaceURI || null;\n type = container.tagName;\n namespace = getChildNamespace(ownNamespace, type);\n break;\n }\n }\n\n {\n var validatedTag = type.toLowerCase();\n var ancestorInfo = updatedAncestorInfo(null, validatedTag);\n return {\n namespace: namespace,\n ancestorInfo: ancestorInfo\n };\n }\n}\nfunction getChildHostContext(parentHostContext, type, rootContainerInstance) {\n {\n var parentHostContextDev = parentHostContext;\n var namespace = getChildNamespace(parentHostContextDev.namespace, type);\n var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);\n return {\n namespace: namespace,\n ancestorInfo: ancestorInfo\n };\n }\n}\nfunction getPublicInstance(instance) {\n return instance;\n}\nfunction prepareForCommit(containerInfo) {\n eventsEnabled = isEnabled();\n selectionInformation = getSelectionInformation();\n setEnabled(false);\n}\nfunction resetAfterCommit(containerInfo) {\n restoreSelection(selectionInformation);\n setEnabled(eventsEnabled);\n eventsEnabled = null;\n\n selectionInformation = null;\n}\nfunction createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {\n var parentNamespace;\n\n {\n // TODO: take namespace into account when validating.\n var hostContextDev = hostContext;\n validateDOMNesting(type, null, hostContextDev.ancestorInfo);\n\n if (typeof props.children === 'string' || typeof props.children === 'number') {\n var string = '' + props.children;\n var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);\n validateDOMNesting(null, string, ownAncestorInfo);\n }\n\n parentNamespace = hostContextDev.namespace;\n }\n\n var domElement = createElement(type, props, rootContainerInstance, parentNamespace);\n precacheFiberNode(internalInstanceHandle, domElement);\n updateFiberProps(domElement, props);\n return domElement;\n}\nfunction appendInitialChild(parentInstance, child) {\n parentInstance.appendChild(child);\n}\nfunction finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {\n setInitialProperties(domElement, type, props, rootContainerInstance);\n return shouldAutoFocusHostComponent(type, props);\n}\nfunction prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {\n {\n var hostContextDev = hostContext;\n\n if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {\n var string = '' + newProps.children;\n var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);\n validateDOMNesting(null, string, ownAncestorInfo);\n }\n }\n\n return diffProperties(domElement, type, oldProps, newProps, rootContainerInstance);\n}\nfunction shouldSetTextContent(type, props) {\n return type === 'textarea' || type === 'option' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;\n}\nfunction shouldDeprioritizeSubtree(type, props) {\n return !!props.hidden;\n}\nfunction createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {\n {\n var hostContextDev = hostContext;\n validateDOMNesting(null, text, hostContextDev.ancestorInfo);\n }\n\n var textNode = createTextNode(text, rootContainerInstance);\n precacheFiberNode(internalInstanceHandle, textNode);\n return textNode;\n}\n// if a component just imports ReactDOM (e.g. for findDOMNode).\n// Some environments might not have setTimeout or clearTimeout.\n\nvar scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined;\nvar cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined;\nvar noTimeout = -1; // -------------------\nfunction commitMount(domElement, type, newProps, internalInstanceHandle) {\n // Despite the naming that might imply otherwise, this method only\n // fires if there is an `Update` effect scheduled during mounting.\n // This happens if `finalizeInitialChildren` returns `true` (which it\n // does to implement the `autoFocus` attribute on the client). But\n // there are also other cases when this might happen (such as patching\n // up text content during hydration mismatch). So we'll check this again.\n if (shouldAutoFocusHostComponent(type, newProps)) {\n domElement.focus();\n }\n}\nfunction commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {\n // Update the props handle so that we know which props are the ones with\n // with current event handlers.\n updateFiberProps(domElement, newProps); // Apply the diff to the DOM node.\n\n updateProperties(domElement, updatePayload, type, oldProps, newProps);\n}\nfunction resetTextContent(domElement) {\n setTextContent(domElement, '');\n}\nfunction commitTextUpdate(textInstance, oldText, newText) {\n textInstance.nodeValue = newText;\n}\nfunction appendChild(parentInstance, child) {\n parentInstance.appendChild(child);\n}\nfunction appendChildToContainer(container, child) {\n var parentNode;\n\n if (container.nodeType === COMMENT_NODE) {\n parentNode = container.parentNode;\n parentNode.insertBefore(child, container);\n } else {\n parentNode = container;\n parentNode.appendChild(child);\n } // This container might be used for a portal.\n // If something inside a portal is clicked, that click should bubble\n // through the React tree. However, on Mobile Safari the click would\n // never bubble through the *DOM* tree unless an ancestor with onclick\n // event exists. So we wouldn't see it and dispatch it.\n // This is why we ensure that non React root containers have inline onclick\n // defined.\n // https://github.com/facebook/react/issues/11918\n\n\n var reactRootContainer = container._reactRootContainer;\n\n if ((reactRootContainer === null || reactRootContainer === undefined) && parentNode.onclick === null) {\n // TODO: This cast may not be sound for SVG, MathML or custom elements.\n trapClickOnNonInteractiveElement(parentNode);\n }\n}\nfunction insertBefore(parentInstance, child, beforeChild) {\n parentInstance.insertBefore(child, beforeChild);\n}\nfunction insertInContainerBefore(container, child, beforeChild) {\n if (container.nodeType === COMMENT_NODE) {\n container.parentNode.insertBefore(child, beforeChild);\n } else {\n container.insertBefore(child, beforeChild);\n }\n}\nfunction removeChild(parentInstance, child) {\n parentInstance.removeChild(child);\n}\nfunction removeChildFromContainer(container, child) {\n if (container.nodeType === COMMENT_NODE) {\n container.parentNode.removeChild(child);\n } else {\n container.removeChild(child);\n }\n}\n\nfunction hideInstance(instance) {\n // pass host context to this method?\n\n\n instance = instance;\n var style = instance.style;\n\n if (typeof style.setProperty === 'function') {\n style.setProperty('display', 'none', 'important');\n } else {\n style.display = 'none';\n }\n}\nfunction hideTextInstance(textInstance) {\n textInstance.nodeValue = '';\n}\nfunction unhideInstance(instance, props) {\n instance = instance;\n var styleProp = props[STYLE$1];\n var display = styleProp !== undefined && styleProp !== null && styleProp.hasOwnProperty('display') ? styleProp.display : null;\n instance.style.display = dangerousStyleValue('display', display);\n}\nfunction unhideTextInstance(textInstance, text) {\n textInstance.nodeValue = text;\n} // -------------------\nfunction canHydrateInstance(instance, type, props) {\n if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {\n return null;\n } // This has now been refined to an element node.\n\n\n return instance;\n}\nfunction canHydrateTextInstance(instance, text) {\n if (text === '' || instance.nodeType !== TEXT_NODE) {\n // Empty strings are not parsed by HTML so there won't be a correct match here.\n return null;\n } // This has now been refined to a text node.\n\n\n return instance;\n}\nfunction isSuspenseInstancePending(instance) {\n return instance.data === SUSPENSE_PENDING_START_DATA;\n}\nfunction isSuspenseInstanceFallback(instance) {\n return instance.data === SUSPENSE_FALLBACK_START_DATA;\n}\n\nfunction getNextHydratable(node) {\n // Skip non-hydratable nodes.\n for (; node != null; node = node.nextSibling) {\n var nodeType = node.nodeType;\n\n if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {\n break;\n }\n }\n\n return node;\n}\n\nfunction getNextHydratableSibling(instance) {\n return getNextHydratable(instance.nextSibling);\n}\nfunction getFirstHydratableChild(parentInstance) {\n return getNextHydratable(parentInstance.firstChild);\n}\nfunction hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {\n precacheFiberNode(internalInstanceHandle, instance); // TODO: Possibly defer this until the commit phase where all the events\n // get attached.\n\n updateFiberProps(instance, props);\n var parentNamespace;\n\n {\n var hostContextDev = hostContext;\n parentNamespace = hostContextDev.namespace;\n }\n\n return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance);\n}\nfunction hydrateTextInstance(textInstance, text, internalInstanceHandle) {\n precacheFiberNode(internalInstanceHandle, textInstance);\n return diffHydratedText(textInstance, text);\n}\nfunction getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {\n var node = suspenseInstance.nextSibling; // Skip past all nodes within this suspense boundary.\n // There might be nested nodes so we need to keep track of how\n // deep we are and only break out when we're back on top.\n\n var depth = 0;\n\n while (node) {\n if (node.nodeType === COMMENT_NODE) {\n var data = node.data;\n\n if (data === SUSPENSE_END_DATA) {\n if (depth === 0) {\n return getNextHydratableSibling(node);\n } else {\n depth--;\n }\n } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {\n depth++;\n }\n }\n\n node = node.nextSibling;\n } // TODO: Warn, we didn't find the end comment boundary.\n\n\n return null;\n} // Returns the SuspenseInstance if this node is a direct child of a\n// SuspenseInstance. I.e. if its previous sibling is a Comment with\n// SUSPENSE_x_START_DATA. Otherwise, null.\n\nfunction getParentSuspenseInstance(targetInstance) {\n var node = targetInstance.previousSibling; // Skip past all nodes within this suspense boundary.\n // There might be nested nodes so we need to keep track of how\n // deep we are and only break out when we're back on top.\n\n var depth = 0;\n\n while (node) {\n if (node.nodeType === COMMENT_NODE) {\n var data = node.data;\n\n if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {\n if (depth === 0) {\n return node;\n } else {\n depth--;\n }\n } else if (data === SUSPENSE_END_DATA) {\n depth++;\n }\n }\n\n node = node.previousSibling;\n }\n\n return null;\n}\nfunction commitHydratedContainer(container) {\n // Retry if any event replaying was blocked on this.\n retryIfBlockedOn(container);\n}\nfunction commitHydratedSuspenseInstance(suspenseInstance) {\n // Retry if any event replaying was blocked on this.\n retryIfBlockedOn(suspenseInstance);\n}\nfunction didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {\n {\n warnForUnmatchedText(textInstance, text);\n }\n}\nfunction didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {\n if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n warnForUnmatchedText(textInstance, text);\n }\n}\nfunction didNotHydrateContainerInstance(parentContainer, instance) {\n {\n if (instance.nodeType === ELEMENT_NODE) {\n warnForDeletedHydratableElement(parentContainer, instance);\n } else if (instance.nodeType === COMMENT_NODE) ; else {\n warnForDeletedHydratableText(parentContainer, instance);\n }\n }\n}\nfunction didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {\n if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n if (instance.nodeType === ELEMENT_NODE) {\n warnForDeletedHydratableElement(parentInstance, instance);\n } else if (instance.nodeType === COMMENT_NODE) ; else {\n warnForDeletedHydratableText(parentInstance, instance);\n }\n }\n}\nfunction didNotFindHydratableContainerInstance(parentContainer, type, props) {\n {\n warnForInsertedHydratedElement(parentContainer, type);\n }\n}\nfunction didNotFindHydratableContainerTextInstance(parentContainer, text) {\n {\n warnForInsertedHydratedText(parentContainer, text);\n }\n}\nfunction didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) {\n if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n warnForInsertedHydratedElement(parentInstance, type);\n }\n}\nfunction didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {\n if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n warnForInsertedHydratedText(parentInstance, text);\n }\n}\nfunction didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) {\n if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) ;\n}\n\nvar randomKey = Math.random().toString(36).slice(2);\nvar internalInstanceKey = '__reactInternalInstance$' + randomKey;\nvar internalEventHandlersKey = '__reactEventHandlers$' + randomKey;\nvar internalContainerInstanceKey = '__reactContainere$' + randomKey;\nfunction precacheFiberNode(hostInst, node) {\n node[internalInstanceKey] = hostInst;\n}\nfunction markContainerAsRoot(hostRoot, node) {\n node[internalContainerInstanceKey] = hostRoot;\n}\nfunction unmarkContainerAsRoot(node) {\n node[internalContainerInstanceKey] = null;\n}\nfunction isContainerMarkedAsRoot(node) {\n return !!node[internalContainerInstanceKey];\n} // Given a DOM node, return the closest HostComponent or HostText fiber ancestor.\n// If the target node is part of a hydrated or not yet rendered subtree, then\n// this may also return a SuspenseComponent or HostRoot to indicate that.\n// Conceptually the HostRoot fiber is a child of the Container node. So if you\n// pass the Container node as the targetNode, you will not actually get the\n// HostRoot back. To get to the HostRoot, you need to pass a child of it.\n// The same thing applies to Suspense boundaries.\n\nfunction getClosestInstanceFromNode(targetNode) {\n var targetInst = targetNode[internalInstanceKey];\n\n if (targetInst) {\n // Don't return HostRoot or SuspenseComponent here.\n return targetInst;\n } // If the direct event target isn't a React owned DOM node, we need to look\n // to see if one of its parents is a React owned DOM node.\n\n\n var parentNode = targetNode.parentNode;\n\n while (parentNode) {\n // We'll check if this is a container root that could include\n // React nodes in the future. We need to check this first because\n // if we're a child of a dehydrated container, we need to first\n // find that inner container before moving on to finding the parent\n // instance. Note that we don't check this field on the targetNode\n // itself because the fibers are conceptually between the container\n // node and the first child. It isn't surrounding the container node.\n // If it's not a container, we check if it's an instance.\n targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];\n\n if (targetInst) {\n // Since this wasn't the direct target of the event, we might have\n // stepped past dehydrated DOM nodes to get here. However they could\n // also have been non-React nodes. We need to answer which one.\n // If we the instance doesn't have any children, then there can't be\n // a nested suspense boundary within it. So we can use this as a fast\n // bailout. Most of the time, when people add non-React children to\n // the tree, it is using a ref to a child-less DOM node.\n // Normally we'd only need to check one of the fibers because if it\n // has ever gone from having children to deleting them or vice versa\n // it would have deleted the dehydrated boundary nested inside already.\n // However, since the HostRoot starts out with an alternate it might\n // have one on the alternate so we need to check in case this was a\n // root.\n var alternate = targetInst.alternate;\n\n if (targetInst.child !== null || alternate !== null && alternate.child !== null) {\n // Next we need to figure out if the node that skipped past is\n // nested within a dehydrated boundary and if so, which one.\n var suspenseInstance = getParentSuspenseInstance(targetNode);\n\n while (suspenseInstance !== null) {\n // We found a suspense instance. That means that we haven't\n // hydrated it yet. Even though we leave the comments in the\n // DOM after hydrating, and there are boundaries in the DOM\n // that could already be hydrated, we wouldn't have found them\n // through this pass since if the target is hydrated it would\n // have had an internalInstanceKey on it.\n // Let's get the fiber associated with the SuspenseComponent\n // as the deepest instance.\n var targetSuspenseInst = suspenseInstance[internalInstanceKey];\n\n if (targetSuspenseInst) {\n return targetSuspenseInst;\n } // If we don't find a Fiber on the comment, it might be because\n // we haven't gotten to hydrate it yet. There might still be a\n // parent boundary that hasn't above this one so we need to find\n // the outer most that is known.\n\n\n suspenseInstance = getParentSuspenseInstance(suspenseInstance); // If we don't find one, then that should mean that the parent\n // host component also hasn't hydrated yet. We can return it\n // below since it will bail out on the isMounted check later.\n }\n }\n\n return targetInst;\n }\n\n targetNode = parentNode;\n parentNode = targetNode.parentNode;\n }\n\n return null;\n}\n/**\n * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent\n * instance, or null if the node was not rendered by this React.\n */\n\nfunction getInstanceFromNode$1(node) {\n var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];\n\n if (inst) {\n if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {\n return inst;\n } else {\n return null;\n }\n }\n\n return null;\n}\n/**\n * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding\n * DOM node.\n */\n\nfunction getNodeFromInstance$1(inst) {\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber this, is just the state node right now. We assume it will be\n // a host component or host text.\n return inst.stateNode;\n } // Without this first invariant, passing a non-DOM-component triggers the next\n // invariant for a missing parent, which is super confusing.\n\n\n {\n {\n throw Error( \"getNodeFromInstance: Invalid argument.\" );\n }\n }\n}\nfunction getFiberCurrentPropsFromNode$1(node) {\n return node[internalEventHandlersKey] || null;\n}\nfunction updateFiberProps(node, props) {\n node[internalEventHandlersKey] = props;\n}\n\nfunction getParent(inst) {\n do {\n inst = inst.return; // TODO: If this is a HostRoot we might want to bail out.\n // That is depending on if we want nested subtrees (layers) to bubble\n // events to their parent. We could also go through parentNode on the\n // host node but that wouldn't work for React Native and doesn't let us\n // do the portal feature.\n } while (inst && inst.tag !== HostComponent);\n\n if (inst) {\n return inst;\n }\n\n return null;\n}\n/**\n * Return the lowest common ancestor of A and B, or null if they are in\n * different trees.\n */\n\n\nfunction getLowestCommonAncestor(instA, instB) {\n var depthA = 0;\n\n for (var tempA = instA; tempA; tempA = getParent(tempA)) {\n depthA++;\n }\n\n var depthB = 0;\n\n for (var tempB = instB; tempB; tempB = getParent(tempB)) {\n depthB++;\n } // If A is deeper, crawl up.\n\n\n while (depthA - depthB > 0) {\n instA = getParent(instA);\n depthA--;\n } // If B is deeper, crawl up.\n\n\n while (depthB - depthA > 0) {\n instB = getParent(instB);\n depthB--;\n } // Walk in lockstep until we find a match.\n\n\n var depth = depthA;\n\n while (depth--) {\n if (instA === instB || instA === instB.alternate) {\n return instA;\n }\n\n instA = getParent(instA);\n instB = getParent(instB);\n }\n\n return null;\n}\n/**\n * Simulates the traversal of a two-phase, capture/bubble event dispatch.\n */\n\nfunction traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}\n/**\n * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that\n * should would receive a `mouseEnter` or `mouseLeave` event.\n *\n * Does not invoke the callback on the nearest common ancestor because nothing\n * \"entered\" or \"left\" that element.\n */\n\nfunction traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n\n while (true) {\n if (!from) {\n break;\n }\n\n if (from === common) {\n break;\n }\n\n var alternate = from.alternate;\n\n if (alternate !== null && alternate === common) {\n break;\n }\n\n pathFrom.push(from);\n from = getParent(from);\n }\n\n var pathTo = [];\n\n while (true) {\n if (!to) {\n break;\n }\n\n if (to === common) {\n break;\n }\n\n var _alternate = to.alternate;\n\n if (_alternate !== null && _alternate === common) {\n break;\n }\n\n pathTo.push(to);\n to = getParent(to);\n }\n\n for (var i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], 'bubbled', argFrom);\n }\n\n for (var _i = pathTo.length; _i-- > 0;) {\n fn(pathTo[_i], 'captured', argTo);\n }\n}\n\nfunction isInteractive(tag) {\n return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';\n}\n\nfunction shouldPreventMouseEvent(name, type, props) {\n switch (name) {\n case 'onClick':\n case 'onClickCapture':\n case 'onDoubleClick':\n case 'onDoubleClickCapture':\n case 'onMouseDown':\n case 'onMouseDownCapture':\n case 'onMouseMove':\n case 'onMouseMoveCapture':\n case 'onMouseUp':\n case 'onMouseUpCapture':\n case 'onMouseEnter':\n return !!(props.disabled && isInteractive(type));\n\n default:\n return false;\n }\n}\n/**\n * @param {object} inst The instance, which is the source of events.\n * @param {string} registrationName Name of listener (e.g. `onClick`).\n * @return {?function} The stored callback.\n */\n\n\nfunction getListener(inst, registrationName) {\n var listener; // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not\n // live here; needs to be moved to a better place soon\n\n var stateNode = inst.stateNode;\n\n if (!stateNode) {\n // Work in progress (ex: onload events in incremental mode).\n return null;\n }\n\n var props = getFiberCurrentPropsFromNode(stateNode);\n\n if (!props) {\n // Work in progress.\n return null;\n }\n\n listener = props[registrationName];\n\n if (shouldPreventMouseEvent(registrationName, inst.type, props)) {\n return null;\n }\n\n if (!(!listener || typeof listener === 'function')) {\n {\n throw Error( \"Expected `\" + registrationName + \"` listener to be a function, instead got a value of `\" + typeof listener + \"` type.\" );\n }\n }\n\n return listener;\n}\n\n/**\n * Some event types have a notion of different registration names for different\n * \"phases\" of propagation. This finds listeners by a given phase.\n */\nfunction listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}\n/**\n * A small set of propagation patterns, each of which will accept a small amount\n * of information, and generate a set of \"dispatch ready event objects\" - which\n * are sets of events that have already been annotated with a set of dispatched\n * listener functions/ids. The API is designed this way to discourage these\n * propagation strategies from actually executing the dispatches, since we\n * always want to collect the entire set of dispatches before executing even a\n * single one.\n */\n\n/**\n * Tags a `SyntheticEvent` with dispatched listeners. Creating this function\n * here, allows us to not have to bind or create functions for each event.\n * Mutating the event's members allows us to not have to create a wrapping\n * \"dispatch\" object that pairs the event with the listener.\n */\n\n\nfunction accumulateDirectionalDispatches(inst, phase, event) {\n {\n if (!inst) {\n error('Dispatching inst must not be null');\n }\n }\n\n var listener = listenerAtPhase(inst, event, phase);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n}\n/**\n * Collect dispatches (must be entirely collected before dispatching - see unit\n * tests). Lazily allocate the array to conserve memory. We must loop through\n * each event and perform the traversal for each one. We cannot perform a\n * single traversal for the entire collection of events because each event may\n * have a different target.\n */\n\n\nfunction accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n}\n/**\n * Accumulates without regard to direction, does not look for phased\n * registration names. Same as `accumulateDirectDispatchesSingle` but without\n * requiring that the `dispatchMarker` be the same as the dispatched ID.\n */\n\n\nfunction accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}\n/**\n * Accumulates dispatches on an `SyntheticEvent`, but only for the\n * `dispatchMarker`.\n * @param {SyntheticEvent} event\n */\n\n\nfunction accumulateDirectDispatchesSingle(event) {\n if (event && event.dispatchConfig.registrationName) {\n accumulateDispatches(event._targetInst, null, event);\n }\n}\n\nfunction accumulateTwoPhaseDispatches(events) {\n forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);\n}\nfunction accumulateEnterLeaveDispatches(leave, enter, from, to) {\n traverseEnterLeave(from, to, accumulateDispatches, leave, enter);\n}\nfunction accumulateDirectDispatches(events) {\n forEachAccumulated(events, accumulateDirectDispatchesSingle);\n}\n\n/**\n * These variables store information about text content of a target node,\n * allowing comparison of content before and after a given event.\n *\n * Identify the node where selection currently begins, then observe\n * both its text content and its current position in the DOM. Since the\n * browser may natively replace the target node during composition, we can\n * use its position to find its replacement.\n *\n *\n */\nvar root = null;\nvar startText = null;\nvar fallbackText = null;\nfunction initialize(nativeEventTarget) {\n root = nativeEventTarget;\n startText = getText();\n return true;\n}\nfunction reset() {\n root = null;\n startText = null;\n fallbackText = null;\n}\nfunction getData() {\n if (fallbackText) {\n return fallbackText;\n }\n\n var start;\n var startValue = startText;\n var startLength = startValue.length;\n var end;\n var endValue = getText();\n var endLength = endValue.length;\n\n for (start = 0; start < startLength; start++) {\n if (startValue[start] !== endValue[start]) {\n break;\n }\n }\n\n var minEnd = startLength - start;\n\n for (end = 1; end <= minEnd; end++) {\n if (startValue[startLength - end] !== endValue[endLength - end]) {\n break;\n }\n }\n\n var sliceTail = end > 1 ? 1 - end : undefined;\n fallbackText = endValue.slice(start, sliceTail);\n return fallbackText;\n}\nfunction getText() {\n if ('value' in root) {\n return root.value;\n }\n\n return root.textContent;\n}\n\nvar EVENT_POOL_SIZE = 10;\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar EventInterface = {\n type: null,\n target: null,\n // currentTarget is set when dispatching; no use in copying it here\n currentTarget: function () {\n return null;\n },\n eventPhase: null,\n bubbles: null,\n cancelable: null,\n timeStamp: function (event) {\n return event.timeStamp || Date.now();\n },\n defaultPrevented: null,\n isTrusted: null\n};\n\nfunction functionThatReturnsTrue() {\n return true;\n}\n\nfunction functionThatReturnsFalse() {\n return false;\n}\n/**\n * Synthetic events are dispatched by event plugins, typically in response to a\n * top-level event delegation handler.\n *\n * These systems should generally use pooling to reduce the frequency of garbage\n * collection. The system should check `isPersistent` to determine whether the\n * event should be released into the pool after being dispatched. Users that\n * need a persisted event should invoke `persist`.\n *\n * Synthetic events (and subclasses) implement the DOM Level 3 Events API by\n * normalizing browser quirks. Subclasses do not necessarily have to implement a\n * DOM interface; custom application-specific events can also subclass this.\n *\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {*} targetInst Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @param {DOMEventTarget} nativeEventTarget Target node.\n */\n\n\nfunction SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {\n {\n // these have a getter/setter for warnings\n delete this.nativeEvent;\n delete this.preventDefault;\n delete this.stopPropagation;\n delete this.isDefaultPrevented;\n delete this.isPropagationStopped;\n }\n\n this.dispatchConfig = dispatchConfig;\n this._targetInst = targetInst;\n this.nativeEvent = nativeEvent;\n var Interface = this.constructor.Interface;\n\n for (var propName in Interface) {\n if (!Interface.hasOwnProperty(propName)) {\n continue;\n }\n\n {\n delete this[propName]; // this has a getter/setter for warnings\n }\n\n var normalize = Interface[propName];\n\n if (normalize) {\n this[propName] = normalize(nativeEvent);\n } else {\n if (propName === 'target') {\n this.target = nativeEventTarget;\n } else {\n this[propName] = nativeEvent[propName];\n }\n }\n }\n\n var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;\n\n if (defaultPrevented) {\n this.isDefaultPrevented = functionThatReturnsTrue;\n } else {\n this.isDefaultPrevented = functionThatReturnsFalse;\n }\n\n this.isPropagationStopped = functionThatReturnsFalse;\n return this;\n}\n\n_assign(SyntheticEvent.prototype, {\n preventDefault: function () {\n this.defaultPrevented = true;\n var event = this.nativeEvent;\n\n if (!event) {\n return;\n }\n\n if (event.preventDefault) {\n event.preventDefault();\n } else if (typeof event.returnValue !== 'unknown') {\n event.returnValue = false;\n }\n\n this.isDefaultPrevented = functionThatReturnsTrue;\n },\n stopPropagation: function () {\n var event = this.nativeEvent;\n\n if (!event) {\n return;\n }\n\n if (event.stopPropagation) {\n event.stopPropagation();\n } else if (typeof event.cancelBubble !== 'unknown') {\n // The ChangeEventPlugin registers a \"propertychange\" event for\n // IE. This event does not support bubbling or cancelling, and\n // any references to cancelBubble throw \"Member not found\". A\n // typeof check of \"unknown\" circumvents this issue (and is also\n // IE specific).\n event.cancelBubble = true;\n }\n\n this.isPropagationStopped = functionThatReturnsTrue;\n },\n\n /**\n * We release all dispatched `SyntheticEvent`s after each event loop, adding\n * them back into the pool. This allows a way to hold onto a reference that\n * won't be added back into the pool.\n */\n persist: function () {\n this.isPersistent = functionThatReturnsTrue;\n },\n\n /**\n * Checks if this event should be released back into the pool.\n *\n * @return {boolean} True if this should not be released, false otherwise.\n */\n isPersistent: functionThatReturnsFalse,\n\n /**\n * `PooledClass` looks for `destructor` on each instance it releases.\n */\n destructor: function () {\n var Interface = this.constructor.Interface;\n\n for (var propName in Interface) {\n {\n Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));\n }\n }\n\n this.dispatchConfig = null;\n this._targetInst = null;\n this.nativeEvent = null;\n this.isDefaultPrevented = functionThatReturnsFalse;\n this.isPropagationStopped = functionThatReturnsFalse;\n this._dispatchListeners = null;\n this._dispatchInstances = null;\n\n {\n Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));\n Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse));\n Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse));\n Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {}));\n Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {}));\n }\n }\n});\n\nSyntheticEvent.Interface = EventInterface;\n/**\n * Helper to reduce boilerplate when creating subclasses.\n */\n\nSyntheticEvent.extend = function (Interface) {\n var Super = this;\n\n var E = function () {};\n\n E.prototype = Super.prototype;\n var prototype = new E();\n\n function Class() {\n return Super.apply(this, arguments);\n }\n\n _assign(prototype, Class.prototype);\n\n Class.prototype = prototype;\n Class.prototype.constructor = Class;\n Class.Interface = _assign({}, Super.Interface, Interface);\n Class.extend = Super.extend;\n addEventPoolingTo(Class);\n return Class;\n};\n\naddEventPoolingTo(SyntheticEvent);\n/**\n * Helper to nullify syntheticEvent instance properties when destructing\n *\n * @param {String} propName\n * @param {?object} getVal\n * @return {object} defineProperty object\n */\n\nfunction getPooledWarningPropertyDefinition(propName, getVal) {\n var isFunction = typeof getVal === 'function';\n return {\n configurable: true,\n set: set,\n get: get\n };\n\n function set(val) {\n var action = isFunction ? 'setting the method' : 'setting the property';\n warn(action, 'This is effectively a no-op');\n return val;\n }\n\n function get() {\n var action = isFunction ? 'accessing the method' : 'accessing the property';\n var result = isFunction ? 'This is a no-op function' : 'This is set to null';\n warn(action, result);\n return getVal;\n }\n\n function warn(action, result) {\n {\n error(\"This synthetic event is reused for performance reasons. If you're seeing this, \" + \"you're %s `%s` on a released/nullified synthetic event. %s. \" + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result);\n }\n }\n}\n\nfunction getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {\n var EventConstructor = this;\n\n if (EventConstructor.eventPool.length) {\n var instance = EventConstructor.eventPool.pop();\n EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);\n return instance;\n }\n\n return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);\n}\n\nfunction releasePooledEvent(event) {\n var EventConstructor = this;\n\n if (!(event instanceof EventConstructor)) {\n {\n throw Error( \"Trying to release an event instance into a pool of a different type.\" );\n }\n }\n\n event.destructor();\n\n if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {\n EventConstructor.eventPool.push(event);\n }\n}\n\nfunction addEventPoolingTo(EventConstructor) {\n EventConstructor.eventPool = [];\n EventConstructor.getPooled = getPooledEvent;\n EventConstructor.release = releasePooledEvent;\n}\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents\n */\n\nvar SyntheticCompositionEvent = SyntheticEvent.extend({\n data: null\n});\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105\n * /#events-inputevents\n */\n\nvar SyntheticInputEvent = SyntheticEvent.extend({\n data: null\n});\n\nvar END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space\n\nvar START_KEYCODE = 229;\nvar canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window;\nvar documentMode = null;\n\nif (canUseDOM && 'documentMode' in document) {\n documentMode = document.documentMode;\n} // Webkit offers a very useful `textInput` event that can be used to\n// directly represent `beforeInput`. The IE `textinput` event is not as\n// useful, so we don't use it.\n\n\nvar canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode; // In IE9+, we have access to composition events, but the data supplied\n// by the native compositionend event may be incorrect. Japanese ideographic\n// spaces, for instance (\\u3000) are not recorded correctly.\n\nvar useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);\nvar SPACEBAR_CODE = 32;\nvar SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); // Events and their corresponding property names.\n\nvar eventTypes = {\n beforeInput: {\n phasedRegistrationNames: {\n bubbled: 'onBeforeInput',\n captured: 'onBeforeInputCapture'\n },\n dependencies: [TOP_COMPOSITION_END, TOP_KEY_PRESS, TOP_TEXT_INPUT, TOP_PASTE]\n },\n compositionEnd: {\n phasedRegistrationNames: {\n bubbled: 'onCompositionEnd',\n captured: 'onCompositionEndCapture'\n },\n dependencies: [TOP_BLUR, TOP_COMPOSITION_END, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]\n },\n compositionStart: {\n phasedRegistrationNames: {\n bubbled: 'onCompositionStart',\n captured: 'onCompositionStartCapture'\n },\n dependencies: [TOP_BLUR, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]\n },\n compositionUpdate: {\n phasedRegistrationNames: {\n bubbled: 'onCompositionUpdate',\n captured: 'onCompositionUpdateCapture'\n },\n dependencies: [TOP_BLUR, TOP_COMPOSITION_UPDATE, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]\n }\n}; // Track whether we've ever handled a keypress on the space key.\n\nvar hasSpaceKeypress = false;\n/**\n * Return whether a native keypress event is assumed to be a command.\n * This is required because Firefox fires `keypress` events for key commands\n * (cut, copy, select-all, etc.) even though no character is inserted.\n */\n\nfunction isKeypressCommand(nativeEvent) {\n return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey);\n}\n/**\n * Translate native top level events into event types.\n *\n * @param {string} topLevelType\n * @return {object}\n */\n\n\nfunction getCompositionEventType(topLevelType) {\n switch (topLevelType) {\n case TOP_COMPOSITION_START:\n return eventTypes.compositionStart;\n\n case TOP_COMPOSITION_END:\n return eventTypes.compositionEnd;\n\n case TOP_COMPOSITION_UPDATE:\n return eventTypes.compositionUpdate;\n }\n}\n/**\n * Does our fallback best-guess model think this event signifies that\n * composition has begun?\n *\n * @param {string} topLevelType\n * @param {object} nativeEvent\n * @return {boolean}\n */\n\n\nfunction isFallbackCompositionStart(topLevelType, nativeEvent) {\n return topLevelType === TOP_KEY_DOWN && nativeEvent.keyCode === START_KEYCODE;\n}\n/**\n * Does our fallback mode think that this event is the end of composition?\n *\n * @param {string} topLevelType\n * @param {object} nativeEvent\n * @return {boolean}\n */\n\n\nfunction isFallbackCompositionEnd(topLevelType, nativeEvent) {\n switch (topLevelType) {\n case TOP_KEY_UP:\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case TOP_KEY_DOWN:\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case TOP_KEY_PRESS:\n case TOP_MOUSE_DOWN:\n case TOP_BLUR:\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n}\n/**\n * Google Input Tools provides composition data via a CustomEvent,\n * with the `data` property populated in the `detail` object. If this\n * is available on the event object, use it. If not, this is a plain\n * composition event and we have nothing special to extract.\n *\n * @param {object} nativeEvent\n * @return {?string}\n */\n\n\nfunction getDataFromCustomEvent(nativeEvent) {\n var detail = nativeEvent.detail;\n\n if (typeof detail === 'object' && 'data' in detail) {\n return detail.data;\n }\n\n return null;\n}\n/**\n * Check if a composition event was triggered by Korean IME.\n * Our fallback mode does not work well with IE's Korean IME,\n * so just use native composition events when Korean IME is used.\n * Although CompositionEvent.locale property is deprecated,\n * it is available in IE, where our fallback mode is enabled.\n *\n * @param {object} nativeEvent\n * @return {boolean}\n */\n\n\nfunction isUsingKoreanIME(nativeEvent) {\n return nativeEvent.locale === 'ko';\n} // Track the current IME composition status, if any.\n\n\nvar isComposing = false;\n/**\n * @return {?object} A SyntheticCompositionEvent.\n */\n\nfunction extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n var eventType;\n var fallbackData;\n\n if (canUseCompositionEvent) {\n eventType = getCompositionEventType(topLevelType);\n } else if (!isComposing) {\n if (isFallbackCompositionStart(topLevelType, nativeEvent)) {\n eventType = eventTypes.compositionStart;\n }\n } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {\n eventType = eventTypes.compositionEnd;\n }\n\n if (!eventType) {\n return null;\n }\n\n if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {\n // The current composition is stored statically and must not be\n // overwritten while composition continues.\n if (!isComposing && eventType === eventTypes.compositionStart) {\n isComposing = initialize(nativeEventTarget);\n } else if (eventType === eventTypes.compositionEnd) {\n if (isComposing) {\n fallbackData = getData();\n }\n }\n }\n\n var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);\n\n if (fallbackData) {\n // Inject data generated from fallback path into the synthetic event.\n // This matches the property of native CompositionEventInterface.\n event.data = fallbackData;\n } else {\n var customData = getDataFromCustomEvent(nativeEvent);\n\n if (customData !== null) {\n event.data = customData;\n }\n }\n\n accumulateTwoPhaseDispatches(event);\n return event;\n}\n/**\n * @param {TopLevelType} topLevelType Number from `TopLevelType`.\n * @param {object} nativeEvent Native browser event.\n * @return {?string} The string corresponding to this `beforeInput` event.\n */\n\n\nfunction getNativeBeforeInputChars(topLevelType, nativeEvent) {\n switch (topLevelType) {\n case TOP_COMPOSITION_END:\n return getDataFromCustomEvent(nativeEvent);\n\n case TOP_KEY_PRESS:\n /**\n * If native `textInput` events are available, our goal is to make\n * use of them. However, there is a special case: the spacebar key.\n * In Webkit, preventing default on a spacebar `textInput` event\n * cancels character insertion, but it *also* causes the browser\n * to fall back to its default spacebar behavior of scrolling the\n * page.\n *\n * Tracking at:\n * https://code.google.com/p/chromium/issues/detail?id=355103\n *\n * To avoid this issue, use the keypress event as if no `textInput`\n * event is available.\n */\n var which = nativeEvent.which;\n\n if (which !== SPACEBAR_CODE) {\n return null;\n }\n\n hasSpaceKeypress = true;\n return SPACEBAR_CHAR;\n\n case TOP_TEXT_INPUT:\n // Record the characters to be added to the DOM.\n var chars = nativeEvent.data; // If it's a spacebar character, assume that we have already handled\n // it at the keypress level and bail immediately. Android Chrome\n // doesn't give us keycodes, so we need to ignore it.\n\n if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {\n return null;\n }\n\n return chars;\n\n default:\n // For other native event types, do nothing.\n return null;\n }\n}\n/**\n * For browsers that do not provide the `textInput` event, extract the\n * appropriate string to use for SyntheticInputEvent.\n *\n * @param {number} topLevelType Number from `TopLevelEventTypes`.\n * @param {object} nativeEvent Native browser event.\n * @return {?string} The fallback string for this `beforeInput` event.\n */\n\n\nfunction getFallbackBeforeInputChars(topLevelType, nativeEvent) {\n // If we are currently composing (IME) and using a fallback to do so,\n // try to extract the composed characters from the fallback object.\n // If composition event is available, we extract a string only at\n // compositionevent, otherwise extract it at fallback events.\n if (isComposing) {\n if (topLevelType === TOP_COMPOSITION_END || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {\n var chars = getData();\n reset();\n isComposing = false;\n return chars;\n }\n\n return null;\n }\n\n switch (topLevelType) {\n case TOP_PASTE:\n // If a paste event occurs after a keypress, throw out the input\n // chars. Paste events should not lead to BeforeInput events.\n return null;\n\n case TOP_KEY_PRESS:\n /**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n */\n if (!isKeypressCommand(nativeEvent)) {\n // IE fires the `keypress` event when a user types an emoji via\n // Touch keyboard of Windows. In such a case, the `char` property\n // holds an emoji character like `\\uD83D\\uDE0A`. Because its length\n // is 2, the property `which` does not represent an emoji correctly.\n // In such a case, we directly return the `char` property instead of\n // using `which`.\n if (nativeEvent.char && nativeEvent.char.length > 1) {\n return nativeEvent.char;\n } else if (nativeEvent.which) {\n return String.fromCharCode(nativeEvent.which);\n }\n }\n\n return null;\n\n case TOP_COMPOSITION_END:\n return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;\n\n default:\n return null;\n }\n}\n/**\n * Extract a SyntheticInputEvent for `beforeInput`, based on either native\n * `textInput` or fallback behavior.\n *\n * @return {?object} A SyntheticInputEvent.\n */\n\n\nfunction extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n var chars;\n\n if (canUseTextInputEvent) {\n chars = getNativeBeforeInputChars(topLevelType, nativeEvent);\n } else {\n chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);\n } // If no characters are being inserted, no BeforeInput event should\n // be fired.\n\n\n if (!chars) {\n return null;\n }\n\n var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);\n event.data = chars;\n accumulateTwoPhaseDispatches(event);\n return event;\n}\n/**\n * Create an `onBeforeInput` event to match\n * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.\n *\n * This event plugin is based on the native `textInput` event\n * available in Chrome, Safari, Opera, and IE. This event fires after\n * `onKeyPress` and `onCompositionEnd`, but before `onInput`.\n *\n * `beforeInput` is spec'd but not implemented in any browsers, and\n * the `input` event does not provide any useful information about what has\n * actually been added, contrary to the spec. Thus, `textInput` is the best\n * available event to identify the characters that have actually been inserted\n * into the target node.\n *\n * This plugin is also responsible for emitting `composition` events, thus\n * allowing us to share composition fallback code for both `beforeInput` and\n * `composition` event types.\n */\n\n\nvar BeforeInputEventPlugin = {\n eventTypes: eventTypes,\n extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n var composition = extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);\n var beforeInput = extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);\n\n if (composition === null) {\n return beforeInput;\n }\n\n if (beforeInput === null) {\n return composition;\n }\n\n return [composition, beforeInput];\n }\n};\n\n/**\n * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary\n */\nvar supportedInputTypes = {\n color: true,\n date: true,\n datetime: true,\n 'datetime-local': true,\n email: true,\n month: true,\n number: true,\n password: true,\n range: true,\n search: true,\n tel: true,\n text: true,\n time: true,\n url: true,\n week: true\n};\n\nfunction isTextInputElement(elem) {\n var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n\n if (nodeName === 'input') {\n return !!supportedInputTypes[elem.type];\n }\n\n if (nodeName === 'textarea') {\n return true;\n }\n\n return false;\n}\n\nvar eventTypes$1 = {\n change: {\n phasedRegistrationNames: {\n bubbled: 'onChange',\n captured: 'onChangeCapture'\n },\n dependencies: [TOP_BLUR, TOP_CHANGE, TOP_CLICK, TOP_FOCUS, TOP_INPUT, TOP_KEY_DOWN, TOP_KEY_UP, TOP_SELECTION_CHANGE]\n }\n};\n\nfunction createAndAccumulateChangeEvent(inst, nativeEvent, target) {\n var event = SyntheticEvent.getPooled(eventTypes$1.change, inst, nativeEvent, target);\n event.type = 'change'; // Flag this event loop as needing state restore.\n\n enqueueStateRestore(target);\n accumulateTwoPhaseDispatches(event);\n return event;\n}\n/**\n * For IE shims\n */\n\n\nvar activeElement = null;\nvar activeElementInst = null;\n/**\n * SECTION: handle `change` event\n */\n\nfunction shouldUseChangeEvent(elem) {\n var nodeName = elem.nodeName && elem.nodeName.toLowerCase();\n return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';\n}\n\nfunction manualDispatchChangeEvent(nativeEvent) {\n var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent)); // If change and propertychange bubbled, we'd just bind to it like all the\n // other events and have it go through ReactBrowserEventEmitter. Since it\n // doesn't, we manually listen for the events and so we have to enqueue and\n // process the abstract event manually.\n //\n // Batching is necessary here in order to ensure that all event handlers run\n // before the next rerender (including event handlers attached to ancestor\n // elements instead of directly on the input). Without this, controlled\n // components don't work properly in conjunction with event bubbling because\n // the component is rerendered and the value reverted before all the event\n // handlers can run. See https://github.com/facebook/react/issues/708.\n\n batchedUpdates(runEventInBatch, event);\n}\n\nfunction runEventInBatch(event) {\n runEventsInBatch(event);\n}\n\nfunction getInstIfValueChanged(targetInst) {\n var targetNode = getNodeFromInstance$1(targetInst);\n\n if (updateValueIfChanged(targetNode)) {\n return targetInst;\n }\n}\n\nfunction getTargetInstForChangeEvent(topLevelType, targetInst) {\n if (topLevelType === TOP_CHANGE) {\n return targetInst;\n }\n}\n/**\n * SECTION: handle `input` event\n */\n\n\nvar isInputEventSupported = false;\n\nif (canUseDOM) {\n // IE9 claims to support the input event but fails to trigger it when\n // deleting text, so we ignore its input events.\n isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);\n}\n/**\n * (For IE <=9) Starts tracking propertychange events on the passed-in element\n * and override the value property so that we can distinguish user events from\n * value changes in JS.\n */\n\n\nfunction startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}\n/**\n * (For IE <=9) Removes the event listeners from the currently-tracked element,\n * if any exists.\n */\n\n\nfunction stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}\n/**\n * (For IE <=9) Handles a propertychange event, sending a `change` event if\n * the value of the active element has changed.\n */\n\n\nfunction handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}\n\nfunction handleEventsForInputEventPolyfill(topLevelType, target, targetInst) {\n if (topLevelType === TOP_FOCUS) {\n // In IE9, propertychange fires for most input events but is buggy and\n // doesn't fire when text is deleted, but conveniently, selectionchange\n // appears to fire in all of the remaining cases so we catch those and\n // forward the event if the value has changed\n // In either case, we don't want to call the event handler if the value\n // is changed from JS so we redefine a setter for `.value` that updates\n // our activeElementValue variable, allowing us to ignore those changes\n //\n // stopWatching() should be a noop here but we call it just in case we\n // missed a blur event somehow.\n stopWatchingForValueChange();\n startWatchingForValueChange(target, targetInst);\n } else if (topLevelType === TOP_BLUR) {\n stopWatchingForValueChange();\n }\n} // For IE8 and IE9.\n\n\nfunction getTargetInstForInputEventPolyfill(topLevelType, targetInst) {\n if (topLevelType === TOP_SELECTION_CHANGE || topLevelType === TOP_KEY_UP || topLevelType === TOP_KEY_DOWN) {\n // On the selectionchange event, the target is just document which isn't\n // helpful for us so just check activeElement instead.\n //\n // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire\n // propertychange on the first input event after setting `value` from a\n // script and fires only keydown, keypress, keyup. Catching keyup usually\n // gets it and catching keydown lets us fire an event for the first\n // keystroke if user does a key repeat (it'll be a little delayed: right\n // before the second keystroke). Other input methods (e.g., paste) seem to\n // fire selectionchange normally.\n return getInstIfValueChanged(activeElementInst);\n }\n}\n/**\n * SECTION: handle `click` event\n */\n\n\nfunction shouldUseClickEvent(elem) {\n // Use the `click` event to detect changes to checkbox and radio inputs.\n // This approach works across all browsers, whereas `change` does not fire\n // until `blur` in IE8.\n var nodeName = elem.nodeName;\n return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');\n}\n\nfunction getTargetInstForClickEvent(topLevelType, targetInst) {\n if (topLevelType === TOP_CLICK) {\n return getInstIfValueChanged(targetInst);\n }\n}\n\nfunction getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {\n if (topLevelType === TOP_INPUT || topLevelType === TOP_CHANGE) {\n return getInstIfValueChanged(targetInst);\n }\n}\n\nfunction handleControlledInputBlur(node) {\n var state = node._wrapperState;\n\n if (!state || !state.controlled || node.type !== 'number') {\n return;\n }\n\n {\n // If controlled, assign the value attribute to the current value on blur\n setDefaultValue(node, 'number', node.value);\n }\n}\n/**\n * This plugin creates an `onChange` event that normalizes change events\n * across form elements. This event fires at a time when it's possible to\n * change the element's value without seeing a flicker.\n *\n * Supported elements are:\n * - input (see `isTextInputElement`)\n * - textarea\n * - select\n */\n\n\nvar ChangeEventPlugin = {\n eventTypes: eventTypes$1,\n _isInputEventSupported: isInputEventSupported,\n extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;\n var getTargetInstFunc, handleEventFunc;\n\n if (shouldUseChangeEvent(targetNode)) {\n getTargetInstFunc = getTargetInstForChangeEvent;\n } else if (isTextInputElement(targetNode)) {\n if (isInputEventSupported) {\n getTargetInstFunc = getTargetInstForInputOrChangeEvent;\n } else {\n getTargetInstFunc = getTargetInstForInputEventPolyfill;\n handleEventFunc = handleEventsForInputEventPolyfill;\n }\n } else if (shouldUseClickEvent(targetNode)) {\n getTargetInstFunc = getTargetInstForClickEvent;\n }\n\n if (getTargetInstFunc) {\n var inst = getTargetInstFunc(topLevelType, targetInst);\n\n if (inst) {\n var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget);\n return event;\n }\n }\n\n if (handleEventFunc) {\n handleEventFunc(topLevelType, targetNode, targetInst);\n } // When blurring, set the value attribute for number inputs\n\n\n if (topLevelType === TOP_BLUR) {\n handleControlledInputBlur(targetNode);\n }\n }\n};\n\nvar SyntheticUIEvent = SyntheticEvent.extend({\n view: null,\n detail: null\n});\n\n/**\n * Translation from modifier key to the associated property in the event.\n * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers\n */\nvar modifierKeyToProp = {\n Alt: 'altKey',\n Control: 'ctrlKey',\n Meta: 'metaKey',\n Shift: 'shiftKey'\n}; // Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support\n// getModifierState. If getModifierState is not supported, we map it to a set of\n// modifier keys exposed by the event. In this case, Lock-keys are not supported.\n\nfunction modifierStateGetter(keyArg) {\n var syntheticEvent = this;\n var nativeEvent = syntheticEvent.nativeEvent;\n\n if (nativeEvent.getModifierState) {\n return nativeEvent.getModifierState(keyArg);\n }\n\n var keyProp = modifierKeyToProp[keyArg];\n return keyProp ? !!nativeEvent[keyProp] : false;\n}\n\nfunction getEventModifierState(nativeEvent) {\n return modifierStateGetter;\n}\n\nvar previousScreenX = 0;\nvar previousScreenY = 0; // Use flags to signal movementX/Y has already been set\n\nvar isMovementXSet = false;\nvar isMovementYSet = false;\n/**\n * @interface MouseEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar SyntheticMouseEvent = SyntheticUIEvent.extend({\n screenX: null,\n screenY: null,\n clientX: null,\n clientY: null,\n pageX: null,\n pageY: null,\n ctrlKey: null,\n shiftKey: null,\n altKey: null,\n metaKey: null,\n getModifierState: getEventModifierState,\n button: null,\n buttons: null,\n relatedTarget: function (event) {\n return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);\n },\n movementX: function (event) {\n if ('movementX' in event) {\n return event.movementX;\n }\n\n var screenX = previousScreenX;\n previousScreenX = event.screenX;\n\n if (!isMovementXSet) {\n isMovementXSet = true;\n return 0;\n }\n\n return event.type === 'mousemove' ? event.screenX - screenX : 0;\n },\n movementY: function (event) {\n if ('movementY' in event) {\n return event.movementY;\n }\n\n var screenY = previousScreenY;\n previousScreenY = event.screenY;\n\n if (!isMovementYSet) {\n isMovementYSet = true;\n return 0;\n }\n\n return event.type === 'mousemove' ? event.screenY - screenY : 0;\n }\n});\n\n/**\n * @interface PointerEvent\n * @see http://www.w3.org/TR/pointerevents/\n */\n\nvar SyntheticPointerEvent = SyntheticMouseEvent.extend({\n pointerId: null,\n width: null,\n height: null,\n pressure: null,\n tangentialPressure: null,\n tiltX: null,\n tiltY: null,\n twist: null,\n pointerType: null,\n isPrimary: null\n});\n\nvar eventTypes$2 = {\n mouseEnter: {\n registrationName: 'onMouseEnter',\n dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]\n },\n mouseLeave: {\n registrationName: 'onMouseLeave',\n dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]\n },\n pointerEnter: {\n registrationName: 'onPointerEnter',\n dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]\n },\n pointerLeave: {\n registrationName: 'onPointerLeave',\n dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]\n }\n};\nvar EnterLeaveEventPlugin = {\n eventTypes: eventTypes$2,\n\n /**\n * For almost every interaction we care about, there will be both a top-level\n * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that\n * we do not extract duplicate events. However, moving the mouse into the\n * browser from outside will not fire a `mouseout` event. In this case, we use\n * the `mouseover` top-level event.\n */\n extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n var isOverEvent = topLevelType === TOP_MOUSE_OVER || topLevelType === TOP_POINTER_OVER;\n var isOutEvent = topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_POINTER_OUT;\n\n if (isOverEvent && (eventSystemFlags & IS_REPLAYED) === 0 && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {\n // If this is an over event with a target, then we've already dispatched\n // the event in the out event of the other target. If this is replayed,\n // then it's because we couldn't dispatch against this target previously\n // so we have to do it now instead.\n return null;\n }\n\n if (!isOutEvent && !isOverEvent) {\n // Must not be a mouse or pointer in or out - ignoring.\n return null;\n }\n\n var win;\n\n if (nativeEventTarget.window === nativeEventTarget) {\n // `nativeEventTarget` is probably a window object.\n win = nativeEventTarget;\n } else {\n // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.\n var doc = nativeEventTarget.ownerDocument;\n\n if (doc) {\n win = doc.defaultView || doc.parentWindow;\n } else {\n win = window;\n }\n }\n\n var from;\n var to;\n\n if (isOutEvent) {\n from = targetInst;\n var related = nativeEvent.relatedTarget || nativeEvent.toElement;\n to = related ? getClosestInstanceFromNode(related) : null;\n\n if (to !== null) {\n var nearestMounted = getNearestMountedFiber(to);\n\n if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {\n to = null;\n }\n }\n } else {\n // Moving to a node from outside the window.\n from = null;\n to = targetInst;\n }\n\n if (from === to) {\n // Nothing pertains to our managed components.\n return null;\n }\n\n var eventInterface, leaveEventType, enterEventType, eventTypePrefix;\n\n if (topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_MOUSE_OVER) {\n eventInterface = SyntheticMouseEvent;\n leaveEventType = eventTypes$2.mouseLeave;\n enterEventType = eventTypes$2.mouseEnter;\n eventTypePrefix = 'mouse';\n } else if (topLevelType === TOP_POINTER_OUT || topLevelType === TOP_POINTER_OVER) {\n eventInterface = SyntheticPointerEvent;\n leaveEventType = eventTypes$2.pointerLeave;\n enterEventType = eventTypes$2.pointerEnter;\n eventTypePrefix = 'pointer';\n }\n\n var fromNode = from == null ? win : getNodeFromInstance$1(from);\n var toNode = to == null ? win : getNodeFromInstance$1(to);\n var leave = eventInterface.getPooled(leaveEventType, from, nativeEvent, nativeEventTarget);\n leave.type = eventTypePrefix + 'leave';\n leave.target = fromNode;\n leave.relatedTarget = toNode;\n var enter = eventInterface.getPooled(enterEventType, to, nativeEvent, nativeEventTarget);\n enter.type = eventTypePrefix + 'enter';\n enter.target = toNode;\n enter.relatedTarget = fromNode;\n accumulateEnterLeaveDispatches(leave, enter, from, to); // If we are not processing the first ancestor, then we\n // should not process the same nativeEvent again, as we\n // will have already processed it in the first ancestor.\n\n if ((eventSystemFlags & IS_FIRST_ANCESTOR) === 0) {\n return [leave];\n }\n\n return [leave, enter];\n }\n};\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 */\nfunction 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\nvar objectIs = typeof Object.is === 'function' ? Object.is : is;\n\nvar hasOwnProperty$2 = Object.prototype.hasOwnProperty;\n/**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * Returns true when the values of all keys are strictly equal.\n */\n\nfunction shallowEqual(objA, objB) {\n if (objectIs(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n } // Test for A's keys different from B.\n\n\n for (var i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty$2.call(objB, keysA[i]) || !objectIs(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n}\n\nvar skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11;\nvar eventTypes$3 = {\n select: {\n phasedRegistrationNames: {\n bubbled: 'onSelect',\n captured: 'onSelectCapture'\n },\n dependencies: [TOP_BLUR, TOP_CONTEXT_MENU, TOP_DRAG_END, TOP_FOCUS, TOP_KEY_DOWN, TOP_KEY_UP, TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_SELECTION_CHANGE]\n }\n};\nvar activeElement$1 = null;\nvar activeElementInst$1 = null;\nvar lastSelection = null;\nvar mouseDown = false;\n/**\n * Get an object which is a unique representation of the current selection.\n *\n * The return value will not be consistent across nodes or browsers, but\n * two identical selections on the same node will return identical objects.\n *\n * @param {DOMElement} node\n * @return {object}\n */\n\nfunction getSelection$1(node) {\n if ('selectionStart' in node && hasSelectionCapabilities(node)) {\n return {\n start: node.selectionStart,\n end: node.selectionEnd\n };\n } else {\n var win = node.ownerDocument && node.ownerDocument.defaultView || window;\n var selection = win.getSelection();\n return {\n anchorNode: selection.anchorNode,\n anchorOffset: selection.anchorOffset,\n focusNode: selection.focusNode,\n focusOffset: selection.focusOffset\n };\n }\n}\n/**\n * Get document associated with the event target.\n *\n * @param {object} nativeEventTarget\n * @return {Document}\n */\n\n\nfunction getEventTargetDocument(eventTarget) {\n return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;\n}\n/**\n * Poll selection to see whether it's changed.\n *\n * @param {object} nativeEvent\n * @param {object} nativeEventTarget\n * @return {?SyntheticEvent}\n */\n\n\nfunction constructSelectEvent(nativeEvent, nativeEventTarget) {\n // Ensure we have the right element, and that the user is not dragging a\n // selection (this matches native `select` event behavior). In HTML5, select\n // fires only on input and textarea thus if there's no focused element we\n // won't dispatch.\n var doc = getEventTargetDocument(nativeEventTarget);\n\n if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {\n return null;\n } // Only fire when selection has actually changed.\n\n\n var currentSelection = getSelection$1(activeElement$1);\n\n if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {\n lastSelection = currentSelection;\n var syntheticEvent = SyntheticEvent.getPooled(eventTypes$3.select, activeElementInst$1, nativeEvent, nativeEventTarget);\n syntheticEvent.type = 'select';\n syntheticEvent.target = activeElement$1;\n accumulateTwoPhaseDispatches(syntheticEvent);\n return syntheticEvent;\n }\n\n return null;\n}\n/**\n * This plugin creates an `onSelect` event that normalizes select events\n * across form elements.\n *\n * Supported elements are:\n * - input (see `isTextInputElement`)\n * - textarea\n * - contentEditable\n *\n * This differs from native browser implementations in the following ways:\n * - Fires on contentEditable fields as well as inputs.\n * - Fires for collapsed selection.\n * - Fires after user input.\n */\n\n\nvar SelectEventPlugin = {\n eventTypes: eventTypes$3,\n extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, container) {\n var containerOrDoc = container || getEventTargetDocument(nativeEventTarget); // Track whether all listeners exists for this plugin. If none exist, we do\n // not extract events. See #3639.\n\n if (!containerOrDoc || !isListeningToAllDependencies('onSelect', containerOrDoc)) {\n return null;\n }\n\n var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;\n\n switch (topLevelType) {\n // Track the input node that has focus.\n case TOP_FOCUS:\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n activeElement$1 = targetNode;\n activeElementInst$1 = targetInst;\n lastSelection = null;\n }\n\n break;\n\n case TOP_BLUR:\n activeElement$1 = null;\n activeElementInst$1 = null;\n lastSelection = null;\n break;\n // Don't fire the event while the user is dragging. This matches the\n // semantics of the native select event.\n\n case TOP_MOUSE_DOWN:\n mouseDown = true;\n break;\n\n case TOP_CONTEXT_MENU:\n case TOP_MOUSE_UP:\n case TOP_DRAG_END:\n mouseDown = false;\n return constructSelectEvent(nativeEvent, nativeEventTarget);\n // Chrome and IE fire non-standard event when selection is changed (and\n // sometimes when it hasn't). IE's event fires out of order with respect\n // to key and input events on deletion, so we discard it.\n //\n // Firefox doesn't support selectionchange, so check selection status\n // after each key entry. The selection changes after keydown and before\n // keyup, but we check on keydown as well in the case of holding down a\n // key, when multiple keydown events are fired but only one keyup is.\n // This is also our approach for IE handling, for the reason above.\n\n case TOP_SELECTION_CHANGE:\n if (skipSelectionChangeEvent) {\n break;\n }\n\n // falls through\n\n case TOP_KEY_DOWN:\n case TOP_KEY_UP:\n return constructSelectEvent(nativeEvent, nativeEventTarget);\n }\n\n return null;\n }\n};\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface\n * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent\n */\n\nvar SyntheticAnimationEvent = SyntheticEvent.extend({\n animationName: null,\n elapsedTime: null,\n pseudoElement: null\n});\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/clipboard-apis/\n */\n\nvar SyntheticClipboardEvent = SyntheticEvent.extend({\n clipboardData: function (event) {\n return 'clipboardData' in event ? event.clipboardData : window.clipboardData;\n }\n});\n\n/**\n * @interface FocusEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar SyntheticFocusEvent = SyntheticUIEvent.extend({\n relatedTarget: null\n});\n\n/**\n * `charCode` represents the actual \"character code\" and is safe to use with\n * `String.fromCharCode`. As such, only keys that correspond to printable\n * characters produce a valid `charCode`, the only exception to this is Enter.\n * The Tab-key is considered non-printable and does not have a `charCode`,\n * presumably because it does not produce a tab-character in browsers.\n *\n * @param {object} nativeEvent Native browser event.\n * @return {number} Normalized `charCode` property.\n */\nfunction getEventCharCode(nativeEvent) {\n var charCode;\n var keyCode = nativeEvent.keyCode;\n\n if ('charCode' in nativeEvent) {\n charCode = nativeEvent.charCode; // FF does not set `charCode` for the Enter-key, check against `keyCode`.\n\n if (charCode === 0 && keyCode === 13) {\n charCode = 13;\n }\n } else {\n // IE8 does not implement `charCode`, but `keyCode` has the correct value.\n charCode = keyCode;\n } // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux)\n // report Enter as charCode 10 when ctrl is pressed.\n\n\n if (charCode === 10) {\n charCode = 13;\n } // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.\n // Must not discard the (non-)printable Enter-key.\n\n\n if (charCode >= 32 || charCode === 13) {\n return charCode;\n }\n\n return 0;\n}\n\n/**\n * Normalization of deprecated HTML5 `key` values\n * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names\n */\n\nvar normalizeKey = {\n Esc: 'Escape',\n Spacebar: ' ',\n Left: 'ArrowLeft',\n Up: 'ArrowUp',\n Right: 'ArrowRight',\n Down: 'ArrowDown',\n Del: 'Delete',\n Win: 'OS',\n Menu: 'ContextMenu',\n Apps: 'ContextMenu',\n Scroll: 'ScrollLock',\n MozPrintableKey: 'Unidentified'\n};\n/**\n * Translation from legacy `keyCode` to HTML5 `key`\n * Only special keys supported, all others depend on keyboard layout or browser\n * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names\n */\n\nvar translateToKey = {\n '8': 'Backspace',\n '9': 'Tab',\n '12': 'Clear',\n '13': 'Enter',\n '16': 'Shift',\n '17': 'Control',\n '18': 'Alt',\n '19': 'Pause',\n '20': 'CapsLock',\n '27': 'Escape',\n '32': ' ',\n '33': 'PageUp',\n '34': 'PageDown',\n '35': 'End',\n '36': 'Home',\n '37': 'ArrowLeft',\n '38': 'ArrowUp',\n '39': 'ArrowRight',\n '40': 'ArrowDown',\n '45': 'Insert',\n '46': 'Delete',\n '112': 'F1',\n '113': 'F2',\n '114': 'F3',\n '115': 'F4',\n '116': 'F5',\n '117': 'F6',\n '118': 'F7',\n '119': 'F8',\n '120': 'F9',\n '121': 'F10',\n '122': 'F11',\n '123': 'F12',\n '144': 'NumLock',\n '145': 'ScrollLock',\n '224': 'Meta'\n};\n/**\n * @param {object} nativeEvent Native browser event.\n * @return {string} Normalized `key` property.\n */\n\nfunction getEventKey(nativeEvent) {\n if (nativeEvent.key) {\n // Normalize inconsistent values reported by browsers due to\n // implementations of a working draft specification.\n // FireFox implements `key` but returns `MozPrintableKey` for all\n // printable characters (normalized to `Unidentified`), ignore it.\n var key = normalizeKey[nativeEvent.key] || nativeEvent.key;\n\n if (key !== 'Unidentified') {\n return key;\n }\n } // Browser does not implement `key`, polyfill as much of it as we can.\n\n\n if (nativeEvent.type === 'keypress') {\n var charCode = getEventCharCode(nativeEvent); // The enter-key is technically both printable and non-printable and can\n // thus be captured by `keypress`, no other non-printable key should.\n\n return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);\n }\n\n if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {\n // While user keyboard layout determines the actual meaning of each\n // `keyCode` value, almost all function keys have a universal value.\n return translateToKey[nativeEvent.keyCode] || 'Unidentified';\n }\n\n return '';\n}\n\n/**\n * @interface KeyboardEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar SyntheticKeyboardEvent = SyntheticUIEvent.extend({\n key: getEventKey,\n location: null,\n ctrlKey: null,\n shiftKey: null,\n altKey: null,\n metaKey: null,\n repeat: null,\n locale: null,\n getModifierState: getEventModifierState,\n // Legacy Interface\n charCode: function (event) {\n // `charCode` is the result of a KeyPress event and represents the value of\n // the actual printable character.\n // KeyPress is deprecated, but its replacement is not yet final and not\n // implemented in any major browser. Only KeyPress has charCode.\n if (event.type === 'keypress') {\n return getEventCharCode(event);\n }\n\n return 0;\n },\n keyCode: function (event) {\n // `keyCode` is the result of a KeyDown/Up event and represents the value of\n // physical keyboard key.\n // The actual meaning of the value depends on the users' keyboard layout\n // which cannot be detected. Assuming that it is a US keyboard layout\n // provides a surprisingly accurate mapping for US and European users.\n // Due to this, it is left to the user to implement at this time.\n if (event.type === 'keydown' || event.type === 'keyup') {\n return event.keyCode;\n }\n\n return 0;\n },\n which: function (event) {\n // `which` is an alias for either `keyCode` or `charCode` depending on the\n // type of the event.\n if (event.type === 'keypress') {\n return getEventCharCode(event);\n }\n\n if (event.type === 'keydown' || event.type === 'keyup') {\n return event.keyCode;\n }\n\n return 0;\n }\n});\n\n/**\n * @interface DragEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar SyntheticDragEvent = SyntheticMouseEvent.extend({\n dataTransfer: null\n});\n\n/**\n * @interface TouchEvent\n * @see http://www.w3.org/TR/touch-events/\n */\n\nvar SyntheticTouchEvent = SyntheticUIEvent.extend({\n touches: null,\n targetTouches: null,\n changedTouches: null,\n altKey: null,\n metaKey: null,\n ctrlKey: null,\n shiftKey: null,\n getModifierState: getEventModifierState\n});\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent\n */\n\nvar SyntheticTransitionEvent = SyntheticEvent.extend({\n propertyName: null,\n elapsedTime: null,\n pseudoElement: null\n});\n\n/**\n * @interface WheelEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar SyntheticWheelEvent = SyntheticMouseEvent.extend({\n deltaX: function (event) {\n return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).\n 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;\n },\n deltaY: function (event) {\n return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).\n 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).\n 'wheelDelta' in event ? -event.wheelDelta : 0;\n },\n deltaZ: null,\n // Browsers without \"deltaMode\" is reporting in raw wheel delta where one\n // notch on the scroll is always +/- 120, roughly equivalent to pixels.\n // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or\n // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.\n deltaMode: null\n});\n\nvar knownHTMLTopLevelTypes = [TOP_ABORT, TOP_CANCEL, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_CLOSE, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_INPUT, TOP_INVALID, TOP_LOAD, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_RESET, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUBMIT, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_TOGGLE, TOP_VOLUME_CHANGE, TOP_WAITING];\nvar SimpleEventPlugin = {\n // simpleEventPluginEventTypes gets populated from\n // the DOMEventProperties module.\n eventTypes: simpleEventPluginEventTypes,\n extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n var dispatchConfig = topLevelEventsToDispatchConfig.get(topLevelType);\n\n if (!dispatchConfig) {\n return null;\n }\n\n var EventConstructor;\n\n switch (topLevelType) {\n case TOP_KEY_PRESS:\n // Firefox creates a keypress event for function keys too. This removes\n // the unwanted keypress events. Enter is however both printable and\n // non-printable. One would expect Tab to be as well (but it isn't).\n if (getEventCharCode(nativeEvent) === 0) {\n return null;\n }\n\n /* falls through */\n\n case TOP_KEY_DOWN:\n case TOP_KEY_UP:\n EventConstructor = SyntheticKeyboardEvent;\n break;\n\n case TOP_BLUR:\n case TOP_FOCUS:\n EventConstructor = SyntheticFocusEvent;\n break;\n\n case TOP_CLICK:\n // Firefox creates a click event on right mouse clicks. This removes the\n // unwanted click events.\n if (nativeEvent.button === 2) {\n return null;\n }\n\n /* falls through */\n\n case TOP_AUX_CLICK:\n case TOP_DOUBLE_CLICK:\n case TOP_MOUSE_DOWN:\n case TOP_MOUSE_MOVE:\n case TOP_MOUSE_UP: // TODO: Disabled elements should not respond to mouse events\n\n /* falls through */\n\n case TOP_MOUSE_OUT:\n case TOP_MOUSE_OVER:\n case TOP_CONTEXT_MENU:\n EventConstructor = SyntheticMouseEvent;\n break;\n\n case TOP_DRAG:\n case TOP_DRAG_END:\n case TOP_DRAG_ENTER:\n case TOP_DRAG_EXIT:\n case TOP_DRAG_LEAVE:\n case TOP_DRAG_OVER:\n case TOP_DRAG_START:\n case TOP_DROP:\n EventConstructor = SyntheticDragEvent;\n break;\n\n case TOP_TOUCH_CANCEL:\n case TOP_TOUCH_END:\n case TOP_TOUCH_MOVE:\n case TOP_TOUCH_START:\n EventConstructor = SyntheticTouchEvent;\n break;\n\n case TOP_ANIMATION_END:\n case TOP_ANIMATION_ITERATION:\n case TOP_ANIMATION_START:\n EventConstructor = SyntheticAnimationEvent;\n break;\n\n case TOP_TRANSITION_END:\n EventConstructor = SyntheticTransitionEvent;\n break;\n\n case TOP_SCROLL:\n EventConstructor = SyntheticUIEvent;\n break;\n\n case TOP_WHEEL:\n EventConstructor = SyntheticWheelEvent;\n break;\n\n case TOP_COPY:\n case TOP_CUT:\n case TOP_PASTE:\n EventConstructor = SyntheticClipboardEvent;\n break;\n\n case TOP_GOT_POINTER_CAPTURE:\n case TOP_LOST_POINTER_CAPTURE:\n case TOP_POINTER_CANCEL:\n case TOP_POINTER_DOWN:\n case TOP_POINTER_MOVE:\n case TOP_POINTER_OUT:\n case TOP_POINTER_OVER:\n case TOP_POINTER_UP:\n EventConstructor = SyntheticPointerEvent;\n break;\n\n default:\n {\n if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) {\n error('SimpleEventPlugin: Unhandled event type, `%s`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType);\n }\n } // HTML Events\n // @see http://www.w3.org/TR/html5/index.html#events-0\n\n\n EventConstructor = SyntheticEvent;\n break;\n }\n\n var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);\n accumulateTwoPhaseDispatches(event);\n return event;\n }\n};\n\n/**\n * Specifies a deterministic ordering of `EventPlugin`s. A convenient way to\n * reason about plugins, without having to package every one of them. This\n * is better than having plugins be ordered in the same order that they\n * are injected because that ordering would be influenced by the packaging order.\n * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that\n * preventing default on events is convenient in `SimpleEventPlugin` handlers.\n */\n\nvar DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];\n/**\n * Inject modules for resolving DOM hierarchy and plugin ordering.\n */\n\ninjectEventPluginOrder(DOMEventPluginOrder);\nsetComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromNode$1, getNodeFromInstance$1);\n/**\n * Some important event plugins included by default (without having to require\n * them).\n */\n\ninjectEventPluginsByName({\n SimpleEventPlugin: SimpleEventPlugin,\n EnterLeaveEventPlugin: EnterLeaveEventPlugin,\n ChangeEventPlugin: ChangeEventPlugin,\n SelectEventPlugin: SelectEventPlugin,\n BeforeInputEventPlugin: BeforeInputEventPlugin\n});\n\n// Prefix measurements so that it's possible to filter them.\n// Longer prefixes are hard to read in DevTools.\nvar reactEmoji = \"\\u269B\";\nvar warningEmoji = \"\\u26D4\";\nvar supportsUserTiming = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function'; // Keep track of current fiber so that we know the path to unwind on pause.\n// TODO: this looks the same as nextUnitOfWork in scheduler. Can we unify them?\n\nvar currentFiber = null; // If we're in the middle of user code, which fiber and method is it?\n// Reusing `currentFiber` would be confusing for this because user code fiber\n// can change during commit phase too, but we don't need to unwind it (since\n// lifecycles in the commit phase don't resemble a tree).\n\nvar currentPhase = null;\nvar currentPhaseFiber = null; // Did lifecycle hook schedule an update? This is often a performance problem,\n// so we will keep track of it, and include it in the report.\n// Track commits caused by cascading updates.\n\nvar isCommitting = false;\nvar hasScheduledUpdateInCurrentCommit = false;\nvar hasScheduledUpdateInCurrentPhase = false;\nvar commitCountInCurrentWorkLoop = 0;\nvar effectCountInCurrentCommit = 0;\n// to avoid stretch the commit phase with measurement overhead.\n\nvar labelsInCurrentCommit = new Set();\n\nvar formatMarkName = function (markName) {\n return reactEmoji + \" \" + markName;\n};\n\nvar formatLabel = function (label, warning) {\n var prefix = warning ? warningEmoji + \" \" : reactEmoji + \" \";\n var suffix = warning ? \" Warning: \" + warning : '';\n return \"\" + prefix + label + suffix;\n};\n\nvar beginMark = function (markName) {\n performance.mark(formatMarkName(markName));\n};\n\nvar clearMark = function (markName) {\n performance.clearMarks(formatMarkName(markName));\n};\n\nvar endMark = function (label, markName, warning) {\n var formattedMarkName = formatMarkName(markName);\n var formattedLabel = formatLabel(label, warning);\n\n try {\n performance.measure(formattedLabel, formattedMarkName);\n } catch (err) {} // If previous mark was missing for some reason, this will throw.\n // This could only happen if React crashed in an unexpected place earlier.\n // Don't pile on with more errors.\n // Clear marks immediately to avoid growing buffer.\n\n\n performance.clearMarks(formattedMarkName);\n performance.clearMeasures(formattedLabel);\n};\n\nvar getFiberMarkName = function (label, debugID) {\n return label + \" (#\" + debugID + \")\";\n};\n\nvar getFiberLabel = function (componentName, isMounted, phase) {\n if (phase === null) {\n // These are composite component total time measurements.\n return componentName + \" [\" + (isMounted ? 'update' : 'mount') + \"]\";\n } else {\n // Composite component methods.\n return componentName + \".\" + phase;\n }\n};\n\nvar beginFiberMark = function (fiber, phase) {\n var componentName = getComponentName(fiber.type) || 'Unknown';\n var debugID = fiber._debugID;\n var isMounted = fiber.alternate !== null;\n var label = getFiberLabel(componentName, isMounted, phase);\n\n if (isCommitting && labelsInCurrentCommit.has(label)) {\n // During the commit phase, we don't show duplicate labels because\n // there is a fixed overhead for every measurement, and we don't\n // want to stretch the commit phase beyond necessary.\n return false;\n }\n\n labelsInCurrentCommit.add(label);\n var markName = getFiberMarkName(label, debugID);\n beginMark(markName);\n return true;\n};\n\nvar clearFiberMark = function (fiber, phase) {\n var componentName = getComponentName(fiber.type) || 'Unknown';\n var debugID = fiber._debugID;\n var isMounted = fiber.alternate !== null;\n var label = getFiberLabel(componentName, isMounted, phase);\n var markName = getFiberMarkName(label, debugID);\n clearMark(markName);\n};\n\nvar endFiberMark = function (fiber, phase, warning) {\n var componentName = getComponentName(fiber.type) || 'Unknown';\n var debugID = fiber._debugID;\n var isMounted = fiber.alternate !== null;\n var label = getFiberLabel(componentName, isMounted, phase);\n var markName = getFiberMarkName(label, debugID);\n endMark(label, markName, warning);\n};\n\nvar shouldIgnoreFiber = function (fiber) {\n // Host components should be skipped in the timeline.\n // We could check typeof fiber.type, but does this work with RN?\n switch (fiber.tag) {\n case HostRoot:\n case HostComponent:\n case HostText:\n case HostPortal:\n case Fragment:\n case ContextProvider:\n case ContextConsumer:\n case Mode:\n return true;\n\n default:\n return false;\n }\n};\n\nvar clearPendingPhaseMeasurement = function () {\n if (currentPhase !== null && currentPhaseFiber !== null) {\n clearFiberMark(currentPhaseFiber, currentPhase);\n }\n\n currentPhaseFiber = null;\n currentPhase = null;\n hasScheduledUpdateInCurrentPhase = false;\n};\n\nvar pauseTimers = function () {\n // Stops all currently active measurements so that they can be resumed\n // if we continue in a later deferred loop from the same unit of work.\n var fiber = currentFiber;\n\n while (fiber) {\n if (fiber._debugIsCurrentlyTiming) {\n endFiberMark(fiber, null, null);\n }\n\n fiber = fiber.return;\n }\n};\n\nvar resumeTimersRecursively = function (fiber) {\n if (fiber.return !== null) {\n resumeTimersRecursively(fiber.return);\n }\n\n if (fiber._debugIsCurrentlyTiming) {\n beginFiberMark(fiber, null);\n }\n};\n\nvar resumeTimers = function () {\n // Resumes all measurements that were active during the last deferred loop.\n if (currentFiber !== null) {\n resumeTimersRecursively(currentFiber);\n }\n};\n\nfunction recordEffect() {\n {\n effectCountInCurrentCommit++;\n }\n}\nfunction recordScheduleUpdate() {\n {\n if (isCommitting) {\n hasScheduledUpdateInCurrentCommit = true;\n }\n\n if (currentPhase !== null && currentPhase !== 'componentWillMount' && currentPhase !== 'componentWillReceiveProps') {\n hasScheduledUpdateInCurrentPhase = true;\n }\n }\n}\nfunction startWorkTimer(fiber) {\n {\n if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n return;\n } // If we pause, this is the fiber to unwind from.\n\n\n currentFiber = fiber;\n\n if (!beginFiberMark(fiber, null)) {\n return;\n }\n\n fiber._debugIsCurrentlyTiming = true;\n }\n}\nfunction cancelWorkTimer(fiber) {\n {\n if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n return;\n } // Remember we shouldn't complete measurement for this fiber.\n // Otherwise flamechart will be deep even for small updates.\n\n\n fiber._debugIsCurrentlyTiming = false;\n clearFiberMark(fiber, null);\n }\n}\nfunction stopWorkTimer(fiber) {\n {\n if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n return;\n } // If we pause, its parent is the fiber to unwind from.\n\n\n currentFiber = fiber.return;\n\n if (!fiber._debugIsCurrentlyTiming) {\n return;\n }\n\n fiber._debugIsCurrentlyTiming = false;\n endFiberMark(fiber, null, null);\n }\n}\nfunction stopFailedWorkTimer(fiber) {\n {\n if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n return;\n } // If we pause, its parent is the fiber to unwind from.\n\n\n currentFiber = fiber.return;\n\n if (!fiber._debugIsCurrentlyTiming) {\n return;\n }\n\n fiber._debugIsCurrentlyTiming = false;\n var warning = fiber.tag === SuspenseComponent ? 'Rendering was suspended' : 'An error was thrown inside this error boundary';\n endFiberMark(fiber, null, warning);\n }\n}\nfunction startPhaseTimer(fiber, phase) {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n clearPendingPhaseMeasurement();\n\n if (!beginFiberMark(fiber, phase)) {\n return;\n }\n\n currentPhaseFiber = fiber;\n currentPhase = phase;\n }\n}\nfunction stopPhaseTimer() {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n if (currentPhase !== null && currentPhaseFiber !== null) {\n var warning = hasScheduledUpdateInCurrentPhase ? 'Scheduled a cascading update' : null;\n endFiberMark(currentPhaseFiber, currentPhase, warning);\n }\n\n currentPhase = null;\n currentPhaseFiber = null;\n }\n}\nfunction startWorkLoopTimer(nextUnitOfWork) {\n {\n currentFiber = nextUnitOfWork;\n\n if (!supportsUserTiming) {\n return;\n }\n\n commitCountInCurrentWorkLoop = 0; // This is top level call.\n // Any other measurements are performed within.\n\n beginMark('(React Tree Reconciliation)'); // Resume any measurements that were in progress during the last loop.\n\n resumeTimers();\n }\n}\nfunction stopWorkLoopTimer(interruptedBy, didCompleteRoot) {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n var warning = null;\n\n if (interruptedBy !== null) {\n if (interruptedBy.tag === HostRoot) {\n warning = 'A top-level update interrupted the previous render';\n } else {\n var componentName = getComponentName(interruptedBy.type) || 'Unknown';\n warning = \"An update to \" + componentName + \" interrupted the previous render\";\n }\n } else if (commitCountInCurrentWorkLoop > 1) {\n warning = 'There were cascading updates';\n }\n\n commitCountInCurrentWorkLoop = 0;\n var label = didCompleteRoot ? '(React Tree Reconciliation: Completed Root)' : '(React Tree Reconciliation: Yielded)'; // Pause any measurements until the next loop.\n\n pauseTimers();\n endMark(label, '(React Tree Reconciliation)', warning);\n }\n}\nfunction startCommitTimer() {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n isCommitting = true;\n hasScheduledUpdateInCurrentCommit = false;\n labelsInCurrentCommit.clear();\n beginMark('(Committing Changes)');\n }\n}\nfunction stopCommitTimer() {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n var warning = null;\n\n if (hasScheduledUpdateInCurrentCommit) {\n warning = 'Lifecycle hook scheduled a cascading update';\n } else if (commitCountInCurrentWorkLoop > 0) {\n warning = 'Caused by a cascading update in earlier commit';\n }\n\n hasScheduledUpdateInCurrentCommit = false;\n commitCountInCurrentWorkLoop++;\n isCommitting = false;\n labelsInCurrentCommit.clear();\n endMark('(Committing Changes)', '(Committing Changes)', warning);\n }\n}\nfunction startCommitSnapshotEffectsTimer() {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n effectCountInCurrentCommit = 0;\n beginMark('(Committing Snapshot Effects)');\n }\n}\nfunction stopCommitSnapshotEffectsTimer() {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n var count = effectCountInCurrentCommit;\n effectCountInCurrentCommit = 0;\n endMark(\"(Committing Snapshot Effects: \" + count + \" Total)\", '(Committing Snapshot Effects)', null);\n }\n}\nfunction startCommitHostEffectsTimer() {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n effectCountInCurrentCommit = 0;\n beginMark('(Committing Host Effects)');\n }\n}\nfunction stopCommitHostEffectsTimer() {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n var count = effectCountInCurrentCommit;\n effectCountInCurrentCommit = 0;\n endMark(\"(Committing Host Effects: \" + count + \" Total)\", '(Committing Host Effects)', null);\n }\n}\nfunction startCommitLifeCyclesTimer() {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n effectCountInCurrentCommit = 0;\n beginMark('(Calling Lifecycle Methods)');\n }\n}\nfunction stopCommitLifeCyclesTimer() {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n var count = effectCountInCurrentCommit;\n effectCountInCurrentCommit = 0;\n endMark(\"(Calling Lifecycle Methods: \" + count + \" Total)\", '(Calling Lifecycle Methods)', null);\n }\n}\n\nvar valueStack = [];\nvar fiberStack;\n\n{\n fiberStack = [];\n}\n\nvar index = -1;\n\nfunction createCursor(defaultValue) {\n return {\n current: defaultValue\n };\n}\n\nfunction pop(cursor, fiber) {\n if (index < 0) {\n {\n error('Unexpected pop.');\n }\n\n return;\n }\n\n {\n if (fiber !== fiberStack[index]) {\n error('Unexpected Fiber popped.');\n }\n }\n\n cursor.current = valueStack[index];\n valueStack[index] = null;\n\n {\n fiberStack[index] = null;\n }\n\n index--;\n}\n\nfunction push(cursor, value, fiber) {\n index++;\n valueStack[index] = cursor.current;\n\n {\n fiberStack[index] = fiber;\n }\n\n cursor.current = value;\n}\n\nvar warnedAboutMissingGetChildContext;\n\n{\n warnedAboutMissingGetChildContext = {};\n}\n\nvar emptyContextObject = {};\n\n{\n Object.freeze(emptyContextObject);\n} // A cursor to the current merged context object on the stack.\n\n\nvar contextStackCursor = createCursor(emptyContextObject); // A cursor to a boolean indicating whether the context has changed.\n\nvar didPerformWorkStackCursor = createCursor(false); // Keep track of the previous context object that was on the stack.\n// We use this to get access to the parent context after we have already\n// pushed the next context provider, and now need to merge their contexts.\n\nvar previousContext = emptyContextObject;\n\nfunction getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) {\n {\n if (didPushOwnContextIfProvider && isContextProvider(Component)) {\n // If the fiber is a context provider itself, when we read its context\n // we may have already pushed its own child context on the stack. A context\n // provider should not \"see\" its own child context. Therefore we read the\n // previous (parent) context instead for a context provider.\n return previousContext;\n }\n\n return contextStackCursor.current;\n }\n}\n\nfunction cacheContext(workInProgress, unmaskedContext, maskedContext) {\n {\n var instance = workInProgress.stateNode;\n instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;\n instance.__reactInternalMemoizedMaskedChildContext = maskedContext;\n }\n}\n\nfunction getMaskedContext(workInProgress, unmaskedContext) {\n {\n var type = workInProgress.type;\n var contextTypes = type.contextTypes;\n\n if (!contextTypes) {\n return emptyContextObject;\n } // Avoid recreating masked context unless unmasked context has changed.\n // Failing to do this will result in unnecessary calls to componentWillReceiveProps.\n // This may trigger infinite loops if componentWillReceiveProps calls setState.\n\n\n var instance = workInProgress.stateNode;\n\n if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {\n return instance.__reactInternalMemoizedMaskedChildContext;\n }\n\n var context = {};\n\n for (var key in contextTypes) {\n context[key] = unmaskedContext[key];\n }\n\n {\n var name = getComponentName(type) || 'Unknown';\n checkPropTypes(contextTypes, context, 'context', name, getCurrentFiberStackInDev);\n } // Cache unmasked context so we can avoid recreating masked context unless necessary.\n // Context is created before the class component is instantiated so check for instance.\n\n\n if (instance) {\n cacheContext(workInProgress, unmaskedContext, context);\n }\n\n return context;\n }\n}\n\nfunction hasContextChanged() {\n {\n return didPerformWorkStackCursor.current;\n }\n}\n\nfunction isContextProvider(type) {\n {\n var childContextTypes = type.childContextTypes;\n return childContextTypes !== null && childContextTypes !== undefined;\n }\n}\n\nfunction popContext(fiber) {\n {\n pop(didPerformWorkStackCursor, fiber);\n pop(contextStackCursor, fiber);\n }\n}\n\nfunction popTopLevelContextObject(fiber) {\n {\n pop(didPerformWorkStackCursor, fiber);\n pop(contextStackCursor, fiber);\n }\n}\n\nfunction pushTopLevelContextObject(fiber, context, didChange) {\n {\n if (!(contextStackCursor.current === emptyContextObject)) {\n {\n throw Error( \"Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n push(contextStackCursor, context, fiber);\n push(didPerformWorkStackCursor, didChange, fiber);\n }\n}\n\nfunction processChildContext(fiber, type, parentContext) {\n {\n var instance = fiber.stateNode;\n var childContextTypes = type.childContextTypes; // 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\n if (typeof instance.getChildContext !== 'function') {\n {\n var componentName = getComponentName(type) || 'Unknown';\n\n if (!warnedAboutMissingGetChildContext[componentName]) {\n warnedAboutMissingGetChildContext[componentName] = true;\n\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\n return parentContext;\n }\n\n var childContext;\n startPhaseTimer(fiber, 'getChildContext');\n childContext = instance.getChildContext();\n stopPhaseTimer();\n\n for (var contextKey in childContext) {\n if (!(contextKey in childContextTypes)) {\n {\n throw Error( (getComponentName(type) || 'Unknown') + \".getChildContext(): key \\\"\" + contextKey + \"\\\" is not defined in childContextTypes.\" );\n }\n }\n }\n\n {\n var name = getComponentName(type) || 'Unknown';\n checkPropTypes(childContextTypes, childContext, 'child context', name, // In practice, there is one case in which we won't get a stack. It's when\n // somebody calls unstable_renderSubtreeIntoContainer() and we process\n // context from the parent component instance. The stack will be missing\n // because it's outside of the reconciliation, and so the pointer has not\n // been set. This is rare and doesn't matter. We'll also remove that API.\n getCurrentFiberStackInDev);\n }\n\n return _assign({}, parentContext, {}, childContext);\n }\n}\n\nfunction pushContextProvider(workInProgress) {\n {\n var instance = workInProgress.stateNode; // We push the context as early as possible to ensure stack integrity.\n // If the instance does not exist yet, we will push null at first,\n // and replace it on the stack later when invalidating the context.\n\n var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject; // Remember the parent context so we can merge with it later.\n // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.\n\n previousContext = contextStackCursor.current;\n push(contextStackCursor, memoizedMergedChildContext, workInProgress);\n push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);\n return true;\n }\n}\n\nfunction invalidateContextProvider(workInProgress, type, didChange) {\n {\n var instance = workInProgress.stateNode;\n\n if (!instance) {\n {\n throw Error( \"Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n if (didChange) {\n // Merge parent and own context.\n // Skip this if we're not updating due to sCU.\n // This avoids unnecessarily recomputing memoized values.\n var mergedContext = processChildContext(workInProgress, type, previousContext);\n instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one.\n // It is important to unwind the context in the reverse order.\n\n pop(didPerformWorkStackCursor, workInProgress);\n pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed.\n\n push(contextStackCursor, mergedContext, workInProgress);\n push(didPerformWorkStackCursor, didChange, workInProgress);\n } else {\n pop(didPerformWorkStackCursor, workInProgress);\n push(didPerformWorkStackCursor, didChange, workInProgress);\n }\n }\n}\n\nfunction findCurrentUnmaskedContext(fiber) {\n {\n // Currently this is only used with renderSubtreeIntoContainer; not sure if it\n // makes sense elsewhere\n if (!(isFiberMounted(fiber) && fiber.tag === ClassComponent)) {\n {\n throw Error( \"Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n var node = fiber;\n\n do {\n switch (node.tag) {\n case HostRoot:\n return node.stateNode.context;\n\n case ClassComponent:\n {\n var Component = node.type;\n\n if (isContextProvider(Component)) {\n return node.stateNode.__reactInternalMemoizedMergedChildContext;\n }\n\n break;\n }\n }\n\n node = node.return;\n } while (node !== null);\n\n {\n {\n throw Error( \"Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n }\n}\n\nvar LegacyRoot = 0;\nvar BlockingRoot = 1;\nvar ConcurrentRoot = 2;\n\nvar Scheduler_runWithPriority = Scheduler.unstable_runWithPriority,\n Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback,\n Scheduler_cancelCallback = Scheduler.unstable_cancelCallback,\n Scheduler_shouldYield = Scheduler.unstable_shouldYield,\n Scheduler_requestPaint = Scheduler.unstable_requestPaint,\n Scheduler_now = Scheduler.unstable_now,\n Scheduler_getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel,\n Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority,\n Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority,\n Scheduler_NormalPriority = Scheduler.unstable_NormalPriority,\n Scheduler_LowPriority = Scheduler.unstable_LowPriority,\n Scheduler_IdlePriority = Scheduler.unstable_IdlePriority;\n\n{\n // Provide explicit error message when production+profiling bundle of e.g.\n // react-dom is used with production (non-profiling) bundle of\n // scheduler/tracing\n if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {\n {\n throw Error( \"It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling\" );\n }\n }\n}\n\nvar fakeCallbackNode = {}; // Except for NoPriority, these correspond to Scheduler priorities. We use\n// ascending numbers so we can compare them like numbers. They start at 90 to\n// avoid clashing with Scheduler's priorities.\n\nvar ImmediatePriority = 99;\nvar UserBlockingPriority$1 = 98;\nvar NormalPriority = 97;\nvar LowPriority = 96;\nvar IdlePriority = 95; // NoPriority is the absence of priority. Also React-only.\n\nvar NoPriority = 90;\nvar shouldYield = Scheduler_shouldYield;\nvar requestPaint = // Fall back gracefully if we're running an older version of Scheduler.\nScheduler_requestPaint !== undefined ? Scheduler_requestPaint : function () {};\nvar syncQueue = null;\nvar immediateQueueCallbackNode = null;\nvar isFlushingSyncQueue = false;\nvar initialTimeMs = Scheduler_now(); // If the initial timestamp is reasonably small, use Scheduler's `now` directly.\n// This will be the case for modern browsers that support `performance.now`. In\n// older browsers, Scheduler falls back to `Date.now`, which returns a Unix\n// timestamp. In that case, subtract the module initialization time to simulate\n// the behavior of performance.now and keep our times small enough to fit\n// within 32 bits.\n// TODO: Consider lifting this into Scheduler.\n\nvar now = initialTimeMs < 10000 ? Scheduler_now : function () {\n return Scheduler_now() - initialTimeMs;\n};\nfunction getCurrentPriorityLevel() {\n switch (Scheduler_getCurrentPriorityLevel()) {\n case Scheduler_ImmediatePriority:\n return ImmediatePriority;\n\n case Scheduler_UserBlockingPriority:\n return UserBlockingPriority$1;\n\n case Scheduler_NormalPriority:\n return NormalPriority;\n\n case Scheduler_LowPriority:\n return LowPriority;\n\n case Scheduler_IdlePriority:\n return IdlePriority;\n\n default:\n {\n {\n throw Error( \"Unknown priority level.\" );\n }\n }\n\n }\n}\n\nfunction reactPriorityToSchedulerPriority(reactPriorityLevel) {\n switch (reactPriorityLevel) {\n case ImmediatePriority:\n return Scheduler_ImmediatePriority;\n\n case UserBlockingPriority$1:\n return Scheduler_UserBlockingPriority;\n\n case NormalPriority:\n return Scheduler_NormalPriority;\n\n case LowPriority:\n return Scheduler_LowPriority;\n\n case IdlePriority:\n return Scheduler_IdlePriority;\n\n default:\n {\n {\n throw Error( \"Unknown priority level.\" );\n }\n }\n\n }\n}\n\nfunction runWithPriority$1(reactPriorityLevel, fn) {\n var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);\n return Scheduler_runWithPriority(priorityLevel, fn);\n}\nfunction scheduleCallback(reactPriorityLevel, callback, options) {\n var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);\n return Scheduler_scheduleCallback(priorityLevel, callback, options);\n}\nfunction scheduleSyncCallback(callback) {\n // Push this callback into an internal queue. We'll flush these either in\n // the next tick, or earlier if something calls `flushSyncCallbackQueue`.\n if (syncQueue === null) {\n syncQueue = [callback]; // Flush the queue in the next tick, at the earliest.\n\n immediateQueueCallbackNode = Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueueImpl);\n } else {\n // Push onto existing queue. Don't need to schedule a callback because\n // we already scheduled one when we created the queue.\n syncQueue.push(callback);\n }\n\n return fakeCallbackNode;\n}\nfunction cancelCallback(callbackNode) {\n if (callbackNode !== fakeCallbackNode) {\n Scheduler_cancelCallback(callbackNode);\n }\n}\nfunction flushSyncCallbackQueue() {\n if (immediateQueueCallbackNode !== null) {\n var node = immediateQueueCallbackNode;\n immediateQueueCallbackNode = null;\n Scheduler_cancelCallback(node);\n }\n\n flushSyncCallbackQueueImpl();\n}\n\nfunction flushSyncCallbackQueueImpl() {\n if (!isFlushingSyncQueue && syncQueue !== null) {\n // Prevent re-entrancy.\n isFlushingSyncQueue = true;\n var i = 0;\n\n try {\n var _isSync = true;\n var queue = syncQueue;\n runWithPriority$1(ImmediatePriority, function () {\n for (; i < queue.length; i++) {\n var callback = queue[i];\n\n do {\n callback = callback(_isSync);\n } while (callback !== null);\n }\n });\n syncQueue = null;\n } catch (error) {\n // If something throws, leave the remaining callbacks on the queue.\n if (syncQueue !== null) {\n syncQueue = syncQueue.slice(i + 1);\n } // Resume flushing in the next tick\n\n\n Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueue);\n throw error;\n } finally {\n isFlushingSyncQueue = false;\n }\n }\n}\n\nvar NoMode = 0;\nvar StrictMode = 1; // TODO: Remove BlockingMode and ConcurrentMode by reading from the root\n// tag instead\n\nvar BlockingMode = 2;\nvar ConcurrentMode = 4;\nvar ProfileMode = 8;\n\n// Max 31 bit integer. The max integer size in V8 for 32-bit systems.\n// Math.pow(2, 30) - 1\n// 0b111111111111111111111111111111\nvar MAX_SIGNED_31_BIT_INT = 1073741823;\n\nvar NoWork = 0; // TODO: Think of a better name for Never. The key difference with Idle is that\n// Never work can be committed in an inconsistent state without tearing the UI.\n// The main example is offscreen content, like a hidden subtree. So one possible\n// name is Offscreen. However, it also includes dehydrated Suspense boundaries,\n// which are inconsistent in the sense that they haven't finished yet, but\n// aren't visibly inconsistent because the server rendered HTML matches what the\n// hydrated tree would look like.\n\nvar Never = 1; // Idle is slightly higher priority than Never. It must completely finish in\n// order to be consistent.\n\nvar Idle = 2; // Continuous Hydration is slightly higher than Idle and is used to increase\n// priority of hover targets.\n\nvar ContinuousHydration = 3;\nvar Sync = MAX_SIGNED_31_BIT_INT;\nvar Batched = Sync - 1;\nvar UNIT_SIZE = 10;\nvar MAGIC_NUMBER_OFFSET = Batched - 1; // 1 unit of expiration time represents 10ms.\n\nfunction msToExpirationTime(ms) {\n // Always subtract from the offset so that we don't clash with the magic number for NoWork.\n return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);\n}\nfunction expirationTimeToMs(expirationTime) {\n return (MAGIC_NUMBER_OFFSET - expirationTime) * UNIT_SIZE;\n}\n\nfunction ceiling(num, precision) {\n return ((num / precision | 0) + 1) * precision;\n}\n\nfunction computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) {\n return MAGIC_NUMBER_OFFSET - ceiling(MAGIC_NUMBER_OFFSET - currentTime + expirationInMs / UNIT_SIZE, bucketSizeMs / UNIT_SIZE);\n} // TODO: This corresponds to Scheduler's NormalPriority, not LowPriority. Update\n// the names to reflect.\n\n\nvar LOW_PRIORITY_EXPIRATION = 5000;\nvar LOW_PRIORITY_BATCH_SIZE = 250;\nfunction computeAsyncExpiration(currentTime) {\n return computeExpirationBucket(currentTime, LOW_PRIORITY_EXPIRATION, LOW_PRIORITY_BATCH_SIZE);\n}\nfunction computeSuspenseExpiration(currentTime, timeoutMs) {\n // TODO: Should we warn if timeoutMs is lower than the normal pri expiration time?\n return computeExpirationBucket(currentTime, timeoutMs, LOW_PRIORITY_BATCH_SIZE);\n} // We intentionally set a higher expiration time for interactive updates in\n// dev than in production.\n//\n// If the main thread is being blocked so long that you hit the expiration,\n// it's a problem that could be solved with better scheduling.\n//\n// People will be more likely to notice this and fix it with the long\n// expiration time in development.\n//\n// In production we opt for better UX at the risk of masking scheduling\n// problems, by expiring fast.\n\nvar HIGH_PRIORITY_EXPIRATION = 500 ;\nvar HIGH_PRIORITY_BATCH_SIZE = 100;\nfunction computeInteractiveExpiration(currentTime) {\n return computeExpirationBucket(currentTime, HIGH_PRIORITY_EXPIRATION, HIGH_PRIORITY_BATCH_SIZE);\n}\nfunction inferPriorityFromExpirationTime(currentTime, expirationTime) {\n if (expirationTime === Sync) {\n return ImmediatePriority;\n }\n\n if (expirationTime === Never || expirationTime === Idle) {\n return IdlePriority;\n }\n\n var msUntil = expirationTimeToMs(expirationTime) - expirationTimeToMs(currentTime);\n\n if (msUntil <= 0) {\n return ImmediatePriority;\n }\n\n if (msUntil <= HIGH_PRIORITY_EXPIRATION + HIGH_PRIORITY_BATCH_SIZE) {\n return UserBlockingPriority$1;\n }\n\n if (msUntil <= LOW_PRIORITY_EXPIRATION + LOW_PRIORITY_BATCH_SIZE) {\n return NormalPriority;\n } // TODO: Handle LowPriority\n // Assume anything lower has idle priority\n\n\n return IdlePriority;\n}\n\nvar ReactStrictModeWarnings = {\n recordUnsafeLifecycleWarnings: function (fiber, instance) {},\n flushPendingUnsafeLifecycleWarnings: function () {},\n recordLegacyContextWarning: function (fiber, instance) {},\n flushLegacyContextWarning: function () {},\n discardPendingWarnings: function () {}\n};\n\n{\n var findStrictRoot = function (fiber) {\n var maybeStrictRoot = null;\n var node = fiber;\n\n while (node !== null) {\n if (node.mode & StrictMode) {\n maybeStrictRoot = node;\n }\n\n node = node.return;\n }\n\n return maybeStrictRoot;\n };\n\n var setToSortedString = function (set) {\n var array = [];\n set.forEach(function (value) {\n array.push(value);\n });\n return array.sort().join(', ');\n };\n\n var pendingComponentWillMountWarnings = [];\n var pendingUNSAFE_ComponentWillMountWarnings = [];\n var pendingComponentWillReceivePropsWarnings = [];\n var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];\n var pendingComponentWillUpdateWarnings = [];\n var pendingUNSAFE_ComponentWillUpdateWarnings = []; // Tracks components we have already warned about.\n\n var didWarnAboutUnsafeLifecycles = new Set();\n\n ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) {\n // Dedup strategy: Warn once per component.\n if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {\n return;\n }\n\n if (typeof instance.componentWillMount === 'function' && // Don't warn about react-lifecycles-compat polyfilled components.\n instance.componentWillMount.__suppressDeprecationWarning !== true) {\n pendingComponentWillMountWarnings.push(fiber);\n }\n\n if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillMount === 'function') {\n pendingUNSAFE_ComponentWillMountWarnings.push(fiber);\n }\n\n if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {\n pendingComponentWillReceivePropsWarnings.push(fiber);\n }\n\n if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillReceiveProps === 'function') {\n pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);\n }\n\n if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {\n pendingComponentWillUpdateWarnings.push(fiber);\n }\n\n if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillUpdate === 'function') {\n pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);\n }\n };\n\n ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () {\n // We do an initial pass to gather component names\n var componentWillMountUniqueNames = new Set();\n\n if (pendingComponentWillMountWarnings.length > 0) {\n pendingComponentWillMountWarnings.forEach(function (fiber) {\n componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingComponentWillMountWarnings = [];\n }\n\n var UNSAFE_componentWillMountUniqueNames = new Set();\n\n if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {\n pendingUNSAFE_ComponentWillMountWarnings.forEach(function (fiber) {\n UNSAFE_componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingUNSAFE_ComponentWillMountWarnings = [];\n }\n\n var componentWillReceivePropsUniqueNames = new Set();\n\n if (pendingComponentWillReceivePropsWarnings.length > 0) {\n pendingComponentWillReceivePropsWarnings.forEach(function (fiber) {\n componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingComponentWillReceivePropsWarnings = [];\n }\n\n var UNSAFE_componentWillReceivePropsUniqueNames = new Set();\n\n if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {\n pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function (fiber) {\n UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingUNSAFE_ComponentWillReceivePropsWarnings = [];\n }\n\n var componentWillUpdateUniqueNames = new Set();\n\n if (pendingComponentWillUpdateWarnings.length > 0) {\n pendingComponentWillUpdateWarnings.forEach(function (fiber) {\n componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingComponentWillUpdateWarnings = [];\n }\n\n var UNSAFE_componentWillUpdateUniqueNames = new Set();\n\n if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {\n pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function (fiber) {\n UNSAFE_componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingUNSAFE_ComponentWillUpdateWarnings = [];\n } // Finally, we flush all the warnings\n // UNSAFE_ ones before the deprecated ones, since they'll be 'louder'\n\n\n if (UNSAFE_componentWillMountUniqueNames.size > 0) {\n var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);\n\n error('Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\\n\\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\\n' + '\\nPlease update the following components: %s', sortedNames);\n }\n\n if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {\n var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);\n\n error('Using UNSAFE_componentWillReceiveProps in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\\n\\n' + '* Move data fetching code or side effects to componentDidUpdate.\\n' + \"* If you're updating state whenever props change, \" + 'refactor your code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\\n' + '\\nPlease update the following components: %s', _sortedNames);\n }\n\n if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {\n var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);\n\n error('Using UNSAFE_componentWillUpdate in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\\n\\n' + '* Move data fetching code or side effects to componentDidUpdate.\\n' + '\\nPlease update the following components: %s', _sortedNames2);\n }\n\n if (componentWillMountUniqueNames.size > 0) {\n var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);\n\n warn('componentWillMount has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\\n\\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\\n' + '* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\\n' + '\\nPlease update the following components: %s', _sortedNames3);\n }\n\n if (componentWillReceivePropsUniqueNames.size > 0) {\n var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);\n\n warn('componentWillReceiveProps has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\\n\\n' + '* Move data fetching code or side effects to componentDidUpdate.\\n' + \"* If you're updating state whenever props change, refactor your \" + 'code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\\n' + '* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\\n' + '\\nPlease update the following components: %s', _sortedNames4);\n }\n\n if (componentWillUpdateUniqueNames.size > 0) {\n var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);\n\n warn('componentWillUpdate has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\\n\\n' + '* Move data fetching code or side effects to componentDidUpdate.\\n' + '* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\\n' + '\\nPlease update the following components: %s', _sortedNames5);\n }\n };\n\n var pendingLegacyContextWarning = new Map(); // Tracks components we have already warned about.\n\n var didWarnAboutLegacyContext = new Set();\n\n ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) {\n var strictRoot = findStrictRoot(fiber);\n\n if (strictRoot === null) {\n error('Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.');\n\n return;\n } // Dedup strategy: Warn once per component.\n\n\n if (didWarnAboutLegacyContext.has(fiber.type)) {\n return;\n }\n\n var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);\n\n if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === 'function') {\n if (warningsForRoot === undefined) {\n warningsForRoot = [];\n pendingLegacyContextWarning.set(strictRoot, warningsForRoot);\n }\n\n warningsForRoot.push(fiber);\n }\n };\n\n ReactStrictModeWarnings.flushLegacyContextWarning = function () {\n pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) {\n if (fiberArray.length === 0) {\n return;\n }\n\n var firstFiber = fiberArray[0];\n var uniqueNames = new Set();\n fiberArray.forEach(function (fiber) {\n uniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutLegacyContext.add(fiber.type);\n });\n var sortedNames = setToSortedString(uniqueNames);\n var firstComponentStack = getStackByFiberInDevAndProd(firstFiber);\n\n error('Legacy context API has been detected within a strict-mode tree.' + '\\n\\nThe old API will be supported in all 16.x releases, but applications ' + 'using it should migrate to the new version.' + '\\n\\nPlease update the following components: %s' + '\\n\\nLearn more about this warning here: https://fb.me/react-legacy-context' + '%s', sortedNames, firstComponentStack);\n });\n };\n\n ReactStrictModeWarnings.discardPendingWarnings = function () {\n pendingComponentWillMountWarnings = [];\n pendingUNSAFE_ComponentWillMountWarnings = [];\n pendingComponentWillReceivePropsWarnings = [];\n pendingUNSAFE_ComponentWillReceivePropsWarnings = [];\n pendingComponentWillUpdateWarnings = [];\n pendingUNSAFE_ComponentWillUpdateWarnings = [];\n pendingLegacyContextWarning = new Map();\n };\n}\n\nvar resolveFamily = null; // $FlowFixMe Flow gets confused by a WeakSet feature check below.\n\nvar failedBoundaries = null;\nvar setRefreshHandler = function (handler) {\n {\n resolveFamily = handler;\n }\n};\nfunction resolveFunctionForHotReloading(type) {\n {\n if (resolveFamily === null) {\n // Hot reloading is disabled.\n return type;\n }\n\n var family = resolveFamily(type);\n\n if (family === undefined) {\n return type;\n } // Use the latest known implementation.\n\n\n return family.current;\n }\n}\nfunction resolveClassForHotReloading(type) {\n // No implementation differences.\n return resolveFunctionForHotReloading(type);\n}\nfunction resolveForwardRefForHotReloading(type) {\n {\n if (resolveFamily === null) {\n // Hot reloading is disabled.\n return type;\n }\n\n var family = resolveFamily(type);\n\n if (family === undefined) {\n // Check if we're dealing with a real forwardRef. Don't want to crash early.\n if (type !== null && type !== undefined && typeof type.render === 'function') {\n // ForwardRef is special because its resolved .type is an object,\n // but it's possible that we only have its inner render function in the map.\n // If that inner render function is different, we'll build a new forwardRef type.\n var currentRender = resolveFunctionForHotReloading(type.render);\n\n if (type.render !== currentRender) {\n var syntheticType = {\n $$typeof: REACT_FORWARD_REF_TYPE,\n render: currentRender\n };\n\n if (type.displayName !== undefined) {\n syntheticType.displayName = type.displayName;\n }\n\n return syntheticType;\n }\n }\n\n return type;\n } // Use the latest known implementation.\n\n\n return family.current;\n }\n}\nfunction isCompatibleFamilyForHotReloading(fiber, element) {\n {\n if (resolveFamily === null) {\n // Hot reloading is disabled.\n return false;\n }\n\n var prevType = fiber.elementType;\n var nextType = element.type; // If we got here, we know types aren't === equal.\n\n var needsCompareFamilies = false;\n var $$typeofNextType = typeof nextType === 'object' && nextType !== null ? nextType.$$typeof : null;\n\n switch (fiber.tag) {\n case ClassComponent:\n {\n if (typeof nextType === 'function') {\n needsCompareFamilies = true;\n }\n\n break;\n }\n\n case FunctionComponent:\n {\n if (typeof nextType === 'function') {\n needsCompareFamilies = true;\n } else if ($$typeofNextType === REACT_LAZY_TYPE) {\n // We don't know the inner type yet.\n // We're going to assume that the lazy inner type is stable,\n // and so it is sufficient to avoid reconciling it away.\n // We're not going to unwrap or actually use the new lazy type.\n needsCompareFamilies = true;\n }\n\n break;\n }\n\n case ForwardRef:\n {\n if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {\n needsCompareFamilies = true;\n } else if ($$typeofNextType === REACT_LAZY_TYPE) {\n needsCompareFamilies = true;\n }\n\n break;\n }\n\n case MemoComponent:\n case SimpleMemoComponent:\n {\n if ($$typeofNextType === REACT_MEMO_TYPE) {\n // TODO: if it was but can no longer be simple,\n // we shouldn't set this.\n needsCompareFamilies = true;\n } else if ($$typeofNextType === REACT_LAZY_TYPE) {\n needsCompareFamilies = true;\n }\n\n break;\n }\n\n default:\n return false;\n } // Check if both types have a family and it's the same one.\n\n\n if (needsCompareFamilies) {\n // Note: memo() and forwardRef() we'll compare outer rather than inner type.\n // This means both of them need to be registered to preserve state.\n // If we unwrapped and compared the inner types for wrappers instead,\n // then we would risk falsely saying two separate memo(Foo)\n // calls are equivalent because they wrap the same Foo function.\n var prevFamily = resolveFamily(prevType);\n\n if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) {\n return true;\n }\n }\n\n return false;\n }\n}\nfunction markFailedErrorBoundaryForHotReloading(fiber) {\n {\n if (resolveFamily === null) {\n // Hot reloading is disabled.\n return;\n }\n\n if (typeof WeakSet !== 'function') {\n return;\n }\n\n if (failedBoundaries === null) {\n failedBoundaries = new WeakSet();\n }\n\n failedBoundaries.add(fiber);\n }\n}\nvar scheduleRefresh = function (root, update) {\n {\n if (resolveFamily === null) {\n // Hot reloading is disabled.\n return;\n }\n\n var staleFamilies = update.staleFamilies,\n updatedFamilies = update.updatedFamilies;\n flushPassiveEffects();\n flushSync(function () {\n scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies);\n });\n }\n};\nvar scheduleRoot = function (root, element) {\n {\n if (root.context !== emptyContextObject) {\n // Super edge case: root has a legacy _renderSubtree context\n // but we don't know the parentComponent so we can't pass it.\n // Just ignore. We'll delete this with _renderSubtree code path later.\n return;\n }\n\n flushPassiveEffects();\n syncUpdates(function () {\n updateContainer(element, root, null, null);\n });\n }\n};\n\nfunction scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {\n {\n var alternate = fiber.alternate,\n child = fiber.child,\n sibling = fiber.sibling,\n tag = fiber.tag,\n type = fiber.type;\n var candidateType = null;\n\n switch (tag) {\n case FunctionComponent:\n case SimpleMemoComponent:\n case ClassComponent:\n candidateType = type;\n break;\n\n case ForwardRef:\n candidateType = type.render;\n break;\n }\n\n if (resolveFamily === null) {\n throw new Error('Expected resolveFamily to be set during hot reload.');\n }\n\n var needsRender = false;\n var needsRemount = false;\n\n if (candidateType !== null) {\n var family = resolveFamily(candidateType);\n\n if (family !== undefined) {\n if (staleFamilies.has(family)) {\n needsRemount = true;\n } else if (updatedFamilies.has(family)) {\n if (tag === ClassComponent) {\n needsRemount = true;\n } else {\n needsRender = true;\n }\n }\n }\n }\n\n if (failedBoundaries !== null) {\n if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {\n needsRemount = true;\n }\n }\n\n if (needsRemount) {\n fiber._debugNeedsRemount = true;\n }\n\n if (needsRemount || needsRender) {\n scheduleWork(fiber, Sync);\n }\n\n if (child !== null && !needsRemount) {\n scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);\n }\n\n if (sibling !== null) {\n scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);\n }\n }\n}\n\nvar findHostInstancesForRefresh = function (root, families) {\n {\n var hostInstances = new Set();\n var types = new Set(families.map(function (family) {\n return family.current;\n }));\n findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances);\n return hostInstances;\n }\n};\n\nfunction findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {\n {\n var child = fiber.child,\n sibling = fiber.sibling,\n tag = fiber.tag,\n type = fiber.type;\n var candidateType = null;\n\n switch (tag) {\n case FunctionComponent:\n case SimpleMemoComponent:\n case ClassComponent:\n candidateType = type;\n break;\n\n case ForwardRef:\n candidateType = type.render;\n break;\n }\n\n var didMatch = false;\n\n if (candidateType !== null) {\n if (types.has(candidateType)) {\n didMatch = true;\n }\n }\n\n if (didMatch) {\n // We have a match. This only drills down to the closest host components.\n // There's no need to search deeper because for the purpose of giving\n // visual feedback, \"flashing\" outermost parent rectangles is sufficient.\n findHostInstancesForFiberShallowly(fiber, hostInstances);\n } else {\n // If there's no match, maybe there will be one further down in the child tree.\n if (child !== null) {\n findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);\n }\n }\n\n if (sibling !== null) {\n findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);\n }\n }\n}\n\nfunction findHostInstancesForFiberShallowly(fiber, hostInstances) {\n {\n var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);\n\n if (foundHostInstances) {\n return;\n } // If we didn't find any host children, fallback to closest host parent.\n\n\n var node = fiber;\n\n while (true) {\n switch (node.tag) {\n case HostComponent:\n hostInstances.add(node.stateNode);\n return;\n\n case HostPortal:\n hostInstances.add(node.stateNode.containerInfo);\n return;\n\n case HostRoot:\n hostInstances.add(node.stateNode.containerInfo);\n return;\n }\n\n if (node.return === null) {\n throw new Error('Expected to reach root first.');\n }\n\n node = node.return;\n }\n }\n}\n\nfunction findChildHostInstancesForFiberShallowly(fiber, hostInstances) {\n {\n var node = fiber;\n var foundHostInstances = false;\n\n while (true) {\n if (node.tag === HostComponent) {\n // We got a match.\n foundHostInstances = true;\n hostInstances.add(node.stateNode); // There may still be more, so keep searching.\n } else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === fiber) {\n return foundHostInstances;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === fiber) {\n return foundHostInstances;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n }\n\n return false;\n}\n\nfunction resolveDefaultProps(Component, baseProps) {\n if (Component && Component.defaultProps) {\n // Resolve default props. Taken from ReactElement\n var props = _assign({}, baseProps);\n\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}\nfunction readLazyComponentType(lazyComponent) {\n initializeLazyComponentType(lazyComponent);\n\n if (lazyComponent._status !== Resolved) {\n throw lazyComponent._result;\n }\n\n return lazyComponent._result;\n}\n\nvar valueCursor = createCursor(null);\nvar rendererSigil;\n\n{\n // Use this to detect multiple renderers using the same context\n rendererSigil = {};\n}\n\nvar currentlyRenderingFiber = null;\nvar lastContextDependency = null;\nvar lastContextWithAllBitsObserved = null;\nvar isDisallowedContextReadInDEV = false;\nfunction resetContextDependencies() {\n // This is called right before React yields execution, to ensure `readContext`\n // cannot be called outside the render phase.\n currentlyRenderingFiber = null;\n lastContextDependency = null;\n lastContextWithAllBitsObserved = null;\n\n {\n isDisallowedContextReadInDEV = false;\n }\n}\nfunction enterDisallowedContextReadInDEV() {\n {\n isDisallowedContextReadInDEV = true;\n }\n}\nfunction exitDisallowedContextReadInDEV() {\n {\n isDisallowedContextReadInDEV = false;\n }\n}\nfunction pushProvider(providerFiber, nextValue) {\n var context = providerFiber.type._context;\n\n {\n push(valueCursor, context._currentValue, providerFiber);\n context._currentValue = nextValue;\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}\nfunction popProvider(providerFiber) {\n var currentValue = valueCursor.current;\n pop(valueCursor, providerFiber);\n var context = providerFiber.type._context;\n\n {\n context._currentValue = currentValue;\n }\n}\nfunction calculateChangedBits(context, newValue, oldValue) {\n if (objectIs(oldValue, newValue)) {\n // No change\n return 0;\n } else {\n var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;\n\n {\n if ((changedBits & MAX_SIGNED_31_BIT_INT) !== changedBits) {\n error('calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits);\n }\n }\n\n return changedBits | 0;\n }\n}\nfunction scheduleWorkOnParentPath(parent, renderExpirationTime) {\n // Update the child expiration time of all the ancestors, including\n // the alternates.\n var node = parent;\n\n while (node !== null) {\n var alternate = node.alternate;\n\n if (node.childExpirationTime < renderExpirationTime) {\n node.childExpirationTime = renderExpirationTime;\n\n if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {\n alternate.childExpirationTime = renderExpirationTime;\n }\n } else if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {\n alternate.childExpirationTime = renderExpirationTime;\n } else {\n // Neither alternate was updated, which means the rest of the\n // ancestor path already has sufficient priority.\n break;\n }\n\n node = node.return;\n }\n}\nfunction propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) {\n var fiber = workInProgress.child;\n\n if (fiber !== null) {\n // Set the return pointer of the child to the work-in-progress fiber.\n fiber.return = workInProgress;\n }\n\n while (fiber !== null) {\n var nextFiber = void 0; // Visit this fiber.\n\n var list = fiber.dependencies;\n\n if (list !== null) {\n nextFiber = fiber.child;\n var dependency = list.firstContext;\n\n while (dependency !== null) {\n // Check if the context matches.\n if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) {\n // Match! Schedule an update on this fiber.\n if (fiber.tag === ClassComponent) {\n // Schedule a force update on the work-in-progress.\n var update = createUpdate(renderExpirationTime, null);\n update.tag = ForceUpdate; // TODO: Because we don't have a work-in-progress, this will add the\n // update to the current fiber, too, which means it will persist even if\n // this render is thrown away. Since it's a race condition, not sure it's\n // worth fixing.\n\n enqueueUpdate(fiber, update);\n }\n\n if (fiber.expirationTime < renderExpirationTime) {\n fiber.expirationTime = renderExpirationTime;\n }\n\n var alternate = fiber.alternate;\n\n if (alternate !== null && alternate.expirationTime < renderExpirationTime) {\n alternate.expirationTime = renderExpirationTime;\n }\n\n scheduleWorkOnParentPath(fiber.return, renderExpirationTime); // Mark the expiration time on the list, too.\n\n if (list.expirationTime < renderExpirationTime) {\n list.expirationTime = renderExpirationTime;\n } // Since we already found a match, we can stop traversing the\n // dependency list.\n\n\n break;\n }\n\n dependency = dependency.next;\n }\n } else if (fiber.tag === ContextProvider) {\n // Don't scan deeper if this is a matching provider\n nextFiber = fiber.type === workInProgress.type ? null : fiber.child;\n } else {\n // Traverse down.\n nextFiber = fiber.child;\n }\n\n if (nextFiber !== null) {\n // Set the return pointer of the child to the work-in-progress fiber.\n nextFiber.return = fiber;\n } else {\n // No child. Traverse to next sibling.\n nextFiber = fiber;\n\n while (nextFiber !== null) {\n if (nextFiber === workInProgress) {\n // We're back to the root of this subtree. Exit.\n nextFiber = null;\n break;\n }\n\n var sibling = nextFiber.sibling;\n\n if (sibling !== null) {\n // Set the return pointer of the sibling to the work-in-progress fiber.\n sibling.return = nextFiber.return;\n nextFiber = sibling;\n break;\n } // No more siblings. Traverse up.\n\n\n nextFiber = nextFiber.return;\n }\n }\n\n fiber = nextFiber;\n }\n}\nfunction prepareToReadContext(workInProgress, renderExpirationTime) {\n currentlyRenderingFiber = workInProgress;\n lastContextDependency = null;\n lastContextWithAllBitsObserved = null;\n var dependencies = workInProgress.dependencies;\n\n if (dependencies !== null) {\n var firstContext = dependencies.firstContext;\n\n if (firstContext !== null) {\n if (dependencies.expirationTime >= renderExpirationTime) {\n // Context list has a pending update. Mark that this fiber performed work.\n markWorkInProgressReceivedUpdate();\n } // Reset the work-in-progress list\n\n\n dependencies.firstContext = null;\n }\n }\n}\nfunction readContext(context, observedBits) {\n {\n // This warning would fire if you read context inside a Hook like useMemo.\n // Unlike the class check below, it's not enforced in production for perf.\n if (isDisallowedContextReadInDEV) {\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\n if (lastContextWithAllBitsObserved === context) ; else if (observedBits === false || observedBits === 0) ; else {\n var resolvedObservedBits; // Avoid deopting on observable arguments or heterogeneous types.\n\n if (typeof observedBits !== 'number' || observedBits === MAX_SIGNED_31_BIT_INT) {\n // Observe all updates.\n lastContextWithAllBitsObserved = context;\n resolvedObservedBits = MAX_SIGNED_31_BIT_INT;\n } else {\n resolvedObservedBits = observedBits;\n }\n\n var contextItem = {\n context: context,\n observedBits: resolvedObservedBits,\n next: null\n };\n\n if (lastContextDependency === null) {\n if (!(currentlyRenderingFiber !== null)) {\n {\n throw 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 } // This is the first dependency for this component. Create a new list.\n\n\n lastContextDependency = contextItem;\n currentlyRenderingFiber.dependencies = {\n expirationTime: NoWork,\n firstContext: contextItem,\n responders: null\n };\n } else {\n // Append a new context item.\n lastContextDependency = lastContextDependency.next = contextItem;\n }\n }\n\n return context._currentValue ;\n}\n\nvar UpdateState = 0;\nvar ReplaceState = 1;\nvar ForceUpdate = 2;\nvar CaptureUpdate = 3; // Global state that is reset at the beginning of calling `processUpdateQueue`.\n// It should only be read right after calling `processUpdateQueue`, via\n// `checkHasForceUpdateAfterProcessing`.\n\nvar hasForceUpdate = false;\nvar didWarnUpdateInsideUpdate;\nvar currentlyProcessingQueue;\n\n{\n didWarnUpdateInsideUpdate = false;\n currentlyProcessingQueue = null;\n}\n\nfunction initializeUpdateQueue(fiber) {\n var queue = {\n baseState: fiber.memoizedState,\n baseQueue: null,\n shared: {\n pending: null\n },\n effects: null\n };\n fiber.updateQueue = queue;\n}\nfunction cloneUpdateQueue(current, workInProgress) {\n // Clone the update queue from current. Unless it's already a clone.\n var queue = workInProgress.updateQueue;\n var currentQueue = current.updateQueue;\n\n if (queue === currentQueue) {\n var clone = {\n baseState: currentQueue.baseState,\n baseQueue: currentQueue.baseQueue,\n shared: currentQueue.shared,\n effects: currentQueue.effects\n };\n workInProgress.updateQueue = clone;\n }\n}\nfunction createUpdate(expirationTime, suspenseConfig) {\n var update = {\n expirationTime: expirationTime,\n suspenseConfig: suspenseConfig,\n tag: UpdateState,\n payload: null,\n callback: null,\n next: null\n };\n update.next = update;\n\n {\n update.priority = getCurrentPriorityLevel();\n }\n\n return update;\n}\nfunction enqueueUpdate(fiber, update) {\n var updateQueue = fiber.updateQueue;\n\n if (updateQueue === null) {\n // Only occurs if the fiber has been unmounted.\n return;\n }\n\n var sharedQueue = updateQueue.shared;\n var pending = sharedQueue.pending;\n\n if (pending === null) {\n // This is the first update. Create a circular list.\n update.next = update;\n } else {\n update.next = pending.next;\n pending.next = update;\n }\n\n sharedQueue.pending = update;\n\n {\n if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {\n error('An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.');\n\n didWarnUpdateInsideUpdate = true;\n }\n }\n}\nfunction enqueueCapturedUpdate(workInProgress, update) {\n var current = workInProgress.alternate;\n\n if (current !== null) {\n // Ensure the work-in-progress queue is a clone\n cloneUpdateQueue(current, workInProgress);\n } // Captured updates go only on the work-in-progress queue.\n\n\n var queue = workInProgress.updateQueue; // Append the update to the end of the list.\n\n var last = queue.baseQueue;\n\n if (last === null) {\n queue.baseQueue = update.next = update;\n update.next = update;\n } else {\n update.next = last.next;\n last.next = update;\n }\n}\n\nfunction getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) {\n switch (update.tag) {\n case ReplaceState:\n {\n var payload = update.payload;\n\n if (typeof payload === 'function') {\n // Updater function\n {\n enterDisallowedContextReadInDEV();\n\n if ( workInProgress.mode & StrictMode) {\n payload.call(instance, prevState, nextProps);\n }\n }\n\n var nextState = payload.call(instance, prevState, nextProps);\n\n {\n exitDisallowedContextReadInDEV();\n }\n\n return nextState;\n } // State object\n\n\n return payload;\n }\n\n case CaptureUpdate:\n {\n workInProgress.effectTag = workInProgress.effectTag & ~ShouldCapture | DidCapture;\n }\n // Intentional fallthrough\n\n case UpdateState:\n {\n var _payload = update.payload;\n var partialState;\n\n if (typeof _payload === 'function') {\n // Updater function\n {\n enterDisallowedContextReadInDEV();\n\n if ( workInProgress.mode & StrictMode) {\n _payload.call(instance, prevState, nextProps);\n }\n }\n\n partialState = _payload.call(instance, prevState, nextProps);\n\n {\n exitDisallowedContextReadInDEV();\n }\n } else {\n // Partial state object\n partialState = _payload;\n }\n\n if (partialState === null || partialState === undefined) {\n // Null and undefined are treated as no-ops.\n return prevState;\n } // Merge the partial state and the previous state.\n\n\n return _assign({}, prevState, partialState);\n }\n\n case ForceUpdate:\n {\n hasForceUpdate = true;\n return prevState;\n }\n }\n\n return prevState;\n}\n\nfunction processUpdateQueue(workInProgress, props, instance, renderExpirationTime) {\n // This is always non-null on a ClassComponent or HostRoot\n var queue = workInProgress.updateQueue;\n hasForceUpdate = false;\n\n {\n currentlyProcessingQueue = queue.shared;\n } // The last rebase update that is NOT part of the base state.\n\n\n var baseQueue = queue.baseQueue; // The last pending update that hasn't been processed yet.\n\n var pendingQueue = queue.shared.pending;\n\n if (pendingQueue !== null) {\n // We have new updates that haven't been processed yet.\n // We'll add them to the base queue.\n if (baseQueue !== null) {\n // Merge the pending queue and the base queue.\n var baseFirst = baseQueue.next;\n var pendingFirst = pendingQueue.next;\n baseQueue.next = pendingFirst;\n pendingQueue.next = baseFirst;\n }\n\n baseQueue = pendingQueue;\n queue.shared.pending = null; // TODO: Pass `current` as argument\n\n var current = workInProgress.alternate;\n\n if (current !== null) {\n var currentQueue = current.updateQueue;\n\n if (currentQueue !== null) {\n currentQueue.baseQueue = pendingQueue;\n }\n }\n } // These values may change as we process the queue.\n\n\n if (baseQueue !== null) {\n var first = baseQueue.next; // Iterate through the list of updates to compute the result.\n\n var newState = queue.baseState;\n var newExpirationTime = NoWork;\n var newBaseState = null;\n var newBaseQueueFirst = null;\n var newBaseQueueLast = null;\n\n if (first !== null) {\n var update = first;\n\n do {\n var updateExpirationTime = update.expirationTime;\n\n if (updateExpirationTime < renderExpirationTime) {\n // Priority is insufficient. Skip this update. If this is the first\n // skipped update, the previous update/state is the new base\n // update/state.\n var clone = {\n expirationTime: update.expirationTime,\n suspenseConfig: update.suspenseConfig,\n tag: update.tag,\n payload: update.payload,\n callback: update.callback,\n next: null\n };\n\n if (newBaseQueueLast === null) {\n newBaseQueueFirst = newBaseQueueLast = clone;\n newBaseState = newState;\n } else {\n newBaseQueueLast = newBaseQueueLast.next = clone;\n } // Update the remaining priority in the queue.\n\n\n if (updateExpirationTime > newExpirationTime) {\n newExpirationTime = updateExpirationTime;\n }\n } else {\n // This update does have sufficient priority.\n if (newBaseQueueLast !== null) {\n var _clone = {\n expirationTime: Sync,\n // This update is going to be committed so we never want uncommit it.\n suspenseConfig: update.suspenseConfig,\n tag: update.tag,\n payload: update.payload,\n callback: update.callback,\n next: null\n };\n newBaseQueueLast = newBaseQueueLast.next = _clone;\n } // Mark the event time of this update as relevant to this render pass.\n // TODO: This should ideally use the true event time of this update rather than\n // its priority which is a derived and not reverseable value.\n // TODO: We should skip this update if it was already committed but currently\n // we have no way of detecting the difference between a committed and suspended\n // update here.\n\n\n markRenderEventTimeAndConfig(updateExpirationTime, update.suspenseConfig); // Process this update.\n\n newState = getStateFromUpdate(workInProgress, queue, update, newState, props, instance);\n var callback = update.callback;\n\n if (callback !== null) {\n workInProgress.effectTag |= Callback;\n var effects = queue.effects;\n\n if (effects === null) {\n queue.effects = [update];\n } else {\n effects.push(update);\n }\n }\n }\n\n update = update.next;\n\n if (update === null || update === first) {\n pendingQueue = queue.shared.pending;\n\n if (pendingQueue === null) {\n break;\n } else {\n // An update was scheduled from inside a reducer. Add the new\n // pending updates to the end of the list and keep processing.\n update = baseQueue.next = pendingQueue.next;\n pendingQueue.next = first;\n queue.baseQueue = baseQueue = pendingQueue;\n queue.shared.pending = null;\n }\n }\n } while (true);\n }\n\n if (newBaseQueueLast === null) {\n newBaseState = newState;\n } else {\n newBaseQueueLast.next = newBaseQueueFirst;\n }\n\n queue.baseState = newBaseState;\n queue.baseQueue = newBaseQueueLast; // Set the remaining expiration time to be whatever is remaining in the queue.\n // This should be fine because the only two other things that contribute to\n // expiration time are props and context. We're already in the middle of the\n // begin phase by the time we start processing the queue, so we've already\n // dealt with the props. Context in components that specify\n // shouldComponentUpdate is tricky; but we'll have to account for\n // that regardless.\n\n markUnprocessedUpdateTime(newExpirationTime);\n workInProgress.expirationTime = newExpirationTime;\n workInProgress.memoizedState = newState;\n }\n\n {\n currentlyProcessingQueue = null;\n }\n}\n\nfunction callCallback(callback, context) {\n if (!(typeof callback === 'function')) {\n {\n throw Error( \"Invalid argument passed as callback. Expected a function. Instead received: \" + callback );\n }\n }\n\n callback.call(context);\n}\n\nfunction resetHasForceUpdateBeforeProcessing() {\n hasForceUpdate = false;\n}\nfunction checkHasForceUpdateAfterProcessing() {\n return hasForceUpdate;\n}\nfunction commitUpdateQueue(finishedWork, finishedQueue, instance) {\n // Commit the effects\n var effects = finishedQueue.effects;\n finishedQueue.effects = null;\n\n if (effects !== null) {\n for (var i = 0; i < effects.length; i++) {\n var effect = effects[i];\n var callback = effect.callback;\n\n if (callback !== null) {\n effect.callback = null;\n callCallback(callback, instance);\n }\n }\n }\n}\n\nvar ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;\nfunction requestCurrentSuspenseConfig() {\n return ReactCurrentBatchConfig.suspense;\n}\n\nvar fakeInternalInstance = {};\nvar isArray = Array.isArray; // React.Component uses a shared frozen object by default.\n// We'll use it to determine whether we need to initialize legacy refs.\n\nvar emptyRefsObject = new React.Component().refs;\nvar didWarnAboutStateAssignmentForComponent;\nvar didWarnAboutUninitializedState;\nvar didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;\nvar didWarnAboutLegacyLifecyclesAndDerivedState;\nvar didWarnAboutUndefinedDerivedState;\nvar warnOnUndefinedDerivedState;\nvar warnOnInvalidCallback;\nvar didWarnAboutDirectlyAssigningPropsToState;\nvar didWarnAboutContextTypeAndContextTypes;\nvar didWarnAboutInvalidateContextType;\n\n{\n didWarnAboutStateAssignmentForComponent = new Set();\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 (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\n error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);\n }\n };\n\n warnOnUndefinedDerivedState = function (type, partialState) {\n if (partialState === undefined) {\n var componentName = getComponentName(type) || 'Component';\n\n if (!didWarnAboutUndefinedDerivedState.has(componentName)) {\n didWarnAboutUndefinedDerivedState.add(componentName);\n\n error('%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName);\n }\n }\n }; // This is so gross but it's at least non-critical and can be removed if\n // it causes problems. This is meant to give a nicer error message for\n // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component,\n // ...)) which otherwise throws a \"_processChildContext is not a function\"\n // exception.\n\n\n Object.defineProperty(fakeInternalInstance, '_processChildContext', {\n enumerable: false,\n value: function () {\n {\n {\n throw Error( \"_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).\" );\n }\n }\n }\n });\n Object.freeze(fakeInternalInstance);\n}\n\nfunction applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) {\n var prevState = workInProgress.memoizedState;\n\n {\n if ( workInProgress.mode & StrictMode) {\n // Invoke the function an extra time to help detect side-effects.\n getDerivedStateFromProps(nextProps, prevState);\n }\n }\n\n var partialState = getDerivedStateFromProps(nextProps, prevState);\n\n {\n warnOnUndefinedDerivedState(ctor, partialState);\n } // Merge the partial state and the previous state.\n\n\n var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState);\n workInProgress.memoizedState = memoizedState; // Once the update queue is empty, persist the derived state onto the\n // base state.\n\n if (workInProgress.expirationTime === NoWork) {\n // Queue is always non-null for classes\n var updateQueue = workInProgress.updateQueue;\n updateQueue.baseState = memoizedState;\n }\n}\nvar classComponentUpdater = {\n isMounted: isMounted,\n enqueueSetState: function (inst, payload, callback) {\n var fiber = get(inst);\n var currentTime = requestCurrentTimeForUpdate();\n var suspenseConfig = requestCurrentSuspenseConfig();\n var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);\n var update = createUpdate(expirationTime, suspenseConfig);\n update.payload = payload;\n\n if (callback !== undefined && callback !== null) {\n {\n warnOnInvalidCallback(callback, 'setState');\n }\n\n update.callback = callback;\n }\n\n enqueueUpdate(fiber, update);\n scheduleWork(fiber, expirationTime);\n },\n enqueueReplaceState: function (inst, payload, callback) {\n var fiber = get(inst);\n var currentTime = requestCurrentTimeForUpdate();\n var suspenseConfig = requestCurrentSuspenseConfig();\n var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);\n var update = createUpdate(expirationTime, suspenseConfig);\n update.tag = ReplaceState;\n update.payload = payload;\n\n if (callback !== undefined && callback !== null) {\n {\n warnOnInvalidCallback(callback, 'replaceState');\n }\n\n update.callback = callback;\n }\n\n enqueueUpdate(fiber, update);\n scheduleWork(fiber, expirationTime);\n },\n enqueueForceUpdate: function (inst, callback) {\n var fiber = get(inst);\n var currentTime = requestCurrentTimeForUpdate();\n var suspenseConfig = requestCurrentSuspenseConfig();\n var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);\n var update = createUpdate(expirationTime, suspenseConfig);\n update.tag = ForceUpdate;\n\n if (callback !== undefined && callback !== null) {\n {\n warnOnInvalidCallback(callback, 'forceUpdate');\n }\n\n update.callback = callback;\n }\n\n enqueueUpdate(fiber, update);\n scheduleWork(fiber, expirationTime);\n }\n};\n\nfunction checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) {\n var instance = workInProgress.stateNode;\n\n if (typeof instance.shouldComponentUpdate === 'function') {\n {\n if ( workInProgress.mode & StrictMode) {\n // Invoke the function an extra time to help detect side-effects.\n instance.shouldComponentUpdate(newProps, newState, nextContext);\n }\n }\n\n startPhaseTimer(workInProgress, 'shouldComponentUpdate');\n var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);\n stopPhaseTimer();\n\n {\n if (shouldUpdate === undefined) {\n error('%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component');\n }\n }\n\n return shouldUpdate;\n }\n\n if (ctor.prototype && ctor.prototype.isPureReactComponent) {\n return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);\n }\n\n return true;\n}\n\nfunction checkClassInstance(workInProgress, ctor, newProps) {\n var instance = workInProgress.stateNode;\n\n {\n var name = getComponentName(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\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.', getComponentName(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\n error('%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(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\nfunction adoptClassInstance(workInProgress, instance) {\n instance.updater = classComponentUpdater;\n workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates\n\n set(instance, workInProgress);\n\n {\n instance._reactInternalInstance = fakeInternalInstance;\n }\n}\n\nfunction constructClassInstance(workInProgress, ctor, props) {\n var isLegacyContextConsumer = false;\n var unmaskedContext = emptyContextObject;\n var context = emptyContextObject;\n var contextType = ctor.contextType;\n\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 <Context.Consumer>\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 // <Context.Consumer>\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', getComponentName(ctor) || 'Component', addendum);\n }\n }\n }\n\n if (typeof contextType === 'object' && contextType !== null) {\n context = readContext(contextType);\n } else {\n unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n var contextTypes = ctor.contextTypes;\n isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined;\n context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject;\n } // Instantiate twice to help detect side-effects.\n\n\n {\n if ( workInProgress.mode & StrictMode) {\n new ctor(props, context); // eslint-disable-line no-new\n }\n }\n\n var instance = new ctor(props, context);\n var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null;\n adoptClassInstance(workInProgress, instance);\n\n {\n if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) {\n var componentName = getComponentName(ctor) || 'Component';\n\n if (!didWarnAboutUninitializedState.has(componentName)) {\n didWarnAboutUninitializedState.add(componentName);\n\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 = getComponentName(ctor) || 'Component';\n\n var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';\n\n if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {\n didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);\n\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://fb.me/react-unsafe-component-lifecycles', _componentName, newApiName, foundWillMountName !== null ? \"\\n \" + foundWillMountName : '', foundWillReceivePropsName !== null ? \"\\n \" + foundWillReceivePropsName : '', foundWillUpdateName !== null ? \"\\n \" + foundWillUpdateName : '');\n }\n }\n }\n } // Cache unmasked context so we can avoid recreating masked context unless necessary.\n // ReactFiberContext usually updates this cache but can't for newly-created instances.\n\n\n if (isLegacyContextConsumer) {\n cacheContext(workInProgress, unmaskedContext, context);\n }\n\n return instance;\n}\n\nfunction callComponentWillMount(workInProgress, instance) {\n startPhaseTimer(workInProgress, 'componentWillMount');\n var oldState = instance.state;\n\n if (typeof instance.componentWillMount === 'function') {\n instance.componentWillMount();\n }\n\n if (typeof instance.UNSAFE_componentWillMount === 'function') {\n instance.UNSAFE_componentWillMount();\n }\n\n stopPhaseTimer();\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.', getComponentName(workInProgress.type) || 'Component');\n }\n\n classComponentUpdater.enqueueReplaceState(instance, instance.state, null);\n }\n}\n\nfunction callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) {\n var oldState = instance.state;\n startPhaseTimer(workInProgress, 'componentWillReceiveProps');\n\n if (typeof instance.componentWillReceiveProps === 'function') {\n instance.componentWillReceiveProps(newProps, nextContext);\n }\n\n if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {\n instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);\n }\n\n stopPhaseTimer();\n\n if (instance.state !== oldState) {\n {\n var componentName = getComponentName(workInProgress.type) || 'Component';\n\n if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {\n didWarnAboutStateAssignmentForComponent.add(componentName);\n\n error('%s.componentWillReceiveProps(): Assigning directly to ' + \"this.state is deprecated (except inside a component's \" + 'constructor). Use setState instead.', componentName);\n }\n }\n\n classComponentUpdater.enqueueReplaceState(instance, instance.state, null);\n }\n} // Invokes the mount life-cycles on a previously never rendered instance.\n\n\nfunction mountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {\n {\n checkClassInstance(workInProgress, ctor, newProps);\n }\n\n var instance = workInProgress.stateNode;\n instance.props = newProps;\n instance.state = workInProgress.memoizedState;\n instance.refs = emptyRefsObject;\n initializeUpdateQueue(workInProgress);\n var contextType = ctor.contextType;\n\n if (typeof contextType === 'object' && contextType !== null) {\n instance.context = readContext(contextType);\n } else {\n var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n instance.context = getMaskedContext(workInProgress, unmaskedContext);\n }\n\n {\n if (instance.state === newProps) {\n var componentName = getComponentName(ctor) || 'Component';\n\n if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {\n didWarnAboutDirectlyAssigningPropsToState.add(componentName);\n\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 if (workInProgress.mode & StrictMode) {\n ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance);\n }\n\n {\n ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);\n }\n }\n\n processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);\n instance.state = workInProgress.memoizedState;\n var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n\n if (typeof getDerivedStateFromProps === 'function') {\n applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);\n instance.state = workInProgress.memoizedState;\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(workInProgress, instance); // If we had additional state updates during this life-cycle, let's\n // process them now.\n\n processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);\n instance.state = workInProgress.memoizedState;\n }\n\n if (typeof instance.componentDidMount === 'function') {\n workInProgress.effectTag |= Update;\n }\n}\n\nfunction resumeMountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {\n var instance = workInProgress.stateNode;\n var oldProps = workInProgress.memoizedProps;\n instance.props = oldProps;\n var oldContext = instance.context;\n var contextType = ctor.contextType;\n var nextContext = emptyContextObject;\n\n if (typeof contextType === 'object' && contextType !== null) {\n nextContext = readContext(contextType);\n } else {\n var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext);\n }\n\n var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what\n // ever the previously attempted to render - not the \"current\". However,\n // during componentDidUpdate we pass the \"current\" props.\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 if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {\n if (oldProps !== newProps || oldContext !== nextContext) {\n callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);\n }\n }\n\n resetHasForceUpdateBeforeProcessing();\n var oldState = workInProgress.memoizedState;\n var newState = instance.state = oldState;\n processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);\n newState = workInProgress.memoizedState;\n\n if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {\n // If an update was already in progress, we should schedule an Update\n // effect even though we're bailing out, so that cWU/cDU are called.\n if (typeof instance.componentDidMount === 'function') {\n workInProgress.effectTag |= Update;\n }\n\n return false;\n }\n\n if (typeof getDerivedStateFromProps === 'function') {\n applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);\n newState = workInProgress.memoizedState;\n }\n\n var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);\n\n if (shouldUpdate) {\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for components using the new APIs.\n if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {\n startPhaseTimer(workInProgress, 'componentWillMount');\n\n if (typeof instance.componentWillMount === 'function') {\n instance.componentWillMount();\n }\n\n if (typeof instance.UNSAFE_componentWillMount === 'function') {\n instance.UNSAFE_componentWillMount();\n }\n\n stopPhaseTimer();\n }\n\n if (typeof instance.componentDidMount === 'function') {\n workInProgress.effectTag |= Update;\n }\n } else {\n // If an update was already in progress, we should schedule an Update\n // effect even though we're bailing out, so that cWU/cDU are called.\n if (typeof instance.componentDidMount === 'function') {\n workInProgress.effectTag |= Update;\n } // If shouldComponentUpdate returned false, we should still update the\n // memoized state to indicate that this work can be reused.\n\n\n workInProgress.memoizedProps = newProps;\n workInProgress.memoizedState = newState;\n } // Update the existing instance's state, props, and context pointers even\n // if shouldComponentUpdate returns false.\n\n\n instance.props = newProps;\n instance.state = newState;\n instance.context = nextContext;\n return shouldUpdate;\n} // Invokes the update life-cycles and returns false if it shouldn't rerender.\n\n\nfunction updateClassInstance(current, workInProgress, ctor, newProps, renderExpirationTime) {\n var instance = workInProgress.stateNode;\n cloneUpdateQueue(current, workInProgress);\n var oldProps = workInProgress.memoizedProps;\n instance.props = workInProgress.type === workInProgress.elementType ? oldProps : resolveDefaultProps(workInProgress.type, oldProps);\n var oldContext = instance.context;\n var contextType = ctor.contextType;\n var nextContext = emptyContextObject;\n\n if (typeof contextType === 'object' && contextType !== null) {\n nextContext = readContext(contextType);\n } else {\n var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n nextContext = getMaskedContext(workInProgress, nextUnmaskedContext);\n }\n\n var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what\n // ever the previously attempted to render - not the \"current\". However,\n // during componentDidUpdate we pass the \"current\" props.\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 if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {\n if (oldProps !== newProps || oldContext !== nextContext) {\n callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);\n }\n }\n\n resetHasForceUpdateBeforeProcessing();\n var oldState = workInProgress.memoizedState;\n var newState = instance.state = oldState;\n processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);\n newState = workInProgress.memoizedState;\n\n if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {\n // If an update was already in progress, we should schedule an Update\n // effect even though we're bailing out, so that cWU/cDU are called.\n if (typeof instance.componentDidUpdate === 'function') {\n if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n workInProgress.effectTag |= Update;\n }\n }\n\n if (typeof instance.getSnapshotBeforeUpdate === 'function') {\n if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n workInProgress.effectTag |= Snapshot;\n }\n }\n\n return false;\n }\n\n if (typeof getDerivedStateFromProps === 'function') {\n applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);\n newState = workInProgress.memoizedState;\n }\n\n var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);\n\n if (shouldUpdate) {\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for components using the new APIs.\n if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) {\n startPhaseTimer(workInProgress, 'componentWillUpdate');\n\n if (typeof instance.componentWillUpdate === 'function') {\n instance.componentWillUpdate(newProps, newState, nextContext);\n }\n\n if (typeof instance.UNSAFE_componentWillUpdate === 'function') {\n instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);\n }\n\n stopPhaseTimer();\n }\n\n if (typeof instance.componentDidUpdate === 'function') {\n workInProgress.effectTag |= Update;\n }\n\n if (typeof instance.getSnapshotBeforeUpdate === 'function') {\n workInProgress.effectTag |= Snapshot;\n }\n } else {\n // If an update was already in progress, we should schedule an Update\n // effect even though we're bailing out, so that cWU/cDU are called.\n if (typeof instance.componentDidUpdate === 'function') {\n if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n workInProgress.effectTag |= Update;\n }\n }\n\n if (typeof instance.getSnapshotBeforeUpdate === 'function') {\n if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n workInProgress.effectTag |= Snapshot;\n }\n } // If shouldComponentUpdate returned false, we should still update the\n // memoized props/state to indicate that this work can be reused.\n\n\n workInProgress.memoizedProps = newProps;\n workInProgress.memoizedState = newState;\n } // Update the existing instance's state, props, and context pointers even\n // if shouldComponentUpdate returns false.\n\n\n instance.props = newProps;\n instance.state = newState;\n instance.context = nextContext;\n return shouldUpdate;\n}\n\nvar didWarnAboutMaps;\nvar didWarnAboutGenerators;\nvar didWarnAboutStringRefs;\nvar ownerHasKeyUseWarning;\nvar ownerHasFunctionTypeWarning;\n\nvar warnForMissingKey = function (child) {};\n\n{\n didWarnAboutMaps = false;\n didWarnAboutGenerators = false;\n didWarnAboutStringRefs = {};\n /**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n ownerHasKeyUseWarning = {};\n ownerHasFunctionTypeWarning = {};\n\n warnForMissingKey = function (child) {\n if (child === null || typeof child !== 'object') {\n return;\n }\n\n if (!child._store || child._store.validated || child.key != null) {\n return;\n }\n\n if (!(typeof child._store === 'object')) {\n {\n throw Error( \"React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n child._store.validated = true;\n var currentComponentErrorInfo = 'Each child in a list should have a unique ' + '\"key\" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + getCurrentFiberStackInDev();\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true;\n\n error('Each child in a list should have a unique ' + '\"key\" prop. See https://fb.me/react-warning-keys for ' + 'more information.');\n };\n}\n\nvar isArray$1 = Array.isArray;\n\nfunction coerceRef(returnFiber, current, element) {\n var mixedRef = element.ref;\n\n if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') {\n {\n // TODO: Clean this up once we turn on the string ref warning for\n // everyone, because the strict mode case will no longer be relevant\n if ((returnFiber.mode & StrictMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs\n // because these cannot be automatically converted to an arrow function\n // using a codemod. Therefore, we don't have to warn about string refs again.\n !(element._owner && element._self && element._owner.stateNode !== element._self)) {\n var componentName = getComponentName(returnFiber.type) || 'Component';\n\n if (!didWarnAboutStringRefs[componentName]) {\n {\n error('A string ref, \"%s\", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref%s', mixedRef, getStackByFiberInDevAndProd(returnFiber));\n }\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n\n if (element._owner) {\n var owner = element._owner;\n var inst;\n\n if (owner) {\n var ownerFiber = owner;\n\n if (!(ownerFiber.tag === ClassComponent)) {\n {\n throw Error( \"Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref\" );\n }\n }\n\n inst = ownerFiber.stateNode;\n }\n\n if (!inst) {\n {\n throw Error( \"Missing owner for string ref \" + mixedRef + \". This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n var stringRef = '' + mixedRef; // Check if previous string ref matches new string ref\n\n if (current !== null && current.ref !== null && typeof current.ref === 'function' && current.ref._stringRef === stringRef) {\n return current.ref;\n }\n\n var ref = function (value) {\n var refs = inst.refs;\n\n if (refs === emptyRefsObject) {\n // This is a lazy pooled frozen object, so we need to initialize.\n refs = inst.refs = {};\n }\n\n if (value === null) {\n delete refs[stringRef];\n } else {\n refs[stringRef] = value;\n }\n };\n\n ref._stringRef = stringRef;\n return ref;\n } else {\n if (!(typeof mixedRef === 'string')) {\n {\n throw Error( \"Expected ref to be a function, a string, an object returned by React.createRef(), or null.\" );\n }\n }\n\n if (!element._owner) {\n {\n throw Error( \"Element ref was specified as a string (\" + mixedRef + \") but no owner was set. This could happen for one of the following reasons:\\n1. You may be adding a ref to a function component\\n2. You may be adding a ref to a component that was not created inside a component's render method\\n3. You have multiple copies of React loaded\\nSee https://fb.me/react-refs-must-have-owner for more information.\" );\n }\n }\n }\n }\n\n return mixedRef;\n}\n\nfunction throwOnInvalidObjectType(returnFiber, newChild) {\n if (returnFiber.type !== 'textarea') {\n var addendum = '';\n\n {\n addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getCurrentFiberStackInDev();\n }\n\n {\n {\n throw Error( \"Objects are not valid as a React child (found: \" + (Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild) + \").\" + addendum );\n }\n }\n }\n}\n\nfunction warnOnFunctionType() {\n {\n var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.' + getCurrentFiberStackInDev();\n\n if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true;\n\n error('Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.');\n }\n} // This wrapper function exists because I expect to clone the code in each path\n// to be able to optimize each path individually by branching early. This needs\n// a compiler or we can do it manually. Helpers that don't need this branching\n// live outside of this function.\n\n\nfunction ChildReconciler(shouldTrackSideEffects) {\n function deleteChild(returnFiber, childToDelete) {\n if (!shouldTrackSideEffects) {\n // Noop.\n return;\n } // Deletions are added in reversed order so we add it to the front.\n // At this point, the return fiber's effect list is empty except for\n // deletions, so we can just append the deletion to the list. The remaining\n // effects aren't added until the complete phase. Once we implement\n // resuming, this may not be true.\n\n\n var last = returnFiber.lastEffect;\n\n if (last !== null) {\n last.nextEffect = childToDelete;\n returnFiber.lastEffect = childToDelete;\n } else {\n returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;\n }\n\n childToDelete.nextEffect = null;\n childToDelete.effectTag = Deletion;\n }\n\n function deleteRemainingChildren(returnFiber, currentFirstChild) {\n if (!shouldTrackSideEffects) {\n // Noop.\n return null;\n } // TODO: For the shouldClone case, this could be micro-optimized a bit by\n // assuming that after the first child we've already added everything.\n\n\n var childToDelete = currentFirstChild;\n\n while (childToDelete !== null) {\n deleteChild(returnFiber, childToDelete);\n childToDelete = childToDelete.sibling;\n }\n\n return null;\n }\n\n function mapRemainingChildren(returnFiber, currentFirstChild) {\n // Add the remaining children to a temporary map so that we can find them by\n // keys quickly. Implicit (null) keys get added to this set with their index\n // instead.\n var existingChildren = new Map();\n var existingChild = currentFirstChild;\n\n while (existingChild !== null) {\n if (existingChild.key !== null) {\n existingChildren.set(existingChild.key, existingChild);\n } else {\n existingChildren.set(existingChild.index, existingChild);\n }\n\n existingChild = existingChild.sibling;\n }\n\n return existingChildren;\n }\n\n function useFiber(fiber, pendingProps) {\n // We currently set sibling to null and index to 0 here because it is easy\n // to forget to do before returning it. E.g. for the single child case.\n var clone = createWorkInProgress(fiber, pendingProps);\n clone.index = 0;\n clone.sibling = null;\n return clone;\n }\n\n function placeChild(newFiber, lastPlacedIndex, newIndex) {\n newFiber.index = newIndex;\n\n if (!shouldTrackSideEffects) {\n // Noop.\n return lastPlacedIndex;\n }\n\n var current = newFiber.alternate;\n\n if (current !== null) {\n var oldIndex = current.index;\n\n if (oldIndex < lastPlacedIndex) {\n // This is a move.\n newFiber.effectTag = Placement;\n return lastPlacedIndex;\n } else {\n // This item can stay in place.\n return oldIndex;\n }\n } else {\n // This is an insertion.\n newFiber.effectTag = Placement;\n return lastPlacedIndex;\n }\n }\n\n function placeSingleChild(newFiber) {\n // This is simpler for the single child case. We only need to do a\n // placement for inserting new children.\n if (shouldTrackSideEffects && newFiber.alternate === null) {\n newFiber.effectTag = Placement;\n }\n\n return newFiber;\n }\n\n function updateTextNode(returnFiber, current, textContent, expirationTime) {\n if (current === null || current.tag !== HostText) {\n // Insert\n var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);\n created.return = returnFiber;\n return created;\n } else {\n // Update\n var existing = useFiber(current, textContent);\n existing.return = returnFiber;\n return existing;\n }\n }\n\n function updateElement(returnFiber, current, element, expirationTime) {\n if (current !== null) {\n if (current.elementType === element.type || ( // Keep this check inline so it only runs on the false path:\n isCompatibleFamilyForHotReloading(current, element) )) {\n // Move based on index\n var existing = useFiber(current, element.props);\n existing.ref = coerceRef(returnFiber, current, element);\n existing.return = returnFiber;\n\n {\n existing._debugSource = element._source;\n existing._debugOwner = element._owner;\n }\n\n return existing;\n }\n } // Insert\n\n\n var created = createFiberFromElement(element, returnFiber.mode, expirationTime);\n created.ref = coerceRef(returnFiber, current, element);\n created.return = returnFiber;\n return created;\n }\n\n function updatePortal(returnFiber, current, portal, expirationTime) {\n if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) {\n // Insert\n var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);\n created.return = returnFiber;\n return created;\n } else {\n // Update\n var existing = useFiber(current, portal.children || []);\n existing.return = returnFiber;\n return existing;\n }\n }\n\n function updateFragment(returnFiber, current, fragment, expirationTime, key) {\n if (current === null || current.tag !== Fragment) {\n // Insert\n var created = createFiberFromFragment(fragment, returnFiber.mode, expirationTime, key);\n created.return = returnFiber;\n return created;\n } else {\n // Update\n var existing = useFiber(current, fragment);\n existing.return = returnFiber;\n return existing;\n }\n }\n\n function createChild(returnFiber, newChild, expirationTime) {\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n // Text nodes don't have keys. If the previous node is implicitly keyed\n // we can continue to replace it without aborting even if it is not a text\n // node.\n var created = createFiberFromText('' + newChild, returnFiber.mode, expirationTime);\n created.return = returnFiber;\n return created;\n }\n\n if (typeof newChild === 'object' && newChild !== null) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n {\n var _created = createFiberFromElement(newChild, returnFiber.mode, expirationTime);\n\n _created.ref = coerceRef(returnFiber, null, newChild);\n _created.return = returnFiber;\n return _created;\n }\n\n case REACT_PORTAL_TYPE:\n {\n var _created2 = createFiberFromPortal(newChild, returnFiber.mode, expirationTime);\n\n _created2.return = returnFiber;\n return _created2;\n }\n }\n\n if (isArray$1(newChild) || getIteratorFn(newChild)) {\n var _created3 = createFiberFromFragment(newChild, returnFiber.mode, expirationTime, null);\n\n _created3.return = returnFiber;\n return _created3;\n }\n\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n return null;\n }\n\n function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {\n // Update the fiber if the keys match, otherwise return null.\n var key = oldFiber !== null ? oldFiber.key : null;\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n // Text nodes don't have keys. If the previous node is implicitly keyed\n // we can continue to replace it without aborting even if it is not a text\n // node.\n if (key !== null) {\n return null;\n }\n\n return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime);\n }\n\n if (typeof newChild === 'object' && newChild !== null) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n {\n if (newChild.key === key) {\n if (newChild.type === REACT_FRAGMENT_TYPE) {\n return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key);\n }\n\n return updateElement(returnFiber, oldFiber, newChild, expirationTime);\n } else {\n return null;\n }\n }\n\n case REACT_PORTAL_TYPE:\n {\n if (newChild.key === key) {\n return updatePortal(returnFiber, oldFiber, newChild, expirationTime);\n } else {\n return null;\n }\n }\n }\n\n if (isArray$1(newChild) || getIteratorFn(newChild)) {\n if (key !== null) {\n return null;\n }\n\n return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null);\n }\n\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n return null;\n }\n\n function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) {\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n // Text nodes don't have keys, so we neither have to check the old nor\n // new node for the key. If both are text nodes, they match.\n var matchedFiber = existingChildren.get(newIdx) || null;\n return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime);\n }\n\n if (typeof newChild === 'object' && newChild !== null) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n {\n var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;\n\n if (newChild.type === REACT_FRAGMENT_TYPE) {\n return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key);\n }\n\n return updateElement(returnFiber, _matchedFiber, newChild, expirationTime);\n }\n\n case REACT_PORTAL_TYPE:\n {\n var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;\n\n return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime);\n }\n }\n\n if (isArray$1(newChild) || getIteratorFn(newChild)) {\n var _matchedFiber3 = existingChildren.get(newIdx) || null;\n\n return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null);\n }\n\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n return null;\n }\n /**\n * Warns if there is a duplicate or missing key\n */\n\n\n function warnOnInvalidKey(child, knownKeys) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n }\n }\n\n return knownKeys;\n }\n\n function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) {\n // This algorithm can't optimize by searching from both ends since we\n // don't have backpointers on fibers. I'm trying to see how far we can get\n // with that model. If it ends up not being worth the tradeoffs, we can\n // add it later.\n // Even with a two ended optimization, we'd want to optimize for the case\n // where there are few changes and brute force the comparison instead of\n // going for the Map. It'd like to explore hitting that path first in\n // forward-only mode and only go for the Map once we notice that we need\n // lots of look ahead. This doesn't handle reversal as well as two ended\n // search but that's unusual. Besides, for the two ended optimization to\n // work on Iterables, we'd need to copy the whole set.\n // In this first iteration, we'll just live with hitting the bad case\n // (adding everything to a Map) in for every insert/move.\n // If you change this code, also update reconcileChildrenIterator() which\n // uses the same algorithm.\n {\n // First, validate keys.\n var knownKeys = null;\n\n for (var i = 0; i < newChildren.length; i++) {\n var child = newChildren[i];\n knownKeys = warnOnInvalidKey(child, knownKeys);\n }\n }\n\n var resultingFirstChild = null;\n var previousNewFiber = null;\n var oldFiber = currentFirstChild;\n var lastPlacedIndex = 0;\n var newIdx = 0;\n var nextOldFiber = null;\n\n for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {\n if (oldFiber.index > newIdx) {\n nextOldFiber = oldFiber;\n oldFiber = null;\n } else {\n nextOldFiber = oldFiber.sibling;\n }\n\n var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime);\n\n if (newFiber === null) {\n // TODO: This breaks on empty slots like null children. That's\n // unfortunate because it triggers the slow path all the time. We need\n // a better way to communicate whether this was a miss or null,\n // boolean, undefined, etc.\n if (oldFiber === null) {\n oldFiber = nextOldFiber;\n }\n\n break;\n }\n\n if (shouldTrackSideEffects) {\n if (oldFiber && newFiber.alternate === null) {\n // We matched the slot, but we didn't reuse the existing fiber, so we\n // need to delete the existing child.\n deleteChild(returnFiber, oldFiber);\n }\n }\n\n lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = newFiber;\n } else {\n // TODO: Defer siblings if we're not at the right index for this slot.\n // I.e. if we had null values before, then we want to defer this\n // for each null value. However, we also don't want to call updateSlot\n // with the previous one.\n previousNewFiber.sibling = newFiber;\n }\n\n previousNewFiber = newFiber;\n oldFiber = nextOldFiber;\n }\n\n if (newIdx === newChildren.length) {\n // We've reached the end of the new children. We can delete the rest.\n deleteRemainingChildren(returnFiber, oldFiber);\n return resultingFirstChild;\n }\n\n if (oldFiber === null) {\n // If we don't have any more existing children we can choose a fast path\n // since the rest will all be insertions.\n for (; newIdx < newChildren.length; newIdx++) {\n var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime);\n\n if (_newFiber === null) {\n continue;\n }\n\n lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = _newFiber;\n } else {\n previousNewFiber.sibling = _newFiber;\n }\n\n previousNewFiber = _newFiber;\n }\n\n return resultingFirstChild;\n } // Add all children to a key map for quick lookups.\n\n\n var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.\n\n for (; newIdx < newChildren.length; newIdx++) {\n var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime);\n\n if (_newFiber2 !== null) {\n if (shouldTrackSideEffects) {\n if (_newFiber2.alternate !== null) {\n // The new fiber is a work in progress, but if there exists a\n // current, that means that we reused the fiber. We need to delete\n // it from the child list so that we don't add it to the deletion\n // list.\n existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);\n }\n }\n\n lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n resultingFirstChild = _newFiber2;\n } else {\n previousNewFiber.sibling = _newFiber2;\n }\n\n previousNewFiber = _newFiber2;\n }\n }\n\n if (shouldTrackSideEffects) {\n // Any existing children that weren't consumed above were deleted. We need\n // to add them to the deletion list.\n existingChildren.forEach(function (child) {\n return deleteChild(returnFiber, child);\n });\n }\n\n return resultingFirstChild;\n }\n\n function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) {\n // This is the same implementation as reconcileChildrenArray(),\n // but using the iterator instead.\n var iteratorFn = getIteratorFn(newChildrenIterable);\n\n if (!(typeof iteratorFn === 'function')) {\n {\n throw Error( \"An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\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 newChildrenIterable[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 (newChildrenIterable.entries === iteratorFn) {\n if (!didWarnAboutMaps) {\n error('Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.');\n }\n\n didWarnAboutMaps = true;\n } // First, validate keys.\n // We'll get a different iterator later for the main pass.\n\n\n var _newChildren = iteratorFn.call(newChildrenIterable);\n\n if (_newChildren) {\n var knownKeys = null;\n\n var _step = _newChildren.next();\n\n for (; !_step.done; _step = _newChildren.next()) {\n var child = _step.value;\n knownKeys = warnOnInvalidKey(child, knownKeys);\n }\n }\n }\n\n var newChildren = iteratorFn.call(newChildrenIterable);\n\n if (!(newChildren != null)) {\n {\n throw Error( \"An iterable object provided no iterator.\" );\n }\n }\n\n var resultingFirstChild = null;\n var previousNewFiber = null;\n var oldFiber = currentFirstChild;\n var lastPlacedIndex = 0;\n var newIdx = 0;\n var nextOldFiber = null;\n var step = newChildren.next();\n\n for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {\n if (oldFiber.index > newIdx) {\n nextOldFiber = oldFiber;\n oldFiber = null;\n } else {\n nextOldFiber = oldFiber.sibling;\n }\n\n var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime);\n\n if (newFiber === null) {\n // TODO: This breaks on empty slots like null children. That's\n // unfortunate because it triggers the slow path all the time. We need\n // a better way to communicate whether this was a miss or null,\n // boolean, undefined, etc.\n if (oldFiber === null) {\n oldFiber = nextOldFiber;\n }\n\n break;\n }\n\n if (shouldTrackSideEffects) {\n if (oldFiber && newFiber.alternate === null) {\n // We matched the slot, but we didn't reuse the existing fiber, so we\n // need to delete the existing child.\n deleteChild(returnFiber, oldFiber);\n }\n }\n\n lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = newFiber;\n } else {\n // TODO: Defer siblings if we're not at the right index for this slot.\n // I.e. if we had null values before, then we want to defer this\n // for each null value. However, we also don't want to call updateSlot\n // with the previous one.\n previousNewFiber.sibling = newFiber;\n }\n\n previousNewFiber = newFiber;\n oldFiber = nextOldFiber;\n }\n\n if (step.done) {\n // We've reached the end of the new children. We can delete the rest.\n deleteRemainingChildren(returnFiber, oldFiber);\n return resultingFirstChild;\n }\n\n if (oldFiber === null) {\n // If we don't have any more existing children we can choose a fast path\n // since the rest will all be insertions.\n for (; !step.done; newIdx++, step = newChildren.next()) {\n var _newFiber3 = createChild(returnFiber, step.value, expirationTime);\n\n if (_newFiber3 === null) {\n continue;\n }\n\n lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = _newFiber3;\n } else {\n previousNewFiber.sibling = _newFiber3;\n }\n\n previousNewFiber = _newFiber3;\n }\n\n return resultingFirstChild;\n } // Add all children to a key map for quick lookups.\n\n\n var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.\n\n for (; !step.done; newIdx++, step = newChildren.next()) {\n var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime);\n\n if (_newFiber4 !== null) {\n if (shouldTrackSideEffects) {\n if (_newFiber4.alternate !== null) {\n // The new fiber is a work in progress, but if there exists a\n // current, that means that we reused the fiber. We need to delete\n // it from the child list so that we don't add it to the deletion\n // list.\n existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);\n }\n }\n\n lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n resultingFirstChild = _newFiber4;\n } else {\n previousNewFiber.sibling = _newFiber4;\n }\n\n previousNewFiber = _newFiber4;\n }\n }\n\n if (shouldTrackSideEffects) {\n // Any existing children that weren't consumed above were deleted. We need\n // to add them to the deletion list.\n existingChildren.forEach(function (child) {\n return deleteChild(returnFiber, child);\n });\n }\n\n return resultingFirstChild;\n }\n\n function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {\n // There's no need to check for keys on text nodes since we don't have a\n // way to define them.\n if (currentFirstChild !== null && currentFirstChild.tag === HostText) {\n // We already have an existing node so let's just update it and delete\n // the rest.\n deleteRemainingChildren(returnFiber, currentFirstChild.sibling);\n var existing = useFiber(currentFirstChild, textContent);\n existing.return = returnFiber;\n return existing;\n } // The existing first child is not a text node so we need to create one\n // and delete the existing ones.\n\n\n deleteRemainingChildren(returnFiber, currentFirstChild);\n var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);\n created.return = returnFiber;\n return created;\n }\n\n function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {\n var key = element.key;\n var child = currentFirstChild;\n\n while (child !== null) {\n // TODO: If key === null and child.key === null, then this only applies to\n // the first item in the list.\n if (child.key === key) {\n switch (child.tag) {\n case Fragment:\n {\n if (element.type === REACT_FRAGMENT_TYPE) {\n deleteRemainingChildren(returnFiber, child.sibling);\n var existing = useFiber(child, element.props.children);\n existing.return = returnFiber;\n\n {\n existing._debugSource = element._source;\n existing._debugOwner = element._owner;\n }\n\n return existing;\n }\n\n break;\n }\n\n case Block:\n\n // We intentionally fallthrough here if enableBlocksAPI is not on.\n // eslint-disable-next-lined no-fallthrough\n\n default:\n {\n if (child.elementType === element.type || ( // Keep this check inline so it only runs on the false path:\n isCompatibleFamilyForHotReloading(child, element) )) {\n deleteRemainingChildren(returnFiber, child.sibling);\n\n var _existing3 = useFiber(child, element.props);\n\n _existing3.ref = coerceRef(returnFiber, child, element);\n _existing3.return = returnFiber;\n\n {\n _existing3._debugSource = element._source;\n _existing3._debugOwner = element._owner;\n }\n\n return _existing3;\n }\n\n break;\n }\n } // Didn't match.\n\n\n deleteRemainingChildren(returnFiber, child);\n break;\n } else {\n deleteChild(returnFiber, child);\n }\n\n child = child.sibling;\n }\n\n if (element.type === REACT_FRAGMENT_TYPE) {\n var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key);\n created.return = returnFiber;\n return created;\n } else {\n var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime);\n\n _created4.ref = coerceRef(returnFiber, currentFirstChild, element);\n _created4.return = returnFiber;\n return _created4;\n }\n }\n\n function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {\n var key = portal.key;\n var child = currentFirstChild;\n\n while (child !== null) {\n // TODO: If key === null and child.key === null, then this only applies to\n // the first item in the list.\n if (child.key === key) {\n if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {\n deleteRemainingChildren(returnFiber, child.sibling);\n var existing = useFiber(child, portal.children || []);\n existing.return = returnFiber;\n return existing;\n } else {\n deleteRemainingChildren(returnFiber, child);\n break;\n }\n } else {\n deleteChild(returnFiber, child);\n }\n\n child = child.sibling;\n }\n\n var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);\n created.return = returnFiber;\n return created;\n } // This API will tag the children with the side-effect of the reconciliation\n // itself. They will be added to the side-effect list as we pass through the\n // children and the parent.\n\n\n function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }\n\n return reconcileChildFibers;\n}\n\nvar reconcileChildFibers = ChildReconciler(true);\nvar mountChildFibers = ChildReconciler(false);\nfunction cloneChildFibers(current, workInProgress) {\n if (!(current === null || workInProgress.child === current.child)) {\n {\n throw Error( \"Resuming work not yet implemented.\" );\n }\n }\n\n if (workInProgress.child === null) {\n return;\n }\n\n var currentChild = workInProgress.child;\n var newChild = createWorkInProgress(currentChild, currentChild.pendingProps);\n workInProgress.child = newChild;\n newChild.return = workInProgress;\n\n while (currentChild.sibling !== null) {\n currentChild = currentChild.sibling;\n newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps);\n newChild.return = workInProgress;\n }\n\n newChild.sibling = null;\n} // Reset a workInProgress child set to prepare it for a second pass.\n\nfunction resetChildFibers(workInProgress, renderExpirationTime) {\n var child = workInProgress.child;\n\n while (child !== null) {\n resetWorkInProgress(child, renderExpirationTime);\n child = child.sibling;\n }\n}\n\nvar NO_CONTEXT = {};\nvar contextStackCursor$1 = createCursor(NO_CONTEXT);\nvar contextFiberStackCursor = createCursor(NO_CONTEXT);\nvar rootInstanceStackCursor = createCursor(NO_CONTEXT);\n\nfunction requiredContext(c) {\n if (!(c !== NO_CONTEXT)) {\n {\n throw Error( \"Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n return c;\n}\n\nfunction getRootHostContainer() {\n var rootInstance = requiredContext(rootInstanceStackCursor.current);\n return rootInstance;\n}\n\nfunction pushHostContainer(fiber, nextRootInstance) {\n // Push current root instance onto the stack;\n // This allows us to reset root when portals are popped.\n push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it.\n // This enables us to pop only Fibers that provide unique contexts.\n\n push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack.\n // However, we can't just call getRootHostContext() and push it because\n // we'd have a different number of entries on the stack depending on\n // whether getRootHostContext() throws somewhere in renderer code or not.\n // So we push an empty value first. This lets us safely unwind on errors.\n\n push(contextStackCursor$1, NO_CONTEXT, fiber);\n var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it.\n\n pop(contextStackCursor$1, fiber);\n push(contextStackCursor$1, nextRootContext, fiber);\n}\n\nfunction popHostContainer(fiber) {\n pop(contextStackCursor$1, fiber);\n pop(contextFiberStackCursor, fiber);\n pop(rootInstanceStackCursor, fiber);\n}\n\nfunction getHostContext() {\n var context = requiredContext(contextStackCursor$1.current);\n return context;\n}\n\nfunction pushHostContext(fiber) {\n var rootInstance = requiredContext(rootInstanceStackCursor.current);\n var context = requiredContext(contextStackCursor$1.current);\n var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique.\n\n if (context === nextContext) {\n return;\n } // Track the context and the Fiber that provided it.\n // This enables us to pop only Fibers that provide unique contexts.\n\n\n push(contextFiberStackCursor, fiber, fiber);\n push(contextStackCursor$1, nextContext, fiber);\n}\n\nfunction popHostContext(fiber) {\n // Do not pop unless this Fiber provided the current context.\n // pushHostContext() only pushes Fibers that provide unique contexts.\n if (contextFiberStackCursor.current !== fiber) {\n return;\n }\n\n pop(contextStackCursor$1, fiber);\n pop(contextFiberStackCursor, fiber);\n}\n\nvar DefaultSuspenseContext = 0; // The Suspense Context is split into two parts. The lower bits is\n// inherited deeply down the subtree. The upper bits only affect\n// this immediate suspense boundary and gets reset each new\n// boundary or suspense list.\n\nvar SubtreeSuspenseContextMask = 1; // Subtree Flags:\n// InvisibleParentSuspenseContext indicates that one of our parent Suspense\n// boundaries is not currently showing visible main content.\n// Either because it is already showing a fallback or is not mounted at all.\n// We can use this to determine if it is desirable to trigger a fallback at\n// the parent. If not, then we might need to trigger undesirable boundaries\n// and/or suspend the commit to avoid hiding the parent content.\n\nvar InvisibleParentSuspenseContext = 1; // Shallow Flags:\n// ForceSuspenseFallback can be used by SuspenseList to force newly added\n// items into their fallback state during one of the render passes.\n\nvar ForceSuspenseFallback = 2;\nvar suspenseStackCursor = createCursor(DefaultSuspenseContext);\nfunction hasSuspenseContext(parentContext, flag) {\n return (parentContext & flag) !== 0;\n}\nfunction setDefaultShallowSuspenseContext(parentContext) {\n return parentContext & SubtreeSuspenseContextMask;\n}\nfunction setShallowSuspenseContext(parentContext, shallowContext) {\n return parentContext & SubtreeSuspenseContextMask | shallowContext;\n}\nfunction addSubtreeSuspenseContext(parentContext, subtreeContext) {\n return parentContext | subtreeContext;\n}\nfunction pushSuspenseContext(fiber, newContext) {\n push(suspenseStackCursor, newContext, fiber);\n}\nfunction popSuspenseContext(fiber) {\n pop(suspenseStackCursor, fiber);\n}\n\nfunction shouldCaptureSuspense(workInProgress, hasInvisibleParent) {\n // If it was the primary children that just suspended, capture and render the\n // fallback. Otherwise, don't capture and bubble to the next boundary.\n var nextState = workInProgress.memoizedState;\n\n if (nextState !== null) {\n if (nextState.dehydrated !== null) {\n // A dehydrated boundary always captures.\n return true;\n }\n\n return false;\n }\n\n var props = workInProgress.memoizedProps; // In order to capture, the Suspense component must have a fallback prop.\n\n if (props.fallback === undefined) {\n return false;\n } // Regular boundaries always capture.\n\n\n if (props.unstable_avoidThisFallback !== true) {\n return true;\n } // If it's a boundary we should avoid, then we prefer to bubble up to the\n // parent boundary if it is currently invisible.\n\n\n if (hasInvisibleParent) {\n return false;\n } // If the parent is not able to handle it, we must handle it.\n\n\n return true;\n}\nfunction findFirstSuspended(row) {\n var node = row;\n\n while (node !== null) {\n if (node.tag === SuspenseComponent) {\n var state = node.memoizedState;\n\n if (state !== null) {\n var dehydrated = state.dehydrated;\n\n if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {\n return node;\n }\n }\n } else if (node.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't\n // keep track of whether it suspended or not.\n node.memoizedProps.revealOrder !== undefined) {\n var didSuspend = (node.effectTag & DidCapture) !== NoEffect;\n\n if (didSuspend) {\n return node;\n }\n } else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === row) {\n return null;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === row) {\n return null;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n\n return null;\n}\n\nfunction createDeprecatedResponderListener(responder, props) {\n var eventResponderListener = {\n responder: responder,\n props: props\n };\n\n {\n Object.freeze(eventResponderListener);\n }\n\n return eventResponderListener;\n}\n\nvar HasEffect =\n/* */\n1; // Represents the phase in which the effect (not the clean-up) fires.\n\nvar Layout =\n/* */\n2;\nvar Passive$1 =\n/* */\n4;\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,\n ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;\nvar didWarnAboutMismatchedHooksForComponent;\n\n{\n didWarnAboutMismatchedHooksForComponent = new Set();\n}\n\n// These are set right before calling the component.\nvar renderExpirationTime = NoWork; // The work-in-progress fiber. I've named it differently to distinguish it from\n// the work-in-progress hook.\n\nvar currentlyRenderingFiber$1 = null; // Hooks are stored as a linked list on the fiber's memoizedState field. The\n// current hook list is the list that belongs to the current fiber. The\n// work-in-progress hook list is a new list that will be added to the\n// work-in-progress fiber.\n\nvar currentHook = null;\nvar workInProgressHook = null; // Whether an update was scheduled at any point during the render phase. This\n// does not get reset if we do another render pass; only when we're completely\n// finished evaluating this component. This is an optimization so we know\n// whether we need to clear render phase updates after a throw.\n\nvar didScheduleRenderPhaseUpdate = false;\nvar RE_RENDER_LIMIT = 25; // In DEV, this is the name of the currently executing primitive hook\n\nvar currentHookNameInDev = null; // In DEV, this list ensures that hooks are called in the same order between renders.\n// The list stores the order of hooks used during the initial render (mount).\n// Subsequent renders (updates) reference this list.\n\nvar hookTypesDev = null;\nvar hookTypesUpdateIndexDev = -1; // In DEV, this tracks whether currently rendering component needs to ignore\n// the dependencies for Hooks that need them (e.g. useEffect or useMemo).\n// When true, such Hooks will always be \"remounted\". Only used during hot reload.\n\nvar ignorePreviousDependencies = false;\n\nfunction mountHookTypesDev() {\n {\n var hookName = currentHookNameInDev;\n\n if (hookTypesDev === null) {\n hookTypesDev = [hookName];\n } else {\n hookTypesDev.push(hookName);\n }\n }\n}\n\nfunction updateHookTypesDev() {\n {\n var hookName = currentHookNameInDev;\n\n if (hookTypesDev !== null) {\n hookTypesUpdateIndexDev++;\n\n if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {\n warnOnHookMismatchInDev(hookName);\n }\n }\n }\n}\n\nfunction checkDepsAreArrayDev(deps) {\n {\n if (deps !== undefined && deps !== null && !Array.isArray(deps)) {\n // Verify deps, but only on mount to avoid extra checks.\n // It's unlikely their type would change as usually you define them inline.\n error('%s received a final argument that is not an array (instead, received `%s`). When ' + 'specified, the final argument must be an array.', currentHookNameInDev, typeof deps);\n }\n }\n}\n\nfunction warnOnHookMismatchInDev(currentHookName) {\n {\n var componentName = getComponentName(currentlyRenderingFiber$1.type);\n\n if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {\n didWarnAboutMismatchedHooksForComponent.add(componentName);\n\n if (hookTypesDev !== null) {\n var table = '';\n var secondColumnStart = 30;\n\n for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {\n var oldHookName = hookTypesDev[i];\n var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;\n var row = i + 1 + \". \" + oldHookName; // Extra space so second column lines up\n // lol @ IE not supporting String#repeat\n\n while (row.length < secondColumnStart) {\n row += ' ';\n }\n\n row += newHookName + '\\n';\n table += row;\n }\n\n error('React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://fb.me/rules-of-hooks\\n\\n' + ' Previous render Next render\\n' + ' ------------------------------------------------------\\n' + '%s' + ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', componentName, table);\n }\n }\n }\n}\n\nfunction throwInvalidHookError() {\n {\n {\n throw 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:\\n1. You might have mismatching versions of React and the renderer (such as React DOM)\\n2. You might be breaking the Rules of Hooks\\n3. You might have more than one copy of React in the same app\\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.\" );\n }\n }\n}\n\nfunction areHookInputsEqual(nextDeps, prevDeps) {\n {\n if (ignorePreviousDependencies) {\n // Only true when this component is being hot reloaded.\n return false;\n }\n }\n\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\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, \"[\" + prevDeps.join(', ') + \"]\", \"[\" + nextDeps.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\nfunction renderWithHooks(current, workInProgress, Component, props, secondArg, nextRenderExpirationTime) {\n renderExpirationTime = nextRenderExpirationTime;\n currentlyRenderingFiber$1 = workInProgress;\n\n {\n hookTypesDev = current !== null ? current._debugHookTypes : null;\n hookTypesUpdateIndexDev = -1; // Used for hot reloading:\n\n ignorePreviousDependencies = current !== null && current.type !== workInProgress.type;\n }\n\n workInProgress.memoizedState = null;\n workInProgress.updateQueue = null;\n workInProgress.expirationTime = NoWork; // The following should have already been reset\n // currentHook = null;\n // workInProgressHook = null;\n // didScheduleRenderPhaseUpdate = false;\n // TODO Warn if no hooks are used at all during mount, then some are used during update.\n // Currently we will identify the update render as a mount because memoizedState === null.\n // This is tricky because it's valid for certain types of components (e.g. React.lazy)\n // Using memoizedState to differentiate between mount/update only works if at least one stateful hook is used.\n // Non-stateful hooks (e.g. context) don't get added to memoizedState,\n // so memoizedState would be null during updates and mounts.\n\n {\n if (current !== null && current.memoizedState !== null) {\n ReactCurrentDispatcher.current = HooksDispatcherOnUpdateInDEV;\n } else if (hookTypesDev !== null) {\n // This dispatcher handles an edge case where a component is updating,\n // but no stateful hooks have been used.\n // We want to match the production code behavior (which will use HooksDispatcherOnMount),\n // but with the extra DEV validation to ensure hooks ordering hasn't changed.\n // This dispatcher does that.\n ReactCurrentDispatcher.current = HooksDispatcherOnMountWithHookTypesInDEV;\n } else {\n ReactCurrentDispatcher.current = HooksDispatcherOnMountInDEV;\n }\n }\n\n var children = Component(props, secondArg); // Check if there was a render phase update\n\n if (workInProgress.expirationTime === renderExpirationTime) {\n // Keep rendering in a loop for as long as render phase updates continue to\n // be scheduled. Use a counter to prevent infinite loops.\n var numberOfReRenders = 0;\n\n do {\n workInProgress.expirationTime = NoWork;\n\n if (!(numberOfReRenders < RE_RENDER_LIMIT)) {\n {\n throw Error( \"Too many re-renders. React limits the number of renders to prevent an infinite loop.\" );\n }\n }\n\n numberOfReRenders += 1;\n\n {\n // Even when hot reloading, allow dependencies to stabilize\n // after first render to prevent infinite render phase updates.\n ignorePreviousDependencies = false;\n } // Start over from the beginning of the list\n\n\n currentHook = null;\n workInProgressHook = null;\n workInProgress.updateQueue = null;\n\n {\n // Also validate hook order for cascading updates.\n hookTypesUpdateIndexDev = -1;\n }\n\n ReactCurrentDispatcher.current = HooksDispatcherOnRerenderInDEV ;\n children = Component(props, secondArg);\n } while (workInProgress.expirationTime === renderExpirationTime);\n } // We can assume the previous dispatcher is always this one, since we set it\n // at the beginning of the render phase and there's no re-entrancy.\n\n\n ReactCurrentDispatcher.current = ContextOnlyDispatcher;\n\n {\n workInProgress._debugHookTypes = hookTypesDev;\n } // This check uses currentHook so that it works the same in DEV and prod bundles.\n // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.\n\n\n var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;\n renderExpirationTime = NoWork;\n currentlyRenderingFiber$1 = null;\n currentHook = null;\n workInProgressHook = null;\n\n {\n currentHookNameInDev = null;\n hookTypesDev = null;\n hookTypesUpdateIndexDev = -1;\n }\n\n didScheduleRenderPhaseUpdate = false;\n\n if (!!didRenderTooFewHooks) {\n {\n throw Error( \"Rendered fewer hooks than expected. This may be caused by an accidental early return statement.\" );\n }\n }\n\n return children;\n}\nfunction bailoutHooks(current, workInProgress, expirationTime) {\n workInProgress.updateQueue = current.updateQueue;\n workInProgress.effectTag &= ~(Passive | Update);\n\n if (current.expirationTime <= expirationTime) {\n current.expirationTime = NoWork;\n }\n}\nfunction resetHooksAfterThrow() {\n // We can assume the previous dispatcher is always this one, since we set it\n // at the beginning of the render phase and there's no re-entrancy.\n ReactCurrentDispatcher.current = ContextOnlyDispatcher;\n\n if (didScheduleRenderPhaseUpdate) {\n // There were render phase updates. These are only valid for this render\n // phase, which we are now aborting. Remove the updates from the queues so\n // they do not persist to the next render. Do not remove updates from hooks\n // that weren't processed.\n //\n // Only reset the updates from the queue if it has a clone. If it does\n // not have a clone, that means it wasn't processed, and the updates were\n // scheduled before we entered the render phase.\n var hook = currentlyRenderingFiber$1.memoizedState;\n\n while (hook !== null) {\n var queue = hook.queue;\n\n if (queue !== null) {\n queue.pending = null;\n }\n\n hook = hook.next;\n }\n }\n\n renderExpirationTime = NoWork;\n currentlyRenderingFiber$1 = null;\n currentHook = null;\n workInProgressHook = null;\n\n {\n hookTypesDev = null;\n hookTypesUpdateIndexDev = -1;\n currentHookNameInDev = null;\n }\n\n didScheduleRenderPhaseUpdate = false;\n}\n\nfunction mountWorkInProgressHook() {\n var hook = {\n memoizedState: null,\n baseState: null,\n baseQueue: null,\n queue: null,\n next: null\n };\n\n if (workInProgressHook === null) {\n // This is the first hook in the list\n currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook;\n } else {\n // Append to the end of the list\n workInProgressHook = workInProgressHook.next = hook;\n }\n\n return workInProgressHook;\n}\n\nfunction updateWorkInProgressHook() {\n // This function is used both for updates and for re-renders triggered by a\n // render phase update. It assumes there is either a current hook we can\n // clone, or a work-in-progress hook from a previous render pass that we can\n // use as a base. When we reach the end of the base list, we must switch to\n // the dispatcher used for mounts.\n var nextCurrentHook;\n\n if (currentHook === null) {\n var current = currentlyRenderingFiber$1.alternate;\n\n if (current !== null) {\n nextCurrentHook = current.memoizedState;\n } else {\n nextCurrentHook = null;\n }\n } else {\n nextCurrentHook = currentHook.next;\n }\n\n var nextWorkInProgressHook;\n\n if (workInProgressHook === null) {\n nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState;\n } else {\n nextWorkInProgressHook = workInProgressHook.next;\n }\n\n if (nextWorkInProgressHook !== null) {\n // There's already a work-in-progress. Reuse it.\n workInProgressHook = nextWorkInProgressHook;\n nextWorkInProgressHook = workInProgressHook.next;\n currentHook = nextCurrentHook;\n } else {\n // Clone from the current hook.\n if (!(nextCurrentHook !== null)) {\n {\n throw Error( \"Rendered more hooks than during the previous render.\" );\n }\n }\n\n currentHook = nextCurrentHook;\n var newHook = {\n memoizedState: currentHook.memoizedState,\n baseState: currentHook.baseState,\n baseQueue: currentHook.baseQueue,\n queue: currentHook.queue,\n next: null\n };\n\n if (workInProgressHook === null) {\n // This is the first hook in the list.\n currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook;\n } else {\n // Append to the end of the list.\n workInProgressHook = workInProgressHook.next = newHook;\n }\n }\n\n return workInProgressHook;\n}\n\nfunction createFunctionComponentUpdateQueue() {\n return {\n lastEffect: null\n };\n}\n\nfunction basicStateReducer(state, action) {\n // $FlowFixMe: Flow doesn't like mixed types\n return typeof action === 'function' ? action(state) : action;\n}\n\nfunction mountReducer(reducer, initialArg, init) {\n var hook = mountWorkInProgressHook();\n var initialState;\n\n if (init !== undefined) {\n initialState = init(initialArg);\n } else {\n initialState = initialArg;\n }\n\n hook.memoizedState = hook.baseState = initialState;\n var queue = hook.queue = {\n pending: null,\n dispatch: null,\n lastRenderedReducer: reducer,\n lastRenderedState: initialState\n };\n var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);\n return [hook.memoizedState, dispatch];\n}\n\nfunction updateReducer(reducer, initialArg, init) {\n var hook = updateWorkInProgressHook();\n var queue = hook.queue;\n\n if (!(queue !== null)) {\n {\n throw Error( \"Should have a queue. This is likely a bug in React. Please file an issue.\" );\n }\n }\n\n queue.lastRenderedReducer = reducer;\n var current = currentHook; // The last rebase update that is NOT part of the base state.\n\n var baseQueue = current.baseQueue; // The last pending update that hasn't been processed yet.\n\n var pendingQueue = queue.pending;\n\n if (pendingQueue !== null) {\n // We have new updates that haven't been processed yet.\n // We'll add them to the base queue.\n if (baseQueue !== null) {\n // Merge the pending queue and the base queue.\n var baseFirst = baseQueue.next;\n var pendingFirst = pendingQueue.next;\n baseQueue.next = pendingFirst;\n pendingQueue.next = baseFirst;\n }\n\n current.baseQueue = baseQueue = pendingQueue;\n queue.pending = null;\n }\n\n if (baseQueue !== null) {\n // We have a queue to process.\n var first = baseQueue.next;\n var newState = current.baseState;\n var newBaseState = null;\n var newBaseQueueFirst = null;\n var newBaseQueueLast = null;\n var update = first;\n\n do {\n var updateExpirationTime = update.expirationTime;\n\n if (updateExpirationTime < renderExpirationTime) {\n // Priority is insufficient. Skip this update. If this is the first\n // skipped update, the previous update/state is the new base\n // update/state.\n var clone = {\n expirationTime: update.expirationTime,\n suspenseConfig: update.suspenseConfig,\n action: update.action,\n eagerReducer: update.eagerReducer,\n eagerState: update.eagerState,\n next: null\n };\n\n if (newBaseQueueLast === null) {\n newBaseQueueFirst = newBaseQueueLast = clone;\n newBaseState = newState;\n } else {\n newBaseQueueLast = newBaseQueueLast.next = clone;\n } // Update the remaining priority in the queue.\n\n\n if (updateExpirationTime > currentlyRenderingFiber$1.expirationTime) {\n currentlyRenderingFiber$1.expirationTime = updateExpirationTime;\n markUnprocessedUpdateTime(updateExpirationTime);\n }\n } else {\n // This update does have sufficient priority.\n if (newBaseQueueLast !== null) {\n var _clone = {\n expirationTime: Sync,\n // This update is going to be committed so we never want uncommit it.\n suspenseConfig: update.suspenseConfig,\n action: update.action,\n eagerReducer: update.eagerReducer,\n eagerState: update.eagerState,\n next: null\n };\n newBaseQueueLast = newBaseQueueLast.next = _clone;\n } // Mark the event time of this update as relevant to this render pass.\n // TODO: This should ideally use the true event time of this update rather than\n // its priority which is a derived and not reverseable value.\n // TODO: We should skip this update if it was already committed but currently\n // we have no way of detecting the difference between a committed and suspended\n // update here.\n\n\n markRenderEventTimeAndConfig(updateExpirationTime, update.suspenseConfig); // Process this update.\n\n if (update.eagerReducer === reducer) {\n // If this update was processed eagerly, and its reducer matches the\n // current reducer, we can use the eagerly computed state.\n newState = update.eagerState;\n } else {\n var action = update.action;\n newState = reducer(newState, action);\n }\n }\n\n update = update.next;\n } while (update !== null && update !== first);\n\n if (newBaseQueueLast === null) {\n newBaseState = newState;\n } else {\n newBaseQueueLast.next = newBaseQueueFirst;\n } // Mark that the fiber performed work, but only if the new state is\n // different from the current state.\n\n\n if (!objectIs(newState, hook.memoizedState)) {\n markWorkInProgressReceivedUpdate();\n }\n\n hook.memoizedState = newState;\n hook.baseState = newBaseState;\n hook.baseQueue = newBaseQueueLast;\n queue.lastRenderedState = newState;\n }\n\n var dispatch = queue.dispatch;\n return [hook.memoizedState, dispatch];\n}\n\nfunction rerenderReducer(reducer, initialArg, init) {\n var hook = updateWorkInProgressHook();\n var queue = hook.queue;\n\n if (!(queue !== null)) {\n {\n throw Error( \"Should have a queue. This is likely a bug in React. Please file an issue.\" );\n }\n }\n\n queue.lastRenderedReducer = reducer; // This is a re-render. Apply the new render phase updates to the previous\n // work-in-progress hook.\n\n var dispatch = queue.dispatch;\n var lastRenderPhaseUpdate = queue.pending;\n var newState = hook.memoizedState;\n\n if (lastRenderPhaseUpdate !== null) {\n // The queue doesn't persist past this render pass.\n queue.pending = null;\n var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next;\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 newState = reducer(newState, action);\n update = update.next;\n } while (update !== firstRenderPhaseUpdate); // Mark that the fiber performed work, but only if the new state is\n // different from the current state.\n\n\n if (!objectIs(newState, hook.memoizedState)) {\n markWorkInProgressReceivedUpdate();\n }\n\n hook.memoizedState = newState; // Don't persist the state accumulated from the render phase updates to\n // the base state unless the queue is empty.\n // TODO: Not sure if this is the desired semantics, but it's what we\n // do for gDSFP. I can't remember why.\n\n if (hook.baseQueue === null) {\n hook.baseState = newState;\n }\n\n queue.lastRenderedState = newState;\n }\n\n return [newState, dispatch];\n}\n\nfunction mountState(initialState) {\n var hook = mountWorkInProgressHook();\n\n if (typeof initialState === 'function') {\n // $FlowFixMe: Flow doesn't like mixed types\n initialState = initialState();\n }\n\n hook.memoizedState = hook.baseState = initialState;\n var queue = hook.queue = {\n pending: null,\n dispatch: null,\n lastRenderedReducer: basicStateReducer,\n lastRenderedState: initialState\n };\n var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);\n return [hook.memoizedState, dispatch];\n}\n\nfunction updateState(initialState) {\n return updateReducer(basicStateReducer);\n}\n\nfunction rerenderState(initialState) {\n return rerenderReducer(basicStateReducer);\n}\n\nfunction pushEffect(tag, create, destroy, deps) {\n var effect = {\n tag: tag,\n create: create,\n destroy: destroy,\n deps: deps,\n // Circular\n next: null\n };\n var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;\n\n if (componentUpdateQueue === null) {\n componentUpdateQueue = createFunctionComponentUpdateQueue();\n currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;\n componentUpdateQueue.lastEffect = effect.next = effect;\n } else {\n var lastEffect = componentUpdateQueue.lastEffect;\n\n if (lastEffect === null) {\n componentUpdateQueue.lastEffect = effect.next = effect;\n } else {\n var firstEffect = lastEffect.next;\n lastEffect.next = effect;\n effect.next = firstEffect;\n componentUpdateQueue.lastEffect = effect;\n }\n }\n\n return effect;\n}\n\nfunction mountRef(initialValue) {\n var hook = mountWorkInProgressHook();\n var ref = {\n current: initialValue\n };\n\n {\n Object.seal(ref);\n }\n\n hook.memoizedState = ref;\n return ref;\n}\n\nfunction updateRef(initialValue) {\n var hook = updateWorkInProgressHook();\n return hook.memoizedState;\n}\n\nfunction mountEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {\n var hook = mountWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n currentlyRenderingFiber$1.effectTag |= fiberEffectTag;\n hook.memoizedState = pushEffect(HasEffect | hookEffectTag, create, undefined, nextDeps);\n}\n\nfunction updateEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {\n var hook = updateWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n var destroy = undefined;\n\n if (currentHook !== null) {\n var prevEffect = currentHook.memoizedState;\n destroy = prevEffect.destroy;\n\n if (nextDeps !== null) {\n var prevDeps = prevEffect.deps;\n\n if (areHookInputsEqual(nextDeps, prevDeps)) {\n pushEffect(hookEffectTag, create, destroy, nextDeps);\n return;\n }\n }\n }\n\n currentlyRenderingFiber$1.effectTag |= fiberEffectTag;\n hook.memoizedState = pushEffect(HasEffect | hookEffectTag, create, destroy, nextDeps);\n}\n\nfunction mountEffect(create, deps) {\n {\n // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n if ('undefined' !== typeof jest) {\n warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);\n }\n }\n\n return mountEffectImpl(Update | Passive, Passive$1, create, deps);\n}\n\nfunction updateEffect(create, deps) {\n {\n // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n if ('undefined' !== typeof jest) {\n warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);\n }\n }\n\n return updateEffectImpl(Update | Passive, Passive$1, create, deps);\n}\n\nfunction mountLayoutEffect(create, deps) {\n return mountEffectImpl(Update, Layout, create, deps);\n}\n\nfunction updateLayoutEffect(create, deps) {\n return updateEffectImpl(Update, Layout, create, deps);\n}\n\nfunction imperativeHandleEffect(create, ref) {\n if (typeof ref === 'function') {\n var refCallback = ref;\n\n var _inst = create();\n\n refCallback(_inst);\n return function () {\n refCallback(null);\n };\n } else if (ref !== null && ref !== undefined) {\n var refObject = ref;\n\n {\n if (!refObject.hasOwnProperty('current')) {\n error('Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}');\n }\n }\n\n var _inst2 = create();\n\n refObject.current = _inst2;\n return function () {\n refObject.current = null;\n };\n }\n}\n\nfunction mountImperativeHandle(ref, create, deps) {\n {\n if (typeof create !== 'function') {\n error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');\n }\n } // TODO: If deps are provided, should we skip comparing the ref itself?\n\n\n var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;\n return mountEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);\n}\n\nfunction updateImperativeHandle(ref, create, deps) {\n {\n if (typeof create !== 'function') {\n error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');\n }\n } // TODO: If deps are provided, should we skip comparing the ref itself?\n\n\n var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;\n return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);\n}\n\nfunction mountDebugValue(value, formatterFn) {// This hook is normally a no-op.\n // The react-debug-hooks package injects its own implementation\n // so that e.g. DevTools can display custom hook values.\n}\n\nvar updateDebugValue = mountDebugValue;\n\nfunction mountCallback(callback, deps) {\n var hook = mountWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n hook.memoizedState = [callback, nextDeps];\n return callback;\n}\n\nfunction updateCallback(callback, deps) {\n var hook = updateWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n var prevState = hook.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 hook.memoizedState = [callback, nextDeps];\n return callback;\n}\n\nfunction mountMemo(nextCreate, deps) {\n var hook = mountWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n var nextValue = nextCreate();\n hook.memoizedState = [nextValue, nextDeps];\n return nextValue;\n}\n\nfunction updateMemo(nextCreate, deps) {\n var hook = updateWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n var prevState = hook.memoizedState;\n\n if (prevState !== null) {\n // Assume these are defined. If they're not, areHookInputsEqual will warn.\n if (nextDeps !== null) {\n var prevDeps = prevState[1];\n\n if (areHookInputsEqual(nextDeps, prevDeps)) {\n return prevState[0];\n }\n }\n }\n\n var nextValue = nextCreate();\n hook.memoizedState = [nextValue, nextDeps];\n return nextValue;\n}\n\nfunction mountDeferredValue(value, config) {\n var _mountState = mountState(value),\n prevValue = _mountState[0],\n setValue = _mountState[1];\n\n mountEffect(function () {\n var previousConfig = ReactCurrentBatchConfig$1.suspense;\n ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;\n\n try {\n setValue(value);\n } finally {\n ReactCurrentBatchConfig$1.suspense = previousConfig;\n }\n }, [value, config]);\n return prevValue;\n}\n\nfunction updateDeferredValue(value, config) {\n var _updateState = updateState(),\n prevValue = _updateState[0],\n setValue = _updateState[1];\n\n updateEffect(function () {\n var previousConfig = ReactCurrentBatchConfig$1.suspense;\n ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;\n\n try {\n setValue(value);\n } finally {\n ReactCurrentBatchConfig$1.suspense = previousConfig;\n }\n }, [value, config]);\n return prevValue;\n}\n\nfunction rerenderDeferredValue(value, config) {\n var _rerenderState = rerenderState(),\n prevValue = _rerenderState[0],\n setValue = _rerenderState[1];\n\n updateEffect(function () {\n var previousConfig = ReactCurrentBatchConfig$1.suspense;\n ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;\n\n try {\n setValue(value);\n } finally {\n ReactCurrentBatchConfig$1.suspense = previousConfig;\n }\n }, [value, config]);\n return prevValue;\n}\n\nfunction startTransition(setPending, config, callback) {\n var priorityLevel = getCurrentPriorityLevel();\n runWithPriority$1(priorityLevel < UserBlockingPriority$1 ? UserBlockingPriority$1 : priorityLevel, function () {\n setPending(true);\n });\n runWithPriority$1(priorityLevel > NormalPriority ? NormalPriority : priorityLevel, function () {\n var previousConfig = ReactCurrentBatchConfig$1.suspense;\n ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;\n\n try {\n setPending(false);\n callback();\n } finally {\n ReactCurrentBatchConfig$1.suspense = previousConfig;\n }\n });\n}\n\nfunction mountTransition(config) {\n var _mountState2 = mountState(false),\n isPending = _mountState2[0],\n setPending = _mountState2[1];\n\n var start = mountCallback(startTransition.bind(null, setPending, config), [setPending, config]);\n return [start, isPending];\n}\n\nfunction updateTransition(config) {\n var _updateState2 = updateState(),\n isPending = _updateState2[0],\n setPending = _updateState2[1];\n\n var start = updateCallback(startTransition.bind(null, setPending, config), [setPending, config]);\n return [start, isPending];\n}\n\nfunction rerenderTransition(config) {\n var _rerenderState2 = rerenderState(),\n isPending = _rerenderState2[0],\n setPending = _rerenderState2[1];\n\n var start = updateCallback(startTransition.bind(null, setPending, config), [setPending, config]);\n return [start, isPending];\n}\n\nfunction dispatchAction(fiber, queue, action) {\n {\n if (typeof arguments[3] === 'function') {\n error(\"State updates from the useState() and useReducer() Hooks don't support the \" + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().');\n }\n }\n\n var currentTime = requestCurrentTimeForUpdate();\n var suspenseConfig = requestCurrentSuspenseConfig();\n var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);\n var update = {\n expirationTime: expirationTime,\n suspenseConfig: suspenseConfig,\n action: action,\n eagerReducer: null,\n eagerState: null,\n next: null\n };\n\n {\n update.priority = getCurrentPriorityLevel();\n } // Append the update to the end of the list.\n\n\n var pending = queue.pending;\n\n if (pending === null) {\n // This is the first update. Create a circular list.\n update.next = update;\n } else {\n update.next = pending.next;\n pending.next = update;\n }\n\n queue.pending = update;\n var alternate = fiber.alternate;\n\n if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) {\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 update.expirationTime = renderExpirationTime;\n currentlyRenderingFiber$1.expirationTime = renderExpirationTime;\n } else {\n if (fiber.expirationTime === NoWork && (alternate === null || alternate.expirationTime === NoWork)) {\n // The queue is currently empty, which means we can eagerly compute the\n // next state before entering the render phase. If the new state is the\n // same as the current state, we may be able to bail out entirely.\n var lastRenderedReducer = queue.lastRenderedReducer;\n\n if (lastRenderedReducer !== null) {\n var prevDispatcher;\n\n {\n prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n }\n\n try {\n var currentState = queue.lastRenderedState;\n var eagerState = lastRenderedReducer(currentState, action); // Stash the eagerly computed state, and the reducer used to compute\n // it, on the update object. If the reducer hasn't changed by the\n // time we enter the render phase, then the eager state can be used\n // without calling the reducer again.\n\n update.eagerReducer = lastRenderedReducer;\n update.eagerState = eagerState;\n\n if (objectIs(eagerState, currentState)) {\n // Fast path. We can bail out without scheduling React to re-render.\n // It's still possible that we'll need to rebase this update later,\n // if the component re-renders for a different reason and by that\n // time the reducer has changed.\n return;\n }\n } catch (error) {// Suppress the error. It will throw again in the render phase.\n } finally {\n {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n }\n }\n }\n\n {\n // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n if ('undefined' !== typeof jest) {\n warnIfNotScopedWithMatchingAct(fiber);\n warnIfNotCurrentlyActingUpdatesInDev(fiber);\n }\n }\n\n scheduleWork(fiber, expirationTime);\n }\n}\n\nvar ContextOnlyDispatcher = {\n readContext: readContext,\n useCallback: throwInvalidHookError,\n useContext: throwInvalidHookError,\n useEffect: throwInvalidHookError,\n useImperativeHandle: throwInvalidHookError,\n useLayoutEffect: throwInvalidHookError,\n useMemo: throwInvalidHookError,\n useReducer: throwInvalidHookError,\n useRef: throwInvalidHookError,\n useState: throwInvalidHookError,\n useDebugValue: throwInvalidHookError,\n useResponder: throwInvalidHookError,\n useDeferredValue: throwInvalidHookError,\n useTransition: throwInvalidHookError\n};\nvar HooksDispatcherOnMountInDEV = null;\nvar HooksDispatcherOnMountWithHookTypesInDEV = null;\nvar HooksDispatcherOnUpdateInDEV = null;\nvar HooksDispatcherOnRerenderInDEV = null;\nvar InvalidNestedHooksDispatcherOnMountInDEV = null;\nvar InvalidNestedHooksDispatcherOnUpdateInDEV = null;\nvar InvalidNestedHooksDispatcherOnRerenderInDEV = null;\n\n{\n var warnInvalidContextAccess = function () {\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 var warnInvalidHookAccess = function () {\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://fb.me/rules-of-hooks');\n };\n\n HooksDispatcherOnMountInDEV = {\n readContext: function (context, observedBits) {\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n return mountCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n mountHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n return mountEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n return mountImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n return mountLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountMemo(create, deps);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n mountHookTypesDev();\n return mountRef(initialValue);\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountState(initialState);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n mountHookTypesDev();\n return mountDebugValue();\n },\n useResponder: function (responder, props) {\n currentHookNameInDev = 'useResponder';\n mountHookTypesDev();\n return createDeprecatedResponderListener(responder, props);\n },\n useDeferredValue: function (value, config) {\n currentHookNameInDev = 'useDeferredValue';\n mountHookTypesDev();\n return mountDeferredValue(value, config);\n },\n useTransition: function (config) {\n currentHookNameInDev = 'useTransition';\n mountHookTypesDev();\n return mountTransition(config);\n }\n };\n HooksDispatcherOnMountWithHookTypesInDEV = {\n readContext: function (context, observedBits) {\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n updateHookTypesDev();\n return mountCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n updateHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n updateHookTypesDev();\n return mountEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n updateHookTypesDev();\n return mountImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n updateHookTypesDev();\n return mountLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountMemo(create, deps);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n updateHookTypesDev();\n return mountRef(initialValue);\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountState(initialState);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n updateHookTypesDev();\n return mountDebugValue();\n },\n useResponder: function (responder, props) {\n currentHookNameInDev = 'useResponder';\n updateHookTypesDev();\n return createDeprecatedResponderListener(responder, props);\n },\n useDeferredValue: function (value, config) {\n currentHookNameInDev = 'useDeferredValue';\n updateHookTypesDev();\n return mountDeferredValue(value, config);\n },\n useTransition: function (config) {\n currentHookNameInDev = 'useTransition';\n updateHookTypesDev();\n return mountTransition(config);\n }\n };\n HooksDispatcherOnUpdateInDEV = {\n readContext: function (context, observedBits) {\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n updateHookTypesDev();\n return updateCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n updateHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n updateHookTypesDev();\n return updateEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n updateHookTypesDev();\n return updateImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n updateHookTypesDev();\n return updateLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateMemo(create, deps);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n updateHookTypesDev();\n return updateRef();\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateState(initialState);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n updateHookTypesDev();\n return updateDebugValue();\n },\n useResponder: function (responder, props) {\n currentHookNameInDev = 'useResponder';\n updateHookTypesDev();\n return createDeprecatedResponderListener(responder, props);\n },\n useDeferredValue: function (value, config) {\n currentHookNameInDev = 'useDeferredValue';\n updateHookTypesDev();\n return updateDeferredValue(value, config);\n },\n useTransition: function (config) {\n currentHookNameInDev = 'useTransition';\n updateHookTypesDev();\n return updateTransition(config);\n }\n };\n HooksDispatcherOnRerenderInDEV = {\n readContext: function (context, observedBits) {\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n updateHookTypesDev();\n return updateCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n updateHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n updateHookTypesDev();\n return updateEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n updateHookTypesDev();\n return updateImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n updateHookTypesDev();\n return updateLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;\n\n try {\n return updateMemo(create, deps);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;\n\n try {\n return rerenderReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n updateHookTypesDev();\n return updateRef();\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;\n\n try {\n return rerenderState(initialState);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n updateHookTypesDev();\n return updateDebugValue();\n },\n useResponder: function (responder, props) {\n currentHookNameInDev = 'useResponder';\n updateHookTypesDev();\n return createDeprecatedResponderListener(responder, props);\n },\n useDeferredValue: function (value, config) {\n currentHookNameInDev = 'useDeferredValue';\n updateHookTypesDev();\n return rerenderDeferredValue(value, config);\n },\n useTransition: function (config) {\n currentHookNameInDev = 'useTransition';\n updateHookTypesDev();\n return rerenderTransition(config);\n }\n };\n InvalidNestedHooksDispatcherOnMountInDEV = {\n readContext: function (context, observedBits) {\n warnInvalidContextAccess();\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n warnInvalidHookAccess();\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountMemo(create, deps);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n warnInvalidHookAccess();\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountRef(initialValue);\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n warnInvalidHookAccess();\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountState(initialState);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountDebugValue();\n },\n useResponder: function (responder, props) {\n currentHookNameInDev = 'useResponder';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return createDeprecatedResponderListener(responder, props);\n },\n useDeferredValue: function (value, config) {\n currentHookNameInDev = 'useDeferredValue';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountDeferredValue(value, config);\n },\n useTransition: function (config) {\n currentHookNameInDev = 'useTransition';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountTransition(config);\n }\n };\n InvalidNestedHooksDispatcherOnUpdateInDEV = {\n readContext: function (context, observedBits) {\n warnInvalidContextAccess();\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateMemo(create, deps);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateRef();\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateState(initialState);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateDebugValue();\n },\n useResponder: function (responder, props) {\n currentHookNameInDev = 'useResponder';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return createDeprecatedResponderListener(responder, props);\n },\n useDeferredValue: function (value, config) {\n currentHookNameInDev = 'useDeferredValue';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateDeferredValue(value, config);\n },\n useTransition: function (config) {\n currentHookNameInDev = 'useTransition';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateTransition(config);\n }\n };\n InvalidNestedHooksDispatcherOnRerenderInDEV = {\n readContext: function (context, observedBits) {\n warnInvalidContextAccess();\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateMemo(create, deps);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return rerenderReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateRef();\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return rerenderState(initialState);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateDebugValue();\n },\n useResponder: function (responder, props) {\n currentHookNameInDev = 'useResponder';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return createDeprecatedResponderListener(responder, props);\n },\n useDeferredValue: function (value, config) {\n currentHookNameInDev = 'useDeferredValue';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return rerenderDeferredValue(value, config);\n },\n useTransition: function (config) {\n currentHookNameInDev = 'useTransition';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return rerenderTransition(config);\n }\n };\n}\n\nvar now$1 = Scheduler.unstable_now;\nvar commitTime = 0;\nvar profilerStartTime = -1;\n\nfunction getCommitTime() {\n return commitTime;\n}\n\nfunction recordCommitTime() {\n\n commitTime = now$1();\n}\n\nfunction startProfilerTimer(fiber) {\n\n profilerStartTime = now$1();\n\n if (fiber.actualStartTime < 0) {\n fiber.actualStartTime = now$1();\n }\n}\n\nfunction stopProfilerTimerIfRunning(fiber) {\n\n profilerStartTime = -1;\n}\n\nfunction stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {\n\n if (profilerStartTime >= 0) {\n var elapsedTime = now$1() - profilerStartTime;\n fiber.actualDuration += elapsedTime;\n\n if (overrideBaseTime) {\n fiber.selfBaseDuration = elapsedTime;\n }\n\n profilerStartTime = -1;\n }\n}\n\n// This may have been an insertion or a hydration.\n\nvar hydrationParentFiber = null;\nvar nextHydratableInstance = null;\nvar isHydrating = false;\n\nfunction enterHydrationState(fiber) {\n\n var parentInstance = fiber.stateNode.containerInfo;\n nextHydratableInstance = getFirstHydratableChild(parentInstance);\n hydrationParentFiber = fiber;\n isHydrating = true;\n return true;\n}\n\nfunction deleteHydratableInstance(returnFiber, instance) {\n {\n switch (returnFiber.tag) {\n case HostRoot:\n didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);\n break;\n\n case HostComponent:\n didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);\n break;\n }\n }\n\n var childToDelete = createFiberFromHostInstanceForDeletion();\n childToDelete.stateNode = instance;\n childToDelete.return = returnFiber;\n childToDelete.effectTag = Deletion; // This might seem like it belongs on progressedFirstDeletion. However,\n // these children are not part of the reconciliation list of children.\n // Even if we abort and rereconcile the children, that will try to hydrate\n // again and the nodes are still in the host tree so these will be\n // recreated.\n\n if (returnFiber.lastEffect !== null) {\n returnFiber.lastEffect.nextEffect = childToDelete;\n returnFiber.lastEffect = childToDelete;\n } else {\n returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;\n }\n}\n\nfunction insertNonHydratedInstance(returnFiber, fiber) {\n fiber.effectTag = fiber.effectTag & ~Hydrating | Placement;\n\n {\n switch (returnFiber.tag) {\n case HostRoot:\n {\n var parentContainer = returnFiber.stateNode.containerInfo;\n\n switch (fiber.tag) {\n case HostComponent:\n var type = fiber.type;\n var props = fiber.pendingProps;\n didNotFindHydratableContainerInstance(parentContainer, type);\n break;\n\n case HostText:\n var text = fiber.pendingProps;\n didNotFindHydratableContainerTextInstance(parentContainer, text);\n break;\n }\n\n break;\n }\n\n case HostComponent:\n {\n var parentType = returnFiber.type;\n var parentProps = returnFiber.memoizedProps;\n var parentInstance = returnFiber.stateNode;\n\n switch (fiber.tag) {\n case HostComponent:\n var _type = fiber.type;\n var _props = fiber.pendingProps;\n didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type);\n break;\n\n case HostText:\n var _text = fiber.pendingProps;\n didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);\n break;\n\n case SuspenseComponent:\n didNotFindHydratableSuspenseInstance(parentType, parentProps);\n break;\n }\n\n break;\n }\n\n default:\n return;\n }\n }\n}\n\nfunction tryHydrate(fiber, nextInstance) {\n switch (fiber.tag) {\n case HostComponent:\n {\n var type = fiber.type;\n var props = fiber.pendingProps;\n var instance = canHydrateInstance(nextInstance, type);\n\n if (instance !== null) {\n fiber.stateNode = instance;\n return true;\n }\n\n return false;\n }\n\n case HostText:\n {\n var text = fiber.pendingProps;\n var textInstance = canHydrateTextInstance(nextInstance, text);\n\n if (textInstance !== null) {\n fiber.stateNode = textInstance;\n return true;\n }\n\n return false;\n }\n\n case SuspenseComponent:\n {\n\n return false;\n }\n\n default:\n return false;\n }\n}\n\nfunction tryToClaimNextHydratableInstance(fiber) {\n if (!isHydrating) {\n return;\n }\n\n var nextInstance = nextHydratableInstance;\n\n if (!nextInstance) {\n // Nothing to hydrate. Make it an insertion.\n insertNonHydratedInstance(hydrationParentFiber, fiber);\n isHydrating = false;\n hydrationParentFiber = fiber;\n return;\n }\n\n var firstAttemptedInstance = nextInstance;\n\n if (!tryHydrate(fiber, nextInstance)) {\n // If we can't hydrate this instance let's try the next one.\n // We use this as a heuristic. It's based on intuition and not data so it\n // might be flawed or unnecessary.\n nextInstance = getNextHydratableSibling(firstAttemptedInstance);\n\n if (!nextInstance || !tryHydrate(fiber, nextInstance)) {\n // Nothing to hydrate. Make it an insertion.\n insertNonHydratedInstance(hydrationParentFiber, fiber);\n isHydrating = false;\n hydrationParentFiber = fiber;\n return;\n } // We matched the next one, we'll now assume that the first one was\n // superfluous and we'll delete it. Since we can't eagerly delete it\n // we'll have to schedule a deletion. To do that, this node needs a dummy\n // fiber associated with it.\n\n\n deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance);\n }\n\n hydrationParentFiber = fiber;\n nextHydratableInstance = getFirstHydratableChild(nextInstance);\n}\n\nfunction prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {\n\n var instance = fiber.stateNode;\n var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber); // TODO: Type this specific to this type of component.\n\n fiber.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there\n // is a new ref we mark this as an update.\n\n if (updatePayload !== null) {\n return true;\n }\n\n return false;\n}\n\nfunction prepareToHydrateHostTextInstance(fiber) {\n\n var textInstance = fiber.stateNode;\n var textContent = fiber.memoizedProps;\n var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);\n\n {\n if (shouldUpdate) {\n // We assume that prepareToHydrateHostTextInstance is called in a context where the\n // hydration parent is the parent host component of this host text.\n var returnFiber = hydrationParentFiber;\n\n if (returnFiber !== null) {\n switch (returnFiber.tag) {\n case HostRoot:\n {\n var parentContainer = returnFiber.stateNode.containerInfo;\n didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);\n break;\n }\n\n case HostComponent:\n {\n var parentType = returnFiber.type;\n var parentProps = returnFiber.memoizedProps;\n var parentInstance = returnFiber.stateNode;\n didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);\n break;\n }\n }\n }\n }\n }\n\n return shouldUpdate;\n}\n\nfunction skipPastDehydratedSuspenseInstance(fiber) {\n\n var suspenseState = fiber.memoizedState;\n var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;\n\n if (!suspenseInstance) {\n {\n throw Error( \"Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);\n}\n\nfunction popToNextHostParent(fiber) {\n var parent = fiber.return;\n\n while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) {\n parent = parent.return;\n }\n\n hydrationParentFiber = parent;\n}\n\nfunction popHydrationState(fiber) {\n\n if (fiber !== hydrationParentFiber) {\n // We're deeper than the current hydration context, inside an inserted\n // tree.\n return false;\n }\n\n if (!isHydrating) {\n // If we're not currently hydrating but we're in a hydration context, then\n // we were an insertion and now need to pop up reenter hydration of our\n // siblings.\n popToNextHostParent(fiber);\n isHydrating = true;\n return false;\n }\n\n var type = fiber.type; // If we have any remaining hydratable nodes, we need to delete them now.\n // We only do this deeper than head and body since they tend to have random\n // other nodes in them. We also ignore components with pure text content in\n // side of them.\n // TODO: Better heuristic.\n\n if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) {\n var nextInstance = nextHydratableInstance;\n\n while (nextInstance) {\n deleteHydratableInstance(fiber, nextInstance);\n nextInstance = getNextHydratableSibling(nextInstance);\n }\n }\n\n popToNextHostParent(fiber);\n\n if (fiber.tag === SuspenseComponent) {\n nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);\n } else {\n nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;\n }\n\n return true;\n}\n\nfunction resetHydrationState() {\n\n hydrationParentFiber = null;\n nextHydratableInstance = null;\n isHydrating = false;\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar didReceiveUpdate = false;\nvar didWarnAboutBadClass;\nvar didWarnAboutModulePatternComponent;\nvar didWarnAboutContextTypeOnFunctionComponent;\nvar didWarnAboutGetDerivedStateOnFunctionComponent;\nvar didWarnAboutFunctionRefs;\nvar didWarnAboutReassigningProps;\nvar didWarnAboutRevealOrder;\nvar didWarnAboutTailOptions;\n\n{\n didWarnAboutBadClass = {};\n didWarnAboutModulePatternComponent = {};\n didWarnAboutContextTypeOnFunctionComponent = {};\n didWarnAboutGetDerivedStateOnFunctionComponent = {};\n didWarnAboutFunctionRefs = {};\n didWarnAboutReassigningProps = false;\n didWarnAboutRevealOrder = {};\n didWarnAboutTailOptions = {};\n}\n\nfunction reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime) {\n if (current === null) {\n // If this is a fresh new component that hasn't been rendered yet, we\n // won't update its child set by applying minimal side-effects. Instead,\n // we will add them all to the child before it gets rendered. That means\n // we can optimize this reconciliation pass by not tracking side-effects.\n workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);\n } else {\n // If the current child is the same as the work in progress, it means that\n // we haven't yet started any work on these children. Therefore, we use\n // the clone algorithm to create a copy of all the current children.\n // If we had any progressed work already, that is invalid at this point so\n // let's throw it out.\n workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderExpirationTime);\n }\n}\n\nfunction forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderExpirationTime) {\n // This function is fork of reconcileChildren. It's used in cases where we\n // want to reconcile without matching against the existing set. This has the\n // effect of all current children being unmounted; even if the type and key\n // are the same, the old child is unmounted and a new child is created.\n //\n // To do this, we're going to go through the reconcile algorithm twice. In\n // the first pass, we schedule a deletion for all the current children by\n // passing null.\n workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderExpirationTime); // In the second pass, we mount the new children. The trick here is that we\n // pass null in place of where we usually pass the current child set. This has\n // the effect of remounting all children regardless of whether their\n // identities match.\n\n workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);\n}\n\nfunction updateForwardRef(current, workInProgress, Component, nextProps, renderExpirationTime) {\n // TODO: current can be non-null here even if the component\n // hasn't yet mounted. This happens after the first render suspends.\n // We'll need to figure out if this is fine or can cause issues.\n {\n if (workInProgress.type !== workInProgress.elementType) {\n // Lazy component props can't be validated in createElement\n // because they're only guaranteed to be resolved here.\n var innerPropTypes = Component.propTypes;\n\n if (innerPropTypes) {\n checkPropTypes(innerPropTypes, nextProps, // Resolved props\n 'prop', getComponentName(Component), getCurrentFiberStackInDev);\n }\n }\n }\n\n var render = Component.render;\n var ref = workInProgress.ref; // The rest is a fork of updateFunctionComponent\n\n var nextChildren;\n prepareToReadContext(workInProgress, renderExpirationTime);\n\n {\n ReactCurrentOwner$1.current = workInProgress;\n setIsRendering(true);\n nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderExpirationTime);\n\n if ( workInProgress.mode & StrictMode) {\n // Only double-render components with Hooks\n if (workInProgress.memoizedState !== null) {\n nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderExpirationTime);\n }\n }\n\n setIsRendering(false);\n }\n\n if (current !== null && !didReceiveUpdate) {\n bailoutHooks(current, workInProgress, renderExpirationTime);\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n } // React DevTools reads this flag.\n\n\n workInProgress.effectTag |= PerformedWork;\n reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n return workInProgress.child;\n}\n\nfunction updateMemoComponent(current, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {\n if (current === null) {\n var type = Component.type;\n\n if (isSimpleFunctionComponent(type) && Component.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.\n Component.defaultProps === undefined) {\n var resolvedType = type;\n\n {\n resolvedType = resolveFunctionForHotReloading(type);\n } // If this is a plain function component without default props,\n // and with only the default shallow comparison, we upgrade it\n // to a SimpleMemoComponent to allow fast path updates.\n\n\n workInProgress.tag = SimpleMemoComponent;\n workInProgress.type = resolvedType;\n\n {\n validateFunctionComponentInDev(workInProgress, type);\n }\n\n return updateSimpleMemoComponent(current, workInProgress, resolvedType, nextProps, updateExpirationTime, renderExpirationTime);\n }\n\n {\n var innerPropTypes = type.propTypes;\n\n if (innerPropTypes) {\n // Inner memo component props aren't currently validated in createElement.\n // We could move it there, but we'd still need this for lazy code path.\n checkPropTypes(innerPropTypes, nextProps, // Resolved props\n 'prop', getComponentName(type), getCurrentFiberStackInDev);\n }\n }\n\n var child = createFiberFromTypeAndProps(Component.type, null, nextProps, null, workInProgress.mode, renderExpirationTime);\n child.ref = workInProgress.ref;\n child.return = workInProgress;\n workInProgress.child = child;\n return child;\n }\n\n {\n var _type = Component.type;\n var _innerPropTypes = _type.propTypes;\n\n if (_innerPropTypes) {\n // Inner memo component props aren't currently validated in createElement.\n // We could move it there, but we'd still need this for lazy code path.\n checkPropTypes(_innerPropTypes, nextProps, // Resolved props\n 'prop', getComponentName(_type), getCurrentFiberStackInDev);\n }\n }\n\n var currentChild = current.child; // This is always exactly one child\n\n if (updateExpirationTime < renderExpirationTime) {\n // This will be the props with resolved defaultProps,\n // unlike current.memoizedProps which will be the unresolved ones.\n var prevProps = currentChild.memoizedProps; // Default to shallow comparison\n\n var compare = Component.compare;\n compare = compare !== null ? compare : shallowEqual;\n\n if (compare(prevProps, nextProps) && current.ref === workInProgress.ref) {\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n }\n } // React DevTools reads this flag.\n\n\n workInProgress.effectTag |= PerformedWork;\n var newChild = createWorkInProgress(currentChild, nextProps);\n newChild.ref = workInProgress.ref;\n newChild.return = workInProgress;\n workInProgress.child = newChild;\n return newChild;\n}\n\nfunction updateSimpleMemoComponent(current, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {\n // TODO: current can be non-null here even if the component\n // hasn't yet mounted. This happens when the inner render suspends.\n // We'll need to figure out if this is fine or can cause issues.\n {\n if (workInProgress.type !== workInProgress.elementType) {\n // Lazy component props can't be validated in createElement\n // because they're only guaranteed to be resolved here.\n var outerMemoType = workInProgress.elementType;\n\n if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {\n // We warn when you define propTypes on lazy()\n // so let's just skip over it to find memo() outer wrapper.\n // Inner props for memo are validated later.\n outerMemoType = refineResolvedLazyComponent(outerMemoType);\n }\n\n var outerPropTypes = outerMemoType && outerMemoType.propTypes;\n\n if (outerPropTypes) {\n checkPropTypes(outerPropTypes, nextProps, // Resolved (SimpleMemoComponent has no defaultProps)\n 'prop', getComponentName(outerMemoType), getCurrentFiberStackInDev);\n } // Inner propTypes will be validated in the function component path.\n\n }\n }\n\n if (current !== null) {\n var prevProps = current.memoizedProps;\n\n if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress.ref && ( // Prevent bailout if the implementation changed due to hot reload.\n workInProgress.type === current.type )) {\n didReceiveUpdate = false;\n\n if (updateExpirationTime < renderExpirationTime) {\n // The pending update priority was cleared at the beginning of\n // beginWork. We're about to bail out, but there might be additional\n // updates at a lower priority. Usually, the priority level of the\n // remaining updates is accumlated during the evaluation of the\n // component (i.e. when processing the update queue). But since since\n // we're bailing out early *without* evaluating the component, we need\n // to account for it here, too. Reset to the value of the current fiber.\n // NOTE: This only applies to SimpleMemoComponent, not MemoComponent,\n // because a MemoComponent fiber does not have hooks or an update queue;\n // rather, it wraps around an inner component, which may or may not\n // contains hooks.\n // TODO: Move the reset at in beginWork out of the common path so that\n // this is no longer necessary.\n workInProgress.expirationTime = current.expirationTime;\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n }\n }\n }\n\n return updateFunctionComponent(current, workInProgress, Component, nextProps, renderExpirationTime);\n}\n\nfunction updateFragment(current, workInProgress, renderExpirationTime) {\n var nextChildren = workInProgress.pendingProps;\n reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n return workInProgress.child;\n}\n\nfunction updateMode(current, workInProgress, renderExpirationTime) {\n var nextChildren = workInProgress.pendingProps.children;\n reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n return workInProgress.child;\n}\n\nfunction updateProfiler(current, workInProgress, renderExpirationTime) {\n {\n workInProgress.effectTag |= Update;\n }\n\n var nextProps = workInProgress.pendingProps;\n var nextChildren = nextProps.children;\n reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n return workInProgress.child;\n}\n\nfunction markRef(current, workInProgress) {\n var ref = workInProgress.ref;\n\n if (current === null && ref !== null || current !== null && current.ref !== ref) {\n // Schedule a Ref effect\n workInProgress.effectTag |= Ref;\n }\n}\n\nfunction updateFunctionComponent(current, workInProgress, Component, nextProps, renderExpirationTime) {\n {\n if (workInProgress.type !== workInProgress.elementType) {\n // Lazy component props can't be validated in createElement\n // because they're only guaranteed to be resolved here.\n var innerPropTypes = Component.propTypes;\n\n if (innerPropTypes) {\n checkPropTypes(innerPropTypes, nextProps, // Resolved props\n 'prop', getComponentName(Component), getCurrentFiberStackInDev);\n }\n }\n }\n\n var context;\n\n {\n var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);\n context = getMaskedContext(workInProgress, unmaskedContext);\n }\n\n var nextChildren;\n prepareToReadContext(workInProgress, renderExpirationTime);\n\n {\n ReactCurrentOwner$1.current = workInProgress;\n setIsRendering(true);\n nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderExpirationTime);\n\n if ( workInProgress.mode & StrictMode) {\n // Only double-render components with Hooks\n if (workInProgress.memoizedState !== null) {\n nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderExpirationTime);\n }\n }\n\n setIsRendering(false);\n }\n\n if (current !== null && !didReceiveUpdate) {\n bailoutHooks(current, workInProgress, renderExpirationTime);\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n } // React DevTools reads this flag.\n\n\n workInProgress.effectTag |= PerformedWork;\n reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n return workInProgress.child;\n}\n\nfunction updateClassComponent(current, workInProgress, Component, nextProps, renderExpirationTime) {\n {\n if (workInProgress.type !== workInProgress.elementType) {\n // Lazy component props can't be validated in createElement\n // because they're only guaranteed to be resolved here.\n var innerPropTypes = Component.propTypes;\n\n if (innerPropTypes) {\n checkPropTypes(innerPropTypes, nextProps, // Resolved props\n 'prop', getComponentName(Component), getCurrentFiberStackInDev);\n }\n }\n } // Push context providers early to prevent context stack mismatches.\n // During mounting we don't know the child context yet as the instance doesn't exist.\n // We will invalidate the child context in finishClassComponent() right after rendering.\n\n\n var hasContext;\n\n if (isContextProvider(Component)) {\n hasContext = true;\n pushContextProvider(workInProgress);\n } else {\n hasContext = false;\n }\n\n prepareToReadContext(workInProgress, renderExpirationTime);\n var instance = workInProgress.stateNode;\n var shouldUpdate;\n\n if (instance === null) {\n if (current !== null) {\n // A class component without an instance only mounts if it suspended\n // inside a non-concurrent tree, in an inconsistent state. We want to\n // treat it like a new mount, even though an empty version of it already\n // committed. Disconnect the alternate pointers.\n current.alternate = null;\n workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect\n\n workInProgress.effectTag |= Placement;\n } // In the initial pass we might need to construct the instance.\n\n\n constructClassInstance(workInProgress, Component, nextProps);\n mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);\n shouldUpdate = true;\n } else if (current === null) {\n // In a resume, we'll already have an instance we can reuse.\n shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);\n } else {\n shouldUpdate = updateClassInstance(current, workInProgress, Component, nextProps, renderExpirationTime);\n }\n\n var nextUnitOfWork = finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime);\n\n {\n var inst = workInProgress.stateNode;\n\n if (inst.props !== nextProps) {\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.', getComponentName(workInProgress.type) || 'a component');\n }\n\n didWarnAboutReassigningProps = true;\n }\n }\n\n return nextUnitOfWork;\n}\n\nfunction finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime) {\n // Refs should update even if shouldComponentUpdate returns false\n markRef(current, workInProgress);\n var didCaptureError = (workInProgress.effectTag & DidCapture) !== NoEffect;\n\n if (!shouldUpdate && !didCaptureError) {\n // Context providers should defer to sCU for rendering\n if (hasContext) {\n invalidateContextProvider(workInProgress, Component, false);\n }\n\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n }\n\n var instance = workInProgress.stateNode; // Rerender\n\n ReactCurrentOwner$1.current = workInProgress;\n var nextChildren;\n\n if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') {\n // If we captured an error, but getDerivedStateFromError is not defined,\n // unmount all the children. componentDidCatch will schedule an update to\n // re-render a fallback. This is temporary until we migrate everyone to\n // the new API.\n // TODO: Warn in a future release.\n nextChildren = null;\n\n {\n stopProfilerTimerIfRunning();\n }\n } else {\n {\n setIsRendering(true);\n nextChildren = instance.render();\n\n if ( workInProgress.mode & StrictMode) {\n instance.render();\n }\n\n setIsRendering(false);\n }\n } // React DevTools reads this flag.\n\n\n workInProgress.effectTag |= PerformedWork;\n\n if (current !== null && didCaptureError) {\n // If we're recovering from an error, reconcile without reusing any of\n // the existing children. Conceptually, the normal children and the children\n // that are shown on error are two different sets, so we shouldn't reuse\n // normal children even if their identities match.\n forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderExpirationTime);\n } else {\n reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n } // Memoize state using the values we just used to render.\n // TODO: Restructure so we never read values from the instance.\n\n\n workInProgress.memoizedState = instance.state; // The context might have changed so we need to recalculate it.\n\n if (hasContext) {\n invalidateContextProvider(workInProgress, Component, true);\n }\n\n return workInProgress.child;\n}\n\nfunction pushHostRootContext(workInProgress) {\n var root = workInProgress.stateNode;\n\n if (root.pendingContext) {\n pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context);\n } else if (root.context) {\n // Should always be set\n pushTopLevelContextObject(workInProgress, root.context, false);\n }\n\n pushHostContainer(workInProgress, root.containerInfo);\n}\n\nfunction updateHostRoot(current, workInProgress, renderExpirationTime) {\n pushHostRootContext(workInProgress);\n var updateQueue = workInProgress.updateQueue;\n\n if (!(current !== null && updateQueue !== null)) {\n {\n throw Error( \"If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n var nextProps = workInProgress.pendingProps;\n var prevState = workInProgress.memoizedState;\n var prevChildren = prevState !== null ? prevState.element : null;\n cloneUpdateQueue(current, workInProgress);\n processUpdateQueue(workInProgress, nextProps, null, renderExpirationTime);\n var nextState = workInProgress.memoizedState; // Caution: React DevTools currently depends on this property\n // being called \"element\".\n\n var nextChildren = nextState.element;\n\n if (nextChildren === prevChildren) {\n // If the state is the same as before, that's a bailout because we had\n // no work that expires at this time.\n resetHydrationState();\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n }\n\n var root = workInProgress.stateNode;\n\n if (root.hydrate && enterHydrationState(workInProgress)) {\n // If we don't have any current children this might be the first pass.\n // We always try to hydrate. If this isn't a hydration pass there won't\n // be any children to hydrate which is effectively the same thing as\n // not hydrating.\n var child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);\n workInProgress.child = child;\n var node = child;\n\n while (node) {\n // Mark each child as hydrating. This is a fast path to know whether this\n // tree is part of a hydrating tree. This is used to determine if a child\n // node has fully mounted yet, and for scheduling event replaying.\n // Conceptually this is similar to Placement in that a new subtree is\n // inserted into the React tree here. It just happens to not need DOM\n // mutations because it already exists.\n node.effectTag = node.effectTag & ~Placement | Hydrating;\n node = node.sibling;\n }\n } else {\n // Otherwise reset hydration state in case we aborted and resumed another\n // root.\n reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n resetHydrationState();\n }\n\n return workInProgress.child;\n}\n\nfunction updateHostComponent(current, workInProgress, renderExpirationTime) {\n pushHostContext(workInProgress);\n\n if (current === null) {\n tryToClaimNextHydratableInstance(workInProgress);\n }\n\n var type = workInProgress.type;\n var nextProps = workInProgress.pendingProps;\n var prevProps = current !== null ? current.memoizedProps : null;\n var nextChildren = nextProps.children;\n var isDirectTextChild = shouldSetTextContent(type, nextProps);\n\n if (isDirectTextChild) {\n // We special case a direct text child of a host node. This is a common\n // case. We won't handle it as a reified child. We will instead handle\n // this in the host environment that also has access to this prop. That\n // avoids allocating another HostText fiber and traversing it.\n nextChildren = null;\n } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {\n // If we're switching from a direct text child to a normal child, or to\n // empty, we need to schedule the text content to be reset.\n workInProgress.effectTag |= ContentReset;\n }\n\n markRef(current, workInProgress); // Check the host config to see if the children are offscreen/hidden.\n\n if (workInProgress.mode & ConcurrentMode && renderExpirationTime !== Never && shouldDeprioritizeSubtree(type, nextProps)) {\n {\n markSpawnedWork(Never);\n } // Schedule this fiber to re-render at offscreen priority. Then bailout.\n\n\n workInProgress.expirationTime = workInProgress.childExpirationTime = Never;\n return null;\n }\n\n reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n return workInProgress.child;\n}\n\nfunction updateHostText(current, workInProgress) {\n if (current === null) {\n tryToClaimNextHydratableInstance(workInProgress);\n } // Nothing to do here. This is terminal. We'll do the completion step\n // immediately after.\n\n\n return null;\n}\n\nfunction mountLazyComponent(_current, workInProgress, elementType, updateExpirationTime, renderExpirationTime) {\n if (_current !== null) {\n // A lazy component only mounts if it suspended inside a non-\n // concurrent tree, in an inconsistent state. We want to treat it like\n // a new mount, even though an empty version of it already committed.\n // Disconnect the alternate pointers.\n _current.alternate = null;\n workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect\n\n workInProgress.effectTag |= Placement;\n }\n\n var props = workInProgress.pendingProps; // We can't start a User Timing measurement with correct label yet.\n // Cancel and resume right after we know the tag.\n\n cancelWorkTimer(workInProgress);\n var Component = readLazyComponentType(elementType); // Store the unwrapped component in the type.\n\n workInProgress.type = Component;\n var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component);\n startWorkTimer(workInProgress);\n var resolvedProps = resolveDefaultProps(Component, props);\n var child;\n\n switch (resolvedTag) {\n case FunctionComponent:\n {\n {\n validateFunctionComponentInDev(workInProgress, Component);\n workInProgress.type = Component = resolveFunctionForHotReloading(Component);\n }\n\n child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);\n return child;\n }\n\n case ClassComponent:\n {\n {\n workInProgress.type = Component = resolveClassForHotReloading(Component);\n }\n\n child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);\n return child;\n }\n\n case ForwardRef:\n {\n {\n workInProgress.type = Component = resolveForwardRefForHotReloading(Component);\n }\n\n child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderExpirationTime);\n return child;\n }\n\n case MemoComponent:\n {\n {\n if (workInProgress.type !== workInProgress.elementType) {\n var outerPropTypes = Component.propTypes;\n\n if (outerPropTypes) {\n checkPropTypes(outerPropTypes, resolvedProps, // Resolved for outer only\n 'prop', getComponentName(Component), getCurrentFiberStackInDev);\n }\n }\n }\n\n child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too\n updateExpirationTime, renderExpirationTime);\n return child;\n }\n }\n\n var hint = '';\n\n {\n if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) {\n hint = ' Did you wrap a component in React.lazy() more than once?';\n }\n } // This message intentionally doesn't mention ForwardRef or MemoComponent\n // because the fact that it's a separate type of work is an\n // implementation detail.\n\n\n {\n {\n throw Error( \"Element type is invalid. Received a promise that resolves to: \" + Component + \". Lazy element type must resolve to a class or function.\" + hint );\n }\n }\n}\n\nfunction mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderExpirationTime) {\n if (_current !== null) {\n // An incomplete component only mounts if it suspended inside a non-\n // concurrent tree, in an inconsistent state. We want to treat it like\n // a new mount, even though an empty version of it already committed.\n // Disconnect the alternate pointers.\n _current.alternate = null;\n workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect\n\n workInProgress.effectTag |= Placement;\n } // Promote the fiber to a class and try rendering again.\n\n\n workInProgress.tag = ClassComponent; // The rest of this function is a fork of `updateClassComponent`\n // Push context providers early to prevent context stack mismatches.\n // During mounting we don't know the child context yet as the instance doesn't exist.\n // We will invalidate the child context in finishClassComponent() right after rendering.\n\n var hasContext;\n\n if (isContextProvider(Component)) {\n hasContext = true;\n pushContextProvider(workInProgress);\n } else {\n hasContext = false;\n }\n\n prepareToReadContext(workInProgress, renderExpirationTime);\n constructClassInstance(workInProgress, Component, nextProps);\n mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);\n return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);\n}\n\nfunction mountIndeterminateComponent(_current, workInProgress, Component, renderExpirationTime) {\n if (_current !== null) {\n // An indeterminate component only mounts if it suspended inside a non-\n // concurrent tree, in an inconsistent state. We want to treat it like\n // a new mount, even though an empty version of it already committed.\n // Disconnect the alternate pointers.\n _current.alternate = null;\n workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect\n\n workInProgress.effectTag |= Placement;\n }\n\n var props = workInProgress.pendingProps;\n var context;\n\n {\n var unmaskedContext = getUnmaskedContext(workInProgress, Component, false);\n context = getMaskedContext(workInProgress, unmaskedContext);\n }\n\n prepareToReadContext(workInProgress, renderExpirationTime);\n var value;\n\n {\n if (Component.prototype && typeof Component.prototype.render === 'function') {\n var componentName = getComponentName(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\n didWarnAboutBadClass[componentName] = true;\n }\n }\n\n if (workInProgress.mode & StrictMode) {\n ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null);\n }\n\n setIsRendering(true);\n ReactCurrentOwner$1.current = workInProgress;\n value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);\n setIsRendering(false);\n } // React DevTools reads this flag.\n\n\n workInProgress.effectTag |= PerformedWork;\n\n if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {\n {\n var _componentName = getComponentName(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\n didWarnAboutModulePatternComponent[_componentName] = true;\n }\n } // Proceed under the assumption that this is a class instance\n\n\n workInProgress.tag = ClassComponent; // Throw out any hooks that were used.\n\n workInProgress.memoizedState = null;\n workInProgress.updateQueue = null; // Push context providers early to prevent context stack mismatches.\n // During mounting we don't know the child context yet as the instance doesn't exist.\n // We will invalidate the child context in finishClassComponent() right after rendering.\n\n var hasContext = false;\n\n if (isContextProvider(Component)) {\n hasContext = true;\n pushContextProvider(workInProgress);\n } else {\n hasContext = false;\n }\n\n workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null;\n initializeUpdateQueue(workInProgress);\n var getDerivedStateFromProps = Component.getDerivedStateFromProps;\n\n if (typeof getDerivedStateFromProps === 'function') {\n applyDerivedStateFromProps(workInProgress, Component, getDerivedStateFromProps, props);\n }\n\n adoptClassInstance(workInProgress, value);\n mountClassInstance(workInProgress, Component, props, renderExpirationTime);\n return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);\n } else {\n // Proceed under the assumption that this is a function component\n workInProgress.tag = FunctionComponent;\n\n {\n\n if ( workInProgress.mode & StrictMode) {\n // Only double-render components with Hooks\n if (workInProgress.memoizedState !== null) {\n value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);\n }\n }\n }\n\n reconcileChildren(null, workInProgress, value, renderExpirationTime);\n\n {\n validateFunctionComponentInDev(workInProgress, Component);\n }\n\n return workInProgress.child;\n }\n}\n\nfunction validateFunctionComponentInDev(workInProgress, 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 (workInProgress.ref !== null) {\n var info = '';\n var ownerName = getCurrentFiberOwnerNameInDevOrNull();\n\n if (ownerName) {\n info += '\\n\\nCheck the render method of `' + ownerName + '`.';\n }\n\n var warningKey = ownerName || workInProgress._debugID || '';\n var debugSource = workInProgress._debugSource;\n\n if (debugSource) {\n warningKey = debugSource.fileName + ':' + debugSource.lineNumber;\n }\n\n if (!didWarnAboutFunctionRefs[warningKey]) {\n didWarnAboutFunctionRefs[warningKey] = true;\n\n error('Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info);\n }\n }\n\n if (typeof Component.getDerivedStateFromProps === 'function') {\n var _componentName2 = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2]) {\n error('%s: Function components do not support getDerivedStateFromProps.', _componentName2);\n\n didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = true;\n }\n }\n\n if (typeof Component.contextType === 'object' && Component.contextType !== null) {\n var _componentName3 = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) {\n error('%s: Function components do not support contextType.', _componentName3);\n\n didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true;\n }\n }\n }\n}\n\nvar SUSPENDED_MARKER = {\n dehydrated: null,\n retryTime: NoWork\n};\n\nfunction shouldRemainOnFallback(suspenseContext, current, workInProgress) {\n // If the context is telling us that we should show a fallback, and we're not\n // already showing content, then we should show the fallback instead.\n return hasSuspenseContext(suspenseContext, ForceSuspenseFallback) && (current === null || current.memoizedState !== null);\n}\n\nfunction updateSuspenseComponent(current, workInProgress, renderExpirationTime) {\n var mode = workInProgress.mode;\n var nextProps = workInProgress.pendingProps; // This is used by DevTools to force a boundary to suspend.\n\n {\n if (shouldSuspend(workInProgress)) {\n workInProgress.effectTag |= DidCapture;\n }\n }\n\n var suspenseContext = suspenseStackCursor.current;\n var nextDidTimeout = false;\n var didSuspend = (workInProgress.effectTag & DidCapture) !== NoEffect;\n\n if (didSuspend || shouldRemainOnFallback(suspenseContext, current)) {\n // Something in this boundary's subtree already suspended. Switch to\n // rendering the fallback children.\n nextDidTimeout = true;\n workInProgress.effectTag &= ~DidCapture;\n } else {\n // Attempting the main content\n if (current === null || current.memoizedState !== null) {\n // This is a new mount or this boundary is already showing a fallback state.\n // Mark this subtree context as having at least one invisible parent that could\n // handle the fallback state.\n // Boundaries without fallbacks or should be avoided are not considered since\n // they cannot handle preferred fallback states.\n if (nextProps.fallback !== undefined && nextProps.unstable_avoidThisFallback !== true) {\n suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);\n }\n }\n }\n\n suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);\n pushSuspenseContext(workInProgress, suspenseContext); // This next part is a bit confusing. If the children timeout, we switch to\n // showing the fallback children in place of the \"primary\" children.\n // However, we don't want to delete the primary children because then their\n // state will be lost (both the React state and the host state, e.g.\n // uncontrolled form inputs). Instead we keep them mounted and hide them.\n // Both the fallback children AND the primary children are rendered at the\n // same time. Once the primary children are un-suspended, we can delete\n // the fallback children — don't need to preserve their state.\n //\n // The two sets of children are siblings in the host environment, but\n // semantically, for purposes of reconciliation, they are two separate sets.\n // So we store them using two fragment fibers.\n //\n // However, we want to avoid allocating extra fibers for every placeholder.\n // They're only necessary when the children time out, because that's the\n // only time when both sets are mounted.\n //\n // So, the extra fragment fibers are only used if the children time out.\n // Otherwise, we render the primary children directly. This requires some\n // custom reconciliation logic to preserve the state of the primary\n // children. It's essentially a very basic form of re-parenting.\n\n if (current === null) {\n // If we're currently hydrating, try to hydrate this boundary.\n // But only if this has a fallback.\n if (nextProps.fallback !== undefined) {\n tryToClaimNextHydratableInstance(workInProgress); // This could've been a dehydrated suspense component.\n } // This is the initial mount. This branch is pretty simple because there's\n // no previous state that needs to be preserved.\n\n\n if (nextDidTimeout) {\n // Mount separate fragments for primary and fallback children.\n var nextFallbackChildren = nextProps.fallback;\n var primaryChildFragment = createFiberFromFragment(null, mode, NoWork, null);\n primaryChildFragment.return = workInProgress;\n\n if ((workInProgress.mode & BlockingMode) === NoMode) {\n // Outside of blocking mode, we commit the effects from the\n // partially completed, timed-out tree, too.\n var progressedState = workInProgress.memoizedState;\n var progressedPrimaryChild = progressedState !== null ? workInProgress.child.child : workInProgress.child;\n primaryChildFragment.child = progressedPrimaryChild;\n var progressedChild = progressedPrimaryChild;\n\n while (progressedChild !== null) {\n progressedChild.return = primaryChildFragment;\n progressedChild = progressedChild.sibling;\n }\n }\n\n var fallbackChildFragment = createFiberFromFragment(nextFallbackChildren, mode, renderExpirationTime, null);\n fallbackChildFragment.return = workInProgress;\n primaryChildFragment.sibling = fallbackChildFragment; // Skip the primary children, and continue working on the\n // fallback children.\n\n workInProgress.memoizedState = SUSPENDED_MARKER;\n workInProgress.child = primaryChildFragment;\n return fallbackChildFragment;\n } else {\n // Mount the primary children without an intermediate fragment fiber.\n var nextPrimaryChildren = nextProps.children;\n workInProgress.memoizedState = null;\n return workInProgress.child = mountChildFibers(workInProgress, null, nextPrimaryChildren, renderExpirationTime);\n }\n } else {\n // This is an update. This branch is more complicated because we need to\n // ensure the state of the primary children is preserved.\n var prevState = current.memoizedState;\n\n if (prevState !== null) {\n // wrapped in a fragment fiber.\n\n\n var currentPrimaryChildFragment = current.child;\n var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;\n\n if (nextDidTimeout) {\n // Still timed out. Reuse the current primary children by cloning\n // its fragment. We're going to skip over these entirely.\n var _nextFallbackChildren2 = nextProps.fallback;\n\n var _primaryChildFragment2 = createWorkInProgress(currentPrimaryChildFragment, currentPrimaryChildFragment.pendingProps);\n\n _primaryChildFragment2.return = workInProgress;\n\n if ((workInProgress.mode & BlockingMode) === NoMode) {\n // Outside of blocking mode, we commit the effects from the\n // partially completed, timed-out tree, too.\n var _progressedState = workInProgress.memoizedState;\n\n var _progressedPrimaryChild = _progressedState !== null ? workInProgress.child.child : workInProgress.child;\n\n if (_progressedPrimaryChild !== currentPrimaryChildFragment.child) {\n _primaryChildFragment2.child = _progressedPrimaryChild;\n var _progressedChild2 = _progressedPrimaryChild;\n\n while (_progressedChild2 !== null) {\n _progressedChild2.return = _primaryChildFragment2;\n _progressedChild2 = _progressedChild2.sibling;\n }\n }\n } // Because primaryChildFragment is a new fiber that we're inserting as the\n // parent of a new tree, we need to set its treeBaseDuration.\n\n\n if ( workInProgress.mode & ProfileMode) {\n // treeBaseDuration is the sum of all the child tree base durations.\n var _treeBaseDuration = 0;\n var _hiddenChild = _primaryChildFragment2.child;\n\n while (_hiddenChild !== null) {\n _treeBaseDuration += _hiddenChild.treeBaseDuration;\n _hiddenChild = _hiddenChild.sibling;\n }\n\n _primaryChildFragment2.treeBaseDuration = _treeBaseDuration;\n } // Clone the fallback child fragment, too. These we'll continue\n // working on.\n\n\n var _fallbackChildFragment2 = createWorkInProgress(currentFallbackChildFragment, _nextFallbackChildren2);\n\n _fallbackChildFragment2.return = workInProgress;\n _primaryChildFragment2.sibling = _fallbackChildFragment2;\n _primaryChildFragment2.childExpirationTime = NoWork; // Skip the primary children, and continue working on the\n // fallback children.\n\n workInProgress.memoizedState = SUSPENDED_MARKER;\n workInProgress.child = _primaryChildFragment2;\n return _fallbackChildFragment2;\n } else {\n // No longer suspended. Switch back to showing the primary children,\n // and remove the intermediate fragment fiber.\n var _nextPrimaryChildren = nextProps.children;\n var currentPrimaryChild = currentPrimaryChildFragment.child;\n var primaryChild = reconcileChildFibers(workInProgress, currentPrimaryChild, _nextPrimaryChildren, renderExpirationTime); // If this render doesn't suspend, we need to delete the fallback\n // children. Wait until the complete phase, after we've confirmed the\n // fallback is no longer needed.\n // TODO: Would it be better to store the fallback fragment on\n // the stateNode?\n // Continue rendering the children, like we normally do.\n\n workInProgress.memoizedState = null;\n return workInProgress.child = primaryChild;\n }\n } else {\n // The current tree has not already timed out. That means the primary\n // children are not wrapped in a fragment fiber.\n var _currentPrimaryChild = current.child;\n\n if (nextDidTimeout) {\n // Timed out. Wrap the children in a fragment fiber to keep them\n // separate from the fallback children.\n var _nextFallbackChildren3 = nextProps.fallback;\n\n var _primaryChildFragment3 = createFiberFromFragment( // It shouldn't matter what the pending props are because we aren't\n // going to render this fragment.\n null, mode, NoWork, null);\n\n _primaryChildFragment3.return = workInProgress;\n _primaryChildFragment3.child = _currentPrimaryChild;\n\n if (_currentPrimaryChild !== null) {\n _currentPrimaryChild.return = _primaryChildFragment3;\n } // Even though we're creating a new fiber, there are no new children,\n // because we're reusing an already mounted tree. So we don't need to\n // schedule a placement.\n // primaryChildFragment.effectTag |= Placement;\n\n\n if ((workInProgress.mode & BlockingMode) === NoMode) {\n // Outside of blocking mode, we commit the effects from the\n // partially completed, timed-out tree, too.\n var _progressedState2 = workInProgress.memoizedState;\n\n var _progressedPrimaryChild2 = _progressedState2 !== null ? workInProgress.child.child : workInProgress.child;\n\n _primaryChildFragment3.child = _progressedPrimaryChild2;\n var _progressedChild3 = _progressedPrimaryChild2;\n\n while (_progressedChild3 !== null) {\n _progressedChild3.return = _primaryChildFragment3;\n _progressedChild3 = _progressedChild3.sibling;\n }\n } // Because primaryChildFragment is a new fiber that we're inserting as the\n // parent of a new tree, we need to set its treeBaseDuration.\n\n\n if ( workInProgress.mode & ProfileMode) {\n // treeBaseDuration is the sum of all the child tree base durations.\n var _treeBaseDuration2 = 0;\n var _hiddenChild2 = _primaryChildFragment3.child;\n\n while (_hiddenChild2 !== null) {\n _treeBaseDuration2 += _hiddenChild2.treeBaseDuration;\n _hiddenChild2 = _hiddenChild2.sibling;\n }\n\n _primaryChildFragment3.treeBaseDuration = _treeBaseDuration2;\n } // Create a fragment from the fallback children, too.\n\n\n var _fallbackChildFragment3 = createFiberFromFragment(_nextFallbackChildren3, mode, renderExpirationTime, null);\n\n _fallbackChildFragment3.return = workInProgress;\n _primaryChildFragment3.sibling = _fallbackChildFragment3;\n _fallbackChildFragment3.effectTag |= Placement;\n _primaryChildFragment3.childExpirationTime = NoWork; // Skip the primary children, and continue working on the\n // fallback children.\n\n workInProgress.memoizedState = SUSPENDED_MARKER;\n workInProgress.child = _primaryChildFragment3;\n return _fallbackChildFragment3;\n } else {\n // Still haven't timed out. Continue rendering the children, like we\n // normally do.\n workInProgress.memoizedState = null;\n var _nextPrimaryChildren2 = nextProps.children;\n return workInProgress.child = reconcileChildFibers(workInProgress, _currentPrimaryChild, _nextPrimaryChildren2, renderExpirationTime);\n }\n }\n }\n}\n\nfunction scheduleWorkOnFiber(fiber, renderExpirationTime) {\n if (fiber.expirationTime < renderExpirationTime) {\n fiber.expirationTime = renderExpirationTime;\n }\n\n var alternate = fiber.alternate;\n\n if (alternate !== null && alternate.expirationTime < renderExpirationTime) {\n alternate.expirationTime = renderExpirationTime;\n }\n\n scheduleWorkOnParentPath(fiber.return, renderExpirationTime);\n}\n\nfunction propagateSuspenseContextChange(workInProgress, firstChild, renderExpirationTime) {\n // Mark any Suspense boundaries with fallbacks as having work to do.\n // If they were previously forced into fallbacks, they may now be able\n // to unblock.\n var node = firstChild;\n\n while (node !== null) {\n if (node.tag === SuspenseComponent) {\n var state = node.memoizedState;\n\n if (state !== null) {\n scheduleWorkOnFiber(node, renderExpirationTime);\n }\n } else if (node.tag === SuspenseListComponent) {\n // If the tail is hidden there might not be an Suspense boundaries\n // to schedule work on. In this case we have to schedule it on the\n // list itself.\n // We don't have to traverse to the children of the list since\n // the list will propagate the change when it rerenders.\n scheduleWorkOnFiber(node, renderExpirationTime);\n } else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === workInProgress) {\n return;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === workInProgress) {\n return;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n}\n\nfunction findLastContentRow(firstChild) {\n // This is going to find the last row among these children that is already\n // showing content on the screen, as opposed to being in fallback state or\n // new. If a row has multiple Suspense boundaries, any of them being in the\n // fallback state, counts as the whole row being in a fallback state.\n // Note that the \"rows\" will be workInProgress, but any nested children\n // will still be current since we haven't rendered them yet. The mounted\n // order may not be the same as the new order. We use the new order.\n var row = firstChild;\n var lastContentRow = null;\n\n while (row !== null) {\n var currentRow = row.alternate; // New rows can't be content rows.\n\n if (currentRow !== null && findFirstSuspended(currentRow) === null) {\n lastContentRow = row;\n }\n\n row = row.sibling;\n }\n\n return lastContentRow;\n}\n\nfunction validateRevealOrder(revealOrder) {\n {\n if (revealOrder !== undefined && revealOrder !== 'forwards' && revealOrder !== 'backwards' && revealOrder !== 'together' && !didWarnAboutRevealOrder[revealOrder]) {\n didWarnAboutRevealOrder[revealOrder] = true;\n\n if (typeof revealOrder === 'string') {\n switch (revealOrder.toLowerCase()) {\n case 'together':\n case 'forwards':\n case 'backwards':\n {\n error('\"%s\" is not a valid value for revealOrder on <SuspenseList />. ' + 'Use lowercase \"%s\" instead.', revealOrder, revealOrder.toLowerCase());\n\n break;\n }\n\n case 'forward':\n case 'backward':\n {\n error('\"%s\" is not a valid value for revealOrder on <SuspenseList />. ' + 'React uses the -s suffix in the spelling. Use \"%ss\" instead.', revealOrder, revealOrder.toLowerCase());\n\n break;\n }\n\n default:\n error('\"%s\" is not a supported revealOrder on <SuspenseList />. ' + 'Did you mean \"together\", \"forwards\" or \"backwards\"?', revealOrder);\n\n break;\n }\n } else {\n error('%s is not a supported value for revealOrder on <SuspenseList />. ' + 'Did you mean \"together\", \"forwards\" or \"backwards\"?', revealOrder);\n }\n }\n }\n}\n\nfunction validateTailOptions(tailMode, revealOrder) {\n {\n if (tailMode !== undefined && !didWarnAboutTailOptions[tailMode]) {\n if (tailMode !== 'collapsed' && tailMode !== 'hidden') {\n didWarnAboutTailOptions[tailMode] = true;\n\n error('\"%s\" is not a supported value for tail on <SuspenseList />. ' + 'Did you mean \"collapsed\" or \"hidden\"?', tailMode);\n } else if (revealOrder !== 'forwards' && revealOrder !== 'backwards') {\n didWarnAboutTailOptions[tailMode] = true;\n\n error('<SuspenseList tail=\"%s\" /> is only valid if revealOrder is ' + '\"forwards\" or \"backwards\". ' + 'Did you mean to specify revealOrder=\"forwards\"?', tailMode);\n }\n }\n }\n}\n\nfunction validateSuspenseListNestedChild(childSlot, index) {\n {\n var isArray = Array.isArray(childSlot);\n var isIterable = !isArray && typeof getIteratorFn(childSlot) === 'function';\n\n if (isArray || isIterable) {\n var type = isArray ? 'array' : 'iterable';\n\n error('A nested %s was passed to row #%s in <SuspenseList />. Wrap it in ' + 'an additional SuspenseList to configure its revealOrder: ' + '<SuspenseList revealOrder=...> ... ' + '<SuspenseList revealOrder=...>{%s}</SuspenseList> ... ' + '</SuspenseList>', type, index, type);\n\n return false;\n }\n }\n\n return true;\n}\n\nfunction validateSuspenseListChildren(children, revealOrder) {\n {\n if ((revealOrder === 'forwards' || revealOrder === 'backwards') && children !== undefined && children !== null && children !== false) {\n if (Array.isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n if (!validateSuspenseListNestedChild(children[i], i)) {\n return;\n }\n }\n } else {\n var iteratorFn = getIteratorFn(children);\n\n if (typeof iteratorFn === 'function') {\n var childrenIterator = iteratorFn.call(children);\n\n if (childrenIterator) {\n var step = childrenIterator.next();\n var _i = 0;\n\n for (; !step.done; step = childrenIterator.next()) {\n if (!validateSuspenseListNestedChild(step.value, _i)) {\n return;\n }\n\n _i++;\n }\n }\n } else {\n error('A single row was passed to a <SuspenseList revealOrder=\"%s\" />. ' + 'This is not useful since it needs multiple rows. ' + 'Did you mean to pass multiple children or an array?', revealOrder);\n }\n }\n }\n }\n}\n\nfunction initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode, lastEffectBeforeRendering) {\n var renderState = workInProgress.memoizedState;\n\n if (renderState === null) {\n workInProgress.memoizedState = {\n isBackwards: isBackwards,\n rendering: null,\n renderingStartTime: 0,\n last: lastContentRow,\n tail: tail,\n tailExpiration: 0,\n tailMode: tailMode,\n lastEffect: lastEffectBeforeRendering\n };\n } else {\n // We can reuse the existing object from previous renders.\n renderState.isBackwards = isBackwards;\n renderState.rendering = null;\n renderState.renderingStartTime = 0;\n renderState.last = lastContentRow;\n renderState.tail = tail;\n renderState.tailExpiration = 0;\n renderState.tailMode = tailMode;\n renderState.lastEffect = lastEffectBeforeRendering;\n }\n} // This can end up rendering this component multiple passes.\n// The first pass splits the children fibers into two sets. A head and tail.\n// We first render the head. If anything is in fallback state, we do another\n// pass through beginWork to rerender all children (including the tail) with\n// the force suspend context. If the first render didn't have anything in\n// in fallback state. Then we render each row in the tail one-by-one.\n// That happens in the completeWork phase without going back to beginWork.\n\n\nfunction updateSuspenseListComponent(current, workInProgress, renderExpirationTime) {\n var nextProps = workInProgress.pendingProps;\n var revealOrder = nextProps.revealOrder;\n var tailMode = nextProps.tail;\n var newChildren = nextProps.children;\n validateRevealOrder(revealOrder);\n validateTailOptions(tailMode, revealOrder);\n validateSuspenseListChildren(newChildren, revealOrder);\n reconcileChildren(current, workInProgress, newChildren, renderExpirationTime);\n var suspenseContext = suspenseStackCursor.current;\n var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);\n\n if (shouldForceFallback) {\n suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);\n workInProgress.effectTag |= DidCapture;\n } else {\n var didSuspendBefore = current !== null && (current.effectTag & DidCapture) !== NoEffect;\n\n if (didSuspendBefore) {\n // If we previously forced a fallback, we need to schedule work\n // on any nested boundaries to let them know to try to render\n // again. This is the same as context updating.\n propagateSuspenseContextChange(workInProgress, workInProgress.child, renderExpirationTime);\n }\n\n suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);\n }\n\n pushSuspenseContext(workInProgress, suspenseContext);\n\n if ((workInProgress.mode & BlockingMode) === NoMode) {\n // Outside of blocking mode, SuspenseList doesn't work so we just\n // use make it a noop by treating it as the default revealOrder.\n workInProgress.memoizedState = null;\n } else {\n switch (revealOrder) {\n case 'forwards':\n {\n var lastContentRow = findLastContentRow(workInProgress.child);\n var tail;\n\n if (lastContentRow === null) {\n // The whole list is part of the tail.\n // TODO: We could fast path by just rendering the tail now.\n tail = workInProgress.child;\n workInProgress.child = null;\n } else {\n // Disconnect the tail rows after the content row.\n // We're going to render them separately later.\n tail = lastContentRow.sibling;\n lastContentRow.sibling = null;\n }\n\n initSuspenseListRenderState(workInProgress, false, // isBackwards\n tail, lastContentRow, tailMode, workInProgress.lastEffect);\n break;\n }\n\n case 'backwards':\n {\n // We're going to find the first row that has existing content.\n // At the same time we're going to reverse the list of everything\n // we pass in the meantime. That's going to be our tail in reverse\n // order.\n var _tail = null;\n var row = workInProgress.child;\n workInProgress.child = null;\n\n while (row !== null) {\n var currentRow = row.alternate; // New rows can't be content rows.\n\n if (currentRow !== null && findFirstSuspended(currentRow) === null) {\n // This is the beginning of the main content.\n workInProgress.child = row;\n break;\n }\n\n var nextRow = row.sibling;\n row.sibling = _tail;\n _tail = row;\n row = nextRow;\n } // TODO: If workInProgress.child is null, we can continue on the tail immediately.\n\n\n initSuspenseListRenderState(workInProgress, true, // isBackwards\n _tail, null, // last\n tailMode, workInProgress.lastEffect);\n break;\n }\n\n case 'together':\n {\n initSuspenseListRenderState(workInProgress, false, // isBackwards\n null, // tail\n null, // last\n undefined, workInProgress.lastEffect);\n break;\n }\n\n default:\n {\n // The default reveal order is the same as not having\n // a boundary.\n workInProgress.memoizedState = null;\n }\n }\n }\n\n return workInProgress.child;\n}\n\nfunction updatePortalComponent(current, workInProgress, renderExpirationTime) {\n pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);\n var nextChildren = workInProgress.pendingProps;\n\n if (current === null) {\n // Portals are special because we don't append the children during mount\n // but at commit. Therefore we need to track insertions which the normal\n // flow doesn't do during mount. This doesn't happen at the root because\n // the root always starts with a \"current\" with a null child.\n // TODO: Consider unifying this with how the root works.\n workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);\n } else {\n reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n }\n\n return workInProgress.child;\n}\n\nfunction updateContextProvider(current, workInProgress, renderExpirationTime) {\n var providerType = workInProgress.type;\n var context = providerType._context;\n var newProps = workInProgress.pendingProps;\n var oldProps = workInProgress.memoizedProps;\n var newValue = newProps.value;\n\n {\n var providerPropTypes = workInProgress.type.propTypes;\n\n if (providerPropTypes) {\n checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider', getCurrentFiberStackInDev);\n }\n }\n\n pushProvider(workInProgress, newValue);\n\n if (oldProps !== null) {\n var oldValue = oldProps.value;\n var changedBits = calculateChangedBits(context, newValue, oldValue);\n\n if (changedBits === 0) {\n // No change. Bailout early if children are the same.\n if (oldProps.children === newProps.children && !hasContextChanged()) {\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n }\n } else {\n // The context value changed. Search for matching consumers and schedule\n // them to update.\n propagateContextChange(workInProgress, context, changedBits, renderExpirationTime);\n }\n }\n\n var newChildren = newProps.children;\n reconcileChildren(current, workInProgress, newChildren, renderExpirationTime);\n return workInProgress.child;\n}\n\nvar hasWarnedAboutUsingContextAsConsumer = false;\n\nfunction updateContextConsumer(current, workInProgress, renderExpirationTime) {\n var context = workInProgress.type; // 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 {\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\n error('Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');\n }\n }\n } else {\n context = context._context;\n }\n }\n\n var newProps = workInProgress.pendingProps;\n var render = newProps.children;\n\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\n prepareToReadContext(workInProgress, renderExpirationTime);\n var newValue = readContext(context, newProps.unstable_observedBits);\n var newChildren;\n\n {\n ReactCurrentOwner$1.current = workInProgress;\n setIsRendering(true);\n newChildren = render(newValue);\n setIsRendering(false);\n } // React DevTools reads this flag.\n\n\n workInProgress.effectTag |= PerformedWork;\n reconcileChildren(current, workInProgress, newChildren, renderExpirationTime);\n return workInProgress.child;\n}\n\nfunction markWorkInProgressReceivedUpdate() {\n didReceiveUpdate = true;\n}\n\nfunction bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime) {\n cancelWorkTimer(workInProgress);\n\n if (current !== null) {\n // Reuse previous dependencies\n workInProgress.dependencies = current.dependencies;\n }\n\n {\n // Don't update \"base\" render times for bailouts.\n stopProfilerTimerIfRunning();\n }\n\n var updateExpirationTime = workInProgress.expirationTime;\n\n if (updateExpirationTime !== NoWork) {\n markUnprocessedUpdateTime(updateExpirationTime);\n } // Check if the children have any pending work.\n\n\n var childExpirationTime = workInProgress.childExpirationTime;\n\n if (childExpirationTime < renderExpirationTime) {\n // The children don't have any work either. We can skip them.\n // TODO: Once we add back resuming, we should check if the children are\n // a work-in-progress set. If so, we need to transfer their effects.\n return null;\n } else {\n // This fiber doesn't have work, but its subtree does. Clone the child\n // fibers and continue.\n cloneChildFibers(current, workInProgress);\n return workInProgress.child;\n }\n}\n\nfunction remountFiber(current, oldWorkInProgress, newWorkInProgress) {\n {\n var returnFiber = oldWorkInProgress.return;\n\n if (returnFiber === null) {\n throw new Error('Cannot swap the root fiber.');\n } // Disconnect from the old current.\n // It will get deleted.\n\n\n current.alternate = null;\n oldWorkInProgress.alternate = null; // Connect to the new tree.\n\n newWorkInProgress.index = oldWorkInProgress.index;\n newWorkInProgress.sibling = oldWorkInProgress.sibling;\n newWorkInProgress.return = oldWorkInProgress.return;\n newWorkInProgress.ref = oldWorkInProgress.ref; // Replace the child/sibling pointers above it.\n\n if (oldWorkInProgress === returnFiber.child) {\n returnFiber.child = newWorkInProgress;\n } else {\n var prevSibling = returnFiber.child;\n\n if (prevSibling === null) {\n throw new Error('Expected parent to have a child.');\n }\n\n while (prevSibling.sibling !== oldWorkInProgress) {\n prevSibling = prevSibling.sibling;\n\n if (prevSibling === null) {\n throw new Error('Expected to find the previous sibling.');\n }\n }\n\n prevSibling.sibling = newWorkInProgress;\n } // Delete the old fiber and place the new one.\n // Since the old fiber is disconnected, we have to schedule it manually.\n\n\n var last = returnFiber.lastEffect;\n\n if (last !== null) {\n last.nextEffect = current;\n returnFiber.lastEffect = current;\n } else {\n returnFiber.firstEffect = returnFiber.lastEffect = current;\n }\n\n current.nextEffect = null;\n current.effectTag = Deletion;\n newWorkInProgress.effectTag |= Placement; // Restart work from the new fiber.\n\n return newWorkInProgress;\n }\n}\n\nfunction beginWork(current, workInProgress, renderExpirationTime) {\n var updateExpirationTime = workInProgress.expirationTime;\n\n {\n if (workInProgress._debugNeedsRemount && current !== null) {\n // This will restart the begin phase with a new fiber.\n return remountFiber(current, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.expirationTime));\n }\n }\n\n if (current !== null) {\n var oldProps = current.memoizedProps;\n var newProps = workInProgress.pendingProps;\n\n if (oldProps !== newProps || hasContextChanged() || ( // Force a re-render if the implementation changed due to hot reload:\n workInProgress.type !== current.type )) {\n // If props or context changed, mark the fiber as having performed work.\n // This may be unset if the props are determined to be equal later (memo).\n didReceiveUpdate = true;\n } else if (updateExpirationTime < renderExpirationTime) {\n didReceiveUpdate = false; // This fiber does not have any pending work. Bailout without entering\n // the begin phase. There's still some bookkeeping we that needs to be done\n // in this optimized path, mostly pushing stuff onto the stack.\n\n switch (workInProgress.tag) {\n case HostRoot:\n pushHostRootContext(workInProgress);\n resetHydrationState();\n break;\n\n case HostComponent:\n pushHostContext(workInProgress);\n\n if (workInProgress.mode & ConcurrentMode && renderExpirationTime !== Never && shouldDeprioritizeSubtree(workInProgress.type, newProps)) {\n {\n markSpawnedWork(Never);\n } // Schedule this fiber to re-render at offscreen priority. Then bailout.\n\n\n workInProgress.expirationTime = workInProgress.childExpirationTime = Never;\n return null;\n }\n\n break;\n\n case ClassComponent:\n {\n var Component = workInProgress.type;\n\n if (isContextProvider(Component)) {\n pushContextProvider(workInProgress);\n }\n\n break;\n }\n\n case HostPortal:\n pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);\n break;\n\n case ContextProvider:\n {\n var newValue = workInProgress.memoizedProps.value;\n pushProvider(workInProgress, newValue);\n break;\n }\n\n case Profiler:\n {\n // Profiler should only call onRender when one of its descendants actually rendered.\n var hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime;\n\n if (hasChildWork) {\n workInProgress.effectTag |= Update;\n }\n }\n\n break;\n\n case SuspenseComponent:\n {\n var state = workInProgress.memoizedState;\n\n if (state !== null) {\n // whether to retry the primary children, or to skip over it and\n // go straight to the fallback. Check the priority of the primary\n // child fragment.\n\n\n var primaryChildFragment = workInProgress.child;\n var primaryChildExpirationTime = primaryChildFragment.childExpirationTime;\n\n if (primaryChildExpirationTime !== NoWork && primaryChildExpirationTime >= renderExpirationTime) {\n // The primary children have pending work. Use the normal path\n // to attempt to render the primary children again.\n return updateSuspenseComponent(current, workInProgress, renderExpirationTime);\n } else {\n pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // The primary children do not have pending work with sufficient\n // priority. Bailout.\n\n var child = bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n\n if (child !== null) {\n // The fallback children have pending work. Skip over the\n // primary children and work on the fallback.\n return child.sibling;\n } else {\n return null;\n }\n }\n } else {\n pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current));\n }\n\n break;\n }\n\n case SuspenseListComponent:\n {\n var didSuspendBefore = (current.effectTag & DidCapture) !== NoEffect;\n\n var _hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime;\n\n if (didSuspendBefore) {\n if (_hasChildWork) {\n // If something was in fallback state last time, and we have all the\n // same children then we're still in progressive loading state.\n // Something might get unblocked by state updates or retries in the\n // tree which will affect the tail. So we need to use the normal\n // path to compute the correct tail.\n return updateSuspenseListComponent(current, workInProgress, renderExpirationTime);\n } // If none of the children had any work, that means that none of\n // them got retried so they'll still be blocked in the same way\n // as before. We can fast bail out.\n\n\n workInProgress.effectTag |= DidCapture;\n } // If nothing suspended before and we're rendering the same children,\n // then the tail doesn't matter. Anything new that suspends will work\n // in the \"together\" mode, so we can continue from the state we had.\n\n\n var renderState = workInProgress.memoizedState;\n\n if (renderState !== null) {\n // Reset to the \"together\" mode in case we've started a different\n // update in the past but didn't complete it.\n renderState.rendering = null;\n renderState.tail = null;\n }\n\n pushSuspenseContext(workInProgress, suspenseStackCursor.current);\n\n if (_hasChildWork) {\n break;\n } else {\n // If none of the children had any work, that means that none of\n // them got retried so they'll still be blocked in the same way\n // as before. We can fast bail out.\n return null;\n }\n }\n }\n\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n } else {\n // An update was scheduled on this fiber, but there are no new props\n // nor legacy context. Set this to false. If an update queue or context\n // consumer produces a changed value, it will set this to true. Otherwise,\n // the component will assume the children have not changed and bail out.\n didReceiveUpdate = false;\n }\n } else {\n didReceiveUpdate = false;\n } // Before entering the begin phase, clear pending update priority.\n // TODO: This assumes that we're about to evaluate the component and process\n // the update queue. However, there's an exception: SimpleMemoComponent\n // sometimes bails out later in the begin phase. This indicates that we should\n // move this assignment out of the common path and into each branch.\n\n\n workInProgress.expirationTime = NoWork;\n\n switch (workInProgress.tag) {\n case IndeterminateComponent:\n {\n return mountIndeterminateComponent(current, workInProgress, workInProgress.type, renderExpirationTime);\n }\n\n case LazyComponent:\n {\n var elementType = workInProgress.elementType;\n return mountLazyComponent(current, workInProgress, elementType, updateExpirationTime, renderExpirationTime);\n }\n\n case FunctionComponent:\n {\n var _Component = workInProgress.type;\n var unresolvedProps = workInProgress.pendingProps;\n var resolvedProps = workInProgress.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps);\n return updateFunctionComponent(current, workInProgress, _Component, resolvedProps, renderExpirationTime);\n }\n\n case ClassComponent:\n {\n var _Component2 = workInProgress.type;\n var _unresolvedProps = workInProgress.pendingProps;\n\n var _resolvedProps = workInProgress.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps);\n\n return updateClassComponent(current, workInProgress, _Component2, _resolvedProps, renderExpirationTime);\n }\n\n case HostRoot:\n return updateHostRoot(current, workInProgress, renderExpirationTime);\n\n case HostComponent:\n return updateHostComponent(current, workInProgress, renderExpirationTime);\n\n case HostText:\n return updateHostText(current, workInProgress);\n\n case SuspenseComponent:\n return updateSuspenseComponent(current, workInProgress, renderExpirationTime);\n\n case HostPortal:\n return updatePortalComponent(current, workInProgress, renderExpirationTime);\n\n case ForwardRef:\n {\n var type = workInProgress.type;\n var _unresolvedProps2 = workInProgress.pendingProps;\n\n var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);\n\n return updateForwardRef(current, workInProgress, type, _resolvedProps2, renderExpirationTime);\n }\n\n case Fragment:\n return updateFragment(current, workInProgress, renderExpirationTime);\n\n case Mode:\n return updateMode(current, workInProgress, renderExpirationTime);\n\n case Profiler:\n return updateProfiler(current, workInProgress, renderExpirationTime);\n\n case ContextProvider:\n return updateContextProvider(current, workInProgress, renderExpirationTime);\n\n case ContextConsumer:\n return updateContextConsumer(current, workInProgress, renderExpirationTime);\n\n case MemoComponent:\n {\n var _type2 = workInProgress.type;\n var _unresolvedProps3 = workInProgress.pendingProps; // Resolve outer props first, then resolve inner props.\n\n var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);\n\n {\n if (workInProgress.type !== workInProgress.elementType) {\n var outerPropTypes = _type2.propTypes;\n\n if (outerPropTypes) {\n checkPropTypes(outerPropTypes, _resolvedProps3, // Resolved for outer only\n 'prop', getComponentName(_type2), getCurrentFiberStackInDev);\n }\n }\n }\n\n _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);\n return updateMemoComponent(current, workInProgress, _type2, _resolvedProps3, updateExpirationTime, renderExpirationTime);\n }\n\n case SimpleMemoComponent:\n {\n return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, updateExpirationTime, renderExpirationTime);\n }\n\n case IncompleteClassComponent:\n {\n var _Component3 = workInProgress.type;\n var _unresolvedProps4 = workInProgress.pendingProps;\n\n var _resolvedProps4 = workInProgress.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4);\n\n return mountIncompleteClassComponent(current, workInProgress, _Component3, _resolvedProps4, renderExpirationTime);\n }\n\n case SuspenseListComponent:\n {\n return updateSuspenseListComponent(current, workInProgress, renderExpirationTime);\n }\n }\n\n {\n {\n throw Error( \"Unknown unit of work tag (\" + workInProgress.tag + \"). This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n}\n\nfunction markUpdate(workInProgress) {\n // Tag the fiber with an update effect. This turns a Placement into\n // a PlacementAndUpdate.\n workInProgress.effectTag |= Update;\n}\n\nfunction markRef$1(workInProgress) {\n workInProgress.effectTag |= Ref;\n}\n\nvar appendAllChildren;\nvar updateHostContainer;\nvar updateHostComponent$1;\nvar updateHostText$1;\n\n{\n // Mutation mode\n appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {\n // We only have the top Fiber that was created but we need recurse down its\n // children to find all the terminal nodes.\n var node = workInProgress.child;\n\n while (node !== null) {\n if (node.tag === HostComponent || node.tag === HostText) {\n appendInitialChild(parent, node.stateNode);\n } else if (node.tag === HostPortal) ; else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === workInProgress) {\n return;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === workInProgress) {\n return;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n };\n\n updateHostContainer = function (workInProgress) {// Noop\n };\n\n updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {\n // If we have an alternate, that means this is an update and we need to\n // schedule a side-effect to do the updates.\n var oldProps = current.memoizedProps;\n\n if (oldProps === newProps) {\n // In mutation mode, this is sufficient for a bailout because\n // we won't touch this node even if children changed.\n return;\n } // If we get updated because one of our children updated, we don't\n // have newProps so we'll have to reuse them.\n // TODO: Split the update API as separate for the props vs. children.\n // Even better would be if children weren't special cased at all tho.\n\n\n var instance = workInProgress.stateNode;\n var currentHostContext = getHostContext(); // TODO: Experiencing an error where oldProps is null. Suggests a host\n // component is hitting the resume path. Figure out why. Possibly\n // related to `hidden`.\n\n var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); // TODO: Type this specific to this type of component.\n\n workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there\n // is a new ref we mark this as an update. All the work is done in commitWork.\n\n if (updatePayload) {\n markUpdate(workInProgress);\n }\n };\n\n updateHostText$1 = function (current, workInProgress, oldText, newText) {\n // If the text differs, mark it as an update. All the work in done in commitWork.\n if (oldText !== newText) {\n markUpdate(workInProgress);\n }\n };\n}\n\nfunction cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {\n switch (renderState.tailMode) {\n case 'hidden':\n {\n // Any insertions at the end of the tail list after this point\n // should be invisible. If there are already mounted boundaries\n // anything before them are not considered for collapsing.\n // Therefore we need to go through the whole tail to find if\n // there are any.\n var tailNode = renderState.tail;\n var lastTailNode = null;\n\n while (tailNode !== null) {\n if (tailNode.alternate !== null) {\n lastTailNode = tailNode;\n }\n\n tailNode = tailNode.sibling;\n } // Next we're simply going to delete all insertions after the\n // last rendered item.\n\n\n if (lastTailNode === null) {\n // All remaining items in the tail are insertions.\n renderState.tail = null;\n } else {\n // Detach the insertion after the last node that was already\n // inserted.\n lastTailNode.sibling = null;\n }\n\n break;\n }\n\n case 'collapsed':\n {\n // Any insertions at the end of the tail list after this point\n // should be invisible. If there are already mounted boundaries\n // anything before them are not considered for collapsing.\n // Therefore we need to go through the whole tail to find if\n // there are any.\n var _tailNode = renderState.tail;\n var _lastTailNode = null;\n\n while (_tailNode !== null) {\n if (_tailNode.alternate !== null) {\n _lastTailNode = _tailNode;\n }\n\n _tailNode = _tailNode.sibling;\n } // Next we're simply going to delete all insertions after the\n // last rendered item.\n\n\n if (_lastTailNode === null) {\n // All remaining items in the tail are insertions.\n if (!hasRenderedATailFallback && renderState.tail !== null) {\n // We suspended during the head. We want to show at least one\n // row at the tail. So we'll keep on and cut off the rest.\n renderState.tail.sibling = null;\n } else {\n renderState.tail = null;\n }\n } else {\n // Detach the insertion after the last node that was already\n // inserted.\n _lastTailNode.sibling = null;\n }\n\n break;\n }\n }\n}\n\nfunction completeWork(current, workInProgress, renderExpirationTime) {\n var newProps = workInProgress.pendingProps;\n\n switch (workInProgress.tag) {\n case IndeterminateComponent:\n case LazyComponent:\n case SimpleMemoComponent:\n case FunctionComponent:\n case ForwardRef:\n case Fragment:\n case Mode:\n case Profiler:\n case ContextConsumer:\n case MemoComponent:\n return null;\n\n case ClassComponent:\n {\n var Component = workInProgress.type;\n\n if (isContextProvider(Component)) {\n popContext(workInProgress);\n }\n\n return null;\n }\n\n case HostRoot:\n {\n popHostContainer(workInProgress);\n popTopLevelContextObject(workInProgress);\n var fiberRoot = workInProgress.stateNode;\n\n if (fiberRoot.pendingContext) {\n fiberRoot.context = fiberRoot.pendingContext;\n fiberRoot.pendingContext = null;\n }\n\n if (current === null || current.child === null) {\n // If we hydrated, pop so that we can delete any remaining children\n // that weren't hydrated.\n var wasHydrated = popHydrationState(workInProgress);\n\n if (wasHydrated) {\n // If we hydrated, then we'll need to schedule an update for\n // the commit side-effects on the root.\n markUpdate(workInProgress);\n }\n }\n\n updateHostContainer(workInProgress);\n return null;\n }\n\n case HostComponent:\n {\n popHostContext(workInProgress);\n var rootContainerInstance = getRootHostContainer();\n var type = workInProgress.type;\n\n if (current !== null && workInProgress.stateNode != null) {\n updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance);\n\n if (current.ref !== workInProgress.ref) {\n markRef$1(workInProgress);\n }\n } else {\n if (!newProps) {\n if (!(workInProgress.stateNode !== null)) {\n {\n throw Error( \"We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n } // This can happen when we abort work.\n\n\n return null;\n }\n\n var currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context\n // \"stack\" as the parent. Then append children as we go in beginWork\n // or completeWork depending on whether we want to add them top->down or\n // bottom->up. Top->down is faster in IE11.\n\n var _wasHydrated = popHydrationState(workInProgress);\n\n if (_wasHydrated) {\n // TODO: Move this and createInstance step into the beginPhase\n // to consolidate.\n if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, currentHostContext)) {\n // If changes to the hydrated node need to be applied at the\n // commit-phase we mark this as such.\n markUpdate(workInProgress);\n }\n } else {\n var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress);\n appendAllChildren(instance, workInProgress, false, false); // This needs to be set before we mount Flare event listeners\n\n workInProgress.stateNode = instance;\n // (eg DOM renderer supports auto-focus for certain elements).\n // Make sure such renderers get scheduled for later work.\n\n\n if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) {\n markUpdate(workInProgress);\n }\n }\n\n if (workInProgress.ref !== null) {\n // If there is a ref on a host node we need to schedule a callback\n markRef$1(workInProgress);\n }\n }\n\n return null;\n }\n\n case HostText:\n {\n var newText = newProps;\n\n if (current && workInProgress.stateNode != null) {\n var oldText = current.memoizedProps; // If we have an alternate, that means this is an update and we need\n // to schedule a side-effect to do the updates.\n\n updateHostText$1(current, workInProgress, oldText, newText);\n } else {\n if (typeof newText !== 'string') {\n if (!(workInProgress.stateNode !== null)) {\n {\n throw Error( \"We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n } // This can happen when we abort work.\n\n }\n\n var _rootContainerInstance = getRootHostContainer();\n\n var _currentHostContext = getHostContext();\n\n var _wasHydrated2 = popHydrationState(workInProgress);\n\n if (_wasHydrated2) {\n if (prepareToHydrateHostTextInstance(workInProgress)) {\n markUpdate(workInProgress);\n }\n } else {\n workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress);\n }\n }\n\n return null;\n }\n\n case SuspenseComponent:\n {\n popSuspenseContext(workInProgress);\n var nextState = workInProgress.memoizedState;\n\n if ((workInProgress.effectTag & DidCapture) !== NoEffect) {\n // Something suspended. Re-render with the fallback children.\n workInProgress.expirationTime = renderExpirationTime; // Do not reset the effect list.\n\n return workInProgress;\n }\n\n var nextDidTimeout = nextState !== null;\n var prevDidTimeout = false;\n\n if (current === null) {\n if (workInProgress.memoizedProps.fallback !== undefined) {\n popHydrationState(workInProgress);\n }\n } else {\n var prevState = current.memoizedState;\n prevDidTimeout = prevState !== null;\n\n if (!nextDidTimeout && prevState !== null) {\n // We just switched from the fallback to the normal children.\n // Delete the fallback.\n // TODO: Would it be better to store the fallback fragment on\n // the stateNode during the begin phase?\n var currentFallbackChild = current.child.sibling;\n\n if (currentFallbackChild !== null) {\n // Deletions go at the beginning of the return fiber's effect list\n var first = workInProgress.firstEffect;\n\n if (first !== null) {\n workInProgress.firstEffect = currentFallbackChild;\n currentFallbackChild.nextEffect = first;\n } else {\n workInProgress.firstEffect = workInProgress.lastEffect = currentFallbackChild;\n currentFallbackChild.nextEffect = null;\n }\n\n currentFallbackChild.effectTag = Deletion;\n }\n }\n }\n\n if (nextDidTimeout && !prevDidTimeout) {\n // If this subtreee is running in blocking mode we can suspend,\n // otherwise we won't suspend.\n // TODO: This will still suspend a synchronous tree if anything\n // in the concurrent tree already suspended during this render.\n // This is a known bug.\n if ((workInProgress.mode & BlockingMode) !== NoMode) {\n // TODO: Move this back to throwException because this is too late\n // if this is a large tree which is common for initial loads. We\n // don't know if we should restart a render or not until we get\n // this marker, and this is too late.\n // If this render already had a ping or lower pri updates,\n // and this is the first time we know we're going to suspend we\n // should be able to immediately restart from within throwException.\n var hasInvisibleChildContext = current === null && workInProgress.memoizedProps.unstable_avoidThisFallback !== true;\n\n if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {\n // If this was in an invisible tree or a new render, then showing\n // this boundary is ok.\n renderDidSuspend();\n } else {\n // Otherwise, we're going to have to hide content so we should\n // suspend for longer if possible.\n renderDidSuspendDelayIfPossible();\n }\n }\n }\n\n {\n // TODO: Only schedule updates if these values are non equal, i.e. it changed.\n if (nextDidTimeout || prevDidTimeout) {\n // If this boundary just timed out, schedule an effect to attach a\n // retry listener to the promise. This flag is also used to hide the\n // primary children. In mutation mode, we also need the flag to\n // *unhide* children that were previously hidden, so check if this\n // is currently timed out, too.\n workInProgress.effectTag |= Update;\n }\n }\n\n return null;\n }\n\n case HostPortal:\n popHostContainer(workInProgress);\n updateHostContainer(workInProgress);\n return null;\n\n case ContextProvider:\n // Pop provider fiber\n popProvider(workInProgress);\n return null;\n\n case IncompleteClassComponent:\n {\n // Same as class component case. I put it down here so that the tags are\n // sequential to ensure this switch is compiled to a jump table.\n var _Component = workInProgress.type;\n\n if (isContextProvider(_Component)) {\n popContext(workInProgress);\n }\n\n return null;\n }\n\n case SuspenseListComponent:\n {\n popSuspenseContext(workInProgress);\n var renderState = workInProgress.memoizedState;\n\n if (renderState === null) {\n // We're running in the default, \"independent\" mode.\n // We don't do anything in this mode.\n return null;\n }\n\n var didSuspendAlready = (workInProgress.effectTag & DidCapture) !== NoEffect;\n var renderedTail = renderState.rendering;\n\n if (renderedTail === null) {\n // We just rendered the head.\n if (!didSuspendAlready) {\n // This is the first pass. We need to figure out if anything is still\n // suspended in the rendered set.\n // If new content unsuspended, but there's still some content that\n // didn't. Then we need to do a second pass that forces everything\n // to keep showing their fallbacks.\n // We might be suspended if something in this render pass suspended, or\n // something in the previous committed pass suspended. Otherwise,\n // there's no chance so we can skip the expensive call to\n // findFirstSuspended.\n var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.effectTag & DidCapture) === NoEffect);\n\n if (!cannotBeSuspended) {\n var row = workInProgress.child;\n\n while (row !== null) {\n var suspended = findFirstSuspended(row);\n\n if (suspended !== null) {\n didSuspendAlready = true;\n workInProgress.effectTag |= DidCapture;\n cutOffTailIfNeeded(renderState, false); // If this is a newly suspended tree, it might not get committed as\n // part of the second pass. In that case nothing will subscribe to\n // its thennables. Instead, we'll transfer its thennables to the\n // SuspenseList so that it can retry if they resolve.\n // There might be multiple of these in the list but since we're\n // going to wait for all of them anyway, it doesn't really matter\n // which ones gets to ping. In theory we could get clever and keep\n // track of how many dependencies remain but it gets tricky because\n // in the meantime, we can add/remove/change items and dependencies.\n // We might bail out of the loop before finding any but that\n // doesn't matter since that means that the other boundaries that\n // we did find already has their listeners attached.\n\n var newThennables = suspended.updateQueue;\n\n if (newThennables !== null) {\n workInProgress.updateQueue = newThennables;\n workInProgress.effectTag |= Update;\n } // Rerender the whole list, but this time, we'll force fallbacks\n // to stay in place.\n // Reset the effect list before doing the second pass since that's now invalid.\n\n\n if (renderState.lastEffect === null) {\n workInProgress.firstEffect = null;\n }\n\n workInProgress.lastEffect = renderState.lastEffect; // Reset the child fibers to their original state.\n\n resetChildFibers(workInProgress, renderExpirationTime); // Set up the Suspense Context to force suspense and immediately\n // rerender the children.\n\n pushSuspenseContext(workInProgress, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));\n return workInProgress.child;\n }\n\n row = row.sibling;\n }\n }\n } else {\n cutOffTailIfNeeded(renderState, false);\n } // Next we're going to render the tail.\n\n } else {\n // Append the rendered row to the child list.\n if (!didSuspendAlready) {\n var _suspended = findFirstSuspended(renderedTail);\n\n if (_suspended !== null) {\n workInProgress.effectTag |= DidCapture;\n didSuspendAlready = true; // Ensure we transfer the update queue to the parent so that it doesn't\n // get lost if this row ends up dropped during a second pass.\n\n var _newThennables = _suspended.updateQueue;\n\n if (_newThennables !== null) {\n workInProgress.updateQueue = _newThennables;\n workInProgress.effectTag |= Update;\n }\n\n cutOffTailIfNeeded(renderState, true); // This might have been modified.\n\n if (renderState.tail === null && renderState.tailMode === 'hidden' && !renderedTail.alternate) {\n // We need to delete the row we just rendered.\n // Reset the effect list to what it was before we rendered this\n // child. The nested children have already appended themselves.\n var lastEffect = workInProgress.lastEffect = renderState.lastEffect; // Remove any effects that were appended after this point.\n\n if (lastEffect !== null) {\n lastEffect.nextEffect = null;\n } // We're done.\n\n\n return null;\n }\n } else if ( // The time it took to render last row is greater than time until\n // the expiration.\n now() * 2 - renderState.renderingStartTime > renderState.tailExpiration && renderExpirationTime > Never) {\n // We have now passed our CPU deadline and we'll just give up further\n // attempts to render the main content and only render fallbacks.\n // The assumption is that this is usually faster.\n workInProgress.effectTag |= DidCapture;\n didSuspendAlready = true;\n cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this\n // to get it started back up to attempt the next item. If we can show\n // them, then they really have the same priority as this render.\n // So we'll pick it back up the very next render pass once we've had\n // an opportunity to yield for paint.\n\n var nextPriority = renderExpirationTime - 1;\n workInProgress.expirationTime = workInProgress.childExpirationTime = nextPriority;\n\n {\n markSpawnedWork(nextPriority);\n }\n }\n }\n\n if (renderState.isBackwards) {\n // The effect list of the backwards tail will have been added\n // to the end. This breaks the guarantee that life-cycles fire in\n // sibling order but that isn't a strong guarantee promised by React.\n // Especially since these might also just pop in during future commits.\n // Append to the beginning of the list.\n renderedTail.sibling = workInProgress.child;\n workInProgress.child = renderedTail;\n } else {\n var previousSibling = renderState.last;\n\n if (previousSibling !== null) {\n previousSibling.sibling = renderedTail;\n } else {\n workInProgress.child = renderedTail;\n }\n\n renderState.last = renderedTail;\n }\n }\n\n if (renderState.tail !== null) {\n // We still have tail rows to render.\n if (renderState.tailExpiration === 0) {\n // Heuristic for how long we're willing to spend rendering rows\n // until we just give up and show what we have so far.\n var TAIL_EXPIRATION_TIMEOUT_MS = 500;\n renderState.tailExpiration = now() + TAIL_EXPIRATION_TIMEOUT_MS; // TODO: This is meant to mimic the train model or JND but this\n // is a per component value. It should really be since the start\n // of the total render or last commit. Consider using something like\n // globalMostRecentFallbackTime. That doesn't account for being\n // suspended for part of the time or when it's a new render.\n // It should probably use a global start time value instead.\n } // Pop a row.\n\n\n var next = renderState.tail;\n renderState.rendering = next;\n renderState.tail = next.sibling;\n renderState.lastEffect = workInProgress.lastEffect;\n renderState.renderingStartTime = now();\n next.sibling = null; // Restore the context.\n // TODO: We can probably just avoid popping it instead and only\n // setting it the first time we go from not suspended to suspended.\n\n var suspenseContext = suspenseStackCursor.current;\n\n if (didSuspendAlready) {\n suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);\n } else {\n suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);\n }\n\n pushSuspenseContext(workInProgress, suspenseContext); // Do a pass over the next row.\n\n return next;\n }\n\n return null;\n }\n }\n\n {\n {\n throw Error( \"Unknown unit of work tag (\" + workInProgress.tag + \"). This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n}\n\nfunction unwindWork(workInProgress, renderExpirationTime) {\n switch (workInProgress.tag) {\n case ClassComponent:\n {\n var Component = workInProgress.type;\n\n if (isContextProvider(Component)) {\n popContext(workInProgress);\n }\n\n var effectTag = workInProgress.effectTag;\n\n if (effectTag & ShouldCapture) {\n workInProgress.effectTag = effectTag & ~ShouldCapture | DidCapture;\n return workInProgress;\n }\n\n return null;\n }\n\n case HostRoot:\n {\n popHostContainer(workInProgress);\n popTopLevelContextObject(workInProgress);\n var _effectTag = workInProgress.effectTag;\n\n if (!((_effectTag & DidCapture) === NoEffect)) {\n {\n throw Error( \"The root failed to unmount after an error. This is likely a bug in React. Please file an issue.\" );\n }\n }\n\n workInProgress.effectTag = _effectTag & ~ShouldCapture | DidCapture;\n return workInProgress;\n }\n\n case HostComponent:\n {\n // TODO: popHydrationState\n popHostContext(workInProgress);\n return null;\n }\n\n case SuspenseComponent:\n {\n popSuspenseContext(workInProgress);\n\n var _effectTag2 = workInProgress.effectTag;\n\n if (_effectTag2 & ShouldCapture) {\n workInProgress.effectTag = _effectTag2 & ~ShouldCapture | DidCapture; // Captured a suspense effect. Re-render the boundary.\n\n return workInProgress;\n }\n\n return null;\n }\n\n case SuspenseListComponent:\n {\n popSuspenseContext(workInProgress); // SuspenseList doesn't actually catch anything. It should've been\n // caught by a nested boundary. If not, it should bubble through.\n\n return null;\n }\n\n case HostPortal:\n popHostContainer(workInProgress);\n return null;\n\n case ContextProvider:\n popProvider(workInProgress);\n return null;\n\n default:\n return null;\n }\n}\n\nfunction unwindInterruptedWork(interruptedWork) {\n switch (interruptedWork.tag) {\n case ClassComponent:\n {\n var childContextTypes = interruptedWork.type.childContextTypes;\n\n if (childContextTypes !== null && childContextTypes !== undefined) {\n popContext(interruptedWork);\n }\n\n break;\n }\n\n case HostRoot:\n {\n popHostContainer(interruptedWork);\n popTopLevelContextObject(interruptedWork);\n break;\n }\n\n case HostComponent:\n {\n popHostContext(interruptedWork);\n break;\n }\n\n case HostPortal:\n popHostContainer(interruptedWork);\n break;\n\n case SuspenseComponent:\n popSuspenseContext(interruptedWork);\n break;\n\n case SuspenseListComponent:\n popSuspenseContext(interruptedWork);\n break;\n\n case ContextProvider:\n popProvider(interruptedWork);\n break;\n }\n}\n\nfunction createCapturedValue(value, source) {\n // If the value is an error, call this function immediately after it is thrown\n // so the stack is accurate.\n return {\n value: value,\n source: source,\n stack: getStackByFiberInDevAndProd(source)\n };\n}\n\nfunction logCapturedError(capturedError) {\n\n var error = capturedError.error;\n\n {\n var componentName = capturedError.componentName,\n componentStack = capturedError.componentStack,\n errorBoundaryName = capturedError.errorBoundaryName,\n errorBoundaryFound = capturedError.errorBoundaryFound,\n willRetry = capturedError.willRetry; // Browsers support silencing uncaught errors by calling\n // `preventDefault()` in window `error` handler.\n // We record this information as an expando on the error.\n\n if (error != null && error._suppressLogging) {\n if (errorBoundaryFound && willRetry) {\n // The error is recoverable and was silenced.\n // Ignore it and don't print the stack addendum.\n // This is handy for testing error boundaries without noise.\n return;\n } // The error is fatal. Since the silencing might have\n // been accidental, we'll surface it anyway.\n // However, the browser would have silenced the original error\n // so we'll print it first, and then print the stack addendum.\n\n\n console['error'](error); // Don't transform to our wrapper\n // For a more detailed description of this block, see:\n // https://github.com/facebook/react/pull/13384\n }\n\n var componentNameMessage = componentName ? \"The above error occurred in the <\" + componentName + \"> component:\" : 'The above error occurred in one of your React components:';\n var errorBoundaryMessage; // errorBoundaryFound check is sufficient; errorBoundaryName check is to satisfy Flow.\n\n if (errorBoundaryFound && errorBoundaryName) {\n if (willRetry) {\n errorBoundaryMessage = \"React will try to recreate this component tree from scratch \" + (\"using the error boundary you provided, \" + errorBoundaryName + \".\");\n } else {\n errorBoundaryMessage = \"This error was initially handled by the error boundary \" + errorBoundaryName + \".\\n\" + \"Recreating the tree from scratch failed so React will unmount the tree.\";\n }\n } else {\n errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.\\n' + 'Visit https://fb.me/react-error-boundaries to learn more about error boundaries.';\n }\n\n var combinedMessage = \"\" + componentNameMessage + componentStack + \"\\n\\n\" + (\"\" + errorBoundaryMessage); // In development, we provide our own message with just the component stack.\n // We don't include the original error message and JS stack because the browser\n // has already printed it. Even if the application swallows the error, it is still\n // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils.\n\n console['error'](combinedMessage); // Don't transform to our wrapper\n }\n}\n\nvar didWarnAboutUndefinedSnapshotBeforeUpdate = null;\n\n{\n didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();\n}\n\nvar PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set;\nfunction logError(boundary, errorInfo) {\n var source = errorInfo.source;\n var stack = errorInfo.stack;\n\n if (stack === null && source !== null) {\n stack = getStackByFiberInDevAndProd(source);\n }\n\n var capturedError = {\n componentName: source !== null ? getComponentName(source.type) : null,\n componentStack: stack !== null ? stack : '',\n error: errorInfo.value,\n errorBoundary: null,\n errorBoundaryName: null,\n errorBoundaryFound: false,\n willRetry: false\n };\n\n if (boundary !== null && boundary.tag === ClassComponent) {\n capturedError.errorBoundary = boundary.stateNode;\n capturedError.errorBoundaryName = getComponentName(boundary.type);\n capturedError.errorBoundaryFound = true;\n capturedError.willRetry = true;\n }\n\n try {\n logCapturedError(capturedError);\n } catch (e) {\n // This method must not throw, or React internal state will get messed up.\n // If console.error is overridden, or logCapturedError() shows a dialog that throws,\n // we want to report this error outside of the normal stack as a last resort.\n // https://github.com/facebook/react/issues/13188\n setTimeout(function () {\n throw e;\n });\n }\n}\n\nvar callComponentWillUnmountWithTimer = function (current, instance) {\n startPhaseTimer(current, 'componentWillUnmount');\n instance.props = current.memoizedProps;\n instance.state = current.memoizedState;\n instance.componentWillUnmount();\n stopPhaseTimer();\n}; // Capture errors so they don't interrupt unmounting.\n\n\nfunction safelyCallComponentWillUnmount(current, instance) {\n {\n invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current, instance);\n\n if (hasCaughtError()) {\n var unmountError = clearCaughtError();\n captureCommitPhaseError(current, unmountError);\n }\n }\n}\n\nfunction safelyDetachRef(current) {\n var ref = current.ref;\n\n if (ref !== null) {\n if (typeof ref === 'function') {\n {\n invokeGuardedCallback(null, ref, null, null);\n\n if (hasCaughtError()) {\n var refError = clearCaughtError();\n captureCommitPhaseError(current, refError);\n }\n }\n } else {\n ref.current = null;\n }\n }\n}\n\nfunction safelyCallDestroy(current, destroy) {\n {\n invokeGuardedCallback(null, destroy, null);\n\n if (hasCaughtError()) {\n var error = clearCaughtError();\n captureCommitPhaseError(current, error);\n }\n }\n}\n\nfunction commitBeforeMutationLifeCycles(current, finishedWork) {\n switch (finishedWork.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n case Block:\n {\n return;\n }\n\n case ClassComponent:\n {\n if (finishedWork.effectTag & Snapshot) {\n if (current !== null) {\n var prevProps = current.memoizedProps;\n var prevState = current.memoizedState;\n startPhaseTimer(finishedWork, 'getSnapshotBeforeUpdate');\n var instance = finishedWork.stateNode; // We could update instance props and state here,\n // but instead we rely on them being set during last render.\n // TODO: revisit this when we implement resuming.\n\n {\n if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n if (instance.props !== finishedWork.memoizedProps) {\n error('Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n\n if (instance.state !== finishedWork.memoizedState) {\n error('Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n }\n }\n\n var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);\n\n {\n var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;\n\n if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) {\n didWarnSet.add(finishedWork.type);\n\n error('%s.getSnapshotBeforeUpdate(): A snapshot value (or null) ' + 'must be returned. You have returned undefined.', getComponentName(finishedWork.type));\n }\n }\n\n instance.__reactInternalSnapshotBeforeUpdate = snapshot;\n stopPhaseTimer();\n }\n }\n\n return;\n }\n\n case HostRoot:\n case HostComponent:\n case HostText:\n case HostPortal:\n case IncompleteClassComponent:\n // Nothing to do for these component types\n return;\n }\n\n {\n {\n throw Error( \"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n}\n\nfunction commitHookEffectListUnmount(tag, finishedWork) {\n var updateQueue = finishedWork.updateQueue;\n var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;\n\n if (lastEffect !== null) {\n var firstEffect = lastEffect.next;\n var effect = firstEffect;\n\n do {\n if ((effect.tag & tag) === tag) {\n // Unmount\n var destroy = effect.destroy;\n effect.destroy = undefined;\n\n if (destroy !== undefined) {\n destroy();\n }\n }\n\n effect = effect.next;\n } while (effect !== firstEffect);\n }\n}\n\nfunction commitHookEffectListMount(tag, finishedWork) {\n var updateQueue = finishedWork.updateQueue;\n var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;\n\n if (lastEffect !== null) {\n var firstEffect = lastEffect.next;\n var effect = firstEffect;\n\n do {\n if ((effect.tag & tag) === tag) {\n // Mount\n var create = effect.create;\n effect.destroy = create();\n\n {\n var destroy = effect.destroy;\n\n if (destroy !== undefined && typeof destroy !== 'function') {\n var addendum = void 0;\n\n if (destroy === null) {\n addendum = ' You returned null. If your effect does not require clean ' + 'up, return undefined (or nothing).';\n } else if (typeof destroy.then === 'function') {\n addendum = '\\n\\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. ' + 'Instead, write the async function inside your effect ' + 'and call it immediately:\\n\\n' + 'useEffect(() => {\\n' + ' async function fetchData() {\\n' + ' // You can await here\\n' + ' const response = await MyAPI.getData(someId);\\n' + ' // ...\\n' + ' }\\n' + ' fetchData();\\n' + \"}, [someId]); // Or [] if effect doesn't need props or state\\n\\n\" + 'Learn more about data fetching with Hooks: https://fb.me/react-hooks-data-fetching';\n } else {\n addendum = ' You returned: ' + destroy;\n }\n\n error('An effect function must not return anything besides a function, ' + 'which is used for clean-up.%s%s', addendum, getStackByFiberInDevAndProd(finishedWork));\n }\n }\n }\n\n effect = effect.next;\n } while (effect !== firstEffect);\n }\n}\n\nfunction commitPassiveHookEffects(finishedWork) {\n if ((finishedWork.effectTag & Passive) !== NoEffect) {\n switch (finishedWork.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n case Block:\n {\n // TODO (#17945) We should call all passive destroy functions (for all fibers)\n // before calling any create functions. The current approach only serializes\n // these for a single fiber.\n commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork);\n commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);\n break;\n }\n }\n }\n}\n\nfunction commitLifeCycles(finishedRoot, current, finishedWork, committedExpirationTime) {\n switch (finishedWork.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n case Block:\n {\n // At this point layout effects have already been destroyed (during mutation phase).\n // This is done to prevent sibling component effects from interfering with each other,\n // e.g. a destroy function in one component should never override a ref set\n // by a create function in another component during the same commit.\n commitHookEffectListMount(Layout | HasEffect, finishedWork);\n\n return;\n }\n\n case ClassComponent:\n {\n var instance = finishedWork.stateNode;\n\n if (finishedWork.effectTag & Update) {\n if (current === null) {\n startPhaseTimer(finishedWork, 'componentDidMount'); // We could update instance props and state here,\n // but instead we rely on them being set during last render.\n // TODO: revisit this when we implement resuming.\n\n {\n if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n if (instance.props !== finishedWork.memoizedProps) {\n error('Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n\n if (instance.state !== finishedWork.memoizedState) {\n error('Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n }\n }\n\n instance.componentDidMount();\n stopPhaseTimer();\n } else {\n var prevProps = finishedWork.elementType === finishedWork.type ? current.memoizedProps : resolveDefaultProps(finishedWork.type, current.memoizedProps);\n var prevState = current.memoizedState;\n startPhaseTimer(finishedWork, 'componentDidUpdate'); // We could update instance props and state here,\n // but instead we rely on them being set during last render.\n // TODO: revisit this when we implement resuming.\n\n {\n if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n if (instance.props !== finishedWork.memoizedProps) {\n error('Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n\n if (instance.state !== finishedWork.memoizedState) {\n error('Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n }\n }\n\n instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);\n stopPhaseTimer();\n }\n }\n\n var updateQueue = finishedWork.updateQueue;\n\n if (updateQueue !== null) {\n {\n if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n if (instance.props !== finishedWork.memoizedProps) {\n error('Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n\n if (instance.state !== finishedWork.memoizedState) {\n error('Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n }\n } // We could update instance props and state here,\n // but instead we rely on them being set during last render.\n // TODO: revisit this when we implement resuming.\n\n\n commitUpdateQueue(finishedWork, updateQueue, instance);\n }\n\n return;\n }\n\n case HostRoot:\n {\n var _updateQueue = finishedWork.updateQueue;\n\n if (_updateQueue !== null) {\n var _instance = null;\n\n if (finishedWork.child !== null) {\n switch (finishedWork.child.tag) {\n case HostComponent:\n _instance = getPublicInstance(finishedWork.child.stateNode);\n break;\n\n case ClassComponent:\n _instance = finishedWork.child.stateNode;\n break;\n }\n }\n\n commitUpdateQueue(finishedWork, _updateQueue, _instance);\n }\n\n return;\n }\n\n case HostComponent:\n {\n var _instance2 = finishedWork.stateNode; // Renderers may schedule work to be done after host components are mounted\n // (eg DOM renderer may schedule auto-focus for inputs and form controls).\n // These effects should only be committed when components are first mounted,\n // aka when there is no current/alternate.\n\n if (current === null && finishedWork.effectTag & Update) {\n var type = finishedWork.type;\n var props = finishedWork.memoizedProps;\n commitMount(_instance2, type, props);\n }\n\n return;\n }\n\n case HostText:\n {\n // We have no life-cycles associated with text.\n return;\n }\n\n case HostPortal:\n {\n // We have no life-cycles associated with portals.\n return;\n }\n\n case Profiler:\n {\n {\n var onRender = finishedWork.memoizedProps.onRender;\n\n if (typeof onRender === 'function') {\n {\n onRender(finishedWork.memoizedProps.id, current === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime(), finishedRoot.memoizedInteractions);\n }\n }\n }\n\n return;\n }\n\n case SuspenseComponent:\n {\n commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);\n return;\n }\n\n case SuspenseListComponent:\n case IncompleteClassComponent:\n case FundamentalComponent:\n case ScopeComponent:\n return;\n }\n\n {\n {\n throw Error( \"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n}\n\nfunction hideOrUnhideAllChildren(finishedWork, isHidden) {\n {\n // We only have the top Fiber that was inserted but we need to recurse down its\n // children to find all the terminal nodes.\n var node = finishedWork;\n\n while (true) {\n if (node.tag === HostComponent) {\n var instance = node.stateNode;\n\n if (isHidden) {\n hideInstance(instance);\n } else {\n unhideInstance(node.stateNode, node.memoizedProps);\n }\n } else if (node.tag === HostText) {\n var _instance3 = node.stateNode;\n\n if (isHidden) {\n hideTextInstance(_instance3);\n } else {\n unhideTextInstance(_instance3, node.memoizedProps);\n }\n } else if (node.tag === SuspenseComponent && node.memoizedState !== null && node.memoizedState.dehydrated === null) {\n // Found a nested Suspense component that timed out. Skip over the\n // primary child fragment, which should remain hidden.\n var fallbackChildFragment = node.child.sibling;\n fallbackChildFragment.return = node;\n node = fallbackChildFragment;\n continue;\n } else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === finishedWork) {\n return;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === finishedWork) {\n return;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n }\n}\n\nfunction commitAttachRef(finishedWork) {\n var ref = finishedWork.ref;\n\n if (ref !== null) {\n var instance = finishedWork.stateNode;\n var instanceToUse;\n\n switch (finishedWork.tag) {\n case HostComponent:\n instanceToUse = getPublicInstance(instance);\n break;\n\n default:\n instanceToUse = instance;\n } // Moved outside to ensure DCE works with this flag\n\n if (typeof ref === 'function') {\n ref(instanceToUse);\n } else {\n {\n if (!ref.hasOwnProperty('current')) {\n error('Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().%s', getComponentName(finishedWork.type), getStackByFiberInDevAndProd(finishedWork));\n }\n }\n\n ref.current = instanceToUse;\n }\n }\n}\n\nfunction commitDetachRef(current) {\n var currentRef = current.ref;\n\n if (currentRef !== null) {\n if (typeof currentRef === 'function') {\n currentRef(null);\n } else {\n currentRef.current = null;\n }\n }\n} // User-originating errors (lifecycles and refs) should not interrupt\n// deletion, so don't let them throw. Host-originating errors should\n// interrupt deletion, so it's okay\n\n\nfunction commitUnmount(finishedRoot, current, renderPriorityLevel) {\n onCommitUnmount(current);\n\n switch (current.tag) {\n case FunctionComponent:\n case ForwardRef:\n case MemoComponent:\n case SimpleMemoComponent:\n case Block:\n {\n var updateQueue = current.updateQueue;\n\n if (updateQueue !== null) {\n var lastEffect = updateQueue.lastEffect;\n\n if (lastEffect !== null) {\n var firstEffect = lastEffect.next;\n\n {\n // When the owner fiber is deleted, the destroy function of a passive\n // effect hook is called during the synchronous commit phase. This is\n // a concession to implementation complexity. Calling it in the\n // passive effect phase (like they usually are, when dependencies\n // change during an update) would require either traversing the\n // children of the deleted fiber again, or including unmount effects\n // as part of the fiber effect list.\n //\n // Because this is during the sync commit phase, we need to change\n // the priority.\n //\n // TODO: Reconsider this implementation trade off.\n var priorityLevel = renderPriorityLevel > NormalPriority ? NormalPriority : renderPriorityLevel;\n runWithPriority$1(priorityLevel, function () {\n var effect = firstEffect;\n\n do {\n var _destroy = effect.destroy;\n\n if (_destroy !== undefined) {\n safelyCallDestroy(current, _destroy);\n }\n\n effect = effect.next;\n } while (effect !== firstEffect);\n });\n }\n }\n }\n\n return;\n }\n\n case ClassComponent:\n {\n safelyDetachRef(current);\n var instance = current.stateNode;\n\n if (typeof instance.componentWillUnmount === 'function') {\n safelyCallComponentWillUnmount(current, instance);\n }\n\n return;\n }\n\n case HostComponent:\n {\n\n safelyDetachRef(current);\n return;\n }\n\n case HostPortal:\n {\n // TODO: this is recursive.\n // We are also not using this parent because\n // the portal will get pushed immediately.\n {\n unmountHostComponents(finishedRoot, current, renderPriorityLevel);\n }\n\n return;\n }\n\n case FundamentalComponent:\n {\n\n return;\n }\n\n case DehydratedFragment:\n {\n\n return;\n }\n\n case ScopeComponent:\n {\n\n return;\n }\n }\n}\n\nfunction commitNestedUnmounts(finishedRoot, root, renderPriorityLevel) {\n // While we're inside a removed host node we don't want to call\n // removeChild on the inner nodes because they're removed by the top\n // call anyway. We also want to call componentWillUnmount on all\n // composites before this host node is removed from the tree. Therefore\n // we do an inner loop while we're still inside the host node.\n var node = root;\n\n while (true) {\n commitUnmount(finishedRoot, node, renderPriorityLevel); // Visit children because they may contain more composite or host nodes.\n // Skip portals because commitUnmount() currently visits them recursively.\n\n if (node.child !== null && ( // If we use mutation we drill down into portals using commitUnmount above.\n // If we don't use mutation we drill down into portals here instead.\n node.tag !== HostPortal)) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === root) {\n return;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === root) {\n return;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n}\n\nfunction detachFiber(current) {\n var alternate = current.alternate; // Cut off the return pointers to disconnect it from the tree. Ideally, we\n // should clear the child pointer of the parent alternate to let this\n // get GC:ed but we don't know which for sure which parent is the current\n // one so we'll settle for GC:ing the subtree of this child. This child\n // itself will be GC:ed when the parent updates the next time.\n\n current.return = null;\n current.child = null;\n current.memoizedState = null;\n current.updateQueue = null;\n current.dependencies = null;\n current.alternate = null;\n current.firstEffect = null;\n current.lastEffect = null;\n current.pendingProps = null;\n current.memoizedProps = null;\n current.stateNode = null;\n\n if (alternate !== null) {\n detachFiber(alternate);\n }\n}\n\nfunction getHostParentFiber(fiber) {\n var parent = fiber.return;\n\n while (parent !== null) {\n if (isHostParent(parent)) {\n return parent;\n }\n\n parent = parent.return;\n }\n\n {\n {\n throw Error( \"Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n}\n\nfunction isHostParent(fiber) {\n return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;\n}\n\nfunction getHostSibling(fiber) {\n // We're going to search forward into the tree until we find a sibling host\n // node. Unfortunately, if multiple insertions are done in a row we have to\n // search past them. This leads to exponential search for the next sibling.\n // TODO: Find a more efficient way to do this.\n var node = fiber;\n\n siblings: while (true) {\n // If we didn't find anything, let's try the next sibling.\n while (node.sibling === null) {\n if (node.return === null || isHostParent(node.return)) {\n // If we pop out of the root or hit the parent the fiber we are the\n // last sibling.\n return null;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n\n while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {\n // If it is not host node and, we might have a host node inside it.\n // Try to search down until we find one.\n if (node.effectTag & Placement) {\n // If we don't have a child, try the siblings instead.\n continue siblings;\n } // If we don't have a child, try the siblings instead.\n // We also skip portals because they are not part of this host tree.\n\n\n if (node.child === null || node.tag === HostPortal) {\n continue siblings;\n } else {\n node.child.return = node;\n node = node.child;\n }\n } // Check if this host node is stable or about to be placed.\n\n\n if (!(node.effectTag & Placement)) {\n // Found it!\n return node.stateNode;\n }\n }\n}\n\nfunction commitPlacement(finishedWork) {\n\n\n var parentFiber = getHostParentFiber(finishedWork); // Note: these two variables *must* always be updated together.\n\n var parent;\n var isContainer;\n var parentStateNode = parentFiber.stateNode;\n\n switch (parentFiber.tag) {\n case HostComponent:\n parent = parentStateNode;\n isContainer = false;\n break;\n\n case HostRoot:\n parent = parentStateNode.containerInfo;\n isContainer = true;\n break;\n\n case HostPortal:\n parent = parentStateNode.containerInfo;\n isContainer = true;\n break;\n\n case FundamentalComponent:\n\n // eslint-disable-next-line-no-fallthrough\n\n default:\n {\n {\n throw Error( \"Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n }\n\n if (parentFiber.effectTag & ContentReset) {\n // Reset the text content of the parent before doing any insertions\n resetTextContent(parent); // Clear ContentReset from the effect tag\n\n parentFiber.effectTag &= ~ContentReset;\n }\n\n var before = getHostSibling(finishedWork); // We only have the top Fiber that was inserted but we need to recurse down its\n // children to find all the terminal nodes.\n\n if (isContainer) {\n insertOrAppendPlacementNodeIntoContainer(finishedWork, before, parent);\n } else {\n insertOrAppendPlacementNode(finishedWork, before, parent);\n }\n}\n\nfunction insertOrAppendPlacementNodeIntoContainer(node, before, parent) {\n var tag = node.tag;\n var isHost = tag === HostComponent || tag === HostText;\n\n if (isHost || enableFundamentalAPI ) {\n var stateNode = isHost ? node.stateNode : node.stateNode.instance;\n\n if (before) {\n insertInContainerBefore(parent, stateNode, before);\n } else {\n appendChildToContainer(parent, stateNode);\n }\n } else if (tag === HostPortal) ; else {\n var child = node.child;\n\n if (child !== null) {\n insertOrAppendPlacementNodeIntoContainer(child, before, parent);\n var sibling = child.sibling;\n\n while (sibling !== null) {\n insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);\n sibling = sibling.sibling;\n }\n }\n }\n}\n\nfunction insertOrAppendPlacementNode(node, before, parent) {\n var tag = node.tag;\n var isHost = tag === HostComponent || tag === HostText;\n\n if (isHost || enableFundamentalAPI ) {\n var stateNode = isHost ? node.stateNode : node.stateNode.instance;\n\n if (before) {\n insertBefore(parent, stateNode, before);\n } else {\n appendChild(parent, stateNode);\n }\n } else if (tag === HostPortal) ; else {\n var child = node.child;\n\n if (child !== null) {\n insertOrAppendPlacementNode(child, before, parent);\n var sibling = child.sibling;\n\n while (sibling !== null) {\n insertOrAppendPlacementNode(sibling, before, parent);\n sibling = sibling.sibling;\n }\n }\n }\n}\n\nfunction unmountHostComponents(finishedRoot, current, renderPriorityLevel) {\n // We only have the top Fiber that was deleted but we need to recurse down its\n // children to find all the terminal nodes.\n var node = current; // Each iteration, currentParent is populated with node's host parent if not\n // currentParentIsValid.\n\n var currentParentIsValid = false; // Note: these two variables *must* always be updated together.\n\n var currentParent;\n var currentParentIsContainer;\n\n while (true) {\n if (!currentParentIsValid) {\n var parent = node.return;\n\n findParent: while (true) {\n if (!(parent !== null)) {\n {\n throw Error( \"Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n var parentStateNode = parent.stateNode;\n\n switch (parent.tag) {\n case HostComponent:\n currentParent = parentStateNode;\n currentParentIsContainer = false;\n break findParent;\n\n case HostRoot:\n currentParent = parentStateNode.containerInfo;\n currentParentIsContainer = true;\n break findParent;\n\n case HostPortal:\n currentParent = parentStateNode.containerInfo;\n currentParentIsContainer = true;\n break findParent;\n\n }\n\n parent = parent.return;\n }\n\n currentParentIsValid = true;\n }\n\n if (node.tag === HostComponent || node.tag === HostText) {\n commitNestedUnmounts(finishedRoot, node, renderPriorityLevel); // After all the children have unmounted, it is now safe to remove the\n // node from the tree.\n\n if (currentParentIsContainer) {\n removeChildFromContainer(currentParent, node.stateNode);\n } else {\n removeChild(currentParent, node.stateNode);\n } // Don't visit children because we already visited them.\n\n } else if (node.tag === HostPortal) {\n if (node.child !== null) {\n // When we go into a portal, it becomes the parent to remove from.\n // We will reassign it back when we pop the portal on the way up.\n currentParent = node.stateNode.containerInfo;\n currentParentIsContainer = true; // Visit children because portals might contain host components.\n\n node.child.return = node;\n node = node.child;\n continue;\n }\n } else {\n commitUnmount(finishedRoot, node, renderPriorityLevel); // Visit children because we may find more host components below.\n\n if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n }\n\n if (node === current) {\n return;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === current) {\n return;\n }\n\n node = node.return;\n\n if (node.tag === HostPortal) {\n // When we go out of the portal, we need to restore the parent.\n // Since we don't keep a stack of them, we will search for it.\n currentParentIsValid = false;\n }\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n}\n\nfunction commitDeletion(finishedRoot, current, renderPriorityLevel) {\n {\n // Recursively delete all host nodes from the parent.\n // Detach refs and call componentWillUnmount() on the whole subtree.\n unmountHostComponents(finishedRoot, current, renderPriorityLevel);\n }\n\n detachFiber(current);\n}\n\nfunction commitWork(current, finishedWork) {\n\n switch (finishedWork.tag) {\n case FunctionComponent:\n case ForwardRef:\n case MemoComponent:\n case SimpleMemoComponent:\n case Block:\n {\n // Layout effects are destroyed during the mutation phase so that all\n // destroy functions for all fibers are called before any create functions.\n // This prevents sibling component effects from interfering with each other,\n // e.g. a destroy function in one component should never override a ref set\n // by a create function in another component during the same commit.\n commitHookEffectListUnmount(Layout | HasEffect, finishedWork);\n return;\n }\n\n case ClassComponent:\n {\n return;\n }\n\n case HostComponent:\n {\n var instance = finishedWork.stateNode;\n\n if (instance != null) {\n // Commit the work prepared earlier.\n var newProps = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps\n // as the newProps. The updatePayload will contain the real change in\n // this case.\n\n var oldProps = current !== null ? current.memoizedProps : newProps;\n var type = finishedWork.type; // TODO: Type the updateQueue to be specific to host components.\n\n var updatePayload = finishedWork.updateQueue;\n finishedWork.updateQueue = null;\n\n if (updatePayload !== null) {\n commitUpdate(instance, updatePayload, type, oldProps, newProps);\n }\n }\n\n return;\n }\n\n case HostText:\n {\n if (!(finishedWork.stateNode !== null)) {\n {\n throw Error( \"This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n var textInstance = finishedWork.stateNode;\n var newText = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps\n // as the newProps. The updatePayload will contain the real change in\n // this case.\n\n var oldText = current !== null ? current.memoizedProps : newText;\n commitTextUpdate(textInstance, oldText, newText);\n return;\n }\n\n case HostRoot:\n {\n {\n var _root = finishedWork.stateNode;\n\n if (_root.hydrate) {\n // We've just hydrated. No need to hydrate again.\n _root.hydrate = false;\n commitHydratedContainer(_root.containerInfo);\n }\n }\n\n return;\n }\n\n case Profiler:\n {\n return;\n }\n\n case SuspenseComponent:\n {\n commitSuspenseComponent(finishedWork);\n attachSuspenseRetryListeners(finishedWork);\n return;\n }\n\n case SuspenseListComponent:\n {\n attachSuspenseRetryListeners(finishedWork);\n return;\n }\n\n case IncompleteClassComponent:\n {\n return;\n }\n }\n\n {\n {\n throw Error( \"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n}\n\nfunction commitSuspenseComponent(finishedWork) {\n var newState = finishedWork.memoizedState;\n var newDidTimeout;\n var primaryChildParent = finishedWork;\n\n if (newState === null) {\n newDidTimeout = false;\n } else {\n newDidTimeout = true;\n primaryChildParent = finishedWork.child;\n markCommitTimeOfFallback();\n }\n\n if ( primaryChildParent !== null) {\n hideOrUnhideAllChildren(primaryChildParent, newDidTimeout);\n }\n}\n\nfunction commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {\n\n var newState = finishedWork.memoizedState;\n\n if (newState === null) {\n var current = finishedWork.alternate;\n\n if (current !== null) {\n var prevState = current.memoizedState;\n\n if (prevState !== null) {\n var suspenseInstance = prevState.dehydrated;\n\n if (suspenseInstance !== null) {\n commitHydratedSuspenseInstance(suspenseInstance);\n }\n }\n }\n }\n}\n\nfunction attachSuspenseRetryListeners(finishedWork) {\n // If this boundary just timed out, then it will have a set of thenables.\n // For each thenable, attach a listener so that when it resolves, React\n // attempts to re-render the boundary in the primary (pre-timeout) state.\n var thenables = finishedWork.updateQueue;\n\n if (thenables !== null) {\n finishedWork.updateQueue = null;\n var retryCache = finishedWork.stateNode;\n\n if (retryCache === null) {\n retryCache = finishedWork.stateNode = new PossiblyWeakSet();\n }\n\n thenables.forEach(function (thenable) {\n // Memoize using the boundary fiber to prevent redundant listeners.\n var retry = resolveRetryThenable.bind(null, finishedWork, thenable);\n\n if (!retryCache.has(thenable)) {\n {\n if (thenable.__reactDoNotTraceInteractions !== true) {\n retry = tracing.unstable_wrap(retry);\n }\n }\n\n retryCache.add(thenable);\n thenable.then(retry, retry);\n }\n });\n }\n}\n\nfunction commitResetTextContent(current) {\n\n resetTextContent(current.stateNode);\n}\n\nvar PossiblyWeakMap$1 = typeof WeakMap === 'function' ? WeakMap : Map;\n\nfunction createRootErrorUpdate(fiber, errorInfo, expirationTime) {\n var update = createUpdate(expirationTime, null); // Unmount the root by rendering null.\n\n update.tag = CaptureUpdate; // Caution: React DevTools currently depends on this property\n // being called \"element\".\n\n update.payload = {\n element: null\n };\n var error = errorInfo.value;\n\n update.callback = function () {\n onUncaughtError(error);\n logError(fiber, errorInfo);\n };\n\n return update;\n}\n\nfunction createClassErrorUpdate(fiber, errorInfo, expirationTime) {\n var update = createUpdate(expirationTime, null);\n update.tag = CaptureUpdate;\n var getDerivedStateFromError = fiber.type.getDerivedStateFromError;\n\n if (typeof getDerivedStateFromError === 'function') {\n var error$1 = errorInfo.value;\n\n update.payload = function () {\n logError(fiber, errorInfo);\n return getDerivedStateFromError(error$1);\n };\n }\n\n var inst = fiber.stateNode;\n\n if (inst !== null && typeof inst.componentDidCatch === 'function') {\n update.callback = function callback() {\n {\n markFailedErrorBoundaryForHotReloading(fiber);\n }\n\n if (typeof getDerivedStateFromError !== 'function') {\n // To preserve the preexisting retry behavior of error boundaries,\n // we keep track of which ones already failed during this batch.\n // This gets reset before we yield back to the browser.\n // TODO: Warn in strict mode if getDerivedStateFromError is\n // not defined.\n markLegacyErrorBoundaryAsFailed(this); // Only log here if componentDidCatch is the only error boundary method defined\n\n logError(fiber, errorInfo);\n }\n\n var error$1 = errorInfo.value;\n var stack = errorInfo.stack;\n this.componentDidCatch(error$1, {\n componentStack: stack !== null ? stack : ''\n });\n\n {\n if (typeof getDerivedStateFromError !== 'function') {\n // If componentDidCatch is the only error boundary method defined,\n // then it needs to call setState to recover from errors.\n // If no state update is scheduled then the boundary will swallow the error.\n if (fiber.expirationTime !== Sync) {\n error('%s: Error boundaries should implement getDerivedStateFromError(). ' + 'In that method, return a state update to display an error message or fallback UI.', getComponentName(fiber.type) || 'Unknown');\n }\n }\n }\n };\n } else {\n update.callback = function () {\n markFailedErrorBoundaryForHotReloading(fiber);\n };\n }\n\n return update;\n}\n\nfunction attachPingListener(root, renderExpirationTime, thenable) {\n // Attach a listener to the promise to \"ping\" the root and retry. But\n // only if one does not already exist for the current render expiration\n // time (which acts like a \"thread ID\" here).\n var pingCache = root.pingCache;\n var threadIDs;\n\n if (pingCache === null) {\n pingCache = root.pingCache = new PossiblyWeakMap$1();\n threadIDs = new Set();\n pingCache.set(thenable, threadIDs);\n } else {\n threadIDs = pingCache.get(thenable);\n\n if (threadIDs === undefined) {\n threadIDs = new Set();\n pingCache.set(thenable, threadIDs);\n }\n }\n\n if (!threadIDs.has(renderExpirationTime)) {\n // Memoize using the thread ID to prevent redundant listeners.\n threadIDs.add(renderExpirationTime);\n var ping = pingSuspendedRoot.bind(null, root, thenable, renderExpirationTime);\n thenable.then(ping, ping);\n }\n}\n\nfunction throwException(root, returnFiber, sourceFiber, value, renderExpirationTime) {\n // The source fiber did not complete.\n sourceFiber.effectTag |= Incomplete; // Its effect list is no longer valid.\n\n sourceFiber.firstEffect = sourceFiber.lastEffect = null;\n\n if (value !== null && typeof value === 'object' && typeof value.then === 'function') {\n // This is a thenable.\n var thenable = value;\n\n if ((sourceFiber.mode & BlockingMode) === NoMode) {\n // Reset the memoizedState to what it was before we attempted\n // to render it.\n var currentSource = sourceFiber.alternate;\n\n if (currentSource) {\n sourceFiber.updateQueue = currentSource.updateQueue;\n sourceFiber.memoizedState = currentSource.memoizedState;\n sourceFiber.expirationTime = currentSource.expirationTime;\n } else {\n sourceFiber.updateQueue = null;\n sourceFiber.memoizedState = null;\n }\n }\n\n var hasInvisibleParentBoundary = hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext); // Schedule the nearest Suspense to re-render the timed out view.\n\n var _workInProgress = returnFiber;\n\n do {\n if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress, hasInvisibleParentBoundary)) {\n // Found the nearest boundary.\n // Stash the promise on the boundary fiber. If the boundary times out, we'll\n // attach another listener to flip the boundary back to its normal state.\n var thenables = _workInProgress.updateQueue;\n\n if (thenables === null) {\n var updateQueue = new Set();\n updateQueue.add(thenable);\n _workInProgress.updateQueue = updateQueue;\n } else {\n thenables.add(thenable);\n } // If the boundary is outside of blocking mode, we should *not*\n // suspend the commit. Pretend as if the suspended component rendered\n // null and keep rendering. In the commit phase, we'll schedule a\n // subsequent synchronous update to re-render the Suspense.\n //\n // Note: It doesn't matter whether the component that suspended was\n // inside a blocking mode tree. If the Suspense is outside of it, we\n // should *not* suspend the commit.\n\n\n if ((_workInProgress.mode & BlockingMode) === NoMode) {\n _workInProgress.effectTag |= DidCapture; // We're going to commit this fiber even though it didn't complete.\n // But we shouldn't call any lifecycle methods or callbacks. Remove\n // all lifecycle effect tags.\n\n sourceFiber.effectTag &= ~(LifecycleEffectMask | Incomplete);\n\n if (sourceFiber.tag === ClassComponent) {\n var currentSourceFiber = sourceFiber.alternate;\n\n if (currentSourceFiber === null) {\n // This is a new mount. Change the tag so it's not mistaken for a\n // completed class component. For example, we should not call\n // componentWillUnmount if it is deleted.\n sourceFiber.tag = IncompleteClassComponent;\n } else {\n // When we try rendering again, we should not reuse the current fiber,\n // since it's known to be in an inconsistent state. Use a force update to\n // prevent a bail out.\n var update = createUpdate(Sync, null);\n update.tag = ForceUpdate;\n enqueueUpdate(sourceFiber, update);\n }\n } // The source fiber did not complete. Mark it with Sync priority to\n // indicate that it still has pending work.\n\n\n sourceFiber.expirationTime = Sync; // Exit without suspending.\n\n return;\n } // Confirmed that the boundary is in a concurrent mode tree. Continue\n // with the normal suspend path.\n //\n // After this we'll use a set of heuristics to determine whether this\n // render pass will run to completion or restart or \"suspend\" the commit.\n // The actual logic for this is spread out in different places.\n //\n // This first principle is that if we're going to suspend when we complete\n // a root, then we should also restart if we get an update or ping that\n // might unsuspend it, and vice versa. The only reason to suspend is\n // because you think you might want to restart before committing. However,\n // it doesn't make sense to restart only while in the period we're suspended.\n //\n // Restarting too aggressively is also not good because it starves out any\n // intermediate loading state. So we use heuristics to determine when.\n // Suspense Heuristics\n //\n // If nothing threw a Promise or all the same fallbacks are already showing,\n // then don't suspend/restart.\n //\n // If this is an initial render of a new tree of Suspense boundaries and\n // those trigger a fallback, then don't suspend/restart. We want to ensure\n // that we can show the initial loading state as quickly as possible.\n //\n // If we hit a \"Delayed\" case, such as when we'd switch from content back into\n // a fallback, then we should always suspend/restart. SuspenseConfig applies to\n // this case. If none is defined, JND is used instead.\n //\n // If we're already showing a fallback and it gets \"retried\", allowing us to show\n // another level, but there's still an inner boundary that would show a fallback,\n // then we suspend/restart for 500ms since the last time we showed a fallback\n // anywhere in the tree. This effectively throttles progressive loading into a\n // consistent train of commits. This also gives us an opportunity to restart to\n // get to the completed state slightly earlier.\n //\n // If there's ambiguity due to batching it's resolved in preference of:\n // 1) \"delayed\", 2) \"initial render\", 3) \"retry\".\n //\n // We want to ensure that a \"busy\" state doesn't get force committed. We want to\n // ensure that new initial loading states can commit as soon as possible.\n\n\n attachPingListener(root, renderExpirationTime, thenable);\n _workInProgress.effectTag |= ShouldCapture;\n _workInProgress.expirationTime = renderExpirationTime;\n return;\n } // This boundary already captured during this render. Continue to the next\n // boundary.\n\n\n _workInProgress = _workInProgress.return;\n } while (_workInProgress !== null); // No boundary was found. Fallthrough to error mode.\n // TODO: Use invariant so the message is stripped in prod?\n\n\n value = new Error((getComponentName(sourceFiber.type) || 'A React component') + ' suspended while rendering, but no fallback UI was specified.\\n' + '\\n' + 'Add a <Suspense fallback=...> component higher in the tree to ' + 'provide a loading indicator or placeholder to display.' + getStackByFiberInDevAndProd(sourceFiber));\n } // We didn't find a boundary that could handle this type of exception. Start\n // over and traverse parent path again, this time treating the exception\n // as an error.\n\n\n renderDidError();\n value = createCapturedValue(value, sourceFiber);\n var workInProgress = returnFiber;\n\n do {\n switch (workInProgress.tag) {\n case HostRoot:\n {\n var _errorInfo = value;\n workInProgress.effectTag |= ShouldCapture;\n workInProgress.expirationTime = renderExpirationTime;\n\n var _update = createRootErrorUpdate(workInProgress, _errorInfo, renderExpirationTime);\n\n enqueueCapturedUpdate(workInProgress, _update);\n return;\n }\n\n case ClassComponent:\n // Capture and retry\n var errorInfo = value;\n var ctor = workInProgress.type;\n var instance = workInProgress.stateNode;\n\n if ((workInProgress.effectTag & DidCapture) === NoEffect && (typeof ctor.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance))) {\n workInProgress.effectTag |= ShouldCapture;\n workInProgress.expirationTime = renderExpirationTime; // Schedule the error boundary to re-render using updated state\n\n var _update2 = createClassErrorUpdate(workInProgress, errorInfo, renderExpirationTime);\n\n enqueueCapturedUpdate(workInProgress, _update2);\n return;\n }\n\n break;\n }\n\n workInProgress = workInProgress.return;\n } while (workInProgress !== null);\n}\n\nvar ceil = Math.ceil;\nvar ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,\n ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner,\n IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing;\nvar NoContext =\n/* */\n0;\nvar BatchedContext =\n/* */\n1;\nvar EventContext =\n/* */\n2;\nvar DiscreteEventContext =\n/* */\n4;\nvar LegacyUnbatchedContext =\n/* */\n8;\nvar RenderContext =\n/* */\n16;\nvar CommitContext =\n/* */\n32;\nvar RootIncomplete = 0;\nvar RootFatalErrored = 1;\nvar RootErrored = 2;\nvar RootSuspended = 3;\nvar RootSuspendedWithDelay = 4;\nvar RootCompleted = 5;\n// Describes where we are in the React execution stack\nvar executionContext = NoContext; // The root we're working on\n\nvar workInProgressRoot = null; // The fiber we're working on\n\nvar workInProgress = null; // The expiration time we're rendering\n\nvar renderExpirationTime$1 = NoWork; // Whether to root completed, errored, suspended, etc.\n\nvar workInProgressRootExitStatus = RootIncomplete; // A fatal error, if one is thrown\n\nvar workInProgressRootFatalError = null; // Most recent event time among processed updates during this render.\n// This is conceptually a time stamp but expressed in terms of an ExpirationTime\n// because we deal mostly with expiration times in the hot path, so this avoids\n// the conversion happening in the hot path.\n\nvar workInProgressRootLatestProcessedExpirationTime = Sync;\nvar workInProgressRootLatestSuspenseTimeout = Sync;\nvar workInProgressRootCanSuspendUsingConfig = null; // The work left over by components that were visited during this render. Only\n// includes unprocessed updates, not work in bailed out children.\n\nvar workInProgressRootNextUnprocessedUpdateTime = NoWork; // If we're pinged while rendering we don't always restart immediately.\n// This flag determines if it might be worthwhile to restart if an opportunity\n// happens latere.\n\nvar workInProgressRootHasPendingPing = false; // The most recent time we committed a fallback. This lets us ensure a train\n// model where we don't commit new loading states in too quick succession.\n\nvar globalMostRecentFallbackTime = 0;\nvar FALLBACK_THROTTLE_MS = 500;\nvar nextEffect = null;\nvar hasUncaughtError = false;\nvar firstUncaughtError = null;\nvar legacyErrorBoundariesThatAlreadyFailed = null;\nvar rootDoesHavePassiveEffects = false;\nvar rootWithPendingPassiveEffects = null;\nvar pendingPassiveEffectsRenderPriority = NoPriority;\nvar pendingPassiveEffectsExpirationTime = NoWork;\nvar rootsWithPendingDiscreteUpdates = null; // Use these to prevent an infinite loop of nested updates\n\nvar NESTED_UPDATE_LIMIT = 50;\nvar nestedUpdateCount = 0;\nvar rootWithNestedUpdates = null;\nvar NESTED_PASSIVE_UPDATE_LIMIT = 50;\nvar nestedPassiveUpdateCount = 0;\nvar interruptedBy = null; // Marks the need to reschedule pending interactions at these expiration times\n// during the commit phase. This enables them to be traced across components\n// that spawn new work during render. E.g. hidden boundaries, suspended SSR\n// hydration or SuspenseList.\n\nvar spawnedWorkDuringRender = null; // Expiration times are computed by adding to the current time (the start\n// time). However, if two updates are scheduled within the same event, we\n// should treat their start times as simultaneous, even if the actual clock\n// time has advanced between the first and second call.\n// In other words, because expiration times determine how updates are batched,\n// we want all updates of like priority that occur within the same event to\n// receive the same expiration time. Otherwise we get tearing.\n\nvar currentEventTime = NoWork;\nfunction requestCurrentTimeForUpdate() {\n if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {\n // We're inside React, so it's fine to read the actual time.\n return msToExpirationTime(now());\n } // We're not inside React, so we may be in the middle of a browser event.\n\n\n if (currentEventTime !== NoWork) {\n // Use the same start time for all updates until we enter React again.\n return currentEventTime;\n } // This is the first update since React yielded. Compute a new start time.\n\n\n currentEventTime = msToExpirationTime(now());\n return currentEventTime;\n}\nfunction getCurrentTime() {\n return msToExpirationTime(now());\n}\nfunction computeExpirationForFiber(currentTime, fiber, suspenseConfig) {\n var mode = fiber.mode;\n\n if ((mode & BlockingMode) === NoMode) {\n return Sync;\n }\n\n var priorityLevel = getCurrentPriorityLevel();\n\n if ((mode & ConcurrentMode) === NoMode) {\n return priorityLevel === ImmediatePriority ? Sync : Batched;\n }\n\n if ((executionContext & RenderContext) !== NoContext) {\n // Use whatever time we're already rendering\n // TODO: Should there be a way to opt out, like with `runWithPriority`?\n return renderExpirationTime$1;\n }\n\n var expirationTime;\n\n if (suspenseConfig !== null) {\n // Compute an expiration time based on the Suspense timeout.\n expirationTime = computeSuspenseExpiration(currentTime, suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION);\n } else {\n // Compute an expiration time based on the Scheduler priority.\n switch (priorityLevel) {\n case ImmediatePriority:\n expirationTime = Sync;\n break;\n\n case UserBlockingPriority$1:\n // TODO: Rename this to computeUserBlockingExpiration\n expirationTime = computeInteractiveExpiration(currentTime);\n break;\n\n case NormalPriority:\n case LowPriority:\n // TODO: Handle LowPriority\n // TODO: Rename this to... something better.\n expirationTime = computeAsyncExpiration(currentTime);\n break;\n\n case IdlePriority:\n expirationTime = Idle;\n break;\n\n default:\n {\n {\n throw Error( \"Expected a valid priority level\" );\n }\n }\n\n }\n } // If we're in the middle of rendering a tree, do not update at the same\n // expiration time that is already rendering.\n // TODO: We shouldn't have to do this if the update is on a different root.\n // Refactor computeExpirationForFiber + scheduleUpdate so we have access to\n // the root when we check for this condition.\n\n\n if (workInProgressRoot !== null && expirationTime === renderExpirationTime$1) {\n // This is a trick to move this update into a separate batch\n expirationTime -= 1;\n }\n\n return expirationTime;\n}\nfunction scheduleUpdateOnFiber(fiber, expirationTime) {\n checkForNestedUpdates();\n warnAboutRenderPhaseUpdatesInDEV(fiber);\n var root = markUpdateTimeFromFiberToRoot(fiber, expirationTime);\n\n if (root === null) {\n warnAboutUpdateOnUnmountedFiberInDEV(fiber);\n return;\n }\n\n checkForInterruption(fiber, expirationTime);\n recordScheduleUpdate(); // TODO: computeExpirationForFiber also reads the priority. Pass the\n // priority as an argument to that function and this one.\n\n var priorityLevel = getCurrentPriorityLevel();\n\n if (expirationTime === Sync) {\n if ( // Check if we're inside unbatchedUpdates\n (executionContext & LegacyUnbatchedContext) !== NoContext && // Check if we're not already rendering\n (executionContext & (RenderContext | CommitContext)) === NoContext) {\n // Register pending interactions on the root to avoid losing traced interaction data.\n schedulePendingInteractions(root, expirationTime); // This is a legacy edge case. The initial mount of a ReactDOM.render-ed\n // root inside of batchedUpdates should be synchronous, but layout updates\n // should be deferred until the end of the batch.\n\n performSyncWorkOnRoot(root);\n } else {\n ensureRootIsScheduled(root);\n schedulePendingInteractions(root, expirationTime);\n\n if (executionContext === NoContext) {\n // Flush the synchronous work now, unless we're already working or inside\n // a batch. This is intentionally inside scheduleUpdateOnFiber instead of\n // scheduleCallbackForFiber to preserve the ability to schedule a callback\n // without immediately flushing it. We only do this for user-initiated\n // updates, to preserve historical behavior of legacy mode.\n flushSyncCallbackQueue();\n }\n }\n } else {\n ensureRootIsScheduled(root);\n schedulePendingInteractions(root, expirationTime);\n }\n\n if ((executionContext & DiscreteEventContext) !== NoContext && ( // Only updates at user-blocking priority or greater are considered\n // discrete, even inside a discrete event.\n priorityLevel === UserBlockingPriority$1 || priorityLevel === ImmediatePriority)) {\n // This is the result of a discrete event. Track the lowest priority\n // discrete update per root so we can flush them early, if needed.\n if (rootsWithPendingDiscreteUpdates === null) {\n rootsWithPendingDiscreteUpdates = new Map([[root, expirationTime]]);\n } else {\n var lastDiscreteTime = rootsWithPendingDiscreteUpdates.get(root);\n\n if (lastDiscreteTime === undefined || lastDiscreteTime > expirationTime) {\n rootsWithPendingDiscreteUpdates.set(root, expirationTime);\n }\n }\n }\n}\nvar scheduleWork = scheduleUpdateOnFiber; // This is split into a separate function so we can mark a fiber with pending\n// work without treating it as a typical update that originates from an event;\n// e.g. retrying a Suspense boundary isn't an update, but it does schedule work\n// on a fiber.\n\nfunction markUpdateTimeFromFiberToRoot(fiber, expirationTime) {\n // Update the source fiber's expiration time\n if (fiber.expirationTime < expirationTime) {\n fiber.expirationTime = expirationTime;\n }\n\n var alternate = fiber.alternate;\n\n if (alternate !== null && alternate.expirationTime < expirationTime) {\n alternate.expirationTime = expirationTime;\n } // Walk the parent path to the root and update the child expiration time.\n\n\n var node = fiber.return;\n var root = null;\n\n if (node === null && fiber.tag === HostRoot) {\n root = fiber.stateNode;\n } else {\n while (node !== null) {\n alternate = node.alternate;\n\n if (node.childExpirationTime < expirationTime) {\n node.childExpirationTime = expirationTime;\n\n if (alternate !== null && alternate.childExpirationTime < expirationTime) {\n alternate.childExpirationTime = expirationTime;\n }\n } else if (alternate !== null && alternate.childExpirationTime < expirationTime) {\n alternate.childExpirationTime = expirationTime;\n }\n\n if (node.return === null && node.tag === HostRoot) {\n root = node.stateNode;\n break;\n }\n\n node = node.return;\n }\n }\n\n if (root !== null) {\n if (workInProgressRoot === root) {\n // Received an update to a tree that's in the middle of rendering. Mark\n // that's unprocessed work on this root.\n markUnprocessedUpdateTime(expirationTime);\n\n if (workInProgressRootExitStatus === RootSuspendedWithDelay) {\n // The root already suspended with a delay, which means this render\n // definitely won't finish. Since we have a new update, let's mark it as\n // suspended now, right before marking the incoming update. This has the\n // effect of interrupting the current render and switching to the update.\n // TODO: This happens to work when receiving an update during the render\n // phase, because of the trick inside computeExpirationForFiber to\n // subtract 1 from `renderExpirationTime` to move it into a\n // separate bucket. But we should probably model it with an exception,\n // using the same mechanism we use to force hydration of a subtree.\n // TODO: This does not account for low pri updates that were already\n // scheduled before the root started rendering. Need to track the next\n // pending expiration time (perhaps by backtracking the return path) and\n // then trigger a restart in the `renderDidSuspendDelayIfPossible` path.\n markRootSuspendedAtTime(root, renderExpirationTime$1);\n }\n } // Mark that the root has a pending update.\n\n\n markRootUpdatedAtTime(root, expirationTime);\n }\n\n return root;\n}\n\nfunction getNextRootExpirationTimeToWorkOn(root) {\n // Determines the next expiration time that the root should render, taking\n // into account levels that may be suspended, or levels that may have\n // received a ping.\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n return lastExpiredTime;\n } // \"Pending\" refers to any update that hasn't committed yet, including if it\n // suspended. The \"suspended\" range is therefore a subset.\n\n\n var firstPendingTime = root.firstPendingTime;\n\n if (!isRootSuspendedAtTime(root, firstPendingTime)) {\n // The highest priority pending time is not suspended. Let's work on that.\n return firstPendingTime;\n } // If the first pending time is suspended, check if there's a lower priority\n // pending level that we know about. Or check if we received a ping. Work\n // on whichever is higher priority.\n\n\n var lastPingedTime = root.lastPingedTime;\n var nextKnownPendingLevel = root.nextKnownPendingLevel;\n var nextLevel = lastPingedTime > nextKnownPendingLevel ? lastPingedTime : nextKnownPendingLevel;\n\n if ( nextLevel <= Idle && firstPendingTime !== nextLevel) {\n // Don't work on Idle/Never priority unless everything else is committed.\n return NoWork;\n }\n\n return nextLevel;\n} // Use this function to schedule a task for a root. There's only one task per\n// root; if a task was already scheduled, we'll check to make sure the\n// expiration time of the existing task is the same as the expiration time of\n// the next level that the root has work on. This function is called on every\n// update, and right before exiting a task.\n\n\nfunction ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that\n// goes through Scheduler.\n\n\nfunction performConcurrentWorkOnRoot(root, didTimeout) {\n // Since we know we're in a React event, we can clear the current\n // event time. The next update will compute a new event time.\n currentEventTime = NoWork;\n\n if (didTimeout) {\n // The render task took too long to complete. Mark the current time as\n // expired to synchronously render all expired work in a single batch.\n var currentTime = requestCurrentTimeForUpdate();\n markRootExpiredAtTime(root, currentTime); // This will schedule a synchronous callback.\n\n ensureRootIsScheduled(root);\n return null;\n } // Determine the next expiration time to work on, using the fields stored\n // on the root.\n\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n\n if (expirationTime !== NoWork) {\n var originalCallbackNode = root.callbackNode;\n\n if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n {\n throw Error( \"Should not already be working.\" );\n }\n }\n\n flushPassiveEffects(); // If the root or expiration time have changed, throw out the existing stack\n // and prepare a fresh one. Otherwise we'll continue where we left off.\n\n if (root !== workInProgressRoot || expirationTime !== renderExpirationTime$1) {\n prepareFreshStack(root, expirationTime);\n startWorkOnPendingInteractions(root, expirationTime);\n } // If we have a work-in-progress fiber, it means there's still work to do\n // in this root.\n\n\n if (workInProgress !== null) {\n var prevExecutionContext = executionContext;\n executionContext |= RenderContext;\n var prevDispatcher = pushDispatcher();\n var prevInteractions = pushInteractions(root);\n startWorkLoopTimer(workInProgress);\n\n do {\n try {\n workLoopConcurrent();\n break;\n } catch (thrownValue) {\n handleError(root, thrownValue);\n }\n } while (true);\n\n resetContextDependencies();\n executionContext = prevExecutionContext;\n popDispatcher(prevDispatcher);\n\n {\n popInteractions(prevInteractions);\n }\n\n if (workInProgressRootExitStatus === RootFatalErrored) {\n var fatalError = workInProgressRootFatalError;\n stopInterruptedWorkLoopTimer();\n prepareFreshStack(root, expirationTime);\n markRootSuspendedAtTime(root, expirationTime);\n ensureRootIsScheduled(root);\n throw fatalError;\n }\n\n if (workInProgress !== null) {\n // There's still work left over. Exit without committing.\n stopInterruptedWorkLoopTimer();\n } else {\n // We now have a consistent tree. The next step is either to commit it,\n // or, if something suspended, wait to commit it after a timeout.\n stopFinishedWorkLoopTimer();\n var finishedWork = root.finishedWork = root.current.alternate;\n root.finishedExpirationTime = expirationTime;\n finishConcurrentRender(root, finishedWork, workInProgressRootExitStatus, expirationTime);\n }\n\n ensureRootIsScheduled(root);\n\n if (root.callbackNode === originalCallbackNode) {\n // The task node scheduled for this root is the same one that's\n // currently executed. Need to return a continuation.\n return performConcurrentWorkOnRoot.bind(null, root);\n }\n }\n }\n\n return null;\n}\n\nfunction finishConcurrentRender(root, finishedWork, exitStatus, expirationTime) {\n // Set this to null to indicate there's no in-progress render.\n workInProgressRoot = null;\n\n switch (exitStatus) {\n case RootIncomplete:\n case RootFatalErrored:\n {\n {\n {\n throw Error( \"Root did not complete. This is a bug in React.\" );\n }\n }\n }\n // Flow knows about invariant, so it complains if I add a break\n // statement, but eslint doesn't know about invariant, so it complains\n // if I do. eslint-disable-next-line no-fallthrough\n\n case RootErrored:\n {\n // If this was an async render, the error may have happened due to\n // a mutation in a concurrent event. Try rendering one more time,\n // synchronously, to see if the error goes away. If there are\n // lower priority updates, let's include those, too, in case they\n // fix the inconsistency. Render at Idle to include all updates.\n // If it was Idle or Never or some not-yet-invented time, render\n // at that time.\n markRootExpiredAtTime(root, expirationTime > Idle ? Idle : expirationTime); // We assume that this second render pass will be synchronous\n // and therefore not hit this path again.\n\n break;\n }\n\n case RootSuspended:\n {\n markRootSuspendedAtTime(root, expirationTime);\n var lastSuspendedTime = root.lastSuspendedTime;\n\n if (expirationTime === lastSuspendedTime) {\n root.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork);\n } // We have an acceptable loading state. We need to figure out if we\n // should immediately commit it or wait a bit.\n // If we have processed new updates during this render, we may now\n // have a new loading state ready. We want to ensure that we commit\n // that as soon as possible.\n\n\n var hasNotProcessedNewUpdates = workInProgressRootLatestProcessedExpirationTime === Sync;\n\n if (hasNotProcessedNewUpdates && // do not delay if we're inside an act() scope\n !( IsThisRendererActing.current)) {\n // If we have not processed any new updates during this pass, then\n // this is either a retry of an existing fallback state or a\n // hidden tree. Hidden trees shouldn't be batched with other work\n // and after that's fixed it can only be a retry. We're going to\n // throttle committing retries so that we don't show too many\n // loading states too quickly.\n var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now(); // Don't bother with a very short suspense time.\n\n if (msUntilTimeout > 10) {\n if (workInProgressRootHasPendingPing) {\n var lastPingedTime = root.lastPingedTime;\n\n if (lastPingedTime === NoWork || lastPingedTime >= expirationTime) {\n // This render was pinged but we didn't get to restart\n // earlier so try restarting now instead.\n root.lastPingedTime = expirationTime;\n prepareFreshStack(root, expirationTime);\n break;\n }\n }\n\n var nextTime = getNextRootExpirationTimeToWorkOn(root);\n\n if (nextTime !== NoWork && nextTime !== expirationTime) {\n // There's additional work on this root.\n break;\n }\n\n if (lastSuspendedTime !== NoWork && lastSuspendedTime !== expirationTime) {\n // We should prefer to render the fallback of at the last\n // suspended level. Ping the last suspended level to try\n // rendering it again.\n root.lastPingedTime = lastSuspendedTime;\n break;\n } // The render is suspended, it hasn't timed out, and there's no\n // lower priority work to do. Instead of committing the fallback\n // immediately, wait for more data to arrive.\n\n\n root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), msUntilTimeout);\n break;\n }\n } // The work expired. Commit immediately.\n\n\n commitRoot(root);\n break;\n }\n\n case RootSuspendedWithDelay:\n {\n markRootSuspendedAtTime(root, expirationTime);\n var _lastSuspendedTime = root.lastSuspendedTime;\n\n if (expirationTime === _lastSuspendedTime) {\n root.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork);\n }\n\n if ( // do not delay if we're inside an act() scope\n !( IsThisRendererActing.current)) {\n // We're suspended in a state that should be avoided. We'll try to\n // avoid committing it for as long as the timeouts let us.\n if (workInProgressRootHasPendingPing) {\n var _lastPingedTime = root.lastPingedTime;\n\n if (_lastPingedTime === NoWork || _lastPingedTime >= expirationTime) {\n // This render was pinged but we didn't get to restart earlier\n // so try restarting now instead.\n root.lastPingedTime = expirationTime;\n prepareFreshStack(root, expirationTime);\n break;\n }\n }\n\n var _nextTime = getNextRootExpirationTimeToWorkOn(root);\n\n if (_nextTime !== NoWork && _nextTime !== expirationTime) {\n // There's additional work on this root.\n break;\n }\n\n if (_lastSuspendedTime !== NoWork && _lastSuspendedTime !== expirationTime) {\n // We should prefer to render the fallback of at the last\n // suspended level. Ping the last suspended level to try\n // rendering it again.\n root.lastPingedTime = _lastSuspendedTime;\n break;\n }\n\n var _msUntilTimeout;\n\n if (workInProgressRootLatestSuspenseTimeout !== Sync) {\n // We have processed a suspense config whose expiration time we\n // can use as the timeout.\n _msUntilTimeout = expirationTimeToMs(workInProgressRootLatestSuspenseTimeout) - now();\n } else if (workInProgressRootLatestProcessedExpirationTime === Sync) {\n // This should never normally happen because only new updates\n // cause delayed states, so we should have processed something.\n // However, this could also happen in an offscreen tree.\n _msUntilTimeout = 0;\n } else {\n // If we don't have a suspense config, we're going to use a\n // heuristic to determine how long we can suspend.\n var eventTimeMs = inferTimeFromExpirationTime(workInProgressRootLatestProcessedExpirationTime);\n var currentTimeMs = now();\n var timeUntilExpirationMs = expirationTimeToMs(expirationTime) - currentTimeMs;\n var timeElapsed = currentTimeMs - eventTimeMs;\n\n if (timeElapsed < 0) {\n // We get this wrong some time since we estimate the time.\n timeElapsed = 0;\n }\n\n _msUntilTimeout = jnd(timeElapsed) - timeElapsed; // Clamp the timeout to the expiration time. TODO: Once the\n // event time is exact instead of inferred from expiration time\n // we don't need this.\n\n if (timeUntilExpirationMs < _msUntilTimeout) {\n _msUntilTimeout = timeUntilExpirationMs;\n }\n } // Don't bother with a very short suspense time.\n\n\n if (_msUntilTimeout > 10) {\n // The render is suspended, it hasn't timed out, and there's no\n // lower priority work to do. Instead of committing the fallback\n // immediately, wait for more data to arrive.\n root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout);\n break;\n }\n } // The work expired. Commit immediately.\n\n\n commitRoot(root);\n break;\n }\n\n case RootCompleted:\n {\n // The work completed. Ready to commit.\n if ( // do not delay if we're inside an act() scope\n !( IsThisRendererActing.current) && workInProgressRootLatestProcessedExpirationTime !== Sync && workInProgressRootCanSuspendUsingConfig !== null) {\n // If we have exceeded the minimum loading delay, which probably\n // means we have shown a spinner already, we might have to suspend\n // a bit longer to ensure that the spinner is shown for\n // enough time.\n var _msUntilTimeout2 = computeMsUntilSuspenseLoadingDelay(workInProgressRootLatestProcessedExpirationTime, expirationTime, workInProgressRootCanSuspendUsingConfig);\n\n if (_msUntilTimeout2 > 10) {\n markRootSuspendedAtTime(root, expirationTime);\n root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout2);\n break;\n }\n }\n\n commitRoot(root);\n break;\n }\n\n default:\n {\n {\n {\n throw Error( \"Unknown root exit status.\" );\n }\n }\n }\n }\n} // This is the entry point for synchronous tasks that don't go\n// through Scheduler\n\n\nfunction performSyncWorkOnRoot(root) {\n // Check if there's expired work on this root. Otherwise, render at Sync.\n var lastExpiredTime = root.lastExpiredTime;\n var expirationTime = lastExpiredTime !== NoWork ? lastExpiredTime : Sync;\n\n if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n {\n throw Error( \"Should not already be working.\" );\n }\n }\n\n flushPassiveEffects(); // If the root or expiration time have changed, throw out the existing stack\n // and prepare a fresh one. Otherwise we'll continue where we left off.\n\n if (root !== workInProgressRoot || expirationTime !== renderExpirationTime$1) {\n prepareFreshStack(root, expirationTime);\n startWorkOnPendingInteractions(root, expirationTime);\n } // If we have a work-in-progress fiber, it means there's still work to do\n // in this root.\n\n\n if (workInProgress !== null) {\n var prevExecutionContext = executionContext;\n executionContext |= RenderContext;\n var prevDispatcher = pushDispatcher();\n var prevInteractions = pushInteractions(root);\n startWorkLoopTimer(workInProgress);\n\n do {\n try {\n workLoopSync();\n break;\n } catch (thrownValue) {\n handleError(root, thrownValue);\n }\n } while (true);\n\n resetContextDependencies();\n executionContext = prevExecutionContext;\n popDispatcher(prevDispatcher);\n\n {\n popInteractions(prevInteractions);\n }\n\n if (workInProgressRootExitStatus === RootFatalErrored) {\n var fatalError = workInProgressRootFatalError;\n stopInterruptedWorkLoopTimer();\n prepareFreshStack(root, expirationTime);\n markRootSuspendedAtTime(root, expirationTime);\n ensureRootIsScheduled(root);\n throw fatalError;\n }\n\n if (workInProgress !== null) {\n // This is a sync render, so we should have finished the whole tree.\n {\n {\n throw Error( \"Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n } else {\n // We now have a consistent tree. Because this is a sync render, we\n // will commit it even if something suspended.\n stopFinishedWorkLoopTimer();\n root.finishedWork = root.current.alternate;\n root.finishedExpirationTime = expirationTime;\n finishSyncRender(root);\n } // Before exiting, make sure there's a callback scheduled for the next\n // pending level.\n\n\n ensureRootIsScheduled(root);\n }\n\n return null;\n}\n\nfunction finishSyncRender(root) {\n // Set this to null to indicate there's no in-progress render.\n workInProgressRoot = null;\n commitRoot(root);\n}\nfunction flushDiscreteUpdates() {\n // TODO: Should be able to flush inside batchedUpdates, but not inside `act`.\n // However, `act` uses `batchedUpdates`, so there's no way to distinguish\n // those two cases. Need to fix this before exposing flushDiscreteUpdates\n // as a public API.\n if ((executionContext & (BatchedContext | RenderContext | CommitContext)) !== NoContext) {\n {\n if ((executionContext & RenderContext) !== NoContext) {\n error('unstable_flushDiscreteUpdates: Cannot flush updates when React is ' + 'already rendering.');\n }\n } // We're already rendering, so we can't synchronously flush pending work.\n // This is probably a nested event dispatch triggered by a lifecycle/effect,\n // like `el.focus()`. Exit.\n\n\n return;\n }\n\n flushPendingDiscreteUpdates(); // If the discrete updates scheduled passive effects, flush them now so that\n // they fire before the next serial event.\n\n flushPassiveEffects();\n}\nfunction syncUpdates(fn, a, b, c) {\n return runWithPriority$1(ImmediatePriority, fn.bind(null, a, b, c));\n}\n\nfunction flushPendingDiscreteUpdates() {\n if (rootsWithPendingDiscreteUpdates !== null) {\n // For each root with pending discrete updates, schedule a callback to\n // immediately flush them.\n var roots = rootsWithPendingDiscreteUpdates;\n rootsWithPendingDiscreteUpdates = null;\n roots.forEach(function (expirationTime, root) {\n markRootExpiredAtTime(root, expirationTime);\n ensureRootIsScheduled(root);\n }); // Now flush the immediate queue.\n\n flushSyncCallbackQueue();\n }\n}\n\nfunction batchedUpdates$1(fn, a) {\n var prevExecutionContext = executionContext;\n executionContext |= BatchedContext;\n\n try {\n return fn(a);\n } finally {\n executionContext = prevExecutionContext;\n\n if (executionContext === NoContext) {\n // Flush the immediate callbacks that were scheduled during this batch\n flushSyncCallbackQueue();\n }\n }\n}\nfunction batchedEventUpdates$1(fn, a) {\n var prevExecutionContext = executionContext;\n executionContext |= EventContext;\n\n try {\n return fn(a);\n } finally {\n executionContext = prevExecutionContext;\n\n if (executionContext === NoContext) {\n // Flush the immediate callbacks that were scheduled during this batch\n flushSyncCallbackQueue();\n }\n }\n}\nfunction discreteUpdates$1(fn, a, b, c, d) {\n var prevExecutionContext = executionContext;\n executionContext |= DiscreteEventContext;\n\n try {\n // Should this\n return runWithPriority$1(UserBlockingPriority$1, fn.bind(null, a, b, c, d));\n } finally {\n executionContext = prevExecutionContext;\n\n if (executionContext === NoContext) {\n // Flush the immediate callbacks that were scheduled during this batch\n flushSyncCallbackQueue();\n }\n }\n}\nfunction unbatchedUpdates(fn, a) {\n var prevExecutionContext = executionContext;\n executionContext &= ~BatchedContext;\n executionContext |= LegacyUnbatchedContext;\n\n try {\n return fn(a);\n } finally {\n executionContext = prevExecutionContext;\n\n if (executionContext === NoContext) {\n // Flush the immediate callbacks that were scheduled during this batch\n flushSyncCallbackQueue();\n }\n }\n}\nfunction flushSync(fn, a) {\n if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {\n {\n {\n throw Error( \"flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.\" );\n }\n }\n }\n\n var prevExecutionContext = executionContext;\n executionContext |= BatchedContext;\n\n try {\n return runWithPriority$1(ImmediatePriority, fn.bind(null, a));\n } finally {\n executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch.\n // Note that this will happen even if batchedUpdates is higher up\n // the stack.\n\n flushSyncCallbackQueue();\n }\n}\n\nfunction prepareFreshStack(root, expirationTime) {\n root.finishedWork = null;\n root.finishedExpirationTime = NoWork;\n var timeoutHandle = root.timeoutHandle;\n\n if (timeoutHandle !== noTimeout) {\n // The root previous suspended and scheduled a timeout to commit a fallback\n // state. Now that we have additional work, cancel the timeout.\n root.timeoutHandle = noTimeout; // $FlowFixMe Complains noTimeout is not a TimeoutID, despite the check above\n\n cancelTimeout(timeoutHandle);\n }\n\n if (workInProgress !== null) {\n var interruptedWork = workInProgress.return;\n\n while (interruptedWork !== null) {\n unwindInterruptedWork(interruptedWork);\n interruptedWork = interruptedWork.return;\n }\n }\n\n workInProgressRoot = root;\n workInProgress = createWorkInProgress(root.current, null);\n renderExpirationTime$1 = expirationTime;\n workInProgressRootExitStatus = RootIncomplete;\n workInProgressRootFatalError = null;\n workInProgressRootLatestProcessedExpirationTime = Sync;\n workInProgressRootLatestSuspenseTimeout = Sync;\n workInProgressRootCanSuspendUsingConfig = null;\n workInProgressRootNextUnprocessedUpdateTime = NoWork;\n workInProgressRootHasPendingPing = false;\n\n {\n spawnedWorkDuringRender = null;\n }\n\n {\n ReactStrictModeWarnings.discardPendingWarnings();\n }\n}\n\nfunction handleError(root, thrownValue) {\n do {\n try {\n // Reset module-level state that was set during the render phase.\n resetContextDependencies();\n resetHooksAfterThrow();\n resetCurrentFiber();\n\n if (workInProgress === null || workInProgress.return === null) {\n // Expected to be working on a non-root fiber. This is a fatal error\n // because there's no ancestor that can handle it; the root is\n // supposed to capture all errors that weren't caught by an error\n // boundary.\n workInProgressRootExitStatus = RootFatalErrored;\n workInProgressRootFatalError = thrownValue; // Set `workInProgress` to null. This represents advancing to the next\n // sibling, or the parent if there are no siblings. But since the root\n // has no siblings nor a parent, we set it to null. Usually this is\n // handled by `completeUnitOfWork` or `unwindWork`, but since we're\n // interntionally not calling those, we need set it here.\n // TODO: Consider calling `unwindWork` to pop the contexts.\n\n workInProgress = null;\n return null;\n }\n\n if (enableProfilerTimer && workInProgress.mode & ProfileMode) {\n // Record the time spent rendering before an error was thrown. This\n // avoids inaccurate Profiler durations in the case of a\n // suspended render.\n stopProfilerTimerIfRunningAndRecordDelta(workInProgress, true);\n }\n\n throwException(root, workInProgress.return, workInProgress, thrownValue, renderExpirationTime$1);\n workInProgress = completeUnitOfWork(workInProgress);\n } catch (yetAnotherThrownValue) {\n // Something in the return path also threw.\n thrownValue = yetAnotherThrownValue;\n continue;\n } // Return to the normal work loop.\n\n\n return;\n } while (true);\n}\n\nfunction pushDispatcher(root) {\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;\n\n if (prevDispatcher === null) {\n // The React isomorphic package does not include a default dispatcher.\n // Instead the first renderer will lazily attach one, in order to give\n // nicer error messages.\n return ContextOnlyDispatcher;\n } else {\n return prevDispatcher;\n }\n}\n\nfunction popDispatcher(prevDispatcher) {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n}\n\nfunction pushInteractions(root) {\n {\n var prevInteractions = tracing.__interactionsRef.current;\n tracing.__interactionsRef.current = root.memoizedInteractions;\n return prevInteractions;\n }\n}\n\nfunction popInteractions(prevInteractions) {\n {\n tracing.__interactionsRef.current = prevInteractions;\n }\n}\n\nfunction markCommitTimeOfFallback() {\n globalMostRecentFallbackTime = now();\n}\nfunction markRenderEventTimeAndConfig(expirationTime, suspenseConfig) {\n if (expirationTime < workInProgressRootLatestProcessedExpirationTime && expirationTime > Idle) {\n workInProgressRootLatestProcessedExpirationTime = expirationTime;\n }\n\n if (suspenseConfig !== null) {\n if (expirationTime < workInProgressRootLatestSuspenseTimeout && expirationTime > Idle) {\n workInProgressRootLatestSuspenseTimeout = expirationTime; // Most of the time we only have one config and getting wrong is not bad.\n\n workInProgressRootCanSuspendUsingConfig = suspenseConfig;\n }\n }\n}\nfunction markUnprocessedUpdateTime(expirationTime) {\n if (expirationTime > workInProgressRootNextUnprocessedUpdateTime) {\n workInProgressRootNextUnprocessedUpdateTime = expirationTime;\n }\n}\nfunction renderDidSuspend() {\n if (workInProgressRootExitStatus === RootIncomplete) {\n workInProgressRootExitStatus = RootSuspended;\n }\n}\nfunction renderDidSuspendDelayIfPossible() {\n if (workInProgressRootExitStatus === RootIncomplete || workInProgressRootExitStatus === RootSuspended) {\n workInProgressRootExitStatus = RootSuspendedWithDelay;\n } // Check if there's a lower priority update somewhere else in the tree.\n\n\n if (workInProgressRootNextUnprocessedUpdateTime !== NoWork && workInProgressRoot !== null) {\n // Mark the current render as suspended, and then mark that there's a\n // pending update.\n // TODO: This should immediately interrupt the current render, instead\n // of waiting until the next time we yield.\n markRootSuspendedAtTime(workInProgressRoot, renderExpirationTime$1);\n markRootUpdatedAtTime(workInProgressRoot, workInProgressRootNextUnprocessedUpdateTime);\n }\n}\nfunction renderDidError() {\n if (workInProgressRootExitStatus !== RootCompleted) {\n workInProgressRootExitStatus = RootErrored;\n }\n} // Called during render to determine if anything has suspended.\n// Returns false if we're not sure.\n\nfunction renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}\n\nfunction inferTimeFromExpirationTime(expirationTime) {\n // We don't know exactly when the update was scheduled, but we can infer an\n // approximate start time from the expiration time.\n var earliestExpirationTimeMs = expirationTimeToMs(expirationTime);\n return earliestExpirationTimeMs - LOW_PRIORITY_EXPIRATION;\n}\n\nfunction inferTimeFromExpirationTimeWithSuspenseConfig(expirationTime, suspenseConfig) {\n // We don't know exactly when the update was scheduled, but we can infer an\n // approximate start time from the expiration time by subtracting the timeout\n // that was added to the event time.\n var earliestExpirationTimeMs = expirationTimeToMs(expirationTime);\n return earliestExpirationTimeMs - (suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION);\n} // The work loop is an extremely hot path. Tell Closure not to inline it.\n\n/** @noinline */\n\n\nfunction workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}\n/** @noinline */\n\n\nfunction workLoopConcurrent() {\n // Perform work until Scheduler asks us to yield\n while (workInProgress !== null && !shouldYield()) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}\n\nfunction performUnitOfWork(unitOfWork) {\n // The current, flushed, state of this fiber is the alternate. Ideally\n // nothing should rely on this, but relying on it here means that we don't\n // need an additional field on the work in progress.\n var current = unitOfWork.alternate;\n startWorkTimer(unitOfWork);\n setCurrentFiber(unitOfWork);\n var next;\n\n if ( (unitOfWork.mode & ProfileMode) !== NoMode) {\n startProfilerTimer(unitOfWork);\n next = beginWork$1(current, unitOfWork, renderExpirationTime$1);\n stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);\n } else {\n next = beginWork$1(current, unitOfWork, renderExpirationTime$1);\n }\n\n resetCurrentFiber();\n unitOfWork.memoizedProps = unitOfWork.pendingProps;\n\n if (next === null) {\n // If this doesn't spawn new work, complete the current work.\n next = completeUnitOfWork(unitOfWork);\n }\n\n ReactCurrentOwner$2.current = null;\n return next;\n}\n\nfunction completeUnitOfWork(unitOfWork) {\n // Attempt to complete the current unit of work, then move to the next\n // sibling. If there are no more siblings, return to the parent fiber.\n workInProgress = unitOfWork;\n\n do {\n // The current, flushed, state of this fiber is the alternate. Ideally\n // nothing should rely on this, but relying on it here means that we don't\n // need an additional field on the work in progress.\n var current = workInProgress.alternate;\n var returnFiber = workInProgress.return; // Check if the work completed or if something threw.\n\n if ((workInProgress.effectTag & Incomplete) === NoEffect) {\n setCurrentFiber(workInProgress);\n var next = void 0;\n\n if ( (workInProgress.mode & ProfileMode) === NoMode) {\n next = completeWork(current, workInProgress, renderExpirationTime$1);\n } else {\n startProfilerTimer(workInProgress);\n next = completeWork(current, workInProgress, renderExpirationTime$1); // Update render duration assuming we didn't error.\n\n stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false);\n }\n\n stopWorkTimer(workInProgress);\n resetCurrentFiber();\n resetChildExpirationTime(workInProgress);\n\n if (next !== null) {\n // Completing this fiber spawned new work. Work on that next.\n return next;\n }\n\n if (returnFiber !== null && // Do not append effects to parents if a sibling failed to complete\n (returnFiber.effectTag & Incomplete) === NoEffect) {\n // Append all the effects of the subtree and this fiber onto the effect\n // list of the parent. The completion order of the children affects the\n // side-effect order.\n if (returnFiber.firstEffect === null) {\n returnFiber.firstEffect = workInProgress.firstEffect;\n }\n\n if (workInProgress.lastEffect !== null) {\n if (returnFiber.lastEffect !== null) {\n returnFiber.lastEffect.nextEffect = workInProgress.firstEffect;\n }\n\n returnFiber.lastEffect = workInProgress.lastEffect;\n } // If this fiber had side-effects, we append it AFTER the children's\n // side-effects. We can perform certain side-effects earlier if needed,\n // by doing multiple passes over the effect list. We don't want to\n // schedule our own side-effect on our own list because if end up\n // reusing children we'll schedule this effect onto itself since we're\n // at the end.\n\n\n var effectTag = workInProgress.effectTag; // Skip both NoWork and PerformedWork tags when creating the effect\n // list. PerformedWork effect is read by React DevTools but shouldn't be\n // committed.\n\n if (effectTag > PerformedWork) {\n if (returnFiber.lastEffect !== null) {\n returnFiber.lastEffect.nextEffect = workInProgress;\n } else {\n returnFiber.firstEffect = workInProgress;\n }\n\n returnFiber.lastEffect = workInProgress;\n }\n }\n } else {\n // This fiber did not complete because something threw. Pop values off\n // the stack without entering the complete phase. If this is a boundary,\n // capture values if possible.\n var _next = unwindWork(workInProgress); // Because this fiber did not complete, don't reset its expiration time.\n\n\n if ( (workInProgress.mode & ProfileMode) !== NoMode) {\n // Record the render duration for the fiber that errored.\n stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false); // Include the time spent working on failed children before continuing.\n\n var actualDuration = workInProgress.actualDuration;\n var child = workInProgress.child;\n\n while (child !== null) {\n actualDuration += child.actualDuration;\n child = child.sibling;\n }\n\n workInProgress.actualDuration = actualDuration;\n }\n\n if (_next !== null) {\n // If completing this work spawned new work, do that next. We'll come\n // back here again.\n // Since we're restarting, remove anything that is not a host effect\n // from the effect tag.\n // TODO: The name stopFailedWorkTimer is misleading because Suspense\n // also captures and restarts.\n stopFailedWorkTimer(workInProgress);\n _next.effectTag &= HostEffectMask;\n return _next;\n }\n\n stopWorkTimer(workInProgress);\n\n if (returnFiber !== null) {\n // Mark the parent fiber as incomplete and clear its effect list.\n returnFiber.firstEffect = returnFiber.lastEffect = null;\n returnFiber.effectTag |= Incomplete;\n }\n }\n\n var siblingFiber = workInProgress.sibling;\n\n if (siblingFiber !== null) {\n // If there is more work to do in this returnFiber, do that next.\n return siblingFiber;\n } // Otherwise, return to the parent\n\n\n workInProgress = returnFiber;\n } while (workInProgress !== null); // We've reached the root.\n\n\n if (workInProgressRootExitStatus === RootIncomplete) {\n workInProgressRootExitStatus = RootCompleted;\n }\n\n return null;\n}\n\nfunction getRemainingExpirationTime(fiber) {\n var updateExpirationTime = fiber.expirationTime;\n var childExpirationTime = fiber.childExpirationTime;\n return updateExpirationTime > childExpirationTime ? updateExpirationTime : childExpirationTime;\n}\n\nfunction resetChildExpirationTime(completedWork) {\n if (renderExpirationTime$1 !== Never && completedWork.childExpirationTime === Never) {\n // The children of this component are hidden. Don't bubble their\n // expiration times.\n return;\n }\n\n var newChildExpirationTime = NoWork; // Bubble up the earliest expiration time.\n\n if ( (completedWork.mode & ProfileMode) !== NoMode) {\n // In profiling mode, resetChildExpirationTime is also used to reset\n // profiler durations.\n var actualDuration = completedWork.actualDuration;\n var treeBaseDuration = completedWork.selfBaseDuration; // When a fiber is cloned, its actualDuration is reset to 0. This value will\n // only be updated if work is done on the fiber (i.e. it doesn't bailout).\n // When work is done, it should bubble to the parent's actualDuration. If\n // the fiber has not been cloned though, (meaning no work was done), then\n // this value will reflect the amount of time spent working on a previous\n // render. In that case it should not bubble. We determine whether it was\n // cloned by comparing the child pointer.\n\n var shouldBubbleActualDurations = completedWork.alternate === null || completedWork.child !== completedWork.alternate.child;\n var child = completedWork.child;\n\n while (child !== null) {\n var childUpdateExpirationTime = child.expirationTime;\n var childChildExpirationTime = child.childExpirationTime;\n\n if (childUpdateExpirationTime > newChildExpirationTime) {\n newChildExpirationTime = childUpdateExpirationTime;\n }\n\n if (childChildExpirationTime > newChildExpirationTime) {\n newChildExpirationTime = childChildExpirationTime;\n }\n\n if (shouldBubbleActualDurations) {\n actualDuration += child.actualDuration;\n }\n\n treeBaseDuration += child.treeBaseDuration;\n child = child.sibling;\n }\n\n completedWork.actualDuration = actualDuration;\n completedWork.treeBaseDuration = treeBaseDuration;\n } else {\n var _child = completedWork.child;\n\n while (_child !== null) {\n var _childUpdateExpirationTime = _child.expirationTime;\n var _childChildExpirationTime = _child.childExpirationTime;\n\n if (_childUpdateExpirationTime > newChildExpirationTime) {\n newChildExpirationTime = _childUpdateExpirationTime;\n }\n\n if (_childChildExpirationTime > newChildExpirationTime) {\n newChildExpirationTime = _childChildExpirationTime;\n }\n\n _child = _child.sibling;\n }\n }\n\n completedWork.childExpirationTime = newChildExpirationTime;\n}\n\nfunction commitRoot(root) {\n var renderPriorityLevel = getCurrentPriorityLevel();\n runWithPriority$1(ImmediatePriority, commitRootImpl.bind(null, root, renderPriorityLevel));\n return null;\n}\n\nfunction commitRootImpl(root, renderPriorityLevel) {\n do {\n // `flushPassiveEffects` will call `flushSyncUpdateQueue` at the end, which\n // means `flushPassiveEffects` will sometimes result in additional\n // passive effects. So we need to keep flushing in a loop until there are\n // no more pending effects.\n // TODO: Might be better if `flushPassiveEffects` did not automatically\n // flush synchronous work at the end, to avoid factoring hazards like this.\n flushPassiveEffects();\n } while (rootWithPendingPassiveEffects !== null);\n\n flushRenderPhaseStrictModeWarningsInDEV();\n\n if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n {\n throw Error( \"Should not already be working.\" );\n }\n }\n\n var finishedWork = root.finishedWork;\n var expirationTime = root.finishedExpirationTime;\n\n if (finishedWork === null) {\n return null;\n }\n\n root.finishedWork = null;\n root.finishedExpirationTime = NoWork;\n\n if (!(finishedWork !== root.current)) {\n {\n throw Error( \"Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n } // commitRoot never returns a continuation; it always finishes synchronously.\n // So we can clear these now to allow a new callback to be scheduled.\n\n\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n root.nextKnownPendingLevel = NoWork;\n startCommitTimer(); // Update the first and last pending times on this root. The new first\n // pending time is whatever is left on the root fiber.\n\n var remainingExpirationTimeBeforeCommit = getRemainingExpirationTime(finishedWork);\n markRootFinishedAtTime(root, expirationTime, remainingExpirationTimeBeforeCommit);\n\n if (root === workInProgressRoot) {\n // We can reset these now that they are finished.\n workInProgressRoot = null;\n workInProgress = null;\n renderExpirationTime$1 = NoWork;\n } // This indicates that the last root we worked on is not the same one that\n // we're committing now. This most commonly happens when a suspended root\n // times out.\n // Get the list of effects.\n\n\n var firstEffect;\n\n if (finishedWork.effectTag > PerformedWork) {\n // A fiber's effect list consists only of its children, not itself. So if\n // the root has an effect, we need to add it to the end of the list. The\n // resulting list is the set that would belong to the root's parent, if it\n // had one; that is, all the effects in the tree including the root.\n if (finishedWork.lastEffect !== null) {\n finishedWork.lastEffect.nextEffect = finishedWork;\n firstEffect = finishedWork.firstEffect;\n } else {\n firstEffect = finishedWork;\n }\n } else {\n // There is no effect on the root.\n firstEffect = finishedWork.firstEffect;\n }\n\n if (firstEffect !== null) {\n var prevExecutionContext = executionContext;\n executionContext |= CommitContext;\n var prevInteractions = pushInteractions(root); // Reset this to null before calling lifecycles\n\n ReactCurrentOwner$2.current = null; // The commit phase is broken into several sub-phases. We do a separate pass\n // of the effect list for each phase: all mutation effects come before all\n // layout effects, and so on.\n // The first phase a \"before mutation\" phase. We use this phase to read the\n // state of the host tree right before we mutate it. This is where\n // getSnapshotBeforeUpdate is called.\n\n startCommitSnapshotEffectsTimer();\n prepareForCommit(root.containerInfo);\n nextEffect = firstEffect;\n\n do {\n {\n invokeGuardedCallback(null, commitBeforeMutationEffects, null);\n\n if (hasCaughtError()) {\n if (!(nextEffect !== null)) {\n {\n throw Error( \"Should be working on an effect.\" );\n }\n }\n\n var error = clearCaughtError();\n captureCommitPhaseError(nextEffect, error);\n nextEffect = nextEffect.nextEffect;\n }\n }\n } while (nextEffect !== null);\n\n stopCommitSnapshotEffectsTimer();\n\n {\n // Mark the current commit time to be shared by all Profilers in this\n // batch. This enables them to be grouped later.\n recordCommitTime();\n } // The next phase is the mutation phase, where we mutate the host tree.\n\n\n startCommitHostEffectsTimer();\n nextEffect = firstEffect;\n\n do {\n {\n invokeGuardedCallback(null, commitMutationEffects, null, root, renderPriorityLevel);\n\n if (hasCaughtError()) {\n if (!(nextEffect !== null)) {\n {\n throw Error( \"Should be working on an effect.\" );\n }\n }\n\n var _error = clearCaughtError();\n\n captureCommitPhaseError(nextEffect, _error);\n nextEffect = nextEffect.nextEffect;\n }\n }\n } while (nextEffect !== null);\n\n stopCommitHostEffectsTimer();\n resetAfterCommit(root.containerInfo); // The work-in-progress tree is now the current tree. This must come after\n // the mutation phase, so that the previous tree is still current during\n // componentWillUnmount, but before the layout phase, so that the finished\n // work is current during componentDidMount/Update.\n\n root.current = finishedWork; // The next phase is the layout phase, where we call effects that read\n // the host tree after it's been mutated. The idiomatic use case for this is\n // layout, but class component lifecycles also fire here for legacy reasons.\n\n startCommitLifeCyclesTimer();\n nextEffect = firstEffect;\n\n do {\n {\n invokeGuardedCallback(null, commitLayoutEffects, null, root, expirationTime);\n\n if (hasCaughtError()) {\n if (!(nextEffect !== null)) {\n {\n throw Error( \"Should be working on an effect.\" );\n }\n }\n\n var _error2 = clearCaughtError();\n\n captureCommitPhaseError(nextEffect, _error2);\n nextEffect = nextEffect.nextEffect;\n }\n }\n } while (nextEffect !== null);\n\n stopCommitLifeCyclesTimer();\n nextEffect = null; // Tell Scheduler to yield at the end of the frame, so the browser has an\n // opportunity to paint.\n\n requestPaint();\n\n {\n popInteractions(prevInteractions);\n }\n\n executionContext = prevExecutionContext;\n } else {\n // No effects.\n root.current = finishedWork; // Measure these anyway so the flamegraph explicitly shows that there were\n // no effects.\n // TODO: Maybe there's a better way to report this.\n\n startCommitSnapshotEffectsTimer();\n stopCommitSnapshotEffectsTimer();\n\n {\n recordCommitTime();\n }\n\n startCommitHostEffectsTimer();\n stopCommitHostEffectsTimer();\n startCommitLifeCyclesTimer();\n stopCommitLifeCyclesTimer();\n }\n\n stopCommitTimer();\n var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;\n\n if (rootDoesHavePassiveEffects) {\n // This commit has passive effects. Stash a reference to them. But don't\n // schedule a callback until after flushing layout work.\n rootDoesHavePassiveEffects = false;\n rootWithPendingPassiveEffects = root;\n pendingPassiveEffectsExpirationTime = expirationTime;\n pendingPassiveEffectsRenderPriority = renderPriorityLevel;\n } else {\n // We are done with the effect chain at this point so let's clear the\n // nextEffect pointers to assist with GC. If we have passive effects, we'll\n // clear this in flushPassiveEffects.\n nextEffect = firstEffect;\n\n while (nextEffect !== null) {\n var nextNextEffect = nextEffect.nextEffect;\n nextEffect.nextEffect = null;\n nextEffect = nextNextEffect;\n }\n } // Check if there's remaining work on this root\n\n\n var remainingExpirationTime = root.firstPendingTime;\n\n if (remainingExpirationTime !== NoWork) {\n {\n if (spawnedWorkDuringRender !== null) {\n var expirationTimes = spawnedWorkDuringRender;\n spawnedWorkDuringRender = null;\n\n for (var i = 0; i < expirationTimes.length; i++) {\n scheduleInteractions(root, expirationTimes[i], root.memoizedInteractions);\n }\n }\n\n schedulePendingInteractions(root, remainingExpirationTime);\n }\n } else {\n // If there's no remaining work, we can clear the set of already failed\n // error boundaries.\n legacyErrorBoundariesThatAlreadyFailed = null;\n }\n\n {\n if (!rootDidHavePassiveEffects) {\n // If there are no passive effects, then we can complete the pending interactions.\n // Otherwise, we'll wait until after the passive effects are flushed.\n // Wait to do this until after remaining work has been scheduled,\n // so that we don't prematurely signal complete for interactions when there's e.g. hidden work.\n finishPendingInteractions(root, expirationTime);\n }\n }\n\n if (remainingExpirationTime === Sync) {\n // Count the number of times the root synchronously re-renders without\n // finishing. If there are too many, it indicates an infinite update loop.\n if (root === rootWithNestedUpdates) {\n nestedUpdateCount++;\n } else {\n nestedUpdateCount = 0;\n rootWithNestedUpdates = root;\n }\n } else {\n nestedUpdateCount = 0;\n }\n\n onCommitRoot(finishedWork.stateNode, expirationTime); // Always call this before exiting `commitRoot`, to ensure that any\n // additional work on this root is scheduled.\n\n ensureRootIsScheduled(root);\n\n if (hasUncaughtError) {\n hasUncaughtError = false;\n var _error3 = firstUncaughtError;\n firstUncaughtError = null;\n throw _error3;\n }\n\n if ((executionContext & LegacyUnbatchedContext) !== NoContext) {\n // This is a legacy edge case. We just committed the initial mount of\n // a ReactDOM.render-ed root inside of batchedUpdates. The commit fired\n // synchronously, but layout updates should be deferred until the end\n // of the batch.\n return null;\n } // If layout work was scheduled, flush it now.\n\n\n flushSyncCallbackQueue();\n return null;\n}\n\nfunction commitBeforeMutationEffects() {\n while (nextEffect !== null) {\n var effectTag = nextEffect.effectTag;\n\n if ((effectTag & Snapshot) !== NoEffect) {\n setCurrentFiber(nextEffect);\n recordEffect();\n var current = nextEffect.alternate;\n commitBeforeMutationLifeCycles(current, nextEffect);\n resetCurrentFiber();\n }\n\n if ((effectTag & Passive) !== NoEffect) {\n // If there are passive effects, schedule a callback to flush at\n // the earliest opportunity.\n if (!rootDoesHavePassiveEffects) {\n rootDoesHavePassiveEffects = true;\n scheduleCallback(NormalPriority, function () {\n flushPassiveEffects();\n return null;\n });\n }\n }\n\n nextEffect = nextEffect.nextEffect;\n }\n}\n\nfunction commitMutationEffects(root, renderPriorityLevel) {\n // TODO: Should probably move the bulk of this function to commitWork.\n while (nextEffect !== null) {\n setCurrentFiber(nextEffect);\n var effectTag = nextEffect.effectTag;\n\n if (effectTag & ContentReset) {\n commitResetTextContent(nextEffect);\n }\n\n if (effectTag & Ref) {\n var current = nextEffect.alternate;\n\n if (current !== null) {\n commitDetachRef(current);\n }\n } // The following switch statement is only concerned about placement,\n // updates, and deletions. To avoid needing to add a case for every possible\n // bitmap value, we remove the secondary effects from the effect tag and\n // switch on that value.\n\n\n var primaryEffectTag = effectTag & (Placement | Update | Deletion | Hydrating);\n\n switch (primaryEffectTag) {\n case Placement:\n {\n commitPlacement(nextEffect); // Clear the \"placement\" from effect tag so that we know that this is\n // inserted, before any life-cycles like componentDidMount gets called.\n // TODO: findDOMNode doesn't rely on this any more but isMounted does\n // and isMounted is deprecated anyway so we should be able to kill this.\n\n nextEffect.effectTag &= ~Placement;\n break;\n }\n\n case PlacementAndUpdate:\n {\n // Placement\n commitPlacement(nextEffect); // Clear the \"placement\" from effect tag so that we know that this is\n // inserted, before any life-cycles like componentDidMount gets called.\n\n nextEffect.effectTag &= ~Placement; // Update\n\n var _current = nextEffect.alternate;\n commitWork(_current, nextEffect);\n break;\n }\n\n case Hydrating:\n {\n nextEffect.effectTag &= ~Hydrating;\n break;\n }\n\n case HydratingAndUpdate:\n {\n nextEffect.effectTag &= ~Hydrating; // Update\n\n var _current2 = nextEffect.alternate;\n commitWork(_current2, nextEffect);\n break;\n }\n\n case Update:\n {\n var _current3 = nextEffect.alternate;\n commitWork(_current3, nextEffect);\n break;\n }\n\n case Deletion:\n {\n commitDeletion(root, nextEffect, renderPriorityLevel);\n break;\n }\n } // TODO: Only record a mutation effect if primaryEffectTag is non-zero.\n\n\n recordEffect();\n resetCurrentFiber();\n nextEffect = nextEffect.nextEffect;\n }\n}\n\nfunction commitLayoutEffects(root, committedExpirationTime) {\n // TODO: Should probably move the bulk of this function to commitWork.\n while (nextEffect !== null) {\n setCurrentFiber(nextEffect);\n var effectTag = nextEffect.effectTag;\n\n if (effectTag & (Update | Callback)) {\n recordEffect();\n var current = nextEffect.alternate;\n commitLifeCycles(root, current, nextEffect);\n }\n\n if (effectTag & Ref) {\n recordEffect();\n commitAttachRef(nextEffect);\n }\n\n resetCurrentFiber();\n nextEffect = nextEffect.nextEffect;\n }\n}\n\nfunction flushPassiveEffects() {\n if (pendingPassiveEffectsRenderPriority !== NoPriority) {\n var priorityLevel = pendingPassiveEffectsRenderPriority > NormalPriority ? NormalPriority : pendingPassiveEffectsRenderPriority;\n pendingPassiveEffectsRenderPriority = NoPriority;\n return runWithPriority$1(priorityLevel, flushPassiveEffectsImpl);\n }\n}\n\nfunction flushPassiveEffectsImpl() {\n if (rootWithPendingPassiveEffects === null) {\n return false;\n }\n\n var root = rootWithPendingPassiveEffects;\n var expirationTime = pendingPassiveEffectsExpirationTime;\n rootWithPendingPassiveEffects = null;\n pendingPassiveEffectsExpirationTime = NoWork;\n\n if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n {\n throw Error( \"Cannot flush passive effects while already rendering.\" );\n }\n }\n\n var prevExecutionContext = executionContext;\n executionContext |= CommitContext;\n var prevInteractions = pushInteractions(root);\n\n {\n // Note: This currently assumes there are no passive effects on the root fiber\n // because the root is not part of its own effect list.\n // This could change in the future.\n var _effect2 = root.current.firstEffect;\n\n while (_effect2 !== null) {\n {\n setCurrentFiber(_effect2);\n invokeGuardedCallback(null, commitPassiveHookEffects, null, _effect2);\n\n if (hasCaughtError()) {\n if (!(_effect2 !== null)) {\n {\n throw Error( \"Should be working on an effect.\" );\n }\n }\n\n var _error5 = clearCaughtError();\n\n captureCommitPhaseError(_effect2, _error5);\n }\n\n resetCurrentFiber();\n }\n\n var nextNextEffect = _effect2.nextEffect; // Remove nextEffect pointer to assist GC\n\n _effect2.nextEffect = null;\n _effect2 = nextNextEffect;\n }\n }\n\n {\n popInteractions(prevInteractions);\n finishPendingInteractions(root, expirationTime);\n }\n\n executionContext = prevExecutionContext;\n flushSyncCallbackQueue(); // If additional passive effects were scheduled, increment a counter. If this\n // exceeds the limit, we'll fire a warning.\n\n nestedPassiveUpdateCount = rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1;\n return true;\n}\n\nfunction isAlreadyFailedLegacyErrorBoundary(instance) {\n return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);\n}\nfunction markLegacyErrorBoundaryAsFailed(instance) {\n if (legacyErrorBoundariesThatAlreadyFailed === null) {\n legacyErrorBoundariesThatAlreadyFailed = new Set([instance]);\n } else {\n legacyErrorBoundariesThatAlreadyFailed.add(instance);\n }\n}\n\nfunction prepareToThrowUncaughtError(error) {\n if (!hasUncaughtError) {\n hasUncaughtError = true;\n firstUncaughtError = error;\n }\n}\n\nvar onUncaughtError = prepareToThrowUncaughtError;\n\nfunction captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {\n var errorInfo = createCapturedValue(error, sourceFiber);\n var update = createRootErrorUpdate(rootFiber, errorInfo, Sync);\n enqueueUpdate(rootFiber, update);\n var root = markUpdateTimeFromFiberToRoot(rootFiber, Sync);\n\n if (root !== null) {\n ensureRootIsScheduled(root);\n schedulePendingInteractions(root, Sync);\n }\n}\n\nfunction captureCommitPhaseError(sourceFiber, error) {\n if (sourceFiber.tag === HostRoot) {\n // Error was thrown at the root. There is no parent, so the root\n // itself should capture it.\n captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);\n return;\n }\n\n var fiber = sourceFiber.return;\n\n while (fiber !== null) {\n if (fiber.tag === HostRoot) {\n captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error);\n return;\n } else if (fiber.tag === ClassComponent) {\n var ctor = fiber.type;\n var instance = fiber.stateNode;\n\n if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {\n var errorInfo = createCapturedValue(error, sourceFiber);\n var update = createClassErrorUpdate(fiber, errorInfo, // TODO: This is always sync\n Sync);\n enqueueUpdate(fiber, update);\n var root = markUpdateTimeFromFiberToRoot(fiber, Sync);\n\n if (root !== null) {\n ensureRootIsScheduled(root);\n schedulePendingInteractions(root, Sync);\n }\n\n return;\n }\n }\n\n fiber = fiber.return;\n }\n}\nfunction pingSuspendedRoot(root, thenable, suspendedTime) {\n var pingCache = root.pingCache;\n\n if (pingCache !== null) {\n // The thenable resolved, so we no longer need to memoize, because it will\n // never be thrown again.\n pingCache.delete(thenable);\n }\n\n if (workInProgressRoot === root && renderExpirationTime$1 === suspendedTime) {\n // Received a ping at the same priority level at which we're currently\n // rendering. We might want to restart this render. This should mirror\n // the logic of whether or not a root suspends once it completes.\n // TODO: If we're rendering sync either due to Sync, Batched or expired,\n // we should probably never restart.\n // If we're suspended with delay, we'll always suspend so we can always\n // restart. If we're suspended without any updates, it might be a retry.\n // If it's early in the retry we can restart. We can't know for sure\n // whether we'll eventually process an update during this render pass,\n // but it's somewhat unlikely that we get to a ping before that, since\n // getting to the root most update is usually very fast.\n if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && workInProgressRootLatestProcessedExpirationTime === Sync && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {\n // Restart from the root. Don't need to schedule a ping because\n // we're already working on this tree.\n prepareFreshStack(root, renderExpirationTime$1);\n } else {\n // Even though we can't restart right now, we might get an\n // opportunity later. So we mark this render as having a ping.\n workInProgressRootHasPendingPing = true;\n }\n\n return;\n }\n\n if (!isRootSuspendedAtTime(root, suspendedTime)) {\n // The root is no longer suspended at this time.\n return;\n }\n\n var lastPingedTime = root.lastPingedTime;\n\n if (lastPingedTime !== NoWork && lastPingedTime < suspendedTime) {\n // There's already a lower priority ping scheduled.\n return;\n } // Mark the time at which this ping was scheduled.\n\n\n root.lastPingedTime = suspendedTime;\n\n ensureRootIsScheduled(root);\n schedulePendingInteractions(root, suspendedTime);\n}\n\nfunction retryTimedOutBoundary(boundaryFiber, retryTime) {\n // The boundary fiber (a Suspense component or SuspenseList component)\n // previously was rendered in its fallback state. One of the promises that\n // suspended it has resolved, which means at least part of the tree was\n // likely unblocked. Try rendering again, at a new expiration time.\n if (retryTime === NoWork) {\n var suspenseConfig = null; // Retries don't carry over the already committed update.\n\n var currentTime = requestCurrentTimeForUpdate();\n retryTime = computeExpirationForFiber(currentTime, boundaryFiber, suspenseConfig);\n } // TODO: Special case idle priority?\n\n\n var root = markUpdateTimeFromFiberToRoot(boundaryFiber, retryTime);\n\n if (root !== null) {\n ensureRootIsScheduled(root);\n schedulePendingInteractions(root, retryTime);\n }\n}\nfunction resolveRetryThenable(boundaryFiber, thenable) {\n var retryTime = NoWork; // Default\n\n var retryCache;\n\n {\n retryCache = boundaryFiber.stateNode;\n }\n\n if (retryCache !== null) {\n // The thenable resolved, so we no longer need to memoize, because it will\n // never be thrown again.\n retryCache.delete(thenable);\n }\n\n retryTimedOutBoundary(boundaryFiber, retryTime);\n} // Computes the next Just Noticeable Difference (JND) boundary.\n// The theory is that a person can't tell the difference between small differences in time.\n// Therefore, if we wait a bit longer than necessary that won't translate to a noticeable\n// difference in the experience. However, waiting for longer might mean that we can avoid\n// showing an intermediate loading state. The longer we have already waited, the harder it\n// is to tell small differences in time. Therefore, the longer we've already waited,\n// the longer we can wait additionally. At some point we have to give up though.\n// We pick a train model where the next boundary commits at a consistent schedule.\n// These particular numbers are vague estimates. We expect to adjust them based on research.\n\nfunction jnd(timeElapsed) {\n return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;\n}\n\nfunction computeMsUntilSuspenseLoadingDelay(mostRecentEventTime, committedExpirationTime, suspenseConfig) {\n var busyMinDurationMs = suspenseConfig.busyMinDurationMs | 0;\n\n if (busyMinDurationMs <= 0) {\n return 0;\n }\n\n var busyDelayMs = suspenseConfig.busyDelayMs | 0; // Compute the time until this render pass would expire.\n\n var currentTimeMs = now();\n var eventTimeMs = inferTimeFromExpirationTimeWithSuspenseConfig(mostRecentEventTime, suspenseConfig);\n var timeElapsed = currentTimeMs - eventTimeMs;\n\n if (timeElapsed <= busyDelayMs) {\n // If we haven't yet waited longer than the initial delay, we don't\n // have to wait any additional time.\n return 0;\n }\n\n var msUntilTimeout = busyDelayMs + busyMinDurationMs - timeElapsed; // This is the value that is passed to `setTimeout`.\n\n return msUntilTimeout;\n}\n\nfunction checkForNestedUpdates() {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n nestedUpdateCount = 0;\n rootWithNestedUpdates = null;\n\n {\n {\n throw Error( \"Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.\" );\n }\n }\n }\n\n {\n if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {\n nestedPassiveUpdateCount = 0;\n\n error('Maximum update depth exceeded. This can happen when a component ' + \"calls setState inside useEffect, but useEffect either doesn't \" + 'have a dependency array, or one of the dependencies changes on ' + 'every render.');\n }\n }\n}\n\nfunction flushRenderPhaseStrictModeWarningsInDEV() {\n {\n ReactStrictModeWarnings.flushLegacyContextWarning();\n\n {\n ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();\n }\n }\n}\n\nfunction stopFinishedWorkLoopTimer() {\n var didCompleteRoot = true;\n stopWorkLoopTimer(interruptedBy, didCompleteRoot);\n interruptedBy = null;\n}\n\nfunction stopInterruptedWorkLoopTimer() {\n // TODO: Track which fiber caused the interruption.\n var didCompleteRoot = false;\n stopWorkLoopTimer(interruptedBy, didCompleteRoot);\n interruptedBy = null;\n}\n\nfunction checkForInterruption(fiberThatReceivedUpdate, updateExpirationTime) {\n if ( workInProgressRoot !== null && updateExpirationTime > renderExpirationTime$1) {\n interruptedBy = fiberThatReceivedUpdate;\n }\n}\n\nvar didWarnStateUpdateForUnmountedComponent = null;\n\nfunction warnAboutUpdateOnUnmountedFiberInDEV(fiber) {\n {\n var tag = fiber.tag;\n\n if (tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {\n // Only warn for user-defined components, not internal ones like Suspense.\n return;\n }\n // the problematic code almost always lies inside that component.\n\n\n var componentName = getComponentName(fiber.type) || 'ReactComponent';\n\n if (didWarnStateUpdateForUnmountedComponent !== null) {\n if (didWarnStateUpdateForUnmountedComponent.has(componentName)) {\n return;\n }\n\n didWarnStateUpdateForUnmountedComponent.add(componentName);\n } else {\n didWarnStateUpdateForUnmountedComponent = new Set([componentName]);\n }\n\n error(\"Can't perform a React state update on an unmounted component. This \" + 'is a no-op, but it indicates a memory leak in your application. To ' + 'fix, cancel all subscriptions and asynchronous tasks in %s.%s', tag === ClassComponent ? 'the componentWillUnmount method' : 'a useEffect cleanup function', getStackByFiberInDevAndProd(fiber));\n }\n}\n\nvar beginWork$1;\n\n{\n var dummyFiber = null;\n\n beginWork$1 = function (current, unitOfWork, expirationTime) {\n // If a component throws an error, we replay it again in a synchronously\n // dispatched event, so that the debugger will treat it as an uncaught\n // error See ReactErrorUtils for more information.\n // Before entering the begin phase, copy the work-in-progress onto a dummy\n // fiber. If beginWork throws, we'll use this to reset the state.\n var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);\n\n try {\n return beginWork(current, unitOfWork, expirationTime);\n } catch (originalError) {\n if (originalError !== null && typeof originalError === 'object' && typeof originalError.then === 'function') {\n // Don't replay promises. Treat everything else like an error.\n throw originalError;\n } // Keep this code in sync with handleError; any changes here must have\n // corresponding changes there.\n\n\n resetContextDependencies();\n resetHooksAfterThrow(); // Don't reset current debug fiber, since we're about to work on the\n // same fiber again.\n // Unwind the failed stack frame\n\n unwindInterruptedWork(unitOfWork); // Restore the original properties of the fiber.\n\n assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);\n\n if ( unitOfWork.mode & ProfileMode) {\n // Reset the profiler timer.\n startProfilerTimer(unitOfWork);\n } // Run beginWork again.\n\n\n invokeGuardedCallback(null, beginWork, null, current, unitOfWork, expirationTime);\n\n if (hasCaughtError()) {\n var replayError = clearCaughtError(); // `invokeGuardedCallback` sometimes sets an expando `_suppressLogging`.\n // Rethrow this error instead of the original one.\n\n throw replayError;\n } else {\n // This branch is reachable if the render phase is impure.\n throw originalError;\n }\n }\n };\n}\n\nvar didWarnAboutUpdateInRender = false;\nvar didWarnAboutUpdateInRenderForAnotherComponent;\n\n{\n didWarnAboutUpdateInRenderForAnotherComponent = new Set();\n}\n\nfunction warnAboutRenderPhaseUpdatesInDEV(fiber) {\n {\n if (isRendering && (executionContext & RenderContext) !== NoContext) {\n switch (fiber.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n {\n var renderingComponentName = workInProgress && getComponentName(workInProgress.type) || 'Unknown'; // Dedupe by the rendering component because it's the one that needs to be fixed.\n\n var dedupeKey = renderingComponentName;\n\n if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {\n didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);\n var setStateComponentName = getComponentName(fiber.type) || 'Unknown';\n\n error('Cannot update a component (`%s`) while rendering a ' + 'different component (`%s`). To locate the bad setState() call inside `%s`, ' + 'follow the stack trace as described in https://fb.me/setstate-in-render', setStateComponentName, renderingComponentName, renderingComponentName);\n }\n\n break;\n }\n\n case ClassComponent:\n {\n if (!didWarnAboutUpdateInRender) {\n error('Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure ' + 'function of props and state.');\n\n didWarnAboutUpdateInRender = true;\n }\n\n break;\n }\n }\n }\n }\n} // a 'shared' variable that changes when act() opens/closes in tests.\n\n\nvar IsThisRendererActing = {\n current: false\n};\nfunction warnIfNotScopedWithMatchingAct(fiber) {\n {\n if ( IsSomeRendererActing.current === true && IsThisRendererActing.current !== true) {\n error(\"It looks like you're using the wrong act() around your test interactions.\\n\" + 'Be sure to use the matching version of act() corresponding to your renderer:\\n\\n' + '// for react-dom:\\n' + \"import {act} from 'react-dom/test-utils';\\n\" + '// ...\\n' + 'act(() => ...);\\n\\n' + '// for react-test-renderer:\\n' + \"import TestRenderer from 'react-test-renderer';\\n\" + 'const {act} = TestRenderer;\\n' + '// ...\\n' + 'act(() => ...);' + '%s', getStackByFiberInDevAndProd(fiber));\n }\n }\n}\nfunction warnIfNotCurrentlyActingEffectsInDEV(fiber) {\n {\n if ( (fiber.mode & StrictMode) !== NoMode && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {\n error('An update to %s ran an effect, but was not wrapped in act(...).\\n\\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\\n\\n' + 'act(() => {\\n' + ' /* fire events that update state */\\n' + '});\\n' + '/* assert on the output */\\n\\n' + \"This ensures that you're testing the behavior the user would see \" + 'in the browser.' + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber));\n }\n }\n}\n\nfunction warnIfNotCurrentlyActingUpdatesInDEV(fiber) {\n {\n if ( executionContext === NoContext && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {\n error('An update to %s inside a test was not wrapped in act(...).\\n\\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\\n\\n' + 'act(() => {\\n' + ' /* fire events that update state */\\n' + '});\\n' + '/* assert on the output */\\n\\n' + \"This ensures that you're testing the behavior the user would see \" + 'in the browser.' + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber));\n }\n }\n}\n\nvar warnIfNotCurrentlyActingUpdatesInDev = warnIfNotCurrentlyActingUpdatesInDEV; // In tests, we want to enforce a mocked scheduler.\n\nvar didWarnAboutUnmockedScheduler = false; // TODO Before we release concurrent mode, revisit this and decide whether a mocked\n// scheduler is the actual recommendation. The alternative could be a testing build,\n// a new lib, or whatever; we dunno just yet. This message is for early adopters\n// to get their tests right.\n\nfunction warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}\n\nfunction computeThreadID(root, expirationTime) {\n // Interaction threads are unique per root and expiration time.\n return expirationTime * 1000 + root.interactionThreadID;\n}\n\nfunction markSpawnedWork(expirationTime) {\n\n if (spawnedWorkDuringRender === null) {\n spawnedWorkDuringRender = [expirationTime];\n } else {\n spawnedWorkDuringRender.push(expirationTime);\n }\n}\n\nfunction scheduleInteractions(root, expirationTime, interactions) {\n\n if (interactions.size > 0) {\n var pendingInteractionMap = root.pendingInteractionMap;\n var pendingInteractions = pendingInteractionMap.get(expirationTime);\n\n if (pendingInteractions != null) {\n interactions.forEach(function (interaction) {\n if (!pendingInteractions.has(interaction)) {\n // Update the pending async work count for previously unscheduled interaction.\n interaction.__count++;\n }\n\n pendingInteractions.add(interaction);\n });\n } else {\n pendingInteractionMap.set(expirationTime, new Set(interactions)); // Update the pending async work count for the current interactions.\n\n interactions.forEach(function (interaction) {\n interaction.__count++;\n });\n }\n\n var subscriber = tracing.__subscriberRef.current;\n\n if (subscriber !== null) {\n var threadID = computeThreadID(root, expirationTime);\n subscriber.onWorkScheduled(interactions, threadID);\n }\n }\n}\n\nfunction schedulePendingInteractions(root, expirationTime) {\n\n scheduleInteractions(root, expirationTime, tracing.__interactionsRef.current);\n}\n\nfunction startWorkOnPendingInteractions(root, expirationTime) {\n // we can accurately attribute time spent working on it, And so that cascading\n // work triggered during the render phase will be associated with it.\n\n\n var interactions = new Set();\n root.pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {\n if (scheduledExpirationTime >= expirationTime) {\n scheduledInteractions.forEach(function (interaction) {\n return interactions.add(interaction);\n });\n }\n }); // Store the current set of interactions on the FiberRoot for a few reasons:\n // We can re-use it in hot functions like performConcurrentWorkOnRoot()\n // without having to recalculate it. We will also use it in commitWork() to\n // pass to any Profiler onRender() hooks. This also provides DevTools with a\n // way to access it when the onCommitRoot() hook is called.\n\n root.memoizedInteractions = interactions;\n\n if (interactions.size > 0) {\n var subscriber = tracing.__subscriberRef.current;\n\n if (subscriber !== null) {\n var threadID = computeThreadID(root, expirationTime);\n\n try {\n subscriber.onWorkStarted(interactions, threadID);\n } catch (error) {\n // If the subscriber throws, rethrow it in a separate task\n scheduleCallback(ImmediatePriority, function () {\n throw error;\n });\n }\n }\n }\n}\n\nfunction finishPendingInteractions(root, committedExpirationTime) {\n\n var earliestRemainingTimeAfterCommit = root.firstPendingTime;\n var subscriber;\n\n try {\n subscriber = tracing.__subscriberRef.current;\n\n if (subscriber !== null && root.memoizedInteractions.size > 0) {\n var threadID = computeThreadID(root, committedExpirationTime);\n subscriber.onWorkStopped(root.memoizedInteractions, threadID);\n }\n } catch (error) {\n // If the subscriber throws, rethrow it in a separate task\n scheduleCallback(ImmediatePriority, function () {\n throw error;\n });\n } finally {\n // Clear completed interactions from the pending Map.\n // Unless the render was suspended or cascading work was scheduled,\n // In which case– leave pending interactions until the subsequent render.\n var pendingInteractionMap = root.pendingInteractionMap;\n pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {\n // Only decrement the pending interaction count if we're done.\n // If there's still work at the current priority,\n // That indicates that we are waiting for suspense data.\n if (scheduledExpirationTime > earliestRemainingTimeAfterCommit) {\n pendingInteractionMap.delete(scheduledExpirationTime);\n scheduledInteractions.forEach(function (interaction) {\n interaction.__count--;\n\n if (subscriber !== null && interaction.__count === 0) {\n try {\n subscriber.onInteractionScheduledWorkCompleted(interaction);\n } catch (error) {\n // If the subscriber throws, rethrow it in a separate task\n scheduleCallback(ImmediatePriority, function () {\n throw error;\n });\n }\n }\n });\n }\n });\n }\n}\n\nvar onScheduleFiberRoot = null;\nvar onCommitFiberRoot = null;\nvar onCommitFiberUnmount = null;\nvar hasLoggedError = false;\nvar isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined';\nfunction injectInternals(internals) {\n if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {\n // No DevTools\n return false;\n }\n\n var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;\n\n if (hook.isDisabled) {\n // This isn't a real property on the hook, but it can be set to opt out\n // of DevTools integration and associated warnings and logs.\n // https://github.com/facebook/react/issues/3877\n return true;\n }\n\n if (!hook.supportsFiber) {\n {\n error('The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://fb.me/react-devtools');\n } // DevTools exists, even though it doesn't support Fiber.\n\n\n return true;\n }\n\n try {\n var rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks.\n\n if (true) {\n // Only used by Fast Refresh\n if (typeof hook.onScheduleFiberRoot === 'function') {\n onScheduleFiberRoot = function (root, children) {\n try {\n hook.onScheduleFiberRoot(rendererID, root, children);\n } catch (err) {\n if (true && !hasLoggedError) {\n hasLoggedError = true;\n\n error('React instrumentation encountered an error: %s', err);\n }\n }\n };\n }\n }\n\n onCommitFiberRoot = function (root, expirationTime) {\n try {\n var didError = (root.current.effectTag & DidCapture) === DidCapture;\n\n if (enableProfilerTimer) {\n var currentTime = getCurrentTime();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime);\n hook.onCommitFiberRoot(rendererID, root, priorityLevel, didError);\n } else {\n hook.onCommitFiberRoot(rendererID, root, undefined, didError);\n }\n } catch (err) {\n if (true) {\n if (!hasLoggedError) {\n hasLoggedError = true;\n\n error('React instrumentation encountered an error: %s', err);\n }\n }\n }\n };\n\n onCommitFiberUnmount = function (fiber) {\n try {\n hook.onCommitFiberUnmount(rendererID, fiber);\n } catch (err) {\n if (true) {\n if (!hasLoggedError) {\n hasLoggedError = true;\n\n error('React instrumentation encountered an error: %s', err);\n }\n }\n }\n };\n } catch (err) {\n // Catch all errors because it is unsafe to throw during initialization.\n {\n error('React instrumentation encountered an error: %s.', err);\n }\n } // DevTools exists\n\n\n return true;\n}\nfunction onScheduleRoot(root, children) {\n if (typeof onScheduleFiberRoot === 'function') {\n onScheduleFiberRoot(root, children);\n }\n}\nfunction onCommitRoot(root, expirationTime) {\n if (typeof onCommitFiberRoot === 'function') {\n onCommitFiberRoot(root, expirationTime);\n }\n}\nfunction onCommitUnmount(fiber) {\n if (typeof onCommitFiberUnmount === 'function') {\n onCommitFiberUnmount(fiber);\n }\n}\n\nvar hasBadMapPolyfill;\n\n{\n hasBadMapPolyfill = false;\n\n try {\n var nonExtensibleObject = Object.preventExtensions({});\n var testMap = new Map([[nonExtensibleObject, null]]);\n var testSet = new Set([nonExtensibleObject]); // This is necessary for Rollup to not consider these unused.\n // https://github.com/rollup/rollup/issues/1771\n // TODO: we can remove these if Rollup fixes the bug.\n\n testMap.set(0, 0);\n testSet.add(0);\n } catch (e) {\n // TODO: Consider warning about bad polyfills\n hasBadMapPolyfill = true;\n }\n}\n\nvar debugCounter = 1;\n\nfunction FiberNode(tag, pendingProps, key, mode) {\n // Instance\n this.tag = tag;\n this.key = key;\n this.elementType = null;\n this.type = null;\n this.stateNode = null; // Fiber\n\n this.return = null;\n this.child = null;\n this.sibling = null;\n this.index = 0;\n this.ref = null;\n this.pendingProps = pendingProps;\n this.memoizedProps = null;\n this.updateQueue = null;\n this.memoizedState = null;\n this.dependencies = null;\n this.mode = mode; // Effects\n\n this.effectTag = NoEffect;\n this.nextEffect = null;\n this.firstEffect = null;\n this.lastEffect = null;\n this.expirationTime = NoWork;\n this.childExpirationTime = NoWork;\n this.alternate = null;\n\n {\n // Note: The following is done to avoid a v8 performance cliff.\n //\n // Initializing the fields below to smis and later updating them with\n // double values will cause Fibers to end up having separate shapes.\n // This behavior/bug has something to do with Object.preventExtension().\n // Fortunately this only impacts DEV builds.\n // Unfortunately it makes React unusably slow for some applications.\n // To work around this, initialize the fields below with doubles.\n //\n // Learn more about this here:\n // https://github.com/facebook/react/issues/14365\n // https://bugs.chromium.org/p/v8/issues/detail?id=8538\n this.actualDuration = Number.NaN;\n this.actualStartTime = Number.NaN;\n this.selfBaseDuration = Number.NaN;\n this.treeBaseDuration = Number.NaN; // It's okay to replace the initial doubles with smis after initialization.\n // This won't trigger the performance cliff mentioned above,\n // and it simplifies other profiler code (including DevTools).\n\n this.actualDuration = 0;\n this.actualStartTime = -1;\n this.selfBaseDuration = 0;\n this.treeBaseDuration = 0;\n } // This is normally DEV-only except www when it adds listeners.\n // TODO: remove the User Timing integration in favor of Root Events.\n\n\n {\n this._debugID = debugCounter++;\n this._debugIsCurrentlyTiming = false;\n }\n\n {\n this._debugSource = null;\n this._debugOwner = null;\n this._debugNeedsRemount = false;\n this._debugHookTypes = null;\n\n if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {\n Object.preventExtensions(this);\n }\n }\n} // This is a constructor function, rather than a POJO constructor, still\n// please ensure we do the following:\n// 1) Nobody should add any instance methods on this. Instance methods can be\n// more difficult to predict when they get optimized and they are almost\n// never inlined properly in static compilers.\n// 2) Nobody should rely on `instanceof Fiber` for type testing. We should\n// always know when it is a fiber.\n// 3) We might want to experiment with using numeric keys since they are easier\n// to optimize in a non-JIT environment.\n// 4) We can easily go from a constructor to a createFiber object literal if that\n// is faster.\n// 5) It should be easy to port this to a C struct and keep a C implementation\n// compatible.\n\n\nvar createFiber = function (tag, pendingProps, key, mode) {\n // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors\n return new FiberNode(tag, pendingProps, key, mode);\n};\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction isSimpleFunctionComponent(type) {\n return typeof type === 'function' && !shouldConstruct(type) && type.defaultProps === undefined;\n}\nfunction resolveLazyComponentTag(Component) {\n if (typeof Component === 'function') {\n return shouldConstruct(Component) ? ClassComponent : FunctionComponent;\n } else if (Component !== undefined && Component !== null) {\n var $$typeof = Component.$$typeof;\n\n if ($$typeof === REACT_FORWARD_REF_TYPE) {\n return ForwardRef;\n }\n\n if ($$typeof === REACT_MEMO_TYPE) {\n return MemoComponent;\n }\n }\n\n return IndeterminateComponent;\n} // This is used to create an alternate fiber to do work on.\n\nfunction createWorkInProgress(current, pendingProps) {\n var workInProgress = current.alternate;\n\n if (workInProgress === null) {\n // We use a double buffering pooling technique because we know that we'll\n // only ever need at most two versions of a tree. We pool the \"other\" unused\n // node that we're free to reuse. This is lazily created to avoid allocating\n // extra objects for things that are never updated. It also allow us to\n // reclaim the extra memory if needed.\n workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode);\n workInProgress.elementType = current.elementType;\n workInProgress.type = current.type;\n workInProgress.stateNode = current.stateNode;\n\n {\n // DEV-only fields\n {\n workInProgress._debugID = current._debugID;\n }\n\n workInProgress._debugSource = current._debugSource;\n workInProgress._debugOwner = current._debugOwner;\n workInProgress._debugHookTypes = current._debugHookTypes;\n }\n\n workInProgress.alternate = current;\n current.alternate = workInProgress;\n } else {\n workInProgress.pendingProps = pendingProps; // We already have an alternate.\n // Reset the effect tag.\n\n workInProgress.effectTag = NoEffect; // The effect list is no longer valid.\n\n workInProgress.nextEffect = null;\n workInProgress.firstEffect = null;\n workInProgress.lastEffect = null;\n\n {\n // We intentionally reset, rather than copy, actualDuration & actualStartTime.\n // This prevents time from endlessly accumulating in new commits.\n // This has the downside of resetting values for different priority renders,\n // But works for yielding (the common case) and should support resuming.\n workInProgress.actualDuration = 0;\n workInProgress.actualStartTime = -1;\n }\n }\n\n workInProgress.childExpirationTime = current.childExpirationTime;\n workInProgress.expirationTime = current.expirationTime;\n workInProgress.child = current.child;\n workInProgress.memoizedProps = current.memoizedProps;\n workInProgress.memoizedState = current.memoizedState;\n workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so\n // it cannot be shared with the current fiber.\n\n var currentDependencies = current.dependencies;\n workInProgress.dependencies = currentDependencies === null ? null : {\n expirationTime: currentDependencies.expirationTime,\n firstContext: currentDependencies.firstContext,\n responders: currentDependencies.responders\n }; // These will be overridden during the parent's reconciliation\n\n workInProgress.sibling = current.sibling;\n workInProgress.index = current.index;\n workInProgress.ref = current.ref;\n\n {\n workInProgress.selfBaseDuration = current.selfBaseDuration;\n workInProgress.treeBaseDuration = current.treeBaseDuration;\n }\n\n {\n workInProgress._debugNeedsRemount = current._debugNeedsRemount;\n\n switch (workInProgress.tag) {\n case IndeterminateComponent:\n case FunctionComponent:\n case SimpleMemoComponent:\n workInProgress.type = resolveFunctionForHotReloading(current.type);\n break;\n\n case ClassComponent:\n workInProgress.type = resolveClassForHotReloading(current.type);\n break;\n\n case ForwardRef:\n workInProgress.type = resolveForwardRefForHotReloading(current.type);\n break;\n }\n }\n\n return workInProgress;\n} // Used to reuse a Fiber for a second pass.\n\nfunction resetWorkInProgress(workInProgress, renderExpirationTime) {\n // This resets the Fiber to what createFiber or createWorkInProgress would\n // have set the values to before during the first pass. Ideally this wouldn't\n // be necessary but unfortunately many code paths reads from the workInProgress\n // when they should be reading from current and writing to workInProgress.\n // We assume pendingProps, index, key, ref, return are still untouched to\n // avoid doing another reconciliation.\n // Reset the effect tag but keep any Placement tags, since that's something\n // that child fiber is setting, not the reconciliation.\n workInProgress.effectTag &= Placement; // The effect list is no longer valid.\n\n workInProgress.nextEffect = null;\n workInProgress.firstEffect = null;\n workInProgress.lastEffect = null;\n var current = workInProgress.alternate;\n\n if (current === null) {\n // Reset to createFiber's initial values.\n workInProgress.childExpirationTime = NoWork;\n workInProgress.expirationTime = renderExpirationTime;\n workInProgress.child = null;\n workInProgress.memoizedProps = null;\n workInProgress.memoizedState = null;\n workInProgress.updateQueue = null;\n workInProgress.dependencies = null;\n\n {\n // Note: We don't reset the actualTime counts. It's useful to accumulate\n // actual time across multiple render passes.\n workInProgress.selfBaseDuration = 0;\n workInProgress.treeBaseDuration = 0;\n }\n } else {\n // Reset to the cloned values that createWorkInProgress would've.\n workInProgress.childExpirationTime = current.childExpirationTime;\n workInProgress.expirationTime = current.expirationTime;\n workInProgress.child = current.child;\n workInProgress.memoizedProps = current.memoizedProps;\n workInProgress.memoizedState = current.memoizedState;\n workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so\n // it cannot be shared with the current fiber.\n\n var currentDependencies = current.dependencies;\n workInProgress.dependencies = currentDependencies === null ? null : {\n expirationTime: currentDependencies.expirationTime,\n firstContext: currentDependencies.firstContext,\n responders: currentDependencies.responders\n };\n\n {\n // Note: We don't reset the actualTime counts. It's useful to accumulate\n // actual time across multiple render passes.\n workInProgress.selfBaseDuration = current.selfBaseDuration;\n workInProgress.treeBaseDuration = current.treeBaseDuration;\n }\n }\n\n return workInProgress;\n}\nfunction createHostRootFiber(tag) {\n var mode;\n\n if (tag === ConcurrentRoot) {\n mode = ConcurrentMode | BlockingMode | StrictMode;\n } else if (tag === BlockingRoot) {\n mode = BlockingMode | StrictMode;\n } else {\n mode = NoMode;\n }\n\n if ( isDevToolsPresent) {\n // Always collect profile timings when DevTools are present.\n // This enables DevTools to start capturing timing at any point–\n // Without some nodes in the tree having empty base times.\n mode |= ProfileMode;\n }\n\n return createFiber(HostRoot, null, null, mode);\n}\nfunction createFiberFromTypeAndProps(type, // React$ElementType\nkey, pendingProps, owner, mode, expirationTime) {\n var fiber;\n var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy.\n\n var resolvedType = type;\n\n if (typeof type === 'function') {\n if (shouldConstruct(type)) {\n fiberTag = ClassComponent;\n\n {\n resolvedType = resolveClassForHotReloading(resolvedType);\n }\n } else {\n {\n resolvedType = resolveFunctionForHotReloading(resolvedType);\n }\n }\n } else if (typeof type === 'string') {\n fiberTag = HostComponent;\n } else {\n getTag: switch (type) {\n case REACT_FRAGMENT_TYPE:\n return createFiberFromFragment(pendingProps.children, mode, expirationTime, key);\n\n case REACT_CONCURRENT_MODE_TYPE:\n fiberTag = Mode;\n mode |= ConcurrentMode | BlockingMode | StrictMode;\n break;\n\n case REACT_STRICT_MODE_TYPE:\n fiberTag = Mode;\n mode |= StrictMode;\n break;\n\n case REACT_PROFILER_TYPE:\n return createFiberFromProfiler(pendingProps, mode, expirationTime, key);\n\n case REACT_SUSPENSE_TYPE:\n return createFiberFromSuspense(pendingProps, mode, expirationTime, key);\n\n case REACT_SUSPENSE_LIST_TYPE:\n return createFiberFromSuspenseList(pendingProps, mode, expirationTime, key);\n\n default:\n {\n if (typeof type === 'object' && type !== null) {\n switch (type.$$typeof) {\n case REACT_PROVIDER_TYPE:\n fiberTag = ContextProvider;\n break getTag;\n\n case REACT_CONTEXT_TYPE:\n // This is a consumer\n fiberTag = ContextConsumer;\n break getTag;\n\n case REACT_FORWARD_REF_TYPE:\n fiberTag = ForwardRef;\n\n {\n resolvedType = resolveForwardRefForHotReloading(resolvedType);\n }\n\n break getTag;\n\n case REACT_MEMO_TYPE:\n fiberTag = MemoComponent;\n break getTag;\n\n case REACT_LAZY_TYPE:\n fiberTag = LazyComponent;\n resolvedType = null;\n break getTag;\n\n case REACT_BLOCK_TYPE:\n fiberTag = Block;\n break getTag;\n\n }\n }\n\n var info = '';\n\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 var ownerName = owner ? getComponentName(owner.type) : null;\n\n if (ownerName) {\n info += '\\n\\nCheck the render method of `' + ownerName + '`.';\n }\n }\n\n {\n {\n throw 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 }\n }\n }\n\n fiber = createFiber(fiberTag, pendingProps, key, mode);\n fiber.elementType = type;\n fiber.type = resolvedType;\n fiber.expirationTime = expirationTime;\n return fiber;\n}\nfunction createFiberFromElement(element, mode, expirationTime) {\n var owner = null;\n\n {\n owner = element._owner;\n }\n\n var type = element.type;\n var key = element.key;\n var pendingProps = element.props;\n var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, expirationTime);\n\n {\n fiber._debugSource = element._source;\n fiber._debugOwner = element._owner;\n }\n\n return fiber;\n}\nfunction createFiberFromFragment(elements, mode, expirationTime, key) {\n var fiber = createFiber(Fragment, elements, key, mode);\n fiber.expirationTime = expirationTime;\n return fiber;\n}\n\nfunction createFiberFromProfiler(pendingProps, mode, expirationTime, key) {\n {\n if (typeof pendingProps.id !== 'string' || typeof pendingProps.onRender !== 'function') {\n error('Profiler must specify an \"id\" string and \"onRender\" function as props');\n }\n }\n\n var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode); // TODO: The Profiler fiber shouldn't have a type. It has a tag.\n\n fiber.elementType = REACT_PROFILER_TYPE;\n fiber.type = REACT_PROFILER_TYPE;\n fiber.expirationTime = expirationTime;\n return fiber;\n}\n\nfunction createFiberFromSuspense(pendingProps, mode, expirationTime, key) {\n var fiber = createFiber(SuspenseComponent, pendingProps, key, mode); // TODO: The SuspenseComponent fiber shouldn't have a type. It has a tag.\n // This needs to be fixed in getComponentName so that it relies on the tag\n // instead.\n\n fiber.type = REACT_SUSPENSE_TYPE;\n fiber.elementType = REACT_SUSPENSE_TYPE;\n fiber.expirationTime = expirationTime;\n return fiber;\n}\nfunction createFiberFromSuspenseList(pendingProps, mode, expirationTime, key) {\n var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);\n\n {\n // TODO: The SuspenseListComponent fiber shouldn't have a type. It has a tag.\n // This needs to be fixed in getComponentName so that it relies on the tag\n // instead.\n fiber.type = REACT_SUSPENSE_LIST_TYPE;\n }\n\n fiber.elementType = REACT_SUSPENSE_LIST_TYPE;\n fiber.expirationTime = expirationTime;\n return fiber;\n}\nfunction createFiberFromText(content, mode, expirationTime) {\n var fiber = createFiber(HostText, content, null, mode);\n fiber.expirationTime = expirationTime;\n return fiber;\n}\nfunction createFiberFromHostInstanceForDeletion() {\n var fiber = createFiber(HostComponent, null, null, NoMode); // TODO: These should not need a type.\n\n fiber.elementType = 'DELETED';\n fiber.type = 'DELETED';\n return fiber;\n}\nfunction createFiberFromPortal(portal, mode, expirationTime) {\n var pendingProps = portal.children !== null ? portal.children : [];\n var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);\n fiber.expirationTime = expirationTime;\n fiber.stateNode = {\n containerInfo: portal.containerInfo,\n pendingChildren: null,\n // Used by persistent updates\n implementation: portal.implementation\n };\n return fiber;\n} // Used for stashing WIP properties to replay failed work in DEV.\n\nfunction assignFiberPropertiesInDEV(target, source) {\n if (target === null) {\n // This Fiber's initial properties will always be overwritten.\n // We only use a Fiber to ensure the same hidden class so DEV isn't slow.\n target = createFiber(IndeterminateComponent, null, null, NoMode);\n } // This is intentionally written as a list of all properties.\n // We tried to use Object.assign() instead but this is called in\n // the hottest path, and Object.assign() was too slow:\n // https://github.com/facebook/react/issues/12502\n // This code is DEV-only so size is not a concern.\n\n\n target.tag = source.tag;\n target.key = source.key;\n target.elementType = source.elementType;\n target.type = source.type;\n target.stateNode = source.stateNode;\n target.return = source.return;\n target.child = source.child;\n target.sibling = source.sibling;\n target.index = source.index;\n target.ref = source.ref;\n target.pendingProps = source.pendingProps;\n target.memoizedProps = source.memoizedProps;\n target.updateQueue = source.updateQueue;\n target.memoizedState = source.memoizedState;\n target.dependencies = source.dependencies;\n target.mode = source.mode;\n target.effectTag = source.effectTag;\n target.nextEffect = source.nextEffect;\n target.firstEffect = source.firstEffect;\n target.lastEffect = source.lastEffect;\n target.expirationTime = source.expirationTime;\n target.childExpirationTime = source.childExpirationTime;\n target.alternate = source.alternate;\n\n {\n target.actualDuration = source.actualDuration;\n target.actualStartTime = source.actualStartTime;\n target.selfBaseDuration = source.selfBaseDuration;\n target.treeBaseDuration = source.treeBaseDuration;\n }\n\n {\n target._debugID = source._debugID;\n }\n\n target._debugSource = source._debugSource;\n target._debugOwner = source._debugOwner;\n target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming;\n target._debugNeedsRemount = source._debugNeedsRemount;\n target._debugHookTypes = source._debugHookTypes;\n return target;\n}\n\nfunction FiberRootNode(containerInfo, tag, hydrate) {\n this.tag = tag;\n this.current = null;\n this.containerInfo = containerInfo;\n this.pendingChildren = null;\n this.pingCache = null;\n this.finishedExpirationTime = NoWork;\n this.finishedWork = null;\n this.timeoutHandle = noTimeout;\n this.context = null;\n this.pendingContext = null;\n this.hydrate = hydrate;\n this.callbackNode = null;\n this.callbackPriority = NoPriority;\n this.firstPendingTime = NoWork;\n this.firstSuspendedTime = NoWork;\n this.lastSuspendedTime = NoWork;\n this.nextKnownPendingLevel = NoWork;\n this.lastPingedTime = NoWork;\n this.lastExpiredTime = NoWork;\n\n {\n this.interactionThreadID = tracing.unstable_getThreadID();\n this.memoizedInteractions = new Set();\n this.pendingInteractionMap = new Map();\n }\n}\n\nfunction createFiberRoot(containerInfo, tag, hydrate, hydrationCallbacks) {\n var root = new FiberRootNode(containerInfo, tag, hydrate);\n // stateNode is any.\n\n\n var uninitializedFiber = createHostRootFiber(tag);\n root.current = uninitializedFiber;\n uninitializedFiber.stateNode = root;\n initializeUpdateQueue(uninitializedFiber);\n return root;\n}\nfunction isRootSuspendedAtTime(root, expirationTime) {\n var firstSuspendedTime = root.firstSuspendedTime;\n var lastSuspendedTime = root.lastSuspendedTime;\n return firstSuspendedTime !== NoWork && firstSuspendedTime >= expirationTime && lastSuspendedTime <= expirationTime;\n}\nfunction markRootSuspendedAtTime(root, expirationTime) {\n var firstSuspendedTime = root.firstSuspendedTime;\n var lastSuspendedTime = root.lastSuspendedTime;\n\n if (firstSuspendedTime < expirationTime) {\n root.firstSuspendedTime = expirationTime;\n }\n\n if (lastSuspendedTime > expirationTime || firstSuspendedTime === NoWork) {\n root.lastSuspendedTime = expirationTime;\n }\n\n if (expirationTime <= root.lastPingedTime) {\n root.lastPingedTime = NoWork;\n }\n\n if (expirationTime <= root.lastExpiredTime) {\n root.lastExpiredTime = NoWork;\n }\n}\nfunction markRootUpdatedAtTime(root, expirationTime) {\n // Update the range of pending times\n var firstPendingTime = root.firstPendingTime;\n\n if (expirationTime > firstPendingTime) {\n root.firstPendingTime = expirationTime;\n } // Update the range of suspended times. Treat everything lower priority or\n // equal to this update as unsuspended.\n\n\n var firstSuspendedTime = root.firstSuspendedTime;\n\n if (firstSuspendedTime !== NoWork) {\n if (expirationTime >= firstSuspendedTime) {\n // The entire suspended range is now unsuspended.\n root.firstSuspendedTime = root.lastSuspendedTime = root.nextKnownPendingLevel = NoWork;\n } else if (expirationTime >= root.lastSuspendedTime) {\n root.lastSuspendedTime = expirationTime + 1;\n } // This is a pending level. Check if it's higher priority than the next\n // known pending level.\n\n\n if (expirationTime > root.nextKnownPendingLevel) {\n root.nextKnownPendingLevel = expirationTime;\n }\n }\n}\nfunction markRootFinishedAtTime(root, finishedExpirationTime, remainingExpirationTime) {\n // Update the range of pending times\n root.firstPendingTime = remainingExpirationTime; // Update the range of suspended times. Treat everything higher priority or\n // equal to this update as unsuspended.\n\n if (finishedExpirationTime <= root.lastSuspendedTime) {\n // The entire suspended range is now unsuspended.\n root.firstSuspendedTime = root.lastSuspendedTime = root.nextKnownPendingLevel = NoWork;\n } else if (finishedExpirationTime <= root.firstSuspendedTime) {\n // Part of the suspended range is now unsuspended. Narrow the range to\n // include everything between the unsuspended time (non-inclusive) and the\n // last suspended time.\n root.firstSuspendedTime = finishedExpirationTime - 1;\n }\n\n if (finishedExpirationTime <= root.lastPingedTime) {\n // Clear the pinged time\n root.lastPingedTime = NoWork;\n }\n\n if (finishedExpirationTime <= root.lastExpiredTime) {\n // Clear the expired time\n root.lastExpiredTime = NoWork;\n }\n}\nfunction markRootExpiredAtTime(root, expirationTime) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime === NoWork || lastExpiredTime > expirationTime) {\n root.lastExpiredTime = expirationTime;\n }\n}\n\nvar didWarnAboutNestedUpdates;\nvar didWarnAboutFindNodeInStrictMode;\n\n{\n didWarnAboutNestedUpdates = false;\n didWarnAboutFindNodeInStrictMode = {};\n}\n\nfunction getContextForSubtree(parentComponent) {\n if (!parentComponent) {\n return emptyContextObject;\n }\n\n var fiber = get(parentComponent);\n var parentContext = findCurrentUnmaskedContext(fiber);\n\n if (fiber.tag === ClassComponent) {\n var Component = fiber.type;\n\n if (isContextProvider(Component)) {\n return processChildContext(fiber, Component, parentContext);\n }\n }\n\n return parentContext;\n}\n\nfunction findHostInstanceWithWarning(component, methodName) {\n {\n var fiber = get(component);\n\n if (fiber === undefined) {\n if (typeof component.render === 'function') {\n {\n {\n throw Error( \"Unable to find node on an unmounted component.\" );\n }\n }\n } else {\n {\n {\n throw Error( \"Argument appears to not be a ReactComponent. Keys: \" + Object.keys(component) );\n }\n }\n }\n }\n\n var hostFiber = findCurrentHostFiber(fiber);\n\n if (hostFiber === null) {\n return null;\n }\n\n if (hostFiber.mode & StrictMode) {\n var componentName = getComponentName(fiber.type) || 'Component';\n\n if (!didWarnAboutFindNodeInStrictMode[componentName]) {\n didWarnAboutFindNodeInStrictMode[componentName] = true;\n\n if (fiber.mode & StrictMode) {\n error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which is inside StrictMode. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-find-node%s', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));\n } else {\n error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which renders StrictMode children. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-find-node%s', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));\n }\n }\n }\n\n return hostFiber.stateNode;\n }\n}\n\nfunction createContainer(containerInfo, tag, hydrate, hydrationCallbacks) {\n return createFiberRoot(containerInfo, tag, hydrate);\n}\nfunction updateContainer(element, container, parentComponent, callback) {\n {\n onScheduleRoot(container, element);\n }\n\n var current$1 = container.current;\n var currentTime = requestCurrentTimeForUpdate();\n\n {\n // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n if ('undefined' !== typeof jest) {\n warnIfUnmockedScheduler(current$1);\n warnIfNotScopedWithMatchingAct(current$1);\n }\n }\n\n var suspenseConfig = requestCurrentSuspenseConfig();\n var expirationTime = computeExpirationForFiber(currentTime, current$1, suspenseConfig);\n var context = getContextForSubtree(parentComponent);\n\n if (container.context === null) {\n container.context = context;\n } else {\n container.pendingContext = context;\n }\n\n {\n if (isRendering && current !== null && !didWarnAboutNestedUpdates) {\n didWarnAboutNestedUpdates = true;\n\n error('Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\\n\\n' + 'Check the render method of %s.', getComponentName(current.type) || 'Unknown');\n }\n }\n\n var update = createUpdate(expirationTime, suspenseConfig); // Caution: React DevTools currently depends on this property\n // being called \"element\".\n\n update.payload = {\n element: element\n };\n callback = callback === undefined ? null : callback;\n\n if (callback !== null) {\n {\n if (typeof callback !== 'function') {\n error('render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback);\n }\n }\n\n update.callback = callback;\n }\n\n enqueueUpdate(current$1, update);\n scheduleWork(current$1, expirationTime);\n return expirationTime;\n}\nfunction getPublicRootInstance(container) {\n var containerFiber = container.current;\n\n if (!containerFiber.child) {\n return null;\n }\n\n switch (containerFiber.child.tag) {\n case HostComponent:\n return getPublicInstance(containerFiber.child.stateNode);\n\n default:\n return containerFiber.child.stateNode;\n }\n}\n\nfunction markRetryTimeImpl(fiber, retryTime) {\n var suspenseState = fiber.memoizedState;\n\n if (suspenseState !== null && suspenseState.dehydrated !== null) {\n if (suspenseState.retryTime < retryTime) {\n suspenseState.retryTime = retryTime;\n }\n }\n} // Increases the priority of thennables when they resolve within this boundary.\n\n\nfunction markRetryTimeIfNotHydrated(fiber, retryTime) {\n markRetryTimeImpl(fiber, retryTime);\n var alternate = fiber.alternate;\n\n if (alternate) {\n markRetryTimeImpl(alternate, retryTime);\n }\n}\n\nfunction attemptUserBlockingHydration$1(fiber) {\n if (fiber.tag !== SuspenseComponent) {\n // We ignore HostRoots here because we can't increase\n // their priority and they should not suspend on I/O,\n // since you have to wrap anything that might suspend in\n // Suspense.\n return;\n }\n\n var expTime = computeInteractiveExpiration(requestCurrentTimeForUpdate());\n scheduleWork(fiber, expTime);\n markRetryTimeIfNotHydrated(fiber, expTime);\n}\nfunction attemptContinuousHydration$1(fiber) {\n if (fiber.tag !== SuspenseComponent) {\n // We ignore HostRoots here because we can't increase\n // their priority and they should not suspend on I/O,\n // since you have to wrap anything that might suspend in\n // Suspense.\n return;\n }\n\n scheduleWork(fiber, ContinuousHydration);\n markRetryTimeIfNotHydrated(fiber, ContinuousHydration);\n}\nfunction attemptHydrationAtCurrentPriority$1(fiber) {\n if (fiber.tag !== SuspenseComponent) {\n // We ignore HostRoots here because we can't increase\n // their priority other than synchronously flush it.\n return;\n }\n\n var currentTime = requestCurrentTimeForUpdate();\n var expTime = computeExpirationForFiber(currentTime, fiber, null);\n scheduleWork(fiber, expTime);\n markRetryTimeIfNotHydrated(fiber, expTime);\n}\nfunction findHostInstanceWithNoPortals(fiber) {\n var hostFiber = findCurrentHostFiberWithNoPortals(fiber);\n\n if (hostFiber === null) {\n return null;\n }\n\n if (hostFiber.tag === FundamentalComponent) {\n return hostFiber.stateNode.instance;\n }\n\n return hostFiber.stateNode;\n}\n\nvar shouldSuspendImpl = function (fiber) {\n return false;\n};\n\nfunction shouldSuspend(fiber) {\n return shouldSuspendImpl(fiber);\n}\nvar overrideHookState = null;\nvar overrideProps = null;\nvar scheduleUpdate = null;\nvar setSuspenseHandler = null;\n\n{\n var copyWithSetImpl = function (obj, path, idx, value) {\n if (idx >= path.length) {\n return value;\n }\n\n var key = path[idx];\n var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj); // $FlowFixMe number or string is fine here\n\n updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value);\n return updated;\n };\n\n var copyWithSet = function (obj, path, value) {\n return copyWithSetImpl(obj, path, 0, value);\n }; // Support DevTools editable values for useState and useReducer.\n\n\n overrideHookState = function (fiber, id, path, value) {\n // For now, the \"id\" of stateful hooks is just the stateful hook index.\n // This may change in the future with e.g. nested hooks.\n var currentHook = fiber.memoizedState;\n\n while (currentHook !== null && id > 0) {\n currentHook = currentHook.next;\n id--;\n }\n\n if (currentHook !== null) {\n var newState = copyWithSet(currentHook.memoizedState, path, value);\n currentHook.memoizedState = newState;\n currentHook.baseState = newState; // We aren't actually adding an update to the queue,\n // because there is no update we can add for useReducer hooks that won't trigger an error.\n // (There's no appropriate action type for DevTools overrides.)\n // As a result though, React will see the scheduled update as a noop and bailout.\n // Shallow cloning props works as a workaround for now to bypass the bailout check.\n\n fiber.memoizedProps = _assign({}, fiber.memoizedProps);\n scheduleWork(fiber, Sync);\n }\n }; // Support DevTools props for function components, forwardRef, memo, host components, etc.\n\n\n overrideProps = function (fiber, path, value) {\n fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);\n\n if (fiber.alternate) {\n fiber.alternate.pendingProps = fiber.pendingProps;\n }\n\n scheduleWork(fiber, Sync);\n };\n\n scheduleUpdate = function (fiber) {\n scheduleWork(fiber, Sync);\n };\n\n setSuspenseHandler = function (newShouldSuspendImpl) {\n shouldSuspendImpl = newShouldSuspendImpl;\n };\n}\n\nfunction injectIntoDevTools(devToolsConfig) {\n var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;\n var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\n return injectInternals(_assign({}, devToolsConfig, {\n overrideHookState: overrideHookState,\n overrideProps: overrideProps,\n setSuspenseHandler: setSuspenseHandler,\n scheduleUpdate: scheduleUpdate,\n currentDispatcherRef: ReactCurrentDispatcher,\n findHostInstanceByFiber: function (fiber) {\n var hostFiber = findCurrentHostFiber(fiber);\n\n if (hostFiber === null) {\n return null;\n }\n\n return hostFiber.stateNode;\n },\n findFiberByHostInstance: function (instance) {\n if (!findFiberByHostInstance) {\n // Might not be implemented by the renderer.\n return null;\n }\n\n return findFiberByHostInstance(instance);\n },\n // React Refresh\n findHostInstancesForRefresh: findHostInstancesForRefresh ,\n scheduleRefresh: scheduleRefresh ,\n scheduleRoot: scheduleRoot ,\n setRefreshHandler: setRefreshHandler ,\n // Enables DevTools to append owner stacks to error messages in DEV mode.\n getCurrentFiber: function () {\n return current;\n } \n }));\n}\nvar IsSomeRendererActing$1 = ReactSharedInternals.IsSomeRendererActing;\n\nfunction ReactDOMRoot(container, options) {\n this._internalRoot = createRootImpl(container, ConcurrentRoot, options);\n}\n\nfunction ReactDOMBlockingRoot(container, tag, options) {\n this._internalRoot = createRootImpl(container, tag, options);\n}\n\nReactDOMRoot.prototype.render = ReactDOMBlockingRoot.prototype.render = function (children) {\n var root = this._internalRoot;\n\n {\n if (typeof arguments[1] === 'function') {\n error('render(...): does not support the second callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');\n }\n\n var container = root.containerInfo;\n\n if (container.nodeType !== COMMENT_NODE) {\n var hostInstance = findHostInstanceWithNoPortals(root.current);\n\n if (hostInstance) {\n if (hostInstance.parentNode !== container) {\n error('render(...): It looks like the React-rendered content of the ' + 'root container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + \"root.unmount() to empty a root's container.\");\n }\n }\n }\n }\n\n updateContainer(children, root, null, null);\n};\n\nReactDOMRoot.prototype.unmount = ReactDOMBlockingRoot.prototype.unmount = function () {\n {\n if (typeof arguments[0] === 'function') {\n error('unmount(...): does not support a callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');\n }\n }\n\n var root = this._internalRoot;\n var container = root.containerInfo;\n updateContainer(null, root, null, function () {\n unmarkContainerAsRoot(container);\n });\n};\n\nfunction createRootImpl(container, tag, options) {\n // Tag is either LegacyRoot or Concurrent Root\n var hydrate = options != null && options.hydrate === true;\n var hydrationCallbacks = options != null && options.hydrationOptions || null;\n var root = createContainer(container, tag, hydrate);\n markContainerAsRoot(root.current, container);\n\n if (hydrate && tag !== LegacyRoot) {\n var doc = container.nodeType === DOCUMENT_NODE ? container : container.ownerDocument;\n eagerlyTrapReplayableEvents(container, doc);\n }\n\n return root;\n}\nfunction createLegacyRoot(container, options) {\n return new ReactDOMBlockingRoot(container, LegacyRoot, options);\n}\nfunction isValidContainer(node) {\n return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable '));\n}\n\nvar ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;\nvar topLevelUpdateWarnings;\nvar warnedAboutHydrateAPI = false;\n\n{\n topLevelUpdateWarnings = function (container) {\n if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {\n var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.current);\n\n if (hostInstance) {\n if (hostInstance.parentNode !== container) {\n error('render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.');\n }\n }\n }\n\n var isRootRenderedBySomeReact = !!container._reactRootContainer;\n var rootEl = getReactRootElementInContainer(container);\n var hasNonRootReactChild = !!(rootEl && getInstanceFromNode$1(rootEl));\n\n if (hasNonRootReactChild && !isRootRenderedBySomeReact) {\n error('render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.');\n }\n\n if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === 'BODY') {\n error('render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.');\n }\n };\n}\n\nfunction getReactRootElementInContainer(container) {\n if (!container) {\n return null;\n }\n\n if (container.nodeType === DOCUMENT_NODE) {\n return container.documentElement;\n } else {\n return container.firstChild;\n }\n}\n\nfunction shouldHydrateDueToLegacyHeuristic(container) {\n var rootElement = getReactRootElementInContainer(container);\n return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));\n}\n\nfunction legacyCreateRootFromDOMContainer(container, forceHydrate) {\n var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container); // First clear any existing content.\n\n if (!shouldHydrate) {\n var warned = false;\n var rootSibling;\n\n while (rootSibling = container.lastChild) {\n {\n if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {\n warned = true;\n\n error('render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.');\n }\n }\n\n container.removeChild(rootSibling);\n }\n }\n\n {\n if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {\n warnedAboutHydrateAPI = true;\n\n warn('render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + 'will stop working in React v17. Replace the ReactDOM.render() call ' + 'with ReactDOM.hydrate() if you want React to attach to the server HTML.');\n }\n }\n\n return createLegacyRoot(container, shouldHydrate ? {\n hydrate: true\n } : undefined);\n}\n\nfunction warnOnInvalidCallback$1(callback, callerName) {\n {\n if (callback !== null && typeof callback !== 'function') {\n error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);\n }\n }\n}\n\nfunction legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {\n {\n topLevelUpdateWarnings(container);\n warnOnInvalidCallback$1(callback === undefined ? null : callback, 'render');\n } // TODO: Without `any` type, Flow says \"Property cannot be accessed on any\n // member of intersection type.\" Whyyyyyy.\n\n\n var root = container._reactRootContainer;\n var fiberRoot;\n\n if (!root) {\n // Initial mount\n root = container._reactRootContainer = legacyCreateRootFromDOMContainer(container, forceHydrate);\n fiberRoot = root._internalRoot;\n\n if (typeof callback === 'function') {\n var originalCallback = callback;\n\n callback = function () {\n var instance = getPublicRootInstance(fiberRoot);\n originalCallback.call(instance);\n };\n } // Initial mount should not be batched.\n\n\n unbatchedUpdates(function () {\n updateContainer(children, fiberRoot, parentComponent, callback);\n });\n } else {\n fiberRoot = root._internalRoot;\n\n if (typeof callback === 'function') {\n var _originalCallback = callback;\n\n callback = function () {\n var instance = getPublicRootInstance(fiberRoot);\n\n _originalCallback.call(instance);\n };\n } // Update\n\n\n updateContainer(children, fiberRoot, parentComponent, callback);\n }\n\n return getPublicRootInstance(fiberRoot);\n}\n\nfunction findDOMNode(componentOrElement) {\n {\n var owner = ReactCurrentOwner$3.current;\n\n if (owner !== null && owner.stateNode !== null) {\n var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;\n\n if (!warnedAboutRefsInRender) {\n error('%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(owner.type) || 'A component');\n }\n\n owner.stateNode._warnedAboutRefsInRender = true;\n }\n }\n\n if (componentOrElement == null) {\n return null;\n }\n\n if (componentOrElement.nodeType === ELEMENT_NODE) {\n return componentOrElement;\n }\n\n {\n return findHostInstanceWithWarning(componentOrElement, 'findDOMNode');\n }\n}\nfunction hydrate(element, container, callback) {\n if (!isValidContainer(container)) {\n {\n throw Error( \"Target container is not a DOM element.\" );\n }\n }\n\n {\n var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;\n\n if (isModernRoot) {\n error('You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call createRoot(container, {hydrate: true}).render(element)?');\n }\n } // TODO: throw or warn if we couldn't hydrate?\n\n\n return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);\n}\nfunction render(element, container, callback) {\n if (!isValidContainer(container)) {\n {\n throw Error( \"Target container is not a DOM element.\" );\n }\n }\n\n {\n var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;\n\n if (isModernRoot) {\n error('You are calling ReactDOM.render() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call root.render(element)?');\n }\n }\n\n return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);\n}\nfunction unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {\n if (!isValidContainer(containerNode)) {\n {\n throw Error( \"Target container is not a DOM element.\" );\n }\n }\n\n if (!(parentComponent != null && has(parentComponent))) {\n {\n throw Error( \"parentComponent must be a valid React Component\" );\n }\n }\n\n return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);\n}\nfunction unmountComponentAtNode(container) {\n if (!isValidContainer(container)) {\n {\n throw Error( \"unmountComponentAtNode(...): Target container is not a DOM element.\" );\n }\n }\n\n {\n var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;\n\n if (isModernRoot) {\n error('You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?');\n }\n }\n\n if (container._reactRootContainer) {\n {\n var rootEl = getReactRootElementInContainer(container);\n var renderedByDifferentReact = rootEl && !getInstanceFromNode$1(rootEl);\n\n if (renderedByDifferentReact) {\n error(\"unmountComponentAtNode(): The node you're attempting to unmount \" + 'was rendered by another copy of React.');\n }\n } // Unmount should not be batched.\n\n\n unbatchedUpdates(function () {\n legacyRenderSubtreeIntoContainer(null, null, container, false, function () {\n // $FlowFixMe This should probably use `delete container._reactRootContainer`\n container._reactRootContainer = null;\n unmarkContainerAsRoot(container);\n });\n }); // If you call unmountComponentAtNode twice in quick succession, you'll\n // get `true` twice. That's probably fine?\n\n return true;\n } else {\n {\n var _rootEl = getReactRootElementInContainer(container);\n\n var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode$1(_rootEl)); // Check if the container itself is a React root node.\n\n var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;\n\n if (hasNonRootReactChild) {\n error(\"unmountComponentAtNode(): The node you're attempting to unmount \" + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.');\n }\n }\n\n return false;\n }\n}\n\nfunction createPortal(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.\nimplementation) {\n var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n return {\n // This tag allow us to uniquely identify this as a React Portal\n $$typeof: REACT_PORTAL_TYPE,\n key: key == null ? null : '' + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n}\n\nvar ReactVersion = '16.13.1';\n\nsetAttemptUserBlockingHydration(attemptUserBlockingHydration$1);\nsetAttemptContinuousHydration(attemptContinuousHydration$1);\nsetAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);\nvar didWarnAboutUnstableCreatePortal = false;\n\n{\n if (typeof Map !== 'function' || // $FlowIssue Flow incorrectly thinks Map has no prototype\n Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' || // $FlowIssue Flow incorrectly thinks Set has no prototype\n Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') {\n error('React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');\n }\n}\n\nsetRestoreImplementation(restoreControlledState$3);\nsetBatchingImplementation(batchedUpdates$1, discreteUpdates$1, flushDiscreteUpdates, batchedEventUpdates$1);\n\nfunction createPortal$1(children, container) {\n var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n if (!isValidContainer(container)) {\n {\n throw Error( \"Target container is not a DOM element.\" );\n }\n } // TODO: pass ReactDOM portal implementation as third argument\n // $FlowFixMe The Flow type is opaque but there's no way to actually create it.\n\n\n return createPortal(children, container, null, key);\n}\n\nfunction renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {\n\n return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);\n}\n\nfunction unstable_createPortal(children, container) {\n var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n {\n if (!didWarnAboutUnstableCreatePortal) {\n didWarnAboutUnstableCreatePortal = true;\n\n warn('The ReactDOM.unstable_createPortal() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactDOM.createPortal() instead. It has the exact same API, ' + 'but without the \"unstable_\" prefix.');\n }\n }\n\n return createPortal$1(children, container, key);\n}\n\nvar Internals = {\n // Keep in sync with ReactDOMUnstableNativeDependencies.js\n // ReactTestUtils.js, and ReactTestUtilsAct.js. This is an array for better minification.\n Events: [getInstanceFromNode$1, getNodeFromInstance$1, getFiberCurrentPropsFromNode$1, injectEventPluginsByName, eventNameDispatchConfigs, accumulateTwoPhaseDispatches, accumulateDirectDispatches, enqueueStateRestore, restoreStateIfNeeded, dispatchEvent, runEventsInBatch, flushPassiveEffects, IsThisRendererActing]\n};\nvar foundDevTools = injectIntoDevTools({\n findFiberByHostInstance: getClosestInstanceFromNode,\n bundleType: 1 ,\n version: ReactVersion,\n rendererPackageName: 'react-dom'\n});\n\n{\n if (!foundDevTools && canUseDOM && window.top === window.self) {\n // If we're in Chrome or Firefox, provide a download link if not installed.\n if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {\n var protocol = window.location.protocol; // Don't warn in exotic cases like chrome-extension://.\n\n if (/^(https?|file):$/.test(protocol)) {\n // eslint-disable-next-line react-internal/no-production-logging\n console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https://fb.me/react-devtools' + (protocol === 'file:' ? '\\nYou might need to use a local HTTP server (instead of file://): ' + 'https://fb.me/react-devtools-faq' : ''), 'font-weight:bold');\n }\n }\n }\n}\n\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;\nexports.createPortal = createPortal$1;\nexports.findDOMNode = findDOMNode;\nexports.flushSync = flushSync;\nexports.hydrate = hydrate;\nexports.render = render;\nexports.unmountComponentAtNode = unmountComponentAtNode;\nexports.unstable_batchedUpdates = batchedUpdates$1;\nexports.unstable_createPortal = unstable_createPortal;\nexports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;\nexports.version = ReactVersion;\n })();\n}\n","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.min.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}\n","/** @license React v16.13.1\n * react-is.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\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\n// (unstable) APIs that have been removed. Can we remove the symbols?\n\nvar REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;\nvar REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;\nvar REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;\nvar REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;\n\nfunction isValidElementType(type) {\n return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.\n type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);\n}\n\nfunction typeOf(object) {\n if (typeof object === 'object' && object !== null) {\n var $$typeof = object.$$typeof;\n\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n var type = object.type;\n\n switch (type) {\n case REACT_ASYNC_MODE_TYPE:\n case REACT_CONCURRENT_MODE_TYPE:\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n return type;\n\n default:\n var $$typeofType = type && type.$$typeof;\n\n switch ($$typeofType) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n case REACT_PROVIDER_TYPE:\n return $$typeofType;\n\n default:\n return $$typeof;\n }\n\n }\n\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n\n return undefined;\n} // AsyncMode is deprecated along with isAsyncMode\n\nvar AsyncMode = REACT_ASYNC_MODE_TYPE;\nvar ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;\nvar ContextConsumer = REACT_CONTEXT_TYPE;\nvar ContextProvider = REACT_PROVIDER_TYPE;\nvar Element = REACT_ELEMENT_TYPE;\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Fragment = REACT_FRAGMENT_TYPE;\nvar Lazy = REACT_LAZY_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nvar Portal = REACT_PORTAL_TYPE;\nvar Profiler = REACT_PROFILER_TYPE;\nvar StrictMode = REACT_STRICT_MODE_TYPE;\nvar Suspense = REACT_SUSPENSE_TYPE;\nvar hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated\n\nfunction isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}\nfunction isConcurrentMode(object) {\n return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;\n}\nfunction isContextConsumer(object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isContextProvider(object) {\n return typeOf(object) === REACT_PROVIDER_TYPE;\n}\nfunction isElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\nfunction isForwardRef(object) {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\nfunction isFragment(object) {\n return typeOf(object) === REACT_FRAGMENT_TYPE;\n}\nfunction isLazy(object) {\n return typeOf(object) === REACT_LAZY_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\nfunction isPortal(object) {\n return typeOf(object) === REACT_PORTAL_TYPE;\n}\nfunction isProfiler(object) {\n return typeOf(object) === REACT_PROFILER_TYPE;\n}\nfunction isStrictMode(object) {\n return typeOf(object) === REACT_STRICT_MODE_TYPE;\n}\nfunction isSuspense(object) {\n return typeOf(object) === REACT_SUSPENSE_TYPE;\n}\n\nexports.AsyncMode = AsyncMode;\nexports.ConcurrentMode = ConcurrentMode;\nexports.ContextConsumer = ContextConsumer;\nexports.ContextProvider = ContextProvider;\nexports.Element = Element;\nexports.ForwardRef = ForwardRef;\nexports.Fragment = Fragment;\nexports.Lazy = Lazy;\nexports.Memo = Memo;\nexports.Portal = Portal;\nexports.Profiler = Profiler;\nexports.StrictMode = StrictMode;\nexports.Suspense = Suspense;\nexports.isAsyncMode = isAsyncMode;\nexports.isConcurrentMode = isConcurrentMode;\nexports.isContextConsumer = isContextConsumer;\nexports.isContextProvider = isContextProvider;\nexports.isElement = isElement;\nexports.isForwardRef = isForwardRef;\nexports.isFragment = isFragment;\nexports.isLazy = isLazy;\nexports.isMemo = isMemo;\nexports.isPortal = isPortal;\nexports.isProfiler = isProfiler;\nexports.isStrictMode = isStrictMode;\nexports.isSuspense = isSuspense;\nexports.isValidElementType = isValidElementType;\nexports.typeOf = typeOf;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","import React from 'react';\nexport var ReactReduxContext =\n/*#__PURE__*/\nReact.createContext(null);\n\nif (process.env.NODE_ENV !== 'production') {\n ReactReduxContext.displayName = 'ReactRedux';\n}\n\nexport default ReactReduxContext;","import React, { useMemo, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { ReactReduxContext } from './Context';\nimport Subscription from '../utils/Subscription';\n\nfunction Provider(_ref) {\n var store = _ref.store,\n context = _ref.context,\n children = _ref.children;\n var contextValue = useMemo(function () {\n var subscription = new Subscription(store);\n subscription.onStateChange = subscription.notifyNestedSubs;\n return {\n store: store,\n subscription: subscription\n };\n }, [store]);\n var previousState = useMemo(function () {\n return store.getState();\n }, [store]);\n useEffect(function () {\n var subscription = contextValue.subscription;\n subscription.trySubscribe();\n\n if (previousState !== store.getState()) {\n subscription.notifyNestedSubs();\n }\n\n return function () {\n subscription.tryUnsubscribe();\n subscription.onStateChange = null;\n };\n }, [contextValue, previousState]);\n var Context = context || ReactReduxContext;\n return React.createElement(Context.Provider, {\n value: contextValue\n }, children);\n}\n\nif (process.env.NODE_ENV !== 'production') {\n Provider.propTypes = {\n store: PropTypes.shape({\n subscribe: PropTypes.func.isRequired,\n dispatch: PropTypes.func.isRequired,\n getState: PropTypes.func.isRequired\n }),\n context: PropTypes.object,\n children: PropTypes.any\n };\n}\n\nexport default Provider;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport hoistStatics from 'hoist-non-react-statics';\nimport React, { useContext, useMemo, useRef, useReducer } from 'react';\nimport { isValidElementType, isContextConsumer } from 'react-is';\nimport Subscription from '../utils/Subscription';\nimport { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';\nimport { ReactReduxContext } from './Context'; // Define some constant arrays just to avoid re-creating these\n\nvar EMPTY_ARRAY = [];\nvar NO_SUBSCRIPTION_ARRAY = [null, null];\n\nvar stringifyComponent = function stringifyComponent(Comp) {\n try {\n return JSON.stringify(Comp);\n } catch (err) {\n return String(Comp);\n }\n};\n\nfunction storeStateUpdatesReducer(state, action) {\n var updateCount = state[1];\n return [action.payload, updateCount + 1];\n}\n\nfunction useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {\n useIsomorphicLayoutEffect(function () {\n return effectFunc.apply(void 0, effectArgs);\n }, dependencies);\n}\n\nfunction captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, actualChildProps, childPropsFromStoreUpdate, notifyNestedSubs) {\n // We want to capture the wrapper props and child props we used for later comparisons\n lastWrapperProps.current = wrapperProps;\n lastChildProps.current = actualChildProps;\n renderIsScheduled.current = false; // If the render was from a store update, clear out that reference and cascade the subscriber update\n\n if (childPropsFromStoreUpdate.current) {\n childPropsFromStoreUpdate.current = null;\n notifyNestedSubs();\n }\n}\n\nfunction subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, childPropsFromStoreUpdate, notifyNestedSubs, forceComponentUpdateDispatch) {\n // If we're not subscribed to the store, nothing to do here\n if (!shouldHandleStateChanges) return; // Capture values for checking if and when this component unmounts\n\n var didUnsubscribe = false;\n var lastThrownError = null; // We'll run this callback every time a store subscription update propagates to this component\n\n var checkForUpdates = function checkForUpdates() {\n if (didUnsubscribe) {\n // Don't run stale listeners.\n // Redux doesn't guarantee unsubscriptions happen until next dispatch.\n return;\n }\n\n var latestStoreState = store.getState();\n var newChildProps, error;\n\n try {\n // Actually run the selector with the most recent store state and wrapper props\n // to determine what the child props should be\n newChildProps = childPropsSelector(latestStoreState, lastWrapperProps.current);\n } catch (e) {\n error = e;\n lastThrownError = e;\n }\n\n if (!error) {\n lastThrownError = null;\n } // If the child props haven't changed, nothing to do here - cascade the subscription update\n\n\n if (newChildProps === lastChildProps.current) {\n if (!renderIsScheduled.current) {\n notifyNestedSubs();\n }\n } else {\n // Save references to the new child props. Note that we track the \"child props from store update\"\n // as a ref instead of a useState/useReducer because we need a way to determine if that value has\n // been processed. If this went into useState/useReducer, we couldn't clear out the value without\n // forcing another re-render, which we don't want.\n lastChildProps.current = newChildProps;\n childPropsFromStoreUpdate.current = newChildProps;\n renderIsScheduled.current = true; // If the child props _did_ change (or we caught an error), this wrapper component needs to re-render\n\n forceComponentUpdateDispatch({\n type: 'STORE_UPDATED',\n payload: {\n error: error\n }\n });\n }\n }; // Actually subscribe to the nearest connected ancestor (or store)\n\n\n subscription.onStateChange = checkForUpdates;\n subscription.trySubscribe(); // Pull data from the store after first render in case the store has\n // changed since we began.\n\n checkForUpdates();\n\n var unsubscribeWrapper = function unsubscribeWrapper() {\n didUnsubscribe = true;\n subscription.tryUnsubscribe();\n subscription.onStateChange = null;\n\n if (lastThrownError) {\n // It's possible that we caught an error due to a bad mapState function, but the\n // parent re-rendered without this component and we're about to unmount.\n // This shouldn't happen as long as we do top-down subscriptions correctly, but\n // if we ever do those wrong, this throw will surface the error in our tests.\n // In that case, throw the error from here so it doesn't get lost.\n throw lastThrownError;\n }\n };\n\n return unsubscribeWrapper;\n}\n\nvar initStateUpdates = function initStateUpdates() {\n return [null, 0];\n};\n\nexport default function connectAdvanced(\n/*\r\n selectorFactory is a func that is responsible for returning the selector function used to\r\n compute new props from state, props, and dispatch. For example:\r\n export default connectAdvanced((dispatch, options) => (state, props) => ({\r\n thing: state.things[props.thingId],\r\n saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),\r\n }))(YourComponent)\r\n Access to dispatch is provided to the factory so selectorFactories can bind actionCreators\r\n outside of their selector as an optimization. Options passed to connectAdvanced are passed to\r\n the selectorFactory, along with displayName and WrappedComponent, as the second argument.\r\n Note that selectorFactory is responsible for all caching/memoization of inbound and outbound\r\n props. Do not use connectAdvanced directly without memoizing results between calls to your\r\n selector, otherwise the Connect component will re-render on every state or props change.\r\n*/\nselectorFactory, // options object:\n_ref) {\n if (_ref === void 0) {\n _ref = {};\n }\n\n var _ref2 = _ref,\n _ref2$getDisplayName = _ref2.getDisplayName,\n getDisplayName = _ref2$getDisplayName === void 0 ? function (name) {\n return \"ConnectAdvanced(\" + name + \")\";\n } : _ref2$getDisplayName,\n _ref2$methodName = _ref2.methodName,\n methodName = _ref2$methodName === void 0 ? 'connectAdvanced' : _ref2$methodName,\n _ref2$renderCountProp = _ref2.renderCountProp,\n renderCountProp = _ref2$renderCountProp === void 0 ? undefined : _ref2$renderCountProp,\n _ref2$shouldHandleSta = _ref2.shouldHandleStateChanges,\n shouldHandleStateChanges = _ref2$shouldHandleSta === void 0 ? true : _ref2$shouldHandleSta,\n _ref2$storeKey = _ref2.storeKey,\n storeKey = _ref2$storeKey === void 0 ? 'store' : _ref2$storeKey,\n _ref2$withRef = _ref2.withRef,\n withRef = _ref2$withRef === void 0 ? false : _ref2$withRef,\n _ref2$forwardRef = _ref2.forwardRef,\n forwardRef = _ref2$forwardRef === void 0 ? false : _ref2$forwardRef,\n _ref2$context = _ref2.context,\n context = _ref2$context === void 0 ? ReactReduxContext : _ref2$context,\n connectOptions = _objectWithoutPropertiesLoose(_ref2, [\"getDisplayName\", \"methodName\", \"renderCountProp\", \"shouldHandleStateChanges\", \"storeKey\", \"withRef\", \"forwardRef\", \"context\"]);\n\n if (process.env.NODE_ENV !== 'production') {\n if (renderCountProp !== undefined) {\n throw new Error(\"renderCountProp is removed. render counting is built into the latest React Dev Tools profiling extension\");\n }\n\n if (withRef) {\n throw new Error('withRef is removed. To access the wrapped instance, use a ref on the connected component');\n }\n\n var customStoreWarningMessage = 'To use a custom Redux store for specific components, create a custom React context with ' + \"React.createContext(), and pass the context object to React Redux's Provider and specific components\" + ' like: <Provider context={MyContext}><ConnectedComponent context={MyContext} /></Provider>. ' + 'You may also pass a {context : MyContext} option to connect';\n\n if (storeKey !== 'store') {\n throw new Error('storeKey has been removed and does not do anything. ' + customStoreWarningMessage);\n }\n }\n\n var Context = context;\n return function wrapWithConnect(WrappedComponent) {\n if (process.env.NODE_ENV !== 'production' && !isValidElementType(WrappedComponent)) {\n throw new Error(\"You must pass a component to the function returned by \" + (methodName + \". Instead received \" + stringifyComponent(WrappedComponent)));\n }\n\n var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n var displayName = getDisplayName(wrappedComponentName);\n\n var selectorFactoryOptions = _extends({}, connectOptions, {\n getDisplayName: getDisplayName,\n methodName: methodName,\n renderCountProp: renderCountProp,\n shouldHandleStateChanges: shouldHandleStateChanges,\n storeKey: storeKey,\n displayName: displayName,\n wrappedComponentName: wrappedComponentName,\n WrappedComponent: WrappedComponent\n });\n\n var pure = connectOptions.pure;\n\n function createChildSelector(store) {\n return selectorFactory(store.dispatch, selectorFactoryOptions);\n } // If we aren't running in \"pure\" mode, we don't want to memoize values.\n // To avoid conditionally calling hooks, we fall back to a tiny wrapper\n // that just executes the given callback immediately.\n\n\n var usePureOnlyMemo = pure ? useMemo : function (callback) {\n return callback();\n };\n\n function ConnectFunction(props) {\n var _useMemo = useMemo(function () {\n // Distinguish between actual \"data\" props that were passed to the wrapper component,\n // and values needed to control behavior (forwarded refs, alternate context instances).\n // To maintain the wrapperProps object reference, memoize this destructuring.\n var reactReduxForwardedRef = props.reactReduxForwardedRef,\n wrapperProps = _objectWithoutPropertiesLoose(props, [\"reactReduxForwardedRef\"]);\n\n return [props.context, reactReduxForwardedRef, wrapperProps];\n }, [props]),\n propsContext = _useMemo[0],\n reactReduxForwardedRef = _useMemo[1],\n wrapperProps = _useMemo[2];\n\n var ContextToUse = useMemo(function () {\n // Users may optionally pass in a custom context instance to use instead of our ReactReduxContext.\n // Memoize the check that determines which context instance we should use.\n return propsContext && propsContext.Consumer && isContextConsumer(React.createElement(propsContext.Consumer, null)) ? propsContext : Context;\n }, [propsContext, Context]); // Retrieve the store and ancestor subscription via context, if available\n\n var contextValue = useContext(ContextToUse); // The store _must_ exist as either a prop or in context.\n // We'll check to see if it _looks_ like a Redux store first.\n // This allows us to pass through a `store` prop that is just a plain value.\n\n var didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);\n var didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);\n\n if (process.env.NODE_ENV !== 'production' && !didStoreComeFromProps && !didStoreComeFromContext) {\n throw new Error(\"Could not find \\\"store\\\" in the context of \" + (\"\\\"\" + displayName + \"\\\". Either wrap the root component in a <Provider>, \") + \"or pass a custom React context provider to <Provider> and the corresponding \" + (\"React context consumer to \" + displayName + \" in connect options.\"));\n } // Based on the previous check, one of these must be true\n\n\n var store = didStoreComeFromProps ? props.store : contextValue.store;\n var childPropsSelector = useMemo(function () {\n // The child props selector needs the store reference as an input.\n // Re-create this selector whenever the store changes.\n return createChildSelector(store);\n }, [store]);\n\n var _useMemo2 = useMemo(function () {\n if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY; // This Subscription's source should match where store came from: props vs. context. A component\n // connected to the store via props shouldn't use subscription from context, or vice versa.\n\n var subscription = new Subscription(store, didStoreComeFromProps ? null : contextValue.subscription); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in\n // the middle of the notification loop, where `subscription` will then be null. This can\n // probably be avoided if Subscription's listeners logic is changed to not call listeners\n // that have been unsubscribed in the middle of the notification loop.\n\n var notifyNestedSubs = subscription.notifyNestedSubs.bind(subscription);\n return [subscription, notifyNestedSubs];\n }, [store, didStoreComeFromProps, contextValue]),\n subscription = _useMemo2[0],\n notifyNestedSubs = _useMemo2[1]; // Determine what {store, subscription} value should be put into nested context, if necessary,\n // and memoize that value to avoid unnecessary context updates.\n\n\n var overriddenContextValue = useMemo(function () {\n if (didStoreComeFromProps) {\n // This component is directly subscribed to a store from props.\n // We don't want descendants reading from this store - pass down whatever\n // the existing context value is from the nearest connected ancestor.\n return contextValue;\n } // Otherwise, put this component's subscription instance into context, so that\n // connected descendants won't update until after this component is done\n\n\n return _extends({}, contextValue, {\n subscription: subscription\n });\n }, [didStoreComeFromProps, contextValue, subscription]); // We need to force this wrapper component to re-render whenever a Redux store update\n // causes a change to the calculated child component props (or we caught an error in mapState)\n\n var _useReducer = useReducer(storeStateUpdatesReducer, EMPTY_ARRAY, initStateUpdates),\n _useReducer$ = _useReducer[0],\n previousStateUpdateResult = _useReducer$[0],\n forceComponentUpdateDispatch = _useReducer[1]; // Propagate any mapState/mapDispatch errors upwards\n\n\n if (previousStateUpdateResult && previousStateUpdateResult.error) {\n throw previousStateUpdateResult.error;\n } // Set up refs to coordinate values between the subscription effect and the render logic\n\n\n var lastChildProps = useRef();\n var lastWrapperProps = useRef(wrapperProps);\n var childPropsFromStoreUpdate = useRef();\n var renderIsScheduled = useRef(false);\n var actualChildProps = usePureOnlyMemo(function () {\n // Tricky logic here:\n // - This render may have been triggered by a Redux store update that produced new child props\n // - However, we may have gotten new wrapper props after that\n // If we have new child props, and the same wrapper props, we know we should use the new child props as-is.\n // But, if we have new wrapper props, those might change the child props, so we have to recalculate things.\n // So, we'll use the child props from store update only if the wrapper props are the same as last time.\n if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) {\n return childPropsFromStoreUpdate.current;\n } // TODO We're reading the store directly in render() here. Bad idea?\n // This will likely cause Bad Things (TM) to happen in Concurrent Mode.\n // Note that we do this because on renders _not_ caused by store updates, we need the latest store state\n // to determine what the child props should be.\n\n\n return childPropsSelector(store.getState(), wrapperProps);\n }, [store, previousStateUpdateResult, wrapperProps]); // We need this to execute synchronously every time we re-render. However, React warns\n // about useLayoutEffect in SSR, so we try to detect environment and fall back to\n // just useEffect instead to avoid the warning, since neither will run anyway.\n\n useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, actualChildProps, childPropsFromStoreUpdate, notifyNestedSubs]); // Our re-subscribe logic only runs when the store/subscription setup changes\n\n useIsomorphicLayoutEffectWithArgs(subscribeUpdates, [shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, childPropsFromStoreUpdate, notifyNestedSubs, forceComponentUpdateDispatch], [store, subscription, childPropsSelector]); // Now that all that's done, we can finally try to actually render the child component.\n // We memoize the elements for the rendered child component as an optimization.\n\n var renderedWrappedComponent = useMemo(function () {\n return React.createElement(WrappedComponent, _extends({}, actualChildProps, {\n ref: reactReduxForwardedRef\n }));\n }, [reactReduxForwardedRef, WrappedComponent, actualChildProps]); // If React sees the exact same element reference as last time, it bails out of re-rendering\n // that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate.\n\n var renderedChild = useMemo(function () {\n if (shouldHandleStateChanges) {\n // If this component is subscribed to store updates, we need to pass its own\n // subscription instance down to our descendants. That means rendering the same\n // Context instance, and putting a different value into the context.\n return React.createElement(ContextToUse.Provider, {\n value: overriddenContextValue\n }, renderedWrappedComponent);\n }\n\n return renderedWrappedComponent;\n }, [ContextToUse, renderedWrappedComponent, overriddenContextValue]);\n return renderedChild;\n } // If we're in \"pure\" mode, ensure our wrapper component only re-renders when incoming props have changed.\n\n\n var Connect = pure ? React.memo(ConnectFunction) : ConnectFunction;\n Connect.WrappedComponent = WrappedComponent;\n Connect.displayName = displayName;\n\n if (forwardRef) {\n var forwarded = React.forwardRef(function forwardConnectRef(props, ref) {\n return React.createElement(Connect, _extends({}, props, {\n reactReduxForwardedRef: ref\n }));\n });\n forwarded.displayName = displayName;\n forwarded.WrappedComponent = WrappedComponent;\n return hoistStatics(forwarded, WrappedComponent);\n }\n\n return hoistStatics(Connect, WrappedComponent);\n };\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport connectAdvanced from '../components/connectAdvanced';\nimport shallowEqual from '../utils/shallowEqual';\nimport defaultMapDispatchToPropsFactories from './mapDispatchToProps';\nimport defaultMapStateToPropsFactories from './mapStateToProps';\nimport defaultMergePropsFactories from './mergeProps';\nimport defaultSelectorFactory from './selectorFactory';\n/*\r\n connect is a facade over connectAdvanced. It turns its args into a compatible\r\n selectorFactory, which has the signature:\r\n\r\n (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps\r\n \r\n connect passes its args to connectAdvanced as options, which will in turn pass them to\r\n selectorFactory each time a Connect component instance is instantiated or hot reloaded.\r\n\r\n selectorFactory returns a final props selector from its mapStateToProps,\r\n mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,\r\n mergePropsFactories, and pure args.\r\n\r\n The resulting final props selector is called by the Connect component instance whenever\r\n it receives new props or store state.\r\n */\n\nfunction match(arg, factories, name) {\n for (var i = factories.length - 1; i >= 0; i--) {\n var result = factories[i](arg);\n if (result) return result;\n }\n\n return function (dispatch, options) {\n throw new Error(\"Invalid value of type \" + typeof arg + \" for \" + name + \" argument when connecting component \" + options.wrappedComponentName + \".\");\n };\n}\n\nfunction strictEqual(a, b) {\n return a === b;\n} // createConnect with default args builds the 'official' connect behavior. Calling it with\n// different options opens up some testing and extensibility scenarios\n\n\nexport function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? defaultMergePropsFactories : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? defaultSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,\n extraOptions = _objectWithoutPropertiesLoose(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}\nexport default\n/*#__PURE__*/\ncreateConnect();","import { bindActionCreators } from 'redux';\nimport { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';\nexport function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {\n return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined;\n}\nexport function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {\n return !mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) {\n return {\n dispatch: dispatch\n };\n }) : undefined;\n}\nexport function whenMapDispatchToPropsIsObject(mapDispatchToProps) {\n return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? wrapMapToPropsConstant(function (dispatch) {\n return bindActionCreators(mapDispatchToProps, dispatch);\n }) : undefined;\n}\nexport default [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];","import { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';\nexport function whenMapStateToPropsIsFunction(mapStateToProps) {\n return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined;\n}\nexport function whenMapStateToPropsIsMissing(mapStateToProps) {\n return !mapStateToProps ? wrapMapToPropsConstant(function () {\n return {};\n }) : undefined;\n}\nexport default [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport verifyPlainObject from '../utils/verifyPlainObject';\nexport function defaultMergeProps(stateProps, dispatchProps, ownProps) {\n return _extends({}, ownProps, {}, stateProps, {}, dispatchProps);\n}\nexport function wrapMergePropsFunc(mergeProps) {\n return function initMergePropsProxy(dispatch, _ref) {\n var displayName = _ref.displayName,\n pure = _ref.pure,\n areMergedPropsEqual = _ref.areMergedPropsEqual;\n var hasRunOnce = false;\n var mergedProps;\n return function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n if (hasRunOnce) {\n if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;\n } else {\n hasRunOnce = true;\n mergedProps = nextMergedProps;\n if (process.env.NODE_ENV !== 'production') verifyPlainObject(mergedProps, displayName, 'mergeProps');\n }\n\n return mergedProps;\n };\n };\n}\nexport function whenMergePropsIsFunction(mergeProps) {\n return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;\n}\nexport function whenMergePropsIsOmitted(mergeProps) {\n return !mergeProps ? function () {\n return defaultMergeProps;\n } : undefined;\n}\nexport default [whenMergePropsIsFunction, whenMergePropsIsOmitted];","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport verifySubselectors from './verifySubselectors';\nexport function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {\n return function impureFinalPropsSelector(state, ownProps) {\n return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);\n };\n}\nexport function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {\n var areStatesEqual = _ref.areStatesEqual,\n areOwnPropsEqual = _ref.areOwnPropsEqual,\n areStatePropsEqual = _ref.areStatePropsEqual;\n var hasRunAtLeastOnce = false;\n var state;\n var ownProps;\n var stateProps;\n var dispatchProps;\n var mergedProps;\n\n function handleFirstCall(firstState, firstOwnProps) {\n state = firstState;\n ownProps = firstOwnProps;\n stateProps = mapStateToProps(state, ownProps);\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n hasRunAtLeastOnce = true;\n return mergedProps;\n }\n\n function handleNewPropsAndNewState() {\n stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewProps() {\n if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewState() {\n var nextStateProps = mapStateToProps(state, ownProps);\n var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n stateProps = nextStateProps;\n if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleSubsequentCalls(nextState, nextOwnProps) {\n var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n var stateChanged = !areStatesEqual(nextState, state);\n state = nextState;\n ownProps = nextOwnProps;\n if (propsChanged && stateChanged) return handleNewPropsAndNewState();\n if (propsChanged) return handleNewProps();\n if (stateChanged) return handleNewState();\n return mergedProps;\n }\n\n return function pureFinalPropsSelector(nextState, nextOwnProps) {\n return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n };\n} // TODO: Add more comments\n// If pure is true, the selector returned by selectorFactory will memoize its results,\n// allowing connectAdvanced's shouldComponentUpdate to return false if final\n// props have not changed. If false, the selector will always return a new\n// object and shouldComponentUpdate will always return true.\n\nexport default function finalPropsSelectorFactory(dispatch, _ref2) {\n var initMapStateToProps = _ref2.initMapStateToProps,\n initMapDispatchToProps = _ref2.initMapDispatchToProps,\n initMergeProps = _ref2.initMergeProps,\n options = _objectWithoutPropertiesLoose(_ref2, [\"initMapStateToProps\", \"initMapDispatchToProps\", \"initMergeProps\"]);\n\n var mapStateToProps = initMapStateToProps(dispatch, options);\n var mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n var mergeProps = initMergeProps(dispatch, options);\n\n if (process.env.NODE_ENV !== 'production') {\n verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);\n }\n\n var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;\n return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}","import warning from '../utils/warning';\n\nfunction verify(selector, methodName, displayName) {\n if (!selector) {\n throw new Error(\"Unexpected value for \" + methodName + \" in \" + displayName + \".\");\n } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {\n if (!Object.prototype.hasOwnProperty.call(selector, 'dependsOnOwnProps')) {\n warning(\"The selector for \" + methodName + \" of \" + displayName + \" did not specify a value for dependsOnOwnProps.\");\n }\n }\n}\n\nexport default function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) {\n verify(mapStateToProps, 'mapStateToProps', displayName);\n verify(mapDispatchToProps, 'mapDispatchToProps', displayName);\n verify(mergeProps, 'mergeProps', displayName);\n}","import verifyPlainObject from '../utils/verifyPlainObject';\nexport function wrapMapToPropsConstant(getConstant) {\n return function initConstantSelector(dispatch, options) {\n var constant = getConstant(dispatch, options);\n\n function constantSelector() {\n return constant;\n }\n\n constantSelector.dependsOnOwnProps = false;\n return constantSelector;\n };\n} // dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args\n// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine\n// whether mapToProps needs to be invoked when props have changed.\n//\n// A length of one signals that mapToProps does not depend on props from the parent component.\n// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and\n// therefore not reporting its length accurately..\n\nexport function getDependsOnOwnProps(mapToProps) {\n return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n} // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,\n// this function wraps mapToProps in a proxy function which does several things:\n//\n// * Detects whether the mapToProps function being called depends on props, which\n// is used by selectorFactory to decide if it should reinvoke on props changes.\n//\n// * On first call, handles mapToProps if returns another function, and treats that\n// new function as the true mapToProps for subsequent calls.\n//\n// * On first call, verifies the first result is a plain object, in order to warn\n// the developer that their mapToProps function is not returning a valid result.\n//\n\nexport function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') verifyPlainObject(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}","import { ReactReduxContext } from '../components/Context';\nimport { useStore as useDefaultStore, createStoreHook } from './useStore';\n/**\r\n * Hook factory, which creates a `useDispatch` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\r\n * @returns {Function} A `useDispatch` hook bound to the specified context.\r\n */\n\nexport function createDispatchHook(context) {\n if (context === void 0) {\n context = ReactReduxContext;\n }\n\n var useStore = context === ReactReduxContext ? useDefaultStore : createStoreHook(context);\n return function useDispatch() {\n var store = useStore();\n return store.dispatch;\n };\n}\n/**\r\n * A hook to access the redux `dispatch` function.\r\n *\r\n * @returns {any|function} redux store's `dispatch` function\r\n *\r\n * @example\r\n *\r\n * import React, { useCallback } from 'react'\r\n * import { useDispatch } from 'react-redux'\r\n *\r\n * export const CounterComponent = ({ value }) => {\r\n * const dispatch = useDispatch()\r\n * const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])\r\n * return (\r\n * <div>\r\n * <span>{value}</span>\r\n * <button onClick={increaseCounter}>Increase counter</button>\r\n * </div>\r\n * )\r\n * }\r\n */\n\nexport var useDispatch =\n/*#__PURE__*/\ncreateDispatchHook();","import { useContext } from 'react';\nimport { ReactReduxContext } from '../components/Context';\n/**\r\n * A hook to access the value of the `ReactReduxContext`. This is a low-level\r\n * hook that you should usually not need to call directly.\r\n *\r\n * @returns {any} the value of the `ReactReduxContext`\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useReduxContext } from 'react-redux'\r\n *\r\n * export const CounterComponent = ({ value }) => {\r\n * const { store } = useReduxContext()\r\n * return <div>{store.getState()}</div>\r\n * }\r\n */\n\nexport function useReduxContext() {\n var contextValue = useContext(ReactReduxContext);\n\n if (process.env.NODE_ENV !== 'production' && !contextValue) {\n throw new Error('could not find react-redux context value; please ensure the component is wrapped in a <Provider>');\n }\n\n return contextValue;\n}","import { useReducer, useRef, useMemo, useContext, useDebugValue } from 'react';\nimport { useReduxContext as useDefaultReduxContext } from './useReduxContext';\nimport Subscription from '../utils/Subscription';\nimport { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';\nimport { ReactReduxContext } from '../components/Context';\n\nvar refEquality = function refEquality(a, b) {\n return a === b;\n};\n\nfunction useSelectorWithStoreAndSubscription(selector, equalityFn, store, contextSub) {\n var _useReducer = useReducer(function (s) {\n return s + 1;\n }, 0),\n forceRender = _useReducer[1];\n\n var subscription = useMemo(function () {\n return new Subscription(store, contextSub);\n }, [store, contextSub]);\n var latestSubscriptionCallbackError = useRef();\n var latestSelector = useRef();\n var latestStoreState = useRef();\n var latestSelectedState = useRef();\n var storeState = store.getState();\n var selectedState;\n\n try {\n if (selector !== latestSelector.current || storeState !== latestStoreState.current || latestSubscriptionCallbackError.current) {\n selectedState = selector(storeState);\n } else {\n selectedState = latestSelectedState.current;\n }\n } catch (err) {\n if (latestSubscriptionCallbackError.current) {\n err.message += \"\\nThe error may be correlated with this previous error:\\n\" + latestSubscriptionCallbackError.current.stack + \"\\n\\n\";\n }\n\n throw err;\n }\n\n useIsomorphicLayoutEffect(function () {\n latestSelector.current = selector;\n latestStoreState.current = storeState;\n latestSelectedState.current = selectedState;\n latestSubscriptionCallbackError.current = undefined;\n });\n useIsomorphicLayoutEffect(function () {\n function checkForUpdates() {\n try {\n var newSelectedState = latestSelector.current(store.getState());\n\n if (equalityFn(newSelectedState, latestSelectedState.current)) {\n return;\n }\n\n latestSelectedState.current = newSelectedState;\n } catch (err) {\n // we ignore all errors here, since when the component\n // is re-rendered, the selectors are called again, and\n // will throw again, if neither props nor store state\n // changed\n latestSubscriptionCallbackError.current = err;\n }\n\n forceRender();\n }\n\n subscription.onStateChange = checkForUpdates;\n subscription.trySubscribe();\n checkForUpdates();\n return function () {\n return subscription.tryUnsubscribe();\n };\n }, [store, subscription]);\n return selectedState;\n}\n/**\r\n * Hook factory, which creates a `useSelector` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\r\n * @returns {Function} A `useSelector` hook bound to the specified context.\r\n */\n\n\nexport function createSelectorHook(context) {\n if (context === void 0) {\n context = ReactReduxContext;\n }\n\n var useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : function () {\n return useContext(context);\n };\n return function useSelector(selector, equalityFn) {\n if (equalityFn === void 0) {\n equalityFn = refEquality;\n }\n\n if (process.env.NODE_ENV !== 'production' && !selector) {\n throw new Error(\"You must pass a selector to useSelector\");\n }\n\n var _useReduxContext = useReduxContext(),\n store = _useReduxContext.store,\n contextSub = _useReduxContext.subscription;\n\n var selectedState = useSelectorWithStoreAndSubscription(selector, equalityFn, store, contextSub);\n useDebugValue(selectedState);\n return selectedState;\n };\n}\n/**\r\n * A hook to access the redux store's state. This hook takes a selector function\r\n * as an argument. The selector is called with the store state.\r\n *\r\n * This hook takes an optional equality comparison function as the second parameter\r\n * that allows you to customize the way the selected state is compared to determine\r\n * whether the component needs to be re-rendered.\r\n *\r\n * @param {Function} selector the selector function\r\n * @param {Function=} equalityFn the function that will be used to determine equality\r\n *\r\n * @returns {any} the selected state\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useSelector } from 'react-redux'\r\n *\r\n * export const CounterComponent = () => {\r\n * const counter = useSelector(state => state.counter)\r\n * return <div>{counter}</div>\r\n * }\r\n */\n\nexport var useSelector =\n/*#__PURE__*/\ncreateSelectorHook();","import { useContext } from 'react';\nimport { ReactReduxContext } from '../components/Context';\nimport { useReduxContext as useDefaultReduxContext } from './useReduxContext';\n/**\r\n * Hook factory, which creates a `useStore` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\r\n * @returns {Function} A `useStore` hook bound to the specified context.\r\n */\n\nexport function createStoreHook(context) {\n if (context === void 0) {\n context = ReactReduxContext;\n }\n\n var useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : function () {\n return useContext(context);\n };\n return function useStore() {\n var _useReduxContext = useReduxContext(),\n store = _useReduxContext.store;\n\n return store;\n };\n}\n/**\r\n * A hook to access the redux store.\r\n *\r\n * @returns {any} the redux store\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useStore } from 'react-redux'\r\n *\r\n * export const ExampleComponent = () => {\r\n * const store = useStore()\r\n * return <div>{store.getState()}</div>\r\n * }\r\n */\n\nexport var useStore =\n/*#__PURE__*/\ncreateStoreHook();","import Provider from './components/Provider';\nimport connectAdvanced from './components/connectAdvanced';\nimport { ReactReduxContext } from './components/Context';\nimport connect from './connect/connect';\nimport { useDispatch, createDispatchHook } from './hooks/useDispatch';\nimport { useSelector, createSelectorHook } from './hooks/useSelector';\nimport { useStore, createStoreHook } from './hooks/useStore';\nimport { setBatch } from './utils/batch';\nimport { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates';\nimport shallowEqual from './utils/shallowEqual';\nsetBatch(batch);\nexport { Provider, connectAdvanced, ReactReduxContext, connect, batch, useDispatch, createDispatchHook, useSelector, createSelectorHook, useStore, createStoreHook, shallowEqual };","import { getBatch } from './batch'; // encapsulates the subscription logic for connecting a component to the redux store, as\n// well as nesting subscriptions of descendant components, so that we can ensure the\n// ancestor components re-render before descendants\n\nvar nullListeners = {\n notify: function notify() {}\n};\n\nfunction createListenerCollection() {\n var batch = getBatch();\n var first = null;\n var last = null;\n return {\n clear: function clear() {\n first = null;\n last = null;\n },\n notify: function notify() {\n batch(function () {\n var listener = first;\n\n while (listener) {\n listener.callback();\n listener = listener.next;\n }\n });\n },\n get: function get() {\n var listeners = [];\n var listener = first;\n\n while (listener) {\n listeners.push(listener);\n listener = listener.next;\n }\n\n return listeners;\n },\n subscribe: function subscribe(callback) {\n var isSubscribed = true;\n var listener = last = {\n callback: callback,\n next: null,\n prev: last\n };\n\n if (listener.prev) {\n listener.prev.next = listener;\n } else {\n first = listener;\n }\n\n return function unsubscribe() {\n if (!isSubscribed || first === null) return;\n isSubscribed = false;\n\n if (listener.next) {\n listener.next.prev = listener.prev;\n } else {\n last = listener.prev;\n }\n\n if (listener.prev) {\n listener.prev.next = listener.next;\n } else {\n first = listener.next;\n }\n };\n }\n };\n}\n\nvar Subscription =\n/*#__PURE__*/\nfunction () {\n function Subscription(store, parentSub) {\n this.store = store;\n this.parentSub = parentSub;\n this.unsubscribe = null;\n this.listeners = nullListeners;\n this.handleChangeWrapper = this.handleChangeWrapper.bind(this);\n }\n\n var _proto = Subscription.prototype;\n\n _proto.addNestedSub = function addNestedSub(listener) {\n this.trySubscribe();\n return this.listeners.subscribe(listener);\n };\n\n _proto.notifyNestedSubs = function notifyNestedSubs() {\n this.listeners.notify();\n };\n\n _proto.handleChangeWrapper = function handleChangeWrapper() {\n if (this.onStateChange) {\n this.onStateChange();\n }\n };\n\n _proto.isSubscribed = function isSubscribed() {\n return Boolean(this.unsubscribe);\n };\n\n _proto.trySubscribe = function trySubscribe() {\n if (!this.unsubscribe) {\n this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.handleChangeWrapper) : this.store.subscribe(this.handleChangeWrapper);\n this.listeners = createListenerCollection();\n }\n };\n\n _proto.tryUnsubscribe = function tryUnsubscribe() {\n if (this.unsubscribe) {\n this.unsubscribe();\n this.unsubscribe = null;\n this.listeners.clear();\n this.listeners = nullListeners;\n }\n };\n\n return Subscription;\n}();\n\nexport { Subscription as default };","// Default to a dummy \"batch\" implementation that just runs the callback\nfunction defaultNoopBatch(callback) {\n callback();\n}\n\nvar batch = defaultNoopBatch; // Allow injecting another batching function later\n\nexport var setBatch = function setBatch(newBatch) {\n return batch = newBatch;\n}; // Supply a getter just to skip dealing with ESM bindings\n\nexport var getBatch = function getBatch() {\n return batch;\n};","/**\r\n * @param {any} obj The object to inspect.\r\n * @returns {boolean} True if the argument appears to be a plain object.\r\n */\nexport default function isPlainObject(obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n var proto = Object.getPrototypeOf(obj);\n if (proto === null) return true;\n var baseProto = proto;\n\n while (Object.getPrototypeOf(baseProto) !== null) {\n baseProto = Object.getPrototypeOf(baseProto);\n }\n\n return proto === baseProto;\n}","/* eslint-disable import/no-unresolved */\nexport { unstable_batchedUpdates } from 'react-dom';","function is(x, y) {\n if (x === y) {\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\n\nexport default function shallowEqual(objA, objB) {\n if (is(objA, objB)) return true;\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n if (keysA.length !== keysB.length) return false;\n\n for (var i = 0; i < keysA.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n}","import { useEffect, useLayoutEffect } from 'react'; // React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser. We need useLayoutEffect to ensure the store\n// subscription callback always has the selector from the latest render commit\n// available, otherwise a store update may happen between render and the effect,\n// which may cause missed updates; we also must ensure the store subscription\n// is created synchronously, otherwise a store update may occur before the\n// subscription is created and an inconsistent state may be observed\n\nexport var useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? useLayoutEffect : useEffect;","import isPlainObject from './isPlainObject';\nimport warning from './warning';\nexport default function verifyPlainObject(value, displayName, methodName) {\n if (!isPlainObject(value)) {\n warning(methodName + \"() in \" + displayName + \" must return a plain object. Instead received \" + value + \".\");\n }\n}","/**\r\n * Prints a warning in the console if it exists.\r\n *\r\n * @param {String} message The warning message.\r\n * @returns {void}\r\n */\nexport default function warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n\n\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n /* eslint-disable no-empty */\n } catch (e) {}\n /* eslint-enable no-empty */\n\n}","/** @license React v16.13.1\n * react.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\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar _assign = require('object-assign');\nvar checkPropTypes = require('prop-types/checkPropTypes');\n\nvar ReactVersion = '16.13.1';\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;\nvar REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;\nvar REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;\nvar REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;\nvar MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction 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/**\n * Keeps track of the current dispatcher.\n */\nvar ReactCurrentDispatcher = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\n/**\n * Keeps track of the current batch's configuration such as how long an update\n * should suspend for if it needs to.\n */\nvar ReactCurrentBatchConfig = {\n suspense: null\n};\n\n/**\n * Keeps track of the current owner.\n *\n * The current owner is the component who should own any components that are\n * currently being constructed.\n */\nvar ReactCurrentOwner = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\nvar BEFORE_SLASH_RE = /^(.*)[\\\\\\/]/;\nfunction describeComponentFrame (name, source, ownerName) {\n var sourceInfo = '';\n\n if (source) {\n var path = source.fileName;\n var fileName = path.replace(BEFORE_SLASH_RE, '');\n\n {\n // In DEV, include code for a common special case:\n // prefer \"folder/index.js\" instead of just \"index.js\".\n if (/^index\\./.test(fileName)) {\n var match = path.match(BEFORE_SLASH_RE);\n\n if (match) {\n var pathBeforeSlash = match[1];\n\n if (pathBeforeSlash) {\n var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');\n fileName = folderName + '/' + fileName;\n }\n }\n }\n }\n\n sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';\n } else if (ownerName) {\n sourceInfo = ' (created by ' + ownerName + ')';\n }\n\n return '\\n in ' + (name || 'Unknown') + sourceInfo;\n}\n\nvar Resolved = 1;\nfunction refineResolvedLazyComponent(lazyComponent) {\n return lazyComponent._status === Resolved ? lazyComponent._result : null;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var functionName = innerType.displayName || innerType.name || '';\n return outerType.displayName || (functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName);\n}\n\nfunction getComponentName(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 getComponentName(). ' + '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 return 'Context.Consumer';\n\n case REACT_PROVIDER_TYPE:\n return 'Context.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n return getComponentName(type.type);\n\n case REACT_BLOCK_TYPE:\n return getComponentName(type.render);\n\n case REACT_LAZY_TYPE:\n {\n var thenable = type;\n var resolvedThenable = refineResolvedLazyComponent(thenable);\n\n if (resolvedThenable) {\n return getComponentName(resolvedThenable);\n }\n\n break;\n }\n }\n }\n\n return null;\n}\n\nvar ReactDebugCurrentFrame = {};\nvar currentlyValidatingElement = null;\nfunction setCurrentlyValidatingElement(element) {\n {\n currentlyValidatingElement = element;\n }\n}\n\n{\n // Stack implementation injected by the current renderer.\n ReactDebugCurrentFrame.getCurrentStack = null;\n\n ReactDebugCurrentFrame.getStackAddendum = function () {\n var stack = ''; // Add an extra top frame while an element is being validated\n\n if (currentlyValidatingElement) {\n var name = getComponentName(currentlyValidatingElement.type);\n var owner = currentlyValidatingElement._owner;\n stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));\n } // Delegate to the injected renderer-specific implementation\n\n\n var impl = ReactDebugCurrentFrame.getCurrentStack;\n\n if (impl) {\n stack += impl() || '';\n }\n\n return stack;\n };\n}\n\n/**\n * Used by act() to track whether you're inside an act() scope.\n */\nvar IsSomeRendererActing = {\n current: false\n};\n\nvar ReactSharedInternals = {\n ReactCurrentDispatcher: ReactCurrentDispatcher,\n ReactCurrentBatchConfig: ReactCurrentBatchConfig,\n ReactCurrentOwner: ReactCurrentOwner,\n IsSomeRendererActing: IsSomeRendererActing,\n // Used by renderers to avoid bundling object-assign twice in UMD bundles:\n assign: _assign\n};\n\n{\n _assign(ReactSharedInternals, {\n // These should not be included in production.\n ReactDebugCurrentFrame: ReactDebugCurrentFrame,\n // Shim for React DOM 16.0.0 which still destructured (but not used) this.\n // TODO: remove in React 17.0.\n ReactComponentTreeHook: {}\n });\n}\n\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\nfunction warn(format) {\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}\nfunction error(format) {\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\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\\n in') === 0;\n\n if (!hasExistingStack) {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n }\n }\n\n var argsWithFormat = args.map(function (item) {\n return '' + 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 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 var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n throw new Error(message);\n } catch (x) {}\n }\n}\n\nvar didWarnStateUpdateForUnmountedComponent = {};\n\nfunction warnNoop(publicInstance, callerName) {\n {\n var _constructor = publicInstance.constructor;\n var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';\n var warningKey = componentName + \".\" + callerName;\n\n if (didWarnStateUpdateForUnmountedComponent[warningKey]) {\n return;\n }\n\n error(\"Can't call %s on a component that is not yet mounted. \" + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);\n\n didWarnStateUpdateForUnmountedComponent[warningKey] = true;\n }\n}\n/**\n * This is the abstract API for an update queue.\n */\n\n\nvar ReactNoopUpdateQueue = {\n /**\n * Checks whether or not this composite component is mounted.\n * @param {ReactClass} publicInstance The instance we want to test.\n * @return {boolean} True if mounted, false otherwise.\n * @protected\n * @final\n */\n isMounted: function (publicInstance) {\n return false;\n },\n\n /**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueForceUpdate: function (publicInstance, callback, callerName) {\n warnNoop(publicInstance, 'forceUpdate');\n },\n\n /**\n * Replaces all of the state. Always use this or `setState` to mutate state.\n * You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} completeState Next state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {\n warnNoop(publicInstance, 'replaceState');\n },\n\n /**\n * Sets a subset of the state. This only exists because _pendingState is\n * internal. This provides a merging strategy that is not available to deep\n * properties which is confusing. TODO: Expose pendingState or don't use it\n * during the merge.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} partialState Next partial state to be merged with state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} Name of the calling function in the public API.\n * @internal\n */\n enqueueSetState: function (publicInstance, partialState, callback, callerName) {\n warnNoop(publicInstance, 'setState');\n }\n};\n\nvar emptyObject = {};\n\n{\n Object.freeze(emptyObject);\n}\n/**\n * Base class helpers for the updating state of a component.\n */\n\n\nfunction Component(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the\n // renderer.\n\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nComponent.prototype.isReactComponent = {};\n/**\n * Sets a subset of the state. Always use this to mutate\n * state. You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * There is no guarantee that calls to `setState` will run synchronously,\n * as they may eventually be batched together. You can provide an optional\n * callback that will be executed when the call to setState is actually\n * completed.\n *\n * When a function is provided to setState, it will be called at some point in\n * the future (not synchronously). It will be called with the up to date\n * component arguments (state, props, context). These values can be different\n * from this.* because your function may be called after receiveProps but before\n * shouldComponentUpdate, and this new state, props, and context will not yet be\n * assigned to this.\n *\n * @param {object|function} partialState Next partial state or function to\n * produce next partial state to be merged with current state.\n * @param {?function} callback Called after state is updated.\n * @final\n * @protected\n */\n\nComponent.prototype.setState = function (partialState, callback) {\n if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {\n {\n throw Error( \"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\" );\n }\n }\n\n this.updater.enqueueSetState(this, partialState, callback, 'setState');\n};\n/**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {?function} callback Called after update is complete.\n * @final\n * @protected\n */\n\n\nComponent.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');\n};\n/**\n * Deprecated APIs. These APIs used to exist on classic React classes but since\n * we would like to deprecate them, we're not going to move them over to this\n * modern base class. Instead, we define a getter that warns if it's accessed.\n */\n\n\n{\n var deprecatedAPIs = {\n isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],\n replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']\n };\n\n var defineDeprecationWarning = function (methodName, info) {\n Object.defineProperty(Component.prototype, methodName, {\n get: function () {\n warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);\n\n return undefined;\n }\n });\n };\n\n for (var fnName in deprecatedAPIs) {\n if (deprecatedAPIs.hasOwnProperty(fnName)) {\n defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);\n }\n }\n}\n\nfunction ComponentDummy() {}\n\nComponentDummy.prototype = Component.prototype;\n/**\n * Convenience component with default shallow equality check for sCU.\n */\n\nfunction PureComponent(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nvar pureComponentPrototype = PureComponent.prototype = new ComponentDummy();\npureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.\n\n_assign(pureComponentPrototype, Component.prototype);\n\npureComponentPrototype.isPureReactComponent = true;\n\n// an immutable object with a single mutable value\nfunction createRef() {\n var refObject = {\n current: null\n };\n\n {\n Object.seal(refObject);\n }\n\n return refObject;\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n var warnAboutAccessingKey = function () {\n {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n var warnAboutAccessingRef = function () {\n {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {\n var componentName = getComponentName(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * Create and return a new ReactElement of the given type.\n * See https://reactjs.org/docs/react-api.html#createelement\n */\n\nfunction createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n}\n/**\n * Clone and return a new ReactElement using element as the starting point.\n * See https://reactjs.org/docs/react-api.html#cloneelement\n */\n\nfunction cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\nfunction isValidElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\n\nvar SEPARATOR = '.';\nvar SUBSEPARATOR = ':';\n/**\n * Escape and wrap key so it is safe to use as a reactid\n *\n * @param {string} key to be escaped.\n * @return {string} the escaped key.\n */\n\nfunction escape(key) {\n var escapeRegex = /[=:]/g;\n var escaperLookup = {\n '=': '=0',\n ':': '=2'\n };\n var escapedString = ('' + key).replace(escapeRegex, function (match) {\n return escaperLookup[match];\n });\n return '$' + escapedString;\n}\n/**\n * TODO: Test that a single child and an array with one item have the same key\n * pattern.\n */\n\n\nvar didWarnAboutMaps = false;\nvar userProvidedKeyEscapeRegex = /\\/+/g;\n\nfunction escapeUserProvidedKey(text) {\n return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');\n}\n\nvar POOL_SIZE = 10;\nvar traverseContextPool = [];\n\nfunction getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {\n if (traverseContextPool.length) {\n var traverseContext = traverseContextPool.pop();\n traverseContext.result = mapResult;\n traverseContext.keyPrefix = keyPrefix;\n traverseContext.func = mapFunction;\n traverseContext.context = mapContext;\n traverseContext.count = 0;\n return traverseContext;\n } else {\n return {\n result: mapResult,\n keyPrefix: keyPrefix,\n func: mapFunction,\n context: mapContext,\n count: 0\n };\n }\n}\n\nfunction releaseTraverseContext(traverseContext) {\n traverseContext.result = null;\n traverseContext.keyPrefix = null;\n traverseContext.func = null;\n traverseContext.context = null;\n traverseContext.count = 0;\n\n if (traverseContextPool.length < POOL_SIZE) {\n traverseContextPool.push(traverseContext);\n }\n}\n/**\n * @param {?*} children Children tree container.\n * @param {!string} nameSoFar Name of the key path so far.\n * @param {!function} callback Callback to invoke with each child found.\n * @param {?*} traverseContext Used to pass information throughout the traversal\n * process.\n * @return {!number} The number of children in this subtree.\n */\n\n\nfunction traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {\n var type = typeof children;\n\n if (type === 'undefined' || type === 'boolean') {\n // All of the above are perceived as null.\n children = null;\n }\n\n var invokeCallback = false;\n\n if (children === null) {\n invokeCallback = true;\n } else {\n switch (type) {\n case 'string':\n case 'number':\n invokeCallback = true;\n break;\n\n case 'object':\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = true;\n }\n\n }\n }\n\n if (invokeCallback) {\n callback(traverseContext, children, // If it's the only child, treat the name as if it was wrapped in an array\n // so that it's consistent if the number of children grows.\n nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);\n return 1;\n }\n\n var child;\n var nextName;\n var subtreeCount = 0; // Count of children found in the current subtree.\n\n var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;\n\n if (Array.isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n nextName = nextNamePrefix + getComponentKey(child, i);\n subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);\n }\n } else {\n var iteratorFn = getIteratorFn(children);\n\n if (typeof iteratorFn === 'function') {\n\n {\n // Warn about using Maps as children\n if (iteratorFn === children.entries) {\n if (!didWarnAboutMaps) {\n warn('Using Maps as children is deprecated and will be removed in ' + 'a future major release. Consider converting children to ' + 'an array of keyed ReactElements instead.');\n }\n\n didWarnAboutMaps = true;\n }\n }\n\n var iterator = iteratorFn.call(children);\n var step;\n var ii = 0;\n\n while (!(step = iterator.next()).done) {\n child = step.value;\n nextName = nextNamePrefix + getComponentKey(child, ii++);\n subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);\n }\n } else if (type === 'object') {\n var addendum = '';\n\n {\n addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();\n }\n\n var childrenString = '' + children;\n\n {\n {\n throw Error( \"Objects are not valid as a React child (found: \" + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + \").\" + addendum );\n }\n }\n }\n }\n\n return subtreeCount;\n}\n/**\n * Traverses children that are typically specified as `props.children`, but\n * might also be specified through attributes:\n *\n * - `traverseAllChildren(this.props.children, ...)`\n * - `traverseAllChildren(this.props.leftPanelChildren, ...)`\n *\n * The `traverseContext` is an optional argument that is passed through the\n * entire traversal. It can be used to store accumulations or anything else that\n * the callback might find relevant.\n *\n * @param {?*} children Children tree object.\n * @param {!function} callback To invoke upon traversing each child.\n * @param {?*} traverseContext Context for traversal.\n * @return {!number} The number of children in this subtree.\n */\n\n\nfunction traverseAllChildren(children, callback, traverseContext) {\n if (children == null) {\n return 0;\n }\n\n return traverseAllChildrenImpl(children, '', callback, traverseContext);\n}\n/**\n * Generate a key string that identifies a component within a set.\n *\n * @param {*} component A component that could contain a manual key.\n * @param {number} index Index that is used if a manual key is not provided.\n * @return {string}\n */\n\n\nfunction getComponentKey(component, index) {\n // Do some typechecking here since we call this blindly. We want to ensure\n // that we don't block potential future ES APIs.\n if (typeof component === 'object' && component !== null && component.key != null) {\n // Explicit key\n return escape(component.key);\n } // Implicit key determined by the index in the set\n\n\n return index.toString(36);\n}\n\nfunction forEachSingleChild(bookKeeping, child, name) {\n var func = bookKeeping.func,\n context = bookKeeping.context;\n func.call(context, child, bookKeeping.count++);\n}\n/**\n * Iterates through children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenforeach\n *\n * The provided forEachFunc(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} forEachFunc\n * @param {*} forEachContext Context for forEachContext.\n */\n\n\nfunction forEachChildren(children, forEachFunc, forEachContext) {\n if (children == null) {\n return children;\n }\n\n var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);\n traverseAllChildren(children, forEachSingleChild, traverseContext);\n releaseTraverseContext(traverseContext);\n}\n\nfunction mapSingleChildIntoContext(bookKeeping, child, childKey) {\n var result = bookKeeping.result,\n keyPrefix = bookKeeping.keyPrefix,\n func = bookKeeping.func,\n context = bookKeeping.context;\n var mappedChild = func.call(context, child, bookKeeping.count++);\n\n if (Array.isArray(mappedChild)) {\n mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {\n return c;\n });\n } else if (mappedChild != null) {\n if (isValidElement(mappedChild)) {\n mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as\n // traverseAllChildren used to do for objects as children\n keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);\n }\n\n result.push(mappedChild);\n }\n}\n\nfunction mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {\n var escapedPrefix = '';\n\n if (prefix != null) {\n escapedPrefix = escapeUserProvidedKey(prefix) + '/';\n }\n\n var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);\n traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);\n releaseTraverseContext(traverseContext);\n}\n/**\n * Maps children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenmap\n *\n * The provided mapFunction(child, key, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} func The map function.\n * @param {*} context Context for mapFunction.\n * @return {object} Object containing the ordered map of results.\n */\n\n\nfunction mapChildren(children, func, context) {\n if (children == null) {\n return children;\n }\n\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, func, context);\n return result;\n}\n/**\n * Count the number of children that are typically specified as\n * `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrencount\n *\n * @param {?*} children Children tree container.\n * @return {number} The number of children.\n */\n\n\nfunction countChildren(children) {\n return traverseAllChildren(children, function () {\n return null;\n }, null);\n}\n/**\n * Flatten a children object (typically specified as `props.children`) and\n * return an array with appropriately re-keyed children.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrentoarray\n */\n\n\nfunction toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n}\n/**\n * Returns the first child in a collection of children and verifies that there\n * is only one child in the collection.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenonly\n *\n * The current implementation of this function assumes that a single child gets\n * passed without a wrapper, but the purpose of this helper function is to\n * abstract away the particular structure of children.\n *\n * @param {?object} children Child collection structure.\n * @return {ReactElement} The first and only `ReactElement` contained in the\n * structure.\n */\n\n\nfunction onlyChild(children) {\n if (!isValidElement(children)) {\n {\n throw Error( \"React.Children.only expected to receive a single React element child.\" );\n }\n }\n\n return children;\n}\n\nfunction createContext(defaultValue, calculateChangedBits) {\n if (calculateChangedBits === undefined) {\n calculateChangedBits = null;\n } else {\n {\n if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') {\n error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits);\n }\n }\n }\n\n var context = {\n $$typeof: REACT_CONTEXT_TYPE,\n _calculateChangedBits: calculateChangedBits,\n // As a workaround to support multiple concurrent renderers, we categorize\n // some renderers as primary and others as secondary. We only expect\n // there to be two concurrent renderers at most: React Native (primary) and\n // Fabric (secondary); React DOM (primary) and React ART (secondary).\n // Secondary renderers store their context values on separate fields.\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n // Used to track how many concurrent renderers this context currently\n // supports within in a single renderer. Such as parallel server rendering.\n _threadCount: 0,\n // These are circular\n Provider: null,\n Consumer: null\n };\n context.Provider = {\n $$typeof: REACT_PROVIDER_TYPE,\n _context: context\n };\n var hasWarnedAboutUsingNestedContextConsumers = false;\n var hasWarnedAboutUsingConsumerProvider = false;\n\n {\n // A separate object, but proxies back to the original context object for\n // backwards compatibility. It has a different $$typeof, so we can properly\n // warn for the incorrect usage of Context as a Consumer.\n var Consumer = {\n $$typeof: REACT_CONTEXT_TYPE,\n _context: context,\n _calculateChangedBits: context._calculateChangedBits\n }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here\n\n Object.defineProperties(Consumer, {\n Provider: {\n get: function () {\n if (!hasWarnedAboutUsingConsumerProvider) {\n hasWarnedAboutUsingConsumerProvider = true;\n\n error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');\n }\n\n return context.Provider;\n },\n set: function (_Provider) {\n context.Provider = _Provider;\n }\n },\n _currentValue: {\n get: function () {\n return context._currentValue;\n },\n set: function (_currentValue) {\n context._currentValue = _currentValue;\n }\n },\n _currentValue2: {\n get: function () {\n return context._currentValue2;\n },\n set: function (_currentValue2) {\n context._currentValue2 = _currentValue2;\n }\n },\n _threadCount: {\n get: function () {\n return context._threadCount;\n },\n set: function (_threadCount) {\n context._threadCount = _threadCount;\n }\n },\n Consumer: {\n get: function () {\n if (!hasWarnedAboutUsingNestedContextConsumers) {\n hasWarnedAboutUsingNestedContextConsumers = true;\n\n error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');\n }\n\n return context.Consumer;\n }\n }\n }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty\n\n context.Consumer = Consumer;\n }\n\n {\n context._currentRenderer = null;\n context._currentRenderer2 = null;\n }\n\n return context;\n}\n\nfunction lazy(ctor) {\n var lazyType = {\n $$typeof: REACT_LAZY_TYPE,\n _ctor: ctor,\n // React uses these fields to store the result.\n _status: -1,\n _result: null\n };\n\n {\n // In production, this would just set it on the object.\n var defaultProps;\n var propTypes;\n Object.defineProperties(lazyType, {\n defaultProps: {\n configurable: true,\n get: function () {\n return defaultProps;\n },\n set: function (newDefaultProps) {\n error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n defaultProps = newDefaultProps; // Match production behavior more closely:\n\n Object.defineProperty(lazyType, 'defaultProps', {\n enumerable: true\n });\n }\n },\n propTypes: {\n configurable: true,\n get: function () {\n return propTypes;\n },\n set: function (newPropTypes) {\n error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n propTypes = newPropTypes; // Match production behavior more closely:\n\n Object.defineProperty(lazyType, 'propTypes', {\n enumerable: true\n });\n }\n }\n });\n }\n\n return lazyType;\n}\n\nfunction forwardRef(render) {\n {\n if (render != null && render.$$typeof === REACT_MEMO_TYPE) {\n error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');\n } else if (typeof render !== 'function') {\n error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);\n } else {\n if (render.length !== 0 && render.length !== 2) {\n error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');\n }\n }\n\n if (render != null) {\n if (render.defaultProps != null || render.propTypes != null) {\n error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');\n }\n }\n }\n\n return {\n $$typeof: REACT_FORWARD_REF_TYPE,\n render: render\n };\n}\n\nfunction isValidElementType(type) {\n return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.\n type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);\n}\n\nfunction memo(type, compare) {\n {\n if (!isValidElementType(type)) {\n error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);\n }\n }\n\n return {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: compare === undefined ? null : compare\n };\n}\n\nfunction resolveDispatcher() {\n var dispatcher = ReactCurrentDispatcher.current;\n\n if (!(dispatcher !== null)) {\n {\n throw 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:\\n1. You might have mismatching versions of React and the renderer (such as React DOM)\\n2. You might be breaking the Rules of Hooks\\n3. You might have more than one copy of React in the same app\\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.\" );\n }\n }\n\n return dispatcher;\n}\n\nfunction useContext(Context, unstable_observedBits) {\n var dispatcher = resolveDispatcher();\n\n {\n if (unstable_observedBits !== undefined) {\n error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\\n\\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '');\n } // TODO: add a more generic warning for invalid values.\n\n\n if (Context._context !== undefined) {\n var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs\n // and nobody should be using this in existing code.\n\n if (realContext.Consumer === Context) {\n error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');\n } else if (realContext.Provider === Context) {\n error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');\n }\n }\n }\n\n return dispatcher.useContext(Context, unstable_observedBits);\n}\nfunction useState(initialState) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useState(initialState);\n}\nfunction useReducer(reducer, initialArg, init) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useReducer(reducer, initialArg, init);\n}\nfunction useRef(initialValue) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useRef(initialValue);\n}\nfunction useEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useEffect(create, deps);\n}\nfunction useLayoutEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useLayoutEffect(create, deps);\n}\nfunction useCallback(callback, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useCallback(callback, deps);\n}\nfunction useMemo(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useMemo(create, deps);\n}\nfunction useImperativeHandle(ref, create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useImperativeHandle(ref, create, deps);\n}\nfunction useDebugValue(value, formatterFn) {\n {\n var dispatcher = resolveDispatcher();\n return dispatcher.useDebugValue(value, formatterFn);\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n\nfunction getDeclarationErrorAddendum() {\n if (ReactCurrentOwner.current) {\n var name = getComponentName(ReactCurrentOwner.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendumForProps(elementProps) {\n if (elementProps !== null && elementProps !== undefined) {\n return getSourceInfoErrorAddendum(elementProps.__source);\n }\n\n return '';\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentName(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement(element);\n\n {\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);\n }\n\n setCurrentlyValidatingElement(null);\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n if (typeof node !== 'object') {\n return;\n }\n\n if (Array.isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var name = getComponentName(type);\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n setCurrentlyValidatingElement(element);\n checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);\n setCurrentlyValidatingElement(null);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true;\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n setCurrentlyValidatingElement(fragment);\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n break;\n }\n }\n\n if (fragment.ref !== null) {\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n }\n\n setCurrentlyValidatingElement(null);\n }\n}\nfunction createElementWithValidation(type, props, children) {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\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 var sourceInfo = getSourceInfoErrorAddendumForProps(props);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (Array.isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentName(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n {\n error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n }\n\n var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], type);\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n}\nvar didWarnAboutDeprecatedCreateFactory = false;\nfunction createFactoryWithValidation(type) {\n var validatedFactory = createElementWithValidation.bind(null, type);\n validatedFactory.type = type;\n\n {\n if (!didWarnAboutDeprecatedCreateFactory) {\n didWarnAboutDeprecatedCreateFactory = true;\n\n warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');\n } // Legacy hook: remove it\n\n\n Object.defineProperty(validatedFactory, 'type', {\n enumerable: false,\n get: function () {\n warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');\n\n Object.defineProperty(this, 'type', {\n value: type\n });\n return type;\n }\n });\n }\n\n return validatedFactory;\n}\nfunction cloneElementWithValidation(element, props, children) {\n var newElement = cloneElement.apply(this, arguments);\n\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], newElement.type);\n }\n\n validatePropTypes(newElement);\n return newElement;\n}\n\n{\n\n try {\n var frozenObject = Object.freeze({});\n var testMap = new Map([[frozenObject, null]]);\n var testSet = new Set([frozenObject]); // This is necessary for Rollup to not consider these unused.\n // https://github.com/rollup/rollup/issues/1771\n // TODO: we can remove these if Rollup fixes the bug.\n\n testMap.set(0, 0);\n testSet.add(0);\n } catch (e) {\n }\n}\n\nvar createElement$1 = createElementWithValidation ;\nvar cloneElement$1 = cloneElementWithValidation ;\nvar createFactory = createFactoryWithValidation ;\nvar Children = {\n map: mapChildren,\n forEach: forEachChildren,\n count: countChildren,\n toArray: toArray,\n only: onlyChild\n};\n\nexports.Children = Children;\nexports.Component = Component;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.PureComponent = PureComponent;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;\nexports.cloneElement = cloneElement$1;\nexports.createContext = createContext;\nexports.createElement = createElement$1;\nexports.createFactory = createFactory;\nexports.createRef = createRef;\nexports.forwardRef = forwardRef;\nexports.isValidElement = isValidElement;\nexports.lazy = lazy;\nexports.memo = memo;\nexports.useCallback = useCallback;\nexports.useContext = useContext;\nexports.useDebugValue = useDebugValue;\nexports.useEffect = useEffect;\nexports.useImperativeHandle = useImperativeHandle;\nexports.useLayoutEffect = useLayoutEffect;\nexports.useMemo = useMemo;\nexports.useReducer = useReducer;\nexports.useRef = useRef;\nexports.useState = useState;\nexports.version = ReactVersion;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.min.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n","// Imports\nimport ___CSS_LOADER_API_IMPORT___ from \"../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(true);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".popup-content{margin:auto;background:#fff;width:50%;padding:5px;border:1px solid #d7d7d7}[role=tooltip].popup-content{width:200px;box-shadow:0 0 3px rgba(0,0,0,.16);border-radius:5px}.popup-overlay{background:rgba(0,0,0,.5)}[data-popup=tooltip].popup-overlay{background:transparent}.popup-arrow{-webkit-filter:drop-shadow(0 -3px 3px rgba(0,0,0,.16));filter:drop-shadow(0 -3px 3px rgba(0,0,0,.16));color:#fff;stroke-width:2px;stroke:#d7d7d7;stroke-dasharray:30px;stroke-dashoffset:-54px}\", \"\",{\"version\":3,\"sources\":[\"webpack://node_modules/reactjs-popup/dist/index.css\"],\"names\":[],\"mappings\":\"AAAA,eAAe,WAAW,CAAC,eAAe,CAAC,SAAS,CAAC,WAAW,CAAC,wBAAwB,CAAC,6BAA6B,WAAW,CAAC,kCAAkC,CAAC,iBAAiB,CAAC,eAAe,yBAAyB,CAAC,mCAAmC,sBAAsB,CAAC,aAAa,sDAAsD,CAAC,8CAA8C,CAAC,UAAU,CAAC,gBAAgB,CAAC,cAAc,CAAC,qBAAqB,CAAC,uBAAuB\",\"sourcesContent\":[\".popup-content{margin:auto;background:#fff;width:50%;padding:5px;border:1px solid #d7d7d7}[role=tooltip].popup-content{width:200px;box-shadow:0 0 3px rgba(0,0,0,.16);border-radius:5px}.popup-overlay{background:rgba(0,0,0,.5)}[data-popup=tooltip].popup-overlay{background:transparent}.popup-arrow{-webkit-filter:drop-shadow(0 -3px 3px rgba(0,0,0,.16));filter:drop-shadow(0 -3px 3px rgba(0,0,0,.16));color:#fff;stroke-width:2px;stroke:#d7d7d7;stroke-dasharray:30px;stroke-dashoffset:-54px}\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","import React, { useEffect, useLayoutEffect, forwardRef, useState, useRef, useImperativeHandle } from 'react';\nimport ReactDOM from 'react-dom';\n\nfunction _extends() {\n _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\n return _extends.apply(this, arguments);\n}\n\nvar useOnEscape = function useOnEscape(handler, active) {\n if (active === void 0) {\n active = true;\n }\n\n useEffect(function () {\n if (!active) return;\n\n var listener = function listener(event) {\n // check if key is an Escape\n if (event.key === 'Escape') handler();\n };\n\n document.addEventListener('keyup', listener);\n return function () {\n if (!active) return;\n document.removeEventListener('keyup', listener);\n };\n }, [handler, active]);\n};\nvar useRepositionOnResize = function useRepositionOnResize(handler, active) {\n if (active === void 0) {\n active = true;\n }\n\n useEffect(function () {\n if (!active) return;\n\n var listener = function listener() {\n handler();\n };\n\n window.addEventListener('resize', listener);\n return function () {\n if (!active) return;\n window.removeEventListener('resize', listener);\n };\n }, [handler, active]);\n};\nvar useOnClickOutside = function useOnClickOutside(ref, handler, active) {\n if (active === void 0) {\n active = true;\n }\n\n useEffect(function () {\n if (!active) return;\n\n var listener = function listener(event) {\n // Do nothing if clicking ref's element or descendent elements\n var refs = Array.isArray(ref) ? ref : [ref];\n var contains = false;\n refs.forEach(function (r) {\n if (!r.current || r.current.contains(event.target)) {\n contains = true;\n return;\n }\n });\n event.stopPropagation();\n if (!contains) handler();\n };\n\n document.addEventListener('mousedown', listener);\n document.addEventListener('touchstart', listener);\n return function () {\n if (!active) return;\n document.removeEventListener('mousedown', listener);\n document.removeEventListener('touchstart', listener);\n };\n }, [ref, handler, active]);\n}; // Make sure that user is not able TAB out of the Modal content on Open\n\nvar useTabbing = function useTabbing(contentRef, active) {\n if (active === void 0) {\n active = true;\n }\n\n useEffect(function () {\n if (!active) return;\n\n var listener = function listener(event) {\n // check if key is an Tab\n if (event.keyCode === 9) {\n var _contentRef$current;\n\n var els = contentRef === null || contentRef === void 0 ? void 0 : (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex=\"0\"]');\n var focusableEls = Array.prototype.slice.call(els);\n\n if (focusableEls.length === 1) {\n event.preventDefault();\n return;\n }\n\n var firstFocusableEl = focusableEls[0];\n var lastFocusableEl = focusableEls[focusableEls.length - 1];\n\n if (event.shiftKey && document.activeElement === firstFocusableEl) {\n event.preventDefault();\n lastFocusableEl.focus();\n } else if (document.activeElement === lastFocusableEl) {\n event.preventDefault();\n firstFocusableEl.focus();\n }\n }\n };\n\n document.addEventListener('keydown', listener);\n return function () {\n if (!active) return;\n document.removeEventListener('keydown', listener);\n };\n }, [contentRef, active]);\n};\nvar useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nvar Style = {\n popupContent: {\n tooltip: {\n position: 'absolute',\n zIndex: 999\n },\n modal: {\n position: 'relative',\n margin: 'auto'\n }\n },\n popupArrow: {\n height: '8px',\n width: '16px',\n position: 'absolute',\n background: 'transparent',\n color: '#FFF',\n zIndex: -1\n },\n overlay: {\n tooltip: {\n position: 'fixed',\n top: '0',\n bottom: '0',\n left: '0',\n right: '0',\n zIndex: 999\n },\n modal: {\n position: 'fixed',\n top: '0',\n bottom: '0',\n left: '0',\n right: '0',\n display: 'flex',\n zIndex: 999\n }\n }\n};\n\nvar POSITION_TYPES = ['top left', 'top center', 'top right', 'right top', 'right center', 'right bottom', 'bottom left', 'bottom center', 'bottom right', 'left top', 'left center', 'left bottom'];\n\nvar getCoordinatesForPosition = function getCoordinatesForPosition(triggerBounding, ContentBounding, position, //PopupPosition | PopupPosition[],\narrow, _ref) {\n var offsetX = _ref.offsetX,\n offsetY = _ref.offsetY;\n var margin = arrow ? 8 : 0;\n var args = position.split(' '); // the step N 1 : center the popup content => ok\n\n var CenterTop = triggerBounding.top + triggerBounding.height / 2;\n var CenterLeft = triggerBounding.left + triggerBounding.width / 2;\n var height = ContentBounding.height,\n width = ContentBounding.width;\n var top = CenterTop - height / 2;\n var left = CenterLeft - width / 2;\n var transform = '';\n var arrowTop = '0%';\n var arrowLeft = '0%'; // the step N 2 : => ok\n\n switch (args[0]) {\n case 'top':\n top -= height / 2 + triggerBounding.height / 2 + margin;\n transform = \"rotate(180deg) translateX(50%)\";\n arrowTop = '100%';\n arrowLeft = '50%';\n break;\n\n case 'bottom':\n top += height / 2 + triggerBounding.height / 2 + margin;\n transform = \"rotate(0deg) translateY(-100%) translateX(-50%)\";\n arrowLeft = '50%';\n break;\n\n case 'left':\n left -= width / 2 + triggerBounding.width / 2 + margin;\n transform = \" rotate(90deg) translateY(50%) translateX(-25%)\";\n arrowLeft = '100%';\n arrowTop = '50%';\n break;\n\n case 'right':\n left += width / 2 + triggerBounding.width / 2 + margin;\n transform = \"rotate(-90deg) translateY(-150%) translateX(25%)\";\n arrowTop = '50%';\n break;\n }\n\n switch (args[1]) {\n case 'top':\n top = triggerBounding.top;\n arrowTop = triggerBounding.height / 2 + \"px\";\n break;\n\n case 'bottom':\n top = triggerBounding.top - height + triggerBounding.height;\n arrowTop = height - triggerBounding.height / 2 + \"px\";\n break;\n\n case 'left':\n left = triggerBounding.left;\n arrowLeft = triggerBounding.width / 2 + \"px\";\n break;\n\n case 'right':\n left = triggerBounding.left - width + triggerBounding.width;\n arrowLeft = width - triggerBounding.width / 2 + \"px\";\n break;\n }\n\n top = args[0] === 'top' ? top - offsetY : top + offsetY;\n left = args[0] === 'left' ? left - offsetX : left + offsetX;\n return {\n top: top,\n left: left,\n transform: transform,\n arrowLeft: arrowLeft,\n arrowTop: arrowTop\n };\n};\n\nvar getTooltipBoundary = function getTooltipBoundary(keepTooltipInside) {\n // add viewport\n var boundingBox = {\n top: 0,\n left: 0,\n\n /* eslint-disable-next-line no-undef */\n width: window.innerWidth,\n\n /* eslint-disable-next-line no-undef */\n height: window.innerHeight\n };\n\n if (typeof keepTooltipInside === 'string') {\n /* eslint-disable-next-line no-undef */\n var selector = document.querySelector(keepTooltipInside);\n\n if (process.env.NODE_ENV !== 'production') {\n if (selector === null) throw new Error(keepTooltipInside + \" selector does not exist : keepTooltipInside must be a valid html selector 'class' or 'Id' or a boolean value\");\n }\n\n if (selector !== null) boundingBox = selector.getBoundingClientRect();\n }\n\n return boundingBox;\n};\n\nvar calculatePosition = function calculatePosition(triggerBounding, ContentBounding, position, arrow, _ref2, keepTooltipInside) {\n var offsetX = _ref2.offsetX,\n offsetY = _ref2.offsetY;\n var bestCoords = {\n arrowLeft: '0%',\n arrowTop: '0%',\n left: 0,\n top: 0,\n transform: 'rotate(135deg)'\n };\n var i = 0;\n var wrapperBox = getTooltipBoundary(keepTooltipInside);\n var positions = Array.isArray(position) ? position : [position]; // keepTooltipInside would be activated if the keepTooltipInside exist or the position is Array\n\n if (keepTooltipInside || Array.isArray(position)) positions = [].concat(positions, POSITION_TYPES); // add viewPort for WarpperBox\n // wrapperBox.top = wrapperBox.top + window.scrollY;\n // wrapperBox.left = wrapperBox.left + window.scrollX;\n\n while (i < positions.length) {\n bestCoords = getCoordinatesForPosition(triggerBounding, ContentBounding, positions[i], arrow, {\n offsetX: offsetX,\n offsetY: offsetY\n });\n var contentBox = {\n top: bestCoords.top,\n left: bestCoords.left,\n width: ContentBounding.width,\n height: ContentBounding.height\n };\n\n if (contentBox.top <= wrapperBox.top || contentBox.left <= wrapperBox.left || contentBox.top + contentBox.height >= wrapperBox.top + wrapperBox.height || contentBox.left + contentBox.width >= wrapperBox.left + wrapperBox.width) {\n i++;\n } else {\n break;\n }\n }\n\n return bestCoords;\n};\n\nvar popupIdCounter = 0;\n\nvar getRootPopup = function getRootPopup() {\n var PopupRoot = document.getElementById('popup-root');\n\n if (PopupRoot === null) {\n PopupRoot = document.createElement('div');\n PopupRoot.setAttribute('id', 'popup-root');\n document.body.appendChild(PopupRoot);\n }\n\n return PopupRoot;\n};\n\nvar Popup = /*#__PURE__*/forwardRef(function (_ref, ref) {\n var _ref$trigger = _ref.trigger,\n trigger = _ref$trigger === void 0 ? null : _ref$trigger,\n _ref$onOpen = _ref.onOpen,\n onOpen = _ref$onOpen === void 0 ? function () {} : _ref$onOpen,\n _ref$onClose = _ref.onClose,\n onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,\n _ref$defaultOpen = _ref.defaultOpen,\n defaultOpen = _ref$defaultOpen === void 0 ? false : _ref$defaultOpen,\n _ref$open = _ref.open,\n open = _ref$open === void 0 ? undefined : _ref$open,\n _ref$disabled = _ref.disabled,\n disabled = _ref$disabled === void 0 ? false : _ref$disabled,\n _ref$nested = _ref.nested,\n nested = _ref$nested === void 0 ? false : _ref$nested,\n _ref$closeOnDocumentC = _ref.closeOnDocumentClick,\n closeOnDocumentClick = _ref$closeOnDocumentC === void 0 ? true : _ref$closeOnDocumentC,\n _ref$repositionOnResi = _ref.repositionOnResize,\n repositionOnResize = _ref$repositionOnResi === void 0 ? true : _ref$repositionOnResi,\n _ref$closeOnEscape = _ref.closeOnEscape,\n closeOnEscape = _ref$closeOnEscape === void 0 ? true : _ref$closeOnEscape,\n _ref$on = _ref.on,\n on = _ref$on === void 0 ? ['click'] : _ref$on,\n _ref$contentStyle = _ref.contentStyle,\n contentStyle = _ref$contentStyle === void 0 ? {} : _ref$contentStyle,\n _ref$arrowStyle = _ref.arrowStyle,\n arrowStyle = _ref$arrowStyle === void 0 ? {} : _ref$arrowStyle,\n _ref$overlayStyle = _ref.overlayStyle,\n overlayStyle = _ref$overlayStyle === void 0 ? {} : _ref$overlayStyle,\n _ref$className = _ref.className,\n className = _ref$className === void 0 ? '' : _ref$className,\n _ref$position = _ref.position,\n position = _ref$position === void 0 ? 'bottom center' : _ref$position,\n _ref$modal = _ref.modal,\n modal = _ref$modal === void 0 ? false : _ref$modal,\n _ref$lockScroll = _ref.lockScroll,\n lockScroll = _ref$lockScroll === void 0 ? false : _ref$lockScroll,\n _ref$arrow = _ref.arrow,\n arrow = _ref$arrow === void 0 ? true : _ref$arrow,\n _ref$offsetX = _ref.offsetX,\n offsetX = _ref$offsetX === void 0 ? 0 : _ref$offsetX,\n _ref$offsetY = _ref.offsetY,\n offsetY = _ref$offsetY === void 0 ? 0 : _ref$offsetY,\n _ref$mouseEnterDelay = _ref.mouseEnterDelay,\n mouseEnterDelay = _ref$mouseEnterDelay === void 0 ? 100 : _ref$mouseEnterDelay,\n _ref$mouseLeaveDelay = _ref.mouseLeaveDelay,\n mouseLeaveDelay = _ref$mouseLeaveDelay === void 0 ? 100 : _ref$mouseLeaveDelay,\n _ref$keepTooltipInsid = _ref.keepTooltipInside,\n keepTooltipInside = _ref$keepTooltipInsid === void 0 ? false : _ref$keepTooltipInsid,\n children = _ref.children;\n\n var _useState = useState(open || defaultOpen),\n isOpen = _useState[0],\n setIsOpen = _useState[1];\n\n var triggerRef = useRef(null);\n var contentRef = useRef(null);\n var arrowRef = useRef(null);\n var focusedElBeforeOpen = useRef(null);\n var popupId = useRef(\"popup-\" + ++popupIdCounter);\n var isModal = modal ? true : !trigger;\n var timeOut = useRef(0);\n useIsomorphicLayoutEffect(function () {\n if (isOpen) {\n focusedElBeforeOpen.current = document.activeElement;\n setPosition();\n focusContentOnOpen(); // for accessibility\n\n lockScrolll();\n } else {\n resetScroll();\n }\n\n return function () {\n clearTimeout(timeOut.current);\n };\n }, [isOpen]); // for uncontrolled popup we need to sync isOpen with open prop\n\n useEffect(function () {\n if (typeof open === 'boolean') {\n if (open) openPopup();else closePopup();\n }\n }, [open, disabled]);\n\n var openPopup = function openPopup() {\n if (isOpen || disabled) return;\n setIsOpen(true);\n setTimeout(onOpen, 0);\n };\n\n var closePopup = function closePopup() {\n if (!isOpen || disabled) return;\n setIsOpen(false);\n if (isModal) focusedElBeforeOpen.current.focus();\n setTimeout(onClose, 0);\n };\n\n var togglePopup = function togglePopup(event) {\n event === null || event === void 0 ? void 0 : event.stopPropagation();\n if (!isOpen) openPopup();else closePopup();\n };\n\n var onMouseEnter = function onMouseEnter() {\n clearTimeout(timeOut.current);\n timeOut.current = setTimeout(openPopup, mouseEnterDelay);\n };\n\n var onContextMenu = function onContextMenu(event) {\n event === null || event === void 0 ? void 0 : event.preventDefault();\n togglePopup();\n };\n\n var onMouseLeave = function onMouseLeave() {\n clearTimeout(timeOut.current);\n timeOut.current = setTimeout(closePopup, mouseLeaveDelay);\n };\n\n var lockScrolll = function lockScrolll() {\n if (isModal && lockScroll) document.getElementsByTagName('body')[0].style.overflow = 'hidden'; // migrate to document.body\n };\n\n var resetScroll = function resetScroll() {\n if (isModal && lockScroll) document.getElementsByTagName('body')[0].style.overflow = 'auto';\n };\n\n var focusContentOnOpen = function focusContentOnOpen() {\n var _contentRef$current;\n\n var focusableEls = contentRef === null || contentRef === void 0 ? void 0 : (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex=\"0\"]');\n var firstEl = Array.prototype.slice.call(focusableEls)[0];\n firstEl === null || firstEl === void 0 ? void 0 : firstEl.focus();\n };\n\n useImperativeHandle(ref, function () {\n return {\n open: function open() {\n openPopup();\n },\n close: function close() {\n closePopup();\n },\n toggle: function toggle() {\n togglePopup();\n }\n };\n }); // set Position\n\n var setPosition = function setPosition() {\n if (isModal || !isOpen) return;\n if (!(triggerRef === null || triggerRef === void 0 ? void 0 : triggerRef.current) || !(triggerRef === null || triggerRef === void 0 ? void 0 : triggerRef.current) || !(contentRef === null || contentRef === void 0 ? void 0 : contentRef.current)) return; /// show error as one of ref is undefined\n\n var trigger = triggerRef.current.getBoundingClientRect();\n var content = contentRef.current.getBoundingClientRect();\n var cords = calculatePosition(trigger, content, position, arrow, {\n offsetX: offsetX,\n offsetY: offsetY\n }, keepTooltipInside);\n contentRef.current.style.top = cords.top + window.scrollY + \"px\";\n contentRef.current.style.left = cords.left + window.scrollX + \"px\";\n\n if (arrow && !!arrowRef.current) {\n var _arrowStyle$top, _arrowStyle$left;\n\n arrowRef.current.style.transform = cords.transform;\n arrowRef.current.style.setProperty('-ms-transform', cords.transform);\n arrowRef.current.style.setProperty('-webkit-transform', cords.transform);\n arrowRef.current.style.top = ((_arrowStyle$top = arrowStyle.top) === null || _arrowStyle$top === void 0 ? void 0 : _arrowStyle$top.toString()) || cords.arrowTop;\n arrowRef.current.style.left = ((_arrowStyle$left = arrowStyle.left) === null || _arrowStyle$left === void 0 ? void 0 : _arrowStyle$left.toString()) || cords.arrowLeft;\n }\n }; // hooks\n\n\n useOnEscape(closePopup, closeOnEscape); // can be optimized if we disabled for hover\n\n useTabbing(contentRef, isOpen && isModal);\n useRepositionOnResize(setPosition, repositionOnResize);\n useOnClickOutside(!!trigger ? [contentRef, triggerRef] : [contentRef], closePopup, closeOnDocumentClick && !nested); // we need to add a ne\n // render the trigger element and add events\n\n var renderTrigger = function renderTrigger() {\n var triggerProps = {\n key: 'T',\n ref: triggerRef,\n 'aria-describedby': popupId.current\n };\n var onAsArray = Array.isArray(on) ? on : [on];\n\n for (var i = 0, len = onAsArray.length; i < len; i++) {\n switch (onAsArray[i]) {\n case 'click':\n triggerProps.onClick = togglePopup;\n break;\n\n case 'right-click':\n triggerProps.onContextMenu = onContextMenu;\n break;\n\n case 'hover':\n triggerProps.onMouseEnter = onMouseEnter;\n triggerProps.onMouseLeave = onMouseLeave;\n break;\n\n case 'focus':\n triggerProps.onFocus = onMouseEnter;\n triggerProps.onBlur = onMouseLeave;\n break;\n }\n }\n\n if (typeof trigger === 'function') {\n var comp = trigger(isOpen);\n return !!trigger && React.cloneElement(comp, triggerProps);\n }\n\n return !!trigger && React.cloneElement(trigger, triggerProps);\n };\n\n var addWarperAction = function addWarperAction() {\n var popupContentStyle = isModal ? Style.popupContent.modal : Style.popupContent.tooltip;\n var childrenElementProps = {\n className: \"popup-content \" + (className !== '' ? className.split(' ').map(function (c) {\n return c + \"-content\";\n }).join(' ') : ''),\n style: _extends({}, popupContentStyle, contentStyle, {\n pointerEvents: 'auto'\n }),\n ref: contentRef,\n onClick: function onClick(e) {\n e.stopPropagation();\n }\n };\n\n if (!modal && on.indexOf('hover') >= 0) {\n childrenElementProps.onMouseEnter = onMouseEnter;\n childrenElementProps.onMouseLeave = onMouseLeave;\n }\n\n return childrenElementProps;\n };\n\n var renderContent = function renderContent() {\n return React.createElement(\"div\", Object.assign({}, addWarperAction(), {\n key: \"C\",\n role: isModal ? 'dialog' : 'tooltip',\n id: popupId.current\n }), arrow && !isModal && React.createElement(\"div\", {\n ref: arrowRef,\n style: Style.popupArrow\n }, React.createElement(\"svg\", {\n \"data-testid\": \"arrow\",\n className: \"popup-arrow \" + (className !== '' ? className.split(' ').map(function (c) {\n return c + \"-arrow\";\n }).join(' ') : ''),\n viewBox: \"0 0 32 16\",\n style: _extends({\n position: 'absolute'\n }, arrowStyle)\n }, React.createElement(\"path\", {\n d: \"M16 0l16 16H0z\",\n fill: \"currentcolor\"\n }))), children && typeof children === 'function' ? children(closePopup, isOpen) : children);\n };\n\n var overlay = !(on.indexOf('hover') >= 0);\n var ovStyle = isModal ? Style.overlay.modal : Style.overlay.tooltip;\n var content = [overlay && React.createElement(\"div\", {\n key: \"O\",\n \"data-testid\": \"overlay\",\n \"data-popup\": isModal ? 'modal' : 'tooltip',\n className: \"popup-overlay \" + (className !== '' ? className.split(' ').map(function (c) {\n return c + \"-overlay\";\n }).join(' ') : ''),\n style: _extends({}, ovStyle, overlayStyle, {\n pointerEvents: closeOnDocumentClick && nested || isModal ? 'auto' : 'none'\n }),\n onClick: closeOnDocumentClick && nested ? closePopup : undefined,\n tabIndex: -1\n }, isModal && renderContent()), !isModal && renderContent()];\n return React.createElement(React.Fragment, null, renderTrigger(), isOpen && ReactDOM.createPortal(content, getRootPopup()));\n});\n\nexport default Popup;\nexport { Popup };\n//# sourceMappingURL=reactjs-popup.esm.js.map\n","module.exports = require('./lib/_stream_duplex.js');\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\n/*<replacement>*/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n keys.push(key);\n }return keys;\n};\n/*</replacement>*/\n\nmodule.exports = Duplex;\n\n/*<replacement>*/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/*</replacement>*/\n\nvar Readable = require('./_stream_readable');\nvar Writable = require('./_stream_writable');\n\nutil.inherits(Duplex, Readable);\n\n{\n // avoid scope creep, the keys array can then be collected\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n\n Readable.call(this, options);\n Writable.call(this, options);\n\n if (options && options.readable === false) this.readable = false;\n\n if (options && options.writable === false) this.writable = false;\n\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n this.once('end', onend);\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we're ok.\n if (this.allowHalfOpen || this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n pna.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n this.push(null);\n this.end();\n\n pna.nextTick(cb, err);\n};","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict';\n\nmodule.exports = PassThrough;\n\nvar Transform = require('./_stream_transform');\n\n/*<replacement>*/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/*</replacement>*/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\nmodule.exports = Readable;\n\n/*<replacement>*/\nvar isArray = require('isarray');\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nReadable.ReadableState = ReadableState;\n\n/*<replacement>*/\nvar EE = require('events').EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n return emitter.listeners(type).length;\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = require('./internal/streams/stream');\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = require('safe-buffer').Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\n/*<replacement>*/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/*</replacement>*/\n\n/*<replacement>*/\nvar debugUtil = require('util');\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function () {};\n}\n/*</replacement>*/\n\nvar BufferList = require('./internal/streams/BufferList');\nvar destroyImpl = require('./internal/streams/destroy');\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n var hwm = options.highWaterMark;\n var readableHwm = options.readableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n if (!(this instanceof Readable)) return new Readable(options);\n\n this._readableState = new ReadableState(options, this);\n\n // legacy\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\n\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n this.push(null);\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n stream.emit('error', er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n stream.emit('error', new Error('stream.push() after EOF'));\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n }\n\n return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n return er;\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n\n // emit 'readable' now to make sure it gets picked up.\n emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n pna.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;else len = state.length;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\n\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n // If the user pushes more data while we're writing to dest then we'll end up\n // in ondata again. However, we only want to increase awaitDrain once because\n // dest will only emit one 'drain' event for the multiple writes.\n // => Introduce a guard on increasing awaitDrain.\n var increasedAwaitDrain = false;\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n increasedAwaitDrain = false;\n var ret = dest.write(chunk);\n if (false === ret && !increasedAwaitDrain) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', src._readableState.awaitDrain);\n src._readableState.awaitDrain++;\n increasedAwaitDrain = true;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function () {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = { hasUnpiped: false };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, unpipeInfo);\n }return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n dest.emit('unpipe', this, unpipeInfo);\n\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n if (ev === 'data') {\n // Start flowing on next tick if stream isn't explicitly paused\n if (this._readableState.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n var state = this._readableState;\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.emittedReadable = false;\n if (!state.reading) {\n pna.nextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this);\n }\n }\n }\n\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n pna.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n state.awaitDrain = 0;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function (method) {\n return function () {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._readableState.highWaterMark;\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = fromListPartial(n, state.buffer, state.decoder);\n }\n\n return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n var ret;\n if (n < list.head.data.length) {\n // slice is the same for buffers and strings\n ret = list.head.data.slice(0, n);\n list.head.data = list.head.data.slice(n);\n } else if (n === list.head.data.length) {\n // first chunk is a perfect match\n ret = list.shift();\n } else {\n // result spans more than one buffer\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n }\n return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n\n // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n pna.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n'use strict';\n\nmodule.exports = Transform;\n\nvar Duplex = require('./_stream_duplex');\n\n/*<replacement>*/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/*</replacement>*/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n\n var cb = ts.writecb;\n\n if (!cb) {\n return this.emit('error', new Error('write callback called multiple times'));\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n\n cb(er);\n\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n\n Duplex.call(this, options);\n\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function') {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n var _this2 = this;\n\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n _this2.emit('close');\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n\n if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n\n return stream.push(null);\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\nmodule.exports = Writable;\n\n/* <replacement> */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* </replacement> */\n\n/*<replacement>*/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nWritable.WritableState = WritableState;\n\n/*<replacement>*/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/*</replacement>*/\n\n/*<replacement>*/\nvar internalUtil = {\n deprecate: require('util-deprecate')\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = require('./internal/streams/stream');\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = require('safe-buffer').Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\nvar destroyImpl = require('./internal/streams/destroy');\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n var hwm = options.highWaterMark;\n var writableHwm = options.writableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function () {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function (object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function (object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n return new Writable(options);\n }\n\n this._writableState = new WritableState(options, this);\n\n // legacy.\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n\n if (typeof options.writev === 'function') this._writev = options.writev;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n\n if (typeof options.final === 'function') this._final = options.final;\n }\n\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end');\n // TODO: defer error events consistently everywhere, not just the cb\n stream.emit('error', er);\n pna.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n pna.nextTick(cb, er);\n valid = false;\n }\n return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n if (typeof cb !== 'function') cb = nop;\n\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n\n return ret;\n};\n\nWritable.prototype.cork = function () {\n var state = this._writableState;\n\n state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n\n if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n pna.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n pna.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n\n onwriteStateUpdate(state);\n\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n /*<replacement>*/\n asyncWrite(afterWrite, stream, state, finished, cb);\n /*</replacement>*/\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending && !state.finished) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n stream.emit('error', err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function') {\n state.pendingcb++;\n state.finalCalled = true;\n pna.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n }\n }\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n if (state.corkedRequestsFree) {\n state.corkedRequestsFree.next = corkReq;\n } else {\n state.corkedRequestsFree = corkReq;\n }\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n get: function () {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\n\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n this.end();\n cb(err);\n};","'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Buffer = require('safe-buffer').Buffer;\nvar util = require('util');\n\nfunction copyBuffer(src, target, offset) {\n src.copy(target, offset);\n}\n\nmodule.exports = function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n BufferList.prototype.push = function push(v) {\n var entry = { data: v, next: null };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n };\n\n BufferList.prototype.unshift = function unshift(v) {\n var entry = { data: v, next: this.head };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n };\n\n BufferList.prototype.shift = function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n };\n\n BufferList.prototype.clear = function clear() {\n this.head = this.tail = null;\n this.length = 0;\n };\n\n BufferList.prototype.join = function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) {\n ret += s + p.data;\n }return ret;\n };\n\n BufferList.prototype.concat = function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n if (this.length === 1) return this.head.data;\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n };\n\n return BufferList;\n}();\n\nif (util && util.inspect && util.inspect.custom) {\n module.exports.prototype[util.inspect.custom] = function () {\n var obj = util.inspect({ length: this.length });\n return this.constructor.name + ' ' + obj;\n };\n}","'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\n pna.nextTick(emitErrorNT, this, err);\n }\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n pna.nextTick(emitErrorNT, _this, err);\n if (_this._writableState) {\n _this._writableState.errorEmitted = true;\n }\n } else if (cb) {\n cb(err);\n }\n });\n\n return this;\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy\n};","module.exports = require('events').EventEmitter;\n","module.exports = require('./readable').PassThrough\n","exports = module.exports = require('./lib/_stream_readable.js');\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = require('./lib/_stream_writable.js');\nexports.Duplex = require('./lib/_stream_duplex.js');\nexports.Transform = require('./lib/_stream_transform.js');\nexports.PassThrough = require('./lib/_stream_passthrough.js');\n","module.exports = require('./readable').Transform\n","module.exports = require('./lib/_stream_writable.js');\n","function createThunkMiddleware(extraArgument) {\n return function (_ref) {\n var dispatch = _ref.dispatch,\n getState = _ref.getState;\n return function (next) {\n return function (action) {\n if (typeof action === 'function') {\n return action(dispatch, getState, extraArgument);\n }\n\n return next(action);\n };\n };\n };\n}\n\nvar thunk = createThunkMiddleware();\nthunk.withExtraArgument = createThunkMiddleware;\n\nexport default thunk;","import $$observable from 'symbol-observable';\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar randomString = function randomString() {\n return Math.random().toString(36).substring(7).split('').join('.');\n};\n\nvar ActionTypes = {\n INIT: \"@@redux/INIT\" + randomString(),\n REPLACE: \"@@redux/REPLACE\" + randomString(),\n PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {\n return \"@@redux/PROBE_UNKNOWN_ACTION\" + randomString();\n }\n};\n\n/**\n * @param {any} obj The object to inspect.\n * @returns {boolean} True if the argument appears to be a plain object.\n */\nfunction isPlainObject(obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n var proto = obj;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(obj) === proto;\n}\n\n/**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {\n throw new Error('It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function.');\n }\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error('Expected the enhancer to be a function.');\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error('Expected the reducer to be a function.');\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n /**\n * This makes a shallow copy of currentListeners so we can use\n * nextListeners as a temporary list while dispatching.\n *\n * This prevents any bugs around consumers calling\n * subscribe/unsubscribe in the middle of a dispatch.\n */\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n\n\n function getState() {\n if (isDispatching) {\n throw new Error('You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n\n return currentState;\n }\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n\n\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Expected the listener to be a function.');\n }\n\n if (isDispatching) {\n throw new Error('You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api-reference/store#subscribelistener for more details.');\n }\n\n var isSubscribed = true;\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n if (isDispatching) {\n throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribelistener for more details.');\n }\n\n isSubscribed = false;\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n currentListeners = null;\n };\n }\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n\n\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error('Actions may not have an undefined \"type\" property. ' + 'Have you misspelled a constant?');\n }\n\n if (isDispatching) {\n throw new Error('Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n\n\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error('Expected the nextReducer to be a function.');\n }\n\n currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.\n // Any reducers that existed in both the new and old rootReducer\n // will receive the previous state. This effectively populates\n // the new state tree with any relevant data from the old one.\n\n dispatch({\n type: ActionTypes.REPLACE\n });\n }\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n\n\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n throw new TypeError('Expected the observer to be an object.');\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe: unsubscribe\n };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n } // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n\n\n dispatch({\n type: ActionTypes.INIT\n });\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n\n\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n\n}\n\nfunction getUndefinedStateErrorMessage(key, action) {\n var actionType = action && action.type;\n var actionDescription = actionType && \"action \\\"\" + String(actionType) + \"\\\"\" || 'an action';\n return \"Given \" + actionDescription + \", reducer \\\"\" + key + \"\\\" returned undefined. \" + \"To ignore an action, you must explicitly return the previous state. \" + \"If you want this reducer to hold no value, you can return null instead of undefined.\";\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return \"The \" + argumentName + \" has unexpected type of \\\"\" + {}.toString.call(inputState).match(/\\s([a-z|A-Z]+)/)[1] + \"\\\". Expected argument to be an object with the following \" + (\"keys: \\\"\" + reducerKeys.join('\", \"') + \"\\\"\");\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === ActionTypes.REPLACE) return;\n\n if (unexpectedKeys.length > 0) {\n return \"Unexpected \" + (unexpectedKeys.length > 1 ? 'keys' : 'key') + \" \" + (\"\\\"\" + unexpectedKeys.join('\", \"') + \"\\\" found in \" + argumentName + \". \") + \"Expected to find one of the known reducer keys instead: \" + (\"\\\"\" + reducerKeys.join('\", \"') + \"\\\". Unexpected keys will be ignored.\");\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, {\n type: ActionTypes.INIT\n });\n\n if (typeof initialState === 'undefined') {\n throw new Error(\"Reducer \\\"\" + key + \"\\\" returned undefined during initialization. \" + \"If the state passed to the reducer is undefined, you must \" + \"explicitly return the initial state. The initial state may \" + \"not be undefined. If you don't want to set a value for this reducer, \" + \"you can use null instead of undefined.\");\n }\n\n if (typeof reducer(undefined, {\n type: ActionTypes.PROBE_UNKNOWN_ACTION()\n }) === 'undefined') {\n throw new Error(\"Reducer \\\"\" + key + \"\\\" returned undefined when probed with a random type. \" + (\"Don't try to handle \" + ActionTypes.INIT + \" or other actions in \\\"redux/*\\\" \") + \"namespace. They are considered private. Instead, you must return the \" + \"current state for any unknown actions, unless it is undefined, \" + \"in which case you must return the initial state, regardless of the \" + \"action type. The initial state may not be undefined, but can be null.\");\n }\n });\n}\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\n\n\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning(\"No reducer provided for key \\\"\" + key + \"\\\"\");\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n\n var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same\n // keys multiple times.\n\n var unexpectedKeyCache;\n\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError;\n\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination(state, action) {\n if (state === void 0) {\n state = {};\n }\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n\n if (typeof nextStateForKey === 'undefined') {\n var errorMessage = getUndefinedStateErrorMessage(_key, action);\n throw new Error(errorMessage);\n }\n\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(this, arguments));\n };\n}\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass an action creator as the first argument,\n * and get a dispatch wrapped function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\n\n\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error(\"bindActionCreators expected an object or a function, instead received \" + (actionCreators === null ? 'null' : typeof actionCreators) + \". \" + \"Did you write \\\"import ActionCreators from\\\" instead of \\\"import * as ActionCreators from\\\"?\");\n }\n\n var boundActionCreators = {};\n\n for (var key in actionCreators) {\n var actionCreator = actionCreators[key];\n\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n\n return boundActionCreators;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n keys.push.apply(keys, Object.getOwnPropertySymbols(object));\n }\n\n if (enumerableOnly) keys = keys.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\nfunction compose() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(void 0, arguments));\n };\n });\n}\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\n\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function () {\n var store = createStore.apply(void 0, arguments);\n\n var _dispatch = function dispatch() {\n throw new Error('Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');\n };\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch() {\n return _dispatch.apply(void 0, arguments);\n }\n };\n var chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(void 0, chain)(store.dispatch);\n return _objectSpread2({}, store, {\n dispatch: _dispatch\n });\n };\n };\n}\n\n/*\n * This is a dummy function to check if the function name has been altered by minification.\n * If the function has been minified and NODE_ENV !== 'production', warn the user.\n */\n\nfunction isCrushed() {}\n\nif (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {\n warning('You are currently using minified code outside of NODE_ENV === \"production\". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');\n}\n\nexport { ActionTypes as __DO_NOT_USE__ActionTypes, applyMiddleware, bindActionCreators, combineReducers, compose, createStore };\n","/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","/** @license React v0.19.1\n * scheduler-tracing.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\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs.\n\nvar interactionIDCounter = 0;\nvar threadIDCounter = 0; // Set of currently traced interactions.\n// Interactions \"stack\"–\n// Meaning that newly traced interactions are appended to the previously active set.\n// When an interaction goes out of scope, the previous set (if any) is restored.\n\nexports.__interactionsRef = null; // Listener(s) to notify when interactions begin and end.\n\nexports.__subscriberRef = null;\n\n{\n exports.__interactionsRef = {\n current: new Set()\n };\n exports.__subscriberRef = {\n current: null\n };\n}\nfunction unstable_clear(callback) {\n\n var prevInteractions = exports.__interactionsRef.current;\n exports.__interactionsRef.current = new Set();\n\n try {\n return callback();\n } finally {\n exports.__interactionsRef.current = prevInteractions;\n }\n}\nfunction unstable_getCurrent() {\n {\n return exports.__interactionsRef.current;\n }\n}\nfunction unstable_getThreadID() {\n return ++threadIDCounter;\n}\nfunction unstable_trace(name, timestamp, callback) {\n var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID;\n\n var interaction = {\n __count: 1,\n id: interactionIDCounter++,\n name: name,\n timestamp: timestamp\n };\n var prevInteractions = exports.__interactionsRef.current; // Traced interactions should stack/accumulate.\n // To do that, clone the current interactions.\n // The previous set will be restored upon completion.\n\n var interactions = new Set(prevInteractions);\n interactions.add(interaction);\n exports.__interactionsRef.current = interactions;\n var subscriber = exports.__subscriberRef.current;\n var returnValue;\n\n try {\n if (subscriber !== null) {\n subscriber.onInteractionTraced(interaction);\n }\n } finally {\n try {\n if (subscriber !== null) {\n subscriber.onWorkStarted(interactions, threadID);\n }\n } finally {\n try {\n returnValue = callback();\n } finally {\n exports.__interactionsRef.current = prevInteractions;\n\n try {\n if (subscriber !== null) {\n subscriber.onWorkStopped(interactions, threadID);\n }\n } finally {\n interaction.__count--; // If no async work was scheduled for this interaction,\n // Notify subscribers that it's completed.\n\n if (subscriber !== null && interaction.__count === 0) {\n subscriber.onInteractionScheduledWorkCompleted(interaction);\n }\n }\n }\n }\n }\n\n return returnValue;\n}\nfunction unstable_wrap(callback) {\n var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID;\n\n var wrappedInteractions = exports.__interactionsRef.current;\n var subscriber = exports.__subscriberRef.current;\n\n if (subscriber !== null) {\n subscriber.onWorkScheduled(wrappedInteractions, threadID);\n } // Update the pending async work count for the current interactions.\n // Update after calling subscribers in case of error.\n\n\n wrappedInteractions.forEach(function (interaction) {\n interaction.__count++;\n });\n var hasRun = false;\n\n function wrapped() {\n var prevInteractions = exports.__interactionsRef.current;\n exports.__interactionsRef.current = wrappedInteractions;\n subscriber = exports.__subscriberRef.current;\n\n try {\n var returnValue;\n\n try {\n if (subscriber !== null) {\n subscriber.onWorkStarted(wrappedInteractions, threadID);\n }\n } finally {\n try {\n returnValue = callback.apply(undefined, arguments);\n } finally {\n exports.__interactionsRef.current = prevInteractions;\n\n if (subscriber !== null) {\n subscriber.onWorkStopped(wrappedInteractions, threadID);\n }\n }\n }\n\n return returnValue;\n } finally {\n if (!hasRun) {\n // We only expect a wrapped function to be executed once,\n // But in the event that it's executed more than once–\n // Only decrement the outstanding interaction counts once.\n hasRun = true; // Update pending async counts for all wrapped interactions.\n // If this was the last scheduled async work for any of them,\n // Mark them as completed.\n\n wrappedInteractions.forEach(function (interaction) {\n interaction.__count--;\n\n if (subscriber !== null && interaction.__count === 0) {\n subscriber.onInteractionScheduledWorkCompleted(interaction);\n }\n });\n }\n }\n }\n\n wrapped.cancel = function cancel() {\n subscriber = exports.__subscriberRef.current;\n\n try {\n if (subscriber !== null) {\n subscriber.onWorkCanceled(wrappedInteractions, threadID);\n }\n } finally {\n // Update pending async counts for all wrapped interactions.\n // If this was the last scheduled async work for any of them,\n // Mark them as completed.\n wrappedInteractions.forEach(function (interaction) {\n interaction.__count--;\n\n if (subscriber && interaction.__count === 0) {\n subscriber.onInteractionScheduledWorkCompleted(interaction);\n }\n });\n }\n };\n\n return wrapped;\n}\n\nvar subscribers = null;\n\n{\n subscribers = new Set();\n}\n\nfunction unstable_subscribe(subscriber) {\n {\n subscribers.add(subscriber);\n\n if (subscribers.size === 1) {\n exports.__subscriberRef.current = {\n onInteractionScheduledWorkCompleted: onInteractionScheduledWorkCompleted,\n onInteractionTraced: onInteractionTraced,\n onWorkCanceled: onWorkCanceled,\n onWorkScheduled: onWorkScheduled,\n onWorkStarted: onWorkStarted,\n onWorkStopped: onWorkStopped\n };\n }\n }\n}\nfunction unstable_unsubscribe(subscriber) {\n {\n subscribers.delete(subscriber);\n\n if (subscribers.size === 0) {\n exports.__subscriberRef.current = null;\n }\n }\n}\n\nfunction onInteractionTraced(interaction) {\n var didCatchError = false;\n var caughtError = null;\n subscribers.forEach(function (subscriber) {\n try {\n subscriber.onInteractionTraced(interaction);\n } catch (error) {\n if (!didCatchError) {\n didCatchError = true;\n caughtError = error;\n }\n }\n });\n\n if (didCatchError) {\n throw caughtError;\n }\n}\n\nfunction onInteractionScheduledWorkCompleted(interaction) {\n var didCatchError = false;\n var caughtError = null;\n subscribers.forEach(function (subscriber) {\n try {\n subscriber.onInteractionScheduledWorkCompleted(interaction);\n } catch (error) {\n if (!didCatchError) {\n didCatchError = true;\n caughtError = error;\n }\n }\n });\n\n if (didCatchError) {\n throw caughtError;\n }\n}\n\nfunction onWorkScheduled(interactions, threadID) {\n var didCatchError = false;\n var caughtError = null;\n subscribers.forEach(function (subscriber) {\n try {\n subscriber.onWorkScheduled(interactions, threadID);\n } catch (error) {\n if (!didCatchError) {\n didCatchError = true;\n caughtError = error;\n }\n }\n });\n\n if (didCatchError) {\n throw caughtError;\n }\n}\n\nfunction onWorkStarted(interactions, threadID) {\n var didCatchError = false;\n var caughtError = null;\n subscribers.forEach(function (subscriber) {\n try {\n subscriber.onWorkStarted(interactions, threadID);\n } catch (error) {\n if (!didCatchError) {\n didCatchError = true;\n caughtError = error;\n }\n }\n });\n\n if (didCatchError) {\n throw caughtError;\n }\n}\n\nfunction onWorkStopped(interactions, threadID) {\n var didCatchError = false;\n var caughtError = null;\n subscribers.forEach(function (subscriber) {\n try {\n subscriber.onWorkStopped(interactions, threadID);\n } catch (error) {\n if (!didCatchError) {\n didCatchError = true;\n caughtError = error;\n }\n }\n });\n\n if (didCatchError) {\n throw caughtError;\n }\n}\n\nfunction onWorkCanceled(interactions, threadID) {\n var didCatchError = false;\n var caughtError = null;\n subscribers.forEach(function (subscriber) {\n try {\n subscriber.onWorkCanceled(interactions, threadID);\n } catch (error) {\n if (!didCatchError) {\n didCatchError = true;\n caughtError = error;\n }\n }\n });\n\n if (didCatchError) {\n throw caughtError;\n }\n}\n\nexports.unstable_clear = unstable_clear;\nexports.unstable_getCurrent = unstable_getCurrent;\nexports.unstable_getThreadID = unstable_getThreadID;\nexports.unstable_subscribe = unstable_subscribe;\nexports.unstable_trace = unstable_trace;\nexports.unstable_unsubscribe = unstable_unsubscribe;\nexports.unstable_wrap = unstable_wrap;\n })();\n}\n","/** @license React v0.19.1\n * scheduler.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\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar enableSchedulerDebugging = false;\nvar enableProfiling = true;\n\nvar requestHostCallback;\nvar requestHostTimeout;\nvar cancelHostTimeout;\nvar shouldYieldToHost;\nvar requestPaint;\n\nif ( // If Scheduler runs in a non-DOM environment, it falls back to a naive\n// implementation using setTimeout.\ntypeof window === 'undefined' || // Check if MessageChannel is supported, too.\ntypeof MessageChannel !== 'function') {\n // If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore,\n // fallback to a naive implementation.\n var _callback = null;\n var _timeoutID = null;\n\n var _flushCallback = function () {\n if (_callback !== null) {\n try {\n var currentTime = exports.unstable_now();\n var hasRemainingTime = true;\n\n _callback(hasRemainingTime, currentTime);\n\n _callback = null;\n } catch (e) {\n setTimeout(_flushCallback, 0);\n throw e;\n }\n }\n };\n\n var initialTime = Date.now();\n\n exports.unstable_now = function () {\n return Date.now() - initialTime;\n };\n\n requestHostCallback = function (cb) {\n if (_callback !== null) {\n // Protect against re-entrancy.\n setTimeout(requestHostCallback, 0, cb);\n } else {\n _callback = cb;\n setTimeout(_flushCallback, 0);\n }\n };\n\n requestHostTimeout = function (cb, ms) {\n _timeoutID = setTimeout(cb, ms);\n };\n\n cancelHostTimeout = function () {\n clearTimeout(_timeoutID);\n };\n\n shouldYieldToHost = function () {\n return false;\n };\n\n requestPaint = exports.unstable_forceFrameRate = function () {};\n} else {\n // Capture local references to native APIs, in case a polyfill overrides them.\n var performance = window.performance;\n var _Date = window.Date;\n var _setTimeout = window.setTimeout;\n var _clearTimeout = window.clearTimeout;\n\n if (typeof console !== 'undefined') {\n // TODO: Scheduler no longer requires these methods to be polyfilled. But\n // maybe we want to continue warning if they don't exist, to preserve the\n // option to rely on it in the future?\n var requestAnimationFrame = window.requestAnimationFrame;\n var cancelAnimationFrame = window.cancelAnimationFrame; // TODO: Remove fb.me link\n\n if (typeof requestAnimationFrame !== 'function') {\n // Using console['error'] to evade Babel and ESLint\n console['error'](\"This browser doesn't support requestAnimationFrame. \" + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');\n }\n\n if (typeof cancelAnimationFrame !== 'function') {\n // Using console['error'] to evade Babel and ESLint\n console['error'](\"This browser doesn't support cancelAnimationFrame. \" + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');\n }\n }\n\n if (typeof performance === 'object' && typeof performance.now === 'function') {\n exports.unstable_now = function () {\n return performance.now();\n };\n } else {\n var _initialTime = _Date.now();\n\n exports.unstable_now = function () {\n return _Date.now() - _initialTime;\n };\n }\n\n var isMessageLoopRunning = false;\n var scheduledHostCallback = null;\n var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main\n // thread, like user events. By default, it yields multiple times per frame.\n // It does not attempt to align with frame boundaries, since most tasks don't\n // need to be frame aligned; for those that do, use requestAnimationFrame.\n\n var yieldInterval = 5;\n var deadline = 0; // TODO: Make this configurable\n\n {\n // `isInputPending` is not available. Since we have no way of knowing if\n // there's pending input, always yield at the end of the frame.\n shouldYieldToHost = function () {\n return exports.unstable_now() >= deadline;\n }; // Since we yield every frame regardless, `requestPaint` has no effect.\n\n\n requestPaint = function () {};\n }\n\n exports.unstable_forceFrameRate = function (fps) {\n if (fps < 0 || fps > 125) {\n // Using console['error'] to evade Babel and ESLint\n console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing framerates higher than 125 fps is not unsupported');\n return;\n }\n\n if (fps > 0) {\n yieldInterval = Math.floor(1000 / fps);\n } else {\n // reset the framerate\n yieldInterval = 5;\n }\n };\n\n var performWorkUntilDeadline = function () {\n if (scheduledHostCallback !== null) {\n var currentTime = exports.unstable_now(); // Yield after `yieldInterval` ms, regardless of where we are in the vsync\n // cycle. This means there's always time remaining at the beginning of\n // the message event.\n\n deadline = currentTime + yieldInterval;\n var hasTimeRemaining = true;\n\n try {\n var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);\n\n if (!hasMoreWork) {\n isMessageLoopRunning = false;\n scheduledHostCallback = null;\n } else {\n // If there's more work, schedule the next message event at the end\n // of the preceding one.\n port.postMessage(null);\n }\n } catch (error) {\n // If a scheduler task throws, exit the current browser task so the\n // error can be observed.\n port.postMessage(null);\n throw error;\n }\n } else {\n isMessageLoopRunning = false;\n } // Yielding to the browser will give it a chance to paint, so we can\n };\n\n var channel = new MessageChannel();\n var port = channel.port2;\n channel.port1.onmessage = performWorkUntilDeadline;\n\n requestHostCallback = function (callback) {\n scheduledHostCallback = callback;\n\n if (!isMessageLoopRunning) {\n isMessageLoopRunning = true;\n port.postMessage(null);\n }\n };\n\n requestHostTimeout = function (callback, ms) {\n taskTimeoutID = _setTimeout(function () {\n callback(exports.unstable_now());\n }, ms);\n };\n\n cancelHostTimeout = function () {\n _clearTimeout(taskTimeoutID);\n\n taskTimeoutID = -1;\n };\n}\n\nfunction push(heap, node) {\n var index = heap.length;\n heap.push(node);\n siftUp(heap, node, index);\n}\nfunction peek(heap) {\n var first = heap[0];\n return first === undefined ? null : first;\n}\nfunction pop(heap) {\n var first = heap[0];\n\n if (first !== undefined) {\n var last = heap.pop();\n\n if (last !== first) {\n heap[0] = last;\n siftDown(heap, last, 0);\n }\n\n return first;\n } else {\n return null;\n }\n}\n\nfunction siftUp(heap, node, i) {\n var index = i;\n\n while (true) {\n var parentIndex = index - 1 >>> 1;\n var parent = heap[parentIndex];\n\n if (parent !== undefined && compare(parent, node) > 0) {\n // The parent is larger. Swap positions.\n heap[parentIndex] = node;\n heap[index] = parent;\n index = parentIndex;\n } else {\n // The parent is smaller. Exit.\n return;\n }\n }\n}\n\nfunction siftDown(heap, node, i) {\n var index = i;\n var length = heap.length;\n\n while (index < length) {\n var leftIndex = (index + 1) * 2 - 1;\n var left = heap[leftIndex];\n var rightIndex = leftIndex + 1;\n var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.\n\n if (left !== undefined && compare(left, node) < 0) {\n if (right !== undefined && compare(right, left) < 0) {\n heap[index] = right;\n heap[rightIndex] = node;\n index = rightIndex;\n } else {\n heap[index] = left;\n heap[leftIndex] = node;\n index = leftIndex;\n }\n } else if (right !== undefined && compare(right, node) < 0) {\n heap[index] = right;\n heap[rightIndex] = node;\n index = rightIndex;\n } else {\n // Neither child is smaller. Exit.\n return;\n }\n }\n}\n\nfunction compare(a, b) {\n // Compare sort index first, then task id.\n var diff = a.sortIndex - b.sortIndex;\n return diff !== 0 ? diff : a.id - b.id;\n}\n\n// TODO: Use symbols?\nvar NoPriority = 0;\nvar ImmediatePriority = 1;\nvar UserBlockingPriority = 2;\nvar NormalPriority = 3;\nvar LowPriority = 4;\nvar IdlePriority = 5;\n\nvar runIdCounter = 0;\nvar mainThreadIdCounter = 0;\nvar profilingStateSize = 4;\nvar sharedProfilingBuffer = // $FlowFixMe Flow doesn't know about SharedArrayBuffer\ntypeof SharedArrayBuffer === 'function' ? new SharedArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : // $FlowFixMe Flow doesn't know about ArrayBuffer\ntypeof ArrayBuffer === 'function' ? new ArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : null // Don't crash the init path on IE9\n;\nvar profilingState = sharedProfilingBuffer !== null ? new Int32Array(sharedProfilingBuffer) : []; // We can't read this but it helps save bytes for null checks\n\nvar PRIORITY = 0;\nvar CURRENT_TASK_ID = 1;\nvar CURRENT_RUN_ID = 2;\nvar QUEUE_SIZE = 3;\n\n{\n profilingState[PRIORITY] = NoPriority; // This is maintained with a counter, because the size of the priority queue\n // array might include canceled tasks.\n\n profilingState[QUEUE_SIZE] = 0;\n profilingState[CURRENT_TASK_ID] = 0;\n} // Bytes per element is 4\n\n\nvar INITIAL_EVENT_LOG_SIZE = 131072;\nvar MAX_EVENT_LOG_SIZE = 524288; // Equivalent to 2 megabytes\n\nvar eventLogSize = 0;\nvar eventLogBuffer = null;\nvar eventLog = null;\nvar eventLogIndex = 0;\nvar TaskStartEvent = 1;\nvar TaskCompleteEvent = 2;\nvar TaskErrorEvent = 3;\nvar TaskCancelEvent = 4;\nvar TaskRunEvent = 5;\nvar TaskYieldEvent = 6;\nvar SchedulerSuspendEvent = 7;\nvar SchedulerResumeEvent = 8;\n\nfunction logEvent(entries) {\n if (eventLog !== null) {\n var offset = eventLogIndex;\n eventLogIndex += entries.length;\n\n if (eventLogIndex + 1 > eventLogSize) {\n eventLogSize *= 2;\n\n if (eventLogSize > MAX_EVENT_LOG_SIZE) {\n // Using console['error'] to evade Babel and ESLint\n console['error'](\"Scheduler Profiling: Event log exceeded maximum size. Don't \" + 'forget to call `stopLoggingProfilingEvents()`.');\n stopLoggingProfilingEvents();\n return;\n }\n\n var newEventLog = new Int32Array(eventLogSize * 4);\n newEventLog.set(eventLog);\n eventLogBuffer = newEventLog.buffer;\n eventLog = newEventLog;\n }\n\n eventLog.set(entries, offset);\n }\n}\n\nfunction startLoggingProfilingEvents() {\n eventLogSize = INITIAL_EVENT_LOG_SIZE;\n eventLogBuffer = new ArrayBuffer(eventLogSize * 4);\n eventLog = new Int32Array(eventLogBuffer);\n eventLogIndex = 0;\n}\nfunction stopLoggingProfilingEvents() {\n var buffer = eventLogBuffer;\n eventLogSize = 0;\n eventLogBuffer = null;\n eventLog = null;\n eventLogIndex = 0;\n return buffer;\n}\nfunction markTaskStart(task, ms) {\n {\n profilingState[QUEUE_SIZE]++;\n\n if (eventLog !== null) {\n // performance.now returns a float, representing milliseconds. When the\n // event is logged, it's coerced to an int. Convert to microseconds to\n // maintain extra degrees of precision.\n logEvent([TaskStartEvent, ms * 1000, task.id, task.priorityLevel]);\n }\n }\n}\nfunction markTaskCompleted(task, ms) {\n {\n profilingState[PRIORITY] = NoPriority;\n profilingState[CURRENT_TASK_ID] = 0;\n profilingState[QUEUE_SIZE]--;\n\n if (eventLog !== null) {\n logEvent([TaskCompleteEvent, ms * 1000, task.id]);\n }\n }\n}\nfunction markTaskCanceled(task, ms) {\n {\n profilingState[QUEUE_SIZE]--;\n\n if (eventLog !== null) {\n logEvent([TaskCancelEvent, ms * 1000, task.id]);\n }\n }\n}\nfunction markTaskErrored(task, ms) {\n {\n profilingState[PRIORITY] = NoPriority;\n profilingState[CURRENT_TASK_ID] = 0;\n profilingState[QUEUE_SIZE]--;\n\n if (eventLog !== null) {\n logEvent([TaskErrorEvent, ms * 1000, task.id]);\n }\n }\n}\nfunction markTaskRun(task, ms) {\n {\n runIdCounter++;\n profilingState[PRIORITY] = task.priorityLevel;\n profilingState[CURRENT_TASK_ID] = task.id;\n profilingState[CURRENT_RUN_ID] = runIdCounter;\n\n if (eventLog !== null) {\n logEvent([TaskRunEvent, ms * 1000, task.id, runIdCounter]);\n }\n }\n}\nfunction markTaskYield(task, ms) {\n {\n profilingState[PRIORITY] = NoPriority;\n profilingState[CURRENT_TASK_ID] = 0;\n profilingState[CURRENT_RUN_ID] = 0;\n\n if (eventLog !== null) {\n logEvent([TaskYieldEvent, ms * 1000, task.id, runIdCounter]);\n }\n }\n}\nfunction markSchedulerSuspended(ms) {\n {\n mainThreadIdCounter++;\n\n if (eventLog !== null) {\n logEvent([SchedulerSuspendEvent, ms * 1000, mainThreadIdCounter]);\n }\n }\n}\nfunction markSchedulerUnsuspended(ms) {\n {\n if (eventLog !== null) {\n logEvent([SchedulerResumeEvent, ms * 1000, mainThreadIdCounter]);\n }\n }\n}\n\n/* eslint-disable no-var */\n// Math.pow(2, 30) - 1\n// 0b111111111111111111111111111111\n\nvar maxSigned31BitInt = 1073741823; // Times out immediately\n\nvar IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out\n\nvar USER_BLOCKING_PRIORITY = 250;\nvar NORMAL_PRIORITY_TIMEOUT = 5000;\nvar LOW_PRIORITY_TIMEOUT = 10000; // Never times out\n\nvar IDLE_PRIORITY = maxSigned31BitInt; // Tasks are stored on a min heap\n\nvar taskQueue = [];\nvar timerQueue = []; // Incrementing id counter. Used to maintain insertion order.\n\nvar taskIdCounter = 1; // Pausing the scheduler is useful for debugging.\nvar currentTask = null;\nvar currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrancy.\n\nvar isPerformingWork = false;\nvar isHostCallbackScheduled = false;\nvar isHostTimeoutScheduled = false;\n\nfunction advanceTimers(currentTime) {\n // Check for tasks that are no longer delayed and add them to the queue.\n var timer = peek(timerQueue);\n\n while (timer !== null) {\n if (timer.callback === null) {\n // Timer was cancelled.\n pop(timerQueue);\n } else if (timer.startTime <= currentTime) {\n // Timer fired. Transfer to the task queue.\n pop(timerQueue);\n timer.sortIndex = timer.expirationTime;\n push(taskQueue, timer);\n\n {\n markTaskStart(timer, currentTime);\n timer.isQueued = true;\n }\n } else {\n // Remaining timers are pending.\n return;\n }\n\n timer = peek(timerQueue);\n }\n}\n\nfunction handleTimeout(currentTime) {\n isHostTimeoutScheduled = false;\n advanceTimers(currentTime);\n\n if (!isHostCallbackScheduled) {\n if (peek(taskQueue) !== null) {\n isHostCallbackScheduled = true;\n requestHostCallback(flushWork);\n } else {\n var firstTimer = peek(timerQueue);\n\n if (firstTimer !== null) {\n requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);\n }\n }\n }\n}\n\nfunction flushWork(hasTimeRemaining, initialTime) {\n {\n markSchedulerUnsuspended(initialTime);\n } // We'll need a host callback the next time work is scheduled.\n\n\n isHostCallbackScheduled = false;\n\n if (isHostTimeoutScheduled) {\n // We scheduled a timeout but it's no longer needed. Cancel it.\n isHostTimeoutScheduled = false;\n cancelHostTimeout();\n }\n\n isPerformingWork = true;\n var previousPriorityLevel = currentPriorityLevel;\n\n try {\n if (enableProfiling) {\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } catch (error) {\n if (currentTask !== null) {\n var currentTime = exports.unstable_now();\n markTaskErrored(currentTask, currentTime);\n currentTask.isQueued = false;\n }\n\n throw error;\n }\n } else {\n // No catch in prod codepath.\n return workLoop(hasTimeRemaining, initialTime);\n }\n } finally {\n currentTask = null;\n currentPriorityLevel = previousPriorityLevel;\n isPerformingWork = false;\n\n {\n var _currentTime = exports.unstable_now();\n\n markSchedulerSuspended(_currentTime);\n }\n }\n}\n\nfunction workLoop(hasTimeRemaining, initialTime) {\n var currentTime = initialTime;\n advanceTimers(currentTime);\n currentTask = peek(taskQueue);\n\n while (currentTask !== null && !(enableSchedulerDebugging )) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n // This currentTask hasn't expired, and we've reached the deadline.\n break;\n }\n\n var callback = currentTask.callback;\n\n if (callback !== null) {\n currentTask.callback = null;\n currentPriorityLevel = currentTask.priorityLevel;\n var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n markTaskRun(currentTask, currentTime);\n var continuationCallback = callback(didUserCallbackTimeout);\n currentTime = exports.unstable_now();\n\n if (typeof continuationCallback === 'function') {\n currentTask.callback = continuationCallback;\n markTaskYield(currentTask, currentTime);\n } else {\n {\n markTaskCompleted(currentTask, currentTime);\n currentTask.isQueued = false;\n }\n\n if (currentTask === peek(taskQueue)) {\n pop(taskQueue);\n }\n }\n\n advanceTimers(currentTime);\n } else {\n pop(taskQueue);\n }\n\n currentTask = peek(taskQueue);\n } // Return whether there's additional work\n\n\n if (currentTask !== null) {\n return true;\n } else {\n var firstTimer = peek(timerQueue);\n\n if (firstTimer !== null) {\n requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);\n }\n\n return false;\n }\n}\n\nfunction unstable_runWithPriority(priorityLevel, eventHandler) {\n switch (priorityLevel) {\n case ImmediatePriority:\n case UserBlockingPriority:\n case NormalPriority:\n case LowPriority:\n case IdlePriority:\n break;\n\n default:\n priorityLevel = NormalPriority;\n }\n\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n}\n\nfunction unstable_next(eventHandler) {\n var priorityLevel;\n\n switch (currentPriorityLevel) {\n case ImmediatePriority:\n case UserBlockingPriority:\n case NormalPriority:\n // Shift down to normal priority\n priorityLevel = NormalPriority;\n break;\n\n default:\n // Anything lower than normal priority should remain at the current level.\n priorityLevel = currentPriorityLevel;\n break;\n }\n\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n}\n\nfunction unstable_wrapCallback(callback) {\n var parentPriorityLevel = currentPriorityLevel;\n return function () {\n // This is a fork of runWithPriority, inlined for performance.\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = parentPriorityLevel;\n\n try {\n return callback.apply(this, arguments);\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n };\n}\n\nfunction timeoutForPriorityLevel(priorityLevel) {\n switch (priorityLevel) {\n case ImmediatePriority:\n return IMMEDIATE_PRIORITY_TIMEOUT;\n\n case UserBlockingPriority:\n return USER_BLOCKING_PRIORITY;\n\n case IdlePriority:\n return IDLE_PRIORITY;\n\n case LowPriority:\n return LOW_PRIORITY_TIMEOUT;\n\n case NormalPriority:\n default:\n return NORMAL_PRIORITY_TIMEOUT;\n }\n}\n\nfunction unstable_scheduleCallback(priorityLevel, callback, options) {\n var currentTime = exports.unstable_now();\n var startTime;\n var timeout;\n\n if (typeof options === 'object' && options !== null) {\n var delay = options.delay;\n\n if (typeof delay === 'number' && delay > 0) {\n startTime = currentTime + delay;\n } else {\n startTime = currentTime;\n }\n\n timeout = typeof options.timeout === 'number' ? options.timeout : timeoutForPriorityLevel(priorityLevel);\n } else {\n timeout = timeoutForPriorityLevel(priorityLevel);\n startTime = currentTime;\n }\n\n var expirationTime = startTime + timeout;\n var newTask = {\n id: taskIdCounter++,\n callback: callback,\n priorityLevel: priorityLevel,\n startTime: startTime,\n expirationTime: expirationTime,\n sortIndex: -1\n };\n\n {\n newTask.isQueued = false;\n }\n\n if (startTime > currentTime) {\n // This is a delayed task.\n newTask.sortIndex = startTime;\n push(timerQueue, newTask);\n\n if (peek(taskQueue) === null && newTask === peek(timerQueue)) {\n // All tasks are delayed, and this is the task with the earliest delay.\n if (isHostTimeoutScheduled) {\n // Cancel an existing timeout.\n cancelHostTimeout();\n } else {\n isHostTimeoutScheduled = true;\n } // Schedule a timeout.\n\n\n requestHostTimeout(handleTimeout, startTime - currentTime);\n }\n } else {\n newTask.sortIndex = expirationTime;\n push(taskQueue, newTask);\n\n {\n markTaskStart(newTask, currentTime);\n newTask.isQueued = true;\n } // Schedule a host callback, if needed. If we're already performing work,\n // wait until the next time we yield.\n\n\n if (!isHostCallbackScheduled && !isPerformingWork) {\n isHostCallbackScheduled = true;\n requestHostCallback(flushWork);\n }\n }\n\n return newTask;\n}\n\nfunction unstable_pauseExecution() {\n}\n\nfunction unstable_continueExecution() {\n\n if (!isHostCallbackScheduled && !isPerformingWork) {\n isHostCallbackScheduled = true;\n requestHostCallback(flushWork);\n }\n}\n\nfunction unstable_getFirstCallbackNode() {\n return peek(taskQueue);\n}\n\nfunction unstable_cancelCallback(task) {\n {\n if (task.isQueued) {\n var currentTime = exports.unstable_now();\n markTaskCanceled(task, currentTime);\n task.isQueued = false;\n }\n } // Null out the callback to indicate the task has been canceled. (Can't\n // remove from the queue because you can't remove arbitrary nodes from an\n // array based heap, only the first one.)\n\n\n task.callback = null;\n}\n\nfunction unstable_getCurrentPriorityLevel() {\n return currentPriorityLevel;\n}\n\nfunction unstable_shouldYield() {\n var currentTime = exports.unstable_now();\n advanceTimers(currentTime);\n var firstTask = peek(taskQueue);\n return firstTask !== currentTask && currentTask !== null && firstTask !== null && firstTask.callback !== null && firstTask.startTime <= currentTime && firstTask.expirationTime < currentTask.expirationTime || shouldYieldToHost();\n}\n\nvar unstable_requestPaint = requestPaint;\nvar unstable_Profiling = {\n startLoggingProfilingEvents: startLoggingProfilingEvents,\n stopLoggingProfilingEvents: stopLoggingProfilingEvents,\n sharedProfilingBuffer: sharedProfilingBuffer\n} ;\n\nexports.unstable_IdlePriority = IdlePriority;\nexports.unstable_ImmediatePriority = ImmediatePriority;\nexports.unstable_LowPriority = LowPriority;\nexports.unstable_NormalPriority = NormalPriority;\nexports.unstable_Profiling = unstable_Profiling;\nexports.unstable_UserBlockingPriority = UserBlockingPriority;\nexports.unstable_cancelCallback = unstable_cancelCallback;\nexports.unstable_continueExecution = unstable_continueExecution;\nexports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;\nexports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;\nexports.unstable_next = unstable_next;\nexports.unstable_pauseExecution = unstable_pauseExecution;\nexports.unstable_requestPaint = unstable_requestPaint;\nexports.unstable_runWithPriority = unstable_runWithPriority;\nexports.unstable_scheduleCallback = unstable_scheduleCallback;\nexports.unstable_shouldYield = unstable_shouldYield;\nexports.unstable_wrapCallback = unstable_wrapCallback;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler-tracing.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler-tracing.development.js');\n}\n","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var script = doc.createElement(\"script\");\n script.onreadystatechange = function () {\n runIfPresent(handle);\n script.onreadystatechange = null;\n html.removeChild(script);\n script = null;\n };\n html.appendChild(script);\n };\n }\n\n function installSetTimeoutImplementation() {\n registerImmediate = function(handle) {\n setTimeout(runIfPresent, 0, handle);\n };\n }\n\n // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.\n var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);\n attachTo = attachTo && attachTo.setTimeout ? attachTo : global;\n\n // Don't get fooled by e.g. browserify environments.\n if ({}.toString.call(global.process) === \"[object process]\") {\n // For Node.js before 0.9\n installNextTickImplementation();\n\n } else if (canUsePostMessage()) {\n // For non-IE10 modern browsers\n installPostMessageImplementation();\n\n } else if (global.MessageChannel) {\n // For web workers, where supported\n installMessageChannelImplementation();\n\n } else if (doc && \"onreadystatechange\" in doc.createElement(\"script\")) {\n // For IE 6–8\n installReadyStateChangeImplementation();\n\n } else {\n // For older browsers\n installSetTimeoutImplementation();\n }\n\n attachTo.setImmediate = setImmediate;\n attachTo.clearImmediate = clearImmediate;\n}(typeof self === \"undefined\" ? typeof global === \"undefined\" ? this : global : self));\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nmodule.exports = Stream;\n\nvar EE = require('events').EventEmitter;\nvar inherits = require('inherits');\n\ninherits(Stream, EE);\nStream.Readable = require('readable-stream/readable.js');\nStream.Writable = require('readable-stream/writable.js');\nStream.Duplex = require('readable-stream/duplex.js');\nStream.Transform = require('readable-stream/transform.js');\nStream.PassThrough = require('readable-stream/passthrough.js');\n\n// Backwards-compat with node 0.4.x\nStream.Stream = Stream;\n\n\n\n// old-style streams. Note that the pipe method (the only relevant\n// part of this class) is overridden in the Readable class.\n\nfunction Stream() {\n EE.call(this);\n}\n\nStream.prototype.pipe = function(dest, options) {\n var source = this;\n\n function ondata(chunk) {\n if (dest.writable) {\n if (false === dest.write(chunk) && source.pause) {\n source.pause();\n }\n }\n }\n\n source.on('data', ondata);\n\n function ondrain() {\n if (source.readable && source.resume) {\n source.resume();\n }\n }\n\n dest.on('drain', ondrain);\n\n // If the 'end' option is not supplied, dest.end() will be called when\n // source gets the 'end' or 'close' events. Only dest.end() once.\n if (!dest._isStdio && (!options || options.end !== false)) {\n source.on('end', onend);\n source.on('close', onclose);\n }\n\n var didOnEnd = false;\n function onend() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n dest.end();\n }\n\n\n function onclose() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n if (typeof dest.destroy === 'function') dest.destroy();\n }\n\n // don't leave dangling pipes when there are errors.\n function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }\n\n source.on('error', onerror);\n dest.on('error', onerror);\n\n // remove all the event listeners that were added.\n function cleanup() {\n source.removeListener('data', ondata);\n dest.removeListener('drain', ondrain);\n\n source.removeListener('end', onend);\n source.removeListener('close', onclose);\n\n source.removeListener('error', onerror);\n dest.removeListener('error', onerror);\n\n source.removeListener('end', cleanup);\n source.removeListener('close', cleanup);\n\n dest.removeListener('close', cleanup);\n }\n\n source.on('end', cleanup);\n source.on('close', cleanup);\n\n dest.on('close', cleanup);\n\n dest.emit('pipe', source);\n\n // Allow for unix-like usage: A.pipe(B).pipe(C)\n return dest;\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/*<replacement>*/\n\nvar Buffer = require('safe-buffer').Buffer;\n/*</replacement>*/\n\nvar isEncoding = Buffer.isEncoding || function (encoding) {\n encoding = '' + encoding;\n switch (encoding && encoding.toLowerCase()) {\n case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':\n return true;\n default:\n return false;\n }\n};\n\nfunction _normalizeEncoding(enc) {\n if (!enc) return 'utf8';\n var retried;\n while (true) {\n switch (enc) {\n case 'utf8':\n case 'utf-8':\n return 'utf8';\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return 'utf16le';\n case 'latin1':\n case 'binary':\n return 'latin1';\n case 'base64':\n case 'ascii':\n case 'hex':\n return enc;\n default:\n if (retried) return; // undefined\n enc = ('' + enc).toLowerCase();\n retried = true;\n }\n }\n};\n\n// Do not cache `Buffer.isEncoding` when checking encoding names as some\n// modules monkey-patch it to support additional encodings\nfunction normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}\n\n// StringDecoder provides an interface for efficiently splitting a series of\n// buffers into a series of JS strings without breaking apart multi-byte\n// characters.\nexports.StringDecoder = StringDecoder;\nfunction StringDecoder(encoding) {\n this.encoding = normalizeEncoding(encoding);\n var nb;\n switch (this.encoding) {\n case 'utf16le':\n this.text = utf16Text;\n this.end = utf16End;\n nb = 4;\n break;\n case 'utf8':\n this.fillLast = utf8FillLast;\n nb = 4;\n break;\n case 'base64':\n this.text = base64Text;\n this.end = base64End;\n nb = 3;\n break;\n default:\n this.write = simpleWrite;\n this.end = simpleEnd;\n return;\n }\n this.lastNeed = 0;\n this.lastTotal = 0;\n this.lastChar = Buffer.allocUnsafe(nb);\n}\n\nStringDecoder.prototype.write = function (buf) {\n if (buf.length === 0) return '';\n var r;\n var i;\n if (this.lastNeed) {\n r = this.fillLast(buf);\n if (r === undefined) return '';\n i = this.lastNeed;\n this.lastNeed = 0;\n } else {\n i = 0;\n }\n if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);\n return r || '';\n};\n\nStringDecoder.prototype.end = utf8End;\n\n// Returns only complete characters in a Buffer\nStringDecoder.prototype.text = utf8Text;\n\n// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer\nStringDecoder.prototype.fillLast = function (buf) {\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);\n this.lastNeed -= buf.length;\n};\n\n// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a\n// continuation byte. If an invalid byte is detected, -2 is returned.\nfunction utf8CheckByte(byte) {\n if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;\n return byte >> 6 === 0x02 ? -1 : -2;\n}\n\n// Checks at most 3 bytes at the end of a Buffer in order to detect an\n// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)\n// needed to complete the UTF-8 character (if applicable) are returned.\nfunction utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}\n\n// Validates as many continuation bytes for a multi-byte UTF-8 character as\n// needed or are available. If we see a non-continuation byte where we expect\n// one, we \"replace\" the validated continuation bytes we've seen so far with\n// a single UTF-8 replacement character ('\\ufffd'), to match v8's UTF-8 decoding\n// behavior. The continuation byte check is included three times in the case\n// where all of the continuation bytes for a character exist in the same buffer.\n// It is also done this way as a slight performance increase instead of using a\n// loop.\nfunction utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}\n\n// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.\nfunction utf8FillLast(buf) {\n var p = this.lastTotal - this.lastNeed;\n var r = utf8CheckExtraBytes(this, buf, p);\n if (r !== undefined) return r;\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, p, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, p, 0, buf.length);\n this.lastNeed -= buf.length;\n}\n\n// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a\n// partial character, the character's bytes are buffered until the required\n// number of bytes are available.\nfunction utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}\n\n// For UTF-8, a replacement character is added when ending on a partial\n// character.\nfunction utf8End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + '\\ufffd';\n return r;\n}\n\n// UTF-16LE typically needs two bytes per character, but even if we have an even\n// number of bytes available, we need to check if we end on a leading/high\n// surrogate. In that case, we need to wait for the next two bytes in order to\n// decode the last character properly.\nfunction utf16Text(buf, i) {\n if ((buf.length - i) % 2 === 0) {\n var r = buf.toString('utf16le', i);\n if (r) {\n var c = r.charCodeAt(r.length - 1);\n if (c >= 0xD800 && c <= 0xDBFF) {\n this.lastNeed = 2;\n this.lastTotal = 4;\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n return r.slice(0, -1);\n }\n }\n return r;\n }\n this.lastNeed = 1;\n this.lastTotal = 2;\n this.lastChar[0] = buf[buf.length - 1];\n return buf.toString('utf16le', i, buf.length - 1);\n}\n\n// For UTF-16LE we do not explicitly append special replacement characters if we\n// end on a partial character, we simply let v8 handle that.\nfunction utf16End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) {\n var end = this.lastTotal - this.lastNeed;\n return r + this.lastChar.toString('utf16le', 0, end);\n }\n return r;\n}\n\nfunction base64Text(buf, i) {\n var n = (buf.length - i) % 3;\n if (n === 0) return buf.toString('base64', i);\n this.lastNeed = 3 - n;\n this.lastTotal = 3;\n if (n === 1) {\n this.lastChar[0] = buf[buf.length - 1];\n } else {\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n }\n return buf.toString('base64', i, buf.length - n);\n}\n\nfunction base64End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);\n return r;\n}\n\n// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)\nfunction simpleWrite(buf) {\n return buf.toString(this.encoding);\n}\n\nfunction simpleEnd(buf) {\n return buf && buf.length ? this.write(buf) : '';\n}","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\t\t\tresult = Symbol('observable');\n\t\t\tSymbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n","var scope = (typeof global !== \"undefined\" && global) ||\n (typeof self !== \"undefined\" && self) ||\n window;\nvar apply = Function.prototype.apply;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) {\n if (timeout) {\n timeout.close();\n }\n};\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(scope, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// setimmediate attaches itself to the global object\nrequire(\"setimmediate\");\n// On some exotic environments, it's not clear which object `setimmediate` was\n// able to install onto. Search each possibility in the same order as the\n// `setimmediate` library.\nexports.setImmediate = (typeof self !== \"undefined\" && self.setImmediate) ||\n (typeof global !== \"undefined\" && global.setImmediate) ||\n (this && this.setImmediate);\nexports.clearImmediate = (typeof self !== \"undefined\" && self.clearImmediate) ||\n (typeof global !== \"undefined\" && global.clearImmediate) ||\n (this && this.clearImmediate);\n","\nmodule.exports = function () {\n var selection = document.getSelection();\n if (!selection.rangeCount) {\n return function () {};\n }\n var active = document.activeElement;\n\n var ranges = [];\n for (var i = 0; i < selection.rangeCount; i++) {\n ranges.push(selection.getRangeAt(i));\n }\n\n switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML\n case 'INPUT':\n case 'TEXTAREA':\n active.blur();\n break;\n\n default:\n active = null;\n break;\n }\n\n selection.removeAllRanges();\n return function () {\n selection.type === 'Caret' &&\n selection.removeAllRanges();\n\n if (!selection.rangeCount) {\n ranges.forEach(function(range) {\n selection.addRange(range);\n });\n }\n\n active &&\n active.focus();\n };\n};\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","\n/**\n * Module exports.\n */\n\nmodule.exports = deprecate;\n\n/**\n * Mark that a method should not be used.\n * Returns a modified function which warns once by default.\n *\n * If `localStorage.noDeprecation = true` is set, then it is a no-op.\n *\n * If `localStorage.throwDeprecation = true` is set, then deprecated functions\n * will throw an Error when invoked.\n *\n * If `localStorage.traceDeprecation = true` is set, then deprecated functions\n * will invoke `console.trace()` instead of `console.error()`.\n *\n * @param {Function} fn - the function to deprecate\n * @param {String} msg - the string to print to the console when `fn` is invoked\n * @returns {Function} a new \"deprecated\" version of `fn`\n * @api public\n */\n\nfunction deprecate (fn, msg) {\n if (config('noDeprecation')) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (config('throwDeprecation')) {\n throw new Error(msg);\n } else if (config('traceDeprecation')) {\n console.trace(msg);\n } else {\n console.warn(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n}\n\n/**\n * Checks `localStorage` for boolean values for the given `name`.\n *\n * @param {String} name\n * @returns {Boolean}\n * @api private\n */\n\nfunction config (name) {\n // accessing global.localStorage can trigger a DOMException in sandboxed iframes\n try {\n if (!global.localStorage) return false;\n } catch (_) {\n return false;\n }\n var val = global.localStorage[name];\n if (null == val) return false;\n return String(val).toLowerCase() === 'true';\n}\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","module.exports = function(originalModule) {\n\tif (!originalModule.webpackPolyfill) {\n\t\tvar module = Object.create(originalModule);\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"exports\", {\n\t\t\tenumerable: true\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","/* (ignored) */","/* (ignored) */"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./client/actions/index.js","webpack:///./client/components/App.jsx","webpack:///./client/components/Description.jsx","webpack:///./client/components/DescriptionCharCount.jsx","webpack:///./client/components/Header.jsx","webpack:///./client/components/LowerSect.jsx","webpack:///./client/components/PopUp.jsx","webpack:///./client/components/Preview.jsx","webpack:///./client/components/Title.jsx","webpack:///./client/components/TitleCharCount.jsx","webpack:///./client/components/Url.jsx","webpack:///./client/firebase.js","webpack:///./client/index.js","webpack:///./client/reducers/description.js","webpack:///./client/reducers/index.js","webpack:///./client/reducers/title.js","webpack:///./client/reducers/url.js","webpack:///./node_modules/@babel/runtime/helpers/assertThisInitialized.js","webpack:///./node_modules/@babel/runtime/helpers/classCallCheck.js","webpack:///./node_modules/@babel/runtime/helpers/createClass.js","webpack:///./node_modules/@babel/runtime/helpers/esm/extends.js","webpack:///./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack:///./node_modules/@babel/runtime/helpers/getPrototypeOf.js","webpack:///./node_modules/@babel/runtime/helpers/inherits.js","webpack:///./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","webpack:///./node_modules/@babel/runtime/helpers/setPrototypeOf.js","webpack:///./node_modules/@babel/runtime/helpers/typeof.js","webpack:///./node_modules/@firebase/analytics/dist/index.esm.js","webpack:///./node_modules/@firebase/app/dist/index.esm.js","webpack:///./node_modules/@firebase/auth/dist/auth.esm.js","webpack:///./node_modules/@firebase/component/dist/index.esm.js","webpack:///./node_modules/@firebase/database/dist/index.esm.js","webpack:///./node_modules/@firebase/firestore/dist/index.esm.js","webpack:///./node_modules/@firebase/functions/dist/index.esm.js","webpack:///./node_modules/@firebase/installations/dist/index.esm.js","webpack:///./node_modules/@firebase/logger/dist/index.esm.js","webpack:///./node_modules/@firebase/messaging/dist/index.esm.js","webpack:///./node_modules/@firebase/performance/dist/index.esm.js","webpack:///./node_modules/@firebase/remote-config/dist/index.esm.js","webpack:///./node_modules/@firebase/storage/dist/index.esm.js","webpack:///./node_modules/@firebase/util/dist/index.esm.js","webpack:///./node_modules/@firebase/webchannel-wrapper/dist/index.esm.js","webpack:///./node_modules/base64-js/index.js","webpack:///./node_modules/buffer/index.js","webpack:///./node_modules/copy-to-clipboard/index.js","webpack:///./node_modules/core-util-is/lib/util.js","webpack:///./node_modules/css-loader/dist/runtime/api.js","webpack:///./node_modules/download-csv/dist/creatCSVFile.js","webpack:///./node_modules/download-csv/dist/detectionClientType.js","webpack:///./node_modules/download-csv/dist/downloadFile.js","webpack:///./node_modules/download-csv/index.js","webpack:///./node_modules/events/events.js","webpack:///./node_modules/firebase/dist/index.esm.js","webpack:///./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","webpack:///./node_modules/idb/build/idb.js","webpack:///./node_modules/ieee754/index.js","webpack:///./node_modules/inherits/inherits_browser.js","webpack:///./node_modules/isarray/index.js","webpack:///./node_modules/jsonexport/lib/core/eol.js","webpack:///./node_modules/jsonexport/lib/core/escape-delimiters.js","webpack:///./node_modules/jsonexport/lib/core/helper.js","webpack:///./node_modules/jsonexport/lib/core/join-rows.js","webpack:///./node_modules/jsonexport/lib/core/stream.js","webpack:///./node_modules/jsonexport/lib/index.js","webpack:///./node_modules/jsonexport/lib/parser/csv.js","webpack:///./node_modules/jsonexport/lib/parser/handler.js","webpack:///./node_modules/object-assign/index.js","webpack:///./node_modules/os-browserify/browser.js","webpack:///./node_modules/process-nextick-args/index.js","webpack:///./node_modules/process/browser.js","webpack:///./node_modules/prop-types/checkPropTypes.js","webpack:///./node_modules/prop-types/factoryWithTypeCheckers.js","webpack:///./node_modules/prop-types/index.js","webpack:///./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack:///./node_modules/react-copy-to-clipboard/lib/Component.js","webpack:///./node_modules/react-copy-to-clipboard/lib/index.js","webpack:///./node_modules/react-dom/cjs/react-dom.development.js","webpack:///./node_modules/react-dom/index.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/Context.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/hooks/useDispatch.js","webpack:///./node_modules/react-redux/es/hooks/useReduxContext.js","webpack:///./node_modules/react-redux/es/hooks/useSelector.js","webpack:///./node_modules/react-redux/es/hooks/useStore.js","webpack:///./node_modules/react-redux/es/index.js","webpack:///./node_modules/react-redux/es/utils/Subscription.js","webpack:///./node_modules/react-redux/es/utils/batch.js","webpack:///./node_modules/react-redux/es/utils/isPlainObject.js","webpack:///./node_modules/react-redux/es/utils/reactBatchedUpdates.js","webpack:///./node_modules/react-redux/es/utils/shallowEqual.js","webpack:///./node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js","webpack:///./node_modules/react-redux/es/utils/verifyPlainObject.js","webpack:///./node_modules/react-redux/es/utils/warning.js","webpack:///./node_modules/react/cjs/react.development.js","webpack:///./node_modules/react/index.js","webpack:///./node_modules/reactjs-popup/dist/index.css","webpack:///./node_modules/reactjs-popup/dist/reactjs-popup.esm.js","webpack:///./node_modules/readable-stream/duplex-browser.js","webpack:///./node_modules/readable-stream/lib/_stream_duplex.js","webpack:///./node_modules/readable-stream/lib/_stream_passthrough.js","webpack:///./node_modules/readable-stream/lib/_stream_readable.js","webpack:///./node_modules/readable-stream/lib/_stream_transform.js","webpack:///./node_modules/readable-stream/lib/_stream_writable.js","webpack:///./node_modules/readable-stream/lib/internal/streams/BufferList.js","webpack:///./node_modules/readable-stream/lib/internal/streams/destroy.js","webpack:///./node_modules/readable-stream/lib/internal/streams/stream-browser.js","webpack:///./node_modules/readable-stream/passthrough.js","webpack:///./node_modules/readable-stream/readable-browser.js","webpack:///./node_modules/readable-stream/transform.js","webpack:///./node_modules/readable-stream/writable-browser.js","webpack:///./node_modules/redux-thunk/es/index.js","webpack:///./node_modules/redux/es/redux.js","webpack:///./node_modules/safe-buffer/index.js","webpack:///./node_modules/scheduler/cjs/scheduler-tracing.development.js","webpack:///./node_modules/scheduler/cjs/scheduler.development.js","webpack:///./node_modules/scheduler/index.js","webpack:///./node_modules/scheduler/tracing.js","webpack:///./node_modules/setimmediate/setImmediate.js","webpack:///./node_modules/stream-browserify/index.js","webpack:///./node_modules/string_decoder/lib/string_decoder.js","webpack:///./node_modules/symbol-observable/es/index.js","webpack:///./node_modules/symbol-observable/es/ponyfill.js","webpack:///./node_modules/timers-browserify/main.js","webpack:///./node_modules/toggle-selection/index.js","webpack:///./node_modules/tslib/tslib.es6.js","webpack:///./node_modules/util-deprecate/browser.js","webpack:///(webpack)/buildin/global.js","webpack:///(webpack)/buildin/harmony-module.js","webpack:///util (ignored)","webpack:///util (ignored)?4b85"],"names":["COLLECT_TITLE","COLLECT_DESCRIPTION","COLLECT_URL","collectTitle","title","type","collectDescription","description","collectUrl","url","App","React","Component","handleChange","e","dispatch","target","value","Description","props","mapStateToProps","state","connect","start","warning","perfect","characterCount","textColor","text","DescriptionCharCount","length","Header","deleteButton","deleteUserData","db","database","ref","set","downloadData","leadsRef","on","snapshot","childData","val","jsonexport","err","csv","console","error","log","downloadFile","LowerSect","PopUp","close","carryInfo","data","writeUserData","urlDomain","a","document","createElement","href","hostname","domain","name","split","join","Preview","onCopy","Title","TitleCharCount","Url","firebaseConfig","apiKey","authDomain","databaseURL","projectId","storageBucket","messagingSenderId","appId","measurementId","firebase","initializeApp","composeEnhancers","window","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","compose","store","createStore","reducers","applyMiddleware","thunkMiddleware","ReactDOM","render","getElementById","action","combineReducers"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAMA,aAAa,GAAG,eAAtB;AACA,IAAMC,mBAAmB,GAAG,qBAA5B;AACA,IAAMC,WAAW,GAAG,aAApB;AAEA,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAAW;AACrC,SAAO;AACLC,QAAI,EAAE,eADD;AAELD,SAAK,EAAEA;AAFF,GAAP;AAID,CALM;AAOA,IAAME,kBAAkB,GAAG,SAArBA,kBAAqB,CAACC,WAAD,EAAiB;AACjD,SAAO;AACLF,QAAI,EAAE,qBADD;AAELE,eAAW,EAAEA;AAFR,GAAP;AAID,CALM;AAOA,IAAMC,UAAU,GAAG,SAAbA,UAAa,CAACC,GAAD,EAAS;AACjC,SAAO;AACLJ,QAAI,EAAE,aADD;AAELI,OAAG,EAAEA;AAFA,GAAP;AAID,CALM,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClBP;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;IAEMC,G;;;;;;;;;;;;;6BACM;AACR,0BACE;AAAK,iBAAS,EAAC;AAAf,sBACE,2DAAC,+CAAD,OADF,eAEE,2DAAC,+CAAD,OAFF,eAGE;AAAK,iBAAS,EAAC;AAAf,sBACE,mGADF,eAEE,2DAAC,4CAAD,OAFF,eAGE,2DAAC,8CAAD,OAHF,eAIE,2DAAC,oDAAD,OAJF,CAHF,eASE,2DAAC,iDAAD,OATF,eAUE,2DAAC,mDAAD,OAVF,CADF;AAcD;;;;EAhBeC,4CAAK,CAACC,S;;AAmBTF,kEAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7BA;AACA;AACA;;AAEA,SAASG,YAAT,CAAuBC,CAAvB,EAA0BC,QAA1B,EAAoC;AAClCA,UAAQ,CAACT,mEAAkB,CAACQ,CAAC,CAACE,MAAF,CAASC,KAAV,CAAnB,CAAR;AACD;;IAEKC,W;;;;;;;;;;;;;6BACM;AAAA;;AACR,0BACE,qFACE;AAAG,iBAAS,EAAC;AAAb,uBADF,eAEE;AACE,YAAI,EAAC,MADP;AAEE,UAAE,EAAC,aAFL;AAGE,iBAAS,EAAC,mBAHZ;AAIE,mBAAW,EAAC,qCAJd;AAKE,gBAAQ,EAAE,kBAAAJ,CAAC;AAAA,iBAAID,YAAY,CAACC,CAAD,EAAI,KAAI,CAACK,KAAL,CAAWJ,QAAf,CAAhB;AAAA;AALb,QAFF,CADF;AAaD;;;;EAfuBJ,4CAAK,CAACC,S;;AAkBhC,IAAMQ,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,KAAK,EAAI;AAC/B,SAAO;AACLd,eAAW,EAAEc,KAAK,CAACd;AADd,GAAP;AAGD,CAJD;;AAMee,0HAAO,CAACF,eAAD,CAAP,CAAyBF,WAAzB,CAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AChCA;AACA;AAEA,IAAMK,KAAK,GAAG,8DAAd;AACA,IAAMC,OAAO,GAAG,+EAAhB;AACA,IAAMC,OAAO,GAAG,mDAAhB;AAEA,IAAIC,cAAc,GAAG,EAArB;AACA,IAAIC,SAAS,GAAG,cAAhB;AACA,IAAIC,IAAI,GAAG,EAAX;;IAEMC,oB;;;;;;;;;;;;;6BACM;AACR,UAAI,KAAKV,KAAL,CAAWZ,WAAf,EAA4B;AAC1BmB,sBAAc,GAAG,KAAKP,KAAL,CAAWZ,WAAX,CAAuBuB,MAAxC;AACD,OAFD,MAEO;AACLJ,sBAAc,GAAG,CAAjB;AACD;;AAED,UAAIA,cAAc,KAAK,CAAvB,EAA0B;AACxBC,iBAAS,GAAG,cAAZ;AACAC,YAAI,GAAGL,KAAP;AACD,OAHD,MAGO,IAAIG,cAAc,GAAG,GAAjB,IAAwBA,cAAc,GAAG,GAA7C,EAAkD;AACvDC,iBAAS,GAAG,cAAZ;AACAC,YAAI,GAAGJ,OAAP;AACD,OAHM,MAGA;AACLG,iBAAS,GAAG,cAAZ;AACAC,YAAI,GAAGH,OAAP;AACD;;AACD,0BACE,qFACE;AAAG,iBAAS,EAAEE;AAAd,SAA0BC,IAA1B,OAAiCF,cAAjC,gBADF,CADF;AAKD;;;;EAvBgCf,4CAAK,CAACC,S;;AA0BzC,IAAMQ,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,KAAK,EAAI;AAC/B,SAAO;AACLd,eAAW,EAAEc,KAAK,CAACd;AADd,GAAP;AAGD,CAJD;;AAMee,0HAAO,CAACF,eAAD,CAAP,CAAyBS,oBAAzB,CAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3CA;;IAEME,M;;;;;;;;;;;;;6BACM;AACR,0BACE;AAAK,iBAAS,EAAC;AAAf,sBACE,2FADF,CADF;AAKD;;;;EAPkBpB,4CAAK,CAACC,S;;AAUZmB,qEAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACZA;AAEA;AACA;AAEA;;AAEA,IAAMC,YAAY,GAAG,SAAfA,YAAe,GAAM;AACzBC,gBAAc;AACf,CAFD;;AAIA,SAASA,cAAT,GAA2B;AACzBC,mDAAE,CAACC,QAAH,GAAcC,GAAd,CAAkB,UAAlB,EAA8BC,GAA9B,CAAkC,IAAlC;AACD;;AAED,SAASC,YAAT,GAAyB;AACvB,MAAMC,QAAQ,GAAGL,iDAAE,CAACC,QAAH,GAAcC,GAAd,CAAkB,UAAlB,CAAjB;AAEAG,UAAQ,CAACC,EAAT,CAAY,OAAZ,EAAqB,UAAUC,QAAV,EAAoB;AACvC,QAAIC,SAAS,GAAGD,QAAQ,CAACE,GAAT,EAAhB;AAEAC,qDAAU,CAACF,SAAD,EAAY,UAAUG,GAAV,EAAeC,GAAf,EAAoB;AACxC,UAAID,GAAJ,EAAS,OAAOE,OAAO,CAACC,KAAR,CAAcH,GAAd,CAAP;AACTE,aAAO,CAACE,GAAR,CAAYH,GAAZ;AACAI,uEAAY,CAACJ,GAAD,EAAM,WAAN,CAAZ;AACD,KAJS,CAAV;AAKD,GARD;AASD;;IAEKK,S;;;;;;;;;;;;;6BACM;AACR,0BACE;AAAK,iBAAS,EAAC;AAAf,sBACE;AAAQ,iBAAS,EAAC,eAAlB;AAAkC,eAAO,EAAE;AAAA,iBAAMnB,YAAY,EAAlB;AAAA;AAA3C,sBADF,eAEE;AAAQ,iBAAS,EAAC,iBAAlB;AAAoC,eAAO,EAAE;AAAA,iBAAMM,YAAY,EAAlB;AAAA;AAA7C,yBAFF,CADF;AAMD;;;;EARqB3B,4CAAK,CAACC,S;;AAWfuC,wEAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxCA;AACA;AACA;AACA;;IAEMC,K;;;;;;;;;;;;;6BACM;AAAA;;AACR,0BACE;AAAK,iBAAS,EAAC;AAAf,sBACE,2DAAC,qDAAD;AACE,eAAO,eAAE;AAAQ,mBAAS,EAAC;AAAlB,0CAAiD,sEAAjD,eADX;AAEE,aAAK,MAFP;AAGE,cAAM;AAHR,SAKG,UAAAC,KAAK;AAAA,4BACJ;AAAK,mBAAS,EAAC;AAAf,wBACE;AAAQ,mBAAS,EAAC,OAAlB;AAA0B,iBAAO,EAAEA;AAAnC,kBADF,eAIE;AAAK,mBAAS,EAAC;AAAf,wBACE;AAAK,mBAAS,EAAC;AAAf,8BADF,eAEE;AAAK,mBAAS,EAAC;AAAf,WACG,GADH,gFAGE,sEAHF,aAIgB,KAAI,CAAClC,KAAL,CAAWf,KAJ3B,2BAKE,sEALF,qCAM6C,KAAI,CAACe,KAAL,CAAWf,KANxD,sBAOE,sEAPF,2CAQmD,KAAI,CAACe,KAAL,CAAWZ,WAR9D,6BASE,sEATF,CAFF,eAaE;AAAK,mBAAS,EAAC;AAAf,wBACE;AACE,mBAAS,EAAC,QADZ;AAEE,iBAAO,EAAE,mBAAM;AACbwC,mBAAO,CAACE,GAAR,CAAY,eAAZ;AACAI,iBAAK;AACN;AALH,kBADF,CAbF,CAJF,CADI;AAAA,OALR,CADF,CADF;AA0CD;;;;EA5CiB1C,4CAAK,CAACC,S;;AA+C1B,IAAMQ,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,KAAK,EAAI;AAC/B,SAAO;AACLjB,SAAK,EAAEiB,KAAK,CAACjB,KADR;AAELG,eAAW,EAAEc,KAAK,CAACd;AAFd,GAAP;AAID,CALD;;AAOee,0HAAO,CAACF,eAAD,CAAP,CAAyBgC,KAAzB,CAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3DA;AACA;AACA;AACA;AAEA;AACA;;AAEA,IAAME,SAAS,GAAG,SAAZA,SAAY,CAACC,IAAD,EAAU;AAC1BC,eAAa,CAACD,IAAI,CAAC9C,GAAN,EAAW8C,IAAI,CAACnD,KAAhB,EAAuBmD,IAAI,CAAChD,WAA5B,CAAb;AACD,CAFD;;AAIA,SAASkD,SAAT,CAAoBF,IAApB,EAA0B;AACxB,MAAIG,CAAC,GAAGC,QAAQ,CAACC,aAAT,CAAuB,GAAvB,CAAR;AACAF,GAAC,CAACG,IAAF,GAASN,IAAT;AACA,SAAOG,CAAC,CAACI,QAAT;AACD;;AAED,SAASN,aAAT,CAAwB/C,GAAxB,EAA6BL,KAA7B,EAAoCG,WAApC,EAAiD;AAC/C,MAAMwD,MAAM,GAAGN,SAAS,CAAChD,GAAD,CAAxB;AACA,MAAMuD,IAAI,GAAGD,MAAM,CAACE,KAAP,CAAa,GAAb,EAAkBC,IAAlB,CAAuB,EAAvB,CAAb;AACAhC,mDAAE,CAACC,QAAH,GAAcC,GAAd,CAAkB,cAAc4B,IAAhC,EAAsC3B,GAAtC,CAA0C;AACxCjC,SAAK,EAAEA,KADiC;AAExCG,eAAW,EAAEA,WAF2B;AAGxCE,OAAG,EAAEA;AAHmC,GAA1C;AAKD;;IAEK0D,O;;;;;;;;;;;;;6BACM;AAAA;;AACR,0BACE;AAAK,iBAAS,EAAC;AAAf,sBACE,mGADF,eAEE;AAAK,iBAAS,EAAC;AAAf,sBACE;AAAI,iBAAS,EAAC;AAAd,SAA+B,KAAKhD,KAAL,CAAWf,KAA1C,CADF,eAEE;AAAG,iBAAS,EAAC;AAAb,SAA4B,KAAKe,KAAL,CAAWV,GAAvC,CAFF,eAGE;AAAG,iBAAS,EAAC;AAAb,SAAoC,KAAKU,KAAL,CAAWZ,WAA/C,CAHF,CAFF,eAOE;AAAK,iBAAS,EAAC;AAAf,sBACE,2DAAC,uEAAD;AAAiB,YAAI,EAAE,KAAKY,KAAL,CAAWf,KAAlC;AAAyC,cAAM,EAAE,KAAKgE;AAAtD,sBACE,wFADF,CADF,eAIE,2DAAC,uEAAD;AAAiB,YAAI,EAAE,KAAKjD,KAAL,CAAWZ,WAAlC;AAA+C,cAAM,EAAE,KAAK6D;AAA5D,sBACE,8FADF,CAJF,eAOE;AAAQ,eAAO,EAAE;AAAA,iBAAMd,SAAS,CAAC,KAAI,CAACnC,KAAN,CAAf;AAAA,SAAjB;AAA8C,iBAAS,EAAC;AAAxD,gBAPF,CAPF,eAgBE;AAAK,iBAAS,EAAC;AAAf,sBACE,2DAAC,uDAAD,OADF,eAEE,2DAAC,8DAAD,OAFF,CAhBF,CADF;AAwBD;;;;EA1BmBR,4CAAK,CAACC,S;;AA6B5B,IAAMQ,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,KAAK,EAAI;AAC/B,SAAO;AACLjB,SAAK,EAAEiB,KAAK,CAACjB,KADR;AAELG,eAAW,EAAEc,KAAK,CAACd,WAFd;AAGLE,OAAG,EAAEY,KAAK,CAACZ;AAHN,GAAP;AAKD,CAND;;AAQea,0HAAO,CAACF,eAAD,CAAP,CAAyB+C,OAAzB,CAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjEA;AACA;AACA;;AAEA,SAAStD,YAAT,CAAuBC,CAAvB,EAA0BC,QAA1B,EAAoC;AAClCA,UAAQ,CAACZ,6DAAY,CAACW,CAAC,CAACE,MAAF,CAASC,KAAV,CAAb,CAAR;AACD;;IAEKoD,K;;;;;;;;;;;;;6BACM;AAAA;;AACR,0BACE,qFACE;AAAG,iBAAS,EAAC;AAAb,iBADF,eAEE;AACE,YAAI,EAAC,MADP;AAEE,UAAE,EAAC,OAFL;AAGE,iBAAS,EAAC,aAHZ;AAIE,mBAAW,EAAC,2CAJd;AAKE,gBAAQ,EAAE,kBAAAvD,CAAC;AAAA,iBAAID,YAAY,CAACC,CAAD,EAAI,KAAI,CAACK,KAAL,CAAWJ,QAAf,CAAhB;AAAA;AALb,QAFF,CADF;AAaD;;;;EAfiBJ,4CAAK,CAACC,S;;AAkB1B,IAAMQ,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,KAAK,EAAI;AAC/B,SAAO;AACLjB,SAAK,EAAEiB,KAAK,CAACjB;AADR,GAAP;AAGD,CAJD;;AAMekB,0HAAO,CAACF,eAAD,CAAP,CAAyBiD,KAAzB,CAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AChCA;AACA;AAEA,IAAM9C,KAAK,GAAG,sDAAd;AACA,IAAMC,OAAO,GAAG,uEAAhB;AACA,IAAMC,OAAO,GAAG,6CAAhB;AAEA,IAAIC,cAAc,GAAG,EAArB;AACA,IAAIC,SAAS,GAAG,cAAhB;AACA,IAAIC,IAAI,GAAGL,KAAX;;IAEM+C,c;;;;;;;;;;;;;6BACM;AACR,UAAI,KAAKnD,KAAL,CAAWf,KAAf,EAAsB;AACpBsB,sBAAc,GAAG,KAAKP,KAAL,CAAWf,KAAX,CAAiB0B,MAAlC;AACD,OAFD,MAEO;AACLJ,sBAAc,GAAG,CAAjB;AACD;;AAED,UAAIA,cAAc,KAAK,CAAvB,EAA0B;AACxBC,iBAAS,GAAG,cAAZ;AACAC,YAAI,GAAGL,KAAP;AACD,OAHD,MAGO,IAAIG,cAAc,GAAG,EAAjB,IAAuBA,cAAc,GAAG,EAA5C,EAAgD;AACrDC,iBAAS,GAAG,cAAZ;AACAC,YAAI,GAAGJ,OAAP;AACD,OAHM,MAGA,IAAIE,cAAc,GAAG,EAAjB,IAAuBA,cAAc,GAAG,EAA5C,EAAgD;AACrDC,iBAAS,GAAG,cAAZ;AACAC,YAAI,GAAGH,OAAP;AACD;;AAED,0BACE,qFACE;AAAG,iBAAS,EAAEE;AAAd,SAA0BC,IAA1B,OAAiCF,cAAjC,gBADF,CADF;AAKD;;;;EAxB0Bf,4CAAK,CAACC,S;;AA2BnC,IAAMQ,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,KAAK,EAAI;AAC/B,SAAO;AACLjB,SAAK,EAAEiB,KAAK,CAACjB;AADR,GAAP;AAGD,CAJD;;AAMekB,0HAAO,CAACF,eAAD,CAAP,CAAyBkD,cAAzB,CAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5CA;AACA;AACA;;AAEA,SAASzD,YAAT,CAAuBC,CAAvB,EAA0BC,QAA1B,EAAoC;AAClCA,UAAQ,CAACP,2DAAU,CAACM,CAAC,CAACE,MAAF,CAASC,KAAV,CAAX,CAAR;AACD;;IAEKsD,G;;;;;;;;;;;;;6BACM;AAAA;;AACR,0BACE,qFACE;AAAG,iBAAS,EAAC;AAAb,eADF,eAEE;AAAK,iBAAS,EAAC;AAAf,sBACE;AACE,YAAI,EAAC,MADP;AAEE,UAAE,EAAC,KAFL;AAGE,iBAAS,EAAC,WAHZ;AAIE,mBAAW,EAAC,qBAJd;AAKE,gBAAQ,EAAE,kBAAAzD,CAAC;AAAA,iBAAID,YAAY,CAACC,CAAD,EAAI,KAAI,CAACK,KAAL,CAAWJ,QAAf,CAAhB;AAAA;AALb,QADF,CAFF,CADF;AAeD;;;;EAjBeJ,4CAAK,CAACC,S;;AAoBxB,IAAMQ,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,KAAK,EAAI;AAC/B,SAAO;AACLZ,OAAG,EAAEY,KAAK,CAACZ;AADN,GAAP;AAGD,CAJD;;AAMea,0HAAO,CAACF,eAAD,CAAP,CAAyBmD,GAAzB,CAAf,E;;;;;;;;;;;;AClCA;AAAA;AAAA;AAEA,IAAMC,cAAc,GAAG;AACrBC,QAAM,EAAE,yCADa;AAErBC,YAAU,EAAE,mCAFS;AAGrBC,aAAW,EAAE,0CAHQ;AAIrBC,WAAS,EAAE,mBAJU;AAKrBC,eAAa,EAAE,+BALM;AAMrBC,mBAAiB,EAAE,cANE;AAOrBC,OAAK,EAAE,2CAPc;AAQrBC,eAAa,EAAE;AARM,CAAvB;AAWA,IAAM9C,EAAE,GAAG+C,gDAAQ,CAACC,aAAT,CAAuBV,cAAvB,CAAX;AAEetC,iEAAf,E;;;;;;;;;;;;ACfA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA,IAAMiD,gBAAgB,GAAGC,MAAM,CAACC,oCAAP,IAA+CC,6CAAxE;AACA,IAAMC,KAAK,GAAGC,yDAAW,CACvBC,iDADuB,EAEvBN,gBAAgB,CAACO,6DAAe,CAACC,mDAAD,CAAhB,CAFO,CAAzB;AAKAC,gDAAQ,CAACC,MAAT,eACE,2DAAC,oDAAD;AAAU,OAAK,EAAEN;AAAjB,gBACE,2DAAC,uDAAD,OADF,CADF,EAIE5B,QAAQ,CAACmC,cAAT,CAAwB,KAAxB,CAJF,E;;;;;;;;;;;;ACfA;AAAA;AAAA;AAAA;AAEe,SAASxF,kBAAT,GAAuL;AAAA,MAA1Je,KAA0J,uEAAlJ,wIAAkJ;AAAA,MAAR0E,MAAQ;;AACpM,UAAQA,MAAM,CAAC1F,IAAf;AACE,SAAKJ,4DAAL;AACE,aAAO8F,MAAM,CAACxF,WAAd;;AACF;AACE,aAAOc,KAAP;AAJJ;AAMD,C;;;;;;;;;;;;ACTD;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAEe2E,4HAAe,CAAC;AAC7B5F,OAAK,EAALA,8CAD6B;AAE7BG,aAAW,EAAXA,oDAF6B;AAG7BE,KAAG,EAAHA,4CAAGA;AAH0B,CAAD,CAA9B,E;;;;;;;;;;;;ACLA;AAAA;AAAA;AAAA;AAEe,SAASN,YAAT,GAA8F;AAAA,MAAvEkB,KAAuE,uEAA/D,qDAA+D;AAAA,MAAR0E,MAAQ;;AAC3G,UAAQA,MAAM,CAAC1F,IAAf;AACE,SAAKL,sDAAL;AACE,aAAO+F,MAAM,CAAC3F,KAAd;;AACF;AACE,aAAOiB,KAAP;AAJJ;AAMD,C;;;;;;;;;;;;ACTD;AAAA;AAAA;AAAA;AAEe,SAASb,UAAT,GAA+D;AAAA,MAA1Ca,KAA0C,uEAAlC,wBAAkC;AAAA,MAAR0E,MAAQ;;AAC5E,UAAQA,MAAM,CAAC1F,IAAf;AACE,SAAKH,oDAAL;AACE,aAAO6F,MAAM,CAACtF,GAAd;;AACF;AACE,aAAOY,KAAP;AAJJ;AAMD,C;;;;;;;;;;;ACTD;AACA;AACA;AACA;;AAEA;AACA;;AAEA,wC;;;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;;AAEA,iC;;;;;;;;;;;ACNA;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,8B;;;;;;;;;;;;AChBA;AAAA;AAAe;AACf;AACA,mBAAmB,sBAAsB;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,C;;;;;;;;;;;;AChBA;AAAA;AAAe;AACf;AACA;AACA;AACA;;AAEA,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;;AAEA,iC;;;;;;;;;;;ACPA,qBAAqB,mBAAO,CAAC,iFAAkB;;AAE/C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA,2B;;;;;;;;;;;ACjBA,cAAc,mBAAO,CAAC,0EAAmB;;AAEzC,4BAA4B,mBAAO,CAAC,+FAAyB;;AAE7D;AACA;AACA;AACA;;AAEA;AACA;;AAEA,4C;;;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,iC;;;;;;;;;;;ACTA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yB;;;;;;;;;;;;AChBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAyD;AACpB;AACJ;AACS;AACmI;AAC7H;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmF,OAAO;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kCAAkC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8BAA8B;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,sDAAQ,CAAC,sDAAQ,GAAG,iBAAiB,2BAA2B;AAC7F;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA,mDAAmD,4BAA4B;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA,mDAAmD,gBAAgB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA,8DAA8D,gBAAgB;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,uDAAM;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E,+CAA+C,EAAE;AAChI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,0CAA0C,EAAE;AACnI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,4BAA4B;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,gBAAgB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,+FAA+F,IAAI;AACnG;AACA;AACA;AACA;AACA;AACA,0IAA0I,QAAQ;AAClJ;AACA;AACA,0EAA0E,WAAW;AACrF;AACA;AACA,0EAA0E,WAAW;AACrF;AACA,8EAA8E,uBAAuB;AACrG,0FAA0F,YAAY,GAAG,iBAAiB;AAC1H;AACA;AACA;AACA;AACA;AACA,wBAAwB,2DAAY;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,uBAAuB;AACjE,wCAAwC,uCAAuC;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,OAAO;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,8BAA8B;AAC7D,WAAW,uDAAS;AACpB;AACA;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,QAAQ,uDAAS;AACrD,uBAAuB,yDAAW;AAClC;AACA;AACA;AACA,iBAAiB;AACjB,aAAa,EAAE,EAAE;AACjB,sEAAsE,6DAA6D;AACnI,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,8BAA8B;AAC7D,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,6CAA6C;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,6CAA6C;AAChG;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,6EAAsB;AAChD,0BAA0B,6EAAsB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA,uBAAuB,4DAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,mBAAmB,EAAE;AACzE;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA,0BAA0B,2EAAoB;AAC9C;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,yCAAyC,gFAAyB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,6CAA6C,wBAAwB,EAAE;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,2BAA2B;AAClE,kDAAkD,mCAAmC;AACrF,wCAAwC,yBAAyB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,yEAAkB;AAC1B;AACA;AACA,SAAS,wEAAiB;AAC1B;AACA;AACA;AACA;AACA,4CAA4C,2CAA2C,EAAE;AACzF;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iIAAiI,wBAAwB,EAAE;AAC3J,SAAS;AACT;AACA,6HAA6H,wBAAwB,EAAE;AACvJ,SAAS;AACT;AACA,8GAA8G,wBAAwB,EAAE;AACxI,SAAS;AACT;AACA,8HAA8H,wBAAwB,EAAE;AACxJ,SAAS;AACT;AACA,yGAAyG,wBAAwB,EAAE;AACnI,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,4CAA4C,6DAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL,4CAA4C,6DAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,kBAAkB,qDAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA,wBAAwB,yEAAkB;AAC1C;AACA;AACA,yBAAyB,wEAAiB;AAC1C;AACA;AACA,yBAAyB,2EAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA,yCAAyC,gFAAyB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEgF;AAChF;;;;;;;;;;;;;ACpsCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA2C;AACuE;AAC9C;AACM;;AAE1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,mDAAmD,SAAS;AAC5D;AACA,iEAAiE,SAAS;AAC1E,oEAAoE,SAAS;AAC7E,gEAAgE,SAAS;AACzE,uEAAuE,SAAS;AAChF;AACA;AACA;AACA,wBAAwB,2DAAY;;AAEpC;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,uDAAM;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+DAAQ;AAChC,6BAA6B,sEAAkB;AAC/C;AACA,+BAA+B,6DAAS,qBAAqB,cAAc,EAAE;AAC7E;AACA;AACA,0BAA0B,sDAAQ,8DAA8D,UAAU;AAC1G;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,uFAAuF,0BAA0B,EAAE;AACnH,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,yCAAyC;AACrF;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,yCAAyC;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,sBAAsB;AAC/F;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,4DAAW;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,+DAAQ;AACrB,+DAA+D,gBAAgB;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,gBAAgB;AACnD;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,YAAY,+DAAQ;AACpB,6EAA6E,gBAAgB;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,mBAAmB,EAAE;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,gBAAgB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iEAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,uBAAuB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ,oCAAoC,UAAU;AAChF;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,6DAAS,oCAAoC,UAAU,qCAAqC,EAAE,EAAE;AAC9H;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,QAAQ,0EAAiB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,sDAAQ,CAAC,sDAAQ,GAAG,wBAAwB;AACrE;AACA,yBAAyB,8DAAe;AACxC,sBAAsB,2DAAY;AAClC,oBAAoB,yDAAU,EAAE;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,iEAAU;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,0CAA0C,kBAAkB,EAAE;AAC9D;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,6DAAS,0CAA0C,6CAA6C,EAAE;AAC9I;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gEAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;;AAEe,yEAAU,EAAC;AACQ;AAClC;;;;;;;;;;;;;AC7pBA;AAAA;AAAqC,aAAa;;AAElD;AACA;AACA;AACA,0FAA0F,yDAAyD,eAAe,kGAAkG,YAAY,WAAW,KAAK,WAAW,4BAA4B,kBAAkB;AACzV,iBAAiB,MAAM,SAAS,eAAe,YAAY,aAAa,KAAK,WAAW,gBAAgB,EAAE,OAAO,gBAAgB,OAAO,OAAO,uBAAuB,oCAAoC,GAAG,eAAe,QAAQ,kBAAkB,mBAAmB,qBAAqB,EAAE,UAAU,eAAe,sEAAsE,oBAAoB;AACnZ,yBAAyB,cAAc,SAAS,cAAc,UAAU,eAAe,IAAI,sBAAsB,SAAS,aAAa,aAAa,YAAY,cAAc,0CAA0C,KAAK,EAAE,cAAc,0BAA0B,iBAAiB,UAAU,WAAW,kBAAkB,MAAM,EAAE,gBAAgB,oBAAoB,0BAA0B,QAAQ,yBAAyB,KAAK,sBAAsB,EAAE,aAAa,UAAU,YAAY,WAAW,KAAK;AACtf,KAAK,UAAU,IAAI,IAAI,SAAS,YAAY,aAAa,0BAA0B,kBAAkB,SAAS,GAAG,yBAAyB,cAAc,mBAAmB,uBAAuB,gBAAgB,OAAO,qCAAqC,0BAA0B,wEAAwE,iCAAiC,KAAK,mBAAmB,4BAA4B,QAAQ,qBAAqB,QAAQ,aAAa;AACve,0BAA0B,aAAa,IAAI,SAAS,SAAS,UAAU,OAAO,4CAA4C,0BAA0B,aAAa,0BAA0B,aAAa,4BAA4B,iGAAiG,SAAS,SAAS,UAAU,yBAAyB,iBAAiB,YAAY,gBAAgB,mBAAmB,cAAc,YAAY,0BAA0B;AAC9e,0BAA0B,4BAA4B,eAAe,IAAI,6BAA6B,SAAS,cAAc,+BAA+B,gBAAgB,wCAAwC,IAAI,SAAS,UAAU,OAAO,GAAG,8BAA8B,IAAI,IAAI,EAAE,uBAAuB,UAAU,8BAA8B,4BAA4B,6BAA6B,aAAa,YAAY,cAAc,MAAM,cAAc,MAAM;AACtd,OAAO,WAAW,oCAAoC,YAAY,qBAAqB,2BAA2B,KAAK,GAAG,mBAAmB,2BAA2B,2BAA2B,QAAQ,8BAA8B,GAAG,kBAAkB,uBAAuB,wCAAwC,eAAe,oBAAoB,SAAS,IAAI,YAAY,aAAa,gEAAgE,eAAe,GAAG,SAAS;AACje,aAAa,gCAAgC,IAAI,WAAW;AAC5D,eAAe,eAAe,qBAAqB,oCAAoC,gCAAgC,wCAAwC,uCAAuC,6KAA6K,oJAAoJ;AACvgB,iEAAiE,SAAS,eAAe,YAAY,yDAAyD,eAAe,wBAAwB,cAAc,eAAe,0CAA0C,eAAe,uEAAuE,mDAAmD,mBAAmB;AACxa,mBAAmB,oBAAoB,uBAAuB,8CAA8C,kBAAkB,4CAA4C,mCAAmC,qBAAqB,kBAAkB,6BAA6B,kBAAkB,iGAAiG;AACpY,iBAAiB,8CAA8C,kBAAkB,gBAAgB,0BAA0B,wBAAwB,4BAA4B,iBAAiB,gBAAgB,cAAc,wBAAwB,iBAAiB,kBAAkB,2BAA2B;;AAEpT;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,eAAe,0BAA0B,eAAe,WAAW,yBAAyB,OAAO,qCAAqC,kCAAkC,UAAU,8BAA8B,iBAAiB,eAAe,gBAAgB;AACpR,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0GAA0G;;AAE1G;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAI,qOAAqO,KAAK,yKAAyK,KAAK;AACpa,wIAAwI,KAAK;AAC7I,eAAe,gDAAgD,8EAA8E,YAAY,OAAO,kCAAkC,eAAe,eAAe,IAAI,yBAAyB,SAAS,WAAW,cAAc,2DAA2D,KAAK,oBAAoB,kBAAkB,4BAA4B,WAAW,+BAA+B,iBAAiB,gBAAgB,8BAA8B,IAAI,mCAAmC,oBAAoB,QAAQ,mCAAmC,iBAAiB,gFAAgF,iBAAiB,SAAS,SAAS,SAAS,YAAY,4BAA4B,aAAa,SAAS,aAAa,cAAc,YAAY,gBAAgB,UAAU,iBAAiB,OAAO,mCAAmC,cAAc,mBAAmB,yBAAyB,cAAc,aAAa,UAAU,EAAE,+BAA+B,eAAe,WAAW,8BAA8B,UAAU,cAAc,gBAAgB,sDAAsD,SAAS,cAAc,6BAA6B,+BAA+B,SAAS,SAAS,gBAAgB,8BAA8B,8BAA8B,6CAA6C,gDAAgD,eAAe,gFAAgF,YAAY,WAAW,iCAAiC,SAAS,2CAA2C,oCAAoC,iBAAiB,2DAA2D,IAAI;AAC1xD,iBAAiB,yDAAyD,KAAK;AAC/E,4CAA4C,+CAA+C,eAAe,oEAAoE,IAAI,eAAe,WAAW,iCAAiC,SAAS,sCAAsC,4CAA4C,eAAe,sEAAsE,IAAI,2CAA2C,SAAS;AACrd,GAAG,6CAA6C,eAAe,2DAA2D,IAAI,gDAAgD,UAAU,eAAe,GAAG,SAAS,2DAA2D,IAAI,wCAAwC,IAAI,QAAQ,KAAK,qDAAqD,iBAAiB;AACjZ,iBAAiB,UAAU,MAAM,6CAA6C,SAAS,iBAAiB,QAAQ,mBAAmB,wEAAwE,EAAE,eAAe,kDAAkD,eAAe,eAAe,QAAQ,uBAAuB,IAAI,cAAc,SAAS,UAAU,yCAAyC,gBAAgB,aAAa,kDAAkD,qEAAqE,gBAAgB,uBAAuB,iBAAiB,uBAAuB,OAAO,GAAG,mBAAmB,OAAO,oBAAoB,OAAO,MAAM,SAAS,MAAM,cAAc,gBAAgB,iBAAiB,uCAAuC,eAAe,wBAAwB,SAAS,eAAe,QAAQ,GAAG,qBAAqB,SAAS,kHAAkH,gBAAgB,gBAAgB,mBAAmB,KAAK,eAAe,qBAAqB,YAAY,YAAY,qEAAqE,iBAAiB,GAAG,IAAI,8DAA8D,OAAO,0BAA0B,QAAQ,SAAS,UAAU,OAAO,+GAA+G,YAAY,uFAAuF,SAAS,sCAAsC,uDAAuD,+DAA+D;AACzsD,OAAO,iBAAiB,qBAAqB,UAAU,mBAAmB,2BAA2B,eAAe,iCAAiC,aAAa,WAAW,GAAG,eAAe,4DAA4D,iDAAiD,yBAAyB,SAAS,MAAM,kBAAkB,iBAAiB,qBAAqB,UAAU,mBAAmB,2BAA2B,0BAA0B,iCAAiC,0BAA0B,WAAW,GAAG,eAAe,4DAA4D,6EAA6E;AAC/rB,iBAAiB,YAAY,oEAAoE,6BAA6B,4KAA4K,OAAO,2DAA2D,EAAE;AAC9W,UAAU,MAAM,gGAAgG,OAAO,iBAAiB,qBAAqB,UAAU,mBAAmB,2BAA2B,0BAA0B,iCAAiC,eAAe,WAAW,GAAG,eAAe,4DAA4D,kEAAkE,2BAA2B;AACrd,eAAe,4BAA4B,4CAA4C,0CAA0C,oBAAoB,SAAS,OAAO,cAAc,UAAU,UAAU,mBAAmB,2BAA2B,0BAA0B,iCAAiC,gBAAgB,WAAW,GAAG,eAAe,4DAA4D,mEAAmE,4BAA4B,UAAU,eAAe,aAAa,MAAM,SAAS,sBAAsB,cAAc,WAAW,eAAe,wBAAwB,0BAA0B,uBAAuB,iBAAiB,0BAA0B,YAAY,gBAAgB,aAAa,4GAA4G,KAAK,QAAQ,MAAM,KAAK,8BAA8B,iBAAiB,uEAAuE,qBAAqB,wBAAwB,sBAAsB,eAAe,uDAAuD,6CAA6C,6CAA6C,+CAA+C,8CAA8C,gDAAgD,KAAK,UAAU,eAAe,WAAW,SAAS,WAAW,iBAAiB,SAAS,iEAAiE,mNAAmN,cAAc,iBAAiB,+BAA+B;AAC3xD,GAAG,wBAAwB,SAAS,sBAAsB,QAAQ,WAAW,sCAAsC,oCAAoC,QAAQ,WAAW,oCAAoC,6CAA6C,GAAG,qBAAqB,OAAO,YAAY,gCAAgC,cAAc,SAAS,MAAM;AACnW,eAAe,uBAAuB,qGAAqG,UAAU,KAAK,0BAA0B,GAAG,0CAA0C,0CAA0C,wCAAwC,8HAA8H,OAAO,OAAO,YAAY,YAAY,EAAE;AACzd,8BAA8B,IAAI,iDAAiD,UAAU,0BAA0B,eAAe,eAAe,gDAAgD,iBAAiB,mBAAmB,wCAAwC,4MAA4M;AAC7d,QAAQ;AACR,mBAAmB,iDAAiD,6BAA6B,UAAU,yCAAyC,WAAW,iCAAiC,SAAS,OAAO,cAAc,IAAI,YAAY,aAAa,UAAU,wFAAwF,sBAAsB;AACnX,mBAAmB,cAAc,4DAA4D,YAAY,WAAW,KAAK,WAAW,oDAAoD,iBAAiB,YAAY,6DAA6D,0BAA0B,eAAe,iCAAiC,iEAAiE,yCAAyC,UAAU,eAAe,wBAAwB,SAAS,IAAI;AACpgB,cAAc,uBAAuB,8HAA8H,4BAA4B,uBAAuB,MAAM,wCAAwC,sBAAsB,aAAa,SAAS,gBAAgB,UAAU,gHAAgH,gBAAgB,2DAA2D;AACrgB,MAAM,mCAAmC,cAAc,YAAY,uBAAuB,qBAAqB,EAAE,sDAAsD,gBAAgB,KAAK,6BAA6B,oBAAoB,SAAS,WAAW,UAAU,MAAM,mBAAmB,QAAQ,MAAM,SAAS,wBAAwB,mBAAmB,oBAAoB,iBAAiB,SAAS,iBAAiB,YAAY,OAAO,cAAc,iCAAiC,gCAAgC,cAAc,YAAY,mBAAmB,SAAS,wJAAwJ,oBAAoB,cAAc,UAAU,OAAO,EAAE,IAAI,cAAc,SAAS,MAAM,SAAS,OAAO,gBAAgB,UAAU,cAAc,0BAA0B,iBAAiB,aAAa,WAAW,qBAAqB,WAAW,aAAa,0BAA0B,8BAA8B,kCAAkC,UAAU,WAAW,EAAE,SAAS,eAAe,mBAAmB,cAAc,2CAA2C,UAAU,8BAA8B,iCAAiC,WAAW,yBAAyB,cAAc,aAAa,UAAU;AAC1zC,mBAAmB,eAAe,MAAM,MAAM,MAAM,SAAS,cAAc,2BAA2B,gBAAgB,WAAW,SAAS,cAAc,2BAA2B,KAAK,EAAE,mBAAmB,4BAA4B,eAAe,2BAA2B,oBAAoB,6BAA6B,IAAI,OAAO,WAAW,eAAe,KAAK,OAAO,WAAW,2BAA2B,UAAU;AACra,eAAe,yBAAyB,oBAAoB,+BAA+B,IAAI,QAAQ,cAAc,EAAE,gBAAgB,WAAW,OAAO,WAAW,uCAAuC,UAAU,EAAE,iCAAiC,6CAA6C,8BAA8B,cAAc,mBAAmB,YAAY,OAAO,WAAW,aAAa,kBAAkB;AACja,qBAAqB,eAAe,gBAAgB,cAAc,WAAW,SAAS,iBAAiB,mBAAmB,UAAU,QAAQ,gCAAgC,wCAAwC,kBAAkB,gGAAgG,SAAS,gBAAgB,iBAAiB,6BAA6B,qBAAqB;AACla,qBAAqB,yBAAyB,wBAAwB,kBAAkB,IAAI,kBAAkB,KAAK,SAAS,MAAM,GAAG,kBAAkB,IAAI,kBAAkB,sCAAsC,SAAS,MAAM,GAAG,EAAE,QAAQ,QAAQ,WAAW,iBAAiB,UAAU,eAAe,iBAAiB,UAAU;AACvU,mBAAmB,mKAAmK,qBAAqB,sDAAsD,iCAAiC,YAAY,aAAa,iCAAiC,SAAS,sBAAsB;AAC3X,uBAAuB,cAAc,sBAAsB,cAAc,sBAAsB,SAAS,IAAI,cAAc,SAAS,MAAM,eAAe,yBAAyB,eAAe,WAAW,oCAAoC,gBAAgB,SAAS,gBAAgB,UAAU,WAAW,0BAA0B;AACvU,qBAAqB,yBAAyB,OAAO,aAAa,4BAA4B,SAAS,4BAA4B,SAAS,gBAAgB,SAAS,mBAAmB,2CAA2C,iBAAiB,OAAO,cAAc,qBAAqB,EAAE,UAAU,eAAe,eAAe,QAAQ,2BAA2B,cAAc,2BAA2B,gBAAgB,gBAAgB,eAAe,mBAAmB,eAAe,kCAAkC,YAAY,mMAAmM,cAAc,2BAA2B,gBAAgB,eAAe,oBAAoB,kCAAkC,UAAU,wDAAwD,wDAAwD,mCAAmC,YAAY,eAAe,MAAM,EAAE,IAAI,mEAAmE,UAAU,SAAS,GAAG,gBAAgB,YAAY,qBAAqB,yBAAyB,sCAAsC,0BAA0B,iBAAiB,yBAAyB,2CAA2C,kEAAkE,YAAY,uDAAuD,iBAAiB,oBAAoB,YAAY,MAAM,4FAA4F,mCAAmC,SAAS,sBAAsB,OAAO,GAAG,IAAI,eAAe,SAAS,QAAQ,UAAU,KAAK,aAAa;AACpvD,iDAAiD,qBAAqB,sTAAsT,qBAAqB,mBAAmB,uBAAuB,qBAAqB,yBAAyB;AACze,UAAU,8BAA8B,qFAAqF,SAAS,2CAA2C,QAAQ,WAAW,4BAA4B,EAAE,uCAAuC,gCAAgC,aAAa,uCAAuC,gCAAgC,0DAA0D,YAAY,0BAA0B,eAAe,wDAAwD,uBAAuB,gBAAgB,gBAAgB,WAAW,YAAY,iBAAiB,UAAU,cAAc,mBAAmB,eAAe,QAAQ,gBAAgB,aAAa,WAAW,WAAW,eAAe,WAAW,UAAU,SAAS,qCAAqC,mBAAmB,YAAY,6BAA6B,kBAAkB,2EAA2E,UAAU,iBAAiB,aAAa,wEAAwE,qBAAqB,YAAY,WAAW,KAAK,WAAW,0DAA0D,UAAU,gDAAgD,MAAM,uBAAuB,2BAA2B,qCAAqC,WAAW,qBAAqB;AACh4C,yBAAyB,wCAAwC,mCAAmC,uBAAuB,mBAAmB,aAAa,OAAO,UAAU,QAAQ,aAAa,wFAAwF,wDAAwD,yDAAyD,sEAAsE;AAChd,cAAc,0BAA0B,kCAAkC,aAAa,6BAA6B,gBAAgB,SAAS,uBAAuB,gCAAgC,WAAW,qBAAqB;AACpO,sBAAsB,gCAAgC,WAAW,oBAAoB;AACrF,eAAe,kCAAkC,YAAY,sBAAsB,KAAK,uBAAuB,qJAAqJ,KAAK,4DAA4D,eAAe;AACpV,qBAAqB,SAAS,uDAAuD,WAAW,KAAK,WAAW,gDAAgD,SAAS,iBAAiB,+BAA+B,YAAY;AACrO,iBAAiB,iBAAiB,QAAQ,SAAS,qBAAqB,gBAAgB,WAAW,0BAA0B,OAAO,QAAQ,IAAI,IAAI,iBAAiB,KAAK,0CAA0C,GAAG,SAAS,oBAAoB,aAAa,QAAQ,SAAS,KAAK,6CAA6C,KAAK,UAAU,EAAE,yBAAyB,SAAS,iBAAiB,KAAK,KAAK,SAAS,sBAAsB,OAAO,QAAQ,WAAW,sCAAsC,SAAS;AAC1f,gBAAgB,eAAe,QAAQ,8BAA8B,sDAAsD,eAAe,kBAAkB,0BAA0B,wBAAwB,EAAE,cAAc,aAAa,cAAc,oBAAoB,aAAa,aAAa,QAAQ,mBAAmB,+CAA+C,kBAAkB,kDAAkD;AACrb,sCAAsC,gBAAgB,cAAc,EAAE,iBAAiB,UAAU,gBAAgB,oCAAoC,4CAA4C,KAAK,QAAQ,aAAa,OAAO,KAAK,0BAA0B,KAAK,KAAK,eAAe,kBAAkB,QAAQ,kBAAkB,kBAAkB,aAAa,WAAW,iCAAiC;AACjZ,0BAA0B,mBAAmB,WAAW,mBAAmB,cAAc,qBAAqB,WAAW,iBAAiB,cAAc,OAAO,cAAc,uBAAuB,4BAA4B,uBAAuB;AACvP,qBAAqB,mBAAmB,eAAe,aAAa,iBAAiB,WAAW,KAAK,WAAW,2BAA2B,+BAA+B,gBAAgB,uBAAuB,+BAA+B,mBAAmB,uBAAuB,iEAAiE,8CAA8C,oDAAoD,eAAe,WAAW,2BAA2B,gBAAgB,UAAU,IAAI,6CAA6C,iBAAiB,kBAAkB,SAAS,GAAG,eAAe,4CAA4C,0CAA0C,UAAU,4BAA4B,IAAI,iBAAiB,SAAS,KAAK,IAAI,uBAAuB,SAAS,eAAe,4CAA4C,iCAAiC,+BAA+B,SAAS,WAAW,YAAY,IAAI,cAAc,SAAS,KAAK,IAAI,wBAAwB;AACrhC,iBAAiB,+DAA+D,iDAAiD,4CAA4C,IAAI,mCAAmC,iBAAiB,UAAU,UAAU,SAAS,uBAAuB,QAAQ,iDAAiD,YAAY,IAAI,2CAA2C,6CAA6C,WAAW,+BAA+B,iCAAiC,eAAe,eAAe,SAAS,iBAAiB,gBAAgB,8BAA8B,UAAU,eAAe,SAAS;AAC7oB,mBAAmB,UAAU,wBAAwB,eAAe,oBAAoB,gBAAgB,aAAa,EAAE,aAAa,wBAAwB,IAAI,aAAa,oBAAoB,SAAS,UAAU,aAAa,2CAA2C,cAAc,oBAAoB,iCAAiC,oBAAoB,wCAAwC;AAC3Y,wBAAwB,uBAAuB,WAAW,KAAK,yBAAyB,qBAAqB,iBAAiB,kDAAkD,gIAAgI,iBAAiB,MAAM,eAAe,YAAY,WAAW,KAAK,+BAA+B,SAAS,0BAA0B,sBAAsB,YAAY,sDAAsD,iBAAiB,wBAAwB,YAAY,iBAAiB,UAAU,MAAM;AAClmB,iCAAiC,kBAAkB,2BAA2B,aAAa,+HAA+H,EAAE,oDAAoD,0FAA0F,qCAAqC,iCAAiC;AAChb,iCAAiC,2BAA2B,oBAAoB,kBAAkB,sBAAsB,UAAU,eAAe,iBAAiB,+CAA+C,KAAK,2BAA2B,+BAA+B,IAAI,wBAAwB,8BAA8B,0BAA0B,eAAe,iBAAiB,WAAW,EAAE,aAAa;AAC9Z,6CAA6C,cAAc,SAAS,8BAA8B,wBAAwB,aAAa,UAAU,mBAAmB,iBAAiB,gCAAgC,iBAAiB,MAAM,YAAY,mDAAmD,MAAM,cAAc,mBAAmB,wEAAwE,kBAAkB,aAAa,iBAAiB;AAC1c,cAAc,kDAAkD,qBAAqB,0BAA0B,WAAW,WAAW,WAAW,WAAW,SAAS,iBAAiB,yEAAyE,mBAAmB,yFAAyF,EAAE,oBAAoB,eAAe,kBAAkB;AACja,iEAAiE,iBAAiB,mBAAmB,eAAe,WAAW,eAAe,iDAAiD,kDAAkD,GAAG,eAAe,YAAY,2DAA2D,0BAA0B,QAAQ,YAAY,WAAW,KAAK,kBAAkB,sCAAsC,SAAS;AACzc,oBAAoB,SAAS,YAAY,aAAa,oBAAoB,sBAAsB,UAAU,UAAU,aAAa,iBAAiB,MAAM,UAAU,8GAA8G,mBAAmB,mBAAmB,UAAU,iBAAiB,MAAM,UAAU,mBAAmB,wBAAwB,SAAS,6BAA6B,gBAAgB,mBAAmB,OAAO;AAC5d,eAAe,SAAS,2CAA2C,WAAW,uBAAuB,WAAW,iBAAiB,UAAU,gBAAgB,SAAS,SAAS,oEAAoE,KAAK,aAAa,YAAY,WAAW,iBAAiB,UAAU,oBAAoB,SAAS,YAAY,aAAa,2CAA2C,kBAAkB,UAAU;AAClb,oBAAoB,eAAe,YAAY,kCAAkC,mBAAmB,QAAQ,4DAA4D,sBAAsB,wBAAwB,oBAAoB,8BAA8B,WAAW,KAAK,2CAA2C,YAAY,YAAY,WAAW,KAAK,QAAQ,qDAAqD,WAAW;AACnb,eAAe,aAAa,QAAQ,+BAA+B,SAAS,iBAAiB,YAAY,yBAAyB,SAAS,iBAAiB,mDAAmD,sBAAsB,gCAAgC,KAAK,OAAO,eAAe,SAAS,eAAe,kBAAkB;AAC1U,mBAAmB,0BAA0B,KAAK,uBAAuB,qBAAqB,QAAQ,WAAW,YAAY,iBAAiB,IAAI,iCAAiC,YAAY,OAAO,gFAAgF,KAAK,SAAS,GAAG,KAAK,qIAAqI,SAAS,GAAG,QAAQ,iBAAiB,sBAAsB,MAAM;AAClf,4BAA4B,MAAM,iCAAiC,MAAM,+BAA+B,MAAM,kDAAkD,QAAQ,wGAAwG;AAChR,iBAAiB,oCAAoC,YAAY,oEAAoE,SAAS,QAAQ,cAAc,UAAU,6CAA6C,cAAc,qFAAqF,iBAAiB,cAAc,oBAAoB,iBAAiB,kBAAkB,iBAAiB,WAAW,sKAAsK,6BAA6B;AACnnB,cAAc,UAAU,qFAAqF,iCAAiC,eAAe,yBAAyB,qJAAqJ,eAAe,cAAc,IAAI,UAAU;AACtX,mBAAmB,+CAA+C,SAAS,SAAS,uEAAuE,GAAG,4FAA4F,oBAAoB,mDAAmD,uDAAuD,QAAQ,YAAY,EAAE,SAAS,oEAAoE,qBAAqB;AAChf,qBAAqB,qEAAqE,MAAM,sDAAsD,iCAAiC,kBAAkB;AACzM,mLAAmL,sBAAsB,0CAA0C,4IAA4I,0DAA0D,uDAAuD,SAAS,UAAU,UAAU;AAC7gB,eAAe,yBAAyB,aAAa,wBAAwB,oBAAoB,gBAAgB,EAAE,WAAW,EAAE,YAAY,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,sBAAsB,cAAc,WAAW,yBAAyB,oDAAoD,IAAI,sBAAsB,iBAAiB,mBAAmB,SAAS;AAC9W,cAAc,uCAAuC,2BAA2B,yCAAyC,4CAA4C,MAAM,4CAA4C,gBAAgB,IAAI,KAAK,EAAE,iEAAiE,eAAe,SAAS,6FAA6F,cAAc,eAAe,IAAI,sBAAsB,SAAS;AACxe,cAAc,oFAAoF,cAAc,OAAO,qDAAQ,sDAAsD,qDAAQ,gEAAgE,cAAc,WAAW,oCAAoC,cAAc,kBAAkB,IAAI,mHAAmH;AACjd;AACA,eAAe,sBAAsB,2DAA2D,oCAAoC,2CAA2C,6BAA6B,6BAA6B,6BAA6B,wCAAwC,8BAA8B,oHAAoH,kCAAkC;AACle,wBAAwB,eAAe,oBAAoB,cAAc,QAAQ,2CAA2C,iBAAiB,QAAQ,aAAa,GAAG,wBAAwB,QAAQ,WAAW,gEAAgE,SAAS,IAAI,mCAAmC,OAAO,kEAAkE,sCAAsC,aAAa;AAC5b,gBAAgB,eAAe,OAAO,YAAY,wCAAwC,cAAc,wBAAwB,SAAS,cAAc,IAAI,4BAA4B,mEAAmE,SAAS,2BAA2B,SAAS,cAAc,mEAAmE,cAAc,sCAAsC,cAAc;AAC1b,eAAe,SAAS,8BAA8B,eAAe,wCAAwC,eAAe,QAAQ,GAAG,wEAAwE,SAAS,eAAe,iCAAiC,eAAe,oDAAoD,eAAe,SAAS;AACnW,cAAc,eAAe,sHAAsH,cAAc,iBAAiB,iBAAiB,kEAAkE,SAAS,SAAS,MAAM,OAAO;AACpS,4BAA4B,kBAAkB,oKAAoK,cAAc,iBAAiB;AACjP,cAAc,wBAAwB,uCAAuC,aAAa,4DAA4D,4CAA4C,iBAAiB,+CAA+C,SAAS,EAAE,eAAe;AAC5R,eAAe,IAAI,+BAA+B,iEAAiE,UAAU,YAAY,cAAc,+DAA+D,cAAc,kBAAkB,4DAA4D,cAAc,kBAAkB,8CAA8C,6BAA6B,mBAAmB,sBAAsB,eAAe,YAAY,WAAW,UAAU,eAAe,yBAAyB,OAAO,IAAI,UAAU,iCAAiC,sCAAsC,EAAE,iCAAiC,sCAAsC,EAAE,cAAc,SAAS,MAAM,kBAAkB,8BAA8B,sCAAsC,SAAS,gBAAgB,qDAAqD,eAAe,SAAS,OAAO,SAAS,eAAe,QAAQ,GAAG,4CAA4C;AACp/B,iBAAiB,0BAA0B,eAAe,YAAY,WAAW,KAAK,cAAc,yCAAyC,SAAS,eAAe,QAAQ,gCAAgC,qBAAqB,+BAA+B,UAAU;;AAE3Q;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B,gBAAgB,oBAAoB,kCAAkC,WAAW,2CAA2C,2BAA2B,qBAAqB,sFAAsF,0BAA0B,OAAO,sGAAsG,eAAe,IAAI,gBAAgB,SAAS,OAAO;AACze,yEAAyE,eAAe,gBAAgB,4BAA4B,SAAS,0BAA0B,yBAAyB,+BAA+B,UAAU,eAAe,QAAQ,yBAAyB,YAAY,+FAA+F,wFAAwF,cAAc,aAAa;AACvf,wOAAwO,eAAe,OAAO,uDAAuD,qBAAqB,6GAA6G,QAAQ,2GAA2G;AAC1iB,4FAA4F,wJAAwJ,eAAe,IAAI,iBAAiB,SAAS,cAAc,eAAe,YAAY,8DAA8D,2FAA2F,SAAS,mBAAmB,UAAU,YAAY,2BAA2B,QAAQ,YAAY,QAAQ,kCAAkC,SAAS,+HAA+H,WAAW;AACjwB,kIAAkI,eAAe,KAAK,kHAAkH,4FAA4F,sHAAsH,YAAY;AACte,2DAA2D,KAAK,mHAAmH,sHAAsH,QAAQ,+HAA+H,WAAW,QAAQ;AACnc,6GAA6G,eAAe;AAC5H,eAAe,SAAS,kBAAkB,yBAAyB,gFAAgF,kBAAkB,wBAAwB,wCAAwC,UAAU,eAAe,wBAAwB,iBAAiB,0BAA0B,YAAY,YAAY,eAAe,SAAS,iBAAiB,0BAA0B,EAAE,SAAS,iBAAiB,cAAc,KAAK,WAAW,EAAE,4BAA4B,oBAAoB,8EAA8E,SAAS,KAAK,aAAa,EAAE,mCAAmC,wBAAwB,aAAa;AAC3rB,cAAc,QAAQ,MAAM,yHAAyH,IAAI,2CAA2C,WAAW,KAAK,WAAW,6BAA6B,eAAe,YAAY,+DAA+D,SAAS,aAAa,aAAa,KAAK,oEAAoE,2CAA2C,6CAA6C,0BAA0B,eAAe,0BAA0B,eAAe,iCAAiC,eAAe,eAAe,IAAI,iBAAiB,SAAS;AACzsB,eAAe,kBAAkB,eAAe,2BAA2B,OAAO,+BAA+B,IAAI,WAAW,IAAI,yBAAyB,UAAU,aAAa,wMAAwM,IAAI,kDAAkD,KAAK,4CAA4C,KAAK,4CAA4C,KAAK,+CAA+C,KAAK;AAC7kB,eAAe,4CAA4C,aAAa,eAAe,SAAS,qBAAqB,mBAAmB,mBAAmB,oBAAoB,eAAe,IAAI,uCAAuC,+CAA+C,UAAU,YAAY;AAC9S,eAAe,YAAY,cAAc,gBAAgB,gBAAgB,mDAAmD,sCAAsC,KAAK,0GAA0G,uBAAuB,sBAAsB,eAAe,gBAAgB,uBAAuB,GAAG,yBAAyB,GAAG;AACnZ,eAAe,gBAAgB,wEAAwE,SAAS,eAAe,gBAAgB,qEAAqE,0DAA0D,SAAS,eAAe,gBAAgB,sEAAsE;AAC5X,eAAe,gBAAgB,sEAAsE,sCAAsC,SAAS,eAAe,4CAA4C,uBAAuB,oCAAoC,iBAAiB,2FAA2F,8FAA8F,eAAe,eAAe,uBAAuB,4BAA4B,2BAA2B,mCAAmC,0BAA0B,sBAAsB,oBAAoB,gBAAgB,EAAE,oBAAoB,4BAA4B,eAAe,6BAA6B,4BAA4B,4BAA4B,4BAA4B,iBAAiB,0BAA0B,UAAU,gBAAgB,2CAA2C,SAAS,8BAA8B,gBAAgB,uEAAuE;AACvlC,iBAAiB,cAAc,sEAAsE,uBAAuB,yBAAyB,4BAA4B,uBAAuB,6BAA6B,eAAe,YAAY,gBAAgB,6BAA6B,6BAA6B,eAAe,OAAO,gDAAgD,0BAA0B,OAAO;AACjb,eAAe,yFAAyF,2CAA2C,UAAU;AAC7J,mBAAmB,YAAY,gNAAgN,gHAAgH,sEAAsE,uBAAuB;AAC5b,4BAA4B,uBAAuB,6BAA6B,eAAe,YAAY,gBAAgB,6BAA6B,eAAe;AACvK,eAAe,SAAS,kCAAkC,8CAA8C,0CAA0C,0BAA0B,iCAAiC,GAAG,yDAAyD,4CAA4C;AACrT,0BAA0B,OAAO,2DAA2D,4CAA4C,wDAAwD,8CAA8C,iCAAiC,gCAAgC;AAC/S,eAAe,oCAAoC,OAAO,+MAA+M,IAAI,6CAA6C,WAAW,YAAY,iBAAiB,cAAc,QAAQ,gCAAgC,EAAE,WAAW,kBAAkB,WAAW;AAClc,4BAA4B,cAAc,aAAa,eAAe,8HAA8H,mBAAmB,SAAS,eAAe,mBAAmB,UAAU,SAAS,4BAA4B,6BAA6B,aAAa,2BAA2B;AACtX,sCAAsC,MAAM,QAAQ,+EAA+E,IAAI,qCAAqC,oIAAoI,kDAAkD,cAAc,6BAA6B,SAAS,mCAAmC;AACzb,eAAe,uGAAuG,QAAQ,wBAAwB,2BAA2B,cAAc,EAAE,cAAc,2BAA2B,SAAS,iCAAiC;AACpR,eAAe,uGAAuG,QAAQ,wBAAwB,2BAA2B,cAAc,EAAE,cAAc,2BAA2B,mBAAmB,SAAS,iCAAiC,2CAA2C,iBAAiB,QAAQ,oCAAoC,2BAA2B,wBAAwB,EAAE,cAAc;AACld,SAAS,kCAAkC,6CAA6C,iBAAiB,QAAQ,UAAU,gCAAgC,EAAE,mJAAmJ;AAChT,mBAAmB,SAAS,SAAS,gCAAgC,sHAAsH,4BAA4B,+DAA+D,4BAA4B,UAAU,6BAA6B;AACzV,6BAA6B,+DAA+D,sCAAsC,UAAU,uCAAuC,GAAG,6BAA6B,yBAAyB,0BAA0B,OAAO,8DAA8D,eAAe,6EAA6E,cAAc,QAAQ,yCAAyC;AACte,iBAAiB,QAAQ,0DAA0D,qDAAqD,eAAe,QAAQ,yCAAyC,MAAM,uBAAuB,EAAE,MAAM,sCAAsC,EAAE,MAAM,yCAAyC,EAAE,eAAe,2DAA2D,SAAS,6BAA6B,gBAAgB;AACtc,4BAA4B,uBAAuB,6BAA6B,eAAe,YAAY,kBAAkB,6BAA6B,eAAe,qBAAqB,YAAY,gBAAgB,0BAA0B,OAAO,oBAAoB,wCAAwC,0CAA0C,wCAAwC,qCAAqC;AAC9a,eAAe,uGAAuG,SAAS,mFAAmF,kBAAkB,EAAE,iBAAiB,YAAY,eAAe,uBAAuB,yCAAyC,EAAE;AACpV,eAAe,IAAI,UAAU,qDAAQ,QAAQ,SAAS,mPAAmP,QAAQ,sCAAsC;AACvV,8BAA8B,eAAe,sCAAsC,6LAA6L,eAAe,oEAAoE,wCAAwC,aAAa,+BAA+B,gCAAgC,EAAE,0CAA0C;AACngB,CAAC,mHAAmH,kBAAkB,EAAE,UAAU,+BAA+B,EAAE,0BAA0B,uCAAuC,SAAS,aAAa,uCAAuC,SAAS,EAAE,iIAAiI;AAC7b,iBAAiB,6CAA6C,+CAA+C,eAAe,UAAU,EAAE,MAAM,oBAAoB,EAAE,MAAM,6BAA6B;AACvM,eAAe,kDAAkD,qCAAqC,EAAE,sBAAsB,kCAAkC,yGAAyG,IAAI,UAAU,iCAAiC,iCAAiC,+BAA+B,kCAAkC,wEAAwE;AACle,+BAA+B,4BAA4B,mCAAmC,QAAQ,SAAS,aAAa,eAAe,8DAA8D,2BAA2B,SAAS,eAAe,eAAe,eAAe,eAAe,eAAe,eAAe,mBAAmB,oDAAoD,sDAAsD,wCAAwC,+BAA+B,SAAS,eAAe,uBAAuB,uBAAuB,uBAAuB,oBAAoB,0BAA0B;AACtpB,0BAA0B,OAAO,0HAA0H,eAAe,QAAQ,kHAAkH;;AAEpS;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,YAAY,UAAU,YAAY,eAAe,SAAS,YAAY,sBAAsB,YAAY,aAAa,cAAc,wEAAwE,eAAe,4CAA4C,MAAM,MAAM;AAChS,iBAAiB,QAAQ,mBAAmB,iBAAiB,QAAQ,2BAA2B,iCAAiC,gDAAgD,8BAA8B,QAAQ,0BAA0B,OAAO,qCAAqC,iCAAiC,mDAAmD,0CAA0C,2CAA2C,UAAU,UAAU,+BAA+B;AACzf,eAAe,WAAW,iBAAiB,6CAA6C,OAAO,gCAAgC,wBAAwB,yCAAyC,wDAAwD,6BAA6B,aAAa,eAAe,oBAAoB,eAAe,yBAAyB,OAAO,eAAe,SAAS,0BAA0B,eAAe,kDAAkD,0BAA0B,SAAS,4BAA4B;AACtiB,eAAe,gFAAgF,+FAA+F,WAAW,KAAK,WAAW,IAAI,kCAAkC,WAAW,2GAA2G,WAAW,UAAU,eAAe,SAAS,0BAA0B,yBAAyB,kCAAkC,oDAAoD,qCAAqC,0BAA0B;AAC1mB,cAAc,0BAA0B,kBAAkB,6BAA6B,qDAAqD,eAAe,mBAAmB,8BAA8B,+BAA+B,kCAAkC,iCAAiC,eAAe,uBAAuB,iEAAiE;AACrZ,mBAAmB,0CAA0C,kDAAkD,oBAAoB,mBAAmB,gBAAgB,gCAAgC,gCAAgC,6DAA6D,gBAAgB,gBAAgB,oDAAoD,YAAY,gBAAgB,gBAAgB,mCAAmC,YAAY,gBAAgB;AACle,gBAAgB,gBAAgB,YAAY,iBAAiB,eAAe,+CAA+C,mCAAmC,2CAA2C,mBAAmB,gCAAgC,oBAAoB,SAAS,uCAAuC,yBAAyB,QAAQ,eAAe,eAAe,SAAS,0BAA0B,iBAAiB,YAAY,aAAa,iCAAiC,kBAAkB,mGAAmG,eAAe,kBAAkB,sBAAsB,oCAAoC,YAAY,iCAAiC,6FAA6F,EAAE,QAAQ,SAAS;AAC11B,eAAe,sCAAsC,MAAM,eAAe,YAAY,yCAAyC,oBAAoB,YAAY,EAAE,SAAS,MAAM,QAAQ,UAAU,iBAAiB,uBAAuB,eAAe,SAAS,SAAS,0BAA0B,uBAAuB,2BAA2B,kBAAkB,UAAU,GAAG,EAAE,eAAe,aAAa,SAAS,mBAAmB,cAAc,qEAAqE,6BAA6B,mBAAmB,YAAY,aAAa,UAAU,UAAU,mCAAmC,0BAA0B,QAAQ,SAAS;AAC9qB,qBAAqB,gFAAgF,SAAS,SAAS,kBAAkB,UAAU,mBAAmB,8EAA8E,UAAU,OAAO,8DAA8D,cAAc;AACjV,mBAAmB,mCAAmC,mBAAmB,cAAc,8CAA8C,wEAAwE;AAC7M,iBAAiB,6ZAA6Z,eAAe;AAC7b,iBAAiB,WAAW,uDAAuD,eAAe,EAAE,wCAAwC,4BAA4B,+BAA+B,iBAAiB,yDAAyD,iBAAiB,uCAAuC,iBAAiB,aAAa,yEAAyE;AAChb,iBAAiB,0DAA0D,eAAe,SAAS,SAAS,SAAS,MAAM,iCAAiC,oBAAoB,gCAAgC;AAChN,mCAAmC,YAAY,aAAa,gHAAgH,SAAS,KAAK,sCAAsC,QAAQ,6CAA6C,uBAAuB,eAAe,oDAAoD,eAAe,aAAa,oBAAoB,eAAe,UAAU,mBAAmB,wBAAwB,+BAA+B,SAAS,YAAY,UAAU,iBAAiB,QAAQ,UAAU,oCAAoC;AACxmB,uBAAuB,mFAAmF,aAAa,0BAA0B,MAAM,OAAO,MAAM,OAAO,OAAO,uBAAuB,uBAAuB,iCAAiC,IAAI,mEAAmE,SAAS,8CAA8C,QAAQ,OAAO,QAAQ,wBAAwB,sBAAsB,WAAW,EAAE,YAAY;AAC7d,WAAW,yEAAyE,gBAAgB,wBAAwB,6BAA6B,IAAI,4BAA4B,8EAA8E,IAAI,0NAA0N,SAAS;AAC9e,yCAAyC,eAAe,oEAAoE,eAAe,sCAAsC,eAAe,gBAAgB,0JAA0J,iBAAiB,OAAO,iCAAiC,MAAM,MAAM;AAC/a,eAAe,mEAAmE,mBAAmB,mKAAmK,gBAAgB,6EAA6E,qBAAqB,gBAAgB,sDAAsD,gBAAgB;AAChd,eAAe,sHAAsH,mCAAmC,sDAAsD,iCAAiC,OAAO,IAAI,YAAY,YAAY,yEAAyE,QAAQ,aAAa,MAAM,WAAW,MAAM,YAAY,qCAAqC,gCAAgC;AACxe,yBAAyB,iCAAiC,IAAI,4DAA4D,KAAK,IAAI,gCAAgC,SAAS,8CAA8C,qBAAqB,OAAO,QAAQ,QAAQ,iBAAiB,QAAQ,MAAM,2BAA2B,SAAS,SAAS,4BAA4B,IAAI,uBAAuB,SAAS;AAClZ,eAAe,+BAA+B,oCAAoC,eAAe,4BAA4B,eAAe,IAAI,6BAA6B,SAAS,UAAU,eAAe,IAAI,+BAA+B,SAAS;AAC3P,yBAAyB,IAAI,uBAAuB,8CAA8C,eAAe,+CAA+C,6FAA6F,aAAa,gFAAgF,YAAY,SAAS,4DAA4D,iBAAiB,yCAAyC;AACre;AACA;AACA;AACA;AACA,eAAe,SAAS,UAAU,SAAS,eAAe,iBAAiB,cAAc,wBAAwB,SAAS,YAAY,SAAS,gCAAgC,gDAAgD,KAAK,WAAW,aAAa,cAAc,yCAAyC,0CAA0C,kDAAkD,6BAA6B,UAAU,cAAc,mBAAmB,OAAO,MAAM,OAAO;AAC3e,eAAe,QAAQ,wBAAwB,QAAQ,iBAAiB,oBAAoB,qBAAqB,kBAAkB,WAAW,kCAAkC,8BAA8B,IAAI,IAAI,EAAE,sBAAsB,gCAAgC,EAAE,sBAAsB,+BAA+B,eAAe,0BAA0B,gBAAgB;AAC9X,eAAe,oBAAoB,kBAAkB,sCAAsC,MAAM,0BAA0B,MAAM,eAAe,iBAAiB,EAAE,gCAAgC,OAAO,iBAAiB,uBAAuB,0DAA0D,4EAA4E,SAAS,0BAA0B,MAAM,gFAAgF;AACjf,6BAA6B,cAAc,aAAa,QAAQ,kDAAkD,uCAAuC,cAAc,aAAa,QAAQ,6CAA6C,kCAAkC,eAAe,sCAAsC,SAAS,0BAA0B,kBAAkB,eAAe,UAAU,eAAe,QAAQ,sEAAsE,eAAe,oDAAoD,qCAAqC,SAAS,yDAAyD,MAAM,WAAW,YAAY,yCAAyC,wGAAwG,qBAAqB,WAAW;AACn2B,GAAG,MAAM,YAAY,mBAAmB,KAAK,uCAAuC,EAAE,QAAQ,QAAQ,qBAAqB,SAAS,eAAe,MAAM,yFAAyF,cAAc,kBAAkB,cAAc;AAChS,mBAAmB,2BAA2B,YAAY,aAAa,wBAAwB,gCAAgC,6CAA6C,IAAI,cAAc,iBAAiB,qCAAqC,eAAe,eAAe,YAAY,QAAQ,eAAe,SAAS,SAAS,0BAA0B,mBAAmB,0BAA0B;AAC9Y,mBAAmB,SAAS,QAAQ,4EAA4E,gCAAgC,oCAAoC,yFAAyF,gFAAgF,6BAA6B,iCAAiC,+DAA+D,eAAe;AACze,GAAG,qDAAQ,gBAAgB,qDAAQ,8BAA8B,qGAAqG,cAAc,6DAA6D,YAAY,2CAA2C,mDAAmD,wBAAwB,mCAAmC,iBAAiB;AACva,iBAAiB,4LAA4L,iBAAiB,OAAO,WAAW,YAAY,UAAU,QAAQ,UAAU,oBAAoB,iBAAiB,wHAAwH,0BAA0B;AAC/c,2BAA2B,mDAAmD,QAAQ,eAAe;AACrG,qCAAqC,0SAA0S,qBAAqB,MAAM,kBAAkB,4BAA4B,2BAA2B,IAAI,2BAA2B,mBAAmB,WAAW,IAAI;AACpf,2BAA2B,SAAS,OAAO,QAAQ,EAAE,wBAAwB,mBAAmB,SAAS,EAAE,0BAA0B,mBAAmB,SAAS,WAAW,EAAE,eAAe,gEAAgE,OAAO;AACpQ,iBAAiB,oBAAoB,YAAY,cAAc,KAAK,iBAAiB,iBAAiB,YAAY,4CAA4C,aAAa,UAAU,EAAE,oBAAoB,6BAA6B;AACxO,mCAAmC,WAAW,mBAAmB,kCAAkC,kCAAkC,gCAAgC,4BAA4B,sEAAsE,6BAA6B,SAAS,EAAE,gBAAgB,MAAM,OAAO,0CAA0C,EAAE;AACxX,iBAAiB,2BAA2B,gJAAgJ,sHAAsH,mEAAmE;AACrX,2BAA2B,aAAa,eAAe,6BAA6B,eAAe,qDAAqD,2BAA2B,8BAA8B,sBAAsB,2CAA2C,qCAAqC,EAAE,eAAe,UAAU,kEAAkE,eAAe;AACna,iBAAiB,eAAe,sDAAsD,mBAAmB,2BAA2B,EAAE,eAAe,gBAAgB,mBAAmB,+BAA+B,EAAE,cAAc,WAAW,+EAA+E;AACjU,eAAe,oCAAoC,oEAAoE,KAAK,yDAAyD,sDAAsD,2BAA2B,mBAAmB,GAAG,8BAA8B,kBAAkB,kBAAkB,GAAG,8BAA8B,kBAAkB,qBAAqB,GAAG,QAAQ,iDAAiD;AACle,mBAAmB,OAAO,UAAU,MAAM,oBAAoB,WAAW,oCAAoC,EAAE,gCAAgC,qBAAqB,mBAAmB,GAAG,sCAAsC,OAAO,qBAAqB,mBAAmB,GAAG,oCAAoC,OAAO,qBAAqB,mBAAmB,GAAG,sCAAsC,OAAO;AACrZ,qBAAqB,GAAG,4DAA4D,OAAO,qBAAqB,iBAAiB,iBAAiB,iBAAiB,qBAAqB,iBAAiB,kCAAkC,sCAAsC;AACjR,eAAe,0DAA0D,+EAA+E,2EAA2E,iBAAiB,kCAAkC,uCAAuC,EAAE,mBAAmB,eAAe,2BAA2B,EAAE,eAAe;AAC7Y,iBAAiB,8LAA8L;AAC/M,eAAe,WAAW,6RAA6R,aAAa,KAAK,iBAAiB,yBAAyB,iBAAiB,iBAAiB,yBAAyB;AAC9a,iBAAiB,yBAAyB,gBAAgB,iBAAiB,eAAe,kDAAkD,mBAAmB,kBAAkB,wBAAwB,GAAG,iBAAiB,kBAAkB,UAAU,GAAG,iBAAiB,kBAAkB,UAAU;AACzS,QAAQ,8CAA8C,KAAK,4CAA4C,oBAAoB,gGAAgG,MAAM,KAAK,uCAAuC,MAAM,6CAA6C,eAAe,KAAK,8BAA8B,KAAK,uCAAuC,KAAK,uEAAuE;AAC1e,qDAAqD,KAAK,oEAAoE,KAAK,yEAAyE,KAAK,qGAAqG,KAAK,8GAA8G,KAAK,0BAA0B,KAAK;AAC7c,cAAc,+DAA+D,MAAM,gBAAgB,KAAK,4EAA4E,gEAAgE,gBAAgB,KAAK,uFAAuF,2EAA2E,gBAAgB,KAAK,kEAAkE;AAClgB,4CAA4C,MAAM,gBAAgB,KAAK,2CAA2C,KAAK,0DAA0D,uDAAuD,KAAK,6CAA6C,KAAK,wFAAwF,KAAK,kDAAkD,KAAK,sDAAsD,MAAM;AAC/e,CAAC,UAAU,KAAK,uCAAuC,KAAK,0FAA0F,wDAAwD,0EAA0E,gFAAgF,eAAe,uFAAuF,YAAY,KAAK;AAC/d,6EAA6E,gGAAgG,eAAe,yFAAyF,YAAY,KAAK,qDAAqD,KAAK,oDAAoD,kFAAkF;AACte,KAAK,WAAW,KAAK,yCAAyC,MAAM,6CAA6C,iBAAiB,KAAK,2CAA2C,iDAAiD,eAAe,KAAK,wCAAwC,MAAM,8CAA8C,eAAe,KAAK,2CAA2C,KAAK,2CAA2C,4CAA4C,MAAM;AACpf,cAAc,mEAAmE,MAAM,KAAK,IAAI,gCAAgC,4CAA4C,KAAK,yFAAyF,2DAA2D;AACrU,kBAAkB,gDAAgD,8BAA8B,sCAAsC,8BAA8B,4DAA4D,uFAAuF,mBAAmB,IAAI,wBAAwB,4BAA4B,iBAAiB,6CAA6C,cAAc;AAC9c,eAAe,WAAW,OAAO,SAAS,UAAU,sBAAsB;AAC1E,iBAAiB,qDAAqD,aAAa,OAAO,oEAAoE,oCAAoC,+BAA+B,GAAG;AACpO;AACA;AACA;AACA;AACA;AACA,yFAAyF,SAAS,EAAE,kEAAkE,wDAAwD,iBAAiB,kCAAkC,eAAe,SAAS,YAAY;AACrT,eAAe,4BAA4B,2BAA2B,qCAAqC,4GAA4G,OAAO,2DAA2D,cAAc,aAAa,aAAa,gBAAgB,IAAI,MAAM,aAAa,kBAAkB,EAAE,4BAA4B,0BAA0B,WAAW,4BAA4B,0BAA0B,EAAE,EAAE,EAAE;AACzf,iBAAiB,4BAA4B,yBAAyB,mEAAmE,EAAE,EAAE,iBAAiB,qBAAqB,0EAA0E,EAAE,6DAA6D,OAAO;AACnU,cAAc,qCAAqC,aAAa,KAAK,+BAA+B,gCAAgC,KAAK,0BAA0B,kBAAkB,EAAE,gCAAgC,2BAA2B,KAAK,6DAA6D,gBAAgB,8CAA8C,SAAS,SAAS,EAAE,sBAAsB,0BAA0B,GAAG,iBAAiB,QAAQ,SAAS,GAAG,qBAAqB,SAAS,SAAS,SAAS,SAAS,YAAY,+GAA+G,SAAS,0BAA0B,2BAA2B,YAAY,UAAU,iCAAiC,6CAA6C,iDAAiD,gEAAgE;AACr6B,yBAAyB,SAAS,SAAS,SAAS,SAAS,SAAS,0BAA0B,SAAS,mBAAmB,4BAA4B,SAAS;AACjK,iCAAiC,WAAW,oBAAoB,2CAA2C,kDAAkD,qBAAqB,sBAAsB,uBAAuB,2BAA2B,aAAa,IAAI,MAAM,qDAAQ,yBAAyB,SAAS,OAAO,OAAO,oCAAoC,SAAS,WAAW,oCAAoC,OAAO,QAAQ,YAAY,WAAW,KAAK,WAAW,oBAAoB;AAC/e,+BAA+B,qCAAqC,mFAAmF,uDAAuD,+CAA+C,mCAAmC,mFAAmF,uCAAuC,uCAAuC,aAAa,gCAAgC;AAC9e,eAAe,IAAI,OAAO,qDAAQ,oBAAoB,SAAS,UAAU,yBAAyB,SAAS,SAAS,SAAS,SAAS,eAAe,eAAe,0BAA0B,UAAU;AACxM,eAAe,WAAW,8BAA8B,GAAG,iBAAiB,MAAM,YAAY,WAAW,KAAK,WAAW,QAAQ,QAAQ,oMAAoM,MAAM,KAAK,SAAS,KAAK,0BAA0B;AAChY,eAAe,kBAAkB,yBAAyB,SAAS,oDAAoD,MAAM,MAAM,cAAc,iBAAiB,gBAAgB,MAAM,EAAE,WAAW,eAAe,qBAAqB,mFAAmF,iCAAiC,uBAAuB,wBAAwB,EAAE,gBAAgB,kBAAkB,mBAAmB,kBAAkB,mCAAmC,KAAK,EAAE;AAC/f,gBAAgB,UAAU,sBAAsB,gBAAgB;AAChE,+BAA+B,uCAAuC,2CAA2C,MAAM,KAAK,UAAU,8BAA8B,WAAW,8BAA8B,2BAA2B,MAAM,KAAK,SAAS,EAAE,IAAI,SAAS,kBAAkB,MAAM,OAAO,sDAAsD,SAAS,gBAAgB,kDAAkD,SAAS;AACpb,eAAe,iFAAiF,WAAW,uBAAuB,8BAA8B,WAAW,8BAA8B,MAAM,sDAAsD,MAAM,gBAAgB,kDAAkD,SAAS,GAAG,gBAAgB,WAAW,gCAAgC,cAAc,eAAe,SAAS,uCAAuC,GAAG,gBAAgB;AACpf,qCAAqC,sBAAsB,MAAM,MAAM,MAAM,gBAAgB,MAAM,0BAA0B,eAAe,uDAAuD,mBAAmB,SAAS,mBAAmB,SAAS,kBAAkB,QAAQ,aAAa,mBAAmB,KAAK,yBAAyB,YAAY,iBAAiB,YAAY;AAC5X,eAAe,OAAO,0BAA0B,6BAA6B,iBAAiB,mBAAmB,0FAA0F,eAAe,EAAE,iBAAiB,gBAAgB,iBAAiB,sBAAsB,YAAY,GAAG,eAAe,UAAU,qDAAQ,uBAAuB,qDAAQ,mCAAmC,iGAAiG,yBAAyB,eAAe,kBAAkB,6CAA6C,gBAAgB,GAAG,oBAAoB,mCAAmC,gBAAgB,gCAAgC,kBAAkB,kBAAkB,eAAe,SAAS,UAAU,sBAAsB,UAAU,cAAc,qBAAqB,iBAAiB,cAAc,EAAE,OAAO,gBAAgB,WAAW;AACp6B,2BAA2B,oDAAoD,kBAAkB,wBAAwB,iDAAiD,EAAE,SAAS,gBAAgB,2BAA2B,+BAA+B,GAAG,EAAE,uBAAuB,SAAS,gBAAgB,QAAQ,qEAAqE,EAAE,EAAE,gBAAgB,sDAAsD,EAAE,wBAAwB;AACre,uBAAuB,EAAE,IAAI,mBAAmB,6CAA6C,yCAAyC,gBAAgB,eAAe,SAAS,uCAAuC,yBAAyB,eAAe,SAAS,UAAU;AAChR,qBAAqB,aAAa,cAAc,iDAAiD,6EAA6E,2BAA2B,kGAAkG,8BAA8B,mBAAmB,sFAAsF,oBAAoB;AACtc,qJAAqJ,IAAI,6BAA6B,oEAAoE,6BAA6B,gDAAgD,oBAAoB,QAAQ,SAAS,gBAAgB,QAAQ,SAAS;AAC7Y,iBAAiB,MAAM,qCAAqC,8DAA8D,mBAAmB,YAAY,GAAG,8BAA8B,KAAK,gBAAgB,oBAAoB,WAAW,cAAc,gDAAgD,UAAU,UAAU,SAAS,mBAAmB,sBAAsB,iCAAiC,UAAU,YAAY,WAAW,6DAA6D,8BAA8B,8BAA8B,KAAK,EAAE,OAAO,0BAA0B,EAAE,8BAA8B,yBAAyB,yBAAyB,uEAAuE;AAC9uB,sCAAsC,gBAAgB,EAAE,EAAE,OAAO,eAAe,2BAA2B,mDAAmD,uBAAuB,KAAK,sBAAsB,0BAA0B;AAC1O,eAAe,2BAA2B,2CAA2C,sBAAsB,IAAI,mBAAmB,UAAU,0BAA0B,8BAA8B,kBAAkB,IAAI,4CAA4C,oBAAoB,EAAE,SAAS,OAAO,wBAAwB,kBAAkB,+EAA+E,aAAa,mBAAmB,KAAK,gBAAgB,KAAK,GAAG;AACle,eAAe,iBAAiB,WAAW,cAAc,IAAI,oBAAoB,SAAS,UAAU,eAAe,6CAA6C,iBAAiB,wEAAwE,eAAe,2BAA2B,wBAAwB,oCAAoC,sBAAsB,mBAAmB,EAAE;AAC1Y,oBAAoB,kBAAkB,iCAAiC,IAAI,eAAe,oBAAoB,mBAAmB,mBAAmB,mCAAmC,MAAM,KAAK,KAAK,cAAc,UAAU,oBAAoB,kBAAkB,SAAS,eAAe,gBAAgB,SAAS,GAAG,iBAAiB,iDAAiD,MAAM,uBAAuB,gBAAgB;AACxa,kBAAkB,iCAAiC,+BAA+B,mBAAmB,kBAAkB,GAAG,gBAAgB,gBAAgB,iCAAiC,KAAK,MAAM,qCAAqC,kBAAkB,cAAc,eAAe,gBAAgB,SAAS;AACnT,eAAe,8BAA8B,mBAAmB,mDAAmD,0BAA0B,wBAAwB,4DAA4D,sBAAsB,mBAAmB,EAAE,mBAAmB,QAAQ,MAAM,WAAW,QAAQ,WAAW,iCAAiC,YAAY,MAAM,SAAS,EAAE,iBAAiB,2BAA2B;AACrb,iBAAiB,sBAAsB,YAAY,EAAE,4BAA4B,eAAe,aAAa,0BAA0B,2BAA2B,8BAA8B,KAAK,EAAE,kBAAkB,IAAI,gBAAgB,6BAA6B,EAAE,MAAM,MAAM,IAAI,eAAe,8BAA8B,mCAAmC,eAAe,kBAAkB,UAAU,sBAAsB,SAAS,2BAA2B,SAAS,uBAAuB,gBAAgB,KAAK,kCAAkC,gBAAgB,mBAAmB,iDAAiD,cAAc,kBAAkB,SAAS,eAAe,WAAW,EAAE,WAAW,mBAAmB,cAAc,iBAAiB,kBAAkB,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,kBAAkB,+BAA+B,gBAAgB;AACp3B,oBAAoB,+BAA+B,kBAAkB,GAAG,gBAAgB,+BAA+B,cAAc,GAAG,iBAAiB,gBAAgB,iBAAiB,sBAAsB,YAAY,GAAG,cAAc,UAAU,qBAAqB,eAAe,kBAAkB,qBAAqB,oBAAoB,YAAY,YAAY,gBAAgB,iBAAiB,YAAY,kBAAkB,kBAAkB,cAAc,UAAU,sGAAsG,wCAAwC,aAAa,qDAAQ,4BAA4B,yBAAyB,cAAc,IAAI,4BAA4B,sCAAsC,SAAS,SAAS;AACrxB,cAAc,mBAAmB,WAAW,qDAAQ,gBAAgB,qDAAQ,4BAA4B,eAAe,IAAI,uDAAuD,SAAS,UAAU,eAAe,kBAAkB,WAAW,2BAA2B,qBAAqB,aAAa,GAAG,oBAAoB,WAAW,2BAA2B,YAAY,iCAAiC,GAAG,gBAAgB,WAAW,2BAA2B,kBAAkB;AACne,iBAAiB,oCAAoC,iBAAiB,mCAAmC,cAAc,wBAAwB,eAAe,iBAAiB,gBAAgB,iBAAiB,YAAY,eAAe,YAAY,kBAAkB,kBAAkB,cAAc,UAAU,wGAAwG,wCAAwC,aAAa,qDAAQ,8BAA8B,2BAA2B,cAAc,IAAI,8BAA8B,sCAAsC,SAAS,SAAS;AACznB,cAAc,mBAAmB,WAAW,qDAAQ,gBAAgB,qDAAQ,8BAA8B,eAAe,IAAI,uDAAuD,SAAS,UAAU,eAAe,kBAAkB,WAAW,2BAA2B,qBAAqB,aAAa,GAAG,oBAAoB,WAAW,2BAA2B,YAAY,iCAAiC,GAAG,gBAAgB,WAAW,2BAA2B,kBAAkB,GAAG;AACxe,kBAAkB,cAAc,SAAS,aAAa,UAAU,iBAAiB,YAAY,eAAe,WAAW,WAAW,KAAK,WAAW,KAAK,WAAW,KAAK,YAAY,QAAQ,qCAAqC,eAAe,gFAAgF,GAAG,yBAAyB,SAAS,QAAQ,KAAK,mCAAmC,aAAa,4CAA4C,MAAM,kCAAkC,MAAM,0DAA0D,MAAM;AAC3jB,cAAc,yCAAyC,SAAS,SAAS,SAAS,UAAU,gBAAgB,KAAK,IAAI,yEAAyE,SAAS,wBAAwB,IAAI,kBAAkB,SAAS,cAAc,cAAc,uBAAuB,UAAU,OAAO,cAAc,gBAAgB,UAAU,iBAAiB,UAAU,0BAA0B,uBAAuB;AACtb,iBAAiB,sCAAsC,mBAAmB,0BAA0B,mCAAmC,WAAW,IAAI,gCAAgC,UAAU,0DAA0D,2DAA2D,EAAE,eAAe,oBAAoB,kCAAkC,mBAAmB,UAAU,4BAA4B;AACrb,sBAAsB,oCAAoC,kCAAkC,gBAAgB,mBAAmB,yBAAyB,GAAG,8BAA8B,UAAU,8CAA8C,gGAAgG,0BAA0B;AAC3W,iCAAiC,UAAU,qCAAqC,YAAY,yCAAyC,oDAAoD,eAAe,MAAM,2BAA2B,kBAAkB,yCAAyC,0BAA0B,8DAA8D,YAAY,MAAM,eAAe;AAC7Z,iBAAiB,WAAW,cAAc,gCAAgC,gBAAgB,iCAAiC,gCAAgC,gCAAgC,8CAA8C,gEAAgE,gIAAgI,yDAAyD,WAAW,aAAa;AAC1f,2FAA2F,4GAA4G,2BAA2B,iBAAiB,mCAAmC,IAAI,GAAG,eAAe,SAAS,YAAY,QAAQ,4BAA4B,eAAe,wCAAwC,aAAa,GAAG,cAAc,aAAa,cAAc,WAAW,iBAAiB,UAAU,yDAAyD,gBAAgB,UAAU,SAAS,SAAS,iDAAiD,wDAAwD,aAAa,OAAO,SAAS,iCAAiC,MAAM,cAAc,kBAAkB,8BAA8B,gBAAgB;AAC31B,eAAe,4BAA4B,WAAW,mDAAmD,SAAS,KAAK,KAAK,YAAY,WAAW,+GAA+G,WAAW,WAAW,WAAW,2DAA2D,WAAW,QAAQ,KAAK,KAAK,oEAAoE,WAAW;AAC1c,MAAM,gBAAgB,qBAAqB,IAAI,IAAI,IAAI,QAAQ,IAAI,IAAI,IAAI,QAAQ,kBAAkB,kBAAkB,kBAAkB,kBAAkB,kBAAkB,kBAAkB,kBAAkB;AACjN,mBAAmB,yBAAyB,cAAc,4BAA4B,IAAI,gDAAgD,mBAAmB,IAAI,EAAE,aAAa,6FAA6F,WAAW,oBAAoB,oDAAoD,MAAM;AACtW;AACA,iMAAiM,cAAc,mBAAmB,SAAS,gGAAgG,yBAAyB,SAAS,SAAS,SAAS,eAAe,eAAe,SAAS,eAAe,cAAc,sBAAsB,YAAY,UAAU,mBAAmB,eAAe,gDAAgD;AACjkB,gBAAgB,oDAAoD,uHAAuH,2GAA2G,wHAAwH;AAC9Z,CAAC,YAAY,kCAAkC,GAAG,cAAc,kBAAkB,IAAI,mHAAmH,kBAAkB,eAAe,aAAa,QAAQ,KAAK,YAAY,6CAA6C,aAAa,MAAM,wBAAwB,MAAM,UAAU,MAAM,iBAAiB,KAAK,0BAA0B;AAC9a,mBAAmB,wDAAwD,YAAY,gBAAgB,gEAAgE,gBAAgB,UAAU,gBAAgB,UAAU,gBAAgB;AAC3O,uBAAuB,wDAAwD,oDAAoD,kCAAkC,MAAM,aAAa,kBAAkB,qBAAqB,kBAAkB,2BAA2B,aAAa,8CAA8C,IAAI,2BAA2B,2DAA2D,UAAU,QAAQ,aAAa,8BAA8B,uCAAuC;AACrgB,aAAa,WAAW,kCAAkC,gFAAgF,iBAAiB,6BAA6B,SAAS,EAAE,EAAE,gBAAgB,wCAAwC,kDAAkD,cAAc,WAAW,SAAS;AACjV,uBAAuB,6FAA6F,oEAAoE,wCAAwC,uDAAuD,mDAAmD,oEAAoE,wBAAwB,QAAQ,cAAc,iDAAiD,8BAA8B;AAC3gB,IAAI,6BAA6B,kBAAkB,oDAAoD,sEAAsE,WAAW,cAAc,MAAM,4CAA4C,sEAAsE,KAAK,KAAK,mCAAmC,sEAAsE,MAAM;AACvb,oCAAoC,EAAE,EAAE,iBAAiB,YAAY,aAAa,QAAQ,UAAU,WAAW,eAAe,iCAAiC,yBAAyB,cAAc,KAAK,QAAQ,SAAS,QAAQ,MAAM,EAAE,GAAG,WAAW,eAAe,WAAW,gCAAgC,IAAI,MAAM,sBAAsB,kBAAkB,SAAS;AAC/W,eAAe,cAAc,KAAK,cAAc,uBAAuB,QAAQ,gBAAgB,WAAW,YAAY,iMAAiM,OAAO,QAAQ,EAAE,6FAA6F,6BAA6B,WAAW,EAAE,oBAAoB,4BAA4B;AAC/f,8EAA8E,MAAM,EAAE,6BAA6B,KAAK,SAAS,mBAAmB,gBAAgB,MAAM,iBAAiB,eAAe,uBAAuB,gHAAgH,GAAG,iBAAiB,sBAAsB,YAAY,GAAG,eAAe,SAAS,YAAY,QAAQ,oCAAoC,eAAe,iCAAiC,eAAe,sBAAsB,eAAe,wCAAwC,mBAAmB,GAAG,qBAAqB,UAAU,SAAS,SAAS,SAAS,SAAS,SAAS,UAAU,UAAU,sBAAsB,cAAc,cAAc,iCAAiC,UAAU,sBAAsB,gCAAgC,8BAA8B,gCAAgC,6BAA6B,2BAA2B,6BAA6B;AAClgC,uBAAuB,MAAM,qDAAQ,mBAAmB,oDAAoD,8BAA8B,UAAU,kBAAkB,4CAA4C,WAAW,eAAe,0BAA0B,UAAU,8BAA8B,kBAAkB,SAAS;AACzU,eAAe,8BAA8B,4FAA4F,cAAc,EAAE,kBAAkB,iBAAiB,uBAAuB,8BAA8B,0BAA0B,oBAAoB,4FAA4F,cAAc,EAAE,QAAQ,eAAe,MAAM,EAAE,iBAAiB,mBAAmB,YAAY;AAC1d,2BAA2B,wCAAwC,4BAA4B,WAAW,6DAA6D,iBAAiB,gBAAgB,KAAK,gBAAgB,kBAAkB,6EAA6E,KAAK,OAAO,WAAW,UAAU,0CAA0C,2BAA2B;AACla,2BAA2B,+BAA+B,0BAA0B,YAAY,UAAU,QAAQ,eAAe;AACjI,uBAAuB,MAAM,+BAA+B,qCAAqC,oEAAoE,IAAI,+BAA+B,SAAS,EAAE,kBAAkB,kCAAkC,0BAA0B,cAAc,mBAAmB,gBAAgB,EAAE,EAAE,EAAE,uBAAuB,4BAA4B,iBAAiB,WAAW,UAAU,mBAAmB,UAAU,mBAAmB;AACje,qBAAqB,gBAAgB,+BAA+B,aAAa,cAAc,YAAY,UAAU,UAAU,YAAY,iBAAiB,8BAA8B,YAAY;AACtM,6BAA6B,MAAM,aAAa,UAAU,oIAAoI,iBAAiB,oIAAoI,qCAAqC,eAAe,iCAAiC,eAAe;AACvb,mBAAmB,gBAAgB,yDAAyD,4BAA4B,eAAe,gBAAgB,eAAe,EAAE,iBAAiB,eAAe,aAAa,0BAA0B,aAAa,cAAc,iBAAiB,eAAe,aAAa,0BAA0B,aAAa,cAAc,qBAAqB,0BAA0B,UAAU,EAAE,OAAO;AAC9a,2BAA2B,WAAW,2BAA2B,oDAAoD,GAAG,eAAe,uBAAuB,kBAAkB,iCAAiC,8BAA8B,EAAE,eAAe,6BAA6B,MAAM,gBAAgB,kFAAkF;AACrY,iBAAiB,gBAAgB,8CAA8C,iBAAiB,gBAAgB,iBAAiB,GAAG,cAAc,WAAW,sDAAsD,eAAe,eAAe,iBAAiB,UAAU,eAAe,GAAG,iBAAiB,SAAS,2BAA2B,iCAAiC,4BAA4B,kBAAkB,qBAAqB,2CAA2C,mBAAmB,GAAG,eAAe,YAAY,mLAAmL,QAAQ,oSAAoS;AACl/B,CAAC,mBAAmB,eAAe,mFAAmF,SAAS,aAAa,SAAS,sBAAsB,UAAU,WAAW,wBAAwB,uBAAuB,EAAE,sBAAsB,yBAAyB,uBAAuB,2CAA2C,4BAA4B,WAAW,8CAA8C,cAAc,aAAa,aAAa,OAAO,cAAc,GAAG,qBAAqB,8CAA8C,qBAAqB,0BAA0B,QAAQ,mBAAmB,0EAA0E,8CAA8C,UAAU,aAAa,eAAe,gCAAgC,+CAA+C,qBAAqB,+BAA+B,GAAG,WAAW,0CAA0C,KAAK,8BAA8B,EAAE,iBAAiB,EAAE,mBAAmB,+BAA+B,GAAG,wBAAwB,KAAK,8BAA8B,EAAE,iBAAiB,EAAE,eAAe,wBAAwB,SAAS;AAC1sC,eAAe,gBAAgB,yJAAyJ,SAAS,iBAAiB,eAAe,4BAA4B,QAAQ,iBAAiB,SAAS,UAAU,uBAAuB,iCAAiC,SAAS,6FAA6F,gBAAgB,MAAM,qBAAqB,qCAAqC,qEAAqE,qCAAqC,IAAI,YAAY,UAAU,IAAI,YAAY,aAAa,EAAE;AAC1rB,eAAe,SAAS,4BAA4B,qBAAqB,EAAE,SAAS,eAAe,iBAAiB,mBAAmB,iBAAiB,MAAM,yBAAyB,gBAAgB,mCAAmC,sBAAsB,GAAG,mBAAmB,sBAAsB,kCAAkC,mBAAmB,mBAAmB,UAAU,oBAAoB;AAClZ,iBAAiB,oDAAoD,mCAAmC,eAAe,4BAA4B,EAAE,mBAAmB,yBAAyB,gBAAgB,EAAE,QAAQ,UAAU,kCAAkC,8CAA8C,EAAE,GAAG,eAAe,OAAO,aAAa,sCAAsC,aAAa,KAAK,mBAAmB,SAAS,SAAS,SAAS,WAAW,YAAY,YAAY,cAAc,yFAAyF,8BAA8B,cAAc,aAAa,iBAAiB,0BAA0B,MAAM,OAAO,mBAAmB,SAAS,iBAAiB,SAAS,gCAAgC,YAAY,kBAAkB,aAAa,kBAAkB,SAAS,gBAAgB,iBAAiB;AAC33B,6BAA6B,uCAAuC,eAAe,SAAS,mBAAmB,0BAA0B,OAAO,oGAAoG,eAAe,yBAAyB,iBAAiB,qBAAqB,kBAAkB,MAAM,iBAAiB,QAAQ;AACnX,iBAAiB,kCAAkC,uBAAuB,oBAAoB,OAAO,6CAA6C,gBAAgB,8CAA8C,SAAS,EAAE,kCAAkC,MAAM,oGAAoG,gDAAgD,aAAa,kDAAkD,GAAG,iBAAiB,eAAe,eAAe,QAAQ,oDAAoD,EAAE,eAAe,uBAAuB,0BAA0B,OAAO,sCAAsC,yBAAyB,QAAQ,0FAA0F;AAC9yB,mBAAmB,UAAU,gBAAgB,iBAAiB,0BAA0B,MAAM,qDAAQ,gBAAgB,qDAAQ,mBAAmB,+BAA+B,8CAA8C,sBAAsB,eAAe,aAAa,gCAAgC,aAAa,EAAE,aAAa,UAAU,gDAAgD,UAAU,YAAY,gBAAgB,uBAAuB,WAAW,aAAa,oBAAoB;AAC/e,aAAa,oBAAoB,aAAa,YAAY,UAAU,oBAAoB,WAAW,aAAa,sBAAsB,6BAA6B,QAAQ,4BAA4B,UAAU,cAAc,2BAA2B,gBAAgB,iBAAiB,yCAAyC,2CAA2C,iBAAiB,yCAAyC;AACza,iBAAiB,MAAM,OAAO,qDAAQ,gBAAgB,qDAAQ,wBAAwB,2BAA2B,mBAAmB,iBAAiB,sCAAsC,wCAAwC,2BAA2B,0CAA0C,eAAe,IAAI,OAAO,qDAAQ,iBAAiB,SAAS;AACpW,eAAe,yBAAyB,eAAe,aAAa,sDAAsD,YAAY,uBAAuB,eAAe,EAAE,eAAe,2EAA2E,eAAe,wBAAwB,WAAW,iBAAiB,OAAO,cAAc,iBAAiB,mBAAmB,YAAY;AAChZ,eAAe,iBAAiB,aAAa,sBAAsB,6BAA6B,SAAS,EAAE,eAAe,8BAA8B,iBAAiB,KAAK,6QAA6Q,EAAE,iBAAiB;AAC9c,eAAe,eAAe,2BAA2B,mCAAmC,EAAE,eAAe,qCAAqC,oBAAoB,EAAE,iBAAiB,+CAA+C,iBAAiB,8BAA8B,uBAAuB,EAAE,mBAAmB;AACnU,iBAAiB,YAAY,4LAA4L,gGAAgG,QAAQ,uDAAuD,eAAe,oBAAoB,WAAW,uCAAuC,6BAA6B,aAAa,WAAW;AAClgB,eAAe,8BAA8B,oBAAoB,+BAA+B,0BAA0B,SAAS,EAAE,EAAE,iBAAiB,kCAAkC,iBAAiB,GAAG,gBAAgB,WAAW,uCAAuC,uBAAuB,mBAAmB,oCAAoC,mFAAmF,oCAAoC,qBAAqB;AAC1e,iBAAiB,+GAA+G,iBAAiB,iBAAiB,UAAU;AAC5K,iBAAiB,UAAU,+CAA+C,OAAO,SAAS,wMAAwM,EAAE,oBAAoB,WAAW,kBAAkB,qGAAqG,0CAA0C,KAAK;AACze,eAAe,wDAAwD,mFAAmF,KAAK,iBAAiB,kKAAkK;AAClV,iBAAiB,kBAAkB,oDAAoD,QAAQ,2BAA2B,SAAS,kBAAkB,kBAAkB,SAAS,OAAO,iBAAiB,6BAA6B,4CAA4C,wCAAwC,EAAE,EAAE,iBAAiB,8IAA8I;AAC5d,iBAAiB,kBAAkB,oDAAoD,aAAa,mBAAmB,kBAAkB,mBAAmB,iBAAiB,eAAe,kBAAkB,SAAS,IAAI,mBAAmB,WAAW,+CAA+C,+BAA+B,IAAI,mBAAmB,WAAW,kCAAkC,+BAA+B;AAC1a,mBAAmB,YAAY,QAAQ,WAAW,yDAAyD,EAAE,iBAAiB,QAAQ,kCAAkC,SAAS,EAAE,iBAAiB,WAAW,wCAAwC,mBAAmB,mBAAmB,QAAQ,kBAAkB,IAAI,iBAAiB,WAAW,wCAAwC,kBAAkB,mBAAmB,QAAQ,kBAAkB;AAC9b,iBAAiB,WAAW,wCAAwC,mBAAmB,mBAAmB,QAAQ,kBAAkB;AACpI,iBAAiB,+DAA+D,WAAW,wCAAwC,iBAAiB,8CAA8C,EAAE,mBAAmB,QAAQ,wCAAwC,kCAAkC,6BAA6B,yFAAyF,EAAE,aAAa;AAC9a,iBAAiB,WAAW,wCAAwC,kDAAkD,SAAS,qCAAqC,mBAAmB,EAAE,oBAAoB,cAAc,EAAE,2CAA2C,aAAa,wBAAwB,iCAAiC,EAAE;AAChV,oBAAoB,WAAW,wCAAwC,iBAAiB,UAAU,EAAE,kBAAkB,uCAAuC,mBAAmB,YAAY,aAAa,iCAAiC,WAAW,WAAW,WAAW,OAAO,OAAO,MAAM,yBAAyB,eAAe;AACvU,mBAAmB,gMAAgM,uBAAuB;AAC1O,mBAAmB,4OAA4O,iBAAiB,WAAW,2CAA2C,0CAA0C,aAAa,EAAE,MAAM,iBAAiB,6CAA6C,WAAW;AAC9c,uBAAuB,wEAAwE,yBAAyB,gDAAgD,oEAAoE,qDAAQ,0CAA0C,4BAA4B,sBAAsB,MAAM,oCAAoC,EAAE,kBAAkB,sCAAsC,kBAAkB,2BAA2B;AACje,WAAW,MAAM,MAAM,MAAM,oBAAoB,EAAE,mBAAmB,SAAS,oBAAoB,gBAAgB,SAAS,SAAS,EAAE,gBAAgB,iBAAiB,WAAW,8CAA8C,0BAA0B,MAAM,iBAAiB,gDAAgD,WAAW;AAC7U,uBAAuB,wEAAwE,yBAAyB,6BAA6B,sBAAsB,MAAM,oCAAoC,EAAE,kBAAkB,OAAO,aAAa,mBAAmB,uCAAuC,SAAS,kBAAkB,gCAAgC,gBAAgB,IAAI,wBAAwB,SAAS,kBAAkB,cAAc,EAAE;AACzc,eAAe,eAAe,2CAA2C,6CAA6C,uBAAuB,WAAW,sCAAsC,WAAW,4BAA4B,eAAe,8CAA8C,EAAE,mBAAmB,iBAAiB,eAAe,kBAAkB,SAAS,EAAE;AACpX,uBAAuB,WAAW,sCAAsC,iCAAiC,kBAAkB,+CAA+C,SAAS,mBAAmB,2BAA2B,QAAQ,SAAS,kBAAkB,kBAAkB,SAAS,EAAE;AACjS,iBAAiB,kBAAkB,wCAAwC,IAAI,sCAAsC,eAAe,mBAAmB,mBAAmB,mBAAmB,gCAAgC,mBAAmB,IAAI,mBAAmB,kBAAkB,wCAAwC,IAAI,sCAAsC,eAAe,mBAAmB,qBAAqB,mBAAmB,gCAAgC,mBAAmB;AACxe,kBAAkB,gBAAgB,YAAY,gBAAgB,UAAU,EAAE,uBAAuB,WAAW,6EAA6E,YAAY,EAAE,iBAAiB,kBAAkB,kCAAkC,2BAA2B,QAAQ,SAAS,kBAAkB,kBAAkB,SAAS,EAAE;AACvW,mBAAmB,mDAAmD,6HAA6H,SAAS,EAAE,oBAAoB;AAClO,eAAe,OAAO,6TAA6T,sCAAsC,gCAAgC,2BAA2B,EAAE,gBAAgB;AACtc,eAAe,yBAAyB,OAAO,0FAA0F,MAAM,4IAA4I,iBAAiB,oBAAoB,6CAA6C,eAAe,EAAE,4CAA4C;AAC1a,qBAAqB,kBAAkB,YAAY,WAAW,kCAAkC,SAAS,EAAE,qBAAqB,eAAe,0BAA0B,mBAAmB,aAAa,sCAAsC,IAAI,YAAY,WAAW,QAAQ,UAAU,eAAe,SAAS,YAAY,QAAQ,iCAAiC,eAAe,sBAAsB,iBAAiB,wCAAwC,uBAAuB,eAAe,EAAE,GAAG,eAAe,SAAS,YAAY,YAAY,gBAAgB,sDAAsD,0BAA0B,yBAAyB,mBAAmB,2BAA2B,+CAA+C,mBAAmB,0CAA0C,MAAM,EAAE,EAAE,GAAG,iBAAiB,WAAW,qDAAqD,uBAAuB;AAC16B,eAAe,+CAA+C,qCAAqC,sBAAsB,mBAAmB,2CAA2C,2CAA2C,4CAA4C,iBAAiB,EAAE,EAAE,EAAE,mBAAmB,MAAM,iBAAiB,eAAe,aAAa,EAAE,QAAQ,gCAAgC,eAAe,OAAO;AAC3a,4BAA4B,kBAAkB,MAAM,0BAA0B,kDAAkD,IAAI,eAAe,kBAAkB,UAAU,+BAA+B,MAAM,GAAG,eAAe,uBAAuB,6BAA6B,EAAE,iBAAiB,uBAAuB,8BAA8B,EAAE,eAAe,uBAAuB,uBAAuB;AACja,mBAAmB,uBAAuB,yCAAyC,uBAAuB,2BAA2B,eAAe,EAAE,EAAE,EAAE,iBAAiB,kBAAkB,YAAY,eAAe,UAAU,0BAA0B,gBAAgB,6CAA6C,qDAAQ,gBAAgB,qDAAQ,mFAAmF,oCAAoC,UAAU,UAAU,UAAU,QAAQ,qDAAQ,2CAA2C,cAAc,QAAQ,qDAAQ,2CAA2C,cAAc,uDAAuD;AACvrB,gDAAgD,wBAAwB,wBAAwB,WAAW,wBAAwB,wBAAwB,wBAAwB,wBAAwB,wBAAwB,YAAY,SAAS,iBAAiB,4CAA4C,2CAA2C,SAAS,aAAa,SAAS,UAAU,YAAY,QAAQ,eAAe,mCAAmC,SAAS;AACxd,eAAe,qCAAqC,SAAS,QAAQ,eAAe,gCAAgC,SAAS,QAAQ,eAAe,iBAAiB,eAAe,kBAAkB,iBAAiB,2FAA2F,gBAAgB,gBAAgB,gBAAgB,kBAAkB;AACpX,iBAAiB,YAAY,8HAA8H,KAAK,QAAQ,OAAO,oBAAoB,kBAAkB;AACrN,cAAc,mIAAmI,iCAAiC,sCAAsC,gFAAgF,yBAAyB,qBAAqB,kCAAkC,oCAAoC,wBAAwB,qBAAqB,mBAAmB,qBAAqB;AACjf,IAAI,2BAA2B,6CAA6C,+BAA+B,EAAE,iBAAiB,eAAe,UAAU,qDAAQ,gBAAgB,qDAAQ,2BAA2B,oCAAoC,gBAAgB,mBAAmB,iBAAiB,gDAAgD,eAAe;AACzW,eAAe,8BAA8B,eAAe,iBAAiB,iBAAiB,WAAW,eAAe,EAAE,UAAU,8BAA8B,eAAe,gBAAgB,iBAAiB,WAAW,eAAe,EAAE,SAAS,oBAAoB,OAAO,4HAA4H,eAAe;AAC7Z,eAAe,oDAAoD,mCAAmC,SAAS,0BAA0B,UAAU,eAAe,QAAQ,QAAQ,UAAU,aAAa,QAAQ,MAAM,UAAU,QAAQ,MAAM,YAAY,QAAQ,SAAS,YAAY,GAAG,mBAAmB,UAAU,iDAAiD,iDAAiD;AAC1Z,uBAAuB,kJAAkJ,mBAAmB,2FAA2F,uBAAuB,cAAc,gDAAgD,sCAAsC,2BAA2B,uBAAuB;AACpc,iBAAiB,wEAAwE,4CAA4C,6JAA6J,qDAAQ,+CAA+C,4BAA4B,4BAA4B,8CAA8C,kBAAkB,2BAA2B;AAC5e,2CAA2C,MAAM,MAAM,MAAM,mCAAmC,EAAE,mBAAmB,SAAS,oBAAoB,gBAAgB,SAAS,SAAS,EAAE,kBAAkB,iBAAiB,wEAAwE,sCAAsC,eAAe,kBAAkB,kDAAkD,EAAE;AAC5Z,eAAe,wEAAwE,4BAA4B,gBAAgB,mBAAmB,oBAAoB,EAAE,cAAc,gBAAgB,WAAW,iCAAiC,eAAe,SAAS,gBAAgB,eAAe,SAAS;AACtT,iBAAiB,mCAAmC,4DAA4D,gBAAgB,gCAAgC,wCAAwC,uBAAuB,yBAAyB,qCAAqC,8CAA8C,kBAAkB,mDAAmD,QAAQ,MAAM,eAAe,kBAAkB,MAAM;AACrc,iBAAiB,SAAS,6BAA6B,qCAAqC,oBAAoB,4BAA4B,2BAA2B,0BAA0B,mBAAmB,mDAAmD,QAAQ,MAAM,eAAe,kBAAkB,MAAM;AAC5T,iBAAiB,qHAAqH,iHAAiH,qBAAqB,gEAAgE,gBAAgB,oCAAoC,eAAe,oBAAoB,WAAW,+BAA+B,MAAM,EAAE,EAAE;AACvd,eAAe,uDAAuD,kBAAkB,eAAe,EAAE,cAAc,eAAe,sDAAsD,qBAAqB,mBAAmB,kFAAkF,iCAAiC,SAAS,EAAE,gBAAgB,sDAAsD,QAAQ,mBAAmB,cAAc,EAAE;AACnd,eAAe,2BAA2B,aAAa,gBAAgB,kBAAkB,sBAAsB,gBAAgB,kBAAkB,SAAS,QAAQ,UAAU,uCAAuC;AACnN,gBAAgB,WAAW,8DAA8D,SAAS,MAAM,cAAc,WAAW,YAAY,qEAAqE,gCAAgC,6DAA6D,GAAG,iBAAiB,qBAAqB,gBAAgB,SAAS,kBAAkB,gBAAgB,WAAW,gBAAgB;AAC9a,iBAAiB,kBAAkB,8BAA8B,QAAQ,QAAQ,eAAe,aAAa,WAAW,yEAAyE,YAAY,kBAAkB,WAAW,mEAAmE,EAAE,GAAG,iBAAiB,WAAW,8BAA8B,kBAAkB,GAAG,iBAAiB,WAAW,qCAAqC,aAAa;AAC/c,iBAAiB,WAAW,mBAAmB,aAAa,GAAG,qBAAqB,WAAW,2CAA2C,uEAAuE,EAAE,uBAAuB,qBAAqB,WAAW,2CAA2C,eAAe,uEAAuE,EAAE;AAC7Y,iBAAiB,oCAAoC,uCAAuC,OAAO,eAAe,OAAO,EAAE,kBAAkB,iBAAiB,WAAW,8BAA8B,sBAAsB,QAAQ,GAAG,mBAAmB,aAAa,uBAAuB,QAAQ,SAAS,GAAG,mBAAmB,WAAW,8BAA8B,sBAAsB,mBAAmB,GAAG;AAC3Z,mBAAmB,WAAW,8BAA8B,sBAAsB,mBAAmB,GAAG,GAAG,iBAAiB,WAAW,8BAA8B,uBAAuB,GAAG,iBAAiB,4JAA4J;AAC5W,gBAAgB,WAAW,8BAA8B,WAAW,qBAAqB,UAAU,6BAA6B,EAAE,WAAW,mEAAmE,EAAE,uCAAuC,aAAa,uBAAuB,QAAQ,SAAS,EAAE,GAAG,cAAc,aAAa,cAAc,qBAAqB,oBAAoB,mCAAmC,eAAe;AACvb,eAAe,SAAS,YAAY,aAAa,4BAA4B,uDAAuD,aAAa,6BAA6B,iBAAiB,6BAA6B,SAAS,gCAAgC,iBAAiB,WAAW,qBAAqB,YAAY,EAAE,qBAAqB,gCAAgC;AACzX,mCAAmC,WAAW,eAAe,8BAA8B,yBAAyB,IAAI,sCAAsC,sBAAsB,YAAY,GAAG,iBAAiB,YAAY,wBAAwB,6DAA6D;AACrT,oBAAoB,UAAU,YAAY,gBAAgB,oCAAoC,UAAU,+DAA+D,uCAAuC,0BAA0B,gBAAgB,YAAY,gBAAgB,UAAU,EAAE,SAAS,iBAAiB,6BAA6B,iBAAiB;AACxW,mBAAmB,WAAW,kCAAkC,gBAAgB,4FAA4F,aAAa,mBAAmB,mBAAmB,mBAAmB,IAAI,iBAAiB,mCAAmC,oBAAoB,GAAG,mBAAmB,8CAA8C,IAAI,iBAAiB,4CAA4C,iBAAiB;AACpd,iBAAiB,4CAA4C,IAAI,mBAAmB,WAAW,kCAAkC,sCAAsC,eAAe,mBAAmB,mBAAmB,mBAAmB,IAAI,mBAAmB;AACtQ,mBAAmB,WAAW,kCAAkC,wBAAwB,QAAQ,0DAA0D,wDAAwD,eAAe,IAAI,eAAe,iCAAiC,gCAAgC,sCAAsC,kCAAkC,cAAc,UAAU,YAAY,YAAY,kCAAkC,sCAAsC,iBAAiB,+BAA+B,iBAAiB,QAAQ,qCAAqC,qCAAqC,2CAA2C,iCAAiC,6BAA6B,iBAAiB,kCAAkC,eAAe;AACnzB,iBAAiB,UAAU,SAAS,mBAAmB,iCAAiC,aAAa,WAAW,kBAAkB,aAAa,gDAAgD,oCAAoC,SAAS;AAC5O,gCAAgC,SAAS,WAAW,sCAAsC,SAAS,6CAA6C,SAAS,OAAO,UAAU,0BAA0B,SAAS,SAAS,SAAS,IAAI,UAAU,iBAAiB,MAAM,QAAQ,+BAA+B,SAAS,UAAU,qBAAqB,YAAY,0BAA0B,eAAe,4DAA4D,eAAe,0BAA0B,eAAe,0BAA0B,gBAAgB,cAAc,4BAA4B,YAAY,cAAc,+BAA+B,YAAY,wDAAwD,mEAAmE,OAAO,sBAAsB,GAAG;AAChzB,2BAA2B,WAAW,2BAA2B,4BAA4B,mCAAmC,WAAW,iCAAiC,kBAAkB,iBAAiB,MAAM,0BAA0B,kCAAkC,SAAS,MAAM,UAAU,gBAAgB,gBAAgB,gDAAgD,eAAe,aAAa,oBAAoB,EAAE,sBAAsB,gBAAgB,6EAA6E,EAAE;AACjiB,gBAAgB,GAAG,0BAA0B,UAAU,YAAY,2BAA2B,2BAA2B,mBAAmB,UAAU,SAAS,YAAY,gDAAgD,SAAS,WAAW,4BAA4B,UAAU,wJAAwJ,gCAAgC;AAC7c,sJAAsJ,iCAAiC,qBAAqB,aAAa,WAAW,UAAU,iBAAiB,uBAAuB,QAAQ,8BAA8B,6BAA6B,aAAa,8BAA8B,iBAAiB,sBAAsB,WAAW,6BAA6B,6BAA6B;AAChf,OAAO,6BAA6B,+DAA+D,iBAAiB,YAAY,aAAa,QAAQ,UAAU,WAAW,iBAAiB,mBAAmB,YAAY,EAAE,iBAAiB,YAAY,gBAAgB,UAAU,EAAE,SAAS;AAC9R,gBAAgB,WAAW,wDAAwD,2BAA2B,uIAAuI,kBAAkB,oBAAoB,mBAAmB,MAAM,kBAAkB,EAAE,mBAAmB,2BAA2B,gBAAgB,SAAS,SAAS;AACxZ,oBAAoB,SAAS,WAAW,yCAAyC,eAAe,UAAU,SAAS,YAAY,YAAY,iBAAiB,sBAAsB,WAAW,IAAI,oBAAoB,SAAS,WAAW,8CAA8C,yBAAyB,yBAAyB,UAAU,KAAK,kBAAkB,mBAAmB,YAAY,uBAAuB,EAAE,IAAI,mBAAmB,SAAS;AAClc,eAAe,uFAAuF,mBAAmB,SAAS,UAAU,WAAW,YAAY,gBAAgB,uEAAuE,YAAY,aAAa,UAAU,eAAe;AAC5S,mBAAmB,SAAS,IAAI,UAAU,qDAAQ,OAAO,SAAS,wFAAwF,iEAAiE,oCAAoC,kBAAkB,IAAI,qBAAqB,UAAU,IAAI,2DAA2D,UAAU,EAAE,qDAAQ,gBAAgB,qDAAQ,qBAAqB,8BAA8B,IAAI,sBAAsB,SAAS;AACrf,KAAK,SAAS,aAAa,SAAS,qBAAqB,GAAG,gCAAgC,QAAQ,iBAAiB,WAAW,0BAA0B,KAAK,oHAAoH,IAAI,WAAW,8HAA8H,KAAK,QAAQ,WAAW,yDAAyD,OAAO;AACxf,mEAAmE,QAAQ,uEAAuE,QAAQ,QAAQ,oDAAoD,+EAA+E,gBAAgB,OAAO,yDAAyD;AACrX,iBAAiB,OAAO,oDAAoD,6BAA6B,gBAAgB,OAAO,gDAAgD,iBAAiB,OAAO,qDAAqD,8BAA8B,iBAAiB,OAAO,+CAA+C,kBAAkB,cAAc,OAAO,sDAAsD;AAC/b,cAAc,OAAO,uEAAuE,+BAA+B,cAAc,OAAO,qEAAqE,yBAAyB,qDAAQ,YAAY,eAAe,OAAO,iHAAiH,eAAe,2BAA2B;AACnb,cAAc,OAAO,uFAAuF,qBAAqB,cAAc,OAAO,wEAAwE,mFAAmF,iBAAiB,4EAA4E,eAAe;AAC7Z,cAAc,OAAO,gHAAgH,sEAAsE,oBAAoB,OAAO,uDAAuD,yBAAyB,gBAAgB,gBAAgB,gBAAgB,wBAAwB,iBAAiB,gBAAgB,gBAAgB,kCAAkC,mBAAmB,eAAe,6BAA6B,iBAAiB,UAAU,4BAA4B,GAAG,oBAAoB;AAC9lB,mBAAmB,aAAa,4CAA4C,UAAU,uBAAuB,eAAe,cAAc,qBAAqB,mDAAmD,SAAS,eAAe,eAAe,sBAAsB,gBAAgB,IAAI,qCAAqC,KAAK,qCAAqC,KAAK,2DAA2D,KAAK,mEAAmE,KAAK,iDAAiD,KAAK,8BAA8B,KAAK,gDAAgD,KAAK,qGAAqG,KAAK;AACvvB,2EAA2E,KAAK,uHAAuH,KAAK,oEAAoE,KAAK,2CAA2C,KAAK,oDAAoD,KAAK,8BAA8B,KAAK,qCAAqC,KAAK,4CAA4C;AACvf,IAAI,+DAA+D,KAAK,4DAA4D,KAAK,uDAAuD,KAAK,gCAAgC,KAAK,mCAAmC,KAAK,0CAA0C,OAAO,wEAAwE,+BAA+B,iBAAiB,KAAK,oBAAoB,SAAS;AAC7d,KAAK,KAAK,8BAA8B,KAAK,gCAAgC,KAAK,8CAA8C,EAAE,iBAAiB,IAAI,kDAAkD,KAAK,2CAA2C,EAAE,kBAAkB,6BAA6B,iCAAiC;AAC3U,gBAAgB,UAAU,mBAAmB,KAAK,sDAAsD,IAAI,gDAAgD,KAAK,kDAAkD,KAAK,mCAAmC,KAAK,qDAAqD,KAAK,8BAA8B,KAAK,iCAAiC,KAAK,4DAA4D,KAAK,6CAA6C,KAAK;AACtf,0BAA0B,KAAK,wCAAwC,KAAK,2CAA2C,SAAS,mBAAmB,KAAK,2GAA2G,SAAS,6BAA6B,KAAK,gCAAgC,KAAK,kCAAkC,KAAK,wCAAwC,KAAK,yCAAyC,KAAK,sCAAsC;AAC3f,IAAI,yHAAyH,EAAE,gBAAgB,SAAS,eAAe,SAAS,cAAc,QAAQ,aAAa,cAAc,oBAAoB,EAAE,gBAAgB,SAAS,eAAe,SAAS,cAAc,QAAQ,aAAa,cAAc,oBAAoB,EAAE,eAAe,IAAI,eAAe,IAAI,aAAa,OAAO,aAAa;AACtb,iBAAiB,yBAAyB,qFAAqF,EAAE,gBAAgB,SAAS,0CAA0C,EAAE,4BAA4B,sCAAsC,8BAA8B,WAAW,0BAA0B,YAAY,sBAAsB,gCAAgC,mBAAmB,6BAA6B,gBAAgB,GAAG,8BAA8B;AAC9e,gBAAgB,IAAI,+BAA+B,KAAK,2DAA2D,EAAE,2CAA2C,0DAA0D,gBAAgB,IAAI,+BAA+B,KAAK,2DAA2D,EAAE,2CAA2C,gBAAgB,IAAI,+BAA+B,KAAK,2DAA2D;AAC7e,kFAAkF,gBAAgB,IAAI,2DAA2D,EAAE,0DAA0D,gBAAgB,IAAI,+BAA+B,aAAa,yFAAyF,KAAK,2DAA2D,EAAE,gBAAgB,GAAG,8BAA8B;AACze,gBAAgB,GAAG,8BAA8B,EAAE;AACnD,gBAAgB,IAAI,gDAAgD,OAAO,mFAAmF,gSAAgS,8BAA8B;AAC5d,gBAAgB,GAAG,8BAA8B,EAAE,eAAe,QAAQ,8BAA8B,EAAE,gBAAgB,QAAQ,8BAA8B,EAAE,gBAAgB,QAAQ,8BAA8B,EAAE,gBAAgB,QAAQ,8BAA8B,EAAE,gBAAgB,IAAI,+BAA+B;AACrU,gBAAgB,IAAI,uBAAuB,KAAK,2CAA2C,KAAK,sBAAsB,oEAAoE,oCAAoC,EAAE,gBAAgB,OAAO,kBAAkB,SAAS,mBAAmB,SAAS,oBAAoB,EAAE,iCAAiC,6BAA6B,iBAAiB;AACnZ,YAAY,wBAAwB,qDAAQ,EAAE,qDAAQ,WAAW,qDAAQ,6BAA6B,OAAO,gBAAgB,WAAW,uKAAuK,oCAAoC,+BAA+B,kCAAkC,gCAAgC,gCAAgC;AACpd,0CAA0C,6CAA6C,mCAAmC,gGAAgG,2BAA2B,uCAAuC,qDAAQ,6BAA6B,wCAAwC,sCAAsC,iBAAiB,4EAA4E,EAAE,qDAAQ,6BAA6B;AACnhB,4BAA4B,uCAAuC,OAAO,0GAA0G,8DAA8D,EAAE,qDAAQ,4CAA4C,qDAAQ,2BAA2B,QAAQ,EAAE,qDAAqD,4DAA4D,KAAK,iIAAiI;;AAE5kB;;;;;;;;;;;;;;ACnbA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAqF;AAC3C;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,iCAAiC;AACrE;AACA;AACA;AACA,+BAA+B,uDAAQ;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,sDAAQ,EAAE,kDAAkD;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ,mDAAmD,UAAU;AAC/F,yBAAyB,oDAAM;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA,oCAAoC,iCAAiC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA,yDAAyD,sDAAQ;AACjE,4DAA4D,8BAA8B,EAAE;AAC5F;AACA,yDAAyD,kCAAkC,EAAE;AAC7F,4DAA4D,6BAA6B,EAAE;AAC3F;AACA,yDAAyD,0BAA0B,EAAE;AACrF;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAEkD;AACnD;;;;;;;;;;;;;ACvTA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAqC;AAC2D;AACuP;AACnS;AAC0B;;AAE9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,gEAAS;AACvE;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,+DAAQ;AAC3B;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+DAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uDAAM;AAC1B;AACA;AACA,UAAU,mBAAmB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA,oBAAoB,wEAAiB;AACrC,mBAAmB,mDAAI;AACvB;AACA;AACA,WAAW,qDAAM;AACjB;AACA;AACA,WAAW,KAAK;AAChB,YAAY;AACZ;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gEAAS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,WAAW,0BAA0B;AACrC,WAAW,SAAS;AACpB;AACA;AACA,IAAI,6DAAM;AACV;AACA,6BAA6B,yDAAQ;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA,0BAA0B,sDAAQ;AAClC;AACA;AACA;AACA,WAAW,UAAU;AACrB;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA,+EAA+E,sDAAQ;AACvF;AACA;AACA;AACA,WAAW,UAAU;AACrB;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA,4EAA4E,sDAAQ;AACpF;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA,wEAAwE,sDAAQ;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB;AACA;AACA,QAAQ,gEAAS;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,gEAAS;AACpF;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY;AACZ;AACA;AACA;AACA,eAAe,gEAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA,eAAe,gEAAS;AACxB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY,eAAe;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA,IAAI,6DAAM,iDAAiD;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,GAAG;AACtB;AACA;AACA;AACA,mBAAmB,GAAG;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,6CAA6C,KAAK;AAClD;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,YAAY,cAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yBAAyB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,yBAAyB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,yBAAyB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA,+BAA+B,WAAW;AAC1C;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,6BAA6B;AACjE;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,gBAAgB;AAChB;AACA;AACA;AACA,oCAAoC,yBAAyB;AAC7D;AACA;AACA;AACA,gDAAgD,iCAAiC;AACjF;AACA;AACA;AACA;AACA;AACA,2BAA2B,wBAAwB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,uBAAuB,6CAA6C;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,yDAAyD,0BAA0B;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,IAAI;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB;AACA;AACA;AACA,mBAAmB,eAAe;AAClC;AACA,mBAAmB,OAAO;AAC1B;AACA,uBAAuB,wBAAwB;AAC/C,gCAAgC,mEAAY;AAC5C;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mEAAY;AACxC;AACA;AACA;AACA;AACA,4BAA4B,mEAAY;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,mBAAmB;AACtD,wCAAwC,qBAAqB;AAC7D,uDAAuD,uCAAuC;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB;AACA;AACA,QAAQ,6DAAM;AACd,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,EAAE,qBAAqB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,sDAAQ,yCAAyC,UAAU;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,QAAQ,gBAAgB;AAC3C;AACA;AACA;AACA;AACA,iBAAiB,0BAA0B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+DAAQ;AACpB;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA,yBAAyB,kEAAW;AACpC;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,sBAAsB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,mEAAY;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,aAAa;AACxB;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA;AACA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA,wBAAwB,kEAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kEAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kEAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,kEAAW;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kEAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kEAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kEAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kEAAW;AACnC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB,QAAQ,uEAAgB;AACxB,2BAA2B,uDAAQ;AACnC;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA,QAAQ,uEAAgB;AACxB,2BAA2B,uDAAQ;AACnC;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA,QAAQ,uEAAgB;AACxB,2BAA2B,uDAAQ;AACnC;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,mBAAmB;AAClC,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB,2BAA2B,uDAAQ;AACnC;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA,2BAA2B,0BAA0B;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB,2BAA2B,uDAAQ;AACnC;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,aAAa;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB,gBAAgB;AAChB;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mCAAmC;AAC3D;AACA;AACA;AACA;AACA,mBAAmB,QAAQ;AAC3B;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,MAAM;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wCAAwC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,qEAAc;AAC5B;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA,wCAAwC,+DAAQ;AAChD;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA,IAAI,6DAAM;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB,eAAe,gCAAgC;AAC/C;AACA,eAAe,OAAO;AACtB;AACA;AACA,uCAAuC,+DAA+D;AACtG;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6BAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,GAAG;AAClB,eAAe,uBAAuB;AACtC,eAAe,QAAQ;AACvB,eAAe,oBAAoB;AACnC;AACA;AACA,0CAA0C,yBAAyB;AACnE;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,eAAe,SAAS;AACxB,eAAe,2BAA2B;AAC1C,eAAe,2BAA2B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,eAAe,SAAS;AACxB,eAAe,wBAAwB;AACvC,eAAe,wBAAwB;AACvC,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,GAAG;AACnB;AACA;AACA;AACA;AACA;AACA,gBAAgB,GAAG;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,WAAW;AAC1B,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,WAAW;AAC1B,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,eAAe;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,eAAe,WAAW;AAC1B,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,WAAW;AAC1B,gBAAgB,eAAe;AAC/B;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC,eAAe,UAAU;AACzB;AACA;AACA,+BAA+B,8BAA8B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,gBAAgB,kBAAkB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,gBAAgB,kBAAkB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,gBAAgB,GAAG;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,gBAAgB,GAAG;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,GAAG;AACnB;AACA;AACA;AACA;AACA;AACA,gBAAgB,GAAG;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,gBAAgB,4BAA4B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,+CAA+C;AACtF;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,wCAAwC;AACnD,WAAW,yBAAyB;AACpC;AACA,WAAW,yBAAyB;AACpC,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA,kCAAkC,8BAA8B,GAAG,8BAA8B;AACjG;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,wBAAwB,8DAAO;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,+DAAQ;AACvB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ,GAAG;AACrC;AACA,yBAAyB,sDAAQ,GAAG;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,0DAAG;AAC5B,wBAAwB,8DAAO;AAC/B,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,0DAAG;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,MAAM;AACrB,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA,kEAAkE,YAAY,EAAE;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,iBAAiB;AAC5B;AACA,YAAY;AACZ;AACA;AACA,8BAA8B,iBAAiB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,6DAAM;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,6FAA6F,uBAAuB,EAAE;AACtH;AACA;AACA,sFAAsF,8BAA8B,GAAG,8BAA8B;AACrJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,+DAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB;AACA,aAAa;AACb;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,WAAW;AAC1B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE;AAClB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE;AAClB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,cAAc;AAC9B;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB;AACvC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,mBAAmB;AAClC,eAAe,cAAc;AAC7B,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gEAAS;AACrB;AACA;AACA,CAAC;AACD;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC,eAAe,iBAAiB;AAChC,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,eAAe,oDAAoD;AACnE,eAAe,iBAAiB;AAChC,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,+DAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd,kDAAkD,QAAQ;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,eAAe,aAAa;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,iCAAiC;AAChD,eAAe,0BAA0B;AACzC,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC,eAAe,iBAAiB;AAChC,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oDAAoD;AACnE,eAAe,iBAAiB;AAChC,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,qCAAqC;AACpD,eAAe,QAAQ;AACvB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA,QAAQ,uEAAgB;AACxB,QAAQ,4EAAqB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,kCAAkC;AACjD;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uDAAQ;AACnC;AACA,4CAA4C,EAAE;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C,eAAe,SAAS;AACxB,gBAAgB;AAChB;AACA;AACA,+BAA+B,cAAc;AAC7C,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C,eAAe,SAAS;AACxB,gBAAgB;AAChB;AACA;AACA,+BAA+B,cAAc;AAC7C,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,uEAAuE;AACvE,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,0BAA0B;AACzC,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA,YAAY,uEAAgB;AAC5B;AACA,YAAY,4EAAqB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,kEAAW;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,+BAA+B;AAC1C,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,IAAI,6DAAM;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA,IAAI,6DAAM;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC;AACvC;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,yBAAyB;AACxC,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA,YAAY,6DAAM;AAClB,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,wCAAwC;AACvD;AACA;AACA,kCAAkC,4BAA4B;AAC9D;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB;AACpC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,aAAa;AACzE;AACA;AACA,eAAe,MAAM;AACrB,eAAe,oBAAoB;AACnC;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB,EAAE;AAClB;AACA;AACA,gFAAgF,aAAa,EAAE;AAC/F;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,GAAG;AAClB,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB,GAAG;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,eAAe;AAC9B,gBAAgB,eAAe;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yCAAyC;AACxD,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,yCAAyC;AACxD,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,qBAAqB;AACpC,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,WAAW,MAAM;AACjB;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,WAAW,MAAM;AACjB,WAAW,uBAAuB;AAClC;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,WAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,6DAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,qEAAc;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB;AACA;AACA,iDAAiD,gCAAgC;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,iBAAiB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B;AACA;AACA,QAAQ,6DAAM;AACd,QAAQ,6DAAM;AACd;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,WAAW;AAC1B,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6DAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6DAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qEAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,WAAW;AAC1B,eAAe,iBAAiB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,MAAM;AACjE;AACA;AACA,2BAA2B,MAAM;AACjC;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB,eAAe,cAAc;AAC7B,eAAe,qBAAqB;AACpC,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6DAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,6DAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,eAAe,QAAQ;AACvB,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB,eAAe,sBAAsB;AACrC,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,sBAAsB;AACrC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB,eAAe,uBAAuB;AACtC,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,eAAe,QAAQ;AACvB,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB,eAAe,yBAAyB;AACxC,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB,eAAe,cAAc;AAC7B,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,6DAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,MAAM;AACrB,eAAe,4BAA4B;AAC3C,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,QAAQ;AACvB,eAAe,iBAAiB;AAChC,eAAe,4BAA4B;AAC3C,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA,gEAAgE,kCAAkC,EAAE;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA,kBAAkB,qEAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,WAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,OAAO;AACtB,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,2BAA2B,qCAAqC;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,MAAM;AACrB,eAAe,mBAAmB;AAClC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E;AAC9E;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA,SAAS;AACT;AACA,YAAY,6DAAM;AAClB;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA,8BAA8B,sDAAQ,sCAAsC,UAAU;AACtF;AACA;AACA;AACA;AACA,2BAA2B,QAAQ,gBAAgB;AACnD;AACA;AACA;AACA;AACA,yBAAyB,0BAA0B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,mBAAmB;AAClC,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,eAAe,QAAQ;AACvB,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,MAAM;AAC7B,uBAAuB,MAAM;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,mBAAmB;AAClC,eAAe,OAAO;AACtB,iBAAiB,iDAAiD;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,sDAAQ,uCAAuC,UAAU;AACvF,6BAA6B,oDAAM;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ,gBAAgB;AACnD;AACA;AACA;AACA;AACA,yBAAyB,0BAA0B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ,sCAAsC,UAAU;AAClF;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ,sCAAsC,UAAU;AAClF;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ,sCAAsC,UAAU;AAClF;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,eAAe;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6DAAM;AACtB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,wBAAwB;AACvC,eAAe,QAAQ;AACvB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA,uBAAuB,4BAA4B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,gBAAgB;AAC/B,eAAe,SAAS;AACxB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,cAAc;AAC7B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,QAAQ;AACvB,eAAe,WAAW;AAC1B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,8DAAO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,qEAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,WAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,gBAAgB;AAC/B,eAAe,SAAS;AACxB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,WAAW;AAC1B,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,WAAW;AAC1B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gBAAgB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,qBAAqB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8GAA8G,wBAAwB,EAAE;AACxI;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,aAAa;AACb,2BAA2B,0BAA0B;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,YAAY;AAC5C,aAAa,+DAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,eAAe,+DAAQ;AACvB;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,sDAAQ,GAAG;AAC/B;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,+DAAQ;AACrC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA,uBAAuB,0BAA0B;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,eAAe,yBAAyB;AACxC;AACA;AACA;AACA;AACA;AACA,uBAAuB,6BAA6B;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,WAAW,MAAM;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,yBAAyB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,KAAK;AACpB;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA,4BAA4B,sDAAQ;AACpC,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,uCAAuC;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA,SAAS;AACT;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sEAAe;AAC5B;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,WAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,uBAAuB;AACvD;AACA;AACA,yBAAyB,oDAAM;AAC/B;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,gCAAgC,uBAAuB;AACvD;AACA;AACA,yBAAyB,oDAAM;AAC/B;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gEAAS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,sBAAsB,gEAAS;AAC/B;AACA;AACA;AACA,yBAAyB,mEAAY;AACrC;AACA;AACA;AACA;AACA;AACA,uBAAuB,qBAAqB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA,YAAY,gEAAS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA,4BAA4B,gEAAS;AACrC;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,gEAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,gBAAgB;AACjE;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,sCAAsC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,YAAY;AAC3B;AACA;AACA;AACA,YAAY,gEAAS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,QAAQ;AACvB;AACA,eAAe,QAAQ;AACvB,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,aAAa,gEAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gEAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,GAAG,QAAQ,GAAG;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,+DAAQ;AACnC;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,sBAAsB,gEAAS;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,qBAAqB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,sDAAQ,kDAAkD,UAAU;AAClG;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ,gBAAgB;AACnD;AACA;AACA;AACA;AACA,yBAAyB,0BAA0B;AACnD;AACA;AACA;AACA;AACA,gBAAgB,8DAA8D;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,yDAAyD;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,aAAa,eAAe,EAAE,EAAE;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,aAAa,qBAAqB,EAAE,EAAE;AACxE;AACA;AACA;AACA,yBAAyB,aAAa,2BAA2B,EAAE,EAAE;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,qCAAqC;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,aAAa,eAAe,EAAE,EAAE;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB,eAAe,0BAA0B;AACzC,eAAe,QAAQ;AACvB;AACA,iFAAiF;AACjF;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB,eAAe,0BAA0B;AACzC,eAAe,QAAQ;AACvB;AACA,mFAAmF;AACnF;AACA;AACA,eAAe,OAAO;AACtB;AACA,iEAAiE;AACjE;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB,eAAe,0BAA0B;AACzC;AACA,uFAAuF;AACvF;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB,eAAe,0BAA0B;AACzC;AACA,yFAAyF;AACzF;AACA,eAAe,OAAO;AACtB,eAAe,0BAA0B;AACzC;AACA,oFAAoF;AACpF;AACA,eAAe,mBAAmB;AAClC;AACA,4DAA4D;AAC5D;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD,+CAA+C;AAC/C;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,uDAAS;AACb;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,gEAAS;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,kBAAkB,gEAAS;AAC3B,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,sDAAsD,+DAAQ;AAC9D;AACA,2BAA2B,8DAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,eAAe,EAAE;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8DAAO;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,oEAAa;AAC1C,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,wCAAwC,gEAAS;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gEAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6DAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,8DAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,0BAA0B;AAC5D;AACA;AACA,uBAAuB,kCAAkC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,6BAA6B,EAAE;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ,wCAAwC,UAAU;AACpF;AACA;AACA,iDAAiD,sDAAQ,oCAAoC,UAAU;AACvG;AACA;AACA;AACA;AACA,+BAA+B,QAAQ,gBAAgB;AACvD;AACA;AACA;AACA;AACA,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA,uBAAuB,kCAAkC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gEAAS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sEAAe;AAC3B;AACA;AACA,iBAAiB,oEAAa;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,uDAAS;AACb;AACA,eAAe,UAAU;AACzB,eAAe,sCAAsC;AACrD,eAAe,kBAAkB;AACjC,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8DAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,oBAAoB;AACnC,eAAe,uBAAuB;AACtC;AACA;AACA;AACA;AACA,+CAA+C,4BAA4B;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kEAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,+DAAQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gEAAS;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,4FAA4F,uDAAuD,EAAE;AACrJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,aAAa;AACb,wCAAwC;AACxC,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,0DAAG,uBAAuB,4BAA4B,EAAE;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,0DAAG,uBAAuB,4BAA4B,EAAE;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,gDAAgD;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,YAAY,8DAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,mBAAmB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,qCAAqC,qBAAqB;AAC1D;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,eAAe,aAAa;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,eAAe,aAAa;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,6BAA6B;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,eAAe,qBAAqB;AACpC,eAAe,wBAAwB;AACvC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,yBAAyB;AAC5D;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,SAAS;AACxB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,SAAS;AACxB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA;AACA,sCAAsC,gEAAS;AAC/C;AACA,0CAA0C,gEAAS;AACnD;AACA,qDAAqD,gEAAS;AAC9D;AACA;AACA;AACA,wCAAwC,gEAAS;AACjD;AACA,mDAAmD,gEAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,WAAW;AAC5B;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA,iBAAiB,WAAW;AAC5B;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA,QAAQ,uEAAgB;AACxB,2BAA2B,uDAAQ;AACnC;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA,2BAA2B,0BAA0B;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB,2BAA2B,uDAAQ;AACnC;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,mBAAmB;AAClC,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA,2BAA2B,uDAAQ;AACnC;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,4CAA4C;AAC3D,eAAe,SAAS;AACxB,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA,QAAQ,uEAAgB;AACxB,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uDAAQ;AACnC;AACA,gDAAgD,EAAE;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA,QAAQ,uEAAgB;AACxB,2BAA2B,uDAAQ;AACnC;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,kBAAkB;AACjC,gBAAgB;AAChB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,gBAAgB,EAAE;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,EAAE;AACzC;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,MAAM;AACrB,eAAe,UAAU;AACzB;AACA;AACA,+BAA+B,YAAY;AAC3C,iCAAiC,gBAAgB;AACjD,+BAA+B,wBAAwB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,8DAAO;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,GAAG;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,SAAS;AACxB;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,2CAA2C;AAC9E;AACA,eAAe,SAAS;AACxB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA,0BAA0B,+DAAQ;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AAC/C;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,0CAA0C;AACrD,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+DAAQ;AACpB;AACA,8BAA8B,8DAAO;AACrC,YAAY,6DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,mBAAmB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,gBAAgB;AAC3B,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4BAA4B;AACvC;AACA;AACA;AACA;AACA;AACA,0BAA0B,mCAAmC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd,yDAAyD,qDAAqD,EAAE;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,qBAAqB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA,oEAAoE,MAAM;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,kBAAkB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,kBAAkB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,MAAM;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+DAAQ;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,6CAA6C,MAAM;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,YAAY,6BAA6B;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4BAA4B;AACvC,YAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,WAAW,4BAA4B;AACvC,WAAW,oBAAoB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,WAAW,6BAA6B;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,qBAAqB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,WAAW,4BAA4B;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA,gBAAgB,6DAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6DAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,iBAAiB;AAClE;AACA,sDAAsD,6BAA6B,EAAE;AACrF;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,uBAAuB,EAAE;AAC7D;AACA;AACA,uCAAuC,4CAA4C,EAAE;AACrF;AACA;AACA;AACA;AACA;AACA,mCAAmC,+CAA+C,EAAE;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F;AAC1F,8EAA8E;AAC9E;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ,2CAA2C,UAAU;AACvF;AACA;AACA,iDAAiD,sDAAQ,qDAAqD,UAAU;AACxH;AACA;AACA;AACA;AACA,+BAA+B,QAAQ,gBAAgB;AACvD;AACA;AACA;AACA;AACA,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ,2CAA2C,UAAU;AACvF;AACA;AACA,iDAAiD,sDAAQ,qDAAqD,UAAU;AACxH;AACA;AACA;AACA;AACA,+BAA+B,QAAQ,gBAAgB;AACvD;AACA;AACA;AACA;AACA,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA,uBAAuB,8DAAO;AAC9B;AACA,yBAAyB,8DAAO;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,aAAa;AAC5B,gBAAgB,MAAM;AACtB;AACA;AACA,uBAAuB,8DAAO;AAC9B;AACA;AACA;AACA;AACA,mBAAmB,8DAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,QAAQ,uDAAS;AAClD,uBAAuB,yDAAW;AAClC;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB,WAAW;AAC3B;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA,QAAQ,uEAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,4DAAQ,sBAAsB,sEAAkB;AAC3E,kCAAkC,6DAAS,+BAA+B,uBAAuB,EAAE;AACnG;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,YAAY;AACvB;AACA;AACA;AACA,2BAA2B,gBAAgB;AAC3C;AACA;AACA,WAAW,EAAE;AACb,WAAW,YAAY;AACvB;AACA;AACA;AACA,8BAA8B,UAAU;AACxC;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,6DAAS;AACrE;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,QAAQ,gEAAS;AACjB;AACA;AACA;AACA,iBAAiB,qDAAQ;;AAEuF;AAChH;;;;;;;;;;;;;;AC9leA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA8F;;AAEhE;;AAEgC;;AAEyF;;AAEZ;;AAEtF;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,uDAAC;AACZ,CAAC,iBAAiB,uDAAC;;AAEnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD,sBAAsB,yDAAC;AACvB;AACA,yBAAyB,4DAAC;AAC1B;AACA;;AAEA;AACA,2BAA2B,sBAAsB;AACjD,sBAAsB,yDAAC;AACvB;AACA,yBAAyB,4DAAC;AAC1B;AACA;;AAEA;AACA,2BAA2B,sBAAsB;AACjD,sBAAsB,yDAAC;AACvB;AACA,wBAAwB,4DAAC;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E;AAC1E;AACA,mBAAmB,OAAO;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,eAAe,6BAA6B,cAAc;AACnE;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mCAAmC,cAAc;AACjD;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,sFAAsF;AACtF;AACA;AACA,yDAAyD,cAAc;AACvE;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,cAAc;AAC9D;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,cAAc;AACrC;AACA;AACA,KAAK;AACL;AACA,kCAAkC,cAAc;AAChD;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,uBAAuB,iBAAiB;AACxC;AACA,KAAK;AACL;AACA,uBAAuB,iBAAiB;AACxC;AACA,KAAK;AACL,mDAAmD,OAAO;AAC1D,KAAK;AACL;AACA,KAAK;AACL,yDAAyD,OAAO;AAChE;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,sBAAsB;AACrD;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,SAAS,cAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB,sBAAsB;AACzC;AACA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,+BAA+B,QAAQ;AACvC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,iCAAiC,QAAQ;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS,MAAM,qBAAqB;AACpC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,QAAQ,gCAAgC,uBAAuB,QAAQ;AAC5G;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,gEAAgE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,wCAAwC,QAAQ;AAChD;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,iEAAiE,QAAQ;AACzE,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,2BAA2B,sBAAsB;AACjD,kCAAkC,cAAc;AAChD;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,iDAAiD,QAAQ;AACzD;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,uBAAuB,cAAc;AACrC;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA,+CAA+C,cAAc;AAC7D;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4IAA4I;AAC5I;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,EAAE;;AAE3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,+DAA+D,8BAA8B;AAC7F;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,mEAAmE,8BAA8B;AACjG;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,kCAAkC,wCAAwC;AAC1E;AACA;AACA;AACA;AACA;AACA,2BAA2B,8BAA8B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,4DAA4D,cAAc;AAC1E;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,kBAAkB,gDAAgD,SAAS,cAAc;AACzF;AACA;AACA;AACA,qBAAqB;AACrB,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG;AAClG;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;AACD;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;;AAED;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK,wBAAwB,cAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;;AAED;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK,wBAAwB,cAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,cAAc;AACtD;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,0CAA0C,cAAc;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,cAAc;AACtE;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;;AAED;AACA;AACA;;AAEA;AACA,kCAAkC,8BAA8B;AAChE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;AACD;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,kBAAkB;AACzD;AACA;AACA;AACA,4CAA4C;AAC5C,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,oCAAoC,kBAAkB;AACtD;AACA;AACA;AACA;AACA;AACA,8DAA8D;AAC9D;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,kCAAkC,cAAc;AAChD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,8FAA8F,mCAAmC,IAAI,0DAA0D;AAC/L,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kCAAkC,cAAc;AAChD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF;AACvF,6CAA6C,cAAc;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iIAAiI;AACjI;AACA;AACA,qCAAqC,cAAc;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF;AAChF;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,YAAY;AACjB;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,sCAAsC,cAAc;AACpD;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;AACA,0CAA0C,cAAc;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uDAAC;AACnB;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC,eAAe;;AAEhB;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,0BAA0B,uBAAuB;AACjD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS,eAAe,cAAc;AACtC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4DAAC;AACvB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,4DAAC;AACzB;AACA,yCAAyC,WAAW,gBAAgB;AACpE;AACA,6CAA6C,aAAa;AAC1D;AACA,8CAA8C;AAC9C;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,yBAAyB;AACzB;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,qBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;AACA,+BAA+B,yDAAC;AAChC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,eAAe,wBAAwB;;AAExE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,2BAA2B;AAC3B;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA,kBAAkB,4DAAC;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,oCAAoC,cAAc;AAClD;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,qCAAqC,cAAc;AACnD;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA;AACA,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,4CAA4C,cAAc;AAC1D;AACA;AACA,4CAA4C,cAAc;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2CAA2C,cAAc;AACzD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,cAAc;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oHAAoH,mCAAmC;AACvJ;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA,oDAAoD,cAAc;AAClE;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,uDAAC;AACxB;AACA,2BAA2B,yDAAC;AAC5B;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA,sCAAsC;AACtC;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK,gCAAgC,iCAAiC;AACtE,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,2BAA2B;AAC5D;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,cAAc;AAC7D;AACA;AACA;AACA;AACA,kDAAkD,cAAc;AAChE;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,cAAc;AAC9D;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,oFAAoF;AACpF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,kCAAkC,cAAc;AAChD;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,kCAAkC,cAAc;AAChD;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,sCAAsC,cAAc,gDAAgD,cAAc;AAClH;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL,wCAAwC,cAAc,yCAAyC,cAAc;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA,6DAA6D,cAAc;AAC3E;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,yEAAyE;AACzE;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,mBAAmB,uDAAC;AACpB;AACA,uBAAuB,yDAAC;AACxB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,gGAAgG;AAChG;AACA,2FAA2F;AAC3F;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,0CAA0C,yDAAC;AAC3C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;;AAEA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,OAAO;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA,aAAa,iBAAiB,cAAc;AAC5C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,4CAA4C,cAAc;AAC1D;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,gCAAgC,oBAAoB;AACpD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,kBAAkB,EAAE;AACpB,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,WAAW,uDAAC;AACZ;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mCAAmC,mDAAmD;AACtF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE;AACrE,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,SAAS,4DAAC,CAAC,4DAAC,CAAC,4DAAC;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,kCAAkC,cAAc;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uDAAC;AACpB,uBAAuB,yDAAC;AACxB;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uDAAC;AACpB,uBAAuB,yDAAC;AACxB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uDAAC;AACpB,uBAAuB,yDAAC;AACxB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;AACrB;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,cAAc;AAC/E;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA,SAAS;AACT,KAAK;AACL,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,qBAAqB;AACrB;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,eAAe,yDAAC;AAChB;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD,oDAAoD;AACpD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,gCAAgC;AACrC;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS,iBAAiB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK,gCAAgC,gCAAgC;AACrE,CAAC;AACD;AACA;AACA;AACA,gFAAgF;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,mBAAmB,uDAAC;AACpB,uBAAuB,yDAAC;AACxB;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,yBAAyB;AAC1C;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL,CAAC,eAAe;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uDAAC;AACpB,uBAAuB,yDAAC;AACxB;AACA;AACA;AACA;AACA,mCAAmC,uDAAC;AACpC;AACA,uCAAuC,yDAAC;AACxC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iCAAiC;AACjC,6BAA6B;AAC7B,yBAAyB;;AAEzB;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,WAAW,uDAAC;AACZ,eAAe,yDAAC;AAChB;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,2BAA2B,uDAAC;AAC5B;AACA,+BAA+B,yDAAC;AAChC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,2BAA2B,uDAAC;AAC5B,+BAA+B,yDAAC;AAChC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,WAAW,uDAAC;AACZ,eAAe,yDAAC;AAChB;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA,4CAA4C,cAAc;AAC1D;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ,eAAe,yDAAC;AAChB;AACA;AACA;AACA,2BAA2B,uDAAC;AAC5B;AACA,+BAA+B,yDAAC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS,4CAA4C,0BAA0B;AAC/E;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,gCAAgC;AACzC;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uDAAC;AAChC;AACA,mCAAmC,yDAAC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;;AAErC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,gDAAgD,cAAc;AAC9D;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,yBAAyB;AACzB;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAoC,cAAc;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,oCAAoC;AAC9C;AACA;AACA;AACA;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;AACA,2BAA2B,uDAAC;AAC5B;AACA,+BAA+B,yDAAC;AAChC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA,6CAA6C;AAC7C,yCAAyC;AACzC,qCAAqC;AACrC,iCAAiC;;AAEjC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kDAAkD,cAAc;AAChE;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uDAAC;AAC5B;AACA,+BAA+B,yDAAC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA,yCAAyC,cAAc;AACvD;AACA;AACA,4EAA4E,cAAc;AAC1F;AACA;AACA;AACA;AACA,8DAA8D,cAAc;AAC5E;AACA;AACA,4EAA4E,cAAc;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,qCAAqC;AACrC,iCAAiC;;AAEjC;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,4CAA4C,cAAc;AAC1D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA,WAAW,uDAAC;AACZ;AACA,eAAe,yDAAC;AAChB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,2BAA2B,yDAAC;AAC5B;AACA;AACA;AACA;AACA;AACA,6BAA6B;;AAE7B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,kFAAkF,yDAAC;AACnF;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,sBAAsB,yDAAC;AACvB;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,8BAA8B,cAAc;AAC5C;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS,QAAQ;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,wBAAwB,kEAAC;AACzB,yBAAyB,sEAAC;AAC1B;AACA;AACA,2BAA2B,sEAAC;AAC5B;AACA;AACA;;AAEA,2BAA2B,sEAAC;AAC5B;AACA;;AAEA,2BAA2B,sEAAC;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,6BAA6B;AAC7B,yBAAyB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT,KAAK;AACL,2FAA2F,8FAAC;AAC5F;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,sEAAC,MAAM,oEAAC,MAAM,iEAAC,MAAM,2DAAC,MAAM,4DAAC,MAAM,yEAAC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,uEAAC;AAClB;AACA,SAAS,MAAM,uEAAC;AAChB;AACA,SAAS,MAAM,uEAAC;AAChB;AACA,SAAS,MAAM,uEAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,oCAAoC,cAAc;AAClD;AACA;AACA,KAAK;AACL;AACA,oCAAoC,cAAc;AAClD;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA;AACA,+BAA+B,uDAAC;AAChC,mCAAmC,yDAAC;AACpC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,cAAc;AACjC;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,sBAAsB;AACrD;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,WAAW,uDAAC;AACZ,iNAAiN,WAAW;AAC5N;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,mDAAmD;AACnD,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL,oEAAoE;AACpE;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,sCAAsC,sBAAsB;AAC5D,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA,yDAAyD;AACzD,kDAAkD,cAAc;AAChE;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB,cAAc;AACjC;AACA;AACA,kDAAkD,QAAQ;AAC1D;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,cAAc;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,4DAAC;AAC/C,aAAa;AACb;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;AACA,+BAA+B,uDAAC;AAChC;AACA,mCAAmC,yDAAC;AACpC;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,qCAAqC;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD,yEAAyE;AACzE,6CAA6C;AAC7C;AACA;AACA;AACA,6CAA6C;AAC7C,yCAAyC;AACzC;AACA,qCAAqC;AACrC;AACA;AACA,qCAAqC;AACrC;AACA,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,+BAA+B,uDAAC;AAChC;AACA,mCAAmC,yDAAC;AACpC;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,qCAAqC;;AAErC;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK,gCAAgC;AACrC,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,mBAAmB,uDAAC;AACpB;AACA,uBAAuB,yDAAC;AACxB;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;AACrB;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uDAAC;AAC5B;AACA,+BAA+B,yDAAC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uDAAC;AAChC,mCAAmC,yDAAC;AACpC;AACA;AACA;;AAEA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,uBAAuB,uDAAC;AACxB;AACA,2BAA2B,yDAAC;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,mBAAmB,uDAAC;AACpB;AACA,uBAAuB,yDAAC;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,uDAAC;AACxB;AACA,2BAA2B,yDAAC;AAC5B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,6BAA6B;;AAE7B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb;AACA,KAAK;AACL,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA,mCAAmC,uDAAC;AACpC;AACA,uCAAuC,yDAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C,yCAAyC;;AAEzC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iCAAiC;AACjC,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;AACrB;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL,sCAAsC,GAAG,uDAAC;AAC1C;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,6BAA6B;AAC7B;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL,eAAe,uDAAC;AAChB;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA,mCAAmC,uDAAC;AACpC;AACA,uCAAuC,yDAAC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iCAAiC;AACjC,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;AACrB;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL,sCAAsC,GAAG,uDAAC;AAC1C;AACA,mBAAmB,yDAAC;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC,iCAAiC;AACjC;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,6BAA6B;AAC7B;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,uBAAuB,uDAAC;AACxB;AACA,2BAA2B,yDAAC;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,cAAc;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,6BAA6B;;AAE7B;AACA;AACA;AACA;AACA,6BAA6B;;AAE7B;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,mBAAmB,uDAAC;AACpB,uBAAuB,yDAAC;AACxB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA,uBAAuB,uDAAC;AACxB,2BAA2B,yDAAC;AAC5B;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,cAAc;AACjF;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,+BAA+B;AAC/B;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,iEAAiE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,mBAAmB,uDAAC;AACpB;AACA,uBAAuB,yDAAC;AACxB;AACA;AACA;AACA,mCAAmC,uDAAC;AACpC;AACA,uCAAuC,yDAAC;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA,iCAAiC;AACjC,6BAA6B;AAC7B,yBAAyB;;AAEzB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,uDAAC;AACxB,2BAA2B,yDAAC;AAC5B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL,eAAe,uDAAC;AAChB,mBAAmB,yDAAC;AACpB;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL,qCAAqC,sBAAsB;AAC3D;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,qCAAqC,sBAAsB;AAC3D;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL,kCAAkC,sBAAsB;AACxD;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,kDAAkD,sBAAsB;AACxE;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,KAAK;AACL;AACA,mCAAmC;AACnC;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,cAAc;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,cAAc;AAChE;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL,+BAA+B,sBAAsB;AACrD;AACA;AACA;AACA,KAAK;AACL,+BAA+B,sBAAsB;AACrD;AACA;AACA;AACA,KAAK;AACL,+BAA+B,sBAAsB;AACrD;AACA;AACA;AACA,KAAK;AACL,+BAA+B,sBAAsB;AACrD;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,kDAAkD,sBAAsB;AACxE,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,0IAA0I,8BAA8B;AACxK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAC;AACZ;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,+BAA+B,sBAAsB;AACrD;AACA;AACA,kDAAkD,eAAe,KAAK;AACtE,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,sBAAsB;AACzD;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL,+BAA+B,sBAAsB;AACrD;AACA,mCAAmC,sBAAsB;AACzD;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,6DAAC;AAC1C;AACA;AACA,aAAa;AACb,SAAS,0DAA0D;AACnE,KAAK;AACL;;AAEA,GAAG,qDAAC;;AAEyC;AAC7C;;;;;;;;;;;;;;ACjjfA;AAAA;AAAA;AAAA;AAAqC;AACqB;AACV;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,iBAAiB;AAChE;AACA;AACA,SAAS;AACT;AACA,qDAAqD,4BAA4B,EAAE;AACnF;AACA,aAAa;AACb;AACA;AACA,+DAA+D,sCAAsC,EAAE;AACvG;AACA,aAAa;AACb;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,uDAAS;AACxB,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,yDAAyD;AACxG;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,uBAAuB;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,wBAAwB,EAAE;AACpE;AACA;AACA,iDAAiD,wBAAwB,EAAE;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,wBAAwB,EAAE;AACpE;AACA;AACA,iDAAiD,wBAAwB,EAAE;AAC3E;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,uCAAuC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,oBAAoB;AACnE;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,6DAAS;AACrD;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAQ;AAC1B,qDAAQ;AACR;;;;;;;;;;;;;ACzpBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAqC;AACW;AAC6B;AAChB;AAChC;;AAE7B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC,0GAA0G,WAAW;AACrH;AACA;AACA,kDAAkD,aAAa,6BAA6B,YAAY,EAAE,cAAc,GAAG,eAAe;AAC1I;AACA;AACA;AACA,wBAAwB,2DAAY;AACpC;AACA;AACA,6BAA6B,4DAAa;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,iCAAiC,EAAE;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,sDAAQ;AAC7D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,GAAG;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,sDAAQ,gDAAgD,qBAAqB;AAC5G;AACA;AACA;AACA;AACA,mBAAmB,QAAQ,gBAAgB;AAC3C;AACA;AACA;AACA;AACA,iBAAiB,0BAA0B;AAC3C;AACA;AACA;AACA;AACA;AACA,6BAA6B,qBAAqB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kDAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,iCAAiC,EAAE;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,sBAAsB;AACxD,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,sDAAQ,CAAC,sDAAQ,GAAG,cAAc,aAAa,qCAAqC,EAAE;AACzG;AACA;AACA,KAAK;AACL;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,sDAAQ,CAAC,sDAAQ,GAAG,uBAAuB,uBAAuB;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,sDAAQ,CAAC,sDAAQ,GAAG,uBAAuB,aAAa,qCAAqC,EAAE;AAC9I;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sDAAQ,CAAC,sDAAQ,GAAG,cAAc,iCAAiC;AAC9E;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,sBAAsB;AACxD,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,iCAAiC,EAAE;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sDAAQ,mDAAmD,sBAAsB;AACjH;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,QAAQ,gBAAgB;AAC3C;AACA;AACA;AACA;AACA,iBAAiB,0BAA0B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,6DAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,4BAA4B,EAAE;AAC9D;AACA;AACA,aAAa;AACb,iCAAiC,yCAAyC,EAAE;AAC5E;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,sBAAsB,qDAAQ;;AAEG;AACjC;;;;;;;;;;;;;ACjzCA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA,+DAA+D;AAC/D;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iDAAiD,QAAQ;AACzD,wCAAwC,QAAQ;AAChD,wDAAwD,QAAQ;AAChE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4BAA4B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,uBAAuB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,4CAA4C,YAAY,EAAE;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,6CAA6C,yBAAyB;AACtE;AACA;AACA;AACA;;AAE4D;AAC5D;;;;;;;;;;;;;AC9RA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAiC;AACe;AACF;AAC+B;AACtC;AACF;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB,0GAA0G,WAAW;AACrH;AACA;AACA;AACA;AACA;AACA,yIAAyI,qBAAqB;AAC9J,wHAAwH,WAAW;AACnI;AACA;AACA,yBAAyB,WAAW;AACpC,iHAAiH,WAAW;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,2DAAY;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kCAAkC;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,sDAAQ;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,gBAAgB,EAAE;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,kDAAM,6CAA6C,QAAQ,uDAAS;AAC7G;AACA;AACA,mCAAmC,yDAAW;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB,EAAE,EAAE;AAC7B;AACA;AACA;AACA;AACA,yCAAyC,oDAAQ;AACjD;AACA;AACA;AACA,yCAAyC,oDAAQ;AACjD;AACA;AACA,yCAAyC,oDAAQ;AACjD;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kDAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,sDAAQ,CAAC,sDAAQ,GAAG,kBAAkB,8CAA8C;AAC9H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA,iCAAiC,sDAAQ,GAAG;AAC5C;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uDAAS;AACpB;AACA;AACA,eAAe,yDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA,4CAA4C,sDAAQ,mDAAmD,sBAAsB;AAC7H;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,QAAQ,gBAAgB;AAC3D;AACA;AACA;AACA;AACA,iCAAiC,0BAA0B;AAC3D;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sDAAQ,mDAAmD,sBAAsB;AACjH;AACA;AACA;AACA;AACA,mBAAmB,QAAQ,gBAAgB;AAC3C;AACA;AACA;AACA;AACA,iBAAiB,0BAA0B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2FAA2F;AAC3F;AACA;AACA,4EAA4E;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,uDAAS;AACxB,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,uDAAS;AACxB,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,uDAAS;AACxB,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,4CAA4C,kBAAkB;AAC9D,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,kBAAkB;AAC9D,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sDAAQ,mDAAmD,sBAAsB;AACjH;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,QAAQ,gBAAgB;AAC3C;AACA;AACA;AACA;AACA,iBAAiB,0BAA0B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAQ,gCAAgC,6DAAS;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC9rDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAqC;AACJ;AACgB;AAC8C;AAC3C;AACJ;;AAEhD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC,6DAA6D,WAAW;AACxE,6DAA6D,WAAW;AACxE,mFAAmF,WAAW;AAC9F,gFAAgF,WAAW;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,eAAe;AAChG,oFAAoF,gBAAgB;AACpG,6FAA6F,kBAAkB;AAC/G;AACA;AACA,wBAAwB,2DAAY;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uDAAM;AAC9B,yBAAyB,yDAAQ;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,2EAAoB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,gBAAgB;AACpE;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,0BAA0B,0BAA0B;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0CAA0C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,4BAA4B,EAAE;AAC/D;AACA,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,mDAAmD;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,wBAAwB,EAAE;AACrD,8BAA8B,uBAAuB,EAAE;AACvD,2BAA2B,qCAAqC,EAAE,eAAe,qCAAqC,EAAE;AACxH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,iBAAiB,4DAAc;AAC/B;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA,KAAK,EAAE,EAAE;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4DAAc;AAC9B;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,4DAAc;AAClC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,4DAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,4BAA4B,EAAE,eAAe,4BAA4B,EAAE;AAChI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,sCAAsC,EAAE;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,wDAAwD,EAAE;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gBAAgB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,oCAAoC,sDAAQ,GAAG;AAC/C;AACA;AACA,+DAA+D,gBAAgB;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,kBAAkB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sDAAQ,GAAG;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,yCAAyC,EAAE;AAClH;AACA;AACA;AACA,iFAAiF,oDAAoD,EAAE;AACvI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,yBAAyB,EAAE;AACvD,4BAA4B,+BAA+B,EAAE;AAC7D,4BAA4B,gCAAgC,EAAE;AAC9D;AACA;AACA;AACA;AACA,6CAA6C,yBAAyB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gFAAyB;AACrC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,6DAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,oBAAoB,qDAAQ;;AAEG;AAC/B;;;;;;;;;;;;;ACz6CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAqC;AACJ;AACwB;AAC4B;AACjC;AACJ;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,yBAAyB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6CAA6C;AACrD;AACA,oDAAoD,oCAAoC;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA,iGAAiG,sBAAsB;AACvH,oGAAoG,sBAAsB;AAC1H,kGAAkG,sBAAsB;AACxH,2GAA2G,sBAAsB;AACjI;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA,8EAA8E,uBAAuB;AACrG;AACA,2BAA2B,sBAAsB;AACjD,uGAAuG,YAAY;AACnH;AACA,wBAAwB,2DAAY;AACpC;AACA;AACA,wBAAwB,4DAAa;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,wBAAwB;AACzF;AACA;AACA,uCAAuC,+BAA+B;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,8BAA8B,WAAW,wBAAwB;AACnF;AACA,kBAAkB,4BAA4B,WAAW,oBAAoB;AAC7E;AACA,kBAAkB,6BAA6B;AAC/C;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,+CAA+C,qDAAqD;AACpG;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,mBAAmB,EAAE;AACzE;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,mCAAmC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C,uDAAuD;AACvD;AACA;AACA;AACA,QAAQ,0HAA0H;AAClI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,yDAAQ;AAChD;AACA;AACA,wCAAwC,yDAAQ;AAChD;AACA;AACA,wCAAwC,yDAAQ;AAChD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,kBAAkB,qCAAqC;AACvD,QAAQ,qCAAqC;AAC7C,QAAQ,oCAAoC;AAC5C;AACA;AACA,eAAe,uDAAS;AACxB;AACA;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA,gDAAgD,QAAQ,uDAAS;AACjE,mCAAmC,yDAAW;AAC9C;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB,EAAE,EAAE;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,uDAAS;AACxB,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B,WAAW;AACrC,0BAA0B,WAAW;AACrC,uBAAuB,sDAAQ,CAAC,sDAAQ,GAAG;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,iBAAiB,OAAO,oBAAoB;AAC1F;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,uDAAuD;AACvD,iCAAiC;AACjC;AACA;AACA;AACA,sCAAsC,iCAAiC;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,gCAAgC;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA,6BAA6B;AAC7B;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,uDAAS;AACxB;AACA;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA,6BAA6B;AAC7B;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,eAAe,uDAAS;AACxB;AACA;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA,6BAA6B;AAC7B;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA,uBAAuB,4DAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,6EAAsB;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,6DAAS;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uDAAM;AAC/B;AACA;AACA,0BAA0B,yDAAQ;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,qDAAQ;;AAEG;AAChC;;;;;;;;;;;;;AC3oCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAqC;AACqC;AAC3B;AACC;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAI,uDAAS;AACb;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,4DAAa;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F;AAC/F;AACA;AACA;AACA,6CAA6C;AAC7C;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8BAA8B;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,+BAA+B,kBAAkB;AACjD;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA,mCAAmC;AACnC;AACA,aAAa,2DAA2D;AACxE;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,6BAA6B,EAAE;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,mBAAmB;AAC/D;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,gBAAgB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,gBAAgB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mCAAmC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA,4CAA4C,uCAAuC,EAAE;AACrF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,8CAA8C,EAAE;AAChD;AACA;AACA;AACA;AACA,kCAAkC,mDAAmD;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,2BAA2B;AAC3D;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,oBAAoB,EAAE;AACvF;AACA;AACA,eAAe,uDAAS;AACxB;AACA;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,4DAAc;AACtE;AACA;AACA;AACA;AACA,wDAAwD,4DAAc;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,qDAAQ,mBAAmB,qDAAQ;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAS;AACxB;AACA,mBAAmB,yDAAW;AAC9B;AACA;AACA,gEAAgE,iBAAiB;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,yBAAyB,EAAE;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,0CAA0C,EAAE,eAAe,0CAA0C,EAAE;AAC5J;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,6DAAS;AACrD;AACA;AACA;AACA;AACA,gBAAgB,qDAAQ;;AAEG;AAC3B;;;;;;;;;;;;;ACtlGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAkC;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,oBAAoB,eAAe;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,8BAA8B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC,oCAAoC;AACpC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,EAAE;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,uDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,iBAAiB,MAAM,IAAI;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,EAAE;AACd;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,aAAa,WAAW;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,yBAAyB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,4DAA4D,gBAAgB;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,yBAAyB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,SAAS;AACjD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,2BAA2B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,uBAAuB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,0CAA0C;AAC9E,mCAAmC,wCAAwC;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEutB;AACvtB;;;;;;;;;;;;;;AC7tDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,8EAA8E;AACvG;AACA;;AAEA;AACA;AACA,mBAAmB,sBAAsB;AACzC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;;AAEA;;AAEA,wBAAwB;AACxB,eAAe;AACf,gBAAgB,kBAAkB,wEAAwE;AAC1G,gBAAgB,eAAe,qEAAqE;AACpG,eAAe,kBAAkB,sDAAsD;AACvF,gBAAgB,+EAA+E;AAC/F;AACA,sBAAsB,wCAAwC;AAC9D,sBAAsB;AACtB,kBAAkB;AAClB;AACA,wBAAwB,+CAA+C,qCAAqC,sBAAsB;AAClI,CAAC,qBAAqB,8BAA8B,GAAG;AACvD,qBAAqB,8GAA8G,iCAAiC;AACpK,mBAAmB,kDAAkD,qBAAqB,mBAAmB,4BAA4B,yBAAyB,GAAG;AACrK;AACA,kBAAkB,eAAe,EAAE,2BAA2B,mBAAmB,qBAAqB,6BAA6B;AACnI,cAAc,iBAAiB,iBAAiB;AAChD;AACA;AACA,8BAA8B;AAC9B;AACA,CAAC;AACD,6BAA6B;AAC7B,UAAU,eAAe;AACzB,yBAAyB;AACzB,oDAAoD,mDAAmD,EAAE,oBAAoB;AAC7H,yEAAyE,gBAAgB,cAAc;AACvG;AACA,iBAAiB,WAAW,EAAE,qDAAqD,uCAAuC,EAAE,uBAAuB,2EAA2E,OAAO;AACrO,oCAAoC;AACpC,gBAAgB;AAChB;AACA,8EAA8E,OAAO;AACrF;AACA;AACA;AACA;AACA;AACA,CAAC,kEAAkE;AACnE,gBAAgB,oDAAoD;AACpE,gBAAgB,kBAAkB;AAClC,iCAAiC,OAAO;AACxC;AACA;AACA,CAAC,WAAW;AACZ,gBAAgB,8BAA8B;AAC9C,+CAA+C,iBAAiB,EAAE,iBAAiB,oDAAoD;AACvI,kBAAkB,2BAA2B;AAC7C,mBAAmB,mCAAmC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B;AAC1B,gBAAgB,YAAY;AAC5B,gBAAgB,UAAU;AAC1B;AACA,mBAAmB,UAAU,gBAAgB,sBAAsB;AACnE;AACA;AACA;AACA,mBAAmB,eAAe;AAClC;AACA,CAAC;AACD,gBAAgB,YAAY,UAAU;AACtC;AACA,mBAAmB,YAAY,wEAAwE;AACvG;AACA,eAAe,oBAAoB,oCAAoC;AACvE;AACA;AACA,mCAAmC,WAAW;AAC9C,yBAAyB,QAAQ,WAAW;AAC5C,yCAAyC;AACzC,uCAAuC,QAAQ,WAAW;AAC1D,uCAAuC;AACvC,gDAAgD,EAAE;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,CAAC,eAAe,EAAE,EAAE;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE;AACtE,cAAc,yCAAyC,cAAc,mBAAmB,QAAQ,EAAE,EAAE,EAAE;AACtG;AACA;AACA,WAAW,EAAE,UAAU,EAAE;AACzB,kBAAkB,eAAe,0BAA0B,4BAA4B;AACvF,6BAA6B,4BAA4B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,6BAA6B,kBAAkB,gBAAgB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB;AACA,4BAA4B,mBAAmB,mBAAmB,cAAc,eAAe,oBAAoB,aAAa,iBAAiB,sBAAsB;AACvK,gBAAgB,UAAU,mBAAmB,gBAAgB,cAAc,aAAa;AACxF,gBAAgB,cAAc,aAAa,YAAY;AACvD,6CAA6C,sBAAsB,eAAe,qCAAqC,wBAAwB,iGAAiG,UAAU;AAC1P,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA,CAAC;AACD,yBAAyB,gBAAgB,cAAc;AACvD;AACA;AACA;AACA,CAAC,WAAW;AACZ;AACA,4BAA4B;AAC5B,6BAA6B;AAC7B,mBAAmB,cAAc;AACjC;AACA;AACA,CAAC,WAAW,oFAAoF;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC,qCAAqC,EAAE,iBAAiB,kCAAkC;AAC7I,aAAa,GAAG,UAAU;AAC1B,4BAA4B;AAC5B,mBAAmB,cAAc;AACjC;AACA;AACA,CAAC,WAAW,oFAAoF;AAChG,4BAA4B;AAC5B,mBAAmB,cAAc;AACjC;AACA;AACA,wWAAwW;AACxW,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,gBAAgB,2CAA2C;AAC3D,mBAAmB,uCAAuC,cAAc,qBAAqB;AAC7F,mBAAmB;AACnB,cAAc;AACd;AACA;AACA;AACA,kCAAkC,cAAc;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8BAA8B;AAC/B,gBAAgB,WAAW,mCAAmC;AAC9D;AACA,gBAAgB;AAChB,aAAa,iCAAiC,yBAAyB,EAAE,EAAE,cAAc;AACzF,cAAc,cAAc,uBAAuB,eAAe,eAAe;AACjF;AACA;AACA;AACA,4CAA4C,sBAAsB;AAClE,+CAA+C,sBAAsB;AACrE,gCAAgC,mBAAmB;AACnD,gBAAgB,GAAG;AACnB,kBAAkB,YAAY,qBAAqB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,QAAQ;AACT,8BAA8B,QAAQ;AACtC;AACA;AACA,KAAK,aAAa,0BAA0B,0BAA0B;AACtE,eAAe,cAAc;AAC7B,iDAAiD,UAAU;AAC3D,mBAAmB,kBAAkB;AACrC;AACA;AACA,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA,CAAC,eAAe;AAChB,8BAA8B,2CAA2C;AACzE,8BAA8B,2CAA2C;AACzE,yBAAyB,sBAAsB;AAC/C,cAAc,gBAAgB,wBAAwB,cAAc;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,iCAAiC;AAClC;AACA,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO,oFAAoF,UAAU;AAC9I;AACA,CAAC,iBAAiB,eAAe,EAAE,gBAAgB,WAAW,EAAE;AAChE,oCAAoC,kBAAkB,aAAa,uCAAuC,YAAY;AACtH,eAAe,sBAAsB,sEAAsE,UAAU;AACrH,eAAe,oCAAoC;AACnD,oCAAoC,YAAY,YAAY,kBAAkB;AAC9E,kCAAkC,oCAAoC;AACtE,gBAAgB,2BAA2B,SAAS,EAAE,KAAK;AAC3D,mBAAmB,YAAY,uBAAuB,cAAc;AACpE;AACA,eAAe,mCAAmC,mBAAmB,YAAY,GAAG;AACpF;AACA,eAAe,YAAY,UAAU;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,SAAS;AACV,mBAAmB,cAAc,iBAAiB,iBAAiB,2BAA2B,cAAc;AAC5G;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,CAAC;AACD,uBAAuB,cAAc,sEAAsE;AAC3G,gBAAgB,WAAW,4CAA4C;AACvE,mBAAmB,mBAAmB,UAAU,eAAe;AAC/D,sBAAsB;AACtB;AACA;AACA;AACA;AACA,6CAA6C,8DAA8D;AAC3G,gBAAgB,uBAAuB,YAAY,0BAA0B,EAAE,OAAO,aAAa,YAAY,oBAAoB;AACnI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,oBAAoB,iCAAiC;AACxF,kCAAkC,+BAA+B,+EAA+E;AAChJ;AACA,CAAC;AACD,eAAe,cAAc,YAAY,aAAa;AACtD;AACA;AACA,yBAAyB,2DAA2D,gBAAgB,cAAc;AAClH;AACA;AACA;AACA;AACA,CAAC;AACD,gBAAgB,0BAA0B,mCAAmC,EAAE,KAAK,UAAU;AAC9F,6BAA6B,kBAAkB,UAAU;AACzD,uCAAuC,yDAAyD;AAChG,eAAe,aAAa;AAC5B,+BAA+B,qBAAqB;AACpD;AACA;AACA,yCAAyC,cAAc;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,kFAAkF,EAAE,EAAE;AAChG,kCAAkC,qBAAqB,8FAA8F,EAAE,EAAE;AACzJ,wBAAwB,qBAAqB,qEAAqE,EAAE,EAAE;AACtH,mBAAmB,qBAAqB,wBAAwB,EAAE,EAAE;AACpE,iCAAiC;AACjC,mBAAmB;AACnB,aAAa;AACb,gBAAgB;AAChB;AACA;AACA,mBAAmB,cAAc;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,cAAc;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,eAAe,yBAAyB;AACxC,gBAAgB,uCAAuC;AACvD;AACA,eAAe,cAAc,+BAA+B;AAC5D,gBAAgB,8BAA8B;AAC9C;AACA,eAAe,cAAc,+BAA+B;AAC5D,gBAAgB,gCAAgC;AAChD;AACA,kBAAkB;AAClB,8DAA8D,kCAAkC,KAAK,EAAE,KAAK;AAC5G,UAAU;AACV,UAAU;AACV,eAAe;AACf;AACA,gBAAgB,OAAO,2BAA2B,EAAE,UAAU;AAC9D,eAAe;AACf,SAAS;AACT,eAAe,mBAAmB;AAClC;AACA,eAAe,mBAAmB;AAClC;AACA;AACA,eAAe;AACf;AACA;AACA,wBAAwB,YAAY,YAAY,YAAY,iBAAiB,sBAAsB,aAAa,uBAAuB,oBAAoB,eAAe,aAAa,qEAAqE,aAAa,eAAe,YAAY,wBAAwB,aAAa,aAAa,YAAY,eAAe,wCAAwC;AACzZ,sBAAsB;AACtB;AACA,6BAA6B,YAAY;AACzC,sBAAsB,SAAS,gBAAgB,SAAS,UAAU,aAAa;AAC/E,mBAAmB,WAAW,MAAM,cAAc,sBAAsB,uCAAuC,iBAAiB,SAAS,iCAAiC,iDAAiD,wCAAwC,wBAAwB,6JAA6J,MAAM,kCAAkC;AAChe,qBAAqB,cAAc,gBAAgB,qCAAqC;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA,sBAAsB,iBAAiB,wBAAwB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,qDAAqD,gBAAgB,0OAA0O;AAChT,oBAAoB;AACpB;AACA;AACA,CAAC;AACD,mBAAmB,qCAAqC;AACxD,cAAc,+BAA+B;AAC7C,cAAc,QAAQ;AACtB,cAAc,oBAAoB,aAAa,UAAU;AACzD,wBAAwB,aAAa,SAAS;AAC9C,eAAe,iBAAiB,YAAY;AAC5C,mBAAmB;AACnB,2CAA2C,wBAAwB;AACnE,gBAAgB,0CAA0C;AAC1D,oBAAoB,eAAe,aAAa,4HAA4H;AAC5K,gBAAgB,iCAAiC;AACjD,eAAe,OAAO,aAAa,0CAA0C,YAAY,SAAS,SAAS,iDAAiD;AAC5J;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,cAAc;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA,gBAAgB;AAChB,iBAAiB;AACjB,uBAAuB;AACvB,yCAAyC,OAAO;AAChD;AACA;AACA,CAAC,QAAQ,OAAO;AAChB,kBAAkB,cAAc;AAChC,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA,CAAC;AACD,kBAAkB,aAAa,aAAa,YAAY,0BAA0B;AAClF;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA,8BAA8B,cAAc;AAC5C;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,mBAAmB,UAAU,wBAAwB,mBAAmB;AACxE,8BAA8B,UAAU;AACxC,mBAAmB,UAAU,wBAAwB;AACrD,gBAAgB;AAChB,0BAA0B,gBAAgB;AAC1C;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA,CAAC;AACD,yBAAyB,qCAAqC;AAC9D,yBAAyB,4CAA4C,eAAe;AACpF,6BAA6B,8BAA8B,cAAc;AACzE;AACA;AACA,CAAC;AACD,kBAAkB,mDAAmD;AACrE;AACA,mBAAmB;AACnB;AACA,mBAAmB,cAAc;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,kBAAkB,+BAA+B,eAAe,sBAAsB,aAAa;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gRAAgR;AAChR,oCAAoC,wBAAwB,iCAAiC,gBAAgB;AAC7G,4HAA4H,EAAE,8DAA8D;AAC5L,iGAAiG,2CAA2C,wCAAwC,mBAAmB;AACvM,eAAe,iBAAiB;AAChC,sBAAsB,yBAAyB,sCAAsC;AACrF,sBAAsB,yBAAyB;AAC/C,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,sBAAsB,wFAAwF;AAC9G,qBAAqB,eAAe;AACpC,gBAAgB,uIAAuI,UAAU;AACjK,gBAAgB,iDAAiD;AACjE,yBAAyB,6BAA6B,eAAe,eAAe,eAAe,gBAAgB,UAAU;AAC7H,mBAAmB,mFAAmF;AACtG,sBAAsB,uGAAuG,EAAE,wBAAwB;AACvJ,gBAAgB,qBAAqB,iEAAiE;AACtG;AACA,kBAAkB,wBAAwB,oBAAoB,cAAc;AAC5E,eAAe,+DAA+D,qDAAqD,EAAE,GAAG;AACxI;AACA,yBAAyB,SAAS,eAAe,gBAAgB,uBAAuB,4BAA4B,WAAW,aAAa,aAAa;AACzJ,mBAAmB,MAAM,aAAa,oIAAoI;AAC1K,mBAAmB,MAAM,aAAa,oBAAoB;AAC1D,6BAA6B,SAAS,iCAAiC,qBAAqB,uBAAuB,EAAE,QAAQ,EAAE,QAAQ;AACvI,mBAAmB,SAAS,wDAAwD,cAAc;AAClG,6BAA6B,cAAc;AAC3C,qBAAqB,UAAU;AAC/B,oBAAoB,SAAS,YAAY;AACzC;AACA;AACA;AACA,mBAAmB,cAAc;AACjC;AACA,CAAC,UAAU;AACX,yBAAyB,SAAS,eAAe,gBAAgB,iDAAiD,oBAAoB,aAAa,aAAa;AAChK,yBAAyB;AACzB,aAAa,eAAe,wCAAwC;AACpE,sBAAsB,UAAU,wEAAwE;AACxG,0BAA0B;AAC1B,kBAAkB;AAClB,cAAc,wCAAwC,cAAc;AACpE;AACA;AACA,mBAAmB,cAAc;AACjC;AACA;AACA;AACA;AACA,CAAC,6BAA6B;AAC9B,kBAAkB,eAAe,8BAA8B,UAAU;AACzE,mBAAmB,8DAA8D,yBAAyB,yCAAyC,EAAE,MAAM,SAAS;AACpK,mBAAmB,YAAY,YAAY;AAC3C,gBAAgB,kBAAkB,+NAA+N,yBAAyB,eAAe,kCAAkC,eAAe,aAAa;AACvW;AACA,gBAAgB,8CAA8C;AAC9D,gBAAgB,qCAAqC;AACrD,mBAAmB,+CAA+C;AAClE,mBAAmB,4BAA4B;AAC/C,mBAAmB,mEAAmE;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,UAAU;AAC9E;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,UAAU;AAC3E;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,uCAAuC,oCAAoC;AAC3E,mCAAmC,gCAAgC;AACnE,eAAe,iBAAiB;AAChC,sBAAsB,iBAAiB;AACvC,2BAA2B,WAAW,qBAAqB,6CAA6C,EAAE;AAC1G;AACA;AACA;AACA,CAAC;AACD,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,sBAAsB,EAAE;AACxB;AACA;AACA;AACA,UAAU;AACV,4BAA4B;AAC5B;AACA;AACA,WAAW,EAAE;AACb;AACA,eAAe,cAAc,sBAAsB,oBAAoB,aAAa,wBAAwB,aAAa,YAAY,aAAa,wCAAwC,YAAY,eAAe,aAAa,sBAAsB;AACxP;AACA;AACA;AACA;AACA;AACA,2FAA2F;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,aAAa,EAAE;AAC/C;AACA;AACA;AACA,yFAAyF;AACzF,+BAA+B,+BAA+B,EAAE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8EAA8E;AAC9F,gBAAgB,0CAA0C;AAC1D,oBAAoB,2JAA2J;AAC/K,mBAAmB,UAAU,0CAA0C,SAAS,SAAS,OAAO,OAAO;AACvG,gBAAgB,0EAA0E;AAC1F,wBAAwB,qKAAqK;AAC7L,mBAAmB,6FAA6F,kBAAkB;AAClI,oBAAoB,+DAA+D;AACnF,oBAAoB,UAAU;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,CAAC;AACD,gBAAgB,sCAAsC,0CAA0C;AAChG,eAAe,iCAAiC;AAChD,mBAAmB;AACnB;AACA;AACA;AACA;AACA,CAAC;AACD,mBAAmB;AACnB;AACA;AACA;AACA;AACA,CAAC;AACD,qBAAqB;AACrB;AACA;AACA;AACA,CAAC;AACD,oBAAoB,eAAe;AACnC,oBAAoB,6DAA6D;AACjF,gBAAgB,YAAY,wBAAwB,QAAQ,UAAU,QAAQ,aAAa,EAAE,EAAE,UAAU;AACzG,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA,CAAC,qGAAqG;AACtG,sBAAsB,2EAA2E;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,OAAO;AACR,gBAAgB,0CAA0C;AAC1D,gBAAgB,OAAO,0CAA0C,OAAO,cAAc,qEAAqE;AAC3J,mBAAmB,6BAA6B,mBAAmB;AACnE,gBAAgB,oDAAoD;AACpE,mBAAmB;AACnB,cAAc;AACd,qCAAqC;AACrC,cAAc,oCAAoC,OAAO,WAAW;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,mBAAmB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO,yBAAyB,gBAAgB,kBAAkB,gBAAgB,kBAAkB,UAAU,+BAA+B,+BAA+B,6BAA6B,8BAA8B,mBAAmB,6EAA6E,YAAY,aAAa;AACnX,mBAAmB,aAAa,mBAAmB,YAAY,EAAE,EAAE;AACnE,sBAAsB,6BAA6B,wCAAwC,8BAA8B;AACzH;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sBAAsB,SAAS,UAAU;AAC1C,gBAAgB,+CAA+C;AAC/D,gBAAgB;AAChB,cAAc,OAAO,iCAAiC,OAAO,WAAW;AACxE,oBAAoB,eAAe,UAAU;AAC7C;AACA;AACA;AACA,CAAC;AACD,oBAAoB,4LAA4L;AAChN,gBAAgB,kDAAkD;AAClE,gBAAgB,iCAAiC,+BAA+B,WAAW,iBAAiB,oBAAoB,kBAAkB,6BAA6B,kBAAkB,UAAU,yBAAyB,+BAA+B,4BAA4B,aAAa,UAAU,SAAS,gBAAgB,YAAY,UAAU,UAAU;AAC/W,oBAAoB,8DAA8D;AAClF,gBAAgB,kDAAkD;AAClE,mBAAmB,cAAc;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,mBAAmB,iDAAiD,iBAAiB,cAAc;AACnG,kBAAkB,6BAA6B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,SAAS,kBAAkB,OAAO,OAAO;AAClD,qBAAqB,8GAA8G;AACnI,gBAAgB,SAAS,UAAU;AACnC;AACA;AACA;AACA,CAAC;AACD,sBAAsB,eAAe;AACrC;AACA;AACA;AACA;AACA,CAAC,iCAAiC,YAAY,EAAE,EAAE,SAAS,UAAU,sBAAsB,mBAAmB,UAAU,UAAU;AAClI,mBAAmB;AACnB,uEAAuE,iBAAiB,WAAW,UAAU;AAC7G,eAAe;AACf;AACA,oBAAoB;AACpB,oBAAoB;AACpB,oBAAoB;AACpB,oBAAoB;AACpB,oBAAoB;AACpB,eAAe;AACf,gEAAgE;AAChE,kCAAkC,oBAAoB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA,6FAA6F,oCAAoC;AACjI;AACA;AACA,mGAAmG,oDAAoD;AACvJ,mEAAmE,qCAAqC;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,6CAA6C;AACzF,+CAA+C,gDAAgD;AAC/F,oBAAoB,mBAAmB,2BAA2B,kDAAkD,MAAM,UAAU,eAAe,WAAW,yBAAyB,OAAO;AAC9L,uBAAuB,YAAY;AACnC,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,oBAAoB,qDAAqD;AACzE,mBAAmB,iBAAiB,eAAe,YAAY,eAAe,kBAAkB;AAChG,gBAAgB,eAAe,kBAAkB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA,eAAe,eAAe,iBAAiB;AAC/C;AACA,eAAe,YAAY;AAC3B;AACA,8BAA8B,2BAA2B;AACzD,+BAA+B,iCAAiC;AAChE,+BAA+B,iCAAiC;AAChE,8BAA8B,2BAA2B,GAAG;;AAE5D;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,eAAe;AAC5D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe,kEAAG,EAAC;AAC2D;AAC9E;;;;;;;;;;;;;;ACl3CY;;AAEZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kCAAkC,SAAS;AAC3C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0CAA0C,UAAU;AACpD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ,aAAa,mBAAO,CAAC,oDAAW;AAChC,cAAc,mBAAO,CAAC,gDAAS;AAC/B,cAAc,mBAAO,CAAC,gDAAS;;AAE/B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB,mDAAmD;AACxE;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,UAAU;AAC7B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,YAAY;AAC7B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,uCAAuC,SAAS;AAChD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD,EAAE;AAClD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB,eAAe;AACvC;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,wBAAwB,QAAQ;AAChC;AACA,qBAAqB,eAAe;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,YAAY;AAC7B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,mBAAmB,cAAc;AACjC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB;AAClB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,qBAAqB,QAAQ;AAC7B;AACA;AACA,GAAG;AACH;AACA,eAAe,SAAS;AACxB;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,YAAY;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,gBAAgB;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,YAAY;AAC7B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;;AC5vDa;;AAEb,sBAAsB,mBAAO,CAAC,kEAAkB;;AAEhD;AACA;AACA;AACA;AACA;;AAEA,2CAA2C,IAAI;;AAE/C;AACA;AACA,4BAA4B,UAAU;AACtC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA,SAAS,OAAO;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;;;;;;;;;;;;AC1Ga;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA;;AAEA;AACA,4CAA4C,qBAAqB;AACjE;;AAEA;AACA,KAAK;AACL,IAAI;AACJ;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,qBAAqB,iBAAiB;AACtC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,qBAAqB;AACzC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,8BAA8B;;AAE9B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,CAAC;;;AAGD;AACA;AACA;AACA,qDAAqD,cAAc;AACnE;AACA,C;;;;;;;;;;;;AC7Fa,oFAAoF,gBAAgB,aAAa,qGAAqG,6BAA6B,iEAAiE,sGAAsG,SAAS,gFAAgF,iBAAiB,0BAA0B,0BAA0B,4BAA4B,GAAG,6DAA6D,qCAAqC,iBAAiB,eAAe,SAAS,yBAAyB,kCAAkC,6BAA6B,wBAAwB,8EAA8E,wBAAwB,kCAAkC,EAAE,kBAAkB,uBAAuB,kBAAkB,yBAAyB,uCAAuC,EAAE,sBAAsB,kBAAkB,EAAE,IAAI,GAAG,wEAAwE,KAAK,sEAAsE,+EAA+E,uB;;;;;;;;;;;;ACA52C,0BAA0B,QAAQ,8CAA8C,qPAAqP,uBAAuB,YAAY,iCAAiC,WAAW,+BAA+B,UAAU,6BAA6B,WAAW,+BAA+B,EAAE,U;;;;;;;;;;;;ACAtgB,wBAAwB,mBAAO,CAAC,sFAAuB,EAAE,2BAA2B,0EAA0E,kDAAkD,8DAA8D,wCAAwC,wDAAwD,sBAAsB,gBAAgB,EAAE,yBAAyB,kBAAkB,8CAA8C,+GAA+G,sBAAsB,kCAAkC,+CAA+C,iCAAiC,sCAAsC,oJAAoJ,uBAAuB,kCAAkC,wCAAwC,0CAA0C,0DAA0D,kCAAkC,iC;;;;;;;;;;;ACAppC,mBAAmB,mBAAO,CAAC,6EAAqB;AAChD,mBAAmB,mBAAO,CAAC,6EAAqB;AAChD,0BAA0B,mBAAO,CAAC,2FAA4B;;AAE9D;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,sBAAsB;AACvC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA,cAAc;AACd;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,iCAAiC,QAAQ;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,OAAO;AACP;AACA,sCAAsC,QAAQ;AAC9C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;;AAEA;AACA,QAAQ,yBAAyB;AACjC;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,GAAG;AACH;;;;;;;;;;;;;AC3dA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAqC;AACG;AAChB;AACI;AACC;AACA;AACA;AACF;AACI;AACF;AACI;;AAEjC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAQ;;AAER;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0aAA0a,gCAAgC,qDAAqD,8BAA8B,qDAAqD,8BAA8B;AAChnB,qDAAQ;AACR;;;;;;;;;;;;;ACtDa;;AAEb,cAAc,mBAAO,CAAC,kDAAU;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,mBAAmB,iBAAiB;AACpC;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACtGA;AACA,EAAE,KAA4D;AAC9D,EAAE,SACmD;AACrD,CAAC,2BAA2B;;AAE5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,gDAAgD,cAAc;;AAE9D,CAAC;;;;;;;;;;;;AC3TD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,QAAQ,WAAW;;AAEnB;AACA;AACA;AACA,QAAQ,WAAW;;AAEnB;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA,QAAQ,WAAW;;AAEnB;AACA;AACA,QAAQ,UAAU;;AAElB;AACA;;;;;;;;;;;;ACnFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtBA,iBAAiB;;AAEjB;AACA;AACA;;;;;;;;;;;;;ACJA;AACa;;AAEb,iBAAiB,mBAAO,CAAC,mDAAI,K;;;;;;;;;;;;ACH7B;AACa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,8F;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;AC9Ca;;AAEb;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;ACjBA,YAAY,mBAAO,CAAC,wDAAO;AAC3B,eAAe,mBAAO,CAAC,8DAAU;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACXA;AACa;;AAEb,kBAAkB,mBAAO,CAAC,yDAAQ;;AAElC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oC;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,gDAAgD;AAChD;AACA,OAAO;AACP;AACA;AACA;AACA,2DAA2D;AAC3D;AACA,K;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;;;;;;;;;;;;AClEA;AACa;AACb;AACA;AACA;AACA;AACA,eAAe,mBAAO,CAAC,iEAAc;AACrC,eAAe,mBAAO,CAAC,mEAAe;AACtC,eAAe,mBAAO,CAAC,mEAAe;AACtC,YAAY,mBAAO,CAAC,6DAAY;;AAEhC;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,6E;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;;;;;;;;;;;;;ACjFA;AACa;;AAEb;AACA;AACA;AACA,iBAAiB,mBAAO,CAAC,0EAAmB;AAC5C,gBAAgB,mBAAO,CAAC,kEAAW;AACnC,eAAe,mBAAO,CAAC,oEAAgB;;AAEvC;AACA;AACA;AACA;AACA;AACA,mBAAmB,mBAAO,CAAC,0FAA2B;AACtD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,kBAAkB,4BAA4B,EAAE,OAAO,EAAE,4BAA4B;AACrF,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;AC1KA;AACa;;AAEb,eAAe,mBAAO,CAAC,oEAAgB;;AAEvC;AACA;AACA;;AAEA,qBAAqB;AACrB;AACA;;AAEA;AACA;AACA;AACA,gBAAgB,YAAY;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB,YAAY;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;;AAGA;AACA;AACA;AACA,aAAa,OAAO;AACpB,gBAAgB,YAAY;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB,gBAAgB,YAAY;AAC5B;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,KAAK;AAClB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,gBAAgB;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;;AChNA;AACA;AACA;AACA;AACA;;AAEa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH,kCAAkC;AAClC;AACA;AACA;;AAEA;AACA,EAAE;AACF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,gBAAgB,sBAAsB;AACtC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,oBAAoB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;ACzFA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA;AACA;;AAEA,+BAA+B;;AAE/B,8BAA8B;;AAE9B;AACA;AACA;;AAEA;AACA;AACA;;AAEA,4BAA4B;;AAE5B,4BAA4B;;AAE5B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,UAAU;;AAEzB,4BAA4B;;AAE5B,gCAAgC;;AAEhC;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;;;;;;;;;;;AChDA,+CAAa;;AAEb;AACA;AACA;AACA;AACA,oBAAoB;AACpB,CAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;;;;;;;;;;;;;AC3CA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;;AAErC;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;;;;;;;ACvLtC;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;;AAEA,IAAI,IAAqC;AACzC,6BAA6B,mBAAO,CAAC,yFAA4B;AACjE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,UAAU;AACrB;AACA;AACA;AACA,MAAM,IAAqC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4GAA4G;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAqC;AAC3C;AACA;AACA;;AAEA;;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,cAAc,mBAAO,CAAC,kDAAU;AAChC,aAAa,mBAAO,CAAC,4DAAe;;AAEpC,2BAA2B,mBAAO,CAAC,yFAA4B;AAC/D,qBAAqB,mBAAO,CAAC,qEAAkB;;AAE/C;AACA;;AAEA,IAAI,IAAqC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,0CAA0C;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,6BAA6B;AAC7B,QAAQ;AACR;AACA;AACA;AACA;AACA,+BAA+B,KAAK;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,4BAA4B;AAC5B,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,KAAqC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU,IAAqC;AAC/C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB,2BAA2B;AAChD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM,KAAqC,4FAA4F,SAAM;AAC7I;AACA;;AAEA,mBAAmB,gCAAgC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,gCAAgC;AACrD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;AC9kBA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAI,IAAqC;AACzC,gBAAgB,mBAAO,CAAC,kDAAU;;AAElC;AACA;AACA;AACA,mBAAmB,mBAAO,CAAC,uFAA2B;AACtD,CAAC,MAAM,EAIN;;;;;;;;;;;;;AClBD;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;;AAEA;;;;;;;;;;;;;ACXa;;AAEb;AACA;AACA,CAAC;AACD;;AAEA,oCAAoC,mBAAO,CAAC,4CAAO;;AAEnD,8CAA8C,mBAAO,CAAC,oEAAmB;;AAEzE,sCAAsC,uCAAuC,kBAAkB;;AAE/F,uBAAuB,2EAA2E,kCAAkC,mBAAmB,GAAG,EAAE,OAAO,kCAAkC,8HAA8H,GAAG,EAAE,qBAAqB;;AAE7V,0CAA0C,gCAAgC,oCAAoC,oDAAoD,8DAA8D,gEAAgE,EAAE,EAAE,gCAAgC,EAAE,aAAa;;AAEnV,gCAAgC,gBAAgB,sBAAsB,OAAO,uDAAuD,aAAa,+CAA+C,2CAA2C,EAAE,EAAE,EAAE,6CAA6C,2EAA2E,EAAE,OAAO,yCAAyC,kFAAkF,EAAE,EAAE,EAAE,EAAE,eAAe;;AAEpgB,qDAAqD,+BAA+B,8DAA8D,YAAY,oCAAoC,6DAA6D,YAAY,6BAA6B,OAAO,2BAA2B,0CAA0C,wEAAwE,2BAA2B,EAAE,EAAE,eAAe;;AAE1e,0DAA0D,+BAA+B,iBAAiB,sCAAsC,YAAY,YAAY,uBAAuB,OAAO,qBAAqB,0CAA0C,2BAA2B,EAAE,eAAe;;AAEjT,iDAAiD,0CAA0C,0DAA0D,EAAE;;AAEvJ,2CAA2C,gBAAgB,kBAAkB,OAAO,2BAA2B,wDAAwD,gCAAgC,uDAAuD,2DAA2D,EAAE;;AAE3T,6DAA6D,sEAAsE,8DAA8D,oBAAoB;;AAErN,iDAAiD,0EAA0E,aAAa,EAAE,qCAAqC;;AAE/K,6BAA6B,gGAAgG,gDAAgD,GAAG,2BAA2B;;AAE3M,uCAAuC,uBAAuB,uFAAuF,EAAE,aAAa;;AAEpK,0CAA0C,+DAA+D,2EAA2E,EAAE,yEAAyE,eAAe,sDAAsD,EAAE,EAAE,uDAAuD;;AAE/X,gCAAgC,4EAA4E,iBAAiB,UAAU,GAAG,8BAA8B;;AAExK,2CAA2C,kBAAkB,kCAAkC,qEAAqE,EAAE,EAAE,OAAO,kBAAkB,EAAE,YAAY;;AAE/M;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,uEAAuE,aAAa;AACpF;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,OAAO;;;AAGP;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,kEAAkE;AAClE;AACA,OAAO;AACP;AACA,GAAG;;AAEH;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA,CAAC,E;;;;;;;;;;;;AC7GY;;AAEb,eAAe,mBAAO,CAAC,4EAAa;AACpC;;AAEA;AACA,iC;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;;;AAIb,IAAI,IAAqC;AACzC;AACA;;AAEA,YAAY,mBAAO,CAAC,4CAAO;AAC3B,cAAc,mBAAO,CAAC,4DAAe;AACrC,gBAAgB,mBAAO,CAAC,oDAAW;AACnC,qBAAqB,mBAAO,CAAC,8EAA2B;AACxD,cAAc,mBAAO,CAAC,8DAAmB;;AAEzC,oFAAoF;AACpF;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,0FAA0F,aAAa;AACvG;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,8FAA8F,eAAe;AAC7G;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK,EAAE;;AAEP,iDAAiD;AACjD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;;AAEA,0BAA0B;AAC1B;AACA;;AAEA,qCAAqC;AACrC;;AAEA,mFAAmF;AACnF;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,gBAAgB;;AAEhB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,gBAAgB;AAC7B;AACA;AACA;AACA,OAAO;;;AAGP,uEAAuE;;AAEvE;AACA,8DAA8D;AAC9D;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA,OAAO;;;AAGP;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,uBAAuB;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,KAAK;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,KAAK;AAChB;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,mBAAmB,8BAA8B;AACjD;AACA;AACA,OAAO;;;AAGP;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;;AAE/B,iBAAiB;;AAEjB,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;;AAEA,mCAAmC,EAAE;;AAErC;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,6CAA6C;;AAE7C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,0BAA0B;AAC7C;AACA;AACA;AACA;;AAEA,+BAA+B;;AAE/B,qCAAqC;;AAErC,iCAAiC;AACjC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;;AAEA,eAAe;AACf;AACA;AACA;;AAEA,0BAA0B;AAC1B;AACA;;AAEA,gBAAgB;AAChB;AACA;AACA;;AAEA,2BAA2B;AAC3B;;AAEA,gBAAgB;AAChB;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;;;AAGA,oBAAoB;;AAEpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;;AAEH;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,GAAG;;;AAGH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG,EAAE;AACL;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC;AACjC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;AACA;AACA,yDAAyD;AACzD;;AAEA;AACA;AACA;;AAEA,iEAAiE;AACjE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA,mBAAmB,kBAAkB;AACrC;;AAEA;AACA;AACA,OAAO;AACP;AACA,8BAA8B;AAC9B;;;AAGA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;;AAGA,sCAAsC;AACtC;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,qBAAqB;AACrB;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAO;AACP,KAAK;;;AAGL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB,2BAA2B;AAC9C;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB,2BAA2B;AAC9C;AACA;AACA;;AAEA,oBAAoB,qBAAqB;AACzC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA,qBAAqB,sBAAsB;AAC3C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA,mBAAmB;AACnB;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;AAGA,4BAA4B;AAC5B;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,iCAAiC;;AAEjC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mCAAmC;;AAEnC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA,qCAAqC;AACrC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,OAAO;AAClB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,OAAO;AAClB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,8CAA8C;AAC9C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;;;AAGA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA;;AAEA;AACA;AACA;AACA;;AAEA,oEAAoE;;AAEpE;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;;;AAGP;AACA,KAAK;AACL;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO;AACP;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,YAAY,WAAW;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,WAAW,MAAM;AACjB;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,EAAE;AACb;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,eAAe;AAC3B;;AAEA;AACA;AACA;AACA,sEAAsE;;AAEtE;AACA;AACA,GAAG;AACH;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,4CAA4C;AAC5C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,GAAG;AACH;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,EAAE;AACd;AACA;;;AAGA;AACA;;AAEA,iBAAiB,oBAAoB;AACrC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,0CAA0C;AAC1C;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA;AACA,wDAAwD;;AAExD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;;AAEA;AACA;AACA;;AAEA,iBAAiB,yBAAyB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6CAA6C;AAC7C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,yBAAyB;AAC1C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,sCAAsC;;AAEtC,8BAA8B;AAC9B;;AAEA;AACA;AACA,uBAAuB;;AAEvB;AACA,sCAAsC;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,6DAA6D;;AAE7D;AACA;AACA,GAAG,EAAE;;AAEL;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,OAAO;AACP;;AAEA;AACA,yEAAyE;AACzE;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC;;AAEpC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oEAAoE;AACpE;AACA;;AAEA,mBAAmB,iCAAiC;AACpD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,4CAA4C;AAC9D;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iJAAiJ;;AAEjJ,kcAAkc;;AAElc;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,MAAM;AACN;AACA;AACA;AACA,kBAAkB,aAAa;AAC/B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,uBAAuB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,uBAAuB;AACxC;AACA;AACA,CAAC;;;AAGD;AACA;AACA,8FAA8F;;AAE9F;AACA;AACA,mDAAmD;AACnD;AACA;;AAEA;AACA;;AAEA;AACA;AACA,yDAAyD;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;AAGA,oDAAoD;AACpD;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;AAGA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,4CAA4C;AAC5C;;AAEA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,YAAY,OAAO;AACnB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,wBAAwB;AACxB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,8BAA8B;;AAE9B,4CAA4C;AAC5C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,OAAO;AAClB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU,iCAAiC;AAC3C;AACA;AACA;AACA,IAAI;AACJ;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,gCAAgC,KAAK;AAC3C;AACA;AACA,MAAM,gCAAgC,KAAK;AAC3C;AACA,4DAA4D;AAC5D,MAAM,gCAAgC,KAAK;AAC3C;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,4NAA4N;AAC5N;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4EAA4E,YAAY;AACxF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2HAA2H,6BAA6B;AACxJ;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kFAAkF;AAClF;;AAEA;AACA;;AAEA;AACA;AACA,OAAO,0CAA0C;;;AAGjD;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,+FAA+F;AAC/F;;AAEA;AACA;AACA;AACA,OAAO,0CAA0C;;;AAGjD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,6EAA6E;;AAE7E;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sJAAsJ,iBAAiB;AACvK,OAAO;AACP,sJAAsJ,iBAAiB,wDAAwD,mBAAmB,gBAAgB,8BAA8B;AAChS;;AAEA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA,KAAK;;;AAGL;AACA,oGAAoG,GAAG;;AAEvG;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,wEAAwE;AACxE;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA,iIAAiI,mBAAmB,gBAAgB,8BAA8B;AAClM,KAAK;AACL;AACA;AACA,IAAI;AACJ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;;AAGP;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK,qGAAqG,kCAAkC;AAC5I;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,0BAA0B;AAC3C;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,2BAA2B;AAC3B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,4DAA4D;AAC5D;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,+CAA+C;AAC/C;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB,4BAA4B;AACjD;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gDAAgD;AAChD;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gDAAgD;AAChD;;AAEA;AACA;;AAEA;AACA;AACA;AACA,gDAAgD;AAChD;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK,2EAA2E,qGAAqG,kCAAkC;AACvN;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK,qGAAqG;AAC1G;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kEAAkE;;AAElE,8FAA8F;AAC9F;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB,4BAA4B;AACjD;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gDAAgD;AAChD;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gDAAgD;AAChD;;AAEA;AACA;;AAEA;AACA;AACA,gDAAgD;AAChD;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,oBAAoB,wBAAwB;AAC5C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA,qCAAqC;AACrC;AACA,+EAA+E;AAC/E;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;;AAE9C;AACA,aAAa;;;AAGb;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,uBAAuB;AAClC,YAAY;AACZ;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uBAAuB;AAClC,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uBAAuB;AAClC,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,WAAW,WAAW;AACtB,YAAY;AACZ;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAO;;;AAGP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uBAAuB;AAClC,WAAW,OAAO;AAClB;;AAEA;AACA;AACA,6CAA6C;AAC7C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,8EAA8E;AAC9E;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA,0vBAA0vB;;AAE1vB;AACA;AACA;AACA,oCAAoC;;AAEpC,uDAAuD;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iCAAiC;;AAEjC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ,cAAc;AACtB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA,GAAG;;;AAGH;AACA,CAAC;AACD;AACA;;AAEA;AACA,4CAA4C;AAC5C;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,+CAA+C;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,+CAA+C;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW;AACX;AACA;AACA;;;AAGA,yEAAyE;AACzE;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA,yBAAyB,OAAO;AAChC;AACA;;AAEA;;AAEA,yBAAyB,OAAO;AAChC;AACA,GAAG;;;AAGH;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,uBAAuB,SAAS;AAChC;AACA;;AAEA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,qBAAqB;AACtC;AACA;;AAEA,8BAA8B,UAAU;AACxC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,UAAU;AACtB;;;AAGA;AACA,eAAe;AACf,eAAe;;AAEf;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;;AAEA;;AAEA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,OAAO;AAClB,WAAW,eAAe;AAC1B;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B;AAC5B;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uHAAuH;AACvH,yHAAyH;AACzH;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,YAAY,OAAO;AACnB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED,mCAAmC;;AAEnC;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA;;;AAGA,+EAA+E;AAC/E;AACA;;AAEA;AACA;AACA,uDAAuD;;AAEvD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA,CAAC;;;AAGD;AACA;AACA,YAAY,QAAQ;AACpB;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,mCAAmC;AACnC;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;;;AAGA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,0GAA0G;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,gFAAgF;AAChF;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA,oCAAoC;;AAEpC;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;AACA,iDAAiD;AACjD;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,sPAAsP;AACtP;;AAEA,wBAAwB;AACxB;AACA;AACA;;AAEA;AACA,6BAA6B;AAC7B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG,eAAe;AAClB;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,qCAAqC;AACrC;;AAEA,6CAA6C;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,yHAAyH;;AAEzH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,CAAC;;;AAGD,0DAA0D;;AAE1D,oDAAoD;AACpD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mDAAmD;AACnD;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAqB,mBAAmB;AACxC;AACA;;AAEA;AACA;AACA,4CAA4C;AAC5C;AACA;;AAEA,0HAA0H;AAC1H;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;;AAEA;AACA,8CAA8C;;AAE9C;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,0BAA0B;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;;AAE3B;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,kBAAkB;AAChC;;AAEA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;;;AAGP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,mBAAmB;AACnB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc;AACd;;AAEA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA,sCAAsC;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;;AAEA;AACA,8DAA8D;AAC9D,qDAAqD;AACrD,2DAA2D;AAC3D,2CAA2C;AAC3C;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qDAAqD;;AAErD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,8CAA8C;;AAE9C;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;;AAGL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,yBAAyB;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gCAAgC;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,0BAA0B;;AAE1B;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,2BAA2B;;AAE3B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,uEAAuE;;AAEvE;AACA;AACA,WAAW;AACX;;;AAGA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;;;AAGP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mDAAmD,yDAAyD;AAC5G,6BAA6B;;AAE7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;;;AAGP;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH,yCAAyC;;AAEzC;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,SAAS;;;AAGT;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;;AAGT,yBAAyB;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH,kCAAkC;;AAElC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gCAAgC;;AAEhC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA,+BAA+B;;AAE/B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;;;AAGX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;;AAGA,oFAAoF;;AAEpF;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA,uCAAuC;AACvC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,oBAAoB;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;;;AAGH,kGAAkG;AAClG,+CAA+C;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC;;AAEtC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6IAA6I;;AAE7I;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,kEAAkE,4CAA4C;AAC9G;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA,+BAA+B;AAC/B;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA,qDAAqD;AACrD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA,kIAAkI;AAClI;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA,kIAAkI;AAClI;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,oCAAoC;;AAEpC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,8JAA8J,yCAAyC;AACvM;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,CAAC;AACD;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAqB,wBAAwB;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,UAAU,kDAAkD;AAC5D;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,6BAA6B;AACzC;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;;AAGL,uEAAuE;;AAEvE,UAAU,6BAA6B;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO;;;AAGP;AACA;AACA;AACA;;AAEA;AACA,OAAO;AACP;;;AAGA;;AAEA;AACA;;AAEA;;AAEA,cAAc,aAAa;AAC3B;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,UAAU,iCAAiC;AAC3C;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,YAAY;AACxB;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;;AAGL,uEAAuE;;AAEvE,UAAU,YAAY;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;;;AAGT;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,MAAM;AACnD;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yDAAyD;AACzD;;AAEA,8CAA8C;AAC9C;AACA;AACA;AACA;;AAEA;AACA,6DAA6D;;AAE7D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6DAA6D;;AAE7D;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,+BAA+B;AAC/B;AACA;AACA;;AAEA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,2CAA2C;;AAE3C;AACA;AACA,GAAG;;;AAGH;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kCAAkC;AAClC;;AAEA,qCAAqC;AACrC;AACA;AACA;;AAEA;AACA,8BAA8B;AAC9B,mDAAmD;AACnD;AACA;;AAEA;AACA,yBAAyB;;AAEzB,gCAAgC;AAChC;AACA;;AAEA;AACA,iCAAiC;AACjC;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,uBAAuB,8BAA8B;AACrD;AACA;AACA,+CAA+C;AAC/C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,4CAA4C;AAC7D;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iCAAiC;;AAEjC;AACA;;AAEA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA,6CAA6C;;AAE7C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;;;AAGP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL,GAAG;AACH;;;AAGA;;AAEA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B;;AAE5B,oCAAoC;;AAEpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;AAGA,kFAAkF;;AAElF;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC;AACtC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,2CAA2C;AAChD;;;AAGA;AACA;AACA;;AAEA,kCAAkC;AAClC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,yKAAyK,0CAA0C;AACnN;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;;AAEA,8CAA8C;AAC9C;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,qEAAqE;AACrE;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,gBAAgB;AACzB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,4HAA4H;;AAE5H,oCAAoC;AACpC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wBAAwB;AACxB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA,yGAAyG;AACzG;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,+BAA+B;;AAE/B;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mCAAmC;;AAEnC;AACA;AACA;AACA,+CAA+C;;AAE/C;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;AAGA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;;AAEtC;AACA,KAAK;;;AAGL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,0CAA0C;;AAE1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;;AAGA,gDAAgD;;AAEhD;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA,mCAAmC;;AAEnC;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;;AAEpC;AACA;;AAEA,0CAA0C;AAC1C;;AAEA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;;AAEpC;AACA,GAAG;;;AAGH,sCAAsC;AACtC;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;;AAEpC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL,wCAAwC;;AAExC;AACA,sCAAsC;AACtC;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,8CAA8C;;AAE9C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uDAAuD;AACvD,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;AAC3D;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;;;AAGA;;AAEA;AACA;AACA,4DAA4D;AAC5D;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,iIAAiI;AACjI;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;;AAGT;;AAEA;AACA;AACA;AACA,4DAA4D;AAC5D;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mCAAmC;;AAEnC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yNAAyN,GAAG;;AAE5N;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAuB,qBAAqB;AAC5C;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,YAAY;AAC9B;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2CAA2C;;AAE3C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;;;AAGX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;;AAGA;AACA,uCAAuC;;AAEvC;AACA;AACA;AACA,kDAAkD;;AAElD;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;;;AAGA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,6CAA6C;;AAE7C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,+BAA+B;AAC/B;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa;;;AAGb;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf,mHAAmH;AACnH;;AAEA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;;;AAGA;AACA,aAAa;AACb;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,4DAA4D;;AAE5D;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO,oCAAoC;AAC3C;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mDAAmD;AACnD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA;AACA,8CAA8C;AAC9C;AACA;;AAEA,qHAAqH;;AAErH,+CAA+C;AAC/C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;;;AAGA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;;;AAGb;AACA;;AAEA,oDAAoD;AACpD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,sEAAsE;;AAEtE;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,8CAA8C;AAC9C;;AAEA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,+DAA+D;;AAE/D;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;;;AAGA;AACA;AACA;;AAEA,qEAAqE;;AAErE,yEAAyE;AACzE;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;;AAEX,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA,uCAAuC;AACvC;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,oDAAoD;;AAEpD;AACA;AACA;AACA;AACA,oFAAoF;;AAEpF;AACA;AACA,iBAAiB;;;AAGjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E;AACA;AACA;AACA;AACA;AACA,WAAW;;;AAGX;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;;AAEA;;AAEA;AACA;AACA,WAAW;AACX;AACA;;AAEA,+DAA+D;;AAE/D;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,+EAA+E;;AAE/E;AACA;;AAEA;AACA;;AAEA;AACA;AACA,2CAA2C;AAC3C;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;;AAGA,8BAA8B;AAC9B;AACA;AACA;;AAEA;AACA,6BAA6B,2CAA2C;;AAExE;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;;AAEA,4GAA4G;AAC5G;AACA;AACA;;AAEA,sCAAsC;AACtC;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;;AAGF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,aAAa;AACb,yNAAyN,qCAAqC,wFAAwF,2BAA2B,qBAAqB,QAAQ,YAAY;AAC1Z,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,+DAA+D;AAC/D;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW;AACX;AACA;AACA,gEAAgE;AAChE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,CAAC;AACD;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB;AACjB,eAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2DAA2D;AAC3D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;;AAGA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA,qDAAqD;;AAErD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,6BAA6B;;AAE7B;AACA;;AAEA,4CAA4C;AAC5C;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG,+BAA+B;AAClC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG,+BAA+B;AAClC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA,mCAAmC;;AAEnC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,oEAAoE;AACpE;;AAEA;AACA;AACA,OAAO;AACP;AACA,OAAO;;AAEP,KAAK;AACL;AACA;AACA;AACA;AACA,wCAAwC;;AAExC;AACA;AACA;AACA;AACA,KAAK;AACL,6DAA6D;;AAE7D;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oDAAoD;AACpD;AACA;;AAEA;AACA,uCAAuC;;AAEvC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iDAAiD;AACjD;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA,kDAAkD;;AAElD,6BAA6B;AAC7B;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;;AAE9C;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC;;AAEtC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA,qHAAqH;;AAErH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA,kDAAkD;AAClD;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;;;AAGA,4CAA4C;;AAE5C;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,OAAO;AACP;;;AAGA;AACA,KAAK,kCAAkC;AACvC;;;AAGA;AACA,GAAG;AACH;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+DAA+D;;AAE/D;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;;AAEjC,8BAA8B;;AAE9B,0BAA0B;;AAE1B,oCAAoC;;AAEpC,kDAAkD;;AAElD,wCAAwC;AACxC;AACA;AACA;;AAEA;AACA;AACA,mDAAmD;AACnD;;AAEA,yDAAyD;AACzD;AACA;;AAEA,6CAA6C;AAC7C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;;AAE3C;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;;AAEA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,yBAAyB;AACzB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;;;AAGH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;AAGA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,CAAC;AACD,QAAQ;AACR;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;;AAGA;AACA,mFAAmF;AACnF;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,CAAC;AACD;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,6CAA6C;;AAE7C;AACA;AACA,GAAG;AACH;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,0BAA0B;AAC1B;;AAEA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;;AAEP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmF;AACnF;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2FAA2F;;AAE3F;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;;AAGA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,6DAA6D;AAC7D;AACA;;AAEA;AACA;AACA;AACA,WAAW;;;AAGX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,wBAAwB;AACxB;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;;AAGA;AACA;;AAEA,gCAAgC;AAChC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,EAAE;;AAEP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH,4CAA4C;AAC5C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mCAAmC;;AAEnC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;;;AAGL;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+DAA+D;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,4CAA4C;;AAE5C;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,6EAA6E;;AAE7E;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;AAGA,iDAAiD;AACjD;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,6CAA6C;;;AAG7C;AACA;AACA,wEAAwE;;AAExE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;;;AAGL;AACA,GAAG,iCAAiC;;;AAGpC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC;;AAEtC;AACA;AACA;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG,4CAA4C;AAC/C;;;AAGA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA,kDAAkD;;AAElD,uCAAuC;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,yCAAyC;AACzC;AACA;AACA;;AAEA,gCAAgC;AAChC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,sBAAsB;AACtB;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA,gCAAgC;AAChC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA;AACA;;AAEA,uBAAuB,4BAA4B;AACnD;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA,uDAAuD;AACvD;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,sCAAsC;AACtC;;AAEA,6CAA6C;;AAE7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6CAA6C;;AAE7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA,+CAA+C;;AAE/C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,2BAA2B;AAC3B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;;AAE9B;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;;AAEzB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,mDAAmD;;AAEnD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,qEAAqE;;AAErE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO,4CAA4C;AACnD;;;AAGA;AACA,6BAA6B;AAC7B;AACA;;AAEA,wCAAwC;;AAExC;;AAEA;AACA;AACA;AACA,OAAO;;;AAGP;;AAEA;AACA,6CAA6C;AAC7C;;AAEA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8GAA8G;;AAE9G;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA;AACA;AACA;AACA,kNAAkN,IAAI,6BAA6B,mCAAmC,0FAA0F,cAAc,IAAI,gBAAgB,mCAAmC;AACrb;AACA;AACA;AACA;AACA;AACA;AACA,iMAAiM,oDAAoD,EAAE;AACvP;AACA;AACA;;AAEA;AACA;AACA;AACA,4LAA4L,oDAAoD,EAAE;AAClP;AACA;AACA;;AAEA,gFAAgF;;AAEhF,0CAA0C;AAC1C;AACA,0BAA0B;AAC1B;;AAEA;AACA;AACA;AACA;AACA;;AAEA,6PAA6P;AAC7P;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO;AACP,KAAK;AACL,uEAAuE;;AAEvE;AACA;AACA,OAAO;AACP;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,GAAG,EAAE;AACL;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA,4CAA4C;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,gBAAgB,KAAI;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,yDAAyD;AACzD;AACA,iDAAiD;AACjD;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH,+CAA+C;AAC/C;;AAEA,wCAAwC;;AAExC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;;AAExC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wCAAwC;;AAExC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,2EAA2E;;AAE3E;AACA;AACA;AACA;AACA;;AAEA;AACA,sEAAsE;AACtE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;AAGA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA,yEAAyE;AACzE;AACA;;AAEA,4DAA4D;AAC5D;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,+DAA+D,OAAO;;AAEtE;AACA;AACA;;AAEA;AACA;AACA,IAAI;;;AAGJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;;AAEA,sCAAsC;AACtC;AACA;AACA,IAAI;;;AAGJ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,K;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,mFAAmF;;AAEnF;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,iMAAiM,cAAc;AAC/M;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK,EAAE;AACP;;AAEA;AACA,GAAG;AACH;AACA;;AAEA,+EAA+E;;AAE/E;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,8CAA8C;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACn7wBa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAqC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,IAAI,KAAqC,EAAE,EAK1C;AACD,mBAAmB,mBAAO,CAAC,6FAAgC;AAC3D;;;;;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;;;AAIb,IAAI,IAAqC;AACzC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E;AAC1E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;;AAEhD;AACA;AACA;AACA,iDAAiD;;AAEjD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACpLa;;AAEb,IAAI,KAAqC,EAAE,EAE1C;AACD,mBAAmB,mBAAO,CAAC,0FAA+B;AAC1D;;;;;;;;;;;;;ACNA;AAAA;AAAA;AAAA;AAA0B;AACnB;AACP;AACA,4CAAK;;AAEL,IAAI,IAAqC;AACzC;AACA;;AAEe,gFAAiB,E;;;;;;;;;;;;ACThC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAkD;AACf;AACW;AACG;;AAEjD;AACA;AACA;AACA;AACA,qBAAqB,qDAAO;AAC5B,2BAA2B,2DAAY;AACvC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,sBAAsB,qDAAO;AAC7B;AACA,GAAG;AACH,EAAE,uDAAS;AACX;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH,2BAA2B,0DAAiB;AAC5C,SAAS,4CAAK;AACd;AACA,GAAG;AACH;;AAEA,IAAI,IAAqC;AACzC;AACA,WAAW,iDAAS;AACpB,iBAAiB,iDAAS;AAC1B,gBAAgB,iDAAS;AACzB,gBAAgB,iDAAS;AACzB,KAAK;AACL,aAAa,iDAAS;AACtB,cAAc,iDAAS;AACvB;AACA;;AAEe,uEAAQ,E;;;;;;;;;;;;ACnDvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA0D;AAC0C;AACjD;AACoB;AACN;AAChB;AAC8B;AACjC;;AAE9C;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,EAAE,kGAAyB;AAC3B;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,oCAAoC;;AAEpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wCAAwC;;AAExC;AACA,6BAA6B;;AAE7B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;;AAEvC;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,IAAI;;;AAGJ;AACA,8BAA8B;AAC9B;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,0DAAiB;AAC5D,uBAAuB,uGAA6B;;AAEpD,MAAM,IAAqC;AAC3C;AACA;AACA;;AAEA;AACA;AACA;;AAEA,qQAAqQ,UAAU,8BAA8B,UAAU,0CAA0C,oBAAoB;;AAErX;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ,KAAqC,KAAK,mEAAkB;AACpE;AACA;;AAEA;AACA;;AAEA,iCAAiC,kFAAQ,GAAG;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA,KAAK;AACL;AACA;;;AAGA,iCAAiC,6CAAO;AACxC;AACA;;AAEA;AACA,qBAAqB,qDAAO;AAC5B;AACA;AACA;AACA;AACA,2BAA2B,uGAA6B;;AAExD;AACA,OAAO;AACP;AACA;AACA;;AAEA,yBAAyB,qDAAO;AAChC;AACA;AACA,wDAAwD,kEAAiB,CAAC,4CAAK;AAC/E,OAAO,2BAA2B;;AAElC,yBAAyB,wDAAU,eAAe;AAClD;AACA;;AAEA;AACA;;AAEA,UAAU,KAAqC;AAC/C;AACA,OAAO;;;AAGP;AACA,+BAA+B,qDAAO;AACtC;AACA;AACA;AACA,OAAO;;AAEP,sBAAsB,qDAAO;AAC7B,oEAAoE;AACpE;;AAEA,+BAA+B,2DAAY,kEAAkE;AAC7G;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,0CAA0C,oBAAoB,oBAAoB;AAClF;;;AAGA,mCAAmC,qDAAO;AAC1C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;;AAGA,eAAe,kFAAQ,GAAG;AAC1B;AACA,SAAS;AACT,OAAO,uDAAuD;AAC9D;;AAEA,wBAAwB,wDAAU;AAClC;AACA;AACA,wDAAwD;;;AAGxD;AACA;AACA,OAAO;;;AAGP,2BAA2B,oDAAM;AACjC,6BAA6B,oDAAM;AACnC,sCAAsC,oDAAM;AAC5C,8BAA8B,oDAAM;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;;AAGA;AACA,OAAO,oDAAoD;AAC3D;AACA;;AAEA,iMAAiM;;AAEjM,0SAA0S;AAC1S;;AAEA,qCAAqC,qDAAO;AAC5C,eAAe,4CAAK,iCAAiC,kFAAQ,GAAG;AAChE;AACA,SAAS;AACT,OAAO,gEAAgE;AACvE;;AAEA,0BAA0B,qDAAO;AACjC;AACA;AACA;AACA;AACA,iBAAiB,4CAAK;AACtB;AACA,WAAW;AACX;;AAEA;AACA,OAAO;AACP;AACA,KAAK;;;AAGL,yBAAyB,4CAAK;AAC9B;AACA;;AAEA;AACA,sBAAsB,4CAAK;AAC3B,eAAe,4CAAK,wBAAwB,kFAAQ,GAAG;AACvD;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,aAAa,8DAAY;AACzB;;AAEA,WAAW,8DAAY;AACvB;AACA,C;;;;;;;;;;;;AChXA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA0D;AAC0C;AACxC;AACX;AACqB;AACN;AACV;AACC;AACvD;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oCAAoC,QAAQ;AAC5C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;;;AAGO;AACP,kCAAkC;AAClC;AACA,gDAAgD,mEAAe;AAC/D;AACA,oEAAoE,wDAA+B;AACnG;AACA,uEAAuE,2DAAkC;AACzG;AACA,+DAA+D,mDAA0B;AACzF;AACA,0DAA0D,wDAAsB;;AAEhF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,2DAAY;AAC1E;AACA,gEAAgE,2DAAY;AAC5E;AACA,iEAAiE,2DAAY;AAC7E,uBAAuB,uGAA6B;;AAEpD;AACA;AACA;AACA,uCAAuC,kFAAQ;AAC/C;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AAGA,2FAAe,E;;;;;;;;;;;;ACnGf;AAAA;AAAA;AAAA;AAAA;AAAA;AAA2C;AACmC;AACvE;AACP,oDAAoD,0EAAkB;AACtE;AACO;AACP,+BAA+B,8EAAsB;AACrD;AACA;AACA;AACA,GAAG;AACH;AACO;AACP,wEAAwE,8EAAsB;AAC9F,WAAW,gEAAkB;AAC7B,GAAG;AACH;AACe,kKAAmG,E;;;;;;;;;;;;ACjBlH;AAAA;AAAA;AAAA;AAA8E;AACvE;AACP,iDAAiD,0EAAkB;AACnE;AACO;AACP,4BAA4B,8EAAsB;AAClD;AACA,GAAG;AACH;AACe,4HAA6D,E;;;;;;;;;;;;ACT5E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA0D;AACC;AACpD;AACP,SAAS,kFAAQ,GAAG,cAAc,gBAAgB;AAClD;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,YAAY,IAAqC,EAAE,wEAAiB;AACpE;;AAEA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA,GAAG;AACH;AACe,kHAAmD,E;;;;;;;;;;;;ACnClE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAoG;AAC9C;AAC/C;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;AACA,gBAAgB,uGAA6B;;AAE7C;AACA;AACA;;AAEA,MAAM,IAAqC;AAC3C,IAAI,mEAAkB;AACtB;;AAEA;AACA;AACA,C;;;;;;;;;;;;ACtFA;AAAA;AAAA;AAAuC;;AAEvC;AACA;AACA;AACA,GAAG;AACH;AACA,MAAM,8DAAO;AACb;AACA;AACA;;AAEe;AACf;AACA;AACA;AACA,C;;;;;;;;;;;;AChBA;AAAA;AAAA;AAAA;AAAA;AAA2D;AACpD;AACP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEA;AACA;AACA,MAAM;;;AAGN;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,UAAU,IAAqC,EAAE,wEAAiB;AAClE;AACA;;AAEA;AACA;AACA,C;;;;;;;;;;;;AC/DA;AAAA;AAAA;AAAA;AAAA;AAA0D;AACgB;AAC1E;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,SAAS;AACtB;;AAEO;AACP;AACA,cAAc,qEAAiB;AAC/B;;AAEA,6BAA6B,qEAAiB,GAAG,kDAAe,GAAG,iEAAe;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,aAAa;AAC1B;AACA;AACA;AACA,kBAAkB,cAAc;AAChC,WAAW,cAAc;AACzB;AACA,qCAAqC,QAAQ;AAC7C;AACA,yDAAyD,2BAA2B;AACpF;AACA;AACA,gBAAgB,MAAM;AACtB,0BAA0B,gBAAgB;AAC1C;AACA;AACA;AACA;;AAEO;AACP;AACA,qB;;;;;;;;;;;;AC5CA;AAAA;AAAA;AAAA;AAAA;AAAmC;AACuB;AAC1D;AACA;AACA;AACA;AACA,aAAa,IAAI;AACjB;AACA;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B;AACA,qCAAqC,QAAQ;AAC7C,YAAY,QAAQ;AACpB,kBAAkB,iBAAiB;AACnC;AACA;;AAEO;AACP,qBAAqB,wDAAU,CAAC,qEAAiB;;AAEjD,MAAM,KAAqC;AAC3C,8DAA8D;AAC9D;;AAEA;AACA,C;;;;;;;;;;;;AC3BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA+E;AACD;AAC7B;AAC8B;AACrB;;AAE1D;AACA;AACA;;AAEA;AACA,oBAAoB,wDAAU;AAC9B;AACA,GAAG;AACH;;AAEA,qBAAqB,qDAAO;AAC5B,eAAe,2DAAY;AAC3B,GAAG;AACH,wCAAwC,oDAAM;AAC9C,uBAAuB,oDAAM;AAC7B,yBAAyB,oDAAM;AAC/B,4BAA4B,oDAAM;AAClC;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA,EAAE,kGAAyB;AAC3B;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE,kGAAyB;AAC3B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,SAAS;AACtB;;;AAGO;AACP;AACA,cAAc,qEAAiB;AAC/B;;AAEA,oCAAoC,qEAAiB,GAAG,gEAAsB;AAC9E,WAAW,wDAAU;AACrB;AACA;AACA;AACA;AACA;;AAEA,QAAQ,KAAqC;AAC7C;AACA;;AAEA;AACA;AACA;;AAEA;AACA,IAAI,2DAAa;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,UAAU;AACrB;AACA,aAAa,IAAI;AACjB;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;AACA;AACA;AACA,kBAAkB,QAAQ;AAC1B;AACA;;AAEO;AACP;AACA,qB;;;;;;;;;;;;ACxIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAmC;AACuB;AACoB;AAC9E;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,SAAS;AACtB;;AAEO;AACP;AACA,cAAc,qEAAiB;AAC/B;;AAEA,oCAAoC,qEAAiB,GAAG,gEAAsB;AAC9E,WAAW,wDAAU;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,IAAI;AACjB;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB;AACA;AACA;AACA,kBAAkB,iBAAiB;AACnC;AACA;;AAEO;AACP;AACA,kB;;;;;;;;;;;;AC3CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA6C;AACc;AACF;AACjB;AAC8B;AACA;AACT;AACpB;AACsC;AAC/B;AAChD,6DAAQ,CAAC,kFAAK;;;;;;;;;;;;;ACVd;AAAA;AAAA;AAAmC;AACnC;AACA;;AAEA;AACA;AACA;;AAEA;AACA,cAAc,uDAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;;;;;;;;;;;;;ACzHD;AAAA;AAAA;AAAA;AACA;AACA;AACA;;AAEA,6BAA6B;;AAEtB;AACP;AACA,EAAE;;AAEK;AACP;AACA,E;;;;;;;;;;;;ACbA;AAAA;AAAA;AACA,WAAW,IAAI;AACf,aAAa,QAAQ;AACrB;AACe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;;ACfA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEe;AACf;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;;AC1BA;AAAA;AAAA;AAAA;AAAmD;AACnD;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;;AAEO,kKAAkK,qDAAe,GAAG,+CAAS,C;;;;;;;;;;;;ACTpM;AAAA;AAAA;AAAA;AAA4C;AACZ;AACjB;AACf,OAAO,8DAAa;AACpB,IAAI,wDAAO;AACX;AACA,C;;;;;;;;;;;;ACNA;AAAA;AAAA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACe;AACf;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA,C;;;;;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;;;AAIb,IAAI,IAAqC;AACzC;AACA;;AAEA,cAAc,mBAAO,CAAC,4DAAe;AACrC,qBAAqB,mBAAO,CAAC,8EAA2B;;AAExD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,0FAA0F,aAAa;AACvG;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,8FAA8F,eAAe;AAC7G;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK,EAAE;;AAEP,iDAAiD;AACjD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,8MAA8M;;AAE9M;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,aAAa,WAAW;AACxB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,WAAW;AACxB,aAAa,UAAU;AACvB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,WAAW;AACxB,aAAa,OAAO;AACpB,aAAa,UAAU;AACvB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,WAAW;AACxB,aAAa,OAAO;AACpB,aAAa,UAAU;AACvB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA,yBAAyB;;AAEzB,0BAA0B;AAC1B;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B;AACA,WAAW,UAAU;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,yBAAyB;;AAEzB;AACA;AACA;;AAEA;AACA,mDAAmD;;AAEnD;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,EAAE;AACb,WAAW,EAAE;AACb,WAAW,cAAc;AACzB,WAAW,EAAE;AACb,WAAW,EAAE;AACb;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,EAAE;;AAEP;AACA;AACA;AACA;AACA;AACA,KAAK,EAAE;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe;;AAEf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oEAAoE;;AAEpE;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA,mBAAmB,oBAAoB;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;;AAGH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe;;AAEf,wBAAwB,iBAAiB;;;AAGzC;AACA,wBAAwB;;AAExB,2BAA2B;AAC3B;AACA;;AAEA,+BAA+B;;AAE/B;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA,mBAAmB,oBAAoB;AACvC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,WAAW,GAAG;AACd;AACA,YAAY,QAAQ;AACpB;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB;;AAEvB;;AAEA;AACA,mBAAmB,qBAAqB;AACxC;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,sIAAsI,yCAAyC;AAC/K;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,UAAU;AACrB,WAAW,GAAG;AACd,YAAY,QAAQ;AACpB;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,iBAAiB;AAC5B,WAAW,EAAE;AACb;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,iBAAiB;AAC5B,WAAW,EAAE;AACb,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,aAAa;AACzB;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;;AAEN;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK,EAAE;;AAEP;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA,yCAAyC;;AAEzC;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA,mCAAmC;;AAEnC;AACA;AACA,WAAW;AACX;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;;AAGL;AACA,yCAAyC;AACzC;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,EAAE;AACb;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,0DAA0D;AAC1D;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB,WAAW,EAAE;AACb;;;AAGA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,iBAAiB;AACpC;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB;;;AAGA;AACA;AACA;AACA;;AAEA,mBAAmB,iBAAiB;AACpC;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA,qDAAqD;AACrD;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;AAGA;AACA,mBAAmB,sBAAsB;AACzC;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA,iBAAiB,sBAAsB;AACvC;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,uCAAuC;AACvC;AACA,0CAA0C;AAC1C;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACv3Da;;AAEb,IAAI,KAAqC,EAAE,EAE1C;AACD,mBAAmB,mBAAO,CAAC,iFAA4B;AACvD;;;;;;;;;;;;;ACNA;AAAA;AAAA;AAAA;AAC+E;AAC/E,8BAA8B,sEAA2B;AACzD;AACA,8BAA8B,QAAS,kBAAkB,YAAY,gBAAgB,UAAU,YAAY,yBAAyB,6BAA6B,YAAY,mCAAmC,kBAAkB,eAAe,0BAA0B,mCAAmC,uBAAuB,aAAa,uDAAuD,+CAA+C,WAAW,iBAAiB,eAAe,sBAAsB,wBAAwB,OAAO,mWAAmW,YAAY,gBAAgB,UAAU,YAAY,yBAAyB,6BAA6B,YAAY,mCAAmC,kBAAkB,eAAe,0BAA0B,mCAAmC,uBAAuB,aAAa,uDAAuD,+CAA+C,WAAW,iBAAiB,eAAe,sBAAsB,wBAAwB,mBAAmB;AACt2C;AACe,sFAAuB,EAAC;;;;;;;;;;;;;ACNvC;AAAA;AAAA;AAAA;AAAA;AAAA;AAA6G;AAC5E;;AAEjC;AACA;AACA,mBAAmB,sBAAsB;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,EAAE,uDAAS;AACX;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,EAAE,uDAAS;AACX;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,EAAE,uDAAS;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;;AAEF;AACA;AACA;AACA;;AAEA,EAAE,uDAAS;AACX;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,gEAAgE,qDAAe,GAAG,+CAAS;;AAE3F;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,QAAQ,IAAqC;AAC7C;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE;;AAElE,qGAAqG;AACrG;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yBAAyB,wDAAU;AACnC;AACA;AACA;AACA,sDAAsD;AACtD;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD;AACA,kDAAkD;AAClD;AACA,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,sDAAQ;AAC1B;AACA;;AAEA,mBAAmB,oDAAM;AACzB,mBAAmB,oDAAM;AACzB,iBAAiB,oDAAM;AACvB,4BAA4B,oDAAM;AAClC,gBAAgB,oDAAM;AACtB;AACA,gBAAgB,oDAAM;AACtB;AACA;AACA;AACA;AACA,2BAA2B;;AAE3B;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,GAAG,YAAY;;AAEf,EAAE,uDAAS;AACX;AACA,4BAA4B;AAC5B;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6BAA6B;AAC7B;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kGAAkG;AAClG;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,EAAE,iEAAmB;AACrB;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,GAAG,EAAE;;AAEL;AACA;AACA,gQAAgQ;;AAEhQ;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;;;AAGJ,yCAAyC;;AAEzC;AACA;AACA,sHAAsH;AACtH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0BAA0B,4CAAK;AAC/B;;AAEA,wBAAwB,4CAAK;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,wBAAwB;AACxB;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,WAAW,4CAAK,sCAAsC;AACtD;AACA;AACA;AACA,KAAK,wBAAwB,4CAAK;AAClC;AACA;AACA,KAAK,EAAE,4CAAK;AACZ;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP,KAAK,EAAE,4CAAK;AACZ;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,4BAA4B,4CAAK;AACjC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,sBAAsB;AACtB;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH,SAAS,4CAAK,eAAe,4CAAK,4CAA4C,gDAAQ;AACtF,CAAC;;AAEc,oEAAK,EAAC;AACJ;AACjB;;;;;;;;;;;;AC3mBA,iBAAiB,mBAAO,CAAC,qFAAyB;;;;;;;;;;;;;ACAlD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEa;;AAEb;;AAEA,UAAU,mBAAO,CAAC,0EAAsB;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA,yBAAyB,mBAAO,CAAC,6DAAc;AAC/C,gBAAgB,mBAAO,CAAC,6DAAU;AAClC;;AAEA,eAAe,mBAAO,CAAC,kFAAoB;AAC3C,eAAe,mBAAO,CAAC,kFAAoB;;AAE3C;;AAEA;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA,E;;;;;;;;;;;;AClIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEa;;AAEb;;AAEA,gBAAgB,mBAAO,CAAC,oFAAqB;;AAE7C;AACA,yBAAyB,mBAAO,CAAC,6DAAc;AAC/C,gBAAgB,mBAAO,CAAC,6DAAU;AAClC;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,E;;;;;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;;AAEA,UAAU,mBAAO,CAAC,0EAAsB;AACxC;;AAEA;;AAEA;AACA,cAAc,mBAAO,CAAC,gDAAS;AAC/B;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,SAAS,mBAAO,CAAC,+CAAQ;;AAEzB;AACA;AACA;AACA;;AAEA;AACA,aAAa,mBAAO,CAAC,wGAA2B;AAChD;;AAEA;;AAEA,aAAa,mBAAO,CAAC,wDAAa;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,yBAAyB,mBAAO,CAAC,6DAAc;AAC/C,gBAAgB,mBAAO,CAAC,6DAAU;AAClC;;AAEA;AACA,gBAAgB,mBAAO,CAAC,aAAM;AAC9B;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA,iBAAiB,mBAAO,CAAC,wGAA+B;AACxD,kBAAkB,mBAAO,CAAC,kGAA4B;AACtD;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yEAAyE,6EAA6E;AACtJ;;AAEA;AACA,qBAAqB,mBAAO,CAAC,8EAAkB;;AAE/C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,iDAAiD,0FAA0F;;AAE3I;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,wCAAwC,mBAAO,CAAC,4EAAiB;AACjE;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,mBAAO,CAAC,8EAAkB;;AAE/C;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA,kGAAkG;AAClG,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA,4FAA4F;AAC5F,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,gDAAgD;;AAEhD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC,mBAAO,CAAC,4EAAiB;AAC/D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,6DAA6D;AAC7D;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sCAAsC;;AAEtC;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,4CAA4C;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB;;AAEpB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,SAAS;AAC5B;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA,4EAA4E;;AAE5E;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA,iBAAiB,yBAAyB;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mDAAmD;AACnD;AACA,mDAAmD,iEAAiE;AACpH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA,uCAAuC;AACvC,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gCAAgC,OAAO;AACvC;AACA;AACA;AACA,C;;;;;;;;;;;;;AC1/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,YAAY;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;;AAEA,aAAa,mBAAO,CAAC,8EAAkB;;AAEvC;AACA,yBAAyB,mBAAO,CAAC,6DAAc;AAC/C,gBAAgB,mBAAO,CAAC,6DAAU;AAClC;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,C;;;;;;;;;;;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEa;;AAEb;;AAEA,UAAU,mBAAO,CAAC,0EAAsB;AACxC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,yBAAyB,mBAAO,CAAC,6DAAc;AAC/C,gBAAgB,mBAAO,CAAC,6DAAU;AAClC;;AAEA;AACA;AACA,aAAa,mBAAO,CAAC,gEAAgB;AACrC;AACA;;AAEA;AACA,aAAa,mBAAO,CAAC,wGAA2B;AAChD;;AAEA;;AAEA,aAAa,mBAAO,CAAC,wDAAa;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,kBAAkB,mBAAO,CAAC,kGAA4B;;AAEtD;;AAEA;;AAEA;AACA,qBAAqB,mBAAO,CAAC,8EAAkB;;AAE/C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iDAAiD,0FAA0F;;AAE3I;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,mBAAO,CAAC,8EAAkB;;AAE/C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iCAAiC;;AAEjC;;AAEA,2CAA2C;AAC3C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,oDAAoD;AACpD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,E;;;;;;;;;;;;;AC9qBa;;AAEb,iDAAiD,0CAA0C,0DAA0D,EAAE;;AAEvJ,aAAa,mBAAO,CAAC,wDAAa;AAClC,WAAW,mBAAO,CAAC,aAAM;;AAEzB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB;AACjB,gDAAgD;AAChD;AACA;AACA;;AAEA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA,4BAA4B,sBAAsB;AAClD;AACA;AACA,C;;;;;;;;;;;;AC9Ea;;AAEb;;AAEA,UAAU,mBAAO,CAAC,0EAAsB;AACxC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,E;;;;;;;;;;;ACzEA,iBAAiB,mBAAO,CAAC,+CAAQ;;;;;;;;;;;;ACAjC,iBAAiB,mBAAO,CAAC,sEAAY;;;;;;;;;;;;ACArC,2BAA2B,mBAAO,CAAC,yFAA2B;AAC9D;AACA;AACA,mBAAmB,mBAAO,CAAC,yFAA2B;AACtD,iBAAiB,mBAAO,CAAC,qFAAyB;AAClD,oBAAoB,mBAAO,CAAC,2FAA4B;AACxD,sBAAsB,mBAAO,CAAC,+FAA8B;;;;;;;;;;;;ACN5D,iBAAiB,mBAAO,CAAC,sEAAY;;;;;;;;;;;;ACArC,iBAAiB,mBAAO,CAAC,yFAA2B;;;;;;;;;;;;;ACApD;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEe,oEAAK,E;;;;;;;;;;;;ACnBpB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA6C;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,IAAI;AACf,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA,WAAW,IAAI;AACf;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB,eAAe,SAAS;AACxB;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB,eAAe;AACf;;;AAGA;AACA;AACA;AACA;;AAEA,iCAAiC;AACjC;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,WAAW;AAC1B;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA,mBAAmB,aAAa;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,OAAO,yDAAY;AACxB;AACA,KAAK;AACL,GAAG;AACH;AACA;;;AAGA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG,QAAQ,yDAAY;AACvB;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,GAAG,aAAa;;AAEhB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oEAAoE;AACpE;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;;;AAGA;AACA;AACA;;AAEA,iBAAiB,wBAAwB;AACzC;;AAEA,QAAQ,IAAqC;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,oDAAoD;AACpD;;AAEA;;AAEA,MAAM,IAAqC;AAC3C;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,QAAQ,IAAqC;AAC7C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,oBAAoB,8BAA8B;AAClD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA,aAAa,gBAAgB;AAC7B;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA,iBAAiB,sBAAsB;AACvC;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA,sEAAsE,aAAa;AACnF;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,SAAS;AACtB;;AAEA;AACA,4EAA4E,aAAa;AACzF;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,8BAA8B;AAC9B;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAI,KAAqC;AACzC;AACA;;AAEgI;;;;;;;;;;;;ACtpBhI;AACA,aAAa,mBAAO,CAAC,8CAAQ;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;;;AAIb,IAAI,IAAqC;AACzC;AACA;;AAEA,0BAA0B;;AAE1B;AACA,wBAAwB;AACxB;AACA;AACA;;AAEA,iCAAiC;;AAEjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,gCAAgC;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;AC5VA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;;;AAIb,IAAI,IAAqC;AACzC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2DAA2D;;AAE3D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,8BAA8B;;AAE9B;AACA,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,+CAA+C;AAC/C;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG;;AAElG;AACA;AACA;AACA;;AAEA;AACA,wCAAwC;AACxC;;AAEA;AACA;AACA,CAAC;;;AAGD;AACA,gCAAgC;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mCAAmC;;AAEnC,oCAAoC;;AAEpC;AACA;AACA,iCAAiC;;AAEjC,sCAAsC;;AAEtC;AACA,oBAAoB;;AAEpB,sBAAsB;AACtB;AACA,0CAA0C;;AAE1C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA,GAAG;;;AAGH;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;;;AAGP;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACz1Ba;;AAEb,IAAI,KAAqC,EAAE,EAE1C;AACD,mBAAmB,mBAAO,CAAC,6FAAgC;AAC3D;;;;;;;;;;;;;ACNa;;AAEb,IAAI,KAAqC,EAAE,EAE1C;AACD,mBAAmB,mBAAO,CAAC,6GAAwC;AACnE;;;;;;;;;;;;ACNA;AACA;;AAEA;AACA;AACA;;AAEA,uBAAuB;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,iBAAiB;AACtC;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0CAA0C,sBAAsB,EAAE;AAClE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA,KAAK;AACL;AACA;;AAEA,KAAK;AACL;AACA;;AAEA,KAAK;AACL;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;;;;;;;;;;;ACzLD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAAS,mBAAO,CAAC,+CAAQ;AACzB,eAAe,mBAAO,CAAC,6DAAU;;AAEjC;AACA,kBAAkB,mBAAO,CAAC,uFAA6B;AACvD,kBAAkB,mBAAO,CAAC,uFAA6B;AACvD,gBAAgB,mBAAO,CAAC,mFAA2B;AACnD,mBAAmB,mBAAO,CAAC,iFAA8B;AACzD,qBAAqB,mBAAO,CAAC,qFAAgC;;AAE7D;AACA;;;;AAIA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;;;;;;;;;;;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;;AAEA,aAAa,mBAAO,CAAC,wDAAa;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6BAA6B,sCAAsC,sCAAsC;AACzG;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,C;;;;;;;;;;;;ACvSA;AAAA;AAAA;AACqC;;AAErC;;AAEA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA,CAAC,UAAU,IAA6B;AACxC;AACA,CAAC,MAAM,EAEN;;AAED,aAAa,4DAAQ;AACN,qEAAM,EAAC;;;;;;;;;;;;;;AClBtB;AAAA;AAAe;AACf;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;;;;;;;;;;;;AChBA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,mBAAO,CAAC,iEAAc;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,0BAA0B;AAC3C;AACA;;AAEA,yCAAyC;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;ACtCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;;AAEO;AACP;AACA,mBAAmB,sBAAsB;AACzC;AACA;;AAEO;AACP;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,4DAA4D,cAAc;AAC1E;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;;AAEO;AACP,mCAAmC,oCAAoC;AACvE;;AAEO;AACP;AACA;;AAEO;AACP,2BAA2B,+DAA+D,gBAAgB,EAAE,EAAE;AAC9G;AACA,mCAAmC,MAAM,6BAA6B,EAAE,YAAY,WAAW,EAAE;AACjG,kCAAkC,MAAM,iCAAiC,EAAE,YAAY,WAAW,EAAE;AACpG,+BAA+B,qFAAqF;AACpH;AACA,KAAK;AACL;;AAEO;AACP,aAAa,6BAA6B,0BAA0B,aAAa,EAAE,qBAAqB;AACxG,gBAAgB,qDAAqD,oEAAoE,aAAa,EAAE;AACxJ,sBAAsB,sBAAsB,qBAAqB,GAAG;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,kCAAkC,SAAS;AAC3C,kCAAkC,WAAW,UAAU;AACvD,yCAAyC,cAAc;AACvD;AACA,6GAA6G,OAAO,UAAU;AAC9H,gFAAgF,iBAAiB,OAAO;AACxG,wDAAwD,gBAAgB,QAAQ,OAAO;AACvF,8CAA8C,gBAAgB,gBAAgB,OAAO;AACrF;AACA,iCAAiC;AACjC;AACA;AACA,SAAS,YAAY,aAAa,OAAO,EAAE,UAAU,WAAW;AAChE,mCAAmC,SAAS;AAC5C;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAM,gBAAgB;AACzC;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;;AAEO;AACP,4BAA4B,sBAAsB;AAClD;AACA;AACA;;AAEO;AACP,iDAAiD,QAAQ;AACzD,wCAAwC,QAAQ;AAChD,wDAAwD,QAAQ;AAChE;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA,iBAAiB,sFAAsF,aAAa,EAAE;AACtH,sBAAsB,gCAAgC,qCAAqC,0CAA0C,EAAE,EAAE,GAAG;AAC5I,2BAA2B,MAAM,eAAe,EAAE,YAAY,oBAAoB,EAAE;AACpF,sBAAsB,oGAAoG;AAC1H,6BAA6B,uBAAuB;AACpD,4BAA4B,wBAAwB;AACpD,2BAA2B,yDAAyD;AACpF;;AAEO;AACP;AACA,iBAAiB,4CAA4C,SAAS,EAAE,qDAAqD,aAAa,EAAE;AAC5I,yBAAyB,6BAA6B,oBAAoB,gDAAgD,gBAAgB,EAAE,KAAK;AACjJ;;AAEO;AACP;AACA;AACA,2GAA2G,sFAAsF,aAAa,EAAE;AAChN,sBAAsB,8BAA8B,gDAAgD,uDAAuD,EAAE,EAAE,GAAG;AAClK,4CAA4C,sCAAsC,UAAU,oBAAoB,EAAE,EAAE,UAAU;AAC9H;;AAEO;AACP,gCAAgC,uCAAuC,aAAa,EAAE,EAAE,OAAO,kBAAkB;AACjH;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,4CAA4C;AAC5C;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxNA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,SAAS;AACtB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClEA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;;;;;;;;;;ACvBA,e;;;;;;;;;;;ACAA,e","file":"bundle.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 = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./client/index.js\");\n","export const COLLECT_TITLE = 'COLLECT_TITLE'\nexport const COLLECT_DESCRIPTION = 'COLLECT_DESCRIPTION'\nexport const COLLECT_URL = 'COLLECT_URL'\n\nexport const collectTitle = (title) => {\n return {\n type: 'COLLECT_TITLE',\n title: title\n }\n}\n\nexport const collectDescription = (description) => {\n return {\n type: 'COLLECT_DESCRIPTION',\n description: description\n }\n}\n\nexport const collectUrl = (url) => {\n return {\n type: 'COLLECT_URL',\n url: url\n }\n}\n","import React from 'react'\n\nimport Header from './Header'\nimport Url from './Url'\nimport Title from './Title'\nimport Description from './Description'\nimport Preview from './Preview'\nimport PopUp from './PopUp'\nimport LowerSect from './LowerSect'\n\nclass App extends React.Component {\n render () {\n return (\n <div className=\"main-container\">\n <PopUp />\n <Header />\n <div className=\"input-container\">\n <h2>Enter your meta tags here</h2>\n <Url />\n <Title />\n <Description />\n </div>\n <Preview />\n <LowerSect />\n </div>\n )\n }\n}\n\nexport default App\n","import React from 'react'\nimport { connect } from 'react-redux'\nimport { collectDescription } from '../actions'\n\nfunction handleChange (e, dispatch) {\n dispatch(collectDescription(e.target.value))\n}\n\nclass Description extends React.Component {\n render () {\n return (\n <div>\n <p className=\"description-label\">Description</p>\n <input \n type=\"text\"\n id=\"description\"\n className=\"description-input\"\n placeholder=\"Start writing your description here\"\n onChange={e => handleChange(e, this.props.dispatch)}\n >\n </input>\n </div>\n )\n }\n}\n\nconst mapStateToProps = state => {\n return {\n description: state.description\n }\n}\n\nexport default connect(mapStateToProps)(Description)\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nconst start = 'Be sure to keep your descriptions within 120-158 characters.'\nconst warning = 'Be sure to keep your descriptions within 120-158 characters. Currently it is:'\nconst perfect = 'Great work, your description is the ideal length!'\n\nlet characterCount = ''\nlet textColor = 'defaultColor'\nlet text = ''\n\nclass DescriptionCharCount extends React.Component {\n render () {\n if (this.props.description) {\n characterCount = this.props.description.length\n } else {\n characterCount = 0\n }\n\n if (characterCount === 0) {\n textColor = 'defaultColor'\n text = start\n } else if (characterCount < 120 || characterCount > 158) {\n textColor = 'warningColor'\n text = warning\n } else {\n textColor = 'optimalColor'\n text = perfect\n }\n return (\n <div>\n <p className={textColor}>{text} {characterCount} characters</p>\n </div>\n )\n }\n}\n\nconst mapStateToProps = state => {\n return {\n description: state.description\n }\n}\n\nexport default connect(mapStateToProps)(DescriptionCharCount)\n","import React from 'react'\n\nclass Header extends React.Component {\n render () {\n return (\n <div className=\"header-container\">\n <h1>Meta Data Checker</h1>\n </div>\n )\n }\n}\n\nexport default Header\n","import React from 'react'\n\nimport db from '../firebase'\nimport { downloadFile } from 'download-csv'\n\nimport jsonexport from 'jsonexport'\n\nconst deleteButton = () => {\n deleteUserData()\n}\n\nfunction deleteUserData () {\n db.database().ref('metaData').set(null)\n}\n\nfunction downloadData () {\n const leadsRef = db.database().ref('metaData')\n\n leadsRef.on('value', function (snapshot) {\n let childData = snapshot.val()\n\n jsonexport(childData, function (err, csv) {\n if (err) return console.error(err)\n console.log(csv)\n downloadFile(csv, 'meta-data')\n })\n })\n}\n\nclass LowerSect extends React.Component {\n render () {\n return (\n <div className=\"lower-sect\">\n <button className=\"delete-button\" onClick={() => deleteButton()}>Clear data</button>\n <button className=\"download-button\" onClick={() => downloadData()}>Download data</button>\n </div>\n )\n }\n}\n\nexport default LowerSect\n","import React from 'react'\nimport Popup from 'reactjs-popup'\nimport 'reactjs-popup/dist/index.css'\nimport { connect } from 'react-redux'\n\nclass PopUp extends React.Component {\n render () {\n return (\n <div className=\"popup\">\n <Popup\n trigger={<button className=\"button\"> </> Generate <br></br>Meta Tags </button>}\n modal\n nested\n >\n {close => (\n <div className=\"modal\">\n <button className=\"close\" onClick={close}>\n ×\n </button>\n <div className=\"modal-content\">\n <div className=\"header\"> Your Meta Tags </div>\n <div className=\"content\">\n {' '}\n <!-- Copy this code into the head section of your website -->\n <br />\n <title>{this.props.title}</title>\n <br />\n <meta name="title" content="{this.props.title}">\n <br />\n <meta name="description" content="{this.props.description}"></meta>\n <br />\n </div>\n <div className=\"actions\">\n <button\n className=\"button\"\n onClick={() => {\n console.log('modal closed ')\n close()\n }}\n >\n Exit\n </button>\n </div>\n </div>\n </div>\n )}\n </Popup>\n </div>\n )\n }\n}\n\nconst mapStateToProps = state => {\n return {\n title: state.title,\n description: state.description\n }\n}\n\nexport default connect(mapStateToProps)(PopUp)\n","import React from 'react'\nimport { CopyToClipboard } from 'react-copy-to-clipboard'\nimport { connect } from 'react-redux'\nimport db from '../firebase'\n\nimport TitleCharCount from './TitleCharCount'\nimport DescriptionCharCount from './DescriptionCharCount'\n\nconst carryInfo = (data) => {\n writeUserData(data.url, data.title, data.description)\n}\n\nfunction urlDomain (data) {\n var a = document.createElement('a')\n a.href = data\n return a.hostname\n}\n\nfunction writeUserData (url, title, description) {\n const domain = urlDomain(url)\n const name = domain.split('.').join('')\n db.database().ref('metaData/' + name).set({\n title: title,\n description: description,\n url: url\n })\n}\n\nclass Preview extends React.Component {\n render () {\n return (\n <div className=\"preview-container\">\n <h2>Preview of Your Meta Data</h2>\n <div className=\"google-preview\">\n <h3 className=\"preview-title\">{this.props.title}</h3>\n <p className=\"preview-url\">{this.props.url}</p>\n <p className=\"preview-description\">{this.props.description}</p>\n </div>\n <div className=\"buttons\">\n <CopyToClipboard text={this.props.title} onCopy={this.onCopy}>\n <button>Copy Title</button>\n </CopyToClipboard>\n <CopyToClipboard text={this.props.description} onCopy={this.onCopy}>\n <button>Copy Description</button>\n </CopyToClipboard>\n <button onClick={() => carryInfo(this.props)} className=\"save-button\">Save</button>\n </div>\n <div className=\"count-container\">\n <TitleCharCount />\n <DescriptionCharCount />\n </div>\n </div>\n\n )\n }\n}\n\nconst mapStateToProps = state => {\n return {\n title: state.title,\n description: state.description,\n url: state.url\n }\n}\n\nexport default connect(mapStateToProps)(Preview)\n","import React from 'react'\nimport { connect } from 'react-redux'\nimport { collectTitle } from '../actions'\n\nfunction handleChange (e, dispatch) {\n dispatch(collectTitle(e.target.value))\n}\n\nclass Title extends React.Component {\n render () {\n return (\n <div>\n <p className=\"title-label\">Title</p>\n <input\n type=\"text\"\n id=\"title\"\n className=\"title-input\"\n placeholder=\"Meta Data Checker | Write Your Title Here\"\n onChange={e => handleChange(e, this.props.dispatch)}\n >\n </input>\n </div>\n )\n }\n}\n\nconst mapStateToProps = state => {\n return {\n title: state.title\n }\n}\n\nexport default connect(mapStateToProps)(Title)\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nconst start = 'Be sure to keep your titles within 50-60 characters.'\nconst warning = 'Be sure to keep your titles within 50-60 characters. Currently it is:'\nconst perfect = 'Great work, your title is the ideal length!'\n\nlet characterCount = ''\nlet textColor = 'defaultColor'\nlet text = start\n\nclass TitleCharCount extends React.Component {\n render () {\n if (this.props.title) {\n characterCount = this.props.title.length\n } else {\n characterCount = 0\n }\n\n if (characterCount === 0) {\n textColor = 'defaultColor'\n text = start\n } else if (characterCount < 50 || characterCount > 60) {\n textColor = 'warningColor'\n text = warning\n } else if (characterCount > 50 || characterCount < 60) {\n textColor = 'optimalColor'\n text = perfect\n }\n\n return (\n <div>\n <p className={textColor}>{text} {characterCount} characters</p>\n </div>\n )\n }\n}\n\nconst mapStateToProps = state => {\n return {\n title: state.title\n }\n}\n\nexport default connect(mapStateToProps)(TitleCharCount)\n","import React from 'react'\nimport { connect } from 'react-redux'\nimport { collectUrl } from '../actions'\n\nfunction handleChange (e, dispatch) {\n dispatch(collectUrl(e.target.value))\n}\n\nclass Url extends React.Component {\n render () {\n return (\n <div>\n <p className=\"url-label\">URL</p>\n <div className=\"group\">\n <input\n type=\"text\"\n id=\"url\"\n className=\"url-input\"\n placeholder=\"Write Your URL Here\"\n onChange={e => handleChange(e, this.props.dispatch)}\n >\n </input>\n </div>\n </div>\n )\n }\n}\n\nconst mapStateToProps = state => {\n return {\n url: state.url\n }\n}\n\nexport default connect(mapStateToProps)(Url)\n","import firebase from 'firebase'\n\nconst firebaseConfig = {\n apiKey: 'AIzaSyDlvYyJk13Oa2dIb5TlmuFRvTyfTZ6b-44',\n authDomain: 'meta-data-checker.firebaseapp.com',\n databaseURL: 'https://meta-data-checker.firebaseio.com',\n projectId: 'meta-data-checker',\n storageBucket: 'meta-data-checker.appspot.com',\n messagingSenderId: '275652737293',\n appId: '1:275652737293:web:e32267586219ff64bb1844',\n measurementId: 'G-BP0VV7EMG4'\n}\n\nconst db = firebase.initializeApp(firebaseConfig)\n\nexport default db\n","import React from 'react'\nimport ReactDOM from 'react-dom'\nimport { applyMiddleware, compose, createStore } from 'redux'\nimport { Provider } from 'react-redux'\nimport thunkMiddleware from 'redux-thunk'\n\nimport App from './components/App'\nimport reducers from './reducers'\n\nconst composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose\nconst store = createStore(\n reducers,\n composeEnhancers(applyMiddleware(thunkMiddleware))\n)\n\nReactDOM.render(\n <Provider store={store}>\n <App />\n </Provider>,\n document.getElementById('app')\n)\n","import { COLLECT_DESCRIPTION} from '../actions'\n\nexport default function collectDescription (state = 'Write your meta titles and descriptions here so you can preview how it might look when users see your website in Search Result Pages. ', action) {\n switch (action.type) {\n case COLLECT_DESCRIPTION:\n return action.description\n default:\n return state\n }\n}\n","import { combineReducers } from 'redux'\nimport title from './title'\nimport description from './description'\nimport url from './url'\n\nexport default combineReducers({\n title,\n description,\n url\n})\n","import { COLLECT_TITLE } from '../actions'\n\nexport default function collectTitle (state = 'Meta Data Checker | Preview and Edit Your Tags Here', action) {\n switch (action.type) {\n case COLLECT_TITLE:\n return action.title\n default:\n return state\n }\n}\n","import { COLLECT_URL } from '../actions'\n\nexport default function collectUrl (state = 'http://localhost:3000/', action) {\n switch (action.type) {\n case COLLECT_URL:\n return action.url\n default:\n return state\n }\n}\n","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","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\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","export default function _extends() {\n _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\n return _extends.apply(this, arguments);\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\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\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","import { __awaiter, __generator, __assign } from 'tslib';\nimport firebase from '@firebase/app';\nimport '@firebase/installations';\nimport { Logger } from '@firebase/logger';\nimport { ErrorFactory, calculateBackoffMillis, FirebaseError, validateIndexedDBOpenable, isIndexedDBAvailable, isBrowserExtension, areCookiesEnabled } from '@firebase/util';\nimport { Component } from '@firebase/component';\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// Key to attach FID to in gtag params.\r\nvar GA_FID_KEY = 'firebase_id';\r\nvar ORIGIN_KEY = 'origin';\r\nvar FETCH_TIMEOUT_MILLIS = 60 * 1000;\r\nvar DYNAMIC_CONFIG_URL = 'https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig';\r\nvar GTAG_URL = 'https://www.googletagmanager.com/gtag/js';\r\nvar GtagCommand;\r\n(function (GtagCommand) {\r\n GtagCommand[\"EVENT\"] = \"event\";\r\n GtagCommand[\"SET\"] = \"set\";\r\n GtagCommand[\"CONFIG\"] = \"config\";\r\n})(GtagCommand || (GtagCommand = {}));\r\n/*\r\n * Officially recommended event names for gtag.js\r\n * Any other string is also allowed.\r\n */\r\nvar EventName;\r\n(function (EventName) {\r\n EventName[\"ADD_SHIPPING_INFO\"] = \"add_shipping_info\";\r\n EventName[\"ADD_PAYMENT_INFO\"] = \"add_payment_info\";\r\n EventName[\"ADD_TO_CART\"] = \"add_to_cart\";\r\n EventName[\"ADD_TO_WISHLIST\"] = \"add_to_wishlist\";\r\n EventName[\"BEGIN_CHECKOUT\"] = \"begin_checkout\";\r\n /** @deprecated */\r\n EventName[\"CHECKOUT_PROGRESS\"] = \"checkout_progress\";\r\n EventName[\"EXCEPTION\"] = \"exception\";\r\n EventName[\"GENERATE_LEAD\"] = \"generate_lead\";\r\n EventName[\"LOGIN\"] = \"login\";\r\n EventName[\"PAGE_VIEW\"] = \"page_view\";\r\n EventName[\"PURCHASE\"] = \"purchase\";\r\n EventName[\"REFUND\"] = \"refund\";\r\n EventName[\"REMOVE_FROM_CART\"] = \"remove_from_cart\";\r\n EventName[\"SCREEN_VIEW\"] = \"screen_view\";\r\n EventName[\"SEARCH\"] = \"search\";\r\n EventName[\"SELECT_CONTENT\"] = \"select_content\";\r\n EventName[\"SELECT_ITEM\"] = \"select_item\";\r\n EventName[\"SELECT_PROMOTION\"] = \"select_promotion\";\r\n /** @deprecated */\r\n EventName[\"SET_CHECKOUT_OPTION\"] = \"set_checkout_option\";\r\n EventName[\"SHARE\"] = \"share\";\r\n EventName[\"SIGN_UP\"] = \"sign_up\";\r\n EventName[\"TIMING_COMPLETE\"] = \"timing_complete\";\r\n EventName[\"VIEW_CART\"] = \"view_cart\";\r\n EventName[\"VIEW_ITEM\"] = \"view_item\";\r\n EventName[\"VIEW_ITEM_LIST\"] = \"view_item_list\";\r\n EventName[\"VIEW_PROMOTION\"] = \"view_promotion\";\r\n EventName[\"VIEW_SEARCH_RESULTS\"] = \"view_search_results\";\r\n})(EventName || (EventName = {}));\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Logs an analytics event through the Firebase SDK.\r\n *\r\n * @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event\r\n * @param eventName Google Analytics event name, choose from standard list or use a custom string.\r\n * @param eventParams Analytics event parameters.\r\n */\r\nfunction logEvent(gtagFunction, initializationPromise, eventName, eventParams, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var measurementId, params;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!(options && options.global)) return [3 /*break*/, 1];\r\n gtagFunction(GtagCommand.EVENT, eventName, eventParams);\r\n return [2 /*return*/];\r\n case 1: return [4 /*yield*/, initializationPromise];\r\n case 2:\r\n measurementId = _a.sent();\r\n params = __assign(__assign({}, eventParams), { 'send_to': measurementId });\r\n gtagFunction(GtagCommand.EVENT, eventName, params);\r\n _a.label = 3;\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Set screen_name parameter for this Google Analytics ID.\r\n *\r\n * @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event\r\n * @param screenName Screen name string to set.\r\n */\r\nfunction setCurrentScreen(gtagFunction, initializationPromise, screenName, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var measurementId;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!(options && options.global)) return [3 /*break*/, 1];\r\n gtagFunction(GtagCommand.SET, { 'screen_name': screenName });\r\n return [2 /*return*/, Promise.resolve()];\r\n case 1: return [4 /*yield*/, initializationPromise];\r\n case 2:\r\n measurementId = _a.sent();\r\n gtagFunction(GtagCommand.CONFIG, measurementId, {\r\n update: true,\r\n 'screen_name': screenName\r\n });\r\n _a.label = 3;\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Set user_id parameter for this Google Analytics ID.\r\n *\r\n * @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event\r\n * @param id User ID string to set\r\n */\r\nfunction setUserId(gtagFunction, initializationPromise, id, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var measurementId;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!(options && options.global)) return [3 /*break*/, 1];\r\n gtagFunction(GtagCommand.SET, { 'user_id': id });\r\n return [2 /*return*/, Promise.resolve()];\r\n case 1: return [4 /*yield*/, initializationPromise];\r\n case 2:\r\n measurementId = _a.sent();\r\n gtagFunction(GtagCommand.CONFIG, measurementId, {\r\n update: true,\r\n 'user_id': id\r\n });\r\n _a.label = 3;\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Set all other user properties other than user_id and screen_name.\r\n *\r\n * @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event\r\n * @param properties Map of user properties to set\r\n */\r\nfunction setUserProperties(gtagFunction, initializationPromise, properties, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var flatProperties, _i, _a, key, measurementId;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n if (!(options && options.global)) return [3 /*break*/, 1];\r\n flatProperties = {};\r\n for (_i = 0, _a = Object.keys(properties); _i < _a.length; _i++) {\r\n key = _a[_i];\r\n // use dot notation for merge behavior in gtag.js\r\n flatProperties[\"user_properties.\" + key] = properties[key];\r\n }\r\n gtagFunction(GtagCommand.SET, flatProperties);\r\n return [2 /*return*/, Promise.resolve()];\r\n case 1: return [4 /*yield*/, initializationPromise];\r\n case 2:\r\n measurementId = _b.sent();\r\n gtagFunction(GtagCommand.CONFIG, measurementId, {\r\n update: true,\r\n 'user_properties': properties\r\n });\r\n _b.label = 3;\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Set whether collection is enabled for this ID.\r\n *\r\n * @param enabled If true, collection is enabled for this ID.\r\n */\r\nfunction setAnalyticsCollectionEnabled(initializationPromise, enabled) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var measurementId;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, initializationPromise];\r\n case 1:\r\n measurementId = _a.sent();\r\n window[\"ga-disable-\" + measurementId] = !enabled;\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar logger = new Logger('@firebase/analytics');\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Inserts gtag script tag into the page to asynchronously download gtag.\r\n * @param dataLayerName Name of datalayer (most often the default, \"_dataLayer\").\r\n */\r\nfunction insertScriptTag(dataLayerName) {\r\n var script = document.createElement('script');\r\n // We are not providing an analyticsId in the URL because it would trigger a `page_view`\r\n // without fid. We will initialize ga-id using gtag (config) command together with fid.\r\n script.src = GTAG_URL + \"?l=\" + dataLayerName;\r\n script.async = true;\r\n document.head.appendChild(script);\r\n}\r\n/**\r\n * Get reference to, or create, global datalayer.\r\n * @param dataLayerName Name of datalayer (most often the default, \"_dataLayer\").\r\n */\r\nfunction getOrCreateDataLayer(dataLayerName) {\r\n // Check for existing dataLayer and create if needed.\r\n var dataLayer = [];\r\n if (Array.isArray(window[dataLayerName])) {\r\n dataLayer = window[dataLayerName];\r\n }\r\n else {\r\n window[dataLayerName] = dataLayer;\r\n }\r\n return dataLayer;\r\n}\r\n/**\r\n * Wrapped gtag logic when gtag is called with 'config' command.\r\n *\r\n * @param gtagCore Basic gtag function that just appends to dataLayer.\r\n * @param initializationPromisesMap Map of appIds to their initialization promises.\r\n * @param dynamicConfigPromisesList Array of dynamic config fetch promises.\r\n * @param measurementIdToAppId Map of GA measurementIDs to corresponding Firebase appId.\r\n * @param measurementId GA Measurement ID to set config for.\r\n * @param gtagParams Gtag config params to set.\r\n */\r\nfunction gtagOnConfig(gtagCore, initializationPromisesMap, dynamicConfigPromisesList, measurementIdToAppId, measurementId, gtagParams) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var correspondingAppId, dynamicConfigResults, foundConfig, e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n correspondingAppId = measurementIdToAppId[measurementId];\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 7, , 8]);\r\n if (!correspondingAppId) return [3 /*break*/, 3];\r\n return [4 /*yield*/, initializationPromisesMap[correspondingAppId]];\r\n case 2:\r\n _a.sent();\r\n return [3 /*break*/, 6];\r\n case 3: return [4 /*yield*/, Promise.all(dynamicConfigPromisesList)];\r\n case 4:\r\n dynamicConfigResults = _a.sent();\r\n foundConfig = dynamicConfigResults.find(function (config) { return config.measurementId === measurementId; });\r\n if (!foundConfig) return [3 /*break*/, 6];\r\n return [4 /*yield*/, initializationPromisesMap[foundConfig.appId]];\r\n case 5:\r\n _a.sent();\r\n _a.label = 6;\r\n case 6: return [3 /*break*/, 8];\r\n case 7:\r\n e_1 = _a.sent();\r\n logger.error(e_1);\r\n return [3 /*break*/, 8];\r\n case 8:\r\n gtagCore(GtagCommand.CONFIG, measurementId, gtagParams);\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Wrapped gtag logic when gtag is called with 'event' command.\r\n *\r\n * @param gtagCore Basic gtag function that just appends to dataLayer.\r\n * @param initializationPromisesMap Map of appIds to their initialization promises.\r\n * @param dynamicConfigPromisesList Array of dynamic config fetch promises.\r\n * @param measurementId GA Measurement ID to log event to.\r\n * @param gtagParams Params to log with this event.\r\n */\r\nfunction gtagOnEvent(gtagCore, initializationPromisesMap, dynamicConfigPromisesList, measurementId, gtagParams) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var initializationPromisesToWaitFor, gaSendToList, dynamicConfigResults, _loop_1, _i, gaSendToList_1, sendToId, state_1, e_2;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 4, , 5]);\r\n initializationPromisesToWaitFor = [];\r\n if (!(gtagParams && gtagParams['send_to'])) return [3 /*break*/, 2];\r\n gaSendToList = gtagParams['send_to'];\r\n // Make it an array if is isn't, so it can be dealt with the same way.\r\n if (!Array.isArray(gaSendToList)) {\r\n gaSendToList = [gaSendToList];\r\n }\r\n return [4 /*yield*/, Promise.all(dynamicConfigPromisesList)];\r\n case 1:\r\n dynamicConfigResults = _a.sent();\r\n _loop_1 = function (sendToId) {\r\n // Any fetched dynamic measurement ID that matches this 'send_to' ID\r\n var foundConfig = dynamicConfigResults.find(function (config) { return config.measurementId === sendToId; });\r\n var initializationPromise = foundConfig && initializationPromisesMap[foundConfig.appId];\r\n if (initializationPromise) {\r\n initializationPromisesToWaitFor.push(initializationPromise);\r\n }\r\n else {\r\n // Found an item in 'send_to' that is not associated\r\n // directly with an FID, possibly a group. Empty this array,\r\n // exit the loop early, and let it get populated below.\r\n initializationPromisesToWaitFor = [];\r\n return \"break\";\r\n }\r\n };\r\n for (_i = 0, gaSendToList_1 = gaSendToList; _i < gaSendToList_1.length; _i++) {\r\n sendToId = gaSendToList_1[_i];\r\n state_1 = _loop_1(sendToId);\r\n if (state_1 === \"break\")\r\n break;\r\n }\r\n _a.label = 2;\r\n case 2:\r\n // This will be unpopulated if there was no 'send_to' field , or\r\n // if not all entries in the 'send_to' field could be mapped to\r\n // a FID. In these cases, wait on all pending initialization promises.\r\n if (initializationPromisesToWaitFor.length === 0) {\r\n initializationPromisesToWaitFor = Object.values(initializationPromisesMap);\r\n }\r\n // Run core gtag function with args after all relevant initialization\r\n // promises have been resolved.\r\n return [4 /*yield*/, Promise.all(initializationPromisesToWaitFor)];\r\n case 3:\r\n // Run core gtag function with args after all relevant initialization\r\n // promises have been resolved.\r\n _a.sent();\r\n // Workaround for http://b/141370449 - third argument cannot be undefined.\r\n gtagCore(GtagCommand.EVENT, measurementId, gtagParams || {});\r\n return [3 /*break*/, 5];\r\n case 4:\r\n e_2 = _a.sent();\r\n logger.error(e_2);\r\n return [3 /*break*/, 5];\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Wraps a standard gtag function with extra code to wait for completion of\r\n * relevant initialization promises before sending requests.\r\n *\r\n * @param gtagCore Basic gtag function that just appends to dataLayer.\r\n * @param initializationPromisesMap Map of appIds to their initialization promises.\r\n * @param dynamicConfigPromisesList Array of dynamic config fetch promises.\r\n * @param measurementIdToAppId Map of GA measurementIDs to corresponding Firebase appId.\r\n */\r\nfunction wrapGtag(gtagCore, \r\n/**\r\n * Allows wrapped gtag calls to wait on whichever intialization promises are required,\r\n * depending on the contents of the gtag params' `send_to` field, if any.\r\n */\r\ninitializationPromisesMap, \r\n/**\r\n * Wrapped gtag calls sometimes require all dynamic config fetches to have returned\r\n * before determining what initialization promises (which include FIDs) to wait for.\r\n */\r\ndynamicConfigPromisesList, \r\n/**\r\n * Wrapped gtag config calls can narrow down which initialization promise (with FID)\r\n * to wait for if the measurementId is already fetched, by getting the corresponding appId,\r\n * which is the key for the initialization promises map.\r\n */\r\nmeasurementIdToAppId) {\r\n /**\r\n * Wrapper around gtag that ensures FID is sent with gtag calls.\r\n * @param command Gtag command type.\r\n * @param idOrNameOrParams Measurement ID if command is EVENT/CONFIG, params if command is SET.\r\n * @param gtagParams Params if event is EVENT/CONFIG.\r\n */\r\n function gtagWrapper(command, idOrNameOrParams, gtagParams) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var e_3;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 6, , 7]);\r\n if (!(command === GtagCommand.EVENT)) return [3 /*break*/, 2];\r\n // If EVENT, second arg must be measurementId.\r\n return [4 /*yield*/, gtagOnEvent(gtagCore, initializationPromisesMap, dynamicConfigPromisesList, idOrNameOrParams, gtagParams)];\r\n case 1:\r\n // If EVENT, second arg must be measurementId.\r\n _a.sent();\r\n return [3 /*break*/, 5];\r\n case 2:\r\n if (!(command === GtagCommand.CONFIG)) return [3 /*break*/, 4];\r\n // If CONFIG, second arg must be measurementId.\r\n return [4 /*yield*/, gtagOnConfig(gtagCore, initializationPromisesMap, dynamicConfigPromisesList, measurementIdToAppId, idOrNameOrParams, gtagParams)];\r\n case 3:\r\n // If CONFIG, second arg must be measurementId.\r\n _a.sent();\r\n return [3 /*break*/, 5];\r\n case 4:\r\n // If SET, second arg must be params.\r\n gtagCore(GtagCommand.SET, idOrNameOrParams);\r\n _a.label = 5;\r\n case 5: return [3 /*break*/, 7];\r\n case 6:\r\n e_3 = _a.sent();\r\n logger.error(e_3);\r\n return [3 /*break*/, 7];\r\n case 7: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n }\r\n return gtagWrapper;\r\n}\r\n/**\r\n * Creates global gtag function or wraps existing one if found.\r\n * This wrapped function attaches Firebase instance ID (FID) to gtag 'config' and\r\n * 'event' calls that belong to the GAID associated with this Firebase instance.\r\n *\r\n * @param initializationPromisesMap Map of appIds to their initialization promises.\r\n * @param dynamicConfigPromisesList Array of dynamic config fetch promises.\r\n * @param measurementIdToAppId Map of GA measurementIDs to corresponding Firebase appId.\r\n * @param dataLayerName Name of global GA datalayer array.\r\n * @param gtagFunctionName Name of global gtag function (\"gtag\" if not user-specified).\r\n */\r\nfunction wrapOrCreateGtag(initializationPromisesMap, dynamicConfigPromisesList, measurementIdToAppId, dataLayerName, gtagFunctionName) {\r\n // Create a basic core gtag function\r\n var gtagCore = function () {\r\n var _args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n _args[_i] = arguments[_i];\r\n }\r\n // Must push IArguments object, not an array.\r\n window[dataLayerName].push(arguments);\r\n };\r\n // Replace it with existing one if found\r\n if (window[gtagFunctionName] &&\r\n typeof window[gtagFunctionName] === 'function') {\r\n // @ts-ignore\r\n gtagCore = window[gtagFunctionName];\r\n }\r\n window[gtagFunctionName] = wrapGtag(gtagCore, initializationPromisesMap, dynamicConfigPromisesList, measurementIdToAppId);\r\n return {\r\n gtagCore: gtagCore,\r\n wrappedGtag: window[gtagFunctionName]\r\n };\r\n}\r\n/**\r\n * Returns first script tag in DOM matching our gtag url pattern.\r\n */\r\nfunction findGtagScriptOnPage() {\r\n var scriptTags = window.document.getElementsByTagName('script');\r\n for (var _i = 0, _a = Object.values(scriptTags); _i < _a.length; _i++) {\r\n var tag = _a[_i];\r\n if (tag.src && tag.src.includes(GTAG_URL)) {\r\n return tag;\r\n }\r\n }\r\n return null;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar _a;\r\nvar ERRORS = (_a = {},\r\n _a[\"already-exists\" /* ALREADY_EXISTS */] = 'A Firebase Analytics instance with the appId {$id} ' +\r\n ' already exists. ' +\r\n 'Only one Firebase Analytics instance can be created for each appId.',\r\n _a[\"already-initialized\" /* ALREADY_INITIALIZED */] = 'Firebase Analytics has already been initialized.' +\r\n 'settings() must be called before initializing any Analytics instance' +\r\n 'or it will have no effect.',\r\n _a[\"interop-component-reg-failed\" /* INTEROP_COMPONENT_REG_FAILED */] = 'Firebase Analytics Interop Component failed to instantiate: {$reason}',\r\n _a[\"invalid-analytics-context\" /* INVALID_ANALYTICS_CONTEXT */] = 'Firebase Analytics is not supported in this environment. ' +\r\n 'Wrap initialization of analytics in analytics.isSupported() ' +\r\n 'to prevent initialization in unsupported environments. Details: {$errorInfo}',\r\n _a[\"indexeddb-unavailable\" /* INDEXEDDB_UNAVAILABLE */] = 'IndexedDB unavailable or restricted in this environment. ' +\r\n 'Wrap initialization of analytics in analytics.isSupported() ' +\r\n 'to prevent initialization in unsupported environments. Details: {$errorInfo}',\r\n _a[\"fetch-throttle\" /* FETCH_THROTTLE */] = 'The config fetch request timed out while in an exponential backoff state.' +\r\n ' Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.',\r\n _a[\"config-fetch-failed\" /* CONFIG_FETCH_FAILED */] = 'Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}',\r\n _a[\"no-api-key\" /* NO_API_KEY */] = 'The \"apiKey\" field is empty in the local Firebase config. Firebase Analytics requires this field to' +\r\n 'contain a valid API key.',\r\n _a[\"no-app-id\" /* NO_APP_ID */] = 'The \"appId\" field is empty in the local Firebase config. Firebase Analytics requires this field to' +\r\n 'contain a valid app ID.',\r\n _a);\r\nvar ERROR_FACTORY = new ErrorFactory('analytics', 'Analytics', ERRORS);\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Backoff factor for 503 errors, which we want to be conservative about\r\n * to avoid overloading servers. Each retry interval will be\r\n * BASE_INTERVAL_MILLIS * LONG_RETRY_FACTOR ^ retryCount, so the second one\r\n * will be ~30 seconds (with fuzzing).\r\n */\r\nvar LONG_RETRY_FACTOR = 30;\r\n/**\r\n * Base wait interval to multiplied by backoffFactor^backoffCount.\r\n */\r\nvar BASE_INTERVAL_MILLIS = 1000;\r\n/**\r\n * Stubbable retry data storage class.\r\n */\r\nvar RetryData = /** @class */ (function () {\r\n function RetryData(throttleMetadata, intervalMillis) {\r\n if (throttleMetadata === void 0) { throttleMetadata = {}; }\r\n if (intervalMillis === void 0) { intervalMillis = BASE_INTERVAL_MILLIS; }\r\n this.throttleMetadata = throttleMetadata;\r\n this.intervalMillis = intervalMillis;\r\n }\r\n RetryData.prototype.getThrottleMetadata = function (appId) {\r\n return this.throttleMetadata[appId];\r\n };\r\n RetryData.prototype.setThrottleMetadata = function (appId, metadata) {\r\n this.throttleMetadata[appId] = metadata;\r\n };\r\n RetryData.prototype.deleteThrottleMetadata = function (appId) {\r\n delete this.throttleMetadata[appId];\r\n };\r\n return RetryData;\r\n}());\r\nvar defaultRetryData = new RetryData();\r\n/**\r\n * Set GET request headers.\r\n * @param apiKey App API key.\r\n */\r\nfunction getHeaders(apiKey) {\r\n return new Headers({\r\n Accept: 'application/json',\r\n 'x-goog-api-key': apiKey\r\n });\r\n}\r\n/**\r\n * Fetches dynamic config from backend.\r\n * @param app Firebase app to fetch config for.\r\n */\r\nfunction fetchDynamicConfig(appFields) {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var appId, apiKey, request, appUrl, response, errorMessage, jsonResponse, _ignored_1;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n appId = appFields.appId, apiKey = appFields.apiKey;\r\n request = {\r\n method: 'GET',\r\n headers: getHeaders(apiKey)\r\n };\r\n appUrl = DYNAMIC_CONFIG_URL.replace('{app-id}', appId);\r\n return [4 /*yield*/, fetch(appUrl, request)];\r\n case 1:\r\n response = _b.sent();\r\n if (!(response.status !== 200 && response.status !== 304)) return [3 /*break*/, 6];\r\n errorMessage = '';\r\n _b.label = 2;\r\n case 2:\r\n _b.trys.push([2, 4, , 5]);\r\n return [4 /*yield*/, response.json()];\r\n case 3:\r\n jsonResponse = (_b.sent());\r\n if ((_a = jsonResponse.error) === null || _a === void 0 ? void 0 : _a.message) {\r\n errorMessage = jsonResponse.error.message;\r\n }\r\n return [3 /*break*/, 5];\r\n case 4:\r\n _ignored_1 = _b.sent();\r\n return [3 /*break*/, 5];\r\n case 5: throw ERROR_FACTORY.create(\"config-fetch-failed\" /* CONFIG_FETCH_FAILED */, {\r\n httpStatus: response.status,\r\n responseMessage: errorMessage\r\n });\r\n case 6: return [2 /*return*/, response.json()];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Fetches dynamic config from backend, retrying if failed.\r\n * @param app Firebase app to fetch config for.\r\n */\r\nfunction fetchDynamicConfigWithRetry(app, \r\n// retryData and timeoutMillis are parameterized to allow passing a different value for testing.\r\nretryData, timeoutMillis) {\r\n if (retryData === void 0) { retryData = defaultRetryData; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _a, appId, apiKey, measurementId, throttleMetadata, signal;\r\n var _this = this;\r\n return __generator(this, function (_b) {\r\n _a = app.options, appId = _a.appId, apiKey = _a.apiKey, measurementId = _a.measurementId;\r\n if (!appId) {\r\n throw ERROR_FACTORY.create(\"no-app-id\" /* NO_APP_ID */);\r\n }\r\n if (!apiKey) {\r\n if (measurementId) {\r\n return [2 /*return*/, {\r\n measurementId: measurementId,\r\n appId: appId\r\n }];\r\n }\r\n throw ERROR_FACTORY.create(\"no-api-key\" /* NO_API_KEY */);\r\n }\r\n throttleMetadata = retryData.getThrottleMetadata(appId) || {\r\n backoffCount: 0,\r\n throttleEndTimeMillis: Date.now()\r\n };\r\n signal = new AnalyticsAbortSignal();\r\n setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n // Note a very low delay, eg < 10ms, can elapse before listeners are initialized.\r\n signal.abort();\r\n return [2 /*return*/];\r\n });\r\n }); }, timeoutMillis !== undefined ? timeoutMillis : FETCH_TIMEOUT_MILLIS);\r\n return [2 /*return*/, attemptFetchDynamicConfigWithRetry({ appId: appId, apiKey: apiKey, measurementId: measurementId }, throttleMetadata, signal, retryData)];\r\n });\r\n });\r\n}\r\n/**\r\n * Runs one retry attempt.\r\n * @param appFields Necessary app config fields.\r\n * @param throttleMetadata Ongoing metadata to determine throttling times.\r\n * @param signal Abort signal.\r\n */\r\nfunction attemptFetchDynamicConfigWithRetry(appFields, _a, signal, retryData // for testing\r\n) {\r\n var throttleEndTimeMillis = _a.throttleEndTimeMillis, backoffCount = _a.backoffCount;\r\n if (retryData === void 0) { retryData = defaultRetryData; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var appId, measurementId, e_1, response, e_2, backoffMillis, throttleMetadata;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n appId = appFields.appId, measurementId = appFields.measurementId;\r\n _b.label = 1;\r\n case 1:\r\n _b.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, setAbortableTimeout(signal, throttleEndTimeMillis)];\r\n case 2:\r\n _b.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n e_1 = _b.sent();\r\n if (measurementId) {\r\n logger.warn(\"Timed out fetching this Firebase app's measurement ID from the server.\" +\r\n (\" Falling back to the measurement ID \" + measurementId) +\r\n (\" provided in the \\\"measurementId\\\" field in the local Firebase config. [\" + e_1.message + \"]\"));\r\n return [2 /*return*/, { appId: appId, measurementId: measurementId }];\r\n }\r\n throw e_1;\r\n case 4:\r\n _b.trys.push([4, 6, , 7]);\r\n return [4 /*yield*/, fetchDynamicConfig(appFields)];\r\n case 5:\r\n response = _b.sent();\r\n // Note the SDK only clears throttle state if response is success or non-retriable.\r\n retryData.deleteThrottleMetadata(appId);\r\n return [2 /*return*/, response];\r\n case 6:\r\n e_2 = _b.sent();\r\n if (!isRetriableError(e_2)) {\r\n retryData.deleteThrottleMetadata(appId);\r\n if (measurementId) {\r\n logger.warn(\"Failed to fetch this Firebase app's measurement ID from the server.\" +\r\n (\" Falling back to the measurement ID \" + measurementId) +\r\n (\" provided in the \\\"measurementId\\\" field in the local Firebase config. [\" + e_2.message + \"]\"));\r\n return [2 /*return*/, { appId: appId, measurementId: measurementId }];\r\n }\r\n else {\r\n throw e_2;\r\n }\r\n }\r\n backoffMillis = Number(e_2.customData.httpStatus) === 503\r\n ? calculateBackoffMillis(backoffCount, retryData.intervalMillis, LONG_RETRY_FACTOR)\r\n : calculateBackoffMillis(backoffCount, retryData.intervalMillis);\r\n throttleMetadata = {\r\n throttleEndTimeMillis: Date.now() + backoffMillis,\r\n backoffCount: backoffCount + 1\r\n };\r\n // Persists state.\r\n retryData.setThrottleMetadata(appId, throttleMetadata);\r\n logger.debug(\"Calling attemptFetch again in \" + backoffMillis + \" millis\");\r\n return [2 /*return*/, attemptFetchDynamicConfigWithRetry(appFields, throttleMetadata, signal, retryData)];\r\n case 7: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Supports waiting on a backoff by:\r\n *\r\n * <ul>\r\n * <li>Promisifying setTimeout, so we can set a timeout in our Promise chain</li>\r\n * <li>Listening on a signal bus for abort events, just like the Fetch API</li>\r\n * <li>Failing in the same way the Fetch API fails, so timing out a live request and a throttled\r\n * request appear the same.</li>\r\n * </ul>\r\n *\r\n * <p>Visible for testing.\r\n */\r\nfunction setAbortableTimeout(signal, throttleEndTimeMillis) {\r\n return new Promise(function (resolve, reject) {\r\n // Derives backoff from given end time, normalizing negative numbers to zero.\r\n var backoffMillis = Math.max(throttleEndTimeMillis - Date.now(), 0);\r\n var timeout = setTimeout(resolve, backoffMillis);\r\n // Adds listener, rather than sets onabort, because signal is a shared object.\r\n signal.addEventListener(function () {\r\n clearTimeout(timeout);\r\n // If the request completes before this timeout, the rejection has no effect.\r\n reject(ERROR_FACTORY.create(\"fetch-throttle\" /* FETCH_THROTTLE */, {\r\n throttleEndTimeMillis: throttleEndTimeMillis\r\n }));\r\n });\r\n });\r\n}\r\n/**\r\n * Returns true if the {@link Error} indicates a fetch request may succeed later.\r\n */\r\nfunction isRetriableError(e) {\r\n if (!(e instanceof FirebaseError) || !e.customData) {\r\n return false;\r\n }\r\n // Uses string index defined by ErrorData, which FirebaseError implements.\r\n var httpStatus = Number(e.customData['httpStatus']);\r\n return (httpStatus === 429 ||\r\n httpStatus === 500 ||\r\n httpStatus === 503 ||\r\n httpStatus === 504);\r\n}\r\n/**\r\n * Shims a minimal AbortSignal (copied from Remote Config).\r\n *\r\n * <p>AbortController's AbortSignal conveniently decouples fetch timeout logic from other aspects\r\n * of networking, such as retries. Firebase doesn't use AbortController enough to justify a\r\n * polyfill recommendation, like we do with the Fetch API, but this minimal shim can easily be\r\n * swapped out if/when we do.\r\n */\r\nvar AnalyticsAbortSignal = /** @class */ (function () {\r\n function AnalyticsAbortSignal() {\r\n this.listeners = [];\r\n }\r\n AnalyticsAbortSignal.prototype.addEventListener = function (listener) {\r\n this.listeners.push(listener);\r\n };\r\n AnalyticsAbortSignal.prototype.abort = function () {\r\n this.listeners.forEach(function (listener) { return listener(); });\r\n };\r\n return AnalyticsAbortSignal;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction validateIndexedDB() {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!!isIndexedDBAvailable()) return [3 /*break*/, 1];\r\n logger.warn(ERROR_FACTORY.create(\"indexeddb-unavailable\" /* INDEXEDDB_UNAVAILABLE */, {\r\n errorInfo: 'IndexedDB is not available in this environment.'\r\n }).message);\r\n return [2 /*return*/, false];\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, validateIndexedDBOpenable()];\r\n case 2:\r\n _a.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n e_1 = _a.sent();\r\n logger.warn(ERROR_FACTORY.create(\"indexeddb-unavailable\" /* INDEXEDDB_UNAVAILABLE */, {\r\n errorInfo: e_1\r\n }).message);\r\n return [2 /*return*/, false];\r\n case 4: return [2 /*return*/, true];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Initialize the analytics instance in gtag.js by calling config command with fid.\r\n *\r\n * NOTE: We combine analytics initialization and setting fid together because we want fid to be\r\n * part of the `page_view` event that's sent during the initialization\r\n * @param app Firebase app\r\n * @param gtagCore The gtag function that's not wrapped.\r\n * @param dynamicConfigPromisesList Array of all dynamic config promises.\r\n * @param measurementIdToAppId Maps measurementID to appID.\r\n * @param installations FirebaseInstallations instance.\r\n *\r\n * @returns Measurement ID.\r\n */\r\nfunction initializeIds(app, dynamicConfigPromisesList, measurementIdToAppId, installations, gtagCore) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var dynamicConfigPromise, fidPromise, _a, dynamicConfig, fid, configProperties;\r\n var _b;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n dynamicConfigPromise = fetchDynamicConfigWithRetry(app);\r\n // Once fetched, map measurementIds to appId, for ease of lookup in wrapped gtag function.\r\n dynamicConfigPromise\r\n .then(function (config) {\r\n measurementIdToAppId[config.measurementId] = config.appId;\r\n if (app.options.measurementId &&\r\n config.measurementId !== app.options.measurementId) {\r\n logger.warn(\"The measurement ID in the local Firebase config (\" + app.options.measurementId + \")\" +\r\n (\" does not match the measurement ID fetched from the server (\" + config.measurementId + \").\") +\r\n \" To ensure analytics events are always sent to the correct Analytics property,\" +\r\n \" update the\" +\r\n \" measurement ID field in the local config or remove it from the local config.\");\r\n }\r\n })\r\n .catch(function (e) { return logger.error(e); });\r\n // Add to list to track state of all dynamic config promises.\r\n dynamicConfigPromisesList.push(dynamicConfigPromise);\r\n fidPromise = validateIndexedDB().then(function (envIsValid) {\r\n if (envIsValid) {\r\n return installations.getId();\r\n }\r\n else {\r\n return undefined;\r\n }\r\n });\r\n return [4 /*yield*/, Promise.all([\r\n dynamicConfigPromise,\r\n fidPromise\r\n ])];\r\n case 1:\r\n _a = _c.sent(), dynamicConfig = _a[0], fid = _a[1];\r\n // This command initializes gtag.js and only needs to be called once for the entire web app,\r\n // but since it is idempotent, we can call it multiple times.\r\n // We keep it together with other initialization logic for better code structure.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n gtagCore('js', new Date());\r\n configProperties = (_b = {},\r\n // guard against developers accidentally setting properties with prefix `firebase_`\r\n _b[ORIGIN_KEY] = 'firebase',\r\n _b.update = true,\r\n _b);\r\n if (fid != null) {\r\n configProperties[GA_FID_KEY] = fid;\r\n }\r\n // It should be the first config command called on this GA-ID\r\n // Initialize this GA-ID and set FID on it using the gtag config API.\r\n gtagCore(GtagCommand.CONFIG, dynamicConfig.measurementId, configProperties);\r\n return [2 /*return*/, dynamicConfig.measurementId];\r\n }\r\n });\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Maps appId to full initialization promise. Wrapped gtag calls must wait on\r\n * all or some of these, depending on the call's `send_to` param and the status\r\n * of the dynamic config fetches (see below).\r\n */\r\nvar initializationPromisesMap = {};\r\n/**\r\n * List of dynamic config fetch promises. In certain cases, wrapped gtag calls\r\n * wait on all these to be complete in order to determine if it can selectively\r\n * wait for only certain initialization (FID) promises or if it must wait for all.\r\n */\r\nvar dynamicConfigPromisesList = [];\r\n/**\r\n * Maps fetched measurementIds to appId. Populated when the app's dynamic config\r\n * fetch completes. If already populated, gtag config calls can use this to\r\n * selectively wait for only this app's initialization promise (FID) instead of all\r\n * initialization promises.\r\n */\r\nvar measurementIdToAppId = {};\r\n/**\r\n * Name for window global data layer array used by GA: defaults to 'dataLayer'.\r\n */\r\nvar dataLayerName = 'dataLayer';\r\n/**\r\n * Name for window global gtag function used by GA: defaults to 'gtag'.\r\n */\r\nvar gtagName = 'gtag';\r\n/**\r\n * Reproduction of standard gtag function or reference to existing\r\n * gtag function on window object.\r\n */\r\nvar gtagCoreFunction;\r\n/**\r\n * Wrapper around gtag function that ensures FID is sent with all\r\n * relevant event and config calls.\r\n */\r\nvar wrappedGtagFunction;\r\n/**\r\n * Flag to ensure page initialization steps (creation or wrapping of\r\n * dataLayer and gtag script) are only run once per page load.\r\n */\r\nvar globalInitDone = false;\r\n/**\r\n * For testing\r\n */\r\nfunction resetGlobalVars(newGlobalInitDone, newInitializationPromisesMap, newDynamicPromises) {\r\n if (newGlobalInitDone === void 0) { newGlobalInitDone = false; }\r\n if (newInitializationPromisesMap === void 0) { newInitializationPromisesMap = {}; }\r\n if (newDynamicPromises === void 0) { newDynamicPromises = []; }\r\n globalInitDone = newGlobalInitDone;\r\n initializationPromisesMap = newInitializationPromisesMap;\r\n dynamicConfigPromisesList = newDynamicPromises;\r\n dataLayerName = 'dataLayer';\r\n gtagName = 'gtag';\r\n}\r\n/**\r\n * For testing\r\n */\r\nfunction getGlobalVars() {\r\n return {\r\n initializationPromisesMap: initializationPromisesMap,\r\n dynamicConfigPromisesList: dynamicConfigPromisesList\r\n };\r\n}\r\n/**\r\n * This must be run before calling firebase.analytics() or it won't\r\n * have any effect.\r\n * @param options Custom gtag and dataLayer names.\r\n */\r\nfunction settings(options) {\r\n if (globalInitDone) {\r\n throw ERROR_FACTORY.create(\"already-initialized\" /* ALREADY_INITIALIZED */);\r\n }\r\n if (options.dataLayerName) {\r\n dataLayerName = options.dataLayerName;\r\n }\r\n if (options.gtagName) {\r\n gtagName = options.gtagName;\r\n }\r\n}\r\n/**\r\n * Returns true if no environment mismatch is found.\r\n * If environment mismatches are found, throws an INVALID_ANALYTICS_CONTEXT\r\n * error that also lists details for each mismatch found.\r\n */\r\nfunction warnOnBrowserContextMismatch() {\r\n var mismatchedEnvMessages = [];\r\n if (isBrowserExtension()) {\r\n mismatchedEnvMessages.push('This is a browser extension environment.');\r\n }\r\n if (!areCookiesEnabled()) {\r\n mismatchedEnvMessages.push('Cookies are not available.');\r\n }\r\n if (mismatchedEnvMessages.length > 0) {\r\n var details = mismatchedEnvMessages\r\n .map(function (message, index) { return \"(\" + (index + 1) + \") \" + message; })\r\n .join(' ');\r\n var err = ERROR_FACTORY.create(\"invalid-analytics-context\" /* INVALID_ANALYTICS_CONTEXT */, {\r\n errorInfo: details\r\n });\r\n logger.warn(err.message);\r\n }\r\n}\r\nfunction factory(app, installations) {\r\n warnOnBrowserContextMismatch();\r\n var appId = app.options.appId;\r\n if (!appId) {\r\n throw ERROR_FACTORY.create(\"no-app-id\" /* NO_APP_ID */);\r\n }\r\n if (!app.options.apiKey) {\r\n if (app.options.measurementId) {\r\n logger.warn(\"The \\\"apiKey\\\" field is empty in the local Firebase config. This is needed to fetch the latest\" +\r\n (\" measurement ID for this Firebase app. Falling back to the measurement ID \" + app.options.measurementId) +\r\n \" provided in the \\\"measurementId\\\" field in the local Firebase config.\");\r\n }\r\n else {\r\n throw ERROR_FACTORY.create(\"no-api-key\" /* NO_API_KEY */);\r\n }\r\n }\r\n if (initializationPromisesMap[appId] != null) {\r\n throw ERROR_FACTORY.create(\"already-exists\" /* ALREADY_EXISTS */, {\r\n id: appId\r\n });\r\n }\r\n if (!globalInitDone) {\r\n // Steps here should only be done once per page: creation or wrapping\r\n // of dataLayer and global gtag function.\r\n // Detect if user has already put the gtag <script> tag on this page.\r\n if (!findGtagScriptOnPage()) {\r\n insertScriptTag(dataLayerName);\r\n }\r\n getOrCreateDataLayer(dataLayerName);\r\n var _a = wrapOrCreateGtag(initializationPromisesMap, dynamicConfigPromisesList, measurementIdToAppId, dataLayerName, gtagName), wrappedGtag = _a.wrappedGtag, gtagCore = _a.gtagCore;\r\n wrappedGtagFunction = wrappedGtag;\r\n gtagCoreFunction = gtagCore;\r\n globalInitDone = true;\r\n }\r\n // Async but non-blocking.\r\n // This map reflects the completion state of all promises for each appId.\r\n initializationPromisesMap[appId] = initializeIds(app, dynamicConfigPromisesList, measurementIdToAppId, installations, gtagCoreFunction);\r\n var analyticsInstance = {\r\n app: app,\r\n // Public methods return void for API simplicity and to better match gtag,\r\n // while internal implementations return promises.\r\n logEvent: function (eventName, eventParams, options) {\r\n logEvent(wrappedGtagFunction, initializationPromisesMap[appId], eventName, eventParams, options).catch(function (e) { return logger.error(e); });\r\n },\r\n setCurrentScreen: function (screenName, options) {\r\n setCurrentScreen(wrappedGtagFunction, initializationPromisesMap[appId], screenName, options).catch(function (e) { return logger.error(e); });\r\n },\r\n setUserId: function (id, options) {\r\n setUserId(wrappedGtagFunction, initializationPromisesMap[appId], id, options).catch(function (e) { return logger.error(e); });\r\n },\r\n setUserProperties: function (properties, options) {\r\n setUserProperties(wrappedGtagFunction, initializationPromisesMap[appId], properties, options).catch(function (e) { return logger.error(e); });\r\n },\r\n setAnalyticsCollectionEnabled: function (enabled) {\r\n setAnalyticsCollectionEnabled(initializationPromisesMap[appId], enabled).catch(function (e) { return logger.error(e); });\r\n },\r\n INTERNAL: {\r\n delete: function () {\r\n delete initializationPromisesMap[appId];\r\n return Promise.resolve();\r\n }\r\n }\r\n };\r\n return analyticsInstance;\r\n}\n\nvar name = \"@firebase/analytics\";\nvar version = \"0.6.1\";\n\n/**\r\n * Type constant for Firebase Analytics.\r\n */\r\nvar ANALYTICS_TYPE = 'analytics';\r\nfunction registerAnalytics(instance) {\r\n instance.INTERNAL.registerComponent(new Component(ANALYTICS_TYPE, function (container) {\r\n // getImmediate for FirebaseApp will always succeed\r\n var app = container.getProvider('app').getImmediate();\r\n var installations = container\r\n .getProvider('installations')\r\n .getImmediate();\r\n return factory(app, installations);\r\n }, \"PUBLIC\" /* PUBLIC */).setServiceProps({\r\n settings: settings,\r\n EventName: EventName,\r\n isSupported: isSupported\r\n }));\r\n instance.INTERNAL.registerComponent(new Component('analytics-internal', internalFactory, \"PRIVATE\" /* PRIVATE */));\r\n instance.registerVersion(name, version);\r\n function internalFactory(container) {\r\n try {\r\n var analytics = container.getProvider(ANALYTICS_TYPE).getImmediate();\r\n return {\r\n logEvent: analytics.logEvent\r\n };\r\n }\r\n catch (e) {\r\n throw ERROR_FACTORY.create(\"interop-component-reg-failed\" /* INTEROP_COMPONENT_REG_FAILED */, {\r\n reason: e\r\n });\r\n }\r\n }\r\n}\r\nregisterAnalytics(firebase);\r\n/**\r\n * this is a public static method provided to users that wraps four different checks:\r\n *\r\n * 1. check if it's not a browser extension environment.\r\n * 1. check if cookie is enabled in current browser.\r\n * 3. check if IndexedDB is supported by the browser environment.\r\n * 4. check if the current browser context is valid for using IndexedDB.\r\n *\r\n */\r\nfunction isSupported() {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var isDBOpenable, error_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (isBrowserExtension()) {\r\n return [2 /*return*/, false];\r\n }\r\n if (!areCookiesEnabled()) {\r\n return [2 /*return*/, false];\r\n }\r\n if (!isIndexedDBAvailable()) {\r\n return [2 /*return*/, false];\r\n }\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, validateIndexedDBOpenable()];\r\n case 2:\r\n isDBOpenable = _a.sent();\r\n return [2 /*return*/, isDBOpenable];\r\n case 3:\r\n error_1 = _a.sent();\r\n return [2 /*return*/, false];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\n\nexport { factory, getGlobalVars, registerAnalytics, resetGlobalVars, settings };\n//# sourceMappingURL=index.esm.js.map\n","import { __values, __assign } from 'tslib';\nimport { ErrorFactory, deepCopy, contains, deepExtend, createSubscribe, isBrowser, isNode } from '@firebase/util';\nimport { ComponentContainer, Component } from '@firebase/component';\nimport { Logger, setLogLevel, setUserLogHandler } from '@firebase/logger';\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar _a;\r\nvar ERRORS = (_a = {},\r\n _a[\"no-app\" /* NO_APP */] = \"No Firebase App '{$appName}' has been created - \" +\r\n 'call Firebase App.initializeApp()',\r\n _a[\"bad-app-name\" /* BAD_APP_NAME */] = \"Illegal App name: '{$appName}\",\r\n _a[\"duplicate-app\" /* DUPLICATE_APP */] = \"Firebase App named '{$appName}' already exists\",\r\n _a[\"app-deleted\" /* APP_DELETED */] = \"Firebase App named '{$appName}' already deleted\",\r\n _a[\"invalid-app-argument\" /* INVALID_APP_ARGUMENT */] = 'firebase.{$appName}() takes either no argument or a ' +\r\n 'Firebase App instance.',\r\n _a[\"invalid-log-argument\" /* INVALID_LOG_ARGUMENT */] = 'First argument to `onLog` must be null or a function.',\r\n _a);\r\nvar ERROR_FACTORY = new ErrorFactory('app', 'Firebase', ERRORS);\n\nvar name$1 = \"@firebase/app\";\nvar version = \"0.6.12\";\n\nvar name$2 = \"@firebase/analytics\";\n\nvar name$3 = \"@firebase/auth\";\n\nvar name$4 = \"@firebase/database\";\n\nvar name$5 = \"@firebase/functions\";\n\nvar name$6 = \"@firebase/installations\";\n\nvar name$7 = \"@firebase/messaging\";\n\nvar name$8 = \"@firebase/performance\";\n\nvar name$9 = \"@firebase/remote-config\";\n\nvar name$a = \"@firebase/storage\";\n\nvar name$b = \"@firebase/firestore\";\n\nvar name$c = \"firebase-wrapper\";\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar _a$1;\r\nvar DEFAULT_ENTRY_NAME = '[DEFAULT]';\r\nvar PLATFORM_LOG_STRING = (_a$1 = {},\r\n _a$1[name$1] = 'fire-core',\r\n _a$1[name$2] = 'fire-analytics',\r\n _a$1[name$3] = 'fire-auth',\r\n _a$1[name$4] = 'fire-rtdb',\r\n _a$1[name$5] = 'fire-fn',\r\n _a$1[name$6] = 'fire-iid',\r\n _a$1[name$7] = 'fire-fcm',\r\n _a$1[name$8] = 'fire-perf',\r\n _a$1[name$9] = 'fire-rc',\r\n _a$1[name$a] = 'fire-gcs',\r\n _a$1[name$b] = 'fire-fst',\r\n _a$1['fire-js'] = 'fire-js',\r\n _a$1[name$c] = 'fire-js-all',\r\n _a$1);\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar logger = new Logger('@firebase/app');\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Global context object for a collection of services using\r\n * a shared authentication state.\r\n */\r\nvar FirebaseAppImpl = /** @class */ (function () {\r\n function FirebaseAppImpl(options, config, firebase_) {\r\n var e_1, _a;\r\n var _this = this;\r\n this.firebase_ = firebase_;\r\n this.isDeleted_ = false;\r\n this.name_ = config.name;\r\n this.automaticDataCollectionEnabled_ =\r\n config.automaticDataCollectionEnabled || false;\r\n this.options_ = deepCopy(options);\r\n this.container = new ComponentContainer(config.name);\r\n // add itself to container\r\n this._addComponent(new Component('app', function () { return _this; }, \"PUBLIC\" /* PUBLIC */));\r\n try {\r\n // populate ComponentContainer with existing components\r\n for (var _b = __values(this.firebase_.INTERNAL.components.values()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var component = _c.value;\r\n this._addComponent(component);\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n }\r\n Object.defineProperty(FirebaseAppImpl.prototype, \"automaticDataCollectionEnabled\", {\r\n get: function () {\r\n this.checkDestroyed_();\r\n return this.automaticDataCollectionEnabled_;\r\n },\r\n set: function (val) {\r\n this.checkDestroyed_();\r\n this.automaticDataCollectionEnabled_ = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(FirebaseAppImpl.prototype, \"name\", {\r\n get: function () {\r\n this.checkDestroyed_();\r\n return this.name_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(FirebaseAppImpl.prototype, \"options\", {\r\n get: function () {\r\n this.checkDestroyed_();\r\n return this.options_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n FirebaseAppImpl.prototype.delete = function () {\r\n var _this = this;\r\n return new Promise(function (resolve) {\r\n _this.checkDestroyed_();\r\n resolve();\r\n })\r\n .then(function () {\r\n _this.firebase_.INTERNAL.removeApp(_this.name_);\r\n return Promise.all(_this.container.getProviders().map(function (provider) { return provider.delete(); }));\r\n })\r\n .then(function () {\r\n _this.isDeleted_ = true;\r\n });\r\n };\r\n /**\r\n * Return a service instance associated with this app (creating it\r\n * on demand), identified by the passed instanceIdentifier.\r\n *\r\n * NOTE: Currently storage and functions are the only ones that are leveraging this\r\n * functionality. They invoke it by calling:\r\n *\r\n * ```javascript\r\n * firebase.app().storage('STORAGE BUCKET ID')\r\n * ```\r\n *\r\n * The service name is passed to this already\r\n * @internal\r\n */\r\n FirebaseAppImpl.prototype._getService = function (name, instanceIdentifier) {\r\n if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }\r\n this.checkDestroyed_();\r\n // getImmediate will always succeed because _getService is only called for registered components.\r\n return this.container.getProvider(name).getImmediate({\r\n identifier: instanceIdentifier\r\n });\r\n };\r\n /**\r\n * Remove a service instance from the cache, so we will create a new instance for this service\r\n * when people try to get this service again.\r\n *\r\n * NOTE: currently only firestore is using this functionality to support firestore shutdown.\r\n *\r\n * @param name The service name\r\n * @param instanceIdentifier instance identifier in case multiple instances are allowed\r\n * @internal\r\n */\r\n FirebaseAppImpl.prototype._removeServiceInstance = function (name, instanceIdentifier) {\r\n if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n this.container.getProvider(name).clearInstance(instanceIdentifier);\r\n };\r\n /**\r\n * @param component the component being added to this app's container\r\n */\r\n FirebaseAppImpl.prototype._addComponent = function (component) {\r\n try {\r\n this.container.addComponent(component);\r\n }\r\n catch (e) {\r\n logger.debug(\"Component \" + component.name + \" failed to register with FirebaseApp \" + this.name, e);\r\n }\r\n };\r\n FirebaseAppImpl.prototype._addOrOverwriteComponent = function (component) {\r\n this.container.addOrOverwriteComponent(component);\r\n };\r\n /**\r\n * This function will throw an Error if the App has already been deleted -\r\n * use before performing API actions on the App.\r\n */\r\n FirebaseAppImpl.prototype.checkDestroyed_ = function () {\r\n if (this.isDeleted_) {\r\n throw ERROR_FACTORY.create(\"app-deleted\" /* APP_DELETED */, { appName: this.name_ });\r\n }\r\n };\r\n return FirebaseAppImpl;\r\n}());\r\n// Prevent dead-code elimination of these methods w/o invalid property\r\n// copying.\r\n(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||\r\n FirebaseAppImpl.prototype.delete ||\r\n console.log('dc');\n\nvar version$1 = \"8.0.0\";\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Because auth can't share code with other components, we attach the utility functions\r\n * in an internal namespace to share code.\r\n * This function return a firebase namespace object without\r\n * any utility functions, so it can be shared between the regular firebaseNamespace and\r\n * the lite version.\r\n */\r\nfunction createFirebaseNamespaceCore(firebaseAppImpl) {\r\n var apps = {};\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n var components = new Map();\r\n // A namespace is a plain JavaScript Object.\r\n var namespace = {\r\n // Hack to prevent Babel from modifying the object returned\r\n // as the firebase namespace.\r\n // @ts-ignore\r\n __esModule: true,\r\n initializeApp: initializeApp,\r\n // @ts-ignore\r\n app: app,\r\n registerVersion: registerVersion,\r\n setLogLevel: setLogLevel,\r\n onLog: onLog,\r\n // @ts-ignore\r\n apps: null,\r\n SDK_VERSION: version$1,\r\n INTERNAL: {\r\n registerComponent: registerComponent,\r\n removeApp: removeApp,\r\n components: components,\r\n useAsService: useAsService\r\n }\r\n };\r\n // Inject a circular default export to allow Babel users who were previously\r\n // using:\r\n //\r\n // import firebase from 'firebase';\r\n // which becomes: var firebase = require('firebase').default;\r\n //\r\n // instead of\r\n //\r\n // import * as firebase from 'firebase';\r\n // which becomes: var firebase = require('firebase');\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n namespace['default'] = namespace;\r\n // firebase.apps is a read-only getter.\r\n Object.defineProperty(namespace, 'apps', {\r\n get: getApps\r\n });\r\n /**\r\n * Called by App.delete() - but before any services associated with the App\r\n * are deleted.\r\n */\r\n function removeApp(name) {\r\n delete apps[name];\r\n }\r\n /**\r\n * Get the App object for a given name (or DEFAULT).\r\n */\r\n function app(name) {\r\n name = name || DEFAULT_ENTRY_NAME;\r\n if (!contains(apps, name)) {\r\n throw ERROR_FACTORY.create(\"no-app\" /* NO_APP */, { appName: name });\r\n }\r\n return apps[name];\r\n }\r\n // @ts-ignore\r\n app['App'] = firebaseAppImpl;\r\n function initializeApp(options, rawConfig) {\r\n if (rawConfig === void 0) { rawConfig = {}; }\r\n if (typeof rawConfig !== 'object' || rawConfig === null) {\r\n var name_1 = rawConfig;\r\n rawConfig = { name: name_1 };\r\n }\r\n var config = rawConfig;\r\n if (config.name === undefined) {\r\n config.name = DEFAULT_ENTRY_NAME;\r\n }\r\n var name = config.name;\r\n if (typeof name !== 'string' || !name) {\r\n throw ERROR_FACTORY.create(\"bad-app-name\" /* BAD_APP_NAME */, {\r\n appName: String(name)\r\n });\r\n }\r\n if (contains(apps, name)) {\r\n throw ERROR_FACTORY.create(\"duplicate-app\" /* DUPLICATE_APP */, { appName: name });\r\n }\r\n var app = new firebaseAppImpl(options, config, namespace);\r\n apps[name] = app;\r\n return app;\r\n }\r\n /*\r\n * Return an array of all the non-deleted FirebaseApps.\r\n */\r\n function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps).map(function (name) { return apps[name]; });\r\n }\r\n function registerComponent(component) {\r\n var e_1, _a;\r\n var componentName = component.name;\r\n if (components.has(componentName)) {\r\n logger.debug(\"There were multiple attempts to register component \" + componentName + \".\");\r\n return component.type === \"PUBLIC\" /* PUBLIC */\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n namespace[componentName]\r\n : null;\r\n }\r\n components.set(componentName, component);\r\n // create service namespace for public components\r\n if (component.type === \"PUBLIC\" /* PUBLIC */) {\r\n // The Service namespace is an accessor function ...\r\n var serviceNamespace = function (appArg) {\r\n if (appArg === void 0) { appArg = app(); }\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n if (typeof appArg[componentName] !== 'function') {\r\n // Invalid argument.\r\n // This happens in the following case: firebase.storage('gs:/')\r\n throw ERROR_FACTORY.create(\"invalid-app-argument\" /* INVALID_APP_ARGUMENT */, {\r\n appName: componentName\r\n });\r\n }\r\n // Forward service instance lookup to the FirebaseApp.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return appArg[componentName]();\r\n };\r\n // ... and a container for service-level properties.\r\n if (component.serviceProps !== undefined) {\r\n deepExtend(serviceNamespace, component.serviceProps);\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n namespace[componentName] = serviceNamespace;\r\n // Patch the FirebaseAppImpl prototype\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n firebaseAppImpl.prototype[componentName] =\r\n // TODO: The eslint disable can be removed and the 'ignoreRestArgs'\r\n // option added to the no-explicit-any rule when ESlint releases it.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var serviceFxn = this._getService.bind(this, componentName);\r\n return serviceFxn.apply(this, component.multipleInstances ? args : []);\r\n };\r\n }\r\n try {\r\n // add the component to existing app instances\r\n for (var _b = __values(Object.keys(apps)), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var appName = _c.value;\r\n apps[appName]._addComponent(component);\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n return component.type === \"PUBLIC\" /* PUBLIC */\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n namespace[componentName]\r\n : null;\r\n }\r\n function registerVersion(libraryKeyOrName, version, variant) {\r\n var _a;\r\n // TODO: We can use this check to whitelist strings when/if we set up\r\n // a good whitelist system.\r\n var library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName]) !== null && _a !== void 0 ? _a : libraryKeyOrName;\r\n if (variant) {\r\n library += \"-\" + variant;\r\n }\r\n var libraryMismatch = library.match(/\\s|\\//);\r\n var versionMismatch = version.match(/\\s|\\//);\r\n if (libraryMismatch || versionMismatch) {\r\n var warning = [\r\n \"Unable to register library \\\"\" + library + \"\\\" with version \\\"\" + version + \"\\\":\"\r\n ];\r\n if (libraryMismatch) {\r\n warning.push(\"library name \\\"\" + library + \"\\\" contains illegal characters (whitespace or \\\"/\\\")\");\r\n }\r\n if (libraryMismatch && versionMismatch) {\r\n warning.push('and');\r\n }\r\n if (versionMismatch) {\r\n warning.push(\"version name \\\"\" + version + \"\\\" contains illegal characters (whitespace or \\\"/\\\")\");\r\n }\r\n logger.warn(warning.join(' '));\r\n return;\r\n }\r\n registerComponent(new Component(library + \"-version\", function () { return ({ library: library, version: version }); }, \"VERSION\" /* VERSION */));\r\n }\r\n function onLog(logCallback, options) {\r\n if (logCallback !== null && typeof logCallback !== 'function') {\r\n throw ERROR_FACTORY.create(\"invalid-log-argument\" /* INVALID_LOG_ARGUMENT */, {\r\n appName: name\r\n });\r\n }\r\n setUserLogHandler(logCallback, options);\r\n }\r\n // Map the requested service to a registered service name\r\n // (used to map auth to serverAuth service when needed).\r\n function useAsService(app, name) {\r\n if (name === 'serverAuth') {\r\n return null;\r\n }\r\n var useService = name;\r\n return useService;\r\n }\r\n return namespace;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Return a firebase namespace object.\r\n *\r\n * In production, this will be called exactly once and the result\r\n * assigned to the 'firebase' global. It may be called multiple times\r\n * in unit tests.\r\n */\r\nfunction createFirebaseNamespace() {\r\n var namespace = createFirebaseNamespaceCore(FirebaseAppImpl);\r\n namespace.INTERNAL = __assign(__assign({}, namespace.INTERNAL), { createFirebaseNamespace: createFirebaseNamespace,\r\n extendNamespace: extendNamespace,\r\n createSubscribe: createSubscribe,\r\n ErrorFactory: ErrorFactory,\r\n deepExtend: deepExtend });\r\n /**\r\n * Patch the top-level firebase namespace with additional properties.\r\n *\r\n * firebase.INTERNAL.extendNamespace()\r\n */\r\n function extendNamespace(props) {\r\n deepExtend(namespace, props);\r\n }\r\n return namespace;\r\n}\r\nvar firebase = createFirebaseNamespace();\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar PlatformLoggerService = /** @class */ (function () {\r\n function PlatformLoggerService(container) {\r\n this.container = container;\r\n }\r\n // In initial implementation, this will be called by installations on\r\n // auth token refresh, and installations will send this string.\r\n PlatformLoggerService.prototype.getPlatformInfoString = function () {\r\n var providers = this.container.getProviders();\r\n // Loop through providers and get library/version pairs from any that are\r\n // version components.\r\n return providers\r\n .map(function (provider) {\r\n if (isVersionServiceProvider(provider)) {\r\n var service = provider.getImmediate();\r\n return service.library + \"/\" + service.version;\r\n }\r\n else {\r\n return null;\r\n }\r\n })\r\n .filter(function (logString) { return logString; })\r\n .join(' ');\r\n };\r\n return PlatformLoggerService;\r\n}());\r\n/**\r\n *\r\n * @param provider check if this provider provides a VersionService\r\n *\r\n * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider\r\n * provides VersionService. The provider is not necessarily a 'app-version'\r\n * provider.\r\n */\r\nfunction isVersionServiceProvider(provider) {\r\n var component = provider.getComponent();\r\n return (component === null || component === void 0 ? void 0 : component.type) === \"VERSION\" /* VERSION */;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction registerCoreComponents(firebase, variant) {\r\n firebase.INTERNAL.registerComponent(new Component('platform-logger', function (container) { return new PlatformLoggerService(container); }, \"PRIVATE\" /* PRIVATE */));\r\n // Register `app` package.\r\n firebase.registerVersion(name$1, version, variant);\r\n // Register platform SDK identifier (no version).\r\n firebase.registerVersion('fire-js', '');\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// Firebase Lite detection test\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nif (isBrowser() && self.firebase !== undefined) {\r\n logger.warn(\"\\n Warning: Firebase is already defined in the global scope. Please make sure\\n Firebase library is only loaded once.\\n \");\r\n // eslint-disable-next-line\r\n var sdkVersion = self.firebase.SDK_VERSION;\r\n if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {\r\n logger.warn(\"\\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\\n \");\r\n }\r\n}\r\nvar initializeApp = firebase.initializeApp;\r\n// TODO: This disable can be removed and the 'ignoreRestArgs' option added to\r\n// the no-explicit-any rule when ESlint releases it.\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nfirebase.initializeApp = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n // Environment check before initializing app\r\n // Do the check in initializeApp, so people have a chance to disable it by setting logLevel\r\n // in @firebase/logger\r\n if (isNode()) {\r\n logger.warn(\"\\n Warning: This is a browser-targeted Firebase bundle but it appears it is being\\n run in a Node environment. If running in a Node environment, make sure you\\n are using the bundle specified by the \\\"main\\\" field in package.json.\\n \\n If you are using Webpack, you can specify \\\"main\\\" as the first item in\\n \\\"resolve.mainFields\\\":\\n https://webpack.js.org/configuration/resolve/#resolvemainfields\\n \\n If using Rollup, use the @rollup/plugin-node-resolve plugin and specify \\\"main\\\"\\n as the first item in \\\"mainFields\\\", e.g. ['main', 'module'].\\n https://github.com/rollup/@rollup/plugin-node-resolve\\n \");\r\n }\r\n return initializeApp.apply(undefined, args);\r\n};\r\nvar firebase$1 = firebase;\r\nregisterCoreComponents(firebase$1);\n\nexport default firebase$1;\nexport { firebase$1 as firebase };\n//# sourceMappingURL=index.esm.js.map\n","import firebase from '@firebase/app';(function() {/*\n\n Copyright The Closure Library Authors.\n SPDX-License-Identifier: Apache-2.0\n*/\nvar k,aa=\"function\"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};function ba(a){a=[\"object\"==typeof window&&window,\"object\"==typeof self&&self,\"object\"==typeof global&&global,a];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}return globalThis}var ca=ba(this);\nfunction da(a,b){if(b){var c=ca;a=a.split(\".\");for(var d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&aa(c,a,{configurable:!0,writable:!0,value:b})}}function ea(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function fa(a){var b=\"undefined\"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:ea(a)}}\nda(\"Promise\",function(a){function b(g){this.b=0;this.c=void 0;this.a=[];var h=this.f();try{g(h.resolve,h.reject)}catch(m){h.reject(m)}}function c(){this.a=null}function d(g){return g instanceof b?g:new b(function(h){h(g)})}if(a)return a;c.prototype.b=function(g){if(null==this.a){this.a=[];var h=this;this.c(function(){h.g()})}this.a.push(g)};var e=ca.setTimeout;c.prototype.c=function(g){e(g,0)};c.prototype.g=function(){for(;this.a&&this.a.length;){var g=this.a;this.a=[];for(var h=0;h<g.length;++h){var m=\ng[h];g[h]=null;try{m()}catch(p){this.f(p)}}}this.a=null};c.prototype.f=function(g){this.c(function(){throw g;})};b.prototype.f=function(){function g(p){return function(v){m||(m=!0,p.call(h,v))}}var h=this,m=!1;return{resolve:g(this.v),reject:g(this.g)}};b.prototype.v=function(g){if(g===this)this.g(new TypeError(\"A Promise cannot resolve to itself\"));else if(g instanceof b)this.o(g);else{a:switch(typeof g){case \"object\":var h=null!=g;break a;case \"function\":h=!0;break a;default:h=!1}h?this.m(g):this.h(g)}};\nb.prototype.m=function(g){var h=void 0;try{h=g.then}catch(m){this.g(m);return}\"function\"==typeof h?this.u(h,g):this.h(g)};b.prototype.g=function(g){this.i(2,g)};b.prototype.h=function(g){this.i(1,g)};b.prototype.i=function(g,h){if(0!=this.b)throw Error(\"Cannot settle(\"+g+\", \"+h+\"): Promise already settled in state\"+this.b);this.b=g;this.c=h;this.l()};b.prototype.l=function(){if(null!=this.a){for(var g=0;g<this.a.length;++g)f.b(this.a[g]);this.a=null}};var f=new c;b.prototype.o=function(g){var h=this.f();\ng.Pa(h.resolve,h.reject)};b.prototype.u=function(g,h){var m=this.f();try{g.call(h,m.resolve,m.reject)}catch(p){m.reject(p)}};b.prototype.then=function(g,h){function m(A,Q){return\"function\"==typeof A?function(xa){try{p(A(xa))}catch(yd){v(yd)}}:Q}var p,v,B=new b(function(A,Q){p=A;v=Q});this.Pa(m(g,p),m(h,v));return B};b.prototype.catch=function(g){return this.then(void 0,g)};b.prototype.Pa=function(g,h){function m(){switch(p.b){case 1:g(p.c);break;case 2:h(p.c);break;default:throw Error(\"Unexpected state: \"+\np.b);}}var p=this;null==this.a?f.b(m):this.a.push(m)};b.resolve=d;b.reject=function(g){return new b(function(h,m){m(g)})};b.race=function(g){return new b(function(h,m){for(var p=fa(g),v=p.next();!v.done;v=p.next())d(v.value).Pa(h,m)})};b.all=function(g){var h=fa(g),m=h.next();return m.done?d([]):new b(function(p,v){function B(xa){return function(yd){A[xa]=yd;Q--;0==Q&&p(A)}}var A=[],Q=0;do A.push(void 0),Q++,d(m.value).Pa(B(A.length-1),v),m=h.next();while(!m.done)})};return b});\nvar ha=ha||{},l=this||self,ia=/^[\\w+/_-]+[=]{0,2}$/,ja=null;function ka(){}\nfunction la(a){var b=typeof a;if(\"object\"==b)if(a){if(a instanceof Array)return\"array\";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if(\"[object Window]\"==c)return\"object\";if(\"[object Array]\"==c||\"number\"==typeof a.length&&\"undefined\"!=typeof a.splice&&\"undefined\"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable(\"splice\"))return\"array\";if(\"[object Function]\"==c||\"undefined\"!=typeof a.call&&\"undefined\"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable(\"call\"))return\"function\"}else return\"null\";\nelse if(\"function\"==b&&\"undefined\"==typeof a.call)return\"object\";return b}function ma(a){var b=la(a);return\"array\"==b||\"object\"==b&&\"number\"==typeof a.length}function na(a){return\"function\"==la(a)}function n(a){var b=typeof a;return\"object\"==b&&null!=a||\"function\"==b}function oa(a){return Object.prototype.hasOwnProperty.call(a,pa)&&a[pa]||(a[pa]=++qa)}var pa=\"closure_uid_\"+(1E9*Math.random()>>>0),qa=0;function ra(a,b,c){return a.call.apply(a.bind,arguments)}\nfunction sa(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}function q(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf(\"native code\")?q=ra:q=sa;return q.apply(null,arguments)}\nfunction ta(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}var ua=Date.now||function(){return+new Date};function r(a,b){function c(){}c.prototype=b.prototype;a.$a=b.prototype;a.prototype=new c;a.prototype.constructor=a};/*\n\n Copyright 2017 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\nfunction t(a,b,c){this.code=va+a;this.message=b||wa[a]||\"\";this.a=c||null}r(t,Error);t.prototype.w=function(){var a={code:this.code,message:this.message};this.a&&(a.serverResponse=this.a);return a};t.prototype.toJSON=function(){return this.w()};function ya(a){var b=a&&a.code;return b?new t(b.substring(va.length),a.message,a.serverResponse):null}\nvar va=\"auth/\",wa={\"admin-restricted-operation\":\"This operation is restricted to administrators only.\",\"argument-error\":\"\",\"app-not-authorized\":\"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.\",\"app-not-installed\":\"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.\",\n\"captcha-check-failed\":\"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.\",\"code-expired\":\"The SMS code has expired. Please re-send the verification code to try again.\",\"cordova-not-ready\":\"Cordova framework is not ready.\",\"cors-unsupported\":\"This browser is not supported.\",\"credential-already-in-use\":\"This credential is already associated with a different user account.\",\"custom-token-mismatch\":\"The custom token corresponds to a different audience.\",\n\"requires-recent-login\":\"This operation is sensitive and requires recent authentication. Log in again before retrying this request.\",\"dynamic-link-not-activated\":\"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.\",\"email-change-needs-verification\":\"Multi-factor users must always have a verified email.\",\"email-already-in-use\":\"The email address is already in use by another account.\",\"expired-action-code\":\"The action code has expired. \",\"cancelled-popup-request\":\"This operation has been cancelled due to another conflicting popup being opened.\",\n\"internal-error\":\"An internal error has occurred.\",\"invalid-app-credential\":\"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.\",\"invalid-app-id\":\"The mobile app identifier is not registed for the current project.\",\"invalid-user-token\":\"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.\",\"invalid-auth-event\":\"An internal error has occurred.\",\n\"invalid-verification-code\":\"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure use the verification code provided by the user.\",\"invalid-continue-uri\":\"The continue URL provided in the request is invalid.\",\"invalid-cordova-configuration\":\"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.\",\n\"invalid-custom-token\":\"The custom token format is incorrect. Please check the documentation.\",\"invalid-dynamic-link-domain\":\"The provided dynamic link domain is not configured or authorized for the current project.\",\"invalid-email\":\"The email address is badly formatted.\",\"invalid-api-key\":\"Your API key is invalid, please check you have copied it correctly.\",\"invalid-cert-hash\":\"The SHA-1 certificate hash provided is invalid.\",\"invalid-credential\":\"The supplied auth credential is malformed or has expired.\",\n\"invalid-message-payload\":\"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.\",\"invalid-multi-factor-session\":\"The request does not contain a valid proof of first factor successful sign-in.\",\"invalid-oauth-provider\":\"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.\",\"invalid-oauth-client-id\":\"The OAuth client ID provided is either invalid or does not match the specified API key.\",\n\"unauthorized-domain\":\"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.\",\"invalid-action-code\":\"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.\",\"wrong-password\":\"The password is invalid or the user does not have a password.\",\"invalid-persistence-type\":\"The specified persistence type is invalid. It can only be local, session or none.\",\"invalid-phone-number\":\"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].\",\n\"invalid-provider-id\":\"The specified provider ID is invalid.\",\"invalid-recipient-email\":\"The email corresponding to this action failed to send as the provided recipient email address is invalid.\",\"invalid-sender\":\"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.\",\"invalid-verification-id\":\"The verification ID used to create the phone auth credential is invalid.\",\"invalid-tenant-id\":\"The Auth instance's tenant ID is invalid.\",\n\"multi-factor-info-not-found\":\"The user does not have a second factor matching the identifier provided.\",\"multi-factor-auth-required\":\"Proof of ownership of a second factor is required to complete sign-in.\",\"missing-android-pkg-name\":\"An Android Package Name must be provided if the Android App is required to be installed.\",\"auth-domain-config-required\":\"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.\",\"missing-app-credential\":\"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.\",\n\"missing-verification-code\":\"The phone auth credential was created with an empty SMS verification code.\",\"missing-continue-uri\":\"A continue URL must be provided in the request.\",\"missing-iframe-start\":\"An internal error has occurred.\",\"missing-ios-bundle-id\":\"An iOS Bundle ID must be provided if an App Store ID is provided.\",\"missing-multi-factor-info\":\"No second factor identifier is provided.\",\"missing-multi-factor-session\":\"The request is missing proof of first factor successful sign-in.\",\"missing-or-invalid-nonce\":\"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.\",\n\"missing-phone-number\":\"To send verification codes, provide a phone number for the recipient.\",\"missing-verification-id\":\"The phone auth credential was created with an empty verification ID.\",\"app-deleted\":\"This instance of FirebaseApp has been deleted.\",\"account-exists-with-different-credential\":\"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.\",\"network-request-failed\":\"A network error (such as timeout, interrupted connection or unreachable host) has occurred.\",\n\"no-auth-event\":\"An internal error has occurred.\",\"no-such-provider\":\"User was not linked to an account with the given provider.\",\"null-user\":\"A null user object was provided as the argument for an operation which requires a non-null user object.\",\"operation-not-allowed\":\"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.\",\"operation-not-supported-in-this-environment\":'This operation is not supported in the environment this application is running on. \"location.protocol\" must be http, https or chrome-extension and web storage must be enabled.',\n\"popup-blocked\":\"Unable to establish a connection with the popup. It may have been blocked by the browser.\",\"popup-closed-by-user\":\"The popup has been closed by the user before finalizing the operation.\",\"provider-already-linked\":\"User can only be linked to one identity for the given provider.\",\"quota-exceeded\":\"The project's quota for this operation has been exceeded.\",\"redirect-cancelled-by-user\":\"The redirect operation has been cancelled by the user before finalizing.\",\"redirect-operation-pending\":\"A redirect sign-in operation is already pending.\",\n\"rejected-credential\":\"The request contains malformed or mismatching credentials.\",\"second-factor-already-in-use\":\"The second factor is already enrolled on this account.\",\"maximum-second-factor-count-exceeded\":\"The maximum allowed number of second factors on a user has been exceeded.\",\"tenant-id-mismatch\":\"The provided tenant ID does not match the Auth instance's tenant ID\",timeout:\"The operation has timed out.\",\"user-token-expired\":\"The user's credential is no longer valid. The user must sign in again.\",\n\"too-many-requests\":\"We have blocked all requests from this device due to unusual activity. Try again later.\",\"unauthorized-continue-uri\":\"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.\",\"unsupported-first-factor\":\"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.\",\"unsupported-persistence-type\":\"The current environment does not support the specified persistence type.\",\"unsupported-tenant-operation\":\"This operation is not supported in a multi-tenant context.\",\n\"unverified-email\":\"The operation requires a verified email.\",\"user-cancelled\":\"The user did not grant your application the permissions it requested.\",\"user-not-found\":\"There is no user record corresponding to this identifier. The user may have been deleted.\",\"user-disabled\":\"The user account has been disabled by an administrator.\",\"user-mismatch\":\"The supplied credentials do not correspond to the previously signed in user.\",\"user-signed-out\":\"\",\"weak-password\":\"The password must be 6 characters long or more.\",\n\"web-storage-unsupported\":\"This browser is not supported or 3rd party cookies and data may be disabled.\"};/*\n\n Copyright 2017 Google LLC\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\nvar za={kd:{Sa:\"https://staging-identitytoolkit.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/\",Ya:\"https://staging-securetoken.sandbox.googleapis.com/v1/token\",Va:\"https://staging-identitytoolkit.sandbox.googleapis.com/v2/\",id:\"b\"},rd:{Sa:\"https://www.googleapis.com/identitytoolkit/v3/relyingparty/\",Ya:\"https://securetoken.googleapis.com/v1/token\",Va:\"https://identitytoolkit.googleapis.com/v2/\",id:\"p\"},td:{Sa:\"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/\",\nYa:\"https://staging-securetoken.sandbox.googleapis.com/v1/token\",Va:\"https://staging-identitytoolkit.sandbox.googleapis.com/v2/\",id:\"s\"},ud:{Sa:\"https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/\",Ya:\"https://test-securetoken.sandbox.googleapis.com/v1/token\",Va:\"https://test-identitytoolkit.sandbox.googleapis.com/v2/\",id:\"t\"}};\nfunction Aa(a){for(var b in za)if(za[b].id===a)return a=za[b],{firebaseEndpoint:a.Sa,secureTokenEndpoint:a.Ya,identityPlatformEndpoint:a.Va};return null}var Ba;Ba=Aa(\"__EID__\")?\"__EID__\":void 0;function Ca(a){if(!a)return!1;try{return!!a.$goog_Thenable}catch(b){return!1}};function u(a){if(Error.captureStackTrace)Error.captureStackTrace(this,u);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))}r(u,Error);u.prototype.name=\"CustomError\";function Da(a,b){a=a.split(\"%s\");for(var c=\"\",d=a.length-1,e=0;e<d;e++)c+=a[e]+(e<b.length?b[e]:\"%s\");u.call(this,c+a[d])}r(Da,u);Da.prototype.name=\"AssertionError\";function Ea(a,b){throw new Da(\"Failure\"+(a?\": \"+a:\"\"),Array.prototype.slice.call(arguments,1));};function Fa(a,b){this.c=a;this.f=b;this.b=0;this.a=null}Fa.prototype.get=function(){if(0<this.b){this.b--;var a=this.a;this.a=a.next;a.next=null}else a=this.c();return a};function Ga(a,b){a.f(b);100>a.b&&(a.b++,b.next=a.a,a.a=b)};function Ha(){this.b=this.a=null}var Ja=new Fa(function(){return new Ia},function(a){a.reset()});Ha.prototype.add=function(a,b){var c=Ja.get();c.set(a,b);this.b?this.b.next=c:this.a=c;this.b=c};function Ka(){var a=La,b=null;a.a&&(b=a.a,a.a=a.a.next,a.a||(a.b=null),b.next=null);return b}function Ia(){this.next=this.b=this.a=null}Ia.prototype.set=function(a,b){this.a=a;this.b=b;this.next=null};Ia.prototype.reset=function(){this.next=this.b=this.a=null};var Ma=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(\"string\"===typeof a)return\"string\"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},w=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=\"string\"===typeof a?a.split(\"\"):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)};\nfunction Na(a,b){for(var c=\"string\"===typeof a?a.split(\"\"):a,d=a.length-1;0<=d;--d)d in c&&b.call(void 0,c[d],d,a)}\nvar Oa=Array.prototype.filter?function(a,b){return Array.prototype.filter.call(a,b,void 0)}:function(a,b){for(var c=a.length,d=[],e=0,f=\"string\"===typeof a?a.split(\"\"):a,g=0;g<c;g++)if(g in f){var h=f[g];b.call(void 0,h,g,a)&&(d[e++]=h)}return d},Pa=Array.prototype.map?function(a,b){return Array.prototype.map.call(a,b,void 0)}:function(a,b){for(var c=a.length,d=Array(c),e=\"string\"===typeof a?a.split(\"\"):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d},Qa=Array.prototype.some?function(a,\nb){return Array.prototype.some.call(a,b,void 0)}:function(a,b){for(var c=a.length,d=\"string\"===typeof a?a.split(\"\"):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1};function Ra(a){a:{var b=Sa;for(var c=a.length,d=\"string\"===typeof a?a.split(\"\"):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1}return 0>b?null:\"string\"===typeof a?a.charAt(b):a[b]}function Ta(a,b){return 0<=Ma(a,b)}\nfunction Ua(a,b){b=Ma(a,b);var c;(c=0<=b)&&Array.prototype.splice.call(a,b,1);return c}function Va(a,b){var c=0;Na(a,function(d,e){b.call(void 0,d,e,a)&&1==Array.prototype.splice.call(a,e,1).length&&c++})}function Wa(a){return Array.prototype.concat.apply([],arguments)}function Xa(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]};var Ya=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\\s\\xa0]*([\\s\\S]*?)[\\s\\xa0]*$/.exec(a)[1]},Za=/&/g,$a=/</g,ab=/>/g,bb=/\"/g,cb=/'/g,db=/\\x00/g,eb=/[\\x00&<>\"']/;function x(a,b){return-1!=a.indexOf(b)}function fb(a,b){return a<b?-1:a>b?1:0};var gb;a:{var hb=l.navigator;if(hb){var ib=hb.userAgent;if(ib){gb=ib;break a}}gb=\"\"}function y(a){return x(gb,a)};function jb(a,b){for(var c in a)b.call(void 0,a[c],c,a)}function kb(a){for(var b in a)return!1;return!0}function lb(a){var b={},c;for(c in a)b[c]=a[c];return b}var mb=\"constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf\".split(\" \");function z(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<mb.length;f++)c=mb[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};function nb(a,b){a:{try{var c=a&&a.ownerDocument,d=c&&(c.defaultView||c.parentWindow);d=d||l;if(d.Element&&d.Location){var e=d;break a}}catch(g){}e=null}if(e&&\"undefined\"!=typeof e[b]&&(!a||!(a instanceof e[b])&&(a instanceof e.Location||a instanceof e.Element))){if(n(a))try{var f=a.constructor.displayName||a.constructor.name||Object.prototype.toString.call(a)}catch(g){f=\"<object could not be stringified>\"}else f=void 0===a?\"undefined\":null===a?\"null\":typeof a;Ea(\"Argument is not a %s (or a non-Element, non-Location mock); got: %s\",\nb,f)}};function ob(a,b){this.a=a===pb&&b||\"\";this.b=qb}ob.prototype.sa=!0;ob.prototype.ra=function(){return this.a};ob.prototype.toString=function(){return\"Const{\"+this.a+\"}\"};function rb(a){if(a instanceof ob&&a.constructor===ob&&a.b===qb)return a.a;Ea(\"expected object of type Const, got '\"+a+\"'\");return\"type_error:Const\"}var qb={},pb={},sb=new ob(pb,\"\");function tb(a,b){this.a=a===ub&&b||\"\";this.b=vb}tb.prototype.sa=!0;tb.prototype.ra=function(){return this.a.toString()};tb.prototype.toString=function(){return\"TrustedResourceUrl{\"+this.a+\"}\"};function wb(a){if(a instanceof tb&&a.constructor===tb&&a.b===vb)return a.a;Ea(\"expected object of type TrustedResourceUrl, got '\"+a+\"' of type \"+la(a));return\"type_error:TrustedResourceUrl\"}\nfunction xb(a,b){var c=rb(a);if(!yb.test(c))throw Error(\"Invalid TrustedResourceUrl format: \"+c);a=c.replace(zb,function(d,e){if(!Object.prototype.hasOwnProperty.call(b,e))throw Error('Found marker, \"'+e+'\", in format string, \"'+c+'\", but no valid label mapping found in args: '+JSON.stringify(b));d=b[e];return d instanceof ob?rb(d):encodeURIComponent(String(d))});return new tb(ub,a)}\nvar zb=/%{(\\w+)}/g,yb=/^((https:)?\\/\\/[0-9a-z.:[\\]-]+\\/|\\/[^/\\\\]|[^:/\\\\%]+\\/|[^:/\\\\%]*[?#]|about:blank#)/i,vb={},ub={};function Ab(a,b){this.a=a===Bb&&b||\"\";this.b=Cb}Ab.prototype.sa=!0;Ab.prototype.ra=function(){return this.a.toString()};Ab.prototype.toString=function(){return\"SafeUrl{\"+this.a+\"}\"};function Db(a){if(a instanceof Ab&&a.constructor===Ab&&a.b===Cb)return a.a;Ea(\"expected object of type SafeUrl, got '\"+a+\"' of type \"+la(a));return\"type_error:SafeUrl\"}var Eb=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;\nfunction Fb(a){if(a instanceof Ab)return a;a=\"object\"==typeof a&&a.sa?a.ra():String(a);Eb.test(a)||(a=\"about:invalid#zClosurez\");return new Ab(Bb,a)}var Cb={},Bb={};function Gb(){this.a=\"\";this.b=Hb}Gb.prototype.sa=!0;Gb.prototype.ra=function(){return this.a.toString()};Gb.prototype.toString=function(){return\"SafeHtml{\"+this.a+\"}\"};function Ib(a){if(a instanceof Gb&&a.constructor===Gb&&a.b===Hb)return a.a;Ea(\"expected object of type SafeHtml, got '\"+a+\"' of type \"+la(a));return\"type_error:SafeHtml\"}var Hb={};function Jb(a){var b=new Gb;b.a=a;return b}Jb(\"<!DOCTYPE html>\");var Kb=Jb(\"\");Jb(\"<br>\");function Lb(a){var b=new tb(ub,rb(sb));nb(a,\"HTMLIFrameElement\");a.src=wb(b).toString()}function Mb(a,b){nb(a,\"HTMLScriptElement\");a.src=wb(b);if(null===ja)b:{b=l.document;if((b=b.querySelector&&b.querySelector(\"script[nonce]\"))&&(b=b.nonce||b.getAttribute(\"nonce\"))&&ia.test(b)){ja=b;break b}ja=\"\"}b=ja;b&&a.setAttribute(\"nonce\",b)};function Nb(a,b){for(var c=a.split(\"%s\"),d=\"\",e=Array.prototype.slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join(\"%s\")}function Ob(a){eb.test(a)&&(-1!=a.indexOf(\"&\")&&(a=a.replace(Za,\"&\")),-1!=a.indexOf(\"<\")&&(a=a.replace($a,\"<\")),-1!=a.indexOf(\">\")&&(a=a.replace(ab,\">\")),-1!=a.indexOf('\"')&&(a=a.replace(bb,\""\")),-1!=a.indexOf(\"'\")&&(a=a.replace(cb,\"'\")),-1!=a.indexOf(\"\\x00\")&&(a=a.replace(db,\"�\")));return a};function Pb(a){Pb[\" \"](a);return a}Pb[\" \"]=ka;function Qb(a,b){var c=Rb;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var Sb=y(\"Opera\"),Tb=y(\"Trident\")||y(\"MSIE\"),Ub=y(\"Edge\"),Vb=Ub||Tb,Wb=y(\"Gecko\")&&!(x(gb.toLowerCase(),\"webkit\")&&!y(\"Edge\"))&&!(y(\"Trident\")||y(\"MSIE\"))&&!y(\"Edge\"),Xb=x(gb.toLowerCase(),\"webkit\")&&!y(\"Edge\");function Yb(){var a=l.document;return a?a.documentMode:void 0}var Zb;\na:{var $b=\"\",ac=function(){var a=gb;if(Wb)return/rv:([^\\);]+)(\\)|;)/.exec(a);if(Ub)return/Edge\\/([\\d\\.]+)/.exec(a);if(Tb)return/\\b(?:MSIE|rv)[: ]([^\\);]+)(\\)|;)/.exec(a);if(Xb)return/WebKit\\/(\\S+)/.exec(a);if(Sb)return/(?:Version)[ \\/]?(\\S+)/.exec(a)}();ac&&($b=ac?ac[1]:\"\");if(Tb){var bc=Yb();if(null!=bc&&bc>parseFloat($b)){Zb=String(bc);break a}}Zb=$b}var Rb={};\nfunction cc(a){return Qb(a,function(){for(var b=0,c=Ya(String(Zb)).split(\".\"),d=Ya(String(a)).split(\".\"),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var g=c[f]||\"\",h=d[f]||\"\";do{g=/(\\d*)(\\D*)(.*)/.exec(g)||[\"\",\"\",\"\",\"\"];h=/(\\d*)(\\D*)(.*)/.exec(h)||[\"\",\"\",\"\",\"\"];if(0==g[0].length&&0==h[0].length)break;b=fb(0==g[1].length?0:parseInt(g[1],10),0==h[1].length?0:parseInt(h[1],10))||fb(0==g[2].length,0==h[2].length)||fb(g[2],h[2]);g=g[3];h=h[3]}while(0==b)}return 0<=b})}var dc;\ndc=l.document&&Tb?Yb():void 0;try{(new self.OffscreenCanvas(0,0)).getContext(\"2d\")}catch(a){}var ec=!Tb||9<=Number(dc);function fc(a){var b=document;return\"string\"===typeof a?b.getElementById(a):a}function gc(a,b){jb(b,function(c,d){c&&\"object\"==typeof c&&c.sa&&(c=c.ra());\"style\"==d?a.style.cssText=c:\"class\"==d?a.className=c:\"for\"==d?a.htmlFor=c:hc.hasOwnProperty(d)?a.setAttribute(hc[d],c):0==d.lastIndexOf(\"aria-\",0)||0==d.lastIndexOf(\"data-\",0)?a.setAttribute(d,c):a[d]=c})}\nvar hc={cellpadding:\"cellPadding\",cellspacing:\"cellSpacing\",colspan:\"colSpan\",frameborder:\"frameBorder\",height:\"height\",maxlength:\"maxLength\",nonce:\"nonce\",role:\"role\",rowspan:\"rowSpan\",type:\"type\",usemap:\"useMap\",valign:\"vAlign\",width:\"width\"};\nfunction ic(a,b,c){var d=arguments,e=document,f=String(d[0]),g=d[1];if(!ec&&g&&(g.name||g.type)){f=[\"<\",f];g.name&&f.push(' name=\"',Ob(g.name),'\"');if(g.type){f.push(' type=\"',Ob(g.type),'\"');var h={};z(h,g);delete h.type;g=h}f.push(\">\");f=f.join(\"\")}f=jc(e,f);g&&(\"string\"===typeof g?f.className=g:Array.isArray(g)?f.className=g.join(\" \"):gc(f,g));2<d.length&&kc(e,f,d);return f}\nfunction kc(a,b,c){function d(g){g&&b.appendChild(\"string\"===typeof g?a.createTextNode(g):g)}for(var e=2;e<c.length;e++){var f=c[e];!ma(f)||n(f)&&0<f.nodeType?d(f):w(lc(f)?Xa(f):f,d)}}function jc(a,b){b=String(b);\"application/xhtml+xml\"===a.contentType&&(b=b.toLowerCase());return a.createElement(b)}function lc(a){if(a&&\"number\"==typeof a.length){if(n(a))return\"function\"==typeof a.item||\"string\"==typeof a.item;if(na(a))return\"function\"==typeof a.item}return!1};function mc(a){l.setTimeout(function(){throw a;},0)}var nc;\nfunction oc(){var a=l.MessageChannel;\"undefined\"===typeof a&&\"undefined\"!==typeof window&&window.postMessage&&window.addEventListener&&!y(\"Presto\")&&(a=function(){var e=jc(document,\"IFRAME\");e.style.display=\"none\";Lb(e);document.documentElement.appendChild(e);var f=e.contentWindow;e=f.document;e.open();e.write(Ib(Kb));e.close();var g=\"callImmediate\"+Math.random(),h=\"file:\"==f.location.protocol?\"*\":f.location.protocol+\"//\"+f.location.host;e=q(function(m){if((\"*\"==h||m.origin==h)&&m.data==g)this.port1.onmessage()},\nthis);f.addEventListener(\"message\",e,!1);this.port1={};this.port2={postMessage:function(){f.postMessage(g,h)}}});if(\"undefined\"!==typeof a&&!y(\"Trident\")&&!y(\"MSIE\")){var b=new a,c={},d=c;b.port1.onmessage=function(){if(void 0!==c.next){c=c.next;var e=c.Fb;c.Fb=null;e()}};return function(e){d.next={Fb:e};d=d.next;b.port2.postMessage(0)}}return function(e){l.setTimeout(e,0)}};function pc(a,b){qc||rc();sc||(qc(),sc=!0);La.add(a,b)}var qc;function rc(){if(l.Promise&&l.Promise.resolve){var a=l.Promise.resolve(void 0);qc=function(){a.then(tc)}}else qc=function(){var b=tc;!na(l.setImmediate)||l.Window&&l.Window.prototype&&!y(\"Edge\")&&l.Window.prototype.setImmediate==l.setImmediate?(nc||(nc=oc()),nc(b)):l.setImmediate(b)}}var sc=!1,La=new Ha;function tc(){for(var a;a=Ka();){try{a.a.call(a.b)}catch(b){mc(b)}Ga(Ja,a)}sc=!1};function C(a,b){this.a=uc;this.i=void 0;this.f=this.b=this.c=null;this.g=this.h=!1;if(a!=ka)try{var c=this;a.call(b,function(d){vc(c,wc,d)},function(d){if(!(d instanceof xc))try{if(d instanceof Error)throw d;throw Error(\"Promise rejected.\");}catch(e){}vc(c,yc,d)})}catch(d){vc(this,yc,d)}}var uc=0,wc=2,yc=3;function zc(){this.next=this.f=this.b=this.g=this.a=null;this.c=!1}zc.prototype.reset=function(){this.f=this.b=this.g=this.a=null;this.c=!1};var Ac=new Fa(function(){return new zc},function(a){a.reset()});\nfunction Bc(a,b,c){var d=Ac.get();d.g=a;d.b=b;d.f=c;return d}function D(a){if(a instanceof C)return a;var b=new C(ka);vc(b,wc,a);return b}function E(a){return new C(function(b,c){c(a)})}function Cc(a,b,c){Dc(a,b,c,null)||pc(ta(b,a))}function Ec(a){return new C(function(b,c){var d=a.length,e=[];if(d)for(var f=function(p,v){d--;e[p]=v;0==d&&b(e)},g=function(p){c(p)},h=0,m;h<a.length;h++)m=a[h],Cc(m,ta(f,h),g);else b(e)})}\nfunction Fc(a){return new C(function(b){var c=a.length,d=[];if(c)for(var e=function(h,m,p){c--;d[h]=m?{Ob:!0,value:p}:{Ob:!1,reason:p};0==c&&b(d)},f=0,g;f<a.length;f++)g=a[f],Cc(g,ta(e,f,!0),ta(e,f,!1));else b(d)})}C.prototype.then=function(a,b,c){return Gc(this,na(a)?a:null,na(b)?b:null,c)};C.prototype.$goog_Thenable=!0;k=C.prototype;k.na=function(a,b){a=Bc(a,a,b);a.c=!0;Hc(this,a);return this};k.s=function(a,b){return Gc(this,null,a,b)};\nk.cancel=function(a){if(this.a==uc){var b=new xc(a);pc(function(){Ic(this,b)},this)}};function Ic(a,b){if(a.a==uc)if(a.c){var c=a.c;if(c.b){for(var d=0,e=null,f=null,g=c.b;g&&(g.c||(d++,g.a==a&&(e=g),!(e&&1<d)));g=g.next)e||(f=g);e&&(c.a==uc&&1==d?Ic(c,b):(f?(d=f,d.next==c.f&&(c.f=d),d.next=d.next.next):Jc(c),Kc(c,e,yc,b)))}a.c=null}else vc(a,yc,b)}function Hc(a,b){a.b||a.a!=wc&&a.a!=yc||Lc(a);a.f?a.f.next=b:a.b=b;a.f=b}\nfunction Gc(a,b,c,d){var e=Bc(null,null,null);e.a=new C(function(f,g){e.g=b?function(h){try{var m=b.call(d,h);f(m)}catch(p){g(p)}}:f;e.b=c?function(h){try{var m=c.call(d,h);void 0===m&&h instanceof xc?g(h):f(m)}catch(p){g(p)}}:g});e.a.c=a;Hc(a,e);return e.a}k.Zc=function(a){this.a=uc;vc(this,wc,a)};k.$c=function(a){this.a=uc;vc(this,yc,a)};\nfunction vc(a,b,c){a.a==uc&&(a===c&&(b=yc,c=new TypeError(\"Promise cannot resolve to itself\")),a.a=1,Dc(c,a.Zc,a.$c,a)||(a.i=c,a.a=b,a.c=null,Lc(a),b!=yc||c instanceof xc||Mc(a,c)))}function Dc(a,b,c,d){if(a instanceof C)return Hc(a,Bc(b||ka,c||null,d)),!0;if(Ca(a))return a.then(b,c,d),!0;if(n(a))try{var e=a.then;if(na(e))return Nc(a,e,b,c,d),!0}catch(f){return c.call(d,f),!0}return!1}\nfunction Nc(a,b,c,d,e){function f(m){h||(h=!0,d.call(e,m))}function g(m){h||(h=!0,c.call(e,m))}var h=!1;try{b.call(a,g,f)}catch(m){f(m)}}function Lc(a){a.h||(a.h=!0,pc(a.fc,a))}function Jc(a){var b=null;a.b&&(b=a.b,a.b=b.next,b.next=null);a.b||(a.f=null);return b}k.fc=function(){for(var a;a=Jc(this);)Kc(this,a,this.a,this.i);this.h=!1};\nfunction Kc(a,b,c,d){if(c==yc&&b.b&&!b.c)for(;a&&a.g;a=a.c)a.g=!1;if(b.a)b.a.c=null,Oc(b,c,d);else try{b.c?b.g.call(b.f):Oc(b,c,d)}catch(e){Pc.call(null,e)}Ga(Ac,b)}function Oc(a,b,c){b==wc?a.g.call(a.f,c):a.b&&a.b.call(a.f,c)}function Mc(a,b){a.g=!0;pc(function(){a.g&&Pc.call(null,b)})}var Pc=mc;function xc(a){u.call(this,a)}r(xc,u);xc.prototype.name=\"cancel\";function Qc(){0!=Rc&&(Sc[oa(this)]=this);this.xa=this.xa;this.oa=this.oa}var Rc=0,Sc={};Qc.prototype.xa=!1;function Tc(a){if(!a.xa&&(a.xa=!0,a.Da(),0!=Rc)){var b=oa(a);if(0!=Rc&&a.oa&&0<a.oa.length)throw Error(a+\" did not empty its onDisposeCallbacks queue. This probably means it overrode dispose() or disposeInternal() without calling the superclass' method.\");delete Sc[b]}}Qc.prototype.Da=function(){if(this.oa)for(;this.oa.length;)this.oa.shift()()};var Uc=Object.freeze||function(a){return a};var Vc=!Tb||9<=Number(dc),Wc=Tb&&!cc(\"9\"),Xc=function(){if(!l.addEventListener||!Object.defineProperty)return!1;var a=!1,b=Object.defineProperty({},\"passive\",{get:function(){a=!0}});try{l.addEventListener(\"test\",ka,b),l.removeEventListener(\"test\",ka,b)}catch(c){}return a}();function F(a,b){this.type=a;this.b=this.target=b;this.defaultPrevented=!1}F.prototype.preventDefault=function(){this.defaultPrevented=!0};function Yc(a,b){F.call(this,a?a.type:\"\");this.relatedTarget=this.b=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.key=\"\";this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.pointerId=0;this.pointerType=\"\";this.a=null;if(a){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.b=b;if(b=a.relatedTarget){if(Wb){a:{try{Pb(b.nodeName);var e=!0;break a}catch(f){}e=!1}e||(b=null)}}else\"mouseover\"==\nc?b=a.fromElement:\"mouseout\"==c&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0):(this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.key=a.key||\"\";this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=\na.metaKey;this.pointerId=a.pointerId||0;this.pointerType=\"string\"===typeof a.pointerType?a.pointerType:Zc[a.pointerType]||\"\";this.a=a;a.defaultPrevented&&this.preventDefault()}}r(Yc,F);var Zc=Uc({2:\"touch\",3:\"pen\",4:\"mouse\"});Yc.prototype.preventDefault=function(){Yc.$a.preventDefault.call(this);var a=this.a;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,Wc)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};Yc.prototype.g=function(){return this.a};var $c=\"closure_listenable_\"+(1E6*Math.random()|0),ad=0;function bd(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.Ua=e;this.key=++ad;this.va=this.Oa=!1}function cd(a){a.va=!0;a.listener=null;a.proxy=null;a.src=null;a.Ua=null};function dd(a){this.src=a;this.a={};this.b=0}dd.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.a[f];a||(a=this.a[f]=[],this.b++);var g=ed(a,b,d,e);-1<g?(b=a[g],c||(b.Oa=!1)):(b=new bd(b,this.src,f,!!d,e),b.Oa=c,a.push(b));return b};function fd(a,b){var c=b.type;c in a.a&&Ua(a.a[c],b)&&(cd(b),0==a.a[c].length&&(delete a.a[c],a.b--))}function ed(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.va&&f.listener==b&&f.capture==!!c&&f.Ua==d)return e}return-1};var gd=\"closure_lm_\"+(1E6*Math.random()|0),hd={},id=0;function jd(a,b,c,d,e){if(d&&d.once)kd(a,b,c,d,e);else if(Array.isArray(b))for(var f=0;f<b.length;f++)jd(a,b[f],c,d,e);else c=ld(c),a&&a[$c]?md(a,b,c,n(d)?!!d.capture:!!d,e):nd(a,b,c,!1,d,e)}\nfunction nd(a,b,c,d,e,f){if(!b)throw Error(\"Invalid event type\");var g=n(e)?!!e.capture:!!e,h=od(a);h||(a[gd]=h=new dd(a));c=h.add(b,c,d,g,f);if(!c.proxy){d=pd();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)Xc||(e=g),void 0===e&&(e=!1),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(qd(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error(\"addEventListener and attachEvent are unavailable.\");id++}}\nfunction pd(){var a=rd,b=Vc?function(c){return a.call(b.src,b.listener,c)}:function(c){c=a.call(b.src,b.listener,c);if(!c)return c};return b}function kd(a,b,c,d,e){if(Array.isArray(b))for(var f=0;f<b.length;f++)kd(a,b[f],c,d,e);else c=ld(c),a&&a[$c]?sd(a,b,c,n(d)?!!d.capture:!!d,e):nd(a,b,c,!0,d,e)}\nfunction G(a,b,c,d,e){if(Array.isArray(b))for(var f=0;f<b.length;f++)G(a,b[f],c,d,e);else(d=n(d)?!!d.capture:!!d,c=ld(c),a&&a[$c])?(a=a.v,b=String(b).toString(),b in a.a&&(f=a.a[b],c=ed(f,c,d,e),-1<c&&(cd(f[c]),Array.prototype.splice.call(f,c,1),0==f.length&&(delete a.a[b],a.b--)))):a&&(a=od(a))&&(b=a.a[b.toString()],a=-1,b&&(a=ed(b,c,d,e)),(c=-1<a?b[a]:null)&&td(c))}\nfunction td(a){if(\"number\"!==typeof a&&a&&!a.va){var b=a.src;if(b&&b[$c])fd(b.v,a);else{var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(qd(c),d):b.addListener&&b.removeListener&&b.removeListener(d);id--;(c=od(b))?(fd(c,a),0==c.b&&(c.src=null,b[gd]=null)):cd(a)}}}function qd(a){return a in hd?hd[a]:hd[a]=\"on\"+a}\nfunction ud(a,b,c,d){var e=!0;if(a=od(a))if(b=a.a[b.toString()])for(b=b.concat(),a=0;a<b.length;a++){var f=b[a];f&&f.capture==c&&!f.va&&(f=vd(f,d),e=e&&!1!==f)}return e}function vd(a,b){var c=a.listener,d=a.Ua||a.src;a.Oa&&td(a);return c.call(d,b)}\nfunction rd(a,b){if(a.va)return!0;if(!Vc){if(!b)a:{b=[\"window\",\"event\"];for(var c=l,d=0;d<b.length;d++)if(c=c[b[d]],null==c){b=null;break a}b=c}d=b;b=new Yc(d,this);c=!0;if(!(0>d.keyCode||void 0!=d.returnValue)){a:{var e=!1;if(0==d.keyCode)try{d.keyCode=-1;break a}catch(g){e=!0}if(e||void 0==d.returnValue)d.returnValue=!0}d=[];for(e=b.b;e;e=e.parentNode)d.push(e);a=a.type;for(e=d.length-1;0<=e;e--){b.b=d[e];var f=ud(d[e],a,!0,b);c=c&&f}for(e=0;e<d.length;e++)b.b=d[e],f=ud(d[e],a,!1,b),c=c&&f}return c}return vd(a,\nnew Yc(b,this))}function od(a){a=a[gd];return a instanceof dd?a:null}var wd=\"__closure_events_fn_\"+(1E9*Math.random()>>>0);function ld(a){if(na(a))return a;a[wd]||(a[wd]=function(b){return a.handleEvent(b)});return a[wd]};function H(){Qc.call(this);this.v=new dd(this);this.$b=this;this.fb=null}r(H,Qc);H.prototype[$c]=!0;H.prototype.addEventListener=function(a,b,c,d){jd(this,a,b,c,d)};H.prototype.removeEventListener=function(a,b,c,d){G(this,a,b,c,d)};\nH.prototype.dispatchEvent=function(a){var b,c=this.fb;if(c)for(b=[];c;c=c.fb)b.push(c);c=this.$b;var d=a.type||a;if(\"string\"===typeof a)a=new F(a,c);else if(a instanceof F)a.target=a.target||c;else{var e=a;a=new F(d,c);z(a,e)}e=!0;if(b)for(var f=b.length-1;0<=f;f--){var g=a.b=b[f];e=xd(g,d,!0,a)&&e}g=a.b=c;e=xd(g,d,!0,a)&&e;e=xd(g,d,!1,a)&&e;if(b)for(f=0;f<b.length;f++)g=a.b=b[f],e=xd(g,d,!1,a)&&e;return e};\nH.prototype.Da=function(){H.$a.Da.call(this);if(this.v){var a=this.v,b=0,c;for(c in a.a){for(var d=a.a[c],e=0;e<d.length;e++)++b,cd(d[e]);delete a.a[c];a.b--}}this.fb=null};function md(a,b,c,d,e){a.v.add(String(b),c,!1,d,e)}function sd(a,b,c,d,e){a.v.add(String(b),c,!0,d,e)}\nfunction xd(a,b,c,d){b=a.v.a[String(b)];if(!b)return!0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var g=b[f];if(g&&!g.va&&g.capture==c){var h=g.listener,m=g.Ua||g.src;g.Oa&&fd(a.v,g);e=!1!==h.call(m,d)&&e}}return e&&!d.defaultPrevented};function zd(a,b,c){if(na(a))c&&(a=q(a,c));else if(a&&\"function\"==typeof a.handleEvent)a=q(a.handleEvent,a);else throw Error(\"Invalid listener argument\");return 2147483647<Number(b)?-1:l.setTimeout(a,b||0)}function Ad(a){var b=null;return(new C(function(c,d){b=zd(function(){c(void 0)},a);-1==b&&d(Error(\"Failed to schedule timer.\"))})).s(function(c){l.clearTimeout(b);throw c;})};function Bd(a){if(a.V&&\"function\"==typeof a.V)return a.V();if(\"string\"===typeof a)return a.split(\"\");if(ma(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}b=[];c=0;for(d in a)b[c++]=a[d];return b}function Cd(a){if(a.Y&&\"function\"==typeof a.Y)return a.Y();if(!a.V||\"function\"!=typeof a.V){if(ma(a)||\"string\"===typeof a){var b=[];a=a.length;for(var c=0;c<a;c++)b.push(c);return b}b=[];c=0;for(var d in a)b[c++]=d;return b}}\nfunction Dd(a,b){if(a.forEach&&\"function\"==typeof a.forEach)a.forEach(b,void 0);else if(ma(a)||\"string\"===typeof a)w(a,b,void 0);else for(var c=Cd(a),d=Bd(a),e=d.length,f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a)};function Ed(a,b){this.b={};this.a=[];this.c=0;var c=arguments.length;if(1<c){if(c%2)throw Error(\"Uneven number of arguments\");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else if(a)if(a instanceof Ed)for(c=a.Y(),d=0;d<c.length;d++)this.set(c[d],a.get(c[d]));else for(d in a)this.set(d,a[d])}k=Ed.prototype;k.V=function(){Fd(this);for(var a=[],b=0;b<this.a.length;b++)a.push(this.b[this.a[b]]);return a};k.Y=function(){Fd(this);return this.a.concat()};\nk.clear=function(){this.b={};this.c=this.a.length=0};function Fd(a){if(a.c!=a.a.length){for(var b=0,c=0;b<a.a.length;){var d=a.a[b];Gd(a.b,d)&&(a.a[c++]=d);b++}a.a.length=c}if(a.c!=a.a.length){var e={};for(c=b=0;b<a.a.length;)d=a.a[b],Gd(e,d)||(a.a[c++]=d,e[d]=1),b++;a.a.length=c}}k.get=function(a,b){return Gd(this.b,a)?this.b[a]:b};k.set=function(a,b){Gd(this.b,a)||(this.c++,this.a.push(a));this.b[a]=b};\nk.forEach=function(a,b){for(var c=this.Y(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};function Gd(a,b){return Object.prototype.hasOwnProperty.call(a,b)};var Hd=/^(?:([^:/?#.]+):)?(?:\\/\\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/\\\\#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$/;function Id(a,b){if(a){a=a.split(\"&\");for(var c=0;c<a.length;c++){var d=a[c].indexOf(\"=\"),e=null;if(0<=d){var f=a[c].substring(0,d);e=a[c].substring(d+1)}else f=a[c];b(f,e?decodeURIComponent(e.replace(/\\+/g,\" \")):\"\")}}};function Jd(a,b){this.a=this.l=this.f=\"\";this.g=null;this.h=this.c=\"\";this.i=!1;var c;a instanceof Jd?(this.i=void 0!==b?b:a.i,Kd(this,a.f),this.l=a.l,this.a=a.a,Ld(this,a.g),this.c=a.c,Md(this,Nd(a.b)),this.h=a.h):a&&(c=String(a).match(Hd))?(this.i=!!b,Kd(this,c[1]||\"\",!0),this.l=Od(c[2]||\"\"),this.a=Od(c[3]||\"\",!0),Ld(this,c[4]),this.c=Od(c[5]||\"\",!0),Md(this,c[6]||\"\",!0),this.h=Od(c[7]||\"\")):(this.i=!!b,this.b=new Pd(null,this.i))}\nJd.prototype.toString=function(){var a=[],b=this.f;b&&a.push(Qd(b,Rd,!0),\":\");var c=this.a;if(c||\"file\"==b)a.push(\"//\"),(b=this.l)&&a.push(Qd(b,Rd,!0),\"@\"),a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g,\"%$1\")),c=this.g,null!=c&&a.push(\":\",String(c));if(c=this.c)this.a&&\"/\"!=c.charAt(0)&&a.push(\"/\"),a.push(Qd(c,\"/\"==c.charAt(0)?Sd:Td,!0));(c=this.b.toString())&&a.push(\"?\",c);(c=this.h)&&a.push(\"#\",Qd(c,Ud));return a.join(\"\")};\nJd.prototype.resolve=function(a){var b=new Jd(this),c=!!a.f;c?Kd(b,a.f):c=!!a.l;c?b.l=a.l:c=!!a.a;c?b.a=a.a:c=null!=a.g;var d=a.c;if(c)Ld(b,a.g);else if(c=!!a.c){if(\"/\"!=d.charAt(0))if(this.a&&!this.c)d=\"/\"+d;else{var e=b.c.lastIndexOf(\"/\");-1!=e&&(d=b.c.substr(0,e+1)+d)}e=d;if(\"..\"==e||\".\"==e)d=\"\";else if(x(e,\"./\")||x(e,\"/.\")){d=0==e.lastIndexOf(\"/\",0);e=e.split(\"/\");for(var f=[],g=0;g<e.length;){var h=e[g++];\".\"==h?d&&g==e.length&&f.push(\"\"):\"..\"==h?((1<f.length||1==f.length&&\"\"!=f[0])&&f.pop(),\nd&&g==e.length&&f.push(\"\")):(f.push(h),d=!0)}d=f.join(\"/\")}else d=e}c?b.c=d:c=\"\"!==a.b.toString();c?Md(b,Nd(a.b)):c=!!a.h;c&&(b.h=a.h);return b};function Kd(a,b,c){a.f=c?Od(b,!0):b;a.f&&(a.f=a.f.replace(/:$/,\"\"))}function Ld(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error(\"Bad port number \"+b);a.g=b}else a.g=null}function Md(a,b,c){b instanceof Pd?(a.b=b,Vd(a.b,a.i)):(c||(b=Qd(b,Wd)),a.b=new Pd(b,a.i))}function I(a,b,c){a.b.set(b,c)}function Xd(a,b){return a.b.get(b)}\nfunction J(a){return a instanceof Jd?new Jd(a):new Jd(a,void 0)}function Yd(a,b,c,d){var e=new Jd(null,void 0);a&&Kd(e,a);b&&(e.a=b);c&&Ld(e,c);d&&(e.c=d);return e}function Od(a,b){return a?b?decodeURI(a.replace(/%25/g,\"%2525\")):decodeURIComponent(a):\"\"}function Qd(a,b,c){return\"string\"===typeof a?(a=encodeURI(a).replace(b,Zd),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,\"%$1\")),a):null}function Zd(a){a=a.charCodeAt(0);return\"%\"+(a>>4&15).toString(16)+(a&15).toString(16)}\nvar Rd=/[#\\/\\?@]/g,Td=/[#\\?:]/g,Sd=/[#\\?]/g,Wd=/[#\\?@]/g,Ud=/#/g;function Pd(a,b){this.b=this.a=null;this.c=a||null;this.f=!!b}function $d(a){a.a||(a.a=new Ed,a.b=0,a.c&&Id(a.c,function(b,c){a.add(decodeURIComponent(b.replace(/\\+/g,\" \")),c)}))}function ae(a){var b=Cd(a);if(\"undefined\"==typeof b)throw Error(\"Keys are undefined\");var c=new Pd(null,void 0);a=Bd(a);for(var d=0;d<b.length;d++){var e=b[d],f=a[d];Array.isArray(f)?be(c,e,f):c.add(e,f)}return c}k=Pd.prototype;\nk.add=function(a,b){$d(this);this.c=null;a=ce(this,a);var c=this.a.get(a);c||this.a.set(a,c=[]);c.push(b);this.b+=1;return this};function de(a,b){$d(a);b=ce(a,b);Gd(a.a.b,b)&&(a.c=null,a.b-=a.a.get(b).length,a=a.a,Gd(a.b,b)&&(delete a.b[b],a.c--,a.a.length>2*a.c&&Fd(a)))}k.clear=function(){this.a=this.c=null;this.b=0};function ee(a,b){$d(a);b=ce(a,b);return Gd(a.a.b,b)}k.forEach=function(a,b){$d(this);this.a.forEach(function(c,d){w(c,function(e){a.call(b,e,d,this)},this)},this)};\nk.Y=function(){$d(this);for(var a=this.a.V(),b=this.a.Y(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};k.V=function(a){$d(this);var b=[];if(\"string\"===typeof a)ee(this,a)&&(b=Wa(b,this.a.get(ce(this,a))));else{a=this.a.V();for(var c=0;c<a.length;c++)b=Wa(b,a[c])}return b};k.set=function(a,b){$d(this);this.c=null;a=ce(this,a);ee(this,a)&&(this.b-=this.a.get(a).length);this.a.set(a,[b]);this.b+=1;return this};\nk.get=function(a,b){if(!a)return b;a=this.V(a);return 0<a.length?String(a[0]):b};function be(a,b,c){de(a,b);0<c.length&&(a.c=null,a.a.set(ce(a,b),Xa(c)),a.b+=c.length)}k.toString=function(){if(this.c)return this.c;if(!this.a)return\"\";for(var a=[],b=this.a.Y(),c=0;c<b.length;c++){var d=b[c],e=encodeURIComponent(String(d));d=this.V(d);for(var f=0;f<d.length;f++){var g=e;\"\"!==d[f]&&(g+=\"=\"+encodeURIComponent(String(d[f])));a.push(g)}}return this.c=a.join(\"&\")};\nfunction Nd(a){var b=new Pd;b.c=a.c;a.a&&(b.a=new Ed(a.a),b.b=a.b);return b}function ce(a,b){b=String(b);a.f&&(b=b.toLowerCase());return b}function Vd(a,b){b&&!a.f&&($d(a),a.c=null,a.a.forEach(function(c,d){var e=d.toLowerCase();d!=e&&(de(this,d),be(this,e,c))},a));a.f=b};function fe(a){var b=[];ge(new he,a,b);return b.join(\"\")}function he(){}\nfunction ge(a,b,c){if(null==b)c.push(\"null\");else{if(\"object\"==typeof b){if(Array.isArray(b)){var d=b;b=d.length;c.push(\"[\");for(var e=\"\",f=0;f<b;f++)c.push(e),ge(a,d[f],c),e=\",\";c.push(\"]\");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push(\"{\");e=\"\";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],\"function\"!=typeof f&&(c.push(e),ie(d,c),c.push(\":\"),ge(a,f,c),e=\",\"));c.push(\"}\");return}}switch(typeof b){case \"string\":ie(b,c);break;case \"number\":c.push(isFinite(b)&&\n!isNaN(b)?String(b):\"null\");break;case \"boolean\":c.push(String(b));break;case \"function\":c.push(\"null\");break;default:throw Error(\"Unknown type: \"+typeof b);}}}var je={'\"':'\\\\\"',\"\\\\\":\"\\\\\\\\\",\"/\":\"\\\\/\",\"\\b\":\"\\\\b\",\"\\f\":\"\\\\f\",\"\\n\":\"\\\\n\",\"\\r\":\"\\\\r\",\"\\t\":\"\\\\t\",\"\\x0B\":\"\\\\u000b\"},ke=/\\uffff/.test(\"\\uffff\")?/[\\\\\"\\x00-\\x1f\\x7f-\\uffff]/g:/[\\\\\"\\x00-\\x1f\\x7f-\\xff]/g;\nfunction ie(a,b){b.push('\"',a.replace(ke,function(c){var d=je[c];d||(d=\"\\\\u\"+(c.charCodeAt(0)|65536).toString(16).substr(1),je[c]=d);return d}),'\"')};function le(){var a=K();return Tb&&!!dc&&11==dc||/Edge\\/\\d+/.test(a)}function me(){return l.window&&l.window.location.href||self&&self.location&&self.location.href||\"\"}function ne(a,b){b=b||l.window;var c=\"about:blank\";a&&(c=Db(Fb(a)));b.location.href=c}function oe(a,b){var c=[],d;for(d in a)d in b?typeof a[d]!=typeof b[d]?c.push(d):\"object\"==typeof a[d]&&null!=a[d]&&null!=b[d]?0<oe(a[d],b[d]).length&&c.push(d):a[d]!==b[d]&&c.push(d):c.push(d);for(d in b)d in a||c.push(d);return c}\nfunction pe(){var a=K();a=qe(a)!=re?null:(a=a.match(/\\sChrome\\/(\\d+)/i))&&2==a.length?parseInt(a[1],10):null;return a&&30>a?!1:!Tb||!dc||9<dc}function se(a){a=(a||K()).toLowerCase();return a.match(/android/)||a.match(/webos/)||a.match(/iphone|ipad|ipod/)||a.match(/blackberry/)||a.match(/windows phone/)||a.match(/iemobile/)?!0:!1}function te(a){a=a||l.window;try{a.close()}catch(b){}}\nfunction ue(a,b,c){var d=Math.floor(1E9*Math.random()).toString();b=b||500;c=c||600;var e=(window.screen.availHeight-c)/2,f=(window.screen.availWidth-b)/2;b={width:b,height:c,top:0<e?e:0,left:0<f?f:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1};c=K().toLowerCase();d&&(b.target=d,x(c,\"crios/\")&&(b.target=\"_blank\"));qe(K())==ve&&(a=a||\"http://localhost\",b.scrollbars=!0);c=a||\"\";(a=b)||(a={});d=window;b=c instanceof Ab?c:Fb(\"undefined\"!=typeof c.href?c.href:String(c));c=a.target||c.target;e=[];\nfor(g in a)switch(g){case \"width\":case \"height\":case \"top\":case \"left\":e.push(g+\"=\"+a[g]);break;case \"target\":case \"noopener\":case \"noreferrer\":break;default:e.push(g+\"=\"+(a[g]?1:0))}var g=e.join(\",\");if((y(\"iPhone\")&&!y(\"iPod\")&&!y(\"iPad\")||y(\"iPad\")||y(\"iPod\"))&&d.navigator&&d.navigator.standalone&&c&&\"_self\"!=c)g=jc(document,\"A\"),nb(g,\"HTMLAnchorElement\"),b instanceof Ab||b instanceof Ab||(b=\"object\"==typeof b&&b.sa?b.ra():String(b),Eb.test(b)||(b=\"about:invalid#zClosurez\"),b=new Ab(Bb,b)),g.href=\nDb(b),g.setAttribute(\"target\",c),a.noreferrer&&g.setAttribute(\"rel\",\"noreferrer\"),a=document.createEvent(\"MouseEvent\"),a.initMouseEvent(\"click\",!0,!0,d,1),g.dispatchEvent(a),g={};else if(a.noreferrer){if(g=d.open(\"\",c,g),a=Db(b),g&&(Vb&&x(a,\";\")&&(a=\"'\"+a.replace(/'/g,\"%27\")+\"'\"),g.opener=null,a=Jb('<meta name=\"referrer\" content=\"no-referrer\"><meta http-equiv=\"refresh\" content=\"0; url='+Ob(a)+'\">'),d=g.document))d.write(Ib(a)),d.close()}else(g=d.open(Db(b),c,g))&&a.noopener&&(g.opener=null);if(g)try{g.focus()}catch(h){}return g}\nfunction we(a){return new C(function(b){function c(){Ad(2E3).then(function(){if(!a||a.closed)b();else return c()})}return c()})}var xe=/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/,ye=/^[^@]+@[^@]+$/;function ze(){var a=null;return(new C(function(b){\"complete\"==l.document.readyState?b():(a=function(){b()},kd(window,\"load\",a))})).s(function(b){G(window,\"load\",a);throw b;})}\nfunction Ae(){return Be(void 0)?ze().then(function(){return new C(function(a,b){var c=l.document,d=setTimeout(function(){b(Error(\"Cordova framework is not ready.\"))},1E3);c.addEventListener(\"deviceready\",function(){clearTimeout(d);a()},!1)})}):E(Error(\"Cordova must run in an Android or iOS file scheme.\"))}function Be(a){a=a||K();return!(\"file:\"!==Ce()&&\"ionic:\"!==Ce()||!a.toLowerCase().match(/iphone|ipad|ipod|android/))}function De(){var a=l.window;try{return!(!a||a==a.top)}catch(b){return!1}}\nfunction Ee(){return\"undefined\"!==typeof l.WorkerGlobalScope&&\"function\"===typeof l.importScripts}function Fe(){return firebase.INTERNAL.hasOwnProperty(\"reactNative\")?\"ReactNative\":firebase.INTERNAL.hasOwnProperty(\"node\")?\"Node\":Ee()?\"Worker\":\"Browser\"}function Ge(){var a=Fe();return\"ReactNative\"===a||\"Node\"===a}function He(){for(var a=50,b=[];0<a;)b.push(\"1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\".charAt(Math.floor(62*Math.random()))),a--;return b.join(\"\")}\nvar ve=\"Firefox\",re=\"Chrome\";\nfunction qe(a){var b=a.toLowerCase();if(x(b,\"opera/\")||x(b,\"opr/\")||x(b,\"opios/\"))return\"Opera\";if(x(b,\"iemobile\"))return\"IEMobile\";if(x(b,\"msie\")||x(b,\"trident/\"))return\"IE\";if(x(b,\"edge/\"))return\"Edge\";if(x(b,\"firefox/\"))return ve;if(x(b,\"silk/\"))return\"Silk\";if(x(b,\"blackberry\"))return\"Blackberry\";if(x(b,\"webos\"))return\"Webos\";if(!x(b,\"safari/\")||x(b,\"chrome/\")||x(b,\"crios/\")||x(b,\"android\"))if(!x(b,\"chrome/\")&&!x(b,\"crios/\")||x(b,\"edge/\")){if(x(b,\"android\"))return\"Android\";if((a=a.match(/([a-zA-Z\\d\\.]+)\\/[a-zA-Z\\d\\.]*$/))&&\n2==a.length)return a[1]}else return re;else return\"Safari\";return\"Other\"}var Ie={ld:\"FirebaseCore-web\",nd:\"FirebaseUI-web\"};function Je(a,b){b=b||[];var c=[],d={},e;for(e in Ie)d[Ie[e]]=!0;for(e=0;e<b.length;e++)\"undefined\"!==typeof d[b[e]]&&(delete d[b[e]],c.push(b[e]));c.sort();b=c;b.length||(b=[\"FirebaseCore-web\"]);c=Fe();\"Browser\"===c?(d=K(),c=qe(d)):\"Worker\"===c&&(d=K(),c=qe(d)+\"-\"+c);return c+\"/JsCore/\"+a+\"/\"+b.join(\",\")}function K(){return l.navigator&&l.navigator.userAgent||\"\"}\nfunction L(a,b){a=a.split(\".\");b=b||l;for(var c=0;c<a.length&&\"object\"==typeof b&&null!=b;c++)b=b[a[c]];c!=a.length&&(b=void 0);return b}function Ke(){try{var a=l.localStorage,b=Le();if(a)return a.setItem(b,\"1\"),a.removeItem(b),le()?!!l.indexedDB:!0}catch(c){return Ee()&&!!l.indexedDB}return!1}function Me(){return(Ne()||\"chrome-extension:\"===Ce()||Be())&&!Ge()&&Ke()&&!Ee()}function Ne(){return\"http:\"===Ce()||\"https:\"===Ce()}function Ce(){return l.location&&l.location.protocol||null}\nfunction Oe(a){a=a||K();return se(a)||qe(a)==ve?!1:!0}function Pe(a){return\"undefined\"===typeof a?null:fe(a)}function Qe(a){var b={},c;for(c in a)a.hasOwnProperty(c)&&null!==a[c]&&void 0!==a[c]&&(b[c]=a[c]);return b}function Re(a){if(null!==a)return JSON.parse(a)}function Le(a){return a?a:Math.floor(1E9*Math.random()).toString()}function Se(a){a=a||K();return\"Safari\"==qe(a)||a.toLowerCase().match(/iphone|ipad|ipod/)?!1:!0}\nfunction Te(){var a=l.___jsl;if(a&&a.H)for(var b in a.H)if(a.H[b].r=a.H[b].r||[],a.H[b].L=a.H[b].L||[],a.H[b].r=a.H[b].L.concat(),a.CP)for(var c=0;c<a.CP.length;c++)a.CP[c]=null}function Ue(a,b){if(a>b)throw Error(\"Short delay should be less than long delay!\");this.a=a;this.c=b;a=K();b=Fe();this.b=se(a)||\"ReactNative\"===b}\nUe.prototype.get=function(){var a=l.navigator;return(a&&\"boolean\"===typeof a.onLine&&(Ne()||\"chrome-extension:\"===Ce()||\"undefined\"!==typeof a.connection)?a.onLine:1)?this.b?this.c:this.a:Math.min(5E3,this.a)};function Ve(){var a=l.document;return a&&\"undefined\"!==typeof a.visibilityState?\"visible\"==a.visibilityState:!0}\nfunction We(){var a=l.document,b=null;return Ve()||!a?D():(new C(function(c){b=function(){Ve()&&(a.removeEventListener(\"visibilitychange\",b,!1),c())};a.addEventListener(\"visibilitychange\",b,!1)})).s(function(c){a.removeEventListener(\"visibilitychange\",b,!1);throw c;})}function Xe(a){\"undefined\"!==typeof console&&\"function\"===typeof console.warn&&console.warn(a)}\nfunction Ye(a){try{var b=new Date(parseInt(a,10));if(!isNaN(b.getTime())&&!/[^0-9]/.test(a))return b.toUTCString()}catch(c){}return null}function Ze(){return!(!L(\"fireauth.oauthhelper\",l)&&!L(\"fireauth.iframe\",l))}function $e(){var a=l.navigator;return a&&a.serviceWorker&&a.serviceWorker.controller||null}function af(){var a=l.navigator;return a&&a.serviceWorker?D().then(function(){return a.serviceWorker.ready}).then(function(b){return b.active||null}).s(function(){return null}):D(null)};var bf={};function cf(a){bf[a]||(bf[a]=!0,Xe(a))};var df;try{var ef={};Object.defineProperty(ef,\"abcd\",{configurable:!0,enumerable:!0,value:1});Object.defineProperty(ef,\"abcd\",{configurable:!0,enumerable:!0,value:2});df=2==ef.abcd}catch(a){df=!1}function M(a,b,c){df?Object.defineProperty(a,b,{configurable:!0,enumerable:!0,value:c}):a[b]=c}function N(a,b){if(b)for(var c in b)b.hasOwnProperty(c)&&M(a,c,b[c])}function ff(a){var b={};N(b,a);return b}function gf(a){var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}\nfunction hf(a,b){if(!b||!b.length)return!0;if(!a)return!1;for(var c=0;c<b.length;c++){var d=a[b[c]];if(void 0===d||null===d||\"\"===d)return!1}return!0}function jf(a){var b=a;if(\"object\"==typeof a&&null!=a){b=\"length\"in a?[]:{};for(var c in a)M(b,c,jf(a[c]))}return b};/*\n\n Copyright 2019 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\nfunction kf(a){var b=a&&(a[lf]?\"phone\":null);if(b&&a&&a[mf]){M(this,\"uid\",a[mf]);M(this,\"displayName\",a[nf]||null);var c=null;a[of]&&(c=(new Date(a[of])).toUTCString());M(this,\"enrollmentTime\",c);M(this,\"factorId\",b)}else throw new t(\"internal-error\",\"Internal assert: invalid MultiFactorInfo object\");}kf.prototype.w=function(){return{uid:this.uid,displayName:this.displayName,factorId:this.factorId,enrollmentTime:this.enrollmentTime}};function pf(a){try{var b=new qf(a)}catch(c){b=null}return b}\nvar nf=\"displayName\",of=\"enrolledAt\",mf=\"mfaEnrollmentId\",lf=\"phoneInfo\";function qf(a){kf.call(this,a);M(this,\"phoneNumber\",a[lf])}r(qf,kf);qf.prototype.w=function(){var a=qf.$a.w.call(this);a.phoneNumber=this.phoneNumber;return a};function rf(a){var b={},c=a[sf],d=a[tf],e=a[uf];a=pf(a[vf]);if(!e||e!=wf&&e!=xf&&!c||e==xf&&!d||e==yf&&!a)throw Error(\"Invalid checkActionCode response!\");e==xf?(b[zf]=c||null,b[Af]=c||null,b[Bf]=d):(b[zf]=d||null,b[Af]=d||null,b[Bf]=c||null);b[Cf]=a||null;M(this,Df,e);M(this,Ef,jf(b))}\nvar yf=\"REVERT_SECOND_FACTOR_ADDITION\",wf=\"EMAIL_SIGNIN\",xf=\"VERIFY_AND_CHANGE_EMAIL\",sf=\"email\",vf=\"mfaInfo\",tf=\"newEmail\",uf=\"requestType\",Bf=\"email\",zf=\"fromEmail\",Cf=\"multiFactorInfo\",Af=\"previousEmail\",Ef=\"data\",Df=\"operation\";function Ff(a){a=J(a);var b=Xd(a,Gf)||null,c=Xd(a,Hf)||null,d=Xd(a,If)||null;d=d?Jf[d]||null:null;if(!b||!c||!d)throw new t(\"argument-error\",Gf+\", \"+Hf+\"and \"+If+\" are required in a valid action code URL.\");N(this,{apiKey:b,operation:d,code:c,continueUrl:Xd(a,Kf)||null,languageCode:Xd(a,Lf)||null,tenantId:Xd(a,Mf)||null})}\nvar Gf=\"apiKey\",Hf=\"oobCode\",Kf=\"continueUrl\",Lf=\"languageCode\",If=\"mode\",Mf=\"tenantId\",Jf={recoverEmail:\"RECOVER_EMAIL\",resetPassword:\"PASSWORD_RESET\",revertSecondFactorAddition:yf,signIn:wf,verifyAndChangeEmail:xf,verifyEmail:\"VERIFY_EMAIL\"};function Nf(a){try{return new Ff(a)}catch(b){return null}};function Of(a){var b=a[Pf];if(\"undefined\"===typeof b)throw new t(\"missing-continue-uri\");if(\"string\"!==typeof b||\"string\"===typeof b&&!b.length)throw new t(\"invalid-continue-uri\");this.h=b;this.b=this.a=null;this.g=!1;var c=a[Qf];if(c&&\"object\"===typeof c){b=c[Rf];var d=c[Sf];c=c[Tf];if(\"string\"===typeof b&&b.length){this.a=b;if(\"undefined\"!==typeof d&&\"boolean\"!==typeof d)throw new t(\"argument-error\",Sf+\" property must be a boolean when specified.\");this.g=!!d;if(\"undefined\"!==typeof c&&(\"string\"!==\ntypeof c||\"string\"===typeof c&&!c.length))throw new t(\"argument-error\",Tf+\" property must be a non empty string when specified.\");this.b=c||null}else{if(\"undefined\"!==typeof b)throw new t(\"argument-error\",Rf+\" property must be a non empty string when specified.\");if(\"undefined\"!==typeof d||\"undefined\"!==typeof c)throw new t(\"missing-android-pkg-name\");}}else if(\"undefined\"!==typeof c)throw new t(\"argument-error\",Qf+\" property must be a non null object when specified.\");this.f=null;if((b=a[Uf])&&\"object\"===\ntypeof b)if(b=b[Vf],\"string\"===typeof b&&b.length)this.f=b;else{if(\"undefined\"!==typeof b)throw new t(\"argument-error\",Vf+\" property must be a non empty string when specified.\");}else if(\"undefined\"!==typeof b)throw new t(\"argument-error\",Uf+\" property must be a non null object when specified.\");b=a[Wf];if(\"undefined\"!==typeof b&&\"boolean\"!==typeof b)throw new t(\"argument-error\",Wf+\" property must be a boolean when specified.\");this.c=!!b;a=a[Xf];if(\"undefined\"!==typeof a&&(\"string\"!==typeof a||\"string\"===\ntypeof a&&!a.length))throw new t(\"argument-error\",Xf+\" property must be a non empty string when specified.\");this.i=a||null}var Qf=\"android\",Xf=\"dynamicLinkDomain\",Wf=\"handleCodeInApp\",Uf=\"iOS\",Pf=\"url\",Sf=\"installApp\",Tf=\"minimumVersion\",Rf=\"packageName\",Vf=\"bundleId\";\nfunction Yf(a){var b={};b.continueUrl=a.h;b.canHandleCodeInApp=a.c;if(b.androidPackageName=a.a)b.androidMinimumVersion=a.b,b.androidInstallApp=a.g;b.iOSBundleId=a.f;b.dynamicLinkDomain=a.i;for(var c in b)null===b[c]&&delete b[c];return b};function Zf(a){return Pa(a,function(b){b=b.toString(16);return 1<b.length?b:\"0\"+b}).join(\"\")};var $f=null;function ag(a){var b=\"\";bg(a,function(c){b+=String.fromCharCode(c)});return b}function bg(a,b){function c(m){for(;d<a.length;){var p=a.charAt(d++),v=$f[p];if(null!=v)return v;if(!/^[\\s\\xa0]*$/.test(p))throw Error(\"Unknown base64 encoding at char: \"+p);}return m}cg();for(var d=0;;){var e=c(-1),f=c(0),g=c(64),h=c(64);if(64===h&&-1===e)break;b(e<<2|f>>4);64!=g&&(b(f<<4&240|g>>2),64!=h&&b(g<<6&192|h))}}\nfunction cg(){if(!$f){$f={};for(var a=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\".split(\"\"),b=[\"+/=\",\"+/\",\"-_=\",\"-_.\",\"-_\"],c=0;5>c;c++)for(var d=a.concat(b[c].split(\"\")),e=0;e<d.length;e++){var f=d[e];void 0===$f[f]&&($f[f]=e)}}};function dg(a){var b=eg(a);if(!(b&&b.sub&&b.iss&&b.aud&&b.exp))throw Error(\"Invalid JWT\");this.g=a;this.c=b.exp;this.h=b.sub;ua();this.a=b.provider_id||b.firebase&&b.firebase.sign_in_provider||null;this.f=b.firebase&&b.firebase.tenant||null;this.b=!!b.is_anonymous||\"anonymous\"==this.a}dg.prototype.S=function(){return this.f};dg.prototype.i=function(){return this.b};dg.prototype.toString=function(){return this.g};function fg(a){try{return new dg(a)}catch(b){return null}}\nfunction eg(a){if(!a)return null;a=a.split(\".\");if(3!=a.length)return null;a=a[1];for(var b=(4-a.length%4)%4,c=0;c<b;c++)a+=\".\";try{return JSON.parse(ag(a))}catch(d){}return null};var gg=\"oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version\".split(\" \"),hg=[\"client_id\",\"response_type\",\"scope\",\"redirect_uri\",\"state\"],ig={md:{Ja:\"locale\",ua:700,ta:600,fa:\"facebook.com\",Wa:hg},od:{Ja:null,ua:500,ta:750,fa:\"github.com\",Wa:hg},pd:{Ja:\"hl\",ua:515,ta:680,fa:\"google.com\",Wa:hg},vd:{Ja:\"lang\",ua:485,ta:705,fa:\"twitter.com\",Wa:gg},jd:{Ja:\"locale\",ua:640,ta:600,fa:\"apple.com\",Wa:[]}};\nfunction jg(a){for(var b in ig)if(ig[b].fa==a)return ig[b];return null};function kg(a){var b={};b[\"facebook.com\"]=lg;b[\"google.com\"]=mg;b[\"github.com\"]=ng;b[\"twitter.com\"]=og;var c=a&&a[pg];try{if(c)return b[c]?new b[c](a):new qg(a);if(\"undefined\"!==typeof a[rg])return new sg(a)}catch(d){}return null}var rg=\"idToken\",pg=\"providerId\";\nfunction sg(a){var b=a[pg];if(!b&&a[rg]){var c=fg(a[rg]);c&&c.a&&(b=c.a)}if(!b)throw Error(\"Invalid additional user info!\");if(\"anonymous\"==b||\"custom\"==b)b=null;c=!1;\"undefined\"!==typeof a.isNewUser?c=!!a.isNewUser:\"identitytoolkit#SignupNewUserResponse\"===a.kind&&(c=!0);M(this,\"providerId\",b);M(this,\"isNewUser\",c)}function qg(a){sg.call(this,a);a=Re(a.rawUserInfo||\"{}\");M(this,\"profile\",jf(a||{}))}r(qg,sg);\nfunction lg(a){qg.call(this,a);if(\"facebook.com\"!=this.providerId)throw Error(\"Invalid provider ID!\");}r(lg,qg);function ng(a){qg.call(this,a);if(\"github.com\"!=this.providerId)throw Error(\"Invalid provider ID!\");M(this,\"username\",this.profile&&this.profile.login||null)}r(ng,qg);function mg(a){qg.call(this,a);if(\"google.com\"!=this.providerId)throw Error(\"Invalid provider ID!\");}r(mg,qg);\nfunction og(a){qg.call(this,a);if(\"twitter.com\"!=this.providerId)throw Error(\"Invalid provider ID!\");M(this,\"username\",a.screenName||null)}r(og,qg);function tg(a){var b=J(a),c=Xd(b,\"link\"),d=Xd(J(c),\"link\");b=Xd(b,\"deep_link_id\");return Xd(J(b),\"link\")||b||d||c||a};function ug(a,b){if(!a&&!b)throw new t(\"internal-error\",\"Internal assert: no raw session string available\");if(a&&b)throw new t(\"internal-error\",\"Internal assert: unable to determine the session type\");this.a=a||null;this.b=b||null;this.type=this.a?vg:wg}var vg=\"enroll\",wg=\"signin\";ug.prototype.Ha=function(){return this.a?D(this.a):D(this.b)};ug.prototype.w=function(){return this.type==vg?{multiFactorSession:{idToken:this.a}}:{multiFactorSession:{pendingCredential:this.b}}};function xg(){}xg.prototype.ja=function(){};xg.prototype.b=function(){};xg.prototype.c=function(){};xg.prototype.w=function(){};function yg(a,b){return a.then(function(c){if(c[zg]){var d=fg(c[zg]);if(!d||b!=d.h)throw new t(\"user-mismatch\");return c}throw new t(\"user-mismatch\");}).s(function(c){throw c&&c.code&&c.code==va+\"user-not-found\"?new t(\"user-mismatch\"):c;})}\nfunction Ag(a,b){if(b)this.a=b;else throw new t(\"internal-error\",\"failed to construct a credential\");M(this,\"providerId\",a);M(this,\"signInMethod\",a)}Ag.prototype.ja=function(a){return Bg(a,Cg(this))};Ag.prototype.b=function(a,b){var c=Cg(this);c.idToken=b;return Dg(a,c)};Ag.prototype.c=function(a,b){return yg(Eg(a,Cg(this)),b)};function Cg(a){return{pendingToken:a.a,requestUri:\"http://localhost\"}}Ag.prototype.w=function(){return{providerId:this.providerId,signInMethod:this.signInMethod,pendingToken:this.a}};\nfunction Fg(a){if(a&&a.providerId&&a.signInMethod&&0==a.providerId.indexOf(\"saml.\")&&a.pendingToken)try{return new Ag(a.providerId,a.pendingToken)}catch(b){}return null}\nfunction Gg(a,b,c){this.a=null;if(b.idToken||b.accessToken)b.idToken&&M(this,\"idToken\",b.idToken),b.accessToken&&M(this,\"accessToken\",b.accessToken),b.nonce&&!b.pendingToken&&M(this,\"nonce\",b.nonce),b.pendingToken&&(this.a=b.pendingToken);else if(b.oauthToken&&b.oauthTokenSecret)M(this,\"accessToken\",b.oauthToken),M(this,\"secret\",b.oauthTokenSecret);else throw new t(\"internal-error\",\"failed to construct a credential\");M(this,\"providerId\",a);M(this,\"signInMethod\",c)}\nGg.prototype.ja=function(a){return Bg(a,Hg(this))};Gg.prototype.b=function(a,b){var c=Hg(this);c.idToken=b;return Dg(a,c)};Gg.prototype.c=function(a,b){var c=Hg(this);return yg(Eg(a,c),b)};\nfunction Hg(a){var b={};a.idToken&&(b.id_token=a.idToken);a.accessToken&&(b.access_token=a.accessToken);a.secret&&(b.oauth_token_secret=a.secret);b.providerId=a.providerId;a.nonce&&!a.a&&(b.nonce=a.nonce);b={postBody:ae(b).toString(),requestUri:\"http://localhost\"};a.a&&(delete b.postBody,b.pendingToken=a.a);return b}\nGg.prototype.w=function(){var a={providerId:this.providerId,signInMethod:this.signInMethod};this.idToken&&(a.oauthIdToken=this.idToken);this.accessToken&&(a.oauthAccessToken=this.accessToken);this.secret&&(a.oauthTokenSecret=this.secret);this.nonce&&(a.nonce=this.nonce);this.a&&(a.pendingToken=this.a);return a};\nfunction Ig(a){if(a&&a.providerId&&a.signInMethod){var b={idToken:a.oauthIdToken,accessToken:a.oauthTokenSecret?null:a.oauthAccessToken,oauthTokenSecret:a.oauthTokenSecret,oauthToken:a.oauthTokenSecret&&a.oauthAccessToken,nonce:a.nonce,pendingToken:a.pendingToken};try{return new Gg(a.providerId,b,a.signInMethod)}catch(c){}}return null}function Jg(a,b){this.Pc=b||[];N(this,{providerId:a,isOAuthProvider:!0});this.Hb={};this.ob=(jg(a)||{}).Ja||null;this.nb=null}\nJg.prototype.Ka=function(a){this.Hb=lb(a);return this};function Kg(a){if(\"string\"!==typeof a||0!=a.indexOf(\"saml.\"))throw new t(\"argument-error\",'SAML provider IDs must be prefixed with \"saml.\"');Jg.call(this,a,[])}r(Kg,Jg);function Lg(a){Jg.call(this,a,hg);this.a=[]}r(Lg,Jg);Lg.prototype.Ca=function(a){Ta(this.a,a)||this.a.push(a);return this};Lg.prototype.Pb=function(){return Xa(this.a)};\nLg.prototype.credential=function(a,b){var c;n(a)?c={idToken:a.idToken||null,accessToken:a.accessToken||null,nonce:a.rawNonce||null}:c={idToken:a||null,accessToken:b||null};if(!c.idToken&&!c.accessToken)throw new t(\"argument-error\",\"credential failed: must provide the ID token and/or the access token.\");return new Gg(this.providerId,c,this.providerId)};function Mg(){Lg.call(this,\"facebook.com\")}r(Mg,Lg);M(Mg,\"PROVIDER_ID\",\"facebook.com\");M(Mg,\"FACEBOOK_SIGN_IN_METHOD\",\"facebook.com\");\nfunction Ng(a){if(!a)throw new t(\"argument-error\",\"credential failed: expected 1 argument (the OAuth access token).\");var b=a;n(a)&&(b=a.accessToken);return(new Mg).credential({accessToken:b})}function Og(){Lg.call(this,\"github.com\")}r(Og,Lg);M(Og,\"PROVIDER_ID\",\"github.com\");M(Og,\"GITHUB_SIGN_IN_METHOD\",\"github.com\");\nfunction Pg(a){if(!a)throw new t(\"argument-error\",\"credential failed: expected 1 argument (the OAuth access token).\");var b=a;n(a)&&(b=a.accessToken);return(new Og).credential({accessToken:b})}function Qg(){Lg.call(this,\"google.com\");this.Ca(\"profile\")}r(Qg,Lg);M(Qg,\"PROVIDER_ID\",\"google.com\");M(Qg,\"GOOGLE_SIGN_IN_METHOD\",\"google.com\");function Rg(a,b){var c=a;n(a)&&(c=a.idToken,b=a.accessToken);return(new Qg).credential({idToken:c,accessToken:b})}function Sg(){Jg.call(this,\"twitter.com\",gg)}\nr(Sg,Jg);M(Sg,\"PROVIDER_ID\",\"twitter.com\");M(Sg,\"TWITTER_SIGN_IN_METHOD\",\"twitter.com\");function Tg(a,b){var c=a;n(c)||(c={oauthToken:a,oauthTokenSecret:b});if(!c.oauthToken||!c.oauthTokenSecret)throw new t(\"argument-error\",\"credential failed: expected 2 arguments (the OAuth access token and secret).\");return new Gg(\"twitter.com\",c,\"twitter.com\")}\nfunction Ug(a,b,c){this.a=a;this.f=b;M(this,\"providerId\",\"password\");M(this,\"signInMethod\",c===Vg.EMAIL_LINK_SIGN_IN_METHOD?Vg.EMAIL_LINK_SIGN_IN_METHOD:Vg.EMAIL_PASSWORD_SIGN_IN_METHOD)}Ug.prototype.ja=function(a){return this.signInMethod==Vg.EMAIL_LINK_SIGN_IN_METHOD?O(a,Wg,{email:this.a,oobCode:this.f}):O(a,Xg,{email:this.a,password:this.f})};\nUg.prototype.b=function(a,b){return this.signInMethod==Vg.EMAIL_LINK_SIGN_IN_METHOD?O(a,Yg,{idToken:b,email:this.a,oobCode:this.f}):O(a,Zg,{idToken:b,email:this.a,password:this.f})};Ug.prototype.c=function(a,b){return yg(this.ja(a),b)};Ug.prototype.w=function(){return{email:this.a,password:this.f,signInMethod:this.signInMethod}};function $g(a){return a&&a.email&&a.password?new Ug(a.email,a.password,a.signInMethod):null}function Vg(){N(this,{providerId:\"password\",isOAuthProvider:!1})}\nfunction ah(a,b){b=bh(b);if(!b)throw new t(\"argument-error\",\"Invalid email link!\");return new Ug(a,b.code,Vg.EMAIL_LINK_SIGN_IN_METHOD)}function bh(a){a=tg(a);return(a=Nf(a))&&a.operation===wf?a:null}N(Vg,{PROVIDER_ID:\"password\"});N(Vg,{EMAIL_LINK_SIGN_IN_METHOD:\"emailLink\"});N(Vg,{EMAIL_PASSWORD_SIGN_IN_METHOD:\"password\"});function ch(a){if(!(a.cb&&a.bb||a.La&&a.ea))throw new t(\"internal-error\");this.a=a;M(this,\"providerId\",\"phone\");this.fa=\"phone\";M(this,\"signInMethod\",\"phone\")}\nch.prototype.ja=function(a){return a.eb(dh(this))};ch.prototype.b=function(a,b){var c=dh(this);c.idToken=b;return O(a,eh,c)};ch.prototype.c=function(a,b){var c=dh(this);c.operation=\"REAUTH\";a=O(a,fh,c);return yg(a,b)};ch.prototype.w=function(){var a={providerId:\"phone\"};this.a.cb&&(a.verificationId=this.a.cb);this.a.bb&&(a.verificationCode=this.a.bb);this.a.La&&(a.temporaryProof=this.a.La);this.a.ea&&(a.phoneNumber=this.a.ea);return a};\nfunction gh(a){if(a&&\"phone\"===a.providerId&&(a.verificationId&&a.verificationCode||a.temporaryProof&&a.phoneNumber)){var b={};w([\"verificationId\",\"verificationCode\",\"temporaryProof\",\"phoneNumber\"],function(c){a[c]&&(b[c]=a[c])});return new ch(b)}return null}function dh(a){return a.a.La&&a.a.ea?{temporaryProof:a.a.La,phoneNumber:a.a.ea}:{sessionInfo:a.a.cb,code:a.a.bb}}\nfunction hh(a){try{this.a=a||firebase.auth()}catch(b){throw new t(\"argument-error\",\"Either an instance of firebase.auth.Auth must be passed as an argument to the firebase.auth.PhoneAuthProvider constructor, or the default firebase App instance must be initialized via firebase.initializeApp().\");}N(this,{providerId:\"phone\",isOAuthProvider:!1})}\nhh.prototype.eb=function(a,b){var c=this.a.a;return D(b.verify()).then(function(d){if(\"string\"!==typeof d)throw new t(\"argument-error\",\"An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.\");switch(b.type){case \"recaptcha\":var e=n(a)?a.session:null,f=n(a)?a.phoneNumber:a,g;e&&e.type==vg?g=e.Ha().then(function(h){return ih(c,{idToken:h,phoneEnrollmentInfo:{phoneNumber:f,recaptchaToken:d}})}):e&&e.type==wg?g=e.Ha().then(function(h){return jh(c,\n{mfaPendingCredential:h,mfaEnrollmentId:a.multiFactorHint&&a.multiFactorHint.uid||a.multiFactorUid,phoneSignInInfo:{recaptchaToken:d}})}):g=kh(c,{phoneNumber:f,recaptchaToken:d});return g.then(function(h){\"function\"===typeof b.reset&&b.reset();return h},function(h){\"function\"===typeof b.reset&&b.reset();throw h;});default:throw new t(\"argument-error\",'Only firebase.auth.ApplicationVerifiers with type=\"recaptcha\" are currently supported.');}})};\nfunction lh(a,b){if(!a)throw new t(\"missing-verification-id\");if(!b)throw new t(\"missing-verification-code\");return new ch({cb:a,bb:b})}N(hh,{PROVIDER_ID:\"phone\"});N(hh,{PHONE_SIGN_IN_METHOD:\"phone\"});\nfunction mh(a){if(a.temporaryProof&&a.phoneNumber)return new ch({La:a.temporaryProof,ea:a.phoneNumber});var b=a&&a.providerId;if(!b||\"password\"===b)return null;var c=a&&a.oauthAccessToken,d=a&&a.oauthTokenSecret,e=a&&a.nonce,f=a&&a.oauthIdToken,g=a&&a.pendingToken;try{switch(b){case \"google.com\":return Rg(f,c);case \"facebook.com\":return Ng(c);case \"github.com\":return Pg(c);case \"twitter.com\":return Tg(c,d);default:return c||d||f||g?g?0==b.indexOf(\"saml.\")?new Ag(b,g):new Gg(b,{pendingToken:g,idToken:a.oauthIdToken,\naccessToken:a.oauthAccessToken},b):(new Lg(b)).credential({idToken:f,accessToken:c,rawNonce:e}):null}}catch(h){return null}}function nh(a){if(!a.isOAuthProvider)throw new t(\"invalid-oauth-provider\");};function oh(a,b,c,d,e,f,g){this.c=a;this.b=b||null;this.g=c||null;this.f=d||null;this.i=f||null;this.h=g||null;this.a=e||null;if(this.g||this.a){if(this.g&&this.a)throw new t(\"invalid-auth-event\");if(this.g&&!this.f)throw new t(\"invalid-auth-event\");}else throw new t(\"invalid-auth-event\");}oh.prototype.getUid=function(){var a=[];a.push(this.c);this.b&&a.push(this.b);this.f&&a.push(this.f);this.h&&a.push(this.h);return a.join(\"-\")};oh.prototype.S=function(){return this.h};\noh.prototype.w=function(){return{type:this.c,eventId:this.b,urlResponse:this.g,sessionId:this.f,postBody:this.i,tenantId:this.h,error:this.a&&this.a.w()}};function ph(a){a=a||{};return a.type?new oh(a.type,a.eventId,a.urlResponse,a.sessionId,a.error&&ya(a.error),a.postBody,a.tenantId):null};/*\n\n Copyright 2018 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\nfunction qh(){this.b=null;this.a=[]}var rh=null;function sh(a){var b=rh;b.a.push(a);b.b||(b.b=function(c){for(var d=0;d<b.a.length;d++)b.a[d](c)},a=L(\"universalLinks.subscribe\",l),\"function\"===typeof a&&a(null,b.b))};function th(a){var b=\"unauthorized-domain\",c=void 0,d=J(a);a=d.a;d=d.f;\"chrome-extension\"==d?c=Nb(\"This chrome extension ID (chrome-extension://%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.\",a):\"http\"==d||\"https\"==d?c=Nb(\"This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.\",a):b=\"operation-not-supported-in-this-environment\";\nt.call(this,b,c)}r(th,t);function uh(a,b,c){t.call(this,a,c);a=b||{};a.Ib&&M(this,\"email\",a.Ib);a.ea&&M(this,\"phoneNumber\",a.ea);a.credential&&M(this,\"credential\",a.credential);a.Yb&&M(this,\"tenantId\",a.Yb)}r(uh,t);uh.prototype.w=function(){var a={code:this.code,message:this.message};this.email&&(a.email=this.email);this.phoneNumber&&(a.phoneNumber=this.phoneNumber);this.tenantId&&(a.tenantId=this.tenantId);var b=this.credential&&this.credential.w();b&&z(a,b);return a};uh.prototype.toJSON=function(){return this.w()};\nfunction vh(a){if(a.code){var b=a.code||\"\";0==b.indexOf(va)&&(b=b.substring(va.length));var c={credential:mh(a),Yb:a.tenantId};if(a.email)c.Ib=a.email;else if(a.phoneNumber)c.ea=a.phoneNumber;else if(!c.credential)return new t(b,a.message||void 0);return new uh(b,c,a.message)}return null};function wh(){}wh.prototype.c=null;function xh(a){return a.c||(a.c=a.b())};var yh;function zh(){}r(zh,wh);zh.prototype.a=function(){var a=Ah(this);return a?new ActiveXObject(a):new XMLHttpRequest};zh.prototype.b=function(){var a={};Ah(this)&&(a[0]=!0,a[1]=!0);return a};\nfunction Ah(a){if(!a.f&&\"undefined\"==typeof XMLHttpRequest&&\"undefined\"!=typeof ActiveXObject){for(var b=[\"MSXML2.XMLHTTP.6.0\",\"MSXML2.XMLHTTP.3.0\",\"MSXML2.XMLHTTP\",\"Microsoft.XMLHTTP\"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.f=d}catch(e){}}throw Error(\"Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed\");}return a.f}yh=new zh;function Bh(){}r(Bh,wh);Bh.prototype.a=function(){var a=new XMLHttpRequest;if(\"withCredentials\"in a)return a;if(\"undefined\"!=typeof XDomainRequest)return new Ch;throw Error(\"Unsupported browser\");};Bh.prototype.b=function(){return{}};\nfunction Ch(){this.a=new XDomainRequest;this.readyState=0;this.onreadystatechange=null;this.responseType=this.responseText=this.response=\"\";this.status=-1;this.statusText=\"\";this.a.onload=q(this.pc,this);this.a.onerror=q(this.Rb,this);this.a.onprogress=q(this.qc,this);this.a.ontimeout=q(this.uc,this)}k=Ch.prototype;k.open=function(a,b,c){if(null!=c&&!c)throw Error(\"Only async requests are supported.\");this.a.open(a,b)};\nk.send=function(a){if(a)if(\"string\"==typeof a)this.a.send(a);else throw Error(\"Only string data is supported\");else this.a.send()};k.abort=function(){this.a.abort()};k.setRequestHeader=function(){};k.getResponseHeader=function(a){return\"content-type\"==a.toLowerCase()?this.a.contentType:\"\"};k.pc=function(){this.status=200;this.response=this.responseText=this.a.responseText;Dh(this,4)};k.Rb=function(){this.status=500;this.response=this.responseText=\"\";Dh(this,4)};k.uc=function(){this.Rb()};\nk.qc=function(){this.status=200;Dh(this,1)};function Dh(a,b){a.readyState=b;if(a.onreadystatechange)a.onreadystatechange()}k.getAllResponseHeaders=function(){return\"content-type: \"+this.a.contentType};function Eh(a,b,c){this.reset(a,b,c,void 0,void 0)}Eh.prototype.a=null;var Fh=0;Eh.prototype.reset=function(a,b,c,d,e){\"number\"==typeof e||Fh++;d||ua();delete this.a};function Gh(a){this.f=a;this.b=this.c=this.a=null}function Hh(a,b){this.name=a;this.value=b}Hh.prototype.toString=function(){return this.name};var Ih=new Hh(\"SEVERE\",1E3),Jh=new Hh(\"WARNING\",900),Kh=new Hh(\"CONFIG\",700),Lh=new Hh(\"FINE\",500);function Mh(a){if(a.c)return a.c;if(a.a)return Mh(a.a);Ea(\"Root logger has no level set.\");return null}Gh.prototype.log=function(a,b,c){if(a.value>=Mh(this).value)for(na(b)&&(b=b()),a=new Eh(a,String(b),this.f),c&&(a.a=c),c=this;c;)c=c.a};var Nh={},Oh=null;\nfunction Ph(a){Oh||(Oh=new Gh(\"\"),Nh[\"\"]=Oh,Oh.c=Kh);var b;if(!(b=Nh[a])){b=new Gh(a);var c=a.lastIndexOf(\".\"),d=a.substr(c+1);c=Ph(a.substr(0,c));c.b||(c.b={});c.b[d]=b;b.a=c;Nh[a]=b}return b};function Qh(a,b){a&&a.log(Lh,b,void 0)};function Rh(a){this.f=a}r(Rh,wh);Rh.prototype.a=function(){return new Sh(this.f)};Rh.prototype.b=function(a){return function(){return a}}({});function Sh(a){H.call(this);this.o=a;this.readyState=Th;this.status=0;this.responseType=this.responseText=this.response=this.statusText=\"\";this.onreadystatechange=null;this.i=new Headers;this.b=null;this.m=\"GET\";this.g=\"\";this.a=!1;this.h=Ph(\"goog.net.FetchXmlHttp\");this.l=this.c=this.f=null}r(Sh,H);var Th=0;k=Sh.prototype;\nk.open=function(a,b){if(this.readyState!=Th)throw this.abort(),Error(\"Error reopening a connection\");this.m=a;this.g=b;this.readyState=1;Uh(this)};k.send=function(a){if(1!=this.readyState)throw this.abort(),Error(\"need to call open() first. \");this.a=!0;var b={headers:this.i,method:this.m,credentials:void 0,cache:void 0};a&&(b.body=a);this.o.fetch(new Request(this.g,b)).then(this.tc.bind(this),this.Ta.bind(this))};\nk.abort=function(){this.response=this.responseText=\"\";this.i=new Headers;this.status=0;this.c&&this.c.cancel(\"Request was aborted.\");1<=this.readyState&&this.a&&4!=this.readyState&&(this.a=!1,Vh(this,!1));this.readyState=Th};\nk.tc=function(a){this.a&&(this.f=a,this.b||(this.b=a.headers,this.readyState=2,Uh(this)),this.a&&(this.readyState=3,Uh(this),this.a&&(\"arraybuffer\"===this.responseType?a.arrayBuffer().then(this.rc.bind(this),this.Ta.bind(this)):\"undefined\"!==typeof l.ReadableStream&&\"body\"in a?(this.response=this.responseText=\"\",this.c=a.body.getReader(),this.l=new TextDecoder,Wh(this)):a.text().then(this.sc.bind(this),this.Ta.bind(this)))))};function Wh(a){a.c.read().then(a.oc.bind(a)).catch(a.Ta.bind(a))}\nk.oc=function(a){if(this.a){var b=this.l.decode(a.value?a.value:new Uint8Array(0),{stream:!a.done});b&&(this.response=this.responseText+=b);a.done?Vh(this,!0):Uh(this);3==this.readyState&&Wh(this)}};k.sc=function(a){this.a&&(this.response=this.responseText=a,Vh(this,!0))};k.rc=function(a){this.a&&(this.response=a,Vh(this,!0))};k.Ta=function(a){var b=this.h;b&&b.log(Jh,\"Failed to fetch url \"+this.g,a instanceof Error?a:Error(a));this.a&&Vh(this,!0)};\nfunction Vh(a,b){b&&a.f&&(a.status=a.f.status,a.statusText=a.f.statusText);a.readyState=4;a.f=null;a.c=null;a.l=null;Uh(a)}k.setRequestHeader=function(a,b){this.i.append(a,b)};k.getResponseHeader=function(a){return this.b?this.b.get(a.toLowerCase())||\"\":((a=this.h)&&a.log(Jh,\"Attempting to get response header but no headers have been received for url: \"+this.g,void 0),\"\")};\nk.getAllResponseHeaders=function(){if(!this.b){var a=this.h;a&&a.log(Jh,\"Attempting to get all response headers but no headers have been received for url: \"+this.g,void 0);return\"\"}a=[];for(var b=this.b.entries(),c=b.next();!c.done;)c=c.value,a.push(c[0]+\": \"+c[1]),c=b.next();return a.join(\"\\r\\n\")};function Uh(a){a.onreadystatechange&&a.onreadystatechange.call(a)};function Xh(a){H.call(this);this.headers=new Ed;this.O=a||null;this.c=!1;this.A=this.a=null;this.h=this.P=this.l=\"\";this.f=this.N=this.i=this.G=!1;this.g=0;this.o=null;this.m=Yh;this.u=this.R=!1}r(Xh,H);var Yh=\"\";Xh.prototype.b=Ph(\"goog.net.XhrIo\");var Zh=/^https?$/i,$h=[\"POST\",\"PUT\"];\nfunction ai(a,b,c,d,e){if(a.a)throw Error(\"[goog.net.XhrIo] Object is active with another request=\"+a.l+\"; newUri=\"+b);c=c?c.toUpperCase():\"GET\";a.l=b;a.h=\"\";a.P=c;a.G=!1;a.c=!0;a.a=a.O?a.O.a():yh.a();a.A=a.O?xh(a.O):xh(yh);a.a.onreadystatechange=q(a.Ub,a);try{Qh(a.b,bi(a,\"Opening Xhr\")),a.N=!0,a.a.open(c,String(b),!0),a.N=!1}catch(g){Qh(a.b,bi(a,\"Error opening Xhr: \"+g.message));ci(a,g);return}b=d||\"\";var f=new Ed(a.headers);e&&Dd(e,function(g,h){f.set(h,g)});e=Ra(f.Y());d=l.FormData&&b instanceof\nl.FormData;!Ta($h,c)||e||d||f.set(\"Content-Type\",\"application/x-www-form-urlencoded;charset=utf-8\");f.forEach(function(g,h){this.a.setRequestHeader(h,g)},a);a.m&&(a.a.responseType=a.m);\"withCredentials\"in a.a&&a.a.withCredentials!==a.R&&(a.a.withCredentials=a.R);try{di(a),0<a.g&&(a.u=ei(a.a),Qh(a.b,bi(a,\"Will abort after \"+a.g+\"ms if incomplete, xhr2 \"+a.u)),a.u?(a.a.timeout=a.g,a.a.ontimeout=q(a.Ma,a)):a.o=zd(a.Ma,a.g,a)),Qh(a.b,bi(a,\"Sending request\")),a.i=!0,a.a.send(b),a.i=!1}catch(g){Qh(a.b,\nbi(a,\"Send error: \"+g.message)),ci(a,g)}}function ei(a){return Tb&&cc(9)&&\"number\"===typeof a.timeout&&void 0!==a.ontimeout}function Sa(a){return\"content-type\"==a.toLowerCase()}k=Xh.prototype;k.Ma=function(){\"undefined\"!=typeof ha&&this.a&&(this.h=\"Timed out after \"+this.g+\"ms, aborting\",Qh(this.b,bi(this,this.h)),this.dispatchEvent(\"timeout\"),this.abort(8))};function ci(a,b){a.c=!1;a.a&&(a.f=!0,a.a.abort(),a.f=!1);a.h=b;fi(a);gi(a)}\nfunction fi(a){a.G||(a.G=!0,a.dispatchEvent(\"complete\"),a.dispatchEvent(\"error\"))}k.abort=function(){this.a&&this.c&&(Qh(this.b,bi(this,\"Aborting\")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent(\"complete\"),this.dispatchEvent(\"abort\"),gi(this))};k.Da=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),gi(this,!0));Xh.$a.Da.call(this)};k.Ub=function(){this.xa||(this.N||this.i||this.f?hi(this):this.Ic())};k.Ic=function(){hi(this)};\nfunction hi(a){if(a.c&&\"undefined\"!=typeof ha)if(a.A[1]&&4==ii(a)&&2==ji(a))Qh(a.b,bi(a,\"Local request error detected and ignored\"));else if(a.i&&4==ii(a))zd(a.Ub,0,a);else if(a.dispatchEvent(\"readystatechange\"),4==ii(a)){Qh(a.b,bi(a,\"Request complete\"));a.c=!1;try{var b=ji(a);a:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var c=!0;break a;default:c=!1}var d;if(!(d=c)){var e;if(e=0===b){var f=String(a.l).match(Hd)[1]||null;if(!f&&l.self&&l.self.location){var g=l.self.location.protocol;\nf=g.substr(0,g.length-1)}e=!Zh.test(f?f.toLowerCase():\"\")}d=e}if(d)a.dispatchEvent(\"complete\"),a.dispatchEvent(\"success\");else{try{var h=2<ii(a)?a.a.statusText:\"\"}catch(m){Qh(a.b,\"Can not get status: \"+m.message),h=\"\"}a.h=h+\" [\"+ji(a)+\"]\";fi(a)}}finally{gi(a)}}}function gi(a,b){if(a.a){di(a);var c=a.a,d=a.A[0]?ka:null;a.a=null;a.A=null;b||a.dispatchEvent(\"ready\");try{c.onreadystatechange=d}catch(e){(a=a.b)&&a.log(Ih,\"Problem encountered resetting onreadystatechange: \"+e.message,void 0)}}}\nfunction di(a){a.a&&a.u&&(a.a.ontimeout=null);a.o&&(l.clearTimeout(a.o),a.o=null)}function ii(a){return a.a?a.a.readyState:0}function ji(a){try{return 2<ii(a)?a.a.status:-1}catch(b){return-1}}function ki(a){try{return a.a?a.a.responseText:\"\"}catch(b){return Qh(a.b,\"Can not get responseText: \"+b.message),\"\"}}\nk.getResponse=function(){try{if(!this.a)return null;if(\"response\"in this.a)return this.a.response;switch(this.m){case Yh:case \"text\":return this.a.responseText;case \"arraybuffer\":if(\"mozResponseArrayBuffer\"in this.a)return this.a.mozResponseArrayBuffer}var a=this.b;a&&a.log(Ih,\"Response type \"+this.m+\" is not supported on this browser\",void 0);return null}catch(b){return Qh(this.b,\"Can not get response: \"+b.message),null}};function bi(a,b){return b+\" [\"+a.P+\" \"+a.l+\" \"+ji(a)+\"]\"};/*\n Portions of this code are from MochiKit, received by\n The Closure Authors under the MIT license. All other code is Copyright\n 2005-2009 The Closure Authors. All Rights Reserved.\n*/\nfunction li(a){var b=mi;this.g=[];this.u=b;this.o=a||null;this.f=this.a=!1;this.c=void 0;this.m=this.A=this.i=!1;this.h=0;this.b=null;this.l=0}li.prototype.cancel=function(a){if(this.a)this.c instanceof li&&this.c.cancel();else{if(this.b){var b=this.b;delete this.b;a?b.cancel(a):(b.l--,0>=b.l&&b.cancel())}this.u?this.u.call(this.o,this):this.m=!0;this.a||(a=new ni(this),oi(this),pi(this,!1,a))}};li.prototype.v=function(a,b){this.i=!1;pi(this,a,b)};function pi(a,b,c){a.a=!0;a.c=c;a.f=!b;qi(a)}\nfunction oi(a){if(a.a){if(!a.m)throw new ri(a);a.m=!1}}function si(a,b){ti(a,null,b,void 0)}function ti(a,b,c,d){a.g.push([b,c,d]);a.a&&qi(a)}li.prototype.then=function(a,b,c){var d,e,f=new C(function(g,h){d=g;e=h});ti(this,d,function(g){g instanceof ni?f.cancel():e(g)});return f.then(a,b,c)};li.prototype.$goog_Thenable=!0;function ui(a){return Qa(a.g,function(b){return na(b[1])})}\nfunction qi(a){if(a.h&&a.a&&ui(a)){var b=a.h,c=vi[b];c&&(l.clearTimeout(c.a),delete vi[b]);a.h=0}a.b&&(a.b.l--,delete a.b);b=a.c;for(var d=c=!1;a.g.length&&!a.i;){var e=a.g.shift(),f=e[0],g=e[1];e=e[2];if(f=a.f?g:f)try{var h=f.call(e||a.o,b);void 0!==h&&(a.f=a.f&&(h==b||h instanceof Error),a.c=b=h);if(Ca(b)||\"function\"===typeof l.Promise&&b instanceof l.Promise)d=!0,a.i=!0}catch(m){b=m,a.f=!0,ui(a)||(c=!0)}}a.c=b;d&&(h=q(a.v,a,!0),d=q(a.v,a,!1),b instanceof li?(ti(b,h,d),b.A=!0):b.then(h,d));c&&(b=\nnew wi(b),vi[b.a]=b,a.h=b.a)}function ri(){u.call(this)}r(ri,u);ri.prototype.message=\"Deferred has already fired\";ri.prototype.name=\"AlreadyCalledError\";function ni(){u.call(this)}r(ni,u);ni.prototype.message=\"Deferred was canceled\";ni.prototype.name=\"CanceledError\";function wi(a){this.a=l.setTimeout(q(this.c,this),0);this.b=a}wi.prototype.c=function(){delete vi[this.a];throw this.b;};var vi={};function xi(a){var b={},c=b.document||document,d=wb(a).toString(),e=jc(document,\"SCRIPT\"),f={Vb:e,Ma:void 0},g=new li(f),h=null,m=null!=b.timeout?b.timeout:5E3;0<m&&(h=window.setTimeout(function(){yi(e,!0);var p=new zi(Ai,\"Timeout reached for loading script \"+d);oi(g);pi(g,!1,p)},m),f.Ma=h);e.onload=e.onreadystatechange=function(){e.readyState&&\"loaded\"!=e.readyState&&\"complete\"!=e.readyState||(yi(e,b.wd||!1,h),oi(g),pi(g,!0,null))};e.onerror=function(){yi(e,!0,h);var p=new zi(Bi,\"Error while loading script \"+\nd);oi(g);pi(g,!1,p)};f=b.attributes||{};z(f,{type:\"text/javascript\",charset:\"UTF-8\"});gc(e,f);Mb(e,a);Ci(c).appendChild(e);return g}function Ci(a){var b;return(b=(a||document).getElementsByTagName(\"HEAD\"))&&0!=b.length?b[0]:a.documentElement}function mi(){if(this&&this.Vb){var a=this.Vb;a&&\"SCRIPT\"==a.tagName&&yi(a,!0,this.Ma)}}\nfunction yi(a,b,c){null!=c&&l.clearTimeout(c);a.onload=ka;a.onerror=ka;a.onreadystatechange=ka;b&&window.setTimeout(function(){a&&a.parentNode&&a.parentNode.removeChild(a)},0)}var Bi=0,Ai=1;function zi(a,b){var c=\"Jsloader error (code #\"+a+\")\";b&&(c+=\": \"+b);u.call(this,c);this.code=a}r(zi,u);function Di(a){this.f=a}r(Di,wh);Di.prototype.a=function(){return new this.f};Di.prototype.b=function(){return{}};\nfunction Ei(a,b,c){this.c=a;a=b||{};this.l=a.secureTokenEndpoint||\"https://securetoken.googleapis.com/v1/token\";this.v=a.secureTokenTimeout||Fi;this.g=lb(a.secureTokenHeaders||Gi);this.h=a.firebaseEndpoint||\"https://www.googleapis.com/identitytoolkit/v3/relyingparty/\";this.i=a.identityPlatformEndpoint||\"https://identitytoolkit.googleapis.com/v2/\";this.m=a.firebaseTimeout||Hi;this.a=lb(a.firebaseHeaders||Ii);c&&(this.a[\"X-Client-Version\"]=c,this.g[\"X-Client-Version\"]=c);c=\"Node\"==Fe();c=l.XMLHttpRequest||\nc&&firebase.INTERNAL.node&&firebase.INTERNAL.node.XMLHttpRequest;if(!c&&!Ee())throw new t(\"internal-error\",\"The XMLHttpRequest compatibility library was not found.\");this.f=void 0;Ee()?this.f=new Rh(self):Ge()?this.f=new Di(c):this.f=new Bh;this.b=null}var Ji,zg=\"idToken\",Fi=new Ue(3E4,6E4),Gi={\"Content-Type\":\"application/x-www-form-urlencoded\"},Hi=new Ue(3E4,6E4),Ii={\"Content-Type\":\"application/json\"};function Ki(a,b){b?a.a[\"X-Firebase-Locale\"]=b:delete a.a[\"X-Firebase-Locale\"]}\nfunction Li(a,b){b&&(a.l=Mi(\"https://securetoken.googleapis.com/v1/token\",b),a.h=Mi(\"https://www.googleapis.com/identitytoolkit/v3/relyingparty/\",b),a.i=Mi(\"https://identitytoolkit.googleapis.com/v2/\",b))}function Mi(a,b){a=J(a);b=J(b.url);a.c=a.a+a.c;Kd(a,b.f);a.a=b.a;Ld(a,b.g);return a.toString()}function Ni(a,b){b?(a.a[\"X-Client-Version\"]=b,a.g[\"X-Client-Version\"]=b):(delete a.a[\"X-Client-Version\"],delete a.g[\"X-Client-Version\"])}Ei.prototype.S=function(){return this.b};\nfunction Oi(a,b,c,d,e,f,g){pe()||Ee()?a=q(a.u,a):(Ji||(Ji=new C(function(h,m){Pi(h,m)})),a=q(a.o,a));a(b,c,d,e,f,g)}\nEi.prototype.u=function(a,b,c,d,e,f){if(Ee()&&(\"undefined\"===typeof l.fetch||\"undefined\"===typeof l.Headers||\"undefined\"===typeof l.Request))throw new t(\"operation-not-supported-in-this-environment\",\"fetch, Headers and Request native APIs or equivalent Polyfills must be available to support HTTP requests from a Worker environment.\");var g=new Xh(this.f);if(f){g.g=Math.max(0,f);var h=setTimeout(function(){g.dispatchEvent(\"timeout\")},f)}md(g,\"complete\",function(){h&&clearTimeout(h);var m=null;try{m=\nJSON.parse(ki(this))||null}catch(p){m=null}b&&b(m)});sd(g,\"ready\",function(){h&&clearTimeout(h);Tc(this)});sd(g,\"timeout\",function(){h&&clearTimeout(h);Tc(this);b&&b(null)});ai(g,a,c,d,e)};var Qi=new ob(pb,\"https://apis.google.com/js/client.js?onload=%{onload}\"),Ri=\"__fcb\"+Math.floor(1E6*Math.random()).toString();\nfunction Pi(a,b){if(((window.gapi||{}).client||{}).request)a();else{l[Ri]=function(){((window.gapi||{}).client||{}).request?a():b(Error(\"CORS_UNSUPPORTED\"))};var c=xb(Qi,{onload:Ri});si(xi(c),function(){b(Error(\"CORS_UNSUPPORTED\"))})}}\nEi.prototype.o=function(a,b,c,d,e){var f=this;Ji.then(function(){window.gapi.client.setApiKey(f.c);var g=window.gapi.auth.getToken();window.gapi.auth.setToken(null);window.gapi.client.request({path:a,method:c,body:d,headers:e,authType:\"none\",callback:function(h){window.gapi.auth.setToken(g);b&&b(h)}})}).s(function(g){b&&b({error:{message:g&&g.message||\"CORS_UNSUPPORTED\"}})})};\nfunction Si(a,b){return new C(function(c,d){\"refresh_token\"==b.grant_type&&b.refresh_token||\"authorization_code\"==b.grant_type&&b.code?Oi(a,a.l+\"?key=\"+encodeURIComponent(a.c),function(e){e?e.error?d(Ti(e)):e.access_token&&e.refresh_token?c(e):d(new t(\"internal-error\")):d(new t(\"network-request-failed\"))},\"POST\",ae(b).toString(),a.g,a.v.get()):d(new t(\"internal-error\"))})}\nfunction Ui(a,b,c,d,e,f,g){var h=J(b+c);I(h,\"key\",a.c);g&&I(h,\"cb\",ua().toString());var m=\"GET\"==d;if(m)for(var p in e)e.hasOwnProperty(p)&&I(h,p,e[p]);return new C(function(v,B){Oi(a,h.toString(),function(A){A?A.error?B(Ti(A,f||{})):v(A):B(new t(\"network-request-failed\"))},d,m?void 0:fe(Qe(e)),a.a,a.m.get())})}function Vi(a){a=a.email;if(\"string\"!==typeof a||!ye.test(a))throw new t(\"invalid-email\");}function Wi(a){\"email\"in a&&Vi(a)}\nfunction Xi(a,b){return O(a,Yi,{identifier:b,continueUri:Ne()?me():\"http://localhost\"}).then(function(c){return c.signinMethods||[]})}function Zi(a){return O(a,$i,{}).then(function(b){return b.authorizedDomains||[]})}function P(a){if(!a[zg]){if(a.mfaPendingCredential)throw new t(\"multi-factor-auth-required\",null,lb(a));throw new t(\"internal-error\");}}\nfunction aj(a){if(a.phoneNumber||a.temporaryProof){if(!a.phoneNumber||!a.temporaryProof)throw new t(\"internal-error\");}else{if(!a.sessionInfo)throw new t(\"missing-verification-id\");if(!a.code)throw new t(\"missing-verification-code\");}}Ei.prototype.yb=function(){return O(this,bj,{})};Ei.prototype.Ab=function(a,b){return O(this,cj,{idToken:a,email:b})};Ei.prototype.Bb=function(a,b){return O(this,Zg,{idToken:a,password:b})};var dj={displayName:\"DISPLAY_NAME\",photoUrl:\"PHOTO_URL\"};k=Ei.prototype;\nk.Cb=function(a,b){var c={idToken:a},d=[];jb(dj,function(e,f){var g=b[f];null===g?d.push(e):f in b&&(c[f]=g)});d.length&&(c.deleteAttribute=d);return O(this,cj,c)};k.ub=function(a,b){a={requestType:\"PASSWORD_RESET\",email:a};z(a,b);return O(this,ej,a)};k.vb=function(a,b){a={requestType:\"EMAIL_SIGNIN\",email:a};z(a,b);return O(this,fj,a)};k.tb=function(a,b){a={requestType:\"VERIFY_EMAIL\",idToken:a};z(a,b);return O(this,gj,a)};\nk.Db=function(a,b,c){a={requestType:\"VERIFY_AND_CHANGE_EMAIL\",idToken:a,newEmail:b};z(a,c);return O(this,hj,a)};function kh(a,b){return O(a,ij,b)}k.eb=function(a){return O(this,jj,a)};function ih(a,b){return O(a,kj,b).then(function(c){return c.phoneSessionInfo.sessionInfo})}\nfunction lj(a){if(!a.phoneVerificationInfo)throw new t(\"internal-error\");if(!a.phoneVerificationInfo.sessionInfo)throw new t(\"missing-verification-id\");if(!a.phoneVerificationInfo.code)throw new t(\"missing-verification-code\");}function jh(a,b){return O(a,mj,b).then(function(c){return c.phoneResponseInfo.sessionInfo})}function nj(a,b,c){return O(a,oj,{idToken:b,deleteProvider:c})}function pj(a){if(!a.requestUri||!a.sessionId&&!a.postBody&&!a.pendingToken)throw new t(\"internal-error\");}\nfunction qj(a,b){b.oauthIdToken&&b.providerId&&0==b.providerId.indexOf(\"oidc.\")&&!b.pendingToken&&(a.sessionId?b.nonce=a.sessionId:a.postBody&&(a=new Pd(a.postBody),ee(a,\"nonce\")&&(b.nonce=a.get(\"nonce\"))));return b}\nfunction rj(a){var b=null;a.needConfirmation?(a.code=\"account-exists-with-different-credential\",b=vh(a)):\"FEDERATED_USER_ID_ALREADY_LINKED\"==a.errorMessage?(a.code=\"credential-already-in-use\",b=vh(a)):\"EMAIL_EXISTS\"==a.errorMessage?(a.code=\"email-already-in-use\",b=vh(a)):a.errorMessage&&(b=sj(a.errorMessage));if(b)throw b;P(a)}function Bg(a,b){b.returnIdpCredential=!0;return O(a,tj,b)}function Dg(a,b){b.returnIdpCredential=!0;return O(a,uj,b)}\nfunction Eg(a,b){b.returnIdpCredential=!0;b.autoCreate=!1;return O(a,vj,b)}function wj(a){if(!a.oobCode)throw new t(\"invalid-action-code\");}k.mb=function(a,b){return O(this,xj,{oobCode:a,newPassword:b})};k.Qa=function(a){return O(this,yj,{oobCode:a})};k.ib=function(a){return O(this,zj,{oobCode:a})};\nvar zj={endpoint:\"setAccountInfo\",B:wj,Z:\"email\",C:!0},yj={endpoint:\"resetPassword\",B:wj,F:function(a){var b=a.requestType;if(!b||!a.email&&\"EMAIL_SIGNIN\"!=b&&\"VERIFY_AND_CHANGE_EMAIL\"!=b)throw new t(\"internal-error\");},C:!0},Aj={endpoint:\"signupNewUser\",B:function(a){Vi(a);if(!a.password)throw new t(\"weak-password\");},F:P,U:!0,C:!0},Yi={endpoint:\"createAuthUri\",C:!0},Bj={endpoint:\"deleteAccount\",M:[\"idToken\"]},oj={endpoint:\"setAccountInfo\",M:[\"idToken\",\"deleteProvider\"],B:function(a){if(\"array\"!=\nla(a.deleteProvider))throw new t(\"internal-error\");}},Wg={endpoint:\"emailLinkSignin\",M:[\"email\",\"oobCode\"],B:Vi,F:P,U:!0,C:!0},Yg={endpoint:\"emailLinkSignin\",M:[\"idToken\",\"email\",\"oobCode\"],B:Vi,F:P,U:!0},Cj={endpoint:\"accounts/mfaEnrollment:finalize\",M:[\"idToken\",\"phoneVerificationInfo\"],B:lj,F:P,C:!0,Na:!0},Dj={endpoint:\"accounts/mfaSignIn:finalize\",M:[\"mfaPendingCredential\",\"phoneVerificationInfo\"],B:lj,F:P,C:!0,Na:!0},Ej={endpoint:\"getAccountInfo\"},fj={endpoint:\"getOobConfirmationCode\",M:[\"requestType\"],\nB:function(a){if(\"EMAIL_SIGNIN\"!=a.requestType)throw new t(\"internal-error\");Vi(a)},Z:\"email\",C:!0},gj={endpoint:\"getOobConfirmationCode\",M:[\"idToken\",\"requestType\"],B:function(a){if(\"VERIFY_EMAIL\"!=a.requestType)throw new t(\"internal-error\");},Z:\"email\",C:!0},hj={endpoint:\"getOobConfirmationCode\",M:[\"idToken\",\"newEmail\",\"requestType\"],B:function(a){if(\"VERIFY_AND_CHANGE_EMAIL\"!=a.requestType)throw new t(\"internal-error\");},Z:\"email\",C:!0},ej={endpoint:\"getOobConfirmationCode\",M:[\"requestType\"],B:function(a){if(\"PASSWORD_RESET\"!=\na.requestType)throw new t(\"internal-error\");Vi(a)},Z:\"email\",C:!0},$i={kb:!0,endpoint:\"getProjectConfig\",Tb:\"GET\"},Fj={kb:!0,endpoint:\"getRecaptchaParam\",Tb:\"GET\",F:function(a){if(!a.recaptchaSiteKey)throw new t(\"internal-error\");}},xj={endpoint:\"resetPassword\",B:wj,Z:\"email\",C:!0},ij={endpoint:\"sendVerificationCode\",M:[\"phoneNumber\",\"recaptchaToken\"],Z:\"sessionInfo\",C:!0},cj={endpoint:\"setAccountInfo\",M:[\"idToken\"],B:Wi,U:!0},Zg={endpoint:\"setAccountInfo\",M:[\"idToken\"],B:function(a){Wi(a);if(!a.password)throw new t(\"weak-password\");\n},F:P,U:!0},bj={endpoint:\"signupNewUser\",F:P,U:!0,C:!0},kj={endpoint:\"accounts/mfaEnrollment:start\",M:[\"idToken\",\"phoneEnrollmentInfo\"],B:function(a){if(!a.phoneEnrollmentInfo)throw new t(\"internal-error\");if(!a.phoneEnrollmentInfo.phoneNumber)throw new t(\"missing-phone-number\");if(!a.phoneEnrollmentInfo.recaptchaToken)throw new t(\"missing-app-credential\");},F:function(a){if(!a.phoneSessionInfo||!a.phoneSessionInfo.sessionInfo)throw new t(\"internal-error\");},C:!0,Na:!0},mj={endpoint:\"accounts/mfaSignIn:start\",\nM:[\"mfaPendingCredential\",\"mfaEnrollmentId\",\"phoneSignInInfo\"],B:function(a){if(!a.phoneSignInInfo||!a.phoneSignInInfo.recaptchaToken)throw new t(\"missing-app-credential\");},F:function(a){if(!a.phoneResponseInfo||!a.phoneResponseInfo.sessionInfo)throw new t(\"internal-error\");},C:!0,Na:!0},tj={endpoint:\"verifyAssertion\",B:pj,Xa:qj,F:rj,U:!0,C:!0},vj={endpoint:\"verifyAssertion\",B:pj,Xa:qj,F:function(a){if(a.errorMessage&&\"USER_NOT_FOUND\"==a.errorMessage)throw new t(\"user-not-found\");if(a.errorMessage)throw sj(a.errorMessage);\nP(a)},U:!0,C:!0},uj={endpoint:\"verifyAssertion\",B:function(a){pj(a);if(!a.idToken)throw new t(\"internal-error\");},Xa:qj,F:rj,U:!0},Gj={endpoint:\"verifyCustomToken\",B:function(a){if(!a.token)throw new t(\"invalid-custom-token\");},F:P,U:!0,C:!0},Xg={endpoint:\"verifyPassword\",B:function(a){Vi(a);if(!a.password)throw new t(\"wrong-password\");},F:P,U:!0,C:!0},jj={endpoint:\"verifyPhoneNumber\",B:aj,F:P,C:!0},eh={endpoint:\"verifyPhoneNumber\",B:function(a){if(!a.idToken)throw new t(\"internal-error\");aj(a)},\nF:function(a){if(a.temporaryProof)throw a.code=\"credential-already-in-use\",vh(a);P(a)}},fh={Gb:{USER_NOT_FOUND:\"user-not-found\"},endpoint:\"verifyPhoneNumber\",B:aj,F:P,C:!0},Hj={endpoint:\"accounts/mfaEnrollment:withdraw\",M:[\"idToken\",\"mfaEnrollmentId\"],F:function(a){if(!!a[zg]^!!a.refreshToken)throw new t(\"internal-error\");},C:!0,Na:!0};\nfunction O(a,b,c){if(!hf(c,b.M))return E(new t(\"internal-error\"));var d=!!b.Na,e=b.Tb||\"POST\",f;return D(c).then(b.B).then(function(){b.U&&(c.returnSecureToken=!0);b.C&&a.b&&\"undefined\"===typeof c.tenantId&&(c.tenantId=a.b);return d?Ui(a,a.i,b.endpoint,e,c,b.Gb,b.kb||!1):Ui(a,a.h,b.endpoint,e,c,b.Gb,b.kb||!1)}).then(function(g){f=g;return b.Xa?b.Xa(c,f):f}).then(b.F).then(function(){if(!b.Z)return f;if(!(b.Z in f))throw new t(\"internal-error\");return f[b.Z]})}\nfunction sj(a){return Ti({error:{errors:[{message:a}],code:400,message:a}})}\nfunction Ti(a,b){var c=(a.error&&a.error.errors&&a.error.errors[0]||{}).reason||\"\";var d={keyInvalid:\"invalid-api-key\",ipRefererBlocked:\"app-not-authorized\"};if(c=d[c]?new t(d[c]):null)return c;c=a.error&&a.error.message||\"\";d={INVALID_CUSTOM_TOKEN:\"invalid-custom-token\",CREDENTIAL_MISMATCH:\"custom-token-mismatch\",MISSING_CUSTOM_TOKEN:\"internal-error\",INVALID_IDENTIFIER:\"invalid-email\",MISSING_CONTINUE_URI:\"internal-error\",INVALID_EMAIL:\"invalid-email\",INVALID_PASSWORD:\"wrong-password\",USER_DISABLED:\"user-disabled\",\nMISSING_PASSWORD:\"internal-error\",EMAIL_EXISTS:\"email-already-in-use\",PASSWORD_LOGIN_DISABLED:\"operation-not-allowed\",INVALID_IDP_RESPONSE:\"invalid-credential\",INVALID_PENDING_TOKEN:\"invalid-credential\",FEDERATED_USER_ID_ALREADY_LINKED:\"credential-already-in-use\",MISSING_OR_INVALID_NONCE:\"missing-or-invalid-nonce\",INVALID_MESSAGE_PAYLOAD:\"invalid-message-payload\",INVALID_RECIPIENT_EMAIL:\"invalid-recipient-email\",INVALID_SENDER:\"invalid-sender\",EMAIL_NOT_FOUND:\"user-not-found\",RESET_PASSWORD_EXCEED_LIMIT:\"too-many-requests\",\nEXPIRED_OOB_CODE:\"expired-action-code\",INVALID_OOB_CODE:\"invalid-action-code\",MISSING_OOB_CODE:\"internal-error\",INVALID_PROVIDER_ID:\"invalid-provider-id\",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:\"requires-recent-login\",INVALID_ID_TOKEN:\"invalid-user-token\",TOKEN_EXPIRED:\"user-token-expired\",USER_NOT_FOUND:\"user-token-expired\",CORS_UNSUPPORTED:\"cors-unsupported\",DYNAMIC_LINK_NOT_ACTIVATED:\"dynamic-link-not-activated\",INVALID_APP_ID:\"invalid-app-id\",TOO_MANY_ATTEMPTS_TRY_LATER:\"too-many-requests\",WEAK_PASSWORD:\"weak-password\",\nOPERATION_NOT_ALLOWED:\"operation-not-allowed\",USER_CANCELLED:\"user-cancelled\",CAPTCHA_CHECK_FAILED:\"captcha-check-failed\",INVALID_APP_CREDENTIAL:\"invalid-app-credential\",INVALID_CODE:\"invalid-verification-code\",INVALID_PHONE_NUMBER:\"invalid-phone-number\",INVALID_SESSION_INFO:\"invalid-verification-id\",INVALID_TEMPORARY_PROOF:\"invalid-credential\",MISSING_APP_CREDENTIAL:\"missing-app-credential\",MISSING_CODE:\"missing-verification-code\",MISSING_PHONE_NUMBER:\"missing-phone-number\",MISSING_SESSION_INFO:\"missing-verification-id\",\nQUOTA_EXCEEDED:\"quota-exceeded\",SESSION_EXPIRED:\"code-expired\",REJECTED_CREDENTIAL:\"rejected-credential\",INVALID_CONTINUE_URI:\"invalid-continue-uri\",MISSING_ANDROID_PACKAGE_NAME:\"missing-android-pkg-name\",MISSING_IOS_BUNDLE_ID:\"missing-ios-bundle-id\",UNAUTHORIZED_DOMAIN:\"unauthorized-continue-uri\",INVALID_DYNAMIC_LINK_DOMAIN:\"invalid-dynamic-link-domain\",INVALID_OAUTH_CLIENT_ID:\"invalid-oauth-client-id\",INVALID_CERT_HASH:\"invalid-cert-hash\",UNSUPPORTED_TENANT_OPERATION:\"unsupported-tenant-operation\",\nINVALID_TENANT_ID:\"invalid-tenant-id\",TENANT_ID_MISMATCH:\"tenant-id-mismatch\",ADMIN_ONLY_OPERATION:\"admin-restricted-operation\",INVALID_MFA_PENDING_CREDENTIAL:\"invalid-multi-factor-session\",MFA_ENROLLMENT_NOT_FOUND:\"multi-factor-info-not-found\",MISSING_MFA_PENDING_CREDENTIAL:\"missing-multi-factor-session\",MISSING_MFA_ENROLLMENT_ID:\"missing-multi-factor-info\",EMAIL_CHANGE_NEEDS_VERIFICATION:\"email-change-needs-verification\",SECOND_FACTOR_EXISTS:\"second-factor-already-in-use\",SECOND_FACTOR_LIMIT_EXCEEDED:\"maximum-second-factor-count-exceeded\",\nUNSUPPORTED_FIRST_FACTOR:\"unsupported-first-factor\",UNVERIFIED_EMAIL:\"unverified-email\"};z(d,b||{});b=(b=c.match(/^[^\\s]+\\s*:\\s*([\\s\\S]*)$/))&&1<b.length?b[1]:void 0;for(var e in d)if(0===c.indexOf(e))return new t(d[e],b);!b&&a&&(b=Pe(a));return new t(\"internal-error\",b)};function Ij(a){this.b=a;this.a=null;this.qb=Jj(this)}\nfunction Jj(a){return Kj().then(function(){return new C(function(b,c){L(\"gapi.iframes.getContext\")().open({where:document.body,url:a.b,messageHandlersFilter:L(\"gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER\"),attributes:{style:{position:\"absolute\",top:\"-100px\",width:\"1px\",height:\"1px\"}},dontclear:!0},function(d){function e(){clearTimeout(f);b()}a.a=d;a.a.restyle({setHideOnLeave:!1});var f=setTimeout(function(){c(Error(\"Network Error\"))},Lj.get());d.ping(e).then(e,function(){c(Error(\"Network Error\"))})})})})}\nfunction Mj(a,b){return a.qb.then(function(){return new C(function(c){a.a.send(b.type,b,c,L(\"gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER\"))})})}function Nj(a,b){a.qb.then(function(){a.a.register(\"authEvent\",b,L(\"gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER\"))})}var Oj=new ob(pb,\"https://apis.google.com/js/api.js?onload=%{onload}\"),Pj=new Ue(3E4,6E4),Lj=new Ue(5E3,15E3),Qj=null;\nfunction Kj(){return Qj?Qj:Qj=(new C(function(a,b){function c(){Te();L(\"gapi.load\")(\"gapi.iframes\",{callback:a,ontimeout:function(){Te();b(Error(\"Network Error\"))},timeout:Pj.get()})}if(L(\"gapi.iframes.Iframe\"))a();else if(L(\"gapi.load\"))c();else{var d=\"__iframefcb\"+Math.floor(1E6*Math.random()).toString();l[d]=function(){L(\"gapi.load\")?c():b(Error(\"Network Error\"))};d=xb(Oj,{onload:d});D(xi(d)).s(function(){b(Error(\"Network Error\"))})}})).s(function(a){Qj=null;throw a;})};function Rj(a,b,c,d){this.l=a;this.h=b;this.i=c;this.g=d;this.f=null;this.g?(a=J(this.g.url),a=Yd(a.f,a.a,a.g,\"/emulator/auth/iframe\")):a=Yd(\"https\",this.l,null,\"/__/auth/iframe\");this.a=a;I(this.a,\"apiKey\",this.h);I(this.a,\"appName\",this.i);this.b=null;this.c=[]}Rj.prototype.toString=function(){this.f?I(this.a,\"v\",this.f):de(this.a.b,\"v\");this.b?I(this.a,\"eid\",this.b):de(this.a.b,\"eid\");this.c.length?I(this.a,\"fw\",this.c.join(\",\")):de(this.a.b,\"fw\");return this.a.toString()};\nfunction Sj(a,b,c,d,e,f){this.u=a;this.o=b;this.c=c;this.v=d;this.m=f;this.i=this.g=this.l=null;this.a=e;this.h=this.f=null}Sj.prototype.xb=function(a){this.h=a;return this};\nSj.prototype.toString=function(){if(this.m){var a=J(this.m.url);a=Yd(a.f,a.a,a.g,\"/emulator/auth/handler\")}else a=Yd(\"https\",this.u,null,\"/__/auth/handler\");I(a,\"apiKey\",this.o);I(a,\"appName\",this.c);I(a,\"authType\",this.v);if(this.a.isOAuthProvider){var b=this.a;try{var c=firebase.app(this.c).auth().ka()}catch(h){c=null}b.nb=c;I(a,\"providerId\",this.a.providerId);c=this.a;b=Qe(c.Hb);for(var d in b)b[d]=b[d].toString();d=c.Pc;b=lb(b);for(var e=0;e<d.length;e++){var f=d[e];f in b&&delete b[f]}c.ob&&\nc.nb&&!b[c.ob]&&(b[c.ob]=c.nb);kb(b)||I(a,\"customParameters\",Pe(b))}\"function\"===typeof this.a.Pb&&(c=this.a.Pb(),c.length&&I(a,\"scopes\",c.join(\",\")));this.l?I(a,\"redirectUrl\",this.l):de(a.b,\"redirectUrl\");this.g?I(a,\"eventId\",this.g):de(a.b,\"eventId\");this.i?I(a,\"v\",this.i):de(a.b,\"v\");if(this.b)for(var g in this.b)this.b.hasOwnProperty(g)&&!Xd(a,g)&&I(a,g,this.b[g]);this.h?I(a,\"tid\",this.h):de(a.b,\"tid\");this.f?I(a,\"eid\",this.f):de(a.b,\"eid\");g=Tj(this.c);g.length&&I(a,\"fw\",g.join(\",\"));return a.toString()};\nfunction Tj(a){try{return firebase.app(a).auth().Ga()}catch(b){return[]}}function Uj(a,b,c,d,e,f){this.o=a;this.g=b;this.b=c;this.f=f;this.c=d||null;this.i=e||null;this.l=this.u=this.A=null;this.h=[];this.v=this.a=null}\nfunction Vj(a){var b=me();return Zi(a).then(function(c){a:{var d=J(b),e=d.f;d=d.a;for(var f=0;f<c.length;f++){var g=c[f];var h=d;var m=e;0==g.indexOf(\"chrome-extension://\")?h=J(g).a==h&&\"chrome-extension\"==m:\"http\"!=m&&\"https\"!=m?h=!1:xe.test(g)?h=h==g:(g=g.split(\".\").join(\"\\\\.\"),h=(new RegExp(\"^(.+\\\\.\"+g+\"|\"+g+\")$\",\"i\")).test(h));if(h){c=!0;break a}}c=!1}if(!c)throw new th(me());})}\nfunction Wj(a){if(a.v)return a.v;a.v=ze().then(function(){if(!a.u){var b=a.c,c=a.i,d=Tj(a.b),e=new Rj(a.o,a.g,a.b,a.f);e.f=b;e.b=c;e.c=Xa(d||[]);a.u=e.toString()}a.m=new Ij(a.u);Xj(a)});return a.v}k=Uj.prototype;k.Nb=function(a,b,c){var d=new t(\"popup-closed-by-user\"),e=new t(\"web-storage-unsupported\"),f=this,g=!1;return this.la().then(function(){Yj(f).then(function(h){h||(a&&te(a),b(e),g=!0)})}).s(function(){}).then(function(){if(!g)return we(a)}).then(function(){if(!g)return Ad(c).then(function(){b(d)})})};\nk.Wb=function(){var a=K();return!Oe(a)&&!Se(a)};k.Sb=function(){return!1};\nk.Lb=function(a,b,c,d,e,f,g,h){if(!a)return E(new t(\"popup-blocked\"));if(g&&!Oe())return this.la().s(function(p){te(a);e(p)}),d(),D();this.a||(this.a=Vj(Zj(this)));var m=this;return this.a.then(function(){var p=m.la().s(function(v){te(a);e(v);throw v;});d();return p}).then(function(){nh(c);if(!g){var p=ak(m.o,m.g,m.b,b,c,null,f,m.c,void 0,m.i,h,m.f);ne(p,a)}}).s(function(p){\"auth/network-request-failed\"==p.code&&(m.a=null);throw p;})};\nfunction Zj(a){a.l||(a.A=a.c?Je(a.c,Tj(a.b)):null,a.l=new Ei(a.g,Aa(a.i),a.A),a.f&&Li(a.l,a.f));return a.l}k.Mb=function(a,b,c,d){this.a||(this.a=Vj(Zj(this)));var e=this;return this.a.then(function(){nh(b);var f=ak(e.o,e.g,e.b,a,b,me(),c,e.c,void 0,e.i,d,e.f);ne(f)}).s(function(f){\"auth/network-request-failed\"==f.code&&(e.a=null);throw f;})};k.la=function(){var a=this;return Wj(this).then(function(){return a.m.qb}).s(function(){a.a=null;throw new t(\"network-request-failed\");})};k.Zb=function(){return!0};\nfunction ak(a,b,c,d,e,f,g,h,m,p,v,B){a=new Sj(a,b,c,d,e,B);a.l=f;a.g=g;a.i=h;a.b=lb(m||null);a.f=p;return a.xb(v).toString()}function Xj(a){if(!a.m)throw Error(\"IfcHandler must be initialized!\");Nj(a.m,function(b){var c={};if(b&&b.authEvent){var d=!1;b=ph(b.authEvent);for(c=0;c<a.h.length;c++)d=a.h[c](b)||d;c={};c.status=d?\"ACK\":\"ERROR\";return D(c)}c.status=\"ERROR\";return D(c)})}\nfunction Yj(a){var b={type:\"webStorageSupport\"};return Wj(a).then(function(){return Mj(a.m,b)}).then(function(c){if(c&&c.length&&\"undefined\"!==typeof c[0].webStorageSupport)return c[0].webStorageSupport;throw Error();})}k.Ea=function(a){this.h.push(a)};k.Ra=function(a){Va(this.h,function(b){return b==a})};function bk(a){this.a=a||firebase.INTERNAL.reactNative&&firebase.INTERNAL.reactNative.AsyncStorage;if(!this.a)throw new t(\"internal-error\",\"The React Native compatibility library was not found.\");this.type=\"asyncStorage\"}k=bk.prototype;k.get=function(a){return D(this.a.getItem(a)).then(function(b){return b&&Re(b)})};k.set=function(a,b){return D(this.a.setItem(a,Pe(b)))};k.T=function(a){return D(this.a.removeItem(a))};k.ca=function(){};k.ia=function(){};function ck(a){this.b=a;this.a={};this.f=q(this.c,this)}var dk=[];function ek(){var a=Ee()?self:null;w(dk,function(c){c.b==a&&(b=c)});if(!b){var b=new ck(a);dk.push(b)}return b}\nck.prototype.c=function(a){var b=a.data.eventType,c=a.data.eventId,d=this.a[b];if(d&&0<d.length){a.ports[0].postMessage({status:\"ack\",eventId:c,eventType:b,response:null});var e=[];w(d,function(f){e.push(D().then(function(){return f(a.origin,a.data.data)}))});Fc(e).then(function(f){var g=[];w(f,function(h){g.push({fulfilled:h.Ob,value:h.value,reason:h.reason?h.reason.message:void 0})});w(g,function(h){for(var m in h)\"undefined\"===typeof h[m]&&delete h[m]});a.ports[0].postMessage({status:\"done\",eventId:c,\neventType:b,response:g})})}};function fk(a,b,c){kb(a.a)&&a.b.addEventListener(\"message\",a.f);\"undefined\"===typeof a.a[b]&&(a.a[b]=[]);a.a[b].push(c)};function gk(a){this.a=a}gk.prototype.postMessage=function(a,b){this.a.postMessage(a,b)};function hk(a){this.c=a;this.b=!1;this.a=[]}\nfunction ik(a,b,c,d){var e,f=c||{},g,h,m,p=null;if(a.b)return E(Error(\"connection_unavailable\"));var v=d?800:50,B=\"undefined\"!==typeof MessageChannel?new MessageChannel:null;return(new C(function(A,Q){B?(e=Math.floor(Math.random()*Math.pow(10,20)).toString(),B.port1.start(),h=setTimeout(function(){Q(Error(\"unsupported_event\"))},v),g=function(xa){xa.data.eventId===e&&(\"ack\"===xa.data.status?(clearTimeout(h),m=setTimeout(function(){Q(Error(\"timeout\"))},3E3)):\"done\"===xa.data.status?(clearTimeout(m),\n\"undefined\"!==typeof xa.data.response?A(xa.data.response):Q(Error(\"unknown_error\"))):(clearTimeout(h),clearTimeout(m),Q(Error(\"invalid_response\"))))},p={messageChannel:B,onMessage:g},a.a.push(p),B.port1.addEventListener(\"message\",g),a.c.postMessage({eventType:b,eventId:e,data:f},[B.port2])):Q(Error(\"connection_unavailable\"))})).then(function(A){jk(a,p);return A}).s(function(A){jk(a,p);throw A;})}\nfunction jk(a,b){if(b){var c=b.messageChannel,d=b.onMessage;c&&(c.port1.removeEventListener(\"message\",d),c.port1.close());Va(a.a,function(e){return e==b})}}hk.prototype.close=function(){for(;0<this.a.length;)jk(this,this.a[0]);this.b=!0};function kk(){if(!lk())throw new t(\"web-storage-unsupported\");this.c={};this.a=[];this.b=0;this.m=l.indexedDB;this.type=\"indexedDB\";this.g=this.l=this.f=this.i=null;this.o=!1;this.h=null;var a=this;Ee()&&self?(this.l=ek(),fk(this.l,\"keyChanged\",function(b,c){return mk(a).then(function(d){0<d.length&&w(a.a,function(e){e(d)});return{keyProcessed:Ta(d,c.key)}})}),fk(this.l,\"ping\",function(){return D([\"keyChanged\"])})):af().then(function(b){if(a.h=b)a.g=new hk(new gk(b)),ik(a.g,\"ping\",null,!0).then(function(c){c[0].fulfilled&&\nTa(c[0].value,\"keyChanged\")&&(a.o=!0)}).s(function(){})})}var nk;function ok(a){return new C(function(b,c){var d=a.m.deleteDatabase(\"firebaseLocalStorageDb\");d.onsuccess=function(){b()};d.onerror=function(e){c(Error(e.target.error))}})}\nfunction pk(a){return new C(function(b,c){var d=a.m.open(\"firebaseLocalStorageDb\",1);d.onerror=function(e){try{e.preventDefault()}catch(f){}c(Error(e.target.error))};d.onupgradeneeded=function(e){e=e.target.result;try{e.createObjectStore(\"firebaseLocalStorage\",{keyPath:\"fbase_key\"})}catch(f){c(f)}};d.onsuccess=function(e){e=e.target.result;e.objectStoreNames.contains(\"firebaseLocalStorage\")?b(e):ok(a).then(function(){return pk(a)}).then(function(f){b(f)}).s(function(f){c(f)})}})}\nfunction qk(a){a.v||(a.v=pk(a));return a.v}function lk(){try{return!!l.indexedDB}catch(a){return!1}}function rk(a){return a.objectStore(\"firebaseLocalStorage\")}function sk(a,b){return a.transaction([\"firebaseLocalStorage\"],b?\"readwrite\":\"readonly\")}function tk(a){return new C(function(b,c){a.onsuccess=function(d){d&&d.target?b(d.target.result):b()};a.onerror=function(d){c(d.target.error)}})}k=kk.prototype;\nk.set=function(a,b){var c=!1,d,e=this;return qk(this).then(function(f){d=f;f=rk(sk(d,!0));return tk(f.get(a))}).then(function(f){var g=rk(sk(d,!0));if(f)return f.value=b,tk(g.put(f));e.b++;c=!0;f={};f.fbase_key=a;f.value=b;return tk(g.add(f))}).then(function(){e.c[a]=b;return uk(e,a)}).na(function(){c&&e.b--})};function uk(a,b){return a.g&&a.h&&$e()===a.h?ik(a.g,\"keyChanged\",{key:b},a.o).then(function(){}).s(function(){}):D()}\nk.get=function(a){return qk(this).then(function(b){return tk(rk(sk(b,!1)).get(a))}).then(function(b){return b&&b.value})};k.T=function(a){var b=!1,c=this;return qk(this).then(function(d){b=!0;c.b++;return tk(rk(sk(d,!0))[\"delete\"](a))}).then(function(){delete c.c[a];return uk(c,a)}).na(function(){b&&c.b--})};\nfunction mk(a){return qk(a).then(function(b){var c=rk(sk(b,!1));return c.getAll?tk(c.getAll()):new C(function(d,e){var f=[],g=c.openCursor();g.onsuccess=function(h){(h=h.target.result)?(f.push(h.value),h[\"continue\"]()):d(f)};g.onerror=function(h){e(h.target.error)}})}).then(function(b){var c={},d=[];if(0==a.b){for(d=0;d<b.length;d++)c[b[d].fbase_key]=b[d].value;d=oe(a.c,c);a.c=c}return d})}k.ca=function(a){0==this.a.length&&vk(this);this.a.push(a)};\nk.ia=function(a){Va(this.a,function(b){return b==a});0==this.a.length&&wk(this)};function vk(a){function b(){a.f=setTimeout(function(){a.i=mk(a).then(function(c){0<c.length&&w(a.a,function(d){d(c)})}).then(function(){b()}).s(function(c){\"STOP_EVENT\"!=c.message&&b()})},800)}wk(a);b()}function wk(a){a.i&&a.i.cancel(\"STOP_EVENT\");a.f&&(clearTimeout(a.f),a.f=null)};function xk(a){var b=this,c=null;this.a=[];this.type=\"indexedDB\";this.c=a;this.b=D().then(function(){if(lk()){var d=Le(),e=\"__sak\"+d;nk||(nk=new kk);c=nk;return c.set(e,d).then(function(){return c.get(e)}).then(function(f){if(f!==d)throw Error(\"indexedDB not supported!\");return c.T(e)}).then(function(){return c}).s(function(){return b.c})}return b.c}).then(function(d){b.type=d.type;d.ca(function(e){w(b.a,function(f){f(e)})});return d})}k=xk.prototype;k.get=function(a){return this.b.then(function(b){return b.get(a)})};\nk.set=function(a,b){return this.b.then(function(c){return c.set(a,b)})};k.T=function(a){return this.b.then(function(b){return b.T(a)})};k.ca=function(a){this.a.push(a)};k.ia=function(a){Va(this.a,function(b){return b==a})};function yk(){this.a={};this.type=\"inMemory\"}k=yk.prototype;k.get=function(a){return D(this.a[a])};k.set=function(a,b){this.a[a]=b;return D()};k.T=function(a){delete this.a[a];return D()};k.ca=function(){};k.ia=function(){};function zk(){if(!Ak()){if(\"Node\"==Fe())throw new t(\"internal-error\",\"The LocalStorage compatibility library was not found.\");throw new t(\"web-storage-unsupported\");}this.a=Bk()||firebase.INTERNAL.node.localStorage;this.type=\"localStorage\"}function Bk(){try{var a=l.localStorage,b=Le();a&&(a.setItem(b,\"1\"),a.removeItem(b));return a}catch(c){return null}}\nfunction Ak(){var a=\"Node\"==Fe();a=Bk()||a&&firebase.INTERNAL.node&&firebase.INTERNAL.node.localStorage;if(!a)return!1;try{return a.setItem(\"__sak\",\"1\"),a.removeItem(\"__sak\"),!0}catch(b){return!1}}k=zk.prototype;k.get=function(a){var b=this;return D().then(function(){var c=b.a.getItem(a);return Re(c)})};k.set=function(a,b){var c=this;return D().then(function(){var d=Pe(b);null===d?c.T(a):c.a.setItem(a,d)})};k.T=function(a){var b=this;return D().then(function(){b.a.removeItem(a)})};\nk.ca=function(a){l.window&&jd(l.window,\"storage\",a)};k.ia=function(a){l.window&&G(l.window,\"storage\",a)};function Ck(){this.type=\"nullStorage\"}k=Ck.prototype;k.get=function(){return D(null)};k.set=function(){return D()};k.T=function(){return D()};k.ca=function(){};k.ia=function(){};function Dk(){if(!Ek()){if(\"Node\"==Fe())throw new t(\"internal-error\",\"The SessionStorage compatibility library was not found.\");throw new t(\"web-storage-unsupported\");}this.a=Fk()||firebase.INTERNAL.node.sessionStorage;this.type=\"sessionStorage\"}function Fk(){try{var a=l.sessionStorage,b=Le();a&&(a.setItem(b,\"1\"),a.removeItem(b));return a}catch(c){return null}}\nfunction Ek(){var a=\"Node\"==Fe();a=Fk()||a&&firebase.INTERNAL.node&&firebase.INTERNAL.node.sessionStorage;if(!a)return!1;try{return a.setItem(\"__sak\",\"1\"),a.removeItem(\"__sak\"),!0}catch(b){return!1}}k=Dk.prototype;k.get=function(a){var b=this;return D().then(function(){var c=b.a.getItem(a);return Re(c)})};k.set=function(a,b){var c=this;return D().then(function(){var d=Pe(b);null===d?c.T(a):c.a.setItem(a,d)})};k.T=function(a){var b=this;return D().then(function(){b.a.removeItem(a)})};k.ca=function(){};\nk.ia=function(){};function Gk(){var a={};a.Browser=Hk;a.Node=Ik;a.ReactNative=Jk;a.Worker=Kk;this.a=a[Fe()]}var Lk,Hk={D:zk,ab:Dk},Ik={D:zk,ab:Dk},Jk={D:bk,ab:Ck},Kk={D:zk,ab:Ck};var Mk={qd:\"local\",NONE:\"none\",sd:\"session\"};function Nk(a){var b=new t(\"invalid-persistence-type\"),c=new t(\"unsupported-persistence-type\");a:{for(d in Mk)if(Mk[d]==a){var d=!0;break a}d=!1}if(!d||\"string\"!==typeof a)throw b;switch(Fe()){case \"ReactNative\":if(\"session\"===a)throw c;break;case \"Node\":if(\"none\"!==a)throw c;break;case \"Worker\":if(\"session\"===a||!lk()&&\"none\"!==a)throw c;break;default:if(!Ke()&&\"none\"!==a)throw c;}}\nfunction Ok(){var a=!Se(K())&&De()?!0:!1,b=Oe(),c=Ke();this.v=a;this.h=b;this.l=c;this.a={};Lk||(Lk=new Gk);a=Lk;try{this.g=!le()&&Ze()||!l.indexedDB?new a.a.D:new xk(Ee()?new yk:new a.a.D)}catch(d){this.g=new yk,this.h=!0}try{this.i=new a.a.ab}catch(d){this.i=new yk}this.m=new yk;this.f=q(this.Xb,this);this.b={}}var Pk;function Qk(){Pk||(Pk=new Ok);return Pk}function Rk(a,b){switch(b){case \"session\":return a.i;case \"none\":return a.m;default:return a.g}}\nfunction Sk(a,b){return\"firebase:\"+a.name+(b?\":\"+b:\"\")}function Tk(a,b,c){var d=Sk(b,c),e=Rk(a,b.D);return a.get(b,c).then(function(f){var g=null;try{g=Re(l.localStorage.getItem(d))}catch(h){}if(g&&!f)return l.localStorage.removeItem(d),a.set(b,g,c);g&&f&&\"localStorage\"!=e.type&&l.localStorage.removeItem(d)})}k=Ok.prototype;k.get=function(a,b){return Rk(this,a.D).get(Sk(a,b))};function Uk(a,b,c){c=Sk(b,c);\"local\"==b.D&&(a.b[c]=null);return Rk(a,b.D).T(c)}\nk.set=function(a,b,c){var d=Sk(a,c),e=this,f=Rk(this,a.D);return f.set(d,b).then(function(){return f.get(d)}).then(function(g){\"local\"==a.D&&(e.b[d]=g)})};k.addListener=function(a,b,c){a=Sk(a,b);this.l&&(this.b[a]=l.localStorage.getItem(a));kb(this.a)&&(Rk(this,\"local\").ca(this.f),this.h||(le()||!Ze())&&l.indexedDB||!this.l||Vk(this));this.a[a]||(this.a[a]=[]);this.a[a].push(c)};\nk.removeListener=function(a,b,c){a=Sk(a,b);this.a[a]&&(Va(this.a[a],function(d){return d==c}),0==this.a[a].length&&delete this.a[a]);kb(this.a)&&(Rk(this,\"local\").ia(this.f),Wk(this))};function Vk(a){Wk(a);a.c=setInterval(function(){for(var b in a.a){var c=l.localStorage.getItem(b),d=a.b[b];c!=d&&(a.b[b]=c,c=new Yc({type:\"storage\",key:b,target:window,oldValue:d,newValue:c,a:!0}),a.Xb(c))}},1E3)}function Wk(a){a.c&&(clearInterval(a.c),a.c=null)}\nk.Xb=function(a){if(a&&a.g){var b=a.a.key;if(null==b)for(var c in this.a){var d=this.b[c];\"undefined\"===typeof d&&(d=null);var e=l.localStorage.getItem(c);e!==d&&(this.b[c]=e,this.lb(c))}else if(0==b.indexOf(\"firebase:\")&&this.a[b]){\"undefined\"!==typeof a.a.a?Rk(this,\"local\").ia(this.f):Wk(this);if(this.v)if(c=l.localStorage.getItem(b),d=a.a.newValue,d!==c)null!==d?l.localStorage.setItem(b,d):l.localStorage.removeItem(b);else if(this.b[b]===d&&\"undefined\"===typeof a.a.a)return;var f=this;c=function(){if(\"undefined\"!==\ntypeof a.a.a||f.b[b]!==l.localStorage.getItem(b))f.b[b]=l.localStorage.getItem(b),f.lb(b)};Tb&&dc&&10==dc&&l.localStorage.getItem(b)!==a.a.newValue&&a.a.newValue!==a.a.oldValue?setTimeout(c,10):c()}}else w(a,q(this.lb,this))};k.lb=function(a){this.a[a]&&w(this.a[a],function(b){b()})};function Xk(a){this.a=a;this.b=Qk()}var Yk={name:\"authEvent\",D:\"local\"};function Zk(a){return a.b.get(Yk,a.a).then(function(b){return ph(b)})};function $k(){this.a=Qk()};function al(){this.b=-1};function bl(a,b){this.b=cl;this.f=l.Uint8Array?new Uint8Array(this.b):Array(this.b);this.g=this.c=0;this.a=[];this.i=a;this.h=b;this.l=l.Int32Array?new Int32Array(64):Array(64);void 0===dl&&(l.Int32Array?dl=new Int32Array(el):dl=el);this.reset()}var dl;r(bl,al);for(var cl=64,fl=cl-1,gl=[],hl=0;hl<fl;hl++)gl[hl]=0;var il=Wa(128,gl);bl.prototype.reset=function(){this.g=this.c=0;this.a=l.Int32Array?new Int32Array(this.h):Xa(this.h)};\nfunction jl(a){for(var b=a.f,c=a.l,d=0,e=0;e<b.length;)c[d++]=b[e]<<24|b[e+1]<<16|b[e+2]<<8|b[e+3],e=4*d;for(b=16;64>b;b++){e=c[b-15]|0;d=c[b-2]|0;var f=(c[b-16]|0)+((e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3)|0,g=(c[b-7]|0)+((d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10)|0;c[b]=f+g|0}d=a.a[0]|0;e=a.a[1]|0;var h=a.a[2]|0,m=a.a[3]|0,p=a.a[4]|0,v=a.a[5]|0,B=a.a[6]|0;f=a.a[7]|0;for(b=0;64>b;b++){var A=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&e^d&h^e&h)|0;g=p&v^~p&B;f=f+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<\n7))|0;g=g+(dl[b]|0)|0;g=f+(g+(c[b]|0)|0)|0;f=B;B=v;v=p;p=m+g|0;m=h;h=e;e=d;d=g+A|0}a.a[0]=a.a[0]+d|0;a.a[1]=a.a[1]+e|0;a.a[2]=a.a[2]+h|0;a.a[3]=a.a[3]+m|0;a.a[4]=a.a[4]+p|0;a.a[5]=a.a[5]+v|0;a.a[6]=a.a[6]+B|0;a.a[7]=a.a[7]+f|0}\nfunction kl(a,b,c){void 0===c&&(c=b.length);var d=0,e=a.c;if(\"string\"===typeof b)for(;d<c;)a.f[e++]=b.charCodeAt(d++),e==a.b&&(jl(a),e=0);else if(ma(b))for(;d<c;){var f=b[d++];if(!(\"number\"==typeof f&&0<=f&&255>=f&&f==(f|0)))throw Error(\"message must be a byte array\");a.f[e++]=f;e==a.b&&(jl(a),e=0)}else throw Error(\"message must be string or array\");a.c=e;a.g+=c}\nvar el=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,\n4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function ll(){bl.call(this,8,ml)}r(ll,bl);var ml=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function nl(a,b,c,d,e,f){this.m=a;this.i=b;this.l=c;this.v=d||null;this.u=e||null;this.o=f;this.h=b+\":\"+c;this.A=new $k;this.g=new Xk(this.h);this.f=null;this.b=[];this.a=this.c=null}function ol(a){return new t(\"invalid-cordova-configuration\",a)}k=nl.prototype;\nk.la=function(){return this.Ia?this.Ia:this.Ia=Ae().then(function(){if(\"function\"!==typeof L(\"universalLinks.subscribe\",l))throw ol(\"cordova-universal-links-plugin-fix is not installed\");if(\"undefined\"===typeof L(\"BuildInfo.packageName\",l))throw ol(\"cordova-plugin-buildinfo is not installed\");if(\"function\"!==typeof L(\"cordova.plugins.browsertab.openUrl\",l))throw ol(\"cordova-plugin-browsertab is not installed\");if(\"function\"!==typeof L(\"cordova.InAppBrowser.open\",l))throw ol(\"cordova-plugin-inappbrowser is not installed\");\n},function(){throw new t(\"cordova-not-ready\");})};function pl(){for(var a=20,b=[];0<a;)b.push(\"1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\".charAt(Math.floor(62*Math.random()))),a--;return b.join(\"\")}function ql(a){var b=new ll;kl(b,a);a=[];var c=8*b.g;56>b.c?kl(b,il,56-b.c):kl(b,il,b.b-(b.c-56));for(var d=63;56<=d;d--)b.f[d]=c&255,c/=256;jl(b);for(d=c=0;d<b.i;d++)for(var e=24;0<=e;e-=8)a[c++]=b.a[d]>>e&255;return Zf(a)}\nk.Nb=function(a,b){b(new t(\"operation-not-supported-in-this-environment\"));return D()};k.Lb=function(){return E(new t(\"operation-not-supported-in-this-environment\"))};k.Zb=function(){return!1};k.Wb=function(){return!0};k.Sb=function(){return!0};\nk.Mb=function(a,b,c,d){if(this.c)return E(new t(\"redirect-operation-pending\"));var e=this,f=l.document,g=null,h=null,m=null,p=null;return this.c=D().then(function(){nh(b);return rl(e)}).then(function(){return sl(e,a,b,c,d)}).then(function(){return(new C(function(v,B){h=function(){var A=L(\"cordova.plugins.browsertab.close\",l);v();\"function\"===typeof A&&A();e.a&&\"function\"===typeof e.a.close&&(e.a.close(),e.a=null);return!1};e.Ea(h);m=function(){g||(g=Ad(2E3).then(function(){B(new t(\"redirect-cancelled-by-user\"))}))};\np=function(){Ve()&&m()};f.addEventListener(\"resume\",m,!1);K().toLowerCase().match(/android/)||f.addEventListener(\"visibilitychange\",p,!1)})).s(function(v){return tl(e).then(function(){throw v;})})}).na(function(){m&&f.removeEventListener(\"resume\",m,!1);p&&f.removeEventListener(\"visibilitychange\",p,!1);g&&g.cancel();h&&e.Ra(h);e.c=null})};\nfunction sl(a,b,c,d,e){var f=pl(),g=new oh(b,d,null,f,new t(\"no-auth-event\"),null,e),h=L(\"BuildInfo.packageName\",l);if(\"string\"!==typeof h)throw new t(\"invalid-cordova-configuration\");var m=L(\"BuildInfo.displayName\",l),p={};if(K().toLowerCase().match(/iphone|ipad|ipod/))p.ibi=h;else if(K().toLowerCase().match(/android/))p.apn=h;else return E(new t(\"operation-not-supported-in-this-environment\"));m&&(p.appDisplayName=m);f=ql(f);p.sessionId=f;var v=ak(a.m,a.i,a.l,b,c,null,d,a.v,p,a.u,e,a.o);return a.la().then(function(){var B=\na.h;return a.A.a.set(Yk,g.w(),B)}).then(function(){var B=L(\"cordova.plugins.browsertab.isAvailable\",l);if(\"function\"!==typeof B)throw new t(\"invalid-cordova-configuration\");var A=null;B(function(Q){if(Q){A=L(\"cordova.plugins.browsertab.openUrl\",l);if(\"function\"!==typeof A)throw new t(\"invalid-cordova-configuration\");A(v)}else{A=L(\"cordova.InAppBrowser.open\",l);if(\"function\"!==typeof A)throw new t(\"invalid-cordova-configuration\");Q=K();a.a=A(v,Q.match(/(iPad|iPhone|iPod).*OS 7_\\d/i)||Q.match(/(iPad|iPhone|iPod).*OS 8_\\d/i)?\n\"_blank\":\"_system\",\"location=yes\")}})})}function ul(a,b){for(var c=0;c<a.b.length;c++)try{a.b[c](b)}catch(d){}}function rl(a){a.f||(a.f=a.la().then(function(){return new C(function(b){function c(d){b(d);a.Ra(c);return!1}a.Ea(c);vl(a)})}));return a.f}function tl(a){var b=null;return Zk(a.g).then(function(c){b=c;c=a.g;return Uk(c.b,Yk,c.a)}).then(function(){return b})}\nfunction vl(a){function b(g){d=!0;e&&e.cancel();tl(a).then(function(h){var m=c;if(h&&g&&g.url){var p=null;m=tg(g.url);-1!=m.indexOf(\"/__/auth/callback\")&&(p=J(m),p=Re(Xd(p,\"firebaseError\")||null),p=(p=\"object\"===typeof p?ya(p):null)?new oh(h.c,h.b,null,null,p,null,h.S()):new oh(h.c,h.b,m,h.f,null,null,h.S()));m=p||c}ul(a,m)})}var c=new oh(\"unknown\",null,null,null,new t(\"no-auth-event\")),d=!1,e=Ad(500).then(function(){return tl(a).then(function(){d||ul(a,c)})}),f=l.handleOpenURL;l.handleOpenURL=function(g){0==\ng.toLowerCase().indexOf(L(\"BuildInfo.packageName\",l).toLowerCase()+\"://\")&&b({url:g});if(\"function\"===typeof f)try{f(g)}catch(h){console.error(h)}};rh||(rh=new qh);sh(b)}k.Ea=function(a){this.b.push(a);rl(this).s(function(b){\"auth/invalid-cordova-configuration\"===b.code&&(b=new oh(\"unknown\",null,null,null,new t(\"no-auth-event\")),a(b))})};k.Ra=function(a){Va(this.b,function(b){return b==a})};function wl(a){this.a=a;this.b=Qk()}var xl={name:\"pendingRedirect\",D:\"session\"};function yl(a){return a.b.set(xl,\"pending\",a.a)}function zl(a){return Uk(a.b,xl,a.a)}function Al(a){return a.b.get(xl,a.a).then(function(b){return\"pending\"==b})};function Bl(a,b,c,d){this.i={};this.u=0;this.O=a;this.m=b;this.v=c;this.G=d;this.h=[];this.f=!1;this.l=q(this.o,this);this.b=new Cl;this.A=new Dl;this.g=new wl(El(this.m,this.v));this.c={};this.c.unknown=this.b;this.c.signInViaRedirect=this.b;this.c.linkViaRedirect=this.b;this.c.reauthViaRedirect=this.b;this.c.signInViaPopup=this.A;this.c.linkViaPopup=this.A;this.c.reauthViaPopup=this.A;this.a=Fl(this.O,this.m,this.v,Ba,this.G)}\nfunction Fl(a,b,c,d,e){var f=firebase.SDK_VERSION||null;return Be()?new nl(a,b,c,f,d,e):new Uj(a,b,c,f,d,e)}Bl.prototype.reset=function(){this.f=!1;this.a.Ra(this.l);this.a=Fl(this.O,this.m,this.v,null,this.G);this.i={}};function Gl(a){a.f||(a.f=!0,a.a.Ea(a.l));var b=a.a;return a.a.la().s(function(c){a.a==b&&a.reset();throw c;})}\nfunction Hl(a){a.a.Wb()&&Gl(a).s(function(b){var c=new oh(\"unknown\",null,null,null,new t(\"operation-not-supported-in-this-environment\"));Il(b)&&a.o(c)});a.a.Sb()||Jl(a.b)}function Kl(a,b){Ta(a.h,b)||a.h.push(b);a.f||Al(a.g).then(function(c){c?zl(a.g).then(function(){Gl(a).s(function(d){var e=new oh(\"unknown\",null,null,null,new t(\"operation-not-supported-in-this-environment\"));Il(d)&&a.o(e)})}):Hl(a)}).s(function(){Hl(a)})}function Ll(a,b){Va(a.h,function(c){return c==b})}\nBl.prototype.o=function(a){if(!a)throw new t(\"invalid-auth-event\");6E5<=ua()-this.u&&(this.i={},this.u=0);if(a&&a.getUid()&&this.i.hasOwnProperty(a.getUid()))return!1;for(var b=!1,c=0;c<this.h.length;c++){var d=this.h[c];if(d.Eb(a.c,a.b)){if(b=this.c[a.c])b.h(a,d),a&&(a.f||a.b)&&(this.i[a.getUid()]=!0,this.u=ua());b=!0;break}}Jl(this.b);return b};var Ml=new Ue(2E3,1E4),Nl=new Ue(3E4,6E4);Bl.prototype.qa=function(){return this.b.qa()};\nfunction Ol(a,b,c,d,e,f,g){return a.a.Lb(b,c,d,function(){a.f||(a.f=!0,a.a.Ea(a.l))},function(){a.reset()},e,f,g)}function Il(a){return a&&\"auth/cordova-not-ready\"==a.code?!0:!1}\nfunction Pl(a,b,c,d,e){var f;return yl(a.g).then(function(){return a.a.Mb(b,c,d,e).s(function(g){if(Il(g))throw new t(\"operation-not-supported-in-this-environment\");f=g;return zl(a.g).then(function(){throw f;})}).then(function(){return a.a.Zb()?new C(function(){}):zl(a.g).then(function(){return a.qa()}).then(function(){}).s(function(){})})})}function Ql(a,b,c,d,e){return a.a.Nb(d,function(f){b.ma(c,null,f,e)},Ml.get())}var Rl={};function El(a,b,c){a=a+\":\"+b;c&&(a=a+\":\"+c.url);return a}\nfunction Sl(a,b,c,d){var e=El(b,c,d);Rl[e]||(Rl[e]=new Bl(a,b,c,d));return Rl[e]}function Cl(){this.b=null;this.f=[];this.c=[];this.a=null;this.i=this.g=!1}Cl.prototype.reset=function(){this.b=null;this.a&&(this.a.cancel(),this.a=null)};\nCl.prototype.h=function(a,b){if(a){this.reset();this.g=!0;var c=a.c,d=a.b,e=a.a&&\"auth/web-storage-unsupported\"==a.a.code,f=a.a&&\"auth/operation-not-supported-in-this-environment\"==a.a.code;this.i=!(!e&&!f);\"unknown\"!=c||e||f?a.a?(Tl(this,!0,null,a.a),D()):b.Fa(c,d)?Ul(this,a,b):E(new t(\"invalid-auth-event\")):(Tl(this,!1,null,null),D())}else E(new t(\"invalid-auth-event\"))};function Jl(a){a.g||(a.g=!0,Tl(a,!1,null,null))}function Vl(a){a.g&&!a.i&&Tl(a,!1,null,null)}\nfunction Ul(a,b,c){c=c.Fa(b.c,b.b);var d=b.g,e=b.f,f=b.i,g=b.S(),h=!!b.c.match(/Redirect$/);c(d,e,g,f).then(function(m){Tl(a,h,m,null)}).s(function(m){Tl(a,h,null,m)})}function Wl(a,b){a.b=function(){return E(b)};if(a.c.length)for(var c=0;c<a.c.length;c++)a.c[c](b)}function Xl(a,b){a.b=function(){return D(b)};if(a.f.length)for(var c=0;c<a.f.length;c++)a.f[c](b)}function Tl(a,b,c,d){b?d?Wl(a,d):Xl(a,c):Xl(a,{user:null});a.f=[];a.c=[]}\nCl.prototype.qa=function(){var a=this;return new C(function(b,c){a.b?a.b().then(b,c):(a.f.push(b),a.c.push(c),Yl(a))})};function Yl(a){var b=new t(\"timeout\");a.a&&a.a.cancel();a.a=Ad(Nl.get()).then(function(){a.b||(a.g=!0,Tl(a,!0,null,b))})}function Dl(){}Dl.prototype.h=function(a,b){if(a){var c=a.c,d=a.b;a.a?(b.ma(a.c,null,a.a,a.b),D()):b.Fa(c,d)?Zl(a,b):E(new t(\"invalid-auth-event\"))}else E(new t(\"invalid-auth-event\"))};\nfunction Zl(a,b){var c=a.b,d=a.c;b.Fa(d,c)(a.g,a.f,a.S(),a.i).then(function(e){b.ma(d,e,null,c)}).s(function(e){b.ma(d,null,e,c)})};function $l(){this.hb=!1;Object.defineProperty(this,\"appVerificationDisabled\",{get:function(){return this.hb},set:function(a){this.hb=a},enumerable:!1})};function am(a,b){this.a=b;M(this,\"verificationId\",a)}am.prototype.confirm=function(a){a=lh(this.verificationId,a);return this.a(a)};function bm(a,b,c,d){return(new hh(a)).eb(b,c).then(function(e){return new am(e,d)})};function cm(a){var b=eg(a);if(!(b&&b.exp&&b.auth_time&&b.iat))throw new t(\"internal-error\",\"An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation.\");N(this,{token:a,expirationTime:Ye(1E3*b.exp),authTime:Ye(1E3*b.auth_time),issuedAtTime:Ye(1E3*b.iat),signInProvider:b.firebase&&b.firebase.sign_in_provider?b.firebase.sign_in_provider:null,signInSecondFactor:b.firebase&&b.firebase.sign_in_second_factor?b.firebase.sign_in_second_factor:null,claims:b})}\n;function dm(a,b,c){var d=b&&b[em];if(!d)throw new t(\"argument-error\",\"Internal assert: Invalid MultiFactorResolver\");this.a=a;this.f=lb(b);this.g=c;this.c=new ug(null,d);this.b=[];var e=this;w(b[fm]||[],function(f){(f=pf(f))&&e.b.push(f)});M(this,\"auth\",this.a);M(this,\"session\",this.c);M(this,\"hints\",this.b)}var fm=\"mfaInfo\",em=\"mfaPendingCredential\";dm.prototype.Qc=function(a){var b=this;return a.rb(this.a.a,this.c).then(function(c){var d=lb(b.f);delete d[fm];delete d[em];z(d,c);return b.g(d)})};function gm(a,b,c,d){t.call(this,\"multi-factor-auth-required\",d,b);this.b=new dm(a,b,c);M(this,\"resolver\",this.b)}r(gm,t);function hm(a,b,c){if(a&&n(a.serverResponse)&&\"auth/multi-factor-auth-required\"===a.code)try{return new gm(b,a.serverResponse,c,a.message)}catch(d){}return null};function im(){}im.prototype.rb=function(a,b,c){return b.type==vg?jm(this,a,b,c):km(this,a,b)};function jm(a,b,c,d){return c.Ha().then(function(e){e={idToken:e};\"undefined\"!==typeof d&&(e.displayName=d);z(e,{phoneVerificationInfo:dh(a.a)});return O(b,Cj,e)})}function km(a,b,c){return c.Ha().then(function(d){d={mfaPendingCredential:d};z(d,{phoneVerificationInfo:dh(a.a)});return O(b,Dj,d)})}function lm(a){M(this,\"factorId\",a.fa);this.a=a}r(lm,im);\nfunction mm(a){lm.call(this,a);if(this.a.fa!=hh.PROVIDER_ID)throw new t(\"argument-error\",\"firebase.auth.PhoneMultiFactorAssertion requires a valid firebase.auth.PhoneAuthCredential\");}r(mm,lm);function nm(a,b){F.call(this,a);for(var c in b)this[c]=b[c]}r(nm,F);function om(a,b){this.a=a;this.b=[];this.c=q(this.xc,this);jd(this.a,\"userReloaded\",this.c);var c=[];b&&b.multiFactor&&b.multiFactor.enrolledFactors&&w(b.multiFactor.enrolledFactors,function(d){var e=null,f={};if(d){d.uid&&(f[mf]=d.uid);d.displayName&&(f[nf]=d.displayName);d.enrollmentTime&&(f[of]=(new Date(d.enrollmentTime)).toISOString());d.phoneNumber&&(f[lf]=d.phoneNumber);try{e=new qf(f)}catch(g){}d=e}else d=null;d&&c.push(d)});pm(this,c)}\nfunction qm(a){var b=[];w(a.mfaInfo||[],function(c){(c=pf(c))&&b.push(c)});return b}k=om.prototype;k.xc=function(a){pm(this,qm(a.gd))};function pm(a,b){a.b=b;M(a,\"enrolledFactors\",b)}k.Qb=function(){return this.a.I().then(function(a){return new ug(a,null)})};k.ec=function(a,b){var c=this,d=this.a.a;return this.Qb().then(function(e){return a.rb(d,e,b)}).then(function(e){rm(c.a,e);return c.a.reload()})};\nk.ad=function(a){var b=this,c=\"string\"===typeof a?a:a.uid,d=this.a.a;return this.a.I().then(function(e){return O(d,Hj,{idToken:e,mfaEnrollmentId:c})}).then(function(e){var f=Oa(b.b,function(g){return g.uid!=c});pm(b,f);rm(b.a,e);return b.a.reload().s(function(g){if(\"auth/user-token-expired\"!=g.code)throw g;})})};k.w=function(){return{multiFactor:{enrolledFactors:Pa(this.b,function(a){return a.w()})}}};function sm(a,b,c){this.h=a;this.i=b;this.g=c;this.c=3E4;this.f=96E4;this.b=null;this.a=this.c;if(this.f<this.c)throw Error(\"Proactive refresh lower bound greater than upper bound!\");}sm.prototype.start=function(){this.a=this.c;tm(this,!0)};function um(a,b){if(b)return a.a=a.c,a.g();b=a.a;a.a*=2;a.a>a.f&&(a.a=a.f);return b}function tm(a,b){a.stop();a.b=Ad(um(a,b)).then(function(){return We()}).then(function(){return a.h()}).then(function(){tm(a,!0)}).s(function(c){a.i(c)&&tm(a,!1)})}\nsm.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)};function vm(a){this.c=a;this.b=this.a=null}vm.prototype.w=function(){return{apiKey:this.c.c,refreshToken:this.a,accessToken:this.b&&this.b.toString(),expirationTime:wm(this)}};function wm(a){return a.b&&1E3*a.b.c||0}function xm(a,b){var c=b.refreshToken;a.b=fg(b[zg]||\"\");a.a=c}function ym(a,b){a.b=b.b;a.a=b.a}\nfunction zm(a,b){return Si(a.c,b).then(function(c){a.b=fg(c.access_token);a.a=c.refresh_token;return{accessToken:a.b.toString(),refreshToken:a.a}}).s(function(c){\"auth/user-token-expired\"==c.code&&(a.a=null);throw c;})}vm.prototype.getToken=function(a){a=!!a;return this.b&&!this.a?E(new t(\"user-token-expired\")):a||!this.b||ua()>wm(this)-3E4?this.a?zm(this,{grant_type:\"refresh_token\",refresh_token:this.a}):D(null):D({accessToken:this.b.toString(),refreshToken:this.a})};function Am(a,b){this.a=a||null;this.b=b||null;N(this,{lastSignInTime:Ye(b||null),creationTime:Ye(a||null)})}function Bm(a){return new Am(a.a,a.b)}Am.prototype.w=function(){return{lastLoginAt:this.b,createdAt:this.a}};function Cm(a,b,c,d,e,f){N(this,{uid:a,displayName:d||null,photoURL:e||null,email:c||null,phoneNumber:f||null,providerId:b})}\nfunction Dm(a,b,c){this.G=[];this.l=a.apiKey;this.m=a.appName;this.o=a.authDomain||null;var d=firebase.SDK_VERSION?Je(firebase.SDK_VERSION):null;this.a=new Ei(this.l,Aa(Ba),d);a.emulatorConfig&&Li(this.a,a.emulatorConfig);this.b=new vm(this.a);Em(this,b[zg]);xm(this.b,b);M(this,\"refreshToken\",this.b.a);Fm(this,c||{});H.call(this);this.P=!1;this.o&&Me()&&(this.i=Sl(this.o,this.l,this.m));this.R=[];this.f=null;this.u=Gm(this);this.$=q(this.gb,this);var e=this;this.pa=null;this.Ba=function(f){e.wa(f.h)};\nthis.ba=null;this.za=function(f){Li(e.a,f.c)};this.W=null;this.X=[];this.Aa=function(f){Hm(e,f.f)};this.aa=null;this.N=new om(this,c);M(this,\"multiFactor\",this.N)}r(Dm,H);Dm.prototype.wa=function(a){this.pa=a;Ki(this.a,a)};Dm.prototype.ka=function(){return this.pa};function Im(a,b){a.ba&&G(a.ba,\"languageCodeChanged\",a.Ba);(a.ba=b)&&jd(b,\"languageCodeChanged\",a.Ba)}function Jm(a,b){a.W&&G(a.W,\"emulatorConfigChanged\",a.za);(a.W=b)&&jd(b,\"emulatorConfigChanged\",a.za)}\nfunction Hm(a,b){a.X=b;Ni(a.a,firebase.SDK_VERSION?Je(firebase.SDK_VERSION,a.X):null)}Dm.prototype.Ga=function(){return Xa(this.X)};function Km(a,b){a.aa&&G(a.aa,\"frameworkChanged\",a.Aa);(a.aa=b)&&jd(b,\"frameworkChanged\",a.Aa)}Dm.prototype.gb=function(){this.u.b&&(this.u.stop(),this.u.start())};function Lm(a){try{return firebase.app(a.m).auth()}catch(b){throw new t(\"internal-error\",\"No firebase.auth.Auth instance is available for the Firebase App '\"+a.m+\"'!\");}}\nfunction Gm(a){return new sm(function(){return a.I(!0)},function(b){return b&&\"auth/network-request-failed\"==b.code?!0:!1},function(){var b=wm(a.b)-ua()-3E5;return 0<b?b:0})}function Mm(a){a.A||a.u.b||(a.u.start(),G(a,\"tokenChanged\",a.$),jd(a,\"tokenChanged\",a.$))}function Nm(a){G(a,\"tokenChanged\",a.$);a.u.stop()}function Em(a,b){a.ya=b;M(a,\"_lat\",b)}function Om(a,b){Va(a.R,function(c){return c==b})}\nfunction Pm(a){for(var b=[],c=0;c<a.R.length;c++)b.push(a.R[c](a));return Fc(b).then(function(){return a})}function Qm(a){a.i&&!a.P&&(a.P=!0,Kl(a.i,a))}function Fm(a,b){N(a,{uid:b.uid,displayName:b.displayName||null,photoURL:b.photoURL||null,email:b.email||null,emailVerified:b.emailVerified||!1,phoneNumber:b.phoneNumber||null,isAnonymous:b.isAnonymous||!1,tenantId:b.tenantId||null,metadata:new Am(b.createdAt,b.lastLoginAt),providerData:[]});a.a.b=a.tenantId}M(Dm.prototype,\"providerId\",\"firebase\");\nfunction Rm(){}function Sm(a){return D().then(function(){if(a.A)throw new t(\"app-deleted\");})}function Tm(a){return Pa(a.providerData,function(b){return b.providerId})}function Um(a,b){b&&(Vm(a,b.providerId),a.providerData.push(b))}function Vm(a,b){Va(a.providerData,function(c){return c.providerId==b})}function Wm(a,b,c){(\"uid\"!=b||c)&&a.hasOwnProperty(b)&&M(a,b,c)}\nfunction Xm(a,b){a!=b&&(N(a,{uid:b.uid,displayName:b.displayName,photoURL:b.photoURL,email:b.email,emailVerified:b.emailVerified,phoneNumber:b.phoneNumber,isAnonymous:b.isAnonymous,tenantId:b.tenantId,providerData:[]}),b.metadata?M(a,\"metadata\",Bm(b.metadata)):M(a,\"metadata\",new Am),w(b.providerData,function(c){Um(a,c)}),ym(a.b,b.b),M(a,\"refreshToken\",a.b.a),pm(a.N,b.N.b))}k=Dm.prototype;k.reload=function(){var a=this;return R(this,Sm(this).then(function(){return Ym(a).then(function(){return Pm(a)}).then(Rm)}))};\nfunction Ym(a){return a.I().then(function(b){var c=a.isAnonymous;return Zm(a,b).then(function(){c||Wm(a,\"isAnonymous\",!1);return b})})}k.nc=function(a){return this.I(a).then(function(b){return new cm(b)})};k.I=function(a){var b=this;return R(this,Sm(this).then(function(){return b.b.getToken(a)}).then(function(c){if(!c)throw new t(\"internal-error\");c.accessToken!=b.ya&&(Em(b,c.accessToken),b.dispatchEvent(new nm(\"tokenChanged\")));Wm(b,\"refreshToken\",c.refreshToken);return c.accessToken}))};\nfunction rm(a,b){b[zg]&&a.ya!=b[zg]&&(xm(a.b,b),a.dispatchEvent(new nm(\"tokenChanged\")),Em(a,b[zg]),Wm(a,\"refreshToken\",a.b.a))}function Zm(a,b){return O(a.a,Ej,{idToken:b}).then(q(a.Jc,a))}\nk.Jc=function(a){a=a.users;if(!a||!a.length)throw new t(\"internal-error\");a=a[0];Fm(this,{uid:a.localId,displayName:a.displayName,photoURL:a.photoUrl,email:a.email,emailVerified:!!a.emailVerified,phoneNumber:a.phoneNumber,lastLoginAt:a.lastLoginAt,createdAt:a.createdAt,tenantId:a.tenantId});for(var b=$m(a),c=0;c<b.length;c++)Um(this,b[c]);Wm(this,\"isAnonymous\",!(this.email&&a.passwordHash)&&!(this.providerData&&this.providerData.length));this.dispatchEvent(new nm(\"userReloaded\",{gd:a}))};\nfunction $m(a){return(a=a.providerUserInfo)&&a.length?Pa(a,function(b){return new Cm(b.rawId,b.providerId,b.email,b.displayName,b.photoUrl,b.phoneNumber)}):[]}k.Kc=function(a){cf(\"firebase.User.prototype.reauthenticateAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.reauthenticateWithCredential instead.\");return this.sb(a)};\nk.sb=function(a){var b=this,c=null;return R(this,a.c(this.a,this.uid).then(function(d){rm(b,d);c=an(b,d,\"reauthenticate\");b.f=null;return b.reload()}).then(function(){return c}),!0)};function bn(a,b){return Ym(a).then(function(){if(Ta(Tm(a),b))return Pm(a).then(function(){throw new t(\"provider-already-linked\");})})}k.Bc=function(a){cf(\"firebase.User.prototype.linkAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.linkWithCredential instead.\");return this.pb(a)};\nk.pb=function(a){var b=this,c=null;return R(this,bn(this,a.providerId).then(function(){return b.I()}).then(function(d){return a.b(b.a,d)}).then(function(d){c=an(b,d,\"link\");return cn(b,d)}).then(function(){return c}))};k.Cc=function(a,b){var c=this;return R(this,bn(this,\"phone\").then(function(){return bm(Lm(c),a,b,q(c.pb,c))}))};k.Lc=function(a,b){var c=this;return R(this,D().then(function(){return bm(Lm(c),a,b,q(c.sb,c))}),!0)};\nfunction an(a,b,c){var d=mh(b);b=kg(b);return ff({user:a,credential:d,additionalUserInfo:b,operationType:c})}function cn(a,b){rm(a,b);return a.reload().then(function(){return a})}k.Ab=function(a){var b=this;return R(this,this.I().then(function(c){return b.a.Ab(c,a)}).then(function(c){rm(b,c);return b.reload()}))};k.dd=function(a){var b=this;return R(this,this.I().then(function(c){return a.b(b.a,c)}).then(function(c){rm(b,c);return b.reload()}))};\nk.Bb=function(a){var b=this;return R(this,this.I().then(function(c){return b.a.Bb(c,a)}).then(function(c){rm(b,c);return b.reload()}))};\nk.Cb=function(a){if(void 0===a.displayName&&void 0===a.photoURL)return Sm(this);var b=this;return R(this,this.I().then(function(c){return b.a.Cb(c,{displayName:a.displayName,photoUrl:a.photoURL})}).then(function(c){rm(b,c);Wm(b,\"displayName\",c.displayName||null);Wm(b,\"photoURL\",c.photoUrl||null);w(b.providerData,function(d){\"password\"===d.providerId&&(M(d,\"displayName\",b.displayName),M(d,\"photoURL\",b.photoURL))});return Pm(b)}).then(Rm))};\nk.bd=function(a){var b=this;return R(this,Ym(this).then(function(c){return Ta(Tm(b),a)?nj(b.a,c,[a]).then(function(d){var e={};w(d.providerUserInfo||[],function(f){e[f.providerId]=!0});w(Tm(b),function(f){e[f]||Vm(b,f)});e[hh.PROVIDER_ID]||M(b,\"phoneNumber\",null);return Pm(b)}):Pm(b).then(function(){throw new t(\"no-such-provider\");})}))};\nk.delete=function(){var a=this;return R(this,this.I().then(function(b){return O(a.a,Bj,{idToken:b})}).then(function(){a.dispatchEvent(new nm(\"userDeleted\"))})).then(function(){for(var b=0;b<a.G.length;b++)a.G[b].cancel(\"app-deleted\");Im(a,null);Jm(a,null);Km(a,null);a.G=[];a.A=!0;Nm(a);M(a,\"refreshToken\",null);a.i&&Ll(a.i,a)})};\nk.Eb=function(a,b){return\"linkViaPopup\"==a&&(this.h||null)==b&&this.g||\"reauthViaPopup\"==a&&(this.h||null)==b&&this.g||\"linkViaRedirect\"==a&&(this.ga||null)==b||\"reauthViaRedirect\"==a&&(this.ga||null)==b?!0:!1};k.ma=function(a,b,c,d){\"linkViaPopup\"!=a&&\"reauthViaPopup\"!=a||d!=(this.h||null)||(c&&this.O?this.O(c):b&&!c&&this.g&&this.g(b),this.c&&(this.c.cancel(),this.c=null),delete this.g,delete this.O)};\nk.Fa=function(a,b){return\"linkViaPopup\"==a&&b==(this.h||null)?q(this.Jb,this):\"reauthViaPopup\"==a&&b==(this.h||null)?q(this.Kb,this):\"linkViaRedirect\"==a&&(this.ga||null)==b?q(this.Jb,this):\"reauthViaRedirect\"==a&&(this.ga||null)==b?q(this.Kb,this):null};k.Dc=function(a){var b=this;return dn(this,\"linkViaPopup\",a,function(){return bn(b,a.providerId).then(function(){return Pm(b)})},!1)};k.Mc=function(a){return dn(this,\"reauthViaPopup\",a,function(){return D()},!0)};\nfunction dn(a,b,c,d,e){if(!Me())return E(new t(\"operation-not-supported-in-this-environment\"));if(a.f&&!e)return E(a.f);var f=jg(c.providerId),g=Le(a.uid+\":::\"),h=null;(!Oe()||De())&&a.o&&c.isOAuthProvider&&(h=ak(a.o,a.l,a.m,b,c,null,g,firebase.SDK_VERSION||null,null,null,a.tenantId));var m=ue(h,f&&f.ua,f&&f.ta);d=d().then(function(){en(a);if(!e)return a.I().then(function(){})}).then(function(){return Ol(a.i,m,b,c,g,!!h,a.tenantId)}).then(function(){return new C(function(p,v){a.ma(b,null,new t(\"cancelled-popup-request\"),\na.h||null);a.g=p;a.O=v;a.h=g;a.c=Ql(a.i,a,b,m,g)})}).then(function(p){m&&te(m);return p?ff(p):null}).s(function(p){m&&te(m);throw p;});return R(a,d,e)}k.Ec=function(a){var b=this;return fn(this,\"linkViaRedirect\",a,function(){return bn(b,a.providerId)},!1)};k.Nc=function(a){return fn(this,\"reauthViaRedirect\",a,function(){return D()},!0)};\nfunction fn(a,b,c,d,e){if(!Me())return E(new t(\"operation-not-supported-in-this-environment\"));if(a.f&&!e)return E(a.f);var f=null,g=Le(a.uid+\":::\");d=d().then(function(){en(a);if(!e)return a.I().then(function(){})}).then(function(){a.ga=g;return Pm(a)}).then(function(h){a.ha&&(h=a.ha,h=h.b.set(gn,a.w(),h.a));return h}).then(function(){return Pl(a.i,b,c,g,a.tenantId)}).s(function(h){f=h;if(a.ha)return hn(a.ha);throw f;}).then(function(){if(f)throw f;});return R(a,d,e)}\nfunction en(a){if(!a.i||!a.P){if(a.i&&!a.P)throw new t(\"internal-error\");throw new t(\"auth-domain-config-required\");}}k.Jb=function(a,b,c,d){var e=this;this.c&&(this.c.cancel(),this.c=null);var f=null;c=this.I().then(function(g){return Dg(e.a,{requestUri:a,postBody:d,sessionId:b,idToken:g})}).then(function(g){f=an(e,g,\"link\");return cn(e,g)}).then(function(){return f});return R(this,c)};\nk.Kb=function(a,b,c,d){var e=this;this.c&&(this.c.cancel(),this.c=null);var f=null,g=D().then(function(){return yg(Eg(e.a,{requestUri:a,sessionId:b,postBody:d,tenantId:c}),e.uid)}).then(function(h){f=an(e,h,\"reauthenticate\");rm(e,h);e.f=null;return e.reload()}).then(function(){return f});return R(this,g,!0)};\nk.tb=function(a){var b=this,c=null;return R(this,this.I().then(function(d){c=d;return\"undefined\"===typeof a||kb(a)?{}:Yf(new Of(a))}).then(function(d){return b.a.tb(c,d)}).then(function(d){if(b.email!=d)return b.reload()}).then(function(){}))};k.Db=function(a,b){var c=this,d=null;return R(this,this.I().then(function(e){d=e;return\"undefined\"===typeof b||kb(b)?{}:Yf(new Of(b))}).then(function(e){return c.a.Db(d,a,e)}).then(function(e){if(c.email!=e)return c.reload()}).then(function(){}))};\nfunction R(a,b,c){var d=jn(a,b,c);a.G.push(d);d.na(function(){Ua(a.G,d)});return d.s(function(e){var f=null;e&&\"auth/multi-factor-auth-required\"===e.code&&(f=hm(e.w(),Lm(a),q(a.ic,a)));throw f||e;})}k.ic=function(a){var b=null,c=this;a=yg(D(a),c.uid).then(function(d){b=an(c,d,\"reauthenticate\");rm(c,d);c.f=null;return c.reload()}).then(function(){return b});return R(this,a,!0)};\nfunction jn(a,b,c){return a.f&&!c?(b.cancel(),E(a.f)):b.s(function(d){!d||\"auth/user-disabled\"!=d.code&&\"auth/user-token-expired\"!=d.code||(a.f||a.dispatchEvent(new nm(\"userInvalidated\")),a.f=d);throw d;})}k.toJSON=function(){return this.w()};\nk.w=function(){var a={uid:this.uid,displayName:this.displayName,photoURL:this.photoURL,email:this.email,emailVerified:this.emailVerified,phoneNumber:this.phoneNumber,isAnonymous:this.isAnonymous,tenantId:this.tenantId,providerData:[],apiKey:this.l,appName:this.m,authDomain:this.o,stsTokenManager:this.b.w(),redirectEventId:this.ga||null};this.metadata&&z(a,this.metadata.w());w(this.providerData,function(b){a.providerData.push(gf(b))});z(a,this.N.w());return a};\nfunction kn(a){if(!a.apiKey)return null;var b={apiKey:a.apiKey,authDomain:a.authDomain,appName:a.appName,emulatorConfig:a.emulatorConfig},c={};if(a.stsTokenManager&&a.stsTokenManager.accessToken)c[zg]=a.stsTokenManager.accessToken,c.refreshToken=a.stsTokenManager.refreshToken||null;else return null;var d=new Dm(b,c,a);a.providerData&&w(a.providerData,function(e){e&&Um(d,ff(e))});a.redirectEventId&&(d.ga=a.redirectEventId);return d}\nfunction ln(a,b,c,d){var e=new Dm(a,b);c&&(e.ha=c);d&&Hm(e,d);return e.reload().then(function(){return e})}function mn(a,b,c,d){var e=a.b,f={};f[zg]=e.b&&e.b.toString();f.refreshToken=e.a;b=new Dm(b||{apiKey:a.l,authDomain:a.o,appName:a.m},f);c&&(b.ha=c);d&&Hm(b,d);Xm(b,a);return b};function nn(a){this.a=a;this.b=Qk()}var gn={name:\"redirectUser\",D:\"session\"};function hn(a){return Uk(a.b,gn,a.a)}function on(a,b){return a.b.get(gn,a.a).then(function(c){c&&b&&(c.authDomain=b);return kn(c||{})})};function pn(a){this.a=a;this.b=Qk();this.c=null;this.f=qn(this);this.b.addListener(rn(\"local\"),this.a,q(this.g,this))}pn.prototype.g=function(){var a=this,b=rn(\"local\");sn(this,function(){return D().then(function(){return a.c&&\"local\"!=a.c.D?a.b.get(b,a.a):null}).then(function(c){if(c)return tn(a,\"local\").then(function(){a.c=b})})})};function tn(a,b){var c=[],d;for(d in Mk)Mk[d]!==b&&c.push(Uk(a.b,rn(Mk[d]),a.a));c.push(Uk(a.b,un,a.a));return Ec(c)}\nfunction qn(a){var b=rn(\"local\"),c=rn(\"session\"),d=rn(\"none\");return Tk(a.b,b,a.a).then(function(){return a.b.get(c,a.a)}).then(function(e){return e?c:a.b.get(d,a.a).then(function(f){return f?d:a.b.get(b,a.a).then(function(g){return g?b:a.b.get(un,a.a).then(function(h){return h?rn(h):b})})})}).then(function(e){a.c=e;return tn(a,e.D)}).s(function(){a.c||(a.c=b)})}var un={name:\"persistence\",D:\"session\"};function rn(a){return{name:\"authUser\",D:a}}\npn.prototype.wb=function(a){var b=null,c=this;Nk(a);return sn(this,function(){return a!=c.c.D?c.b.get(c.c,c.a).then(function(d){b=d;return tn(c,a)}).then(function(){c.c=rn(a);if(b)return c.b.set(c.c,b,c.a)}):D()})};function vn(a){return sn(a,function(){return a.b.set(un,a.c.D,a.a)})}function wn(a,b){return sn(a,function(){return a.b.set(a.c,b.w(),a.a)})}function xn(a){return sn(a,function(){return Uk(a.b,a.c,a.a)})}\nfunction yn(a,b,c){return sn(a,function(){return a.b.get(a.c,a.a).then(function(d){d&&b&&(d.authDomain=b);d&&c&&(d.emulatorConfig=c);return kn(d||{})})})}function sn(a,b){a.f=a.f.then(b,b);return a.f};function zn(a){this.m=!1;M(this,\"settings\",new $l);M(this,\"app\",a);if(S(this).options&&S(this).options.apiKey)a=firebase.SDK_VERSION?Je(firebase.SDK_VERSION):null,this.a=new Ei(S(this).options&&S(this).options.apiKey,Aa(Ba),a);else throw new t(\"invalid-api-key\");this.R=[];this.u=[];this.P=[];this.ac=firebase.INTERNAL.createSubscribe(q(this.yc,this));this.X=void 0;this.bc=firebase.INTERNAL.createSubscribe(q(this.zc,this));An(this,null);this.l=new pn(S(this).options.apiKey+\":\"+S(this).name);this.G=\nnew nn(S(this).options.apiKey+\":\"+S(this).name);this.$=T(this,Bn(this));this.i=T(this,Cn(this));this.ba=!1;this.pa=q(this.Yc,this);this.Ba=q(this.da,this);this.ya=q(this.kc,this);this.za=q(this.vc,this);this.Aa=q(this.wc,this);this.b=null;Dn(this);this.INTERNAL={};this.INTERNAL[\"delete\"]=q(this.delete,this);this.INTERNAL.logFramework=q(this.Fc,this);this.A=0;H.call(this);En(this);this.N=[];this.f=null}r(zn,H);function Fn(a){F.call(this,\"languageCodeChanged\");this.h=a}r(Fn,F);\nfunction Gn(a){F.call(this,\"emulatorConfigChanged\");this.c=a}r(Gn,F);function Hn(a){F.call(this,\"frameworkChanged\");this.f=a}r(Hn,F);k=zn.prototype;k.wb=function(a){a=this.l.wb(a);return T(this,a)};k.wa=function(a){this.aa===a||this.m||(this.aa=a,Ki(this.a,this.aa),this.dispatchEvent(new Fn(this.ka())))};k.ka=function(){return this.aa};k.ed=function(){var a=l.navigator;this.wa(a?a.languages&&a.languages[0]||a.language||a.userLanguage||null:null)};\nk.fd=function(a){if(!this.f){if(!/^https?:\\/\\//.test(a))throw new t(\"argument-error\",\"Emulator URL must start with a valid scheme (http:// or https://).\");In();this.f={url:a};this.settings.hb=!0;Li(this.a,this.f);this.dispatchEvent(new Gn(this.f))}};\nfunction In(){Xe(\"WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials.\");l.document&&ze().then(function(){var a=l.document.createElement(\"div\");a.innerText=\"Running in emulator mode. Do not use with production credentials.\";a.style.position=\"fixed\";a.style.width=\"100%\";a.style.backgroundColor=\"#ffffff\";a.style.border=\".1em solid #000000\";a.style.color=\"#ff0000\";a.style.bottom=\"0px\";a.style.left=\"0px\";a.style.margin=\"0px\";a.style.zIndex=\n1E4;a.style.textAlign=\"center\";a.classList.add(\"firebase-emulator-warning\");l.document.body.appendChild(a)})}k.Fc=function(a){this.N.push(a);Ni(this.a,firebase.SDK_VERSION?Je(firebase.SDK_VERSION,this.N):null);this.dispatchEvent(new Hn(this.N))};k.Ga=function(){return Xa(this.N)};k.xb=function(a){this.W===a||this.m||(this.W=a,this.a.b=this.W)};k.S=function(){return this.W};\nfunction En(a){Object.defineProperty(a,\"lc\",{get:function(){return this.ka()},set:function(b){this.wa(b)},enumerable:!1});a.aa=null;Object.defineProperty(a,\"ti\",{get:function(){return this.S()},set:function(b){this.xb(b)},enumerable:!1});a.W=null}k.toJSON=function(){return{apiKey:S(this).options.apiKey,authDomain:S(this).options.authDomain,appName:S(this).name,currentUser:U(this)&&U(this).w()}};function Jn(a){return a.gb||E(new t(\"auth-domain-config-required\"))}\nfunction Dn(a){var b=S(a).options.authDomain,c=S(a).options.apiKey;b&&Me()&&(a.gb=a.$.then(function(){if(!a.m){a.b=Sl(b,c,S(a).name,a.f);Kl(a.b,a);U(a)&&Qm(U(a));if(a.o){Qm(a.o);var d=a.o;d.wa(a.ka());Im(d,a);d=a.o;Hm(d,a.N);Km(d,a);d=a.o;Li(d.a,a.f);Jm(d,a);a.o=null}return a.b}}))}k.Eb=function(a,b){switch(a){case \"unknown\":case \"signInViaRedirect\":return!0;case \"signInViaPopup\":return this.h==b&&!!this.g;default:return!1}};\nk.ma=function(a,b,c,d){\"signInViaPopup\"==a&&this.h==d&&(c&&this.O?this.O(c):b&&!c&&this.g&&this.g(b),this.c&&(this.c.cancel(),this.c=null),delete this.g,delete this.O)};k.Fa=function(a,b){return\"signInViaRedirect\"==a||\"signInViaPopup\"==a&&this.h==b&&this.g?q(this.hc,this):null};k.hc=function(a,b,c,d){var e=this,f={requestUri:a,postBody:d,sessionId:b,tenantId:c};this.c&&(this.c.cancel(),this.c=null);return e.$.then(function(){return Kn(e,Bg(e.a,f))})};\nk.Wc=function(a){if(!Me())return E(new t(\"operation-not-supported-in-this-environment\"));var b=this,c=jg(a.providerId),d=Le(),e=null;(!Oe()||De())&&S(this).options.authDomain&&a.isOAuthProvider&&(e=ak(S(this).options.authDomain,S(this).options.apiKey,S(this).name,\"signInViaPopup\",a,null,d,firebase.SDK_VERSION||null,null,null,this.S(),this.f));var f=ue(e,c&&c.ua,c&&c.ta);c=Jn(this).then(function(g){return Ol(g,f,\"signInViaPopup\",a,d,!!e,b.S())}).then(function(){return new C(function(g,h){b.ma(\"signInViaPopup\",\nnull,new t(\"cancelled-popup-request\"),b.h);b.g=g;b.O=h;b.h=d;b.c=Ql(b.b,b,\"signInViaPopup\",f,d)})}).then(function(g){f&&te(f);return g?ff(g):null}).s(function(g){f&&te(f);throw g;});return T(this,c)};k.Xc=function(a){if(!Me())return E(new t(\"operation-not-supported-in-this-environment\"));var b=this,c=Jn(this).then(function(){return vn(b.l)}).then(function(){return Pl(b.b,\"signInViaRedirect\",a,void 0,b.S())});return T(this,c)};\nfunction Ln(a){if(!Me())return E(new t(\"operation-not-supported-in-this-environment\"));var b=Jn(a).then(function(){return a.b.qa()}).then(function(c){return c?ff(c):null});return T(a,b)}k.qa=function(){var a=this;return Ln(this).then(function(b){a.b&&Vl(a.b.b);return b}).s(function(b){a.b&&Vl(a.b.b);throw b;})};\nk.cd=function(a){if(!a)return E(new t(\"null-user\"));if(this.W!=a.tenantId)return E(new t(\"tenant-id-mismatch\"));var b=this,c={};c.apiKey=S(this).options.apiKey;c.authDomain=S(this).options.authDomain;c.appName=S(this).name;var d=mn(a,c,b.G,b.Ga());return T(this,this.i.then(function(){if(S(b).options.apiKey!=a.l)return d.reload()}).then(function(){if(U(b)&&a.uid==U(b).uid)return Xm(U(b),a),b.da(a);An(b,d);Qm(d);return b.da(d)}).then(function(){Mn(b)}))};\nfunction Nn(a,b){var c={};c.apiKey=S(a).options.apiKey;c.authDomain=S(a).options.authDomain;c.appName=S(a).name;a.f&&(c.emulatorConfig=a.f);return a.$.then(function(){return ln(c,b,a.G,a.Ga())}).then(function(d){if(U(a)&&d.uid==U(a).uid)return Xm(U(a),d),a.da(d);An(a,d);Qm(d);return a.da(d)}).then(function(){Mn(a)})}\nfunction An(a,b){U(a)&&(Om(U(a),a.Ba),G(U(a),\"tokenChanged\",a.ya),G(U(a),\"userDeleted\",a.za),G(U(a),\"userInvalidated\",a.Aa),Nm(U(a)));b&&(b.R.push(a.Ba),jd(b,\"tokenChanged\",a.ya),jd(b,\"userDeleted\",a.za),jd(b,\"userInvalidated\",a.Aa),0<a.A&&Mm(b));M(a,\"currentUser\",b);b&&(b.wa(a.ka()),Im(b,a),Hm(b,a.N),Km(b,a),Li(b.a,a.f),Jm(b,a))}k.zb=function(){var a=this,b=this.i.then(function(){a.b&&Vl(a.b.b);if(!U(a))return D();An(a,null);return xn(a.l).then(function(){Mn(a)})});return T(this,b)};\nfunction On(a){var b=on(a.G,S(a).options.authDomain).then(function(c){if(a.o=c)c.ha=a.G;return hn(a.G)});return T(a,b)}function Bn(a){var b=S(a).options.authDomain,c=On(a).then(function(){return yn(a.l,b,a.f)}).then(function(d){return d?(d.ha=a.G,a.o&&(a.o.ga||null)==(d.ga||null)?d:d.reload().then(function(){return wn(a.l,d).then(function(){return d})}).s(function(e){return\"auth/network-request-failed\"==e.code?d:xn(a.l)})):null}).then(function(d){An(a,d||null)});return T(a,c)}\nfunction Cn(a){return a.$.then(function(){return Ln(a)}).s(function(){}).then(function(){if(!a.m)return a.pa()}).s(function(){}).then(function(){if(!a.m){a.ba=!0;var b=a.l;b.b.addListener(rn(\"local\"),b.a,a.pa)}})}\nk.Yc=function(){var a=this;return yn(this.l,S(this).options.authDomain).then(function(b){if(!a.m){var c;if(c=U(a)&&b){c=U(a).uid;var d=b.uid;c=void 0===c||null===c||\"\"===c||void 0===d||null===d||\"\"===d?!1:c==d}if(c)return Xm(U(a),b),U(a).I();if(U(a)||b)An(a,b),b&&(Qm(b),b.ha=a.G),a.b&&Kl(a.b,a),Mn(a)}})};k.da=function(a){return wn(this.l,a)};k.kc=function(){Mn(this);this.da(U(this))};k.vc=function(){this.zb()};k.wc=function(){this.zb()};\nfunction Kn(a,b){var c=null,d=null;return T(a,b.then(function(e){c=mh(e);d=kg(e);return Nn(a,e)},function(e){var f=null;e&&\"auth/multi-factor-auth-required\"===e.code&&(f=hm(e.w(),a,q(a.jc,a)));throw f||e;}).then(function(){return ff({user:U(a),credential:c,additionalUserInfo:d,operationType:\"signIn\"})}))}k.jc=function(a){var b=this;return this.i.then(function(){return Kn(b,D(a))})};k.yc=function(a){var b=this;this.addAuthTokenListener(function(){a.next(U(b))})};\nk.zc=function(a){var b=this;Pn(this,function(){a.next(U(b))})};k.Hc=function(a,b,c){var d=this;this.ba&&Promise.resolve().then(function(){\"function\"===typeof a?a(U(d)):\"function\"===typeof a.next&&a.next(U(d))});return this.ac(a,b,c)};k.Gc=function(a,b,c){var d=this;this.ba&&Promise.resolve().then(function(){d.X=d.getUid();\"function\"===typeof a?a(U(d)):\"function\"===typeof a.next&&a.next(U(d))});return this.bc(a,b,c)};\nk.mc=function(a){var b=this,c=this.i.then(function(){return U(b)?U(b).I(a).then(function(d){return{accessToken:d}}):null});return T(this,c)};k.Sc=function(a){var b=this;return this.i.then(function(){return Kn(b,O(b.a,Gj,{token:a}))}).then(function(c){var d=c.user;Wm(d,\"isAnonymous\",!1);b.da(d);return c})};k.Tc=function(a,b){var c=this;return this.i.then(function(){return Kn(c,O(c.a,Xg,{email:a,password:b}))})};\nk.dc=function(a,b){var c=this;return this.i.then(function(){return Kn(c,O(c.a,Aj,{email:a,password:b}))})};k.Za=function(a){var b=this;return this.i.then(function(){return Kn(b,a.ja(b.a))})};k.Rc=function(a){cf(\"firebase.auth.Auth.prototype.signInAndRetrieveDataWithCredential is deprecated. Please use firebase.auth.Auth.prototype.signInWithCredential instead.\");return this.Za(a)};\nk.yb=function(){var a=this;return this.i.then(function(){var b=U(a);if(b&&b.isAnonymous){var c=ff({providerId:null,isNewUser:!1});return ff({user:b,credential:null,additionalUserInfo:c,operationType:\"signIn\"})}return Kn(a,a.a.yb()).then(function(d){var e=d.user;Wm(e,\"isAnonymous\",!0);a.da(e);return d})})};function S(a){return a.app}function U(a){return a.currentUser}k.getUid=function(){return U(this)&&U(this).uid||null};function Qn(a){return U(a)&&U(a)._lat||null}\nfunction Mn(a){if(a.ba){for(var b=0;b<a.u.length;b++)if(a.u[b])a.u[b](Qn(a));if(a.X!==a.getUid()&&a.P.length)for(a.X=a.getUid(),b=0;b<a.P.length;b++)if(a.P[b])a.P[b](Qn(a))}}k.cc=function(a){this.addAuthTokenListener(a);this.A++;0<this.A&&U(this)&&Mm(U(this))};k.Oc=function(a){var b=this;w(this.u,function(c){c==a&&b.A--});0>this.A&&(this.A=0);0==this.A&&U(this)&&Nm(U(this));this.removeAuthTokenListener(a)};\nk.addAuthTokenListener=function(a){var b=this;this.u.push(a);T(this,this.i.then(function(){b.m||Ta(b.u,a)&&a(Qn(b))}))};k.removeAuthTokenListener=function(a){Va(this.u,function(b){return b==a})};function Pn(a,b){a.P.push(b);T(a,a.i.then(function(){!a.m&&Ta(a.P,b)&&a.X!==a.getUid()&&(a.X=a.getUid(),b(Qn(a)))}))}\nk.delete=function(){this.m=!0;for(var a=0;a<this.R.length;a++)this.R[a].cancel(\"app-deleted\");this.R=[];this.l&&(a=this.l,a.b.removeListener(rn(\"local\"),a.a,this.pa));this.b&&(Ll(this.b,this),Vl(this.b.b));return Promise.resolve()};function T(a,b){a.R.push(b);b.na(function(){Ua(a.R,b)});return b}k.gc=function(a){return T(this,Xi(this.a,a))};k.Ac=function(a){return!!bh(a)};\nk.vb=function(a,b){var c=this;return T(this,D().then(function(){var d=new Of(b);if(!d.c)throw new t(\"argument-error\",Wf+\" must be true when sending sign in link to email\");return Yf(d)}).then(function(d){return c.a.vb(a,d)}).then(function(){}))};k.hd=function(a){return this.Qa(a).then(function(b){return b.data.email})};k.mb=function(a,b){return T(this,this.a.mb(a,b).then(function(){}))};k.Qa=function(a){return T(this,this.a.Qa(a).then(function(b){return new rf(b)}))};\nk.ib=function(a){return T(this,this.a.ib(a).then(function(){}))};k.ub=function(a,b){var c=this;return T(this,D().then(function(){return\"undefined\"===typeof b||kb(b)?{}:Yf(new Of(b))}).then(function(d){return c.a.ub(a,d)}).then(function(){}))};k.Vc=function(a,b){return T(this,bm(this,a,b,q(this.Za,this)))};\nk.Uc=function(a,b){var c=this;return T(this,D().then(function(){var d=b||me(),e=ah(a,d);d=bh(d);if(!d)throw new t(\"argument-error\",\"Invalid email link!\");if(d.tenantId!==c.S())throw new t(\"tenant-id-mismatch\");return c.Za(e)}))};function Rn(){}Rn.prototype.render=function(){};Rn.prototype.reset=function(){};Rn.prototype.getResponse=function(){};Rn.prototype.execute=function(){};function Sn(){this.a={};this.b=1E12}var Tn=null;Sn.prototype.render=function(a,b){this.a[this.b.toString()]=new Un(a,b);return this.b++};Sn.prototype.reset=function(a){var b=Vn(this,a);a=Wn(a);b&&a&&(b.delete(),delete this.a[a])};Sn.prototype.getResponse=function(a){return(a=Vn(this,a))?a.getResponse():null};Sn.prototype.execute=function(a){(a=Vn(this,a))&&a.execute()};function Vn(a,b){return(b=Wn(b))?a.a[b]||null:null}function Wn(a){return(a=\"undefined\"===typeof a?1E12:a)?a.toString():null}\nfunction Un(a,b){this.g=!1;this.c=b;this.a=this.b=null;this.h=\"invisible\"!==this.c.size;this.f=fc(a);var c=this;this.i=function(){c.execute()};this.h?this.execute():jd(this.f,\"click\",this.i)}Un.prototype.getResponse=function(){Xn(this);return this.b};\nUn.prototype.execute=function(){Xn(this);var a=this;this.a||(this.a=setTimeout(function(){a.b=He();var b=a.c.callback,c=a.c[\"expired-callback\"];if(b)try{b(a.b)}catch(d){}a.a=setTimeout(function(){a.a=null;a.b=null;if(c)try{c()}catch(d){}a.h&&a.execute()},6E4)},500))};Un.prototype.delete=function(){Xn(this);this.g=!0;clearTimeout(this.a);this.a=null;G(this.f,\"click\",this.i)};function Xn(a){if(a.g)throw Error(\"reCAPTCHA mock was already deleted!\");};function Yn(){}M(Yn,\"FACTOR_ID\",\"phone\");function Zn(){}Zn.prototype.g=function(){Tn||(Tn=new Sn);return D(Tn)};Zn.prototype.c=function(){};var $n=null;function ao(){this.b=l.grecaptcha?Infinity:0;this.f=null;this.a=\"__rcb\"+Math.floor(1E6*Math.random()).toString()}var bo=new ob(pb,\"https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}\"),co=new Ue(3E4,6E4);\nao.prototype.g=function(a){var b=this;return new C(function(c,d){var e=setTimeout(function(){d(new t(\"network-request-failed\"))},co.get());if(!l.grecaptcha||a!==b.f&&!b.b){l[b.a]=function(){if(l.grecaptcha){b.f=a;var g=l.grecaptcha.render;l.grecaptcha.render=function(h,m){h=g(h,m);b.b++;return h};clearTimeout(e);c(l.grecaptcha)}else clearTimeout(e),d(new t(\"internal-error\"));delete l[b.a]};var f=xb(bo,{onload:b.a,hl:a||\"\"});D(xi(f)).s(function(){clearTimeout(e);d(new t(\"internal-error\",\"Unable to load external reCAPTCHA dependencies!\"))})}else clearTimeout(e),\nc(l.grecaptcha)})};ao.prototype.c=function(){this.b--};var eo=null;function fo(a,b,c,d,e,f,g){M(this,\"type\",\"recaptcha\");this.c=this.f=null;this.A=!1;this.m=b;this.g=null;g?($n||($n=new Zn),g=$n):(eo||(eo=new ao),g=eo);this.v=g;this.a=c||{theme:\"light\",type:\"image\"};this.h=[];if(this.a[go])throw new t(\"argument-error\",\"sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.\");this.i=\"invisible\"===this.a[ho];if(!l.document)throw new t(\"operation-not-supported-in-this-environment\",\"RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.\");\nif(!fc(b)||!this.i&&fc(b).hasChildNodes())throw new t(\"argument-error\",\"reCAPTCHA container is either not found or already contains inner elements!\");this.o=new Ei(a,f||null,e||null);this.u=d||function(){return null};var h=this;this.l=[];var m=this.a[io];this.a[io]=function(v){jo(h,v);if(\"function\"===typeof m)m(v);else if(\"string\"===typeof m){var B=L(m,l);\"function\"===typeof B&&B(v)}};var p=this.a[ko];this.a[ko]=function(){jo(h,null);if(\"function\"===typeof p)p();else if(\"string\"===typeof p){var v=\nL(p,l);\"function\"===typeof v&&v()}}}var io=\"callback\",ko=\"expired-callback\",go=\"sitekey\",ho=\"size\";function jo(a,b){for(var c=0;c<a.l.length;c++)try{a.l[c](b)}catch(d){}}function lo(a,b){Va(a.l,function(c){return c==b})}function mo(a,b){a.h.push(b);b.na(function(){Ua(a.h,b)});return b}k=fo.prototype;\nk.Ia=function(){var a=this;return this.f?this.f:this.f=mo(this,D().then(function(){if(Ne()&&!Ee())return ze();throw new t(\"operation-not-supported-in-this-environment\",\"RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.\");}).then(function(){return a.v.g(a.u())}).then(function(b){a.g=b;return O(a.o,Fj,{})}).then(function(b){a.a[go]=b.recaptchaSiteKey}).s(function(b){a.f=null;throw b;}))};\nk.render=function(){no(this);var a=this;return mo(this,this.Ia().then(function(){if(null===a.c){var b=a.m;if(!a.i){var c=fc(b);b=ic(\"DIV\");c.appendChild(b)}a.c=a.g.render(b,a.a)}return a.c}))};k.verify=function(){no(this);var a=this;return mo(this,this.render().then(function(b){return new C(function(c){var d=a.g.getResponse(b);if(d)c(d);else{var e=function(f){f&&(lo(a,e),c(f))};a.l.push(e);a.i&&a.g.execute(a.c)}})}))};k.reset=function(){no(this);null!==this.c&&this.g.reset(this.c)};\nfunction no(a){if(a.A)throw new t(\"internal-error\",\"RecaptchaVerifier instance has been destroyed.\");}k.clear=function(){no(this);this.A=!0;this.v.c();for(var a=0;a<this.h.length;a++)this.h[a].cancel(\"RecaptchaVerifier instance has been destroyed.\");if(!this.i){a=fc(this.m);for(var b;b=a.firstChild;)a.removeChild(b)}};\nfunction oo(a,b,c){var d=!1;try{this.b=c||firebase.app()}catch(g){throw new t(\"argument-error\",\"No firebase.app.App instance is currently initialized.\");}if(this.b.options&&this.b.options.apiKey)c=this.b.options.apiKey;else throw new t(\"invalid-api-key\");var e=this,f=null;try{f=this.b.auth().Ga()}catch(g){}try{d=this.b.auth().settings.appVerificationDisabledForTesting}catch(g){}f=firebase.SDK_VERSION?Je(firebase.SDK_VERSION,f):null;fo.call(this,c,a,b,function(){try{var g=e.b.auth().ka()}catch(h){g=\nnull}return g},f,Aa(Ba),d)}r(oo,fo);function po(a,b,c,d){a:{c=Array.prototype.slice.call(c);var e=0;for(var f=!1,g=0;g<b.length;g++)if(b[g].optional)f=!0;else{if(f)throw new t(\"internal-error\",\"Argument validator encountered a required argument after an optional argument.\");e++}f=b.length;if(c.length<e||f<c.length)d=\"Expected \"+(e==f?1==e?\"1 argument\":e+\" arguments\":e+\"-\"+f+\" arguments\")+\" but got \"+c.length+\".\";else{for(e=0;e<c.length;e++)if(f=b[e].optional&&void 0===c[e],!b[e].K(c[e])&&!f){b=b[e];if(0>e||e>=qo.length)throw new t(\"internal-error\",\n\"Argument validator received an unsupported number of arguments.\");c=qo[e];d=(d?\"\":c+\" argument \")+(b.name?'\"'+b.name+'\" ':\"\")+\"must be \"+b.J+\".\";break a}d=null}}if(d)throw new t(\"argument-error\",a+\" failed: \"+d);}var qo=\"First Second Third Fourth Fifth Sixth Seventh Eighth Ninth\".split(\" \");function V(a,b){return{name:a||\"\",J:\"a valid string\",optional:!!b,K:function(c){return\"string\"===typeof c}}}\nfunction ro(a,b){return{name:a||\"\",J:\"a boolean\",optional:!!b,K:function(c){return\"boolean\"===typeof c}}}function W(a,b){return{name:a||\"\",J:\"a valid object\",optional:!!b,K:n}}function so(a,b){return{name:a||\"\",J:\"a function\",optional:!!b,K:function(c){return\"function\"===typeof c}}}function to(a,b){return{name:a||\"\",J:\"null\",optional:!!b,K:function(c){return null===c}}}function uo(){return{name:\"\",J:\"an HTML element\",optional:!1,K:function(a){return!!(a&&a instanceof Element)}}}\nfunction vo(){return{name:\"auth\",J:\"an instance of Firebase Auth\",optional:!0,K:function(a){return!!(a&&a instanceof zn)}}}function wo(){return{name:\"app\",J:\"an instance of Firebase App\",optional:!0,K:function(a){return!!(a&&a instanceof firebase.app.App)}}}function xo(a){return{name:a?a+\"Credential\":\"credential\",J:a?\"a valid \"+a+\" credential\":\"a valid credential\",optional:!1,K:function(b){if(!b)return!1;var c=!a||b.providerId===a;return!(!b.ja||!c)}}}\nfunction yo(){return{name:\"multiFactorAssertion\",J:\"a valid multiFactorAssertion\",optional:!1,K:function(a){return a?!!a.rb:!1}}}function zo(){return{name:\"authProvider\",J:\"a valid Auth provider\",optional:!1,K:function(a){return!!(a&&a.providerId&&a.hasOwnProperty&&a.hasOwnProperty(\"isOAuthProvider\"))}}}function Ao(a,b){return n(a)&&\"string\"===typeof a.type&&a.type===b&&\"function\"===typeof a.Ha}function Bo(a){return n(a)&&\"string\"===typeof a.uid}\nfunction Co(){return{name:\"applicationVerifier\",J:\"an implementation of firebase.auth.ApplicationVerifier\",optional:!1,K:function(a){return!(!a||\"string\"!==typeof a.type||\"function\"!==typeof a.verify)}}}function X(a,b,c,d){return{name:c||\"\",J:a.J+\" or \"+b.J,optional:!!d,K:function(e){return a.K(e)||b.K(e)}}};function Y(a,b){for(var c in b){var d=b[c].name;a[d]=Do(d,a[c],b[c].j)}}function Eo(a,b){for(var c in b){var d=b[c].name;d!==c&&Object.defineProperty(a,d,{get:ta(function(e){return this[e]},c),set:ta(function(e,f,g,h){po(e,[g],[h],!0);this[f]=h},d,c,b[c].jb),enumerable:!0})}}function Z(a,b,c,d){a[b]=Do(b,c,d)}\nfunction Do(a,b,c){function d(){var g=Array.prototype.slice.call(arguments);po(e,c,g);return b.apply(this,g)}if(!c)return b;var e=Fo(a),f;for(f in b)d[f]=b[f];for(f in b.prototype)d.prototype[f]=b.prototype[f];return d}function Fo(a){a=a.split(\".\");return a[a.length-1]};Y(zn.prototype,{ib:{name:\"applyActionCode\",j:[V(\"code\")]},Qa:{name:\"checkActionCode\",j:[V(\"code\")]},mb:{name:\"confirmPasswordReset\",j:[V(\"code\"),V(\"newPassword\")]},dc:{name:\"createUserWithEmailAndPassword\",j:[V(\"email\"),V(\"password\")]},gc:{name:\"fetchSignInMethodsForEmail\",j:[V(\"email\")]},qa:{name:\"getRedirectResult\",j:[]},Ac:{name:\"isSignInWithEmailLink\",j:[V(\"emailLink\")]},Gc:{name:\"onAuthStateChanged\",j:[X(W(),so(),\"nextOrObserver\"),so(\"opt_error\",!0),so(\"opt_completed\",!0)]},Hc:{name:\"onIdTokenChanged\",\nj:[X(W(),so(),\"nextOrObserver\"),so(\"opt_error\",!0),so(\"opt_completed\",!0)]},ub:{name:\"sendPasswordResetEmail\",j:[V(\"email\"),X(W(\"opt_actionCodeSettings\",!0),to(null,!0),\"opt_actionCodeSettings\",!0)]},vb:{name:\"sendSignInLinkToEmail\",j:[V(\"email\"),W(\"actionCodeSettings\")]},wb:{name:\"setPersistence\",j:[V(\"persistence\")]},Rc:{name:\"signInAndRetrieveDataWithCredential\",j:[xo()]},yb:{name:\"signInAnonymously\",j:[]},Za:{name:\"signInWithCredential\",j:[xo()]},Sc:{name:\"signInWithCustomToken\",j:[V(\"token\")]},\nTc:{name:\"signInWithEmailAndPassword\",j:[V(\"email\"),V(\"password\")]},Uc:{name:\"signInWithEmailLink\",j:[V(\"email\"),V(\"emailLink\",!0)]},Vc:{name:\"signInWithPhoneNumber\",j:[V(\"phoneNumber\"),Co()]},Wc:{name:\"signInWithPopup\",j:[zo()]},Xc:{name:\"signInWithRedirect\",j:[zo()]},cd:{name:\"updateCurrentUser\",j:[X(function(a){return{name:\"user\",J:\"an instance of Firebase User\",optional:!!a,K:function(b){return!!(b&&b instanceof Dm)}}}(),to(),\"user\")]},zb:{name:\"signOut\",j:[]},toJSON:{name:\"toJSON\",j:[V(null,\n!0)]},ed:{name:\"useDeviceLanguage\",j:[]},fd:{name:\"useEmulator\",j:[V(\"url\")]},hd:{name:\"verifyPasswordResetCode\",j:[V(\"code\")]}});Eo(zn.prototype,{lc:{name:\"languageCode\",jb:X(V(),to(),\"languageCode\")},ti:{name:\"tenantId\",jb:X(V(),to(),\"tenantId\")}});zn.Persistence=Mk;zn.Persistence.LOCAL=\"local\";zn.Persistence.SESSION=\"session\";zn.Persistence.NONE=\"none\";\nY(Dm.prototype,{\"delete\":{name:\"delete\",j:[]},nc:{name:\"getIdTokenResult\",j:[ro(\"opt_forceRefresh\",!0)]},I:{name:\"getIdToken\",j:[ro(\"opt_forceRefresh\",!0)]},Bc:{name:\"linkAndRetrieveDataWithCredential\",j:[xo()]},pb:{name:\"linkWithCredential\",j:[xo()]},Cc:{name:\"linkWithPhoneNumber\",j:[V(\"phoneNumber\"),Co()]},Dc:{name:\"linkWithPopup\",j:[zo()]},Ec:{name:\"linkWithRedirect\",j:[zo()]},Kc:{name:\"reauthenticateAndRetrieveDataWithCredential\",j:[xo()]},sb:{name:\"reauthenticateWithCredential\",j:[xo()]},Lc:{name:\"reauthenticateWithPhoneNumber\",\nj:[V(\"phoneNumber\"),Co()]},Mc:{name:\"reauthenticateWithPopup\",j:[zo()]},Nc:{name:\"reauthenticateWithRedirect\",j:[zo()]},reload:{name:\"reload\",j:[]},tb:{name:\"sendEmailVerification\",j:[X(W(\"opt_actionCodeSettings\",!0),to(null,!0),\"opt_actionCodeSettings\",!0)]},toJSON:{name:\"toJSON\",j:[V(null,!0)]},bd:{name:\"unlink\",j:[V(\"provider\")]},Ab:{name:\"updateEmail\",j:[V(\"email\")]},Bb:{name:\"updatePassword\",j:[V(\"password\")]},dd:{name:\"updatePhoneNumber\",j:[xo(\"phone\")]},Cb:{name:\"updateProfile\",j:[W(\"profile\")]},\nDb:{name:\"verifyBeforeUpdateEmail\",j:[V(\"email\"),X(W(\"opt_actionCodeSettings\",!0),to(null,!0),\"opt_actionCodeSettings\",!0)]}});Y(Sn.prototype,{execute:{name:\"execute\"},render:{name:\"render\"},reset:{name:\"reset\"},getResponse:{name:\"getResponse\"}});Y(Rn.prototype,{execute:{name:\"execute\"},render:{name:\"render\"},reset:{name:\"reset\"},getResponse:{name:\"getResponse\"}});Y(C.prototype,{na:{name:\"finally\"},s:{name:\"catch\"},then:{name:\"then\"}});\nEo($l.prototype,{appVerificationDisabled:{name:\"appVerificationDisabledForTesting\",jb:ro(\"appVerificationDisabledForTesting\")}});Y(am.prototype,{confirm:{name:\"confirm\",j:[V(\"verificationCode\")]}});Z(xg,\"fromJSON\",function(a){a=\"string\"===typeof a?JSON.parse(a):a;for(var b,c=[Ig,$g,gh,Fg],d=0;d<c.length;d++)if(b=c[d](a))return b;return null},[X(V(),W(),\"json\")]);Z(Vg,\"credential\",function(a,b){return new Ug(a,b)},[V(\"email\"),V(\"password\")]);Y(Ug.prototype,{w:{name:\"toJSON\",j:[V(null,!0)]}});\nY(Mg.prototype,{Ca:{name:\"addScope\",j:[V(\"scope\")]},Ka:{name:\"setCustomParameters\",j:[W(\"customOAuthParameters\")]}});Z(Mg,\"credential\",Ng,[X(V(),W(),\"token\")]);Z(Vg,\"credentialWithLink\",ah,[V(\"email\"),V(\"emailLink\")]);Y(Og.prototype,{Ca:{name:\"addScope\",j:[V(\"scope\")]},Ka:{name:\"setCustomParameters\",j:[W(\"customOAuthParameters\")]}});Z(Og,\"credential\",Pg,[X(V(),W(),\"token\")]);Y(Qg.prototype,{Ca:{name:\"addScope\",j:[V(\"scope\")]},Ka:{name:\"setCustomParameters\",j:[W(\"customOAuthParameters\")]}});\nZ(Qg,\"credential\",Rg,[X(V(),X(W(),to()),\"idToken\"),X(V(),to(),\"accessToken\",!0)]);Y(Sg.prototype,{Ka:{name:\"setCustomParameters\",j:[W(\"customOAuthParameters\")]}});Z(Sg,\"credential\",Tg,[X(V(),W(),\"token\"),V(\"secret\",!0)]);Y(Lg.prototype,{Ca:{name:\"addScope\",j:[V(\"scope\")]},credential:{name:\"credential\",j:[X(V(),X(W(),to()),\"optionsOrIdToken\"),X(V(),to(),\"accessToken\",!0)]},Ka:{name:\"setCustomParameters\",j:[W(\"customOAuthParameters\")]}});Y(Gg.prototype,{w:{name:\"toJSON\",j:[V(null,!0)]}});\nY(Ag.prototype,{w:{name:\"toJSON\",j:[V(null,!0)]}});Z(hh,\"credential\",lh,[V(\"verificationId\"),V(\"verificationCode\")]);\nY(hh.prototype,{eb:{name:\"verifyPhoneNumber\",j:[X(V(),function(a,b){return{name:a||\"phoneInfoOptions\",J:\"valid phone info options\",optional:!!b,K:function(c){return c?c.session&&c.phoneNumber?Ao(c.session,vg)&&\"string\"===typeof c.phoneNumber:c.session&&c.multiFactorHint?Ao(c.session,wg)&&Bo(c.multiFactorHint):c.session&&c.multiFactorUid?Ao(c.session,wg)&&\"string\"===typeof c.multiFactorUid:c.phoneNumber?\"string\"===typeof c.phoneNumber:!1:!1}}}(),\"phoneInfoOptions\"),Co()]}});\nY(ch.prototype,{w:{name:\"toJSON\",j:[V(null,!0)]}});Y(t.prototype,{toJSON:{name:\"toJSON\",j:[V(null,!0)]}});Y(uh.prototype,{toJSON:{name:\"toJSON\",j:[V(null,!0)]}});Y(th.prototype,{toJSON:{name:\"toJSON\",j:[V(null,!0)]}});Y(gm.prototype,{toJSON:{name:\"toJSON\",j:[V(null,!0)]}});Y(dm.prototype,{Qc:{name:\"resolveSignIn\",j:[yo()]}});\nY(om.prototype,{Qb:{name:\"getSession\",j:[]},ec:{name:\"enroll\",j:[yo(),V(\"displayName\",!0)]},ad:{name:\"unenroll\",j:[X({name:\"multiFactorInfo\",J:\"a valid multiFactorInfo\",optional:!1,K:Bo},V(),\"multiFactorInfoIdentifier\")]}});Y(oo.prototype,{clear:{name:\"clear\",j:[]},render:{name:\"render\",j:[]},verify:{name:\"verify\",j:[]}});Z(Ff,\"parseLink\",Nf,[V(\"link\")]);Z(Yn,\"assertion\",function(a){return new mm(a)},[xo(\"phone\")]);\n(function(){if(\"undefined\"!==typeof firebase&&firebase.INTERNAL&&firebase.INTERNAL.registerComponent){var a={ActionCodeInfo:{Operation:{EMAIL_SIGNIN:wf,PASSWORD_RESET:\"PASSWORD_RESET\",RECOVER_EMAIL:\"RECOVER_EMAIL\",REVERT_SECOND_FACTOR_ADDITION:yf,VERIFY_AND_CHANGE_EMAIL:xf,VERIFY_EMAIL:\"VERIFY_EMAIL\"}},Auth:zn,AuthCredential:xg,Error:t};Z(a,\"EmailAuthProvider\",Vg,[]);Z(a,\"FacebookAuthProvider\",Mg,[]);Z(a,\"GithubAuthProvider\",Og,[]);Z(a,\"GoogleAuthProvider\",Qg,[]);Z(a,\"TwitterAuthProvider\",Sg,[]);\nZ(a,\"OAuthProvider\",Lg,[V(\"providerId\")]);Z(a,\"SAMLAuthProvider\",Kg,[V(\"providerId\")]);Z(a,\"PhoneAuthProvider\",hh,[vo()]);Z(a,\"RecaptchaVerifier\",oo,[X(V(),uo(),\"recaptchaContainer\"),W(\"recaptchaParameters\",!0),wo()]);Z(a,\"ActionCodeURL\",Ff,[]);Z(a,\"PhoneMultiFactorGenerator\",Yn,[]);firebase.INTERNAL.registerComponent({name:\"auth\",instanceFactory:function(b){b=b.getProvider(\"app\").getImmediate();return new zn(b)},multipleInstances:!1,serviceProps:a,instantiationMode:\"LAZY\",type:\"PUBLIC\"});firebase.INTERNAL.registerComponent({name:\"auth-internal\",\ninstanceFactory:function(b){b=b.getProvider(\"auth\").getImmediate();return{getUid:q(b.getUid,b),getToken:q(b.mc,b),addAuthTokenListener:q(b.cc,b),removeAuthTokenListener:q(b.Oc,b)}},multipleInstances:!1,instantiationMode:\"LAZY\",type:\"PRIVATE\"});firebase.registerVersion(\"@firebase/auth\",\"0.15.1\");firebase.INTERNAL.extendNamespace({User:Dm})}else throw Error(\"Cannot find the firebase namespace; be sure to include firebase-app.js before this library.\");})();}).apply(typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : {});\n\n//# sourceMappingURL=auth.esm.js.map\n","import { __assign, __values, __read, __awaiter, __generator, __spread } from 'tslib';\nimport { Deferred } from '@firebase/util';\n\n/**\r\n * Component for service name T, e.g. `auth`, `auth-internal`\r\n */\r\nvar Component = /** @class */ (function () {\r\n /**\r\n *\r\n * @param name The public service name, e.g. app, auth, firestore, database\r\n * @param instanceFactory Service factory responsible for creating the public interface\r\n * @param type whether the service provided by the component is public or private\r\n */\r\n function Component(name, instanceFactory, type) {\r\n this.name = name;\r\n this.instanceFactory = instanceFactory;\r\n this.type = type;\r\n this.multipleInstances = false;\r\n /**\r\n * Properties to be added to the service namespace\r\n */\r\n this.serviceProps = {};\r\n this.instantiationMode = \"LAZY\" /* LAZY */;\r\n }\r\n Component.prototype.setInstantiationMode = function (mode) {\r\n this.instantiationMode = mode;\r\n return this;\r\n };\r\n Component.prototype.setMultipleInstances = function (multipleInstances) {\r\n this.multipleInstances = multipleInstances;\r\n return this;\r\n };\r\n Component.prototype.setServiceProps = function (props) {\r\n this.serviceProps = props;\r\n return this;\r\n };\r\n return Component;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DEFAULT_ENTRY_NAME = '[DEFAULT]';\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Provider for instance for service name T, e.g. 'auth', 'auth-internal'\r\n * NameServiceMapping[T] is an alias for the type of the instance\r\n */\r\nvar Provider = /** @class */ (function () {\r\n function Provider(name, container) {\r\n this.name = name;\r\n this.container = container;\r\n this.component = null;\r\n this.instances = new Map();\r\n this.instancesDeferred = new Map();\r\n }\r\n /**\r\n * @param identifier A provider can provide mulitple instances of a service\r\n * if this.component.multipleInstances is true.\r\n */\r\n Provider.prototype.get = function (identifier) {\r\n if (identifier === void 0) { identifier = DEFAULT_ENTRY_NAME; }\r\n // if multipleInstances is not supported, use the default name\r\n var normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\r\n if (!this.instancesDeferred.has(normalizedIdentifier)) {\r\n var deferred = new Deferred();\r\n this.instancesDeferred.set(normalizedIdentifier, deferred);\r\n // If the service instance is available, resolve the promise with it immediately\r\n try {\r\n var instance = this.getOrInitializeService(normalizedIdentifier);\r\n if (instance) {\r\n deferred.resolve(instance);\r\n }\r\n }\r\n catch (e) {\r\n // when the instance factory throws an exception during get(), it should not cause\r\n // a fatal error. We just return the unresolved promise in this case.\r\n }\r\n }\r\n return this.instancesDeferred.get(normalizedIdentifier).promise;\r\n };\r\n Provider.prototype.getImmediate = function (options) {\r\n var _a = __assign({ identifier: DEFAULT_ENTRY_NAME, optional: false }, options), identifier = _a.identifier, optional = _a.optional;\r\n // if multipleInstances is not supported, use the default name\r\n var normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\r\n try {\r\n var instance = this.getOrInitializeService(normalizedIdentifier);\r\n if (!instance) {\r\n if (optional) {\r\n return null;\r\n }\r\n throw Error(\"Service \" + this.name + \" is not available\");\r\n }\r\n return instance;\r\n }\r\n catch (e) {\r\n if (optional) {\r\n return null;\r\n }\r\n else {\r\n throw e;\r\n }\r\n }\r\n };\r\n Provider.prototype.getComponent = function () {\r\n return this.component;\r\n };\r\n Provider.prototype.setComponent = function (component) {\r\n var e_1, _a;\r\n if (component.name !== this.name) {\r\n throw Error(\"Mismatching Component \" + component.name + \" for Provider \" + this.name + \".\");\r\n }\r\n if (this.component) {\r\n throw Error(\"Component for \" + this.name + \" has already been provided\");\r\n }\r\n this.component = component;\r\n // if the service is eager, initialize the default instance\r\n if (isComponentEager(component)) {\r\n try {\r\n this.getOrInitializeService(DEFAULT_ENTRY_NAME);\r\n }\r\n catch (e) {\r\n // when the instance factory for an eager Component throws an exception during the eager\r\n // initialization, it should not cause a fatal error.\r\n // TODO: Investigate if we need to make it configurable, because some component may want to cause\r\n // a fatal error in this case?\r\n }\r\n }\r\n try {\r\n // Create service instances for the pending promises and resolve them\r\n // NOTE: if this.multipleInstances is false, only the default instance will be created\r\n // and all promises with resolve with it regardless of the identifier.\r\n for (var _b = __values(this.instancesDeferred.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var _d = __read(_c.value, 2), instanceIdentifier = _d[0], instanceDeferred = _d[1];\r\n var normalizedIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\r\n try {\r\n // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy.\r\n var instance = this.getOrInitializeService(normalizedIdentifier);\r\n instanceDeferred.resolve(instance);\r\n }\r\n catch (e) {\r\n // when the instance factory throws an exception, it should not cause\r\n // a fatal error. We just leave the promise unresolved.\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n };\r\n Provider.prototype.clearInstance = function (identifier) {\r\n if (identifier === void 0) { identifier = DEFAULT_ENTRY_NAME; }\r\n this.instancesDeferred.delete(identifier);\r\n this.instances.delete(identifier);\r\n };\r\n // app.delete() will call this method on every provider to delete the services\r\n // TODO: should we mark the provider as deleted?\r\n Provider.prototype.delete = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var services;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n services = Array.from(this.instances.values());\r\n return [4 /*yield*/, Promise.all(__spread(services\r\n .filter(function (service) { return 'INTERNAL' in service; }) // legacy services\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map(function (service) { return service.INTERNAL.delete(); }), services\r\n .filter(function (service) { return '_delete' in service; }) // modularized services\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map(function (service) { return service._delete(); })))];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n Provider.prototype.isComponentSet = function () {\r\n return this.component != null;\r\n };\r\n Provider.prototype.getOrInitializeService = function (identifier) {\r\n var instance = this.instances.get(identifier);\r\n if (!instance && this.component) {\r\n instance = this.component.instanceFactory(this.container, normalizeIdentifierForFactory(identifier));\r\n this.instances.set(identifier, instance);\r\n }\r\n return instance || null;\r\n };\r\n Provider.prototype.normalizeInstanceIdentifier = function (identifier) {\r\n if (this.component) {\r\n return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME;\r\n }\r\n else {\r\n return identifier; // assume multiple instances are supported before the component is provided.\r\n }\r\n };\r\n return Provider;\r\n}());\r\n// undefined should be passed to the service factory for the default instance\r\nfunction normalizeIdentifierForFactory(identifier) {\r\n return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier;\r\n}\r\nfunction isComponentEager(component) {\r\n return component.instantiationMode === \"EAGER\" /* EAGER */;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`\r\n */\r\nvar ComponentContainer = /** @class */ (function () {\r\n function ComponentContainer(name) {\r\n this.name = name;\r\n this.providers = new Map();\r\n }\r\n /**\r\n *\r\n * @param component Component being added\r\n * @param overwrite When a component with the same name has already been registered,\r\n * if overwrite is true: overwrite the existing component with the new component and create a new\r\n * provider with the new component. It can be useful in tests where you want to use different mocks\r\n * for different tests.\r\n * if overwrite is false: throw an exception\r\n */\r\n ComponentContainer.prototype.addComponent = function (component) {\r\n var provider = this.getProvider(component.name);\r\n if (provider.isComponentSet()) {\r\n throw new Error(\"Component \" + component.name + \" has already been registered with \" + this.name);\r\n }\r\n provider.setComponent(component);\r\n };\r\n ComponentContainer.prototype.addOrOverwriteComponent = function (component) {\r\n var provider = this.getProvider(component.name);\r\n if (provider.isComponentSet()) {\r\n // delete the existing provider from the container, so we can register the new component\r\n this.providers.delete(component.name);\r\n }\r\n this.addComponent(component);\r\n };\r\n /**\r\n * getProvider provides a type safe interface where it can only be called with a field name\r\n * present in NameServiceMapping interface.\r\n *\r\n * Firebase SDKs providing services should extend NameServiceMapping interface to register\r\n * themselves.\r\n */\r\n ComponentContainer.prototype.getProvider = function (name) {\r\n if (this.providers.has(name)) {\r\n return this.providers.get(name);\r\n }\r\n // create a Provider for a service that hasn't registered with Firebase\r\n var provider = new Provider(name, this);\r\n this.providers.set(name, provider);\r\n return provider;\r\n };\r\n ComponentContainer.prototype.getProviders = function () {\r\n return Array.from(this.providers.values());\r\n };\r\n return ComponentContainer;\r\n}());\n\nexport { Component, ComponentContainer, Provider };\n//# sourceMappingURL=index.esm.js.map\n","import firebase from '@firebase/app';\nimport { __spread, __values, __extends, __assign, __read, __awaiter, __generator } from 'tslib';\nimport { stringify, jsonEval, contains, assert, base64, stringToByteArray, Sha1, isNodeSdk, stringLength, errorPrefix, validateArgCount, validateCallback, Deferred, assertionError, safeGet, map, validateContextObject, deepCopy, isMobileCordova, base64Encode, isAdmin, isValidFormat, isEmpty, isReactNative, querystring } from '@firebase/util';\nimport { Logger, LogLevel } from '@firebase/logger';\nimport { Provider, ComponentContainer, Component } from '@firebase/component';\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Wraps a DOM Storage object and:\r\n * - automatically encode objects as JSON strings before storing them to allow us to store arbitrary types.\r\n * - prefixes names with \"firebase:\" to avoid collisions with app data.\r\n *\r\n * We automatically (see storage.js) create two such wrappers, one for sessionStorage,\r\n * and one for localStorage.\r\n *\r\n * @constructor\r\n */\r\nvar DOMStorageWrapper = /** @class */ (function () {\r\n /**\r\n * @param {Storage} domStorage_ The underlying storage object (e.g. localStorage or sessionStorage)\r\n */\r\n function DOMStorageWrapper(domStorage_) {\r\n this.domStorage_ = domStorage_;\r\n // Use a prefix to avoid collisions with other stuff saved by the app.\r\n this.prefix_ = 'firebase:';\r\n }\r\n /**\r\n * @param {string} key The key to save the value under\r\n * @param {?Object} value The value being stored, or null to remove the key.\r\n */\r\n DOMStorageWrapper.prototype.set = function (key, value) {\r\n if (value == null) {\r\n this.domStorage_.removeItem(this.prefixedName_(key));\r\n }\r\n else {\r\n this.domStorage_.setItem(this.prefixedName_(key), stringify(value));\r\n }\r\n };\r\n /**\r\n * @param {string} key\r\n * @return {*} The value that was stored under this key, or null\r\n */\r\n DOMStorageWrapper.prototype.get = function (key) {\r\n var storedVal = this.domStorage_.getItem(this.prefixedName_(key));\r\n if (storedVal == null) {\r\n return null;\r\n }\r\n else {\r\n return jsonEval(storedVal);\r\n }\r\n };\r\n /**\r\n * @param {string} key\r\n */\r\n DOMStorageWrapper.prototype.remove = function (key) {\r\n this.domStorage_.removeItem(this.prefixedName_(key));\r\n };\r\n /**\r\n * @param {string} name\r\n * @return {string}\r\n */\r\n DOMStorageWrapper.prototype.prefixedName_ = function (name) {\r\n return this.prefix_ + name;\r\n };\r\n DOMStorageWrapper.prototype.toString = function () {\r\n return this.domStorage_.toString();\r\n };\r\n return DOMStorageWrapper;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An in-memory storage implementation that matches the API of DOMStorageWrapper\r\n * (TODO: create interface for both to implement).\r\n *\r\n * @constructor\r\n */\r\nvar MemoryStorage = /** @class */ (function () {\r\n function MemoryStorage() {\r\n this.cache_ = {};\r\n this.isInMemoryStorage = true;\r\n }\r\n MemoryStorage.prototype.set = function (key, value) {\r\n if (value == null) {\r\n delete this.cache_[key];\r\n }\r\n else {\r\n this.cache_[key] = value;\r\n }\r\n };\r\n MemoryStorage.prototype.get = function (key) {\r\n if (contains(this.cache_, key)) {\r\n return this.cache_[key];\r\n }\r\n return null;\r\n };\r\n MemoryStorage.prototype.remove = function (key) {\r\n delete this.cache_[key];\r\n };\r\n return MemoryStorage;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Helper to create a DOMStorageWrapper or else fall back to MemoryStorage.\r\n * TODO: Once MemoryStorage and DOMStorageWrapper have a shared interface this method annotation should change\r\n * to reflect this type\r\n *\r\n * @param {string} domStorageName Name of the underlying storage object\r\n * (e.g. 'localStorage' or 'sessionStorage').\r\n * @return {?} Turning off type information until a common interface is defined.\r\n */\r\nvar createStoragefor = function (domStorageName) {\r\n try {\r\n // NOTE: just accessing \"localStorage\" or \"window['localStorage']\" may throw a security exception,\r\n // so it must be inside the try/catch.\r\n if (typeof window !== 'undefined' &&\r\n typeof window[domStorageName] !== 'undefined') {\r\n // Need to test cache. Just because it's here doesn't mean it works\r\n var domStorage = window[domStorageName];\r\n domStorage.setItem('firebase:sentinel', 'cache');\r\n domStorage.removeItem('firebase:sentinel');\r\n return new DOMStorageWrapper(domStorage);\r\n }\r\n }\r\n catch (e) { }\r\n // Failed to create wrapper. Just return in-memory storage.\r\n // TODO: log?\r\n return new MemoryStorage();\r\n};\r\n/** A storage object that lasts across sessions */\r\nvar PersistentStorage = createStoragefor('localStorage');\r\n/** A storage object that only lasts one session */\r\nvar SessionStorage = createStoragefor('sessionStorage');\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar logClient = new Logger('@firebase/database');\r\n/**\r\n * Returns a locally-unique ID (generated by just incrementing up from 0 each time its called).\r\n * @type {function(): number} Generated ID.\r\n */\r\nvar LUIDGenerator = (function () {\r\n var id = 1;\r\n return function () {\r\n return id++;\r\n };\r\n})();\r\n/**\r\n * Sha1 hash of the input string\r\n * @param {!string} str The string to hash\r\n * @return {!string} The resulting hash\r\n */\r\nvar sha1 = function (str) {\r\n var utf8Bytes = stringToByteArray(str);\r\n var sha1 = new Sha1();\r\n sha1.update(utf8Bytes);\r\n var sha1Bytes = sha1.digest();\r\n return base64.encodeByteArray(sha1Bytes);\r\n};\r\n/**\r\n * @param {...*} varArgs\r\n * @return {string}\r\n * @private\r\n */\r\nvar buildLogMessage_ = function () {\r\n var varArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n varArgs[_i] = arguments[_i];\r\n }\r\n var message = '';\r\n for (var i = 0; i < varArgs.length; i++) {\r\n var arg = varArgs[i];\r\n if (Array.isArray(arg) ||\r\n (arg &&\r\n typeof arg === 'object' &&\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n typeof arg.length === 'number')) {\r\n message += buildLogMessage_.apply(null, arg);\r\n }\r\n else if (typeof arg === 'object') {\r\n message += stringify(arg);\r\n }\r\n else {\r\n message += arg;\r\n }\r\n message += ' ';\r\n }\r\n return message;\r\n};\r\n/**\r\n * Use this for all debug messages in Firebase.\r\n * @type {?function(string)}\r\n */\r\nvar logger = null;\r\n/**\r\n * Flag to check for log availability on first log message\r\n * @type {boolean}\r\n * @private\r\n */\r\nvar firstLog_ = true;\r\n/**\r\n * The implementation of Firebase.enableLogging (defined here to break dependencies)\r\n * @param {boolean|?function(string)} logger_ A flag to turn on logging, or a custom logger\r\n * @param {boolean=} persistent Whether or not to persist logging settings across refreshes\r\n */\r\nvar enableLogging = function (logger_, persistent) {\r\n assert(!persistent || logger_ === true || logger_ === false, \"Can't turn on custom loggers persistently.\");\r\n if (logger_ === true) {\r\n logClient.logLevel = LogLevel.VERBOSE;\r\n logger = logClient.log.bind(logClient);\r\n if (persistent) {\r\n SessionStorage.set('logging_enabled', true);\r\n }\r\n }\r\n else if (typeof logger_ === 'function') {\r\n logger = logger_;\r\n }\r\n else {\r\n logger = null;\r\n SessionStorage.remove('logging_enabled');\r\n }\r\n};\r\n/**\r\n *\r\n * @param {...(string|Arguments)} varArgs\r\n */\r\nvar log = function () {\r\n var varArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n varArgs[_i] = arguments[_i];\r\n }\r\n if (firstLog_ === true) {\r\n firstLog_ = false;\r\n if (logger === null && SessionStorage.get('logging_enabled') === true) {\r\n enableLogging(true);\r\n }\r\n }\r\n if (logger) {\r\n var message = buildLogMessage_.apply(null, varArgs);\r\n logger(message);\r\n }\r\n};\r\n/**\r\n * @param {!string} prefix\r\n * @return {function(...[*])}\r\n */\r\nvar logWrapper = function (prefix) {\r\n return function () {\r\n var varArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n varArgs[_i] = arguments[_i];\r\n }\r\n log.apply(void 0, __spread([prefix], varArgs));\r\n };\r\n};\r\n/**\r\n * @param {...string} varArgs\r\n */\r\nvar error = function () {\r\n var varArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n varArgs[_i] = arguments[_i];\r\n }\r\n var message = 'FIREBASE INTERNAL ERROR: ' + buildLogMessage_.apply(void 0, __spread(varArgs));\r\n logClient.error(message);\r\n};\r\n/**\r\n * @param {...string} varArgs\r\n */\r\nvar fatal = function () {\r\n var varArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n varArgs[_i] = arguments[_i];\r\n }\r\n var message = \"FIREBASE FATAL ERROR: \" + buildLogMessage_.apply(void 0, __spread(varArgs));\r\n logClient.error(message);\r\n throw new Error(message);\r\n};\r\n/**\r\n * @param {...*} varArgs\r\n */\r\nvar warn = function () {\r\n var varArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n varArgs[_i] = arguments[_i];\r\n }\r\n var message = 'FIREBASE WARNING: ' + buildLogMessage_.apply(void 0, __spread(varArgs));\r\n logClient.warn(message);\r\n};\r\n/**\r\n * Logs a warning if the containing page uses https. Called when a call to new Firebase\r\n * does not use https.\r\n */\r\nvar warnIfPageIsSecure = function () {\r\n // Be very careful accessing browser globals. Who knows what may or may not exist.\r\n if (typeof window !== 'undefined' &&\r\n window.location &&\r\n window.location.protocol &&\r\n window.location.protocol.indexOf('https:') !== -1) {\r\n warn('Insecure Firebase access from a secure page. ' +\r\n 'Please use https in calls to new Firebase().');\r\n }\r\n};\r\n/**\r\n * Returns true if data is NaN, or +/- Infinity.\r\n * @param {*} data\r\n * @return {boolean}\r\n */\r\nvar isInvalidJSONNumber = function (data) {\r\n return (typeof data === 'number' &&\r\n (data !== data || // NaN\r\n data === Number.POSITIVE_INFINITY ||\r\n data === Number.NEGATIVE_INFINITY));\r\n};\r\n/**\r\n * @param {function()} fn\r\n */\r\nvar executeWhenDOMReady = function (fn) {\r\n if (isNodeSdk() || document.readyState === 'complete') {\r\n fn();\r\n }\r\n else {\r\n // Modeled after jQuery. Try DOMContentLoaded and onreadystatechange (which\r\n // fire before onload), but fall back to onload.\r\n var called_1 = false;\r\n var wrappedFn_1 = function () {\r\n if (!document.body) {\r\n setTimeout(wrappedFn_1, Math.floor(10));\r\n return;\r\n }\r\n if (!called_1) {\r\n called_1 = true;\r\n fn();\r\n }\r\n };\r\n if (document.addEventListener) {\r\n document.addEventListener('DOMContentLoaded', wrappedFn_1, false);\r\n // fallback to onload.\r\n window.addEventListener('load', wrappedFn_1, false);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n }\r\n else if (document.attachEvent) {\r\n // IE.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n document.attachEvent('onreadystatechange', function () {\r\n if (document.readyState === 'complete') {\r\n wrappedFn_1();\r\n }\r\n });\r\n // fallback to onload.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n window.attachEvent('onload', wrappedFn_1);\r\n // jQuery has an extra hack for IE that we could employ (based on\r\n // http://javascript.nwbox.com/IEContentLoaded/) But it looks really old.\r\n // I'm hoping we don't need it.\r\n }\r\n }\r\n};\r\n/**\r\n * Minimum key name. Invalid for actual data, used as a marker to sort before any valid names\r\n * @type {!string}\r\n */\r\nvar MIN_NAME = '[MIN_NAME]';\r\n/**\r\n * Maximum key name. Invalid for actual data, used as a marker to sort above any valid names\r\n * @type {!string}\r\n */\r\nvar MAX_NAME = '[MAX_NAME]';\r\n/**\r\n * Compares valid Firebase key names, plus min and max name\r\n * @param {!string} a\r\n * @param {!string} b\r\n * @return {!number}\r\n */\r\nvar nameCompare = function (a, b) {\r\n if (a === b) {\r\n return 0;\r\n }\r\n else if (a === MIN_NAME || b === MAX_NAME) {\r\n return -1;\r\n }\r\n else if (b === MIN_NAME || a === MAX_NAME) {\r\n return 1;\r\n }\r\n else {\r\n var aAsInt = tryParseInt(a), bAsInt = tryParseInt(b);\r\n if (aAsInt !== null) {\r\n if (bAsInt !== null) {\r\n return aAsInt - bAsInt === 0 ? a.length - b.length : aAsInt - bAsInt;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n else if (bAsInt !== null) {\r\n return 1;\r\n }\r\n else {\r\n return a < b ? -1 : 1;\r\n }\r\n }\r\n};\r\n/**\r\n * @param {!string} a\r\n * @param {!string} b\r\n * @return {!number} comparison result.\r\n */\r\nvar stringCompare = function (a, b) {\r\n if (a === b) {\r\n return 0;\r\n }\r\n else if (a < b) {\r\n return -1;\r\n }\r\n else {\r\n return 1;\r\n }\r\n};\r\n/**\r\n * @param {string} key\r\n * @param {Object} obj\r\n * @return {*}\r\n */\r\nvar requireKey = function (key, obj) {\r\n if (obj && key in obj) {\r\n return obj[key];\r\n }\r\n else {\r\n throw new Error('Missing required key (' + key + ') in object: ' + stringify(obj));\r\n }\r\n};\r\n/**\r\n * @param {*} obj\r\n * @return {string}\r\n */\r\nvar ObjectToUniqueKey = function (obj) {\r\n if (typeof obj !== 'object' || obj === null) {\r\n return stringify(obj);\r\n }\r\n var keys = [];\r\n // eslint-disable-next-line guard-for-in\r\n for (var k in obj) {\r\n keys.push(k);\r\n }\r\n // Export as json, but with the keys sorted.\r\n keys.sort();\r\n var key = '{';\r\n for (var i = 0; i < keys.length; i++) {\r\n if (i !== 0) {\r\n key += ',';\r\n }\r\n key += stringify(keys[i]);\r\n key += ':';\r\n key += ObjectToUniqueKey(obj[keys[i]]);\r\n }\r\n key += '}';\r\n return key;\r\n};\r\n/**\r\n * Splits a string into a number of smaller segments of maximum size\r\n * @param {!string} str The string\r\n * @param {!number} segsize The maximum number of chars in the string.\r\n * @return {Array.<string>} The string, split into appropriately-sized chunks\r\n */\r\nvar splitStringBySize = function (str, segsize) {\r\n var len = str.length;\r\n if (len <= segsize) {\r\n return [str];\r\n }\r\n var dataSegs = [];\r\n for (var c = 0; c < len; c += segsize) {\r\n if (c + segsize > len) {\r\n dataSegs.push(str.substring(c, len));\r\n }\r\n else {\r\n dataSegs.push(str.substring(c, c + segsize));\r\n }\r\n }\r\n return dataSegs;\r\n};\r\n/**\r\n * Apply a function to each (key, value) pair in an object or\r\n * apply a function to each (index, value) pair in an array\r\n * @param obj The object or array to iterate over\r\n * @param fn The function to apply\r\n */\r\nfunction each(obj, fn) {\r\n for (var key in obj) {\r\n if (obj.hasOwnProperty(key)) {\r\n fn(key, obj[key]);\r\n }\r\n }\r\n}\r\n/**\r\n * Borrowed from http://hg.secondlife.com/llsd/src/tip/js/typedarray.js (MIT License)\r\n * I made one modification at the end and removed the NaN / Infinity\r\n * handling (since it seemed broken [caused an overflow] and we don't need it). See MJL comments.\r\n * @param {!number} v A double\r\n * @return {string}\r\n */\r\nvar doubleToIEEE754String = function (v) {\r\n assert(!isInvalidJSONNumber(v), 'Invalid JSON number'); // MJL\r\n var ebits = 11, fbits = 52;\r\n var bias = (1 << (ebits - 1)) - 1;\r\n var s, e, f, ln, i;\r\n // Compute sign, exponent, fraction\r\n // Skip NaN / Infinity handling --MJL.\r\n if (v === 0) {\r\n e = 0;\r\n f = 0;\r\n s = 1 / v === -Infinity ? 1 : 0;\r\n }\r\n else {\r\n s = v < 0;\r\n v = Math.abs(v);\r\n if (v >= Math.pow(2, 1 - bias)) {\r\n // Normalized\r\n ln = Math.min(Math.floor(Math.log(v) / Math.LN2), bias);\r\n e = ln + bias;\r\n f = Math.round(v * Math.pow(2, fbits - ln) - Math.pow(2, fbits));\r\n }\r\n else {\r\n // Denormalized\r\n e = 0;\r\n f = Math.round(v / Math.pow(2, 1 - bias - fbits));\r\n }\r\n }\r\n // Pack sign, exponent, fraction\r\n var bits = [];\r\n for (i = fbits; i; i -= 1) {\r\n bits.push(f % 2 ? 1 : 0);\r\n f = Math.floor(f / 2);\r\n }\r\n for (i = ebits; i; i -= 1) {\r\n bits.push(e % 2 ? 1 : 0);\r\n e = Math.floor(e / 2);\r\n }\r\n bits.push(s ? 1 : 0);\r\n bits.reverse();\r\n var str = bits.join('');\r\n // Return the data as a hex string. --MJL\r\n var hexByteString = '';\r\n for (i = 0; i < 64; i += 8) {\r\n var hexByte = parseInt(str.substr(i, 8), 2).toString(16);\r\n if (hexByte.length === 1) {\r\n hexByte = '0' + hexByte;\r\n }\r\n hexByteString = hexByteString + hexByte;\r\n }\r\n return hexByteString.toLowerCase();\r\n};\r\n/**\r\n * Used to detect if we're in a Chrome content script (which executes in an\r\n * isolated environment where long-polling doesn't work).\r\n * @return {boolean}\r\n */\r\nvar isChromeExtensionContentScript = function () {\r\n return !!(typeof window === 'object' &&\r\n window['chrome'] &&\r\n window['chrome']['extension'] &&\r\n !/^chrome/.test(window.location.href));\r\n};\r\n/**\r\n * Used to detect if we're in a Windows 8 Store app.\r\n * @return {boolean}\r\n */\r\nvar isWindowsStoreApp = function () {\r\n // Check for the presence of a couple WinRT globals\r\n return typeof Windows === 'object' && typeof Windows.UI === 'object';\r\n};\r\n/**\r\n * Converts a server error code to a Javascript Error\r\n * @param {!string} code\r\n * @param {!Query} query\r\n * @return {Error}\r\n */\r\nvar errorForServerCode = function (code, query) {\r\n var reason = 'Unknown Error';\r\n if (code === 'too_big') {\r\n reason =\r\n 'The data requested exceeds the maximum size ' +\r\n 'that can be accessed with a single request.';\r\n }\r\n else if (code === 'permission_denied') {\r\n reason = \"Client doesn't have permission to access the desired data.\";\r\n }\r\n else if (code === 'unavailable') {\r\n reason = 'The service is unavailable';\r\n }\r\n var error = new Error(code + ' at ' + query.path.toString() + ': ' + reason);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n error.code = code.toUpperCase();\r\n return error;\r\n};\r\n/**\r\n * Used to test for integer-looking strings\r\n * @type {RegExp}\r\n * @private\r\n */\r\nvar INTEGER_REGEXP_ = new RegExp('^-?(0*)\\\\d{1,10}$');\r\n/**\r\n * If the string contains a 32-bit integer, return it. Else return null.\r\n * @param {!string} str\r\n * @return {?number}\r\n */\r\nvar tryParseInt = function (str) {\r\n if (INTEGER_REGEXP_.test(str)) {\r\n var intVal = Number(str);\r\n if (intVal >= -2147483648 && intVal <= 2147483647) {\r\n return intVal;\r\n }\r\n }\r\n return null;\r\n};\r\n/**\r\n * Helper to run some code but catch any exceptions and re-throw them later.\r\n * Useful for preventing user callbacks from breaking internal code.\r\n *\r\n * Re-throwing the exception from a setTimeout is a little evil, but it's very\r\n * convenient (we don't have to try to figure out when is a safe point to\r\n * re-throw it), and the behavior seems reasonable:\r\n *\r\n * * If you aren't pausing on exceptions, you get an error in the console with\r\n * the correct stack trace.\r\n * * If you're pausing on all exceptions, the debugger will pause on your\r\n * exception and then again when we rethrow it.\r\n * * If you're only pausing on uncaught exceptions, the debugger will only pause\r\n * on us re-throwing it.\r\n *\r\n * @param {!function()} fn The code to guard.\r\n */\r\nvar exceptionGuard = function (fn) {\r\n try {\r\n fn();\r\n }\r\n catch (e) {\r\n // Re-throw exception when it's safe.\r\n setTimeout(function () {\r\n // It used to be that \"throw e\" would result in a good console error with\r\n // relevant context, but as of Chrome 39, you just get the firebase.js\r\n // file/line number where we re-throw it, which is useless. So we log\r\n // e.stack explicitly.\r\n var stack = e.stack || '';\r\n warn('Exception was thrown by user callback.', stack);\r\n throw e;\r\n }, Math.floor(0));\r\n }\r\n};\r\n/**\r\n * @return {boolean} true if we think we're currently being crawled.\r\n */\r\nvar beingCrawled = function () {\r\n var userAgent = (typeof window === 'object' &&\r\n window['navigator'] &&\r\n window['navigator']['userAgent']) ||\r\n '';\r\n // For now we whitelist the most popular crawlers. We should refine this to be the set of crawlers we\r\n // believe to support JavaScript/AJAX rendering.\r\n // NOTE: Google Webmaster Tools doesn't really belong, but their \"This is how a visitor to your website\r\n // would have seen the page\" is flaky if we don't treat it as a crawler.\r\n return (userAgent.search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i) >= 0);\r\n};\r\n/**\r\n * Same as setTimeout() except on Node.JS it will /not/ prevent the process from exiting.\r\n *\r\n * It is removed with clearTimeout() as normal.\r\n *\r\n * @param {Function} fn Function to run.\r\n * @param {number} time Milliseconds to wait before running.\r\n * @return {number|Object} The setTimeout() return value.\r\n */\r\nvar setTimeoutNonBlocking = function (fn, time) {\r\n var timeout = setTimeout(fn, time);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n if (typeof timeout === 'object' && timeout['unref']) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n timeout['unref']();\r\n }\r\n return timeout;\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An immutable object representing a parsed path. It's immutable so that you\r\n * can pass them around to other functions without worrying about them changing\r\n * it.\r\n */\r\nvar Path = /** @class */ (function () {\r\n /**\r\n * @param {string|Array.<string>} pathOrString Path string to parse,\r\n * or another path, or the raw tokens array\r\n * @param {number=} pieceNum\r\n */\r\n function Path(pathOrString, pieceNum) {\r\n if (pieceNum === void 0) {\r\n this.pieces_ = pathOrString.split('/');\r\n // Remove empty pieces.\r\n var copyTo = 0;\r\n for (var i = 0; i < this.pieces_.length; i++) {\r\n if (this.pieces_[i].length > 0) {\r\n this.pieces_[copyTo] = this.pieces_[i];\r\n copyTo++;\r\n }\r\n }\r\n this.pieces_.length = copyTo;\r\n this.pieceNum_ = 0;\r\n }\r\n else {\r\n this.pieces_ = pathOrString;\r\n this.pieceNum_ = pieceNum;\r\n }\r\n }\r\n Object.defineProperty(Path, \"Empty\", {\r\n /**\r\n * Singleton to represent an empty path\r\n *\r\n * @const\r\n */\r\n get: function () {\r\n return new Path('');\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Path.prototype.getFront = function () {\r\n if (this.pieceNum_ >= this.pieces_.length) {\r\n return null;\r\n }\r\n return this.pieces_[this.pieceNum_];\r\n };\r\n /**\r\n * @return {number} The number of segments in this path\r\n */\r\n Path.prototype.getLength = function () {\r\n return this.pieces_.length - this.pieceNum_;\r\n };\r\n /**\r\n * @return {!Path}\r\n */\r\n Path.prototype.popFront = function () {\r\n var pieceNum = this.pieceNum_;\r\n if (pieceNum < this.pieces_.length) {\r\n pieceNum++;\r\n }\r\n return new Path(this.pieces_, pieceNum);\r\n };\r\n /**\r\n * @return {?string}\r\n */\r\n Path.prototype.getBack = function () {\r\n if (this.pieceNum_ < this.pieces_.length) {\r\n return this.pieces_[this.pieces_.length - 1];\r\n }\r\n return null;\r\n };\r\n Path.prototype.toString = function () {\r\n var pathString = '';\r\n for (var i = this.pieceNum_; i < this.pieces_.length; i++) {\r\n if (this.pieces_[i] !== '') {\r\n pathString += '/' + this.pieces_[i];\r\n }\r\n }\r\n return pathString || '/';\r\n };\r\n Path.prototype.toUrlEncodedString = function () {\r\n var pathString = '';\r\n for (var i = this.pieceNum_; i < this.pieces_.length; i++) {\r\n if (this.pieces_[i] !== '') {\r\n pathString += '/' + encodeURIComponent(String(this.pieces_[i]));\r\n }\r\n }\r\n return pathString || '/';\r\n };\r\n /**\r\n * Shallow copy of the parts of the path.\r\n *\r\n * @param {number=} begin\r\n * @return {!Array<string>}\r\n */\r\n Path.prototype.slice = function (begin) {\r\n if (begin === void 0) { begin = 0; }\r\n return this.pieces_.slice(this.pieceNum_ + begin);\r\n };\r\n /**\r\n * @return {?Path}\r\n */\r\n Path.prototype.parent = function () {\r\n if (this.pieceNum_ >= this.pieces_.length) {\r\n return null;\r\n }\r\n var pieces = [];\r\n for (var i = this.pieceNum_; i < this.pieces_.length - 1; i++) {\r\n pieces.push(this.pieces_[i]);\r\n }\r\n return new Path(pieces, 0);\r\n };\r\n /**\r\n * @param {string|!Path} childPathObj\r\n * @return {!Path}\r\n */\r\n Path.prototype.child = function (childPathObj) {\r\n var pieces = [];\r\n for (var i = this.pieceNum_; i < this.pieces_.length; i++) {\r\n pieces.push(this.pieces_[i]);\r\n }\r\n if (childPathObj instanceof Path) {\r\n for (var i = childPathObj.pieceNum_; i < childPathObj.pieces_.length; i++) {\r\n pieces.push(childPathObj.pieces_[i]);\r\n }\r\n }\r\n else {\r\n var childPieces = childPathObj.split('/');\r\n for (var i = 0; i < childPieces.length; i++) {\r\n if (childPieces[i].length > 0) {\r\n pieces.push(childPieces[i]);\r\n }\r\n }\r\n }\r\n return new Path(pieces, 0);\r\n };\r\n /**\r\n * @return {boolean} True if there are no segments in this path\r\n */\r\n Path.prototype.isEmpty = function () {\r\n return this.pieceNum_ >= this.pieces_.length;\r\n };\r\n /**\r\n * @param {!Path} outerPath\r\n * @param {!Path} innerPath\r\n * @return {!Path} The path from outerPath to innerPath\r\n */\r\n Path.relativePath = function (outerPath, innerPath) {\r\n var outer = outerPath.getFront(), inner = innerPath.getFront();\r\n if (outer === null) {\r\n return innerPath;\r\n }\r\n else if (outer === inner) {\r\n return Path.relativePath(outerPath.popFront(), innerPath.popFront());\r\n }\r\n else {\r\n throw new Error('INTERNAL ERROR: innerPath (' +\r\n innerPath +\r\n ') is not within ' +\r\n 'outerPath (' +\r\n outerPath +\r\n ')');\r\n }\r\n };\r\n /**\r\n * @param {!Path} left\r\n * @param {!Path} right\r\n * @return {number} -1, 0, 1 if left is less, equal, or greater than the right.\r\n */\r\n Path.comparePaths = function (left, right) {\r\n var leftKeys = left.slice();\r\n var rightKeys = right.slice();\r\n for (var i = 0; i < leftKeys.length && i < rightKeys.length; i++) {\r\n var cmp = nameCompare(leftKeys[i], rightKeys[i]);\r\n if (cmp !== 0) {\r\n return cmp;\r\n }\r\n }\r\n if (leftKeys.length === rightKeys.length) {\r\n return 0;\r\n }\r\n return leftKeys.length < rightKeys.length ? -1 : 1;\r\n };\r\n /**\r\n *\r\n * @param {Path} other\r\n * @return {boolean} true if paths are the same.\r\n */\r\n Path.prototype.equals = function (other) {\r\n if (this.getLength() !== other.getLength()) {\r\n return false;\r\n }\r\n for (var i = this.pieceNum_, j = other.pieceNum_; i <= this.pieces_.length; i++, j++) {\r\n if (this.pieces_[i] !== other.pieces_[j]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n /**\r\n *\r\n * @param {!Path} other\r\n * @return {boolean} True if this path is a parent (or the same as) other\r\n */\r\n Path.prototype.contains = function (other) {\r\n var i = this.pieceNum_;\r\n var j = other.pieceNum_;\r\n if (this.getLength() > other.getLength()) {\r\n return false;\r\n }\r\n while (i < this.pieces_.length) {\r\n if (this.pieces_[i] !== other.pieces_[j]) {\r\n return false;\r\n }\r\n ++i;\r\n ++j;\r\n }\r\n return true;\r\n };\r\n return Path;\r\n}()); // end Path\r\n/**\r\n * Dynamic (mutable) path used to count path lengths.\r\n *\r\n * This class is used to efficiently check paths for valid\r\n * length (in UTF8 bytes) and depth (used in path validation).\r\n *\r\n * Throws Error exception if path is ever invalid.\r\n *\r\n * The definition of a path always begins with '/'.\r\n */\r\nvar ValidationPath = /** @class */ (function () {\r\n /**\r\n * @param {!Path} path Initial Path.\r\n * @param {string} errorPrefix_ Prefix for any error messages.\r\n */\r\n function ValidationPath(path, errorPrefix_) {\r\n this.errorPrefix_ = errorPrefix_;\r\n /** @type {!Array<string>} */\r\n this.parts_ = path.slice();\r\n /** @type {number} Initialize to number of '/' chars needed in path. */\r\n this.byteLength_ = Math.max(1, this.parts_.length);\r\n for (var i = 0; i < this.parts_.length; i++) {\r\n this.byteLength_ += stringLength(this.parts_[i]);\r\n }\r\n this.checkValid_();\r\n }\r\n Object.defineProperty(ValidationPath, \"MAX_PATH_DEPTH\", {\r\n /** @const {number} Maximum key depth. */\r\n get: function () {\r\n return 32;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValidationPath, \"MAX_PATH_LENGTH_BYTES\", {\r\n /** @const {number} Maximum number of (UTF8) bytes in a Firebase path. */\r\n get: function () {\r\n return 768;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /** @param {string} child */\r\n ValidationPath.prototype.push = function (child) {\r\n // Count the needed '/'\r\n if (this.parts_.length > 0) {\r\n this.byteLength_ += 1;\r\n }\r\n this.parts_.push(child);\r\n this.byteLength_ += stringLength(child);\r\n this.checkValid_();\r\n };\r\n ValidationPath.prototype.pop = function () {\r\n var last = this.parts_.pop();\r\n this.byteLength_ -= stringLength(last);\r\n // Un-count the previous '/'\r\n if (this.parts_.length > 0) {\r\n this.byteLength_ -= 1;\r\n }\r\n };\r\n ValidationPath.prototype.checkValid_ = function () {\r\n if (this.byteLength_ > ValidationPath.MAX_PATH_LENGTH_BYTES) {\r\n throw new Error(this.errorPrefix_ +\r\n 'has a key path longer than ' +\r\n ValidationPath.MAX_PATH_LENGTH_BYTES +\r\n ' bytes (' +\r\n this.byteLength_ +\r\n ').');\r\n }\r\n if (this.parts_.length > ValidationPath.MAX_PATH_DEPTH) {\r\n throw new Error(this.errorPrefix_ +\r\n 'path specified exceeds the maximum depth that can be written (' +\r\n ValidationPath.MAX_PATH_DEPTH +\r\n ') or object contains a cycle ' +\r\n this.toErrorString());\r\n }\r\n };\r\n /**\r\n * String for use in error messages - uses '.' notation for path.\r\n *\r\n * @return {string}\r\n */\r\n ValidationPath.prototype.toErrorString = function () {\r\n if (this.parts_.length === 0) {\r\n return '';\r\n }\r\n return \"in property '\" + this.parts_.join('.') + \"'\";\r\n };\r\n return ValidationPath;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar PROTOCOL_VERSION = '5';\r\nvar VERSION_PARAM = 'v';\r\nvar TRANSPORT_SESSION_PARAM = 's';\r\nvar REFERER_PARAM = 'r';\r\nvar FORGE_REF = 'f';\r\nvar FORGE_DOMAIN = 'firebaseio.com';\r\nvar LAST_SESSION_PARAM = 'ls';\r\nvar APPLICATION_ID_PARAM = 'p';\r\nvar WEBSOCKET = 'websocket';\r\nvar LONG_POLLING = 'long_polling';\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A class that holds metadata about a Repo object\r\n *\r\n * @constructor\r\n */\r\nvar RepoInfo = /** @class */ (function () {\r\n /**\r\n * @param host Hostname portion of the url for the repo\r\n * @param secure Whether or not this repo is accessed over ssl\r\n * @param namespace The namespace represented by the repo\r\n * @param webSocketOnly Whether to prefer websockets over all other transports (used by Nest).\r\n * @param nodeAdmin Whether this instance uses Admin SDK credentials\r\n * @param persistenceKey Override the default session persistence storage key\r\n */\r\n function RepoInfo(host, secure, namespace, webSocketOnly, nodeAdmin, persistenceKey, includeNamespaceInQueryParams) {\r\n if (nodeAdmin === void 0) { nodeAdmin = false; }\r\n if (persistenceKey === void 0) { persistenceKey = ''; }\r\n if (includeNamespaceInQueryParams === void 0) { includeNamespaceInQueryParams = false; }\r\n this.secure = secure;\r\n this.namespace = namespace;\r\n this.webSocketOnly = webSocketOnly;\r\n this.nodeAdmin = nodeAdmin;\r\n this.persistenceKey = persistenceKey;\r\n this.includeNamespaceInQueryParams = includeNamespaceInQueryParams;\r\n this.host = host.toLowerCase();\r\n this.domain = this.host.substr(this.host.indexOf('.') + 1);\r\n this.internalHost =\r\n PersistentStorage.get('host:' + host) || this.host;\r\n }\r\n RepoInfo.prototype.needsQueryParam = function () {\r\n return (this.host !== this.internalHost ||\r\n this.isCustomHost() ||\r\n this.includeNamespaceInQueryParams);\r\n };\r\n RepoInfo.prototype.isCacheableHost = function () {\r\n return this.internalHost.substr(0, 2) === 's-';\r\n };\r\n RepoInfo.prototype.isDemoHost = function () {\r\n return this.domain === 'firebaseio-demo.com';\r\n };\r\n RepoInfo.prototype.isCustomHost = function () {\r\n return (this.domain !== 'firebaseio.com' && this.domain !== 'firebaseio-demo.com');\r\n };\r\n RepoInfo.prototype.updateHost = function (newHost) {\r\n if (newHost !== this.internalHost) {\r\n this.internalHost = newHost;\r\n if (this.isCacheableHost()) {\r\n PersistentStorage.set('host:' + this.host, this.internalHost);\r\n }\r\n }\r\n };\r\n /**\r\n * Returns the websocket URL for this repo\r\n * @param {string} type of connection\r\n * @param {Object} params list\r\n * @return {string} The URL for this repo\r\n */\r\n RepoInfo.prototype.connectionURL = function (type, params) {\r\n assert(typeof type === 'string', 'typeof type must == string');\r\n assert(typeof params === 'object', 'typeof params must == object');\r\n var connURL;\r\n if (type === WEBSOCKET) {\r\n connURL =\r\n (this.secure ? 'wss://' : 'ws://') + this.internalHost + '/.ws?';\r\n }\r\n else if (type === LONG_POLLING) {\r\n connURL =\r\n (this.secure ? 'https://' : 'http://') + this.internalHost + '/.lp?';\r\n }\r\n else {\r\n throw new Error('Unknown connection type: ' + type);\r\n }\r\n if (this.needsQueryParam()) {\r\n params['ns'] = this.namespace;\r\n }\r\n var pairs = [];\r\n each(params, function (key, value) {\r\n pairs.push(key + '=' + value);\r\n });\r\n return connURL + pairs.join('&');\r\n };\r\n /** @return {string} */\r\n RepoInfo.prototype.toString = function () {\r\n var str = this.toURLString();\r\n if (this.persistenceKey) {\r\n str += '<' + this.persistenceKey + '>';\r\n }\r\n return str;\r\n };\r\n /** @return {string} */\r\n RepoInfo.prototype.toURLString = function () {\r\n return (this.secure ? 'https://' : 'http://') + this.host;\r\n };\r\n return RepoInfo;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @param {!string} pathString\r\n * @return {string}\r\n */\r\nfunction decodePath(pathString) {\r\n var pathStringDecoded = '';\r\n var pieces = pathString.split('/');\r\n for (var i = 0; i < pieces.length; i++) {\r\n if (pieces[i].length > 0) {\r\n var piece = pieces[i];\r\n try {\r\n piece = decodeURIComponent(piece.replace(/\\+/g, ' '));\r\n }\r\n catch (e) { }\r\n pathStringDecoded += '/' + piece;\r\n }\r\n }\r\n return pathStringDecoded;\r\n}\r\n/**\r\n * @param {!string} queryString\r\n * @return {!{[key:string]:string}} key value hash\r\n */\r\nfunction decodeQuery(queryString) {\r\n var e_1, _a;\r\n var results = {};\r\n if (queryString.charAt(0) === '?') {\r\n queryString = queryString.substring(1);\r\n }\r\n try {\r\n for (var _b = __values(queryString.split('&')), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var segment = _c.value;\r\n if (segment.length === 0) {\r\n continue;\r\n }\r\n var kv = segment.split('=');\r\n if (kv.length === 2) {\r\n results[decodeURIComponent(kv[0])] = decodeURIComponent(kv[1]);\r\n }\r\n else {\r\n warn(\"Invalid query segment '\" + segment + \"' in query '\" + queryString + \"'\");\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n return results;\r\n}\r\nvar parseRepoInfo = function (dataURL, nodeAdmin) {\r\n var parsedUrl = parseDatabaseURL(dataURL), namespace = parsedUrl.namespace;\r\n if (parsedUrl.domain === 'firebase.com') {\r\n fatal(parsedUrl.host +\r\n ' is no longer supported. ' +\r\n 'Please use <YOUR FIREBASE>.firebaseio.com instead');\r\n }\r\n // Catch common error of uninitialized namespace value.\r\n if ((!namespace || namespace === 'undefined') &&\r\n parsedUrl.domain !== 'localhost') {\r\n fatal('Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com');\r\n }\r\n if (!parsedUrl.secure) {\r\n warnIfPageIsSecure();\r\n }\r\n var webSocketOnly = parsedUrl.scheme === 'ws' || parsedUrl.scheme === 'wss';\r\n return {\r\n repoInfo: new RepoInfo(parsedUrl.host, parsedUrl.secure, namespace, nodeAdmin, webSocketOnly, \r\n /*persistenceKey=*/ '', \r\n /*includeNamespaceInQueryParams=*/ namespace !== parsedUrl.subdomain),\r\n path: new Path(parsedUrl.pathString)\r\n };\r\n};\r\n/**\r\n *\r\n * @param {!string} dataURL\r\n * @return {{host: string, port: number, domain: string, subdomain: string, secure: boolean, scheme: string, pathString: string, namespace: string}}\r\n */\r\nvar parseDatabaseURL = function (dataURL) {\r\n // Default to empty strings in the event of a malformed string.\r\n var host = '', domain = '', subdomain = '', pathString = '', namespace = '';\r\n // Always default to SSL, unless otherwise specified.\r\n var secure = true, scheme = 'https', port = 443;\r\n // Don't do any validation here. The caller is responsible for validating the result of parsing.\r\n if (typeof dataURL === 'string') {\r\n // Parse scheme.\r\n var colonInd = dataURL.indexOf('//');\r\n if (colonInd >= 0) {\r\n scheme = dataURL.substring(0, colonInd - 1);\r\n dataURL = dataURL.substring(colonInd + 2);\r\n }\r\n // Parse host, path, and query string.\r\n var slashInd = dataURL.indexOf('/');\r\n if (slashInd === -1) {\r\n slashInd = dataURL.length;\r\n }\r\n var questionMarkInd = dataURL.indexOf('?');\r\n if (questionMarkInd === -1) {\r\n questionMarkInd = dataURL.length;\r\n }\r\n host = dataURL.substring(0, Math.min(slashInd, questionMarkInd));\r\n if (slashInd < questionMarkInd) {\r\n // For pathString, questionMarkInd will always come after slashInd\r\n pathString = decodePath(dataURL.substring(slashInd, questionMarkInd));\r\n }\r\n var queryParams = decodeQuery(dataURL.substring(Math.min(dataURL.length, questionMarkInd)));\r\n // If we have a port, use scheme for determining if it's secure.\r\n colonInd = host.indexOf(':');\r\n if (colonInd >= 0) {\r\n secure = scheme === 'https' || scheme === 'wss';\r\n port = parseInt(host.substring(colonInd + 1), 10);\r\n }\r\n else {\r\n colonInd = host.length;\r\n }\r\n var hostWithoutPort = host.slice(0, colonInd);\r\n if (hostWithoutPort.toLowerCase() === 'localhost') {\r\n domain = 'localhost';\r\n }\r\n else if (hostWithoutPort.split('.').length <= 2) {\r\n domain = hostWithoutPort;\r\n }\r\n else {\r\n // Interpret the subdomain of a 3 or more component URL as the namespace name.\r\n var dotInd = host.indexOf('.');\r\n subdomain = host.substring(0, dotInd).toLowerCase();\r\n domain = host.substring(dotInd + 1);\r\n // Normalize namespaces to lowercase to share storage / connection.\r\n namespace = subdomain;\r\n }\r\n // Always treat the value of the `ns` as the namespace name if it is present.\r\n if ('ns' in queryParams) {\r\n namespace = queryParams['ns'];\r\n }\r\n }\r\n return {\r\n host: host,\r\n port: port,\r\n domain: domain,\r\n subdomain: subdomain,\r\n secure: secure,\r\n scheme: scheme,\r\n pathString: pathString,\r\n namespace: namespace\r\n };\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * True for invalid Firebase keys\r\n * @type {RegExp}\r\n * @private\r\n */\r\nvar INVALID_KEY_REGEX_ = /[\\[\\].#$\\/\\u0000-\\u001F\\u007F]/;\r\n/**\r\n * True for invalid Firebase paths.\r\n * Allows '/' in paths.\r\n * @type {RegExp}\r\n * @private\r\n */\r\nvar INVALID_PATH_REGEX_ = /[\\[\\].#$\\u0000-\\u001F\\u007F]/;\r\n/**\r\n * Maximum number of characters to allow in leaf value\r\n * @type {number}\r\n * @private\r\n */\r\nvar MAX_LEAF_SIZE_ = 10 * 1024 * 1024;\r\n/**\r\n * @param {*} key\r\n * @return {boolean}\r\n */\r\nvar isValidKey = function (key) {\r\n return (typeof key === 'string' && key.length !== 0 && !INVALID_KEY_REGEX_.test(key));\r\n};\r\n/**\r\n * @param {string} pathString\r\n * @return {boolean}\r\n */\r\nvar isValidPathString = function (pathString) {\r\n return (typeof pathString === 'string' &&\r\n pathString.length !== 0 &&\r\n !INVALID_PATH_REGEX_.test(pathString));\r\n};\r\n/**\r\n * @param {string} pathString\r\n * @return {boolean}\r\n */\r\nvar isValidRootPathString = function (pathString) {\r\n if (pathString) {\r\n // Allow '/.info/' at the beginning.\r\n pathString = pathString.replace(/^\\/*\\.info(\\/|$)/, '/');\r\n }\r\n return isValidPathString(pathString);\r\n};\r\n/**\r\n * @param {*} priority\r\n * @return {boolean}\r\n */\r\nvar isValidPriority = function (priority) {\r\n return (priority === null ||\r\n typeof priority === 'string' ||\r\n (typeof priority === 'number' && !isInvalidJSONNumber(priority)) ||\r\n (priority &&\r\n typeof priority === 'object' &&\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n contains(priority, '.sv')));\r\n};\r\n/**\r\n * Pre-validate a datum passed as an argument to Firebase function.\r\n *\r\n * @param {string} fnName\r\n * @param {number} argumentNumber\r\n * @param {*} data\r\n * @param {!Path} path\r\n * @param {boolean} optional\r\n */\r\nvar validateFirebaseDataArg = function (fnName, argumentNumber, data, path, optional) {\r\n if (optional && data === undefined) {\r\n return;\r\n }\r\n validateFirebaseData(errorPrefix(fnName, argumentNumber, optional), data, path);\r\n};\r\n/**\r\n * Validate a data object client-side before sending to server.\r\n *\r\n * @param {string} errorPrefix\r\n * @param {*} data\r\n * @param {!Path|!ValidationPath} path_\r\n */\r\nvar validateFirebaseData = function (errorPrefix, data, path_) {\r\n var path = path_ instanceof Path ? new ValidationPath(path_, errorPrefix) : path_;\r\n if (data === undefined) {\r\n throw new Error(errorPrefix + 'contains undefined ' + path.toErrorString());\r\n }\r\n if (typeof data === 'function') {\r\n throw new Error(errorPrefix +\r\n 'contains a function ' +\r\n path.toErrorString() +\r\n ' with contents = ' +\r\n data.toString());\r\n }\r\n if (isInvalidJSONNumber(data)) {\r\n throw new Error(errorPrefix + 'contains ' + data.toString() + ' ' + path.toErrorString());\r\n }\r\n // Check max leaf size, but try to avoid the utf8 conversion if we can.\r\n if (typeof data === 'string' &&\r\n data.length > MAX_LEAF_SIZE_ / 3 &&\r\n stringLength(data) > MAX_LEAF_SIZE_) {\r\n throw new Error(errorPrefix +\r\n 'contains a string greater than ' +\r\n MAX_LEAF_SIZE_ +\r\n ' utf8 bytes ' +\r\n path.toErrorString() +\r\n \" ('\" +\r\n data.substring(0, 50) +\r\n \"...')\");\r\n }\r\n // TODO = Perf = Consider combining the recursive validation of keys into NodeFromJSON\r\n // to save extra walking of large objects.\r\n if (data && typeof data === 'object') {\r\n var hasDotValue_1 = false;\r\n var hasActualChild_1 = false;\r\n each(data, function (key, value) {\r\n if (key === '.value') {\r\n hasDotValue_1 = true;\r\n }\r\n else if (key !== '.priority' && key !== '.sv') {\r\n hasActualChild_1 = true;\r\n if (!isValidKey(key)) {\r\n throw new Error(errorPrefix +\r\n ' contains an invalid key (' +\r\n key +\r\n ') ' +\r\n path.toErrorString() +\r\n '. Keys must be non-empty strings ' +\r\n 'and can\\'t contain \".\", \"#\", \"$\", \"/\", \"[\", or \"]\"');\r\n }\r\n }\r\n path.push(key);\r\n validateFirebaseData(errorPrefix, value, path);\r\n path.pop();\r\n });\r\n if (hasDotValue_1 && hasActualChild_1) {\r\n throw new Error(errorPrefix +\r\n ' contains \".value\" child ' +\r\n path.toErrorString() +\r\n ' in addition to actual children.');\r\n }\r\n }\r\n};\r\n/**\r\n * Pre-validate paths passed in the firebase function.\r\n *\r\n * @param {string} errorPrefix\r\n * @param {Array<!Path>} mergePaths\r\n */\r\nvar validateFirebaseMergePaths = function (errorPrefix, mergePaths) {\r\n var i, curPath;\r\n for (i = 0; i < mergePaths.length; i++) {\r\n curPath = mergePaths[i];\r\n var keys = curPath.slice();\r\n for (var j = 0; j < keys.length; j++) {\r\n if (keys[j] === '.priority' && j === keys.length - 1) ;\r\n else if (!isValidKey(keys[j])) {\r\n throw new Error(errorPrefix +\r\n 'contains an invalid key (' +\r\n keys[j] +\r\n ') in path ' +\r\n curPath.toString() +\r\n '. Keys must be non-empty strings ' +\r\n 'and can\\'t contain \".\", \"#\", \"$\", \"/\", \"[\", or \"]\"');\r\n }\r\n }\r\n }\r\n // Check that update keys are not descendants of each other.\r\n // We rely on the property that sorting guarantees that ancestors come\r\n // right before descendants.\r\n mergePaths.sort(Path.comparePaths);\r\n var prevPath = null;\r\n for (i = 0; i < mergePaths.length; i++) {\r\n curPath = mergePaths[i];\r\n if (prevPath !== null && prevPath.contains(curPath)) {\r\n throw new Error(errorPrefix +\r\n 'contains a path ' +\r\n prevPath.toString() +\r\n ' that is ancestor of another path ' +\r\n curPath.toString());\r\n }\r\n prevPath = curPath;\r\n }\r\n};\r\n/**\r\n * pre-validate an object passed as an argument to firebase function (\r\n * must be an object - e.g. for firebase.update()).\r\n *\r\n * @param {string} fnName\r\n * @param {number} argumentNumber\r\n * @param {*} data\r\n * @param {!Path} path\r\n * @param {boolean} optional\r\n */\r\nvar validateFirebaseMergeDataArg = function (fnName, argumentNumber, data, path, optional) {\r\n if (optional && data === undefined) {\r\n return;\r\n }\r\n var errorPrefix$1 = errorPrefix(fnName, argumentNumber, optional);\r\n if (!(data && typeof data === 'object') || Array.isArray(data)) {\r\n throw new Error(errorPrefix$1 + ' must be an object containing the children to replace.');\r\n }\r\n var mergePaths = [];\r\n each(data, function (key, value) {\r\n var curPath = new Path(key);\r\n validateFirebaseData(errorPrefix$1, value, path.child(curPath));\r\n if (curPath.getBack() === '.priority') {\r\n if (!isValidPriority(value)) {\r\n throw new Error(errorPrefix$1 +\r\n \"contains an invalid value for '\" +\r\n curPath.toString() +\r\n \"', which must be a valid \" +\r\n 'Firebase priority (a string, finite number, server value, or null).');\r\n }\r\n }\r\n mergePaths.push(curPath);\r\n });\r\n validateFirebaseMergePaths(errorPrefix$1, mergePaths);\r\n};\r\nvar validatePriority = function (fnName, argumentNumber, priority, optional) {\r\n if (optional && priority === undefined) {\r\n return;\r\n }\r\n if (isInvalidJSONNumber(priority)) {\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) +\r\n 'is ' +\r\n priority.toString() +\r\n ', but must be a valid Firebase priority (a string, finite number, ' +\r\n 'server value, or null).');\r\n }\r\n // Special case to allow importing data with a .sv.\r\n if (!isValidPriority(priority)) {\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) +\r\n 'must be a valid Firebase priority ' +\r\n '(a string, finite number, server value, or null).');\r\n }\r\n};\r\nvar validateEventType = function (fnName, argumentNumber, eventType, optional) {\r\n if (optional && eventType === undefined) {\r\n return;\r\n }\r\n switch (eventType) {\r\n case 'value':\r\n case 'child_added':\r\n case 'child_removed':\r\n case 'child_changed':\r\n case 'child_moved':\r\n break;\r\n default:\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) +\r\n 'must be a valid event type = \"value\", \"child_added\", \"child_removed\", ' +\r\n '\"child_changed\", or \"child_moved\".');\r\n }\r\n};\r\nvar validateKey = function (fnName, argumentNumber, key, optional) {\r\n if (optional && key === undefined) {\r\n return;\r\n }\r\n if (!isValidKey(key)) {\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) +\r\n 'was an invalid key = \"' +\r\n key +\r\n '\". Firebase keys must be non-empty strings and ' +\r\n 'can\\'t contain \".\", \"#\", \"$\", \"/\", \"[\", or \"]\").');\r\n }\r\n};\r\nvar validatePathString = function (fnName, argumentNumber, pathString, optional) {\r\n if (optional && pathString === undefined) {\r\n return;\r\n }\r\n if (!isValidPathString(pathString)) {\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) +\r\n 'was an invalid path = \"' +\r\n pathString +\r\n '\". Paths must be non-empty strings and ' +\r\n 'can\\'t contain \".\", \"#\", \"$\", \"[\", or \"]\"');\r\n }\r\n};\r\nvar validateRootPathString = function (fnName, argumentNumber, pathString, optional) {\r\n if (pathString) {\r\n // Allow '/.info/' at the beginning.\r\n pathString = pathString.replace(/^\\/*\\.info(\\/|$)/, '/');\r\n }\r\n validatePathString(fnName, argumentNumber, pathString, optional);\r\n};\r\nvar validateWritablePath = function (fnName, path) {\r\n if (path.getFront() === '.info') {\r\n throw new Error(fnName + \" failed = Can't modify data under /.info/\");\r\n }\r\n};\r\nvar validateUrl = function (fnName, argumentNumber, parsedUrl) {\r\n // TODO = Validate server better.\r\n var pathString = parsedUrl.path.toString();\r\n if (!(typeof parsedUrl.repoInfo.host === 'string') ||\r\n parsedUrl.repoInfo.host.length === 0 ||\r\n (!isValidKey(parsedUrl.repoInfo.namespace) &&\r\n parsedUrl.repoInfo.host.split(':')[0] !== 'localhost') ||\r\n (pathString.length !== 0 && !isValidRootPathString(pathString))) {\r\n throw new Error(errorPrefix(fnName, argumentNumber, false) +\r\n 'must be a valid firebase URL and ' +\r\n 'the path can\\'t contain \".\", \"#\", \"$\", \"[\", or \"]\".');\r\n }\r\n};\r\nvar validateBoolean = function (fnName, argumentNumber, bool, optional) {\r\n if (optional && bool === undefined) {\r\n return;\r\n }\r\n if (typeof bool !== 'boolean') {\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) + 'must be a boolean.');\r\n }\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @constructor\r\n */\r\nvar OnDisconnect = /** @class */ (function () {\r\n /**\r\n * @param {!Repo} repo_\r\n * @param {!Path} path_\r\n */\r\n function OnDisconnect(repo_, path_) {\r\n this.repo_ = repo_;\r\n this.path_ = path_;\r\n }\r\n /**\r\n * @param {function(?Error)=} onComplete\r\n * @return {!firebase.Promise}\r\n */\r\n OnDisconnect.prototype.cancel = function (onComplete) {\r\n validateArgCount('OnDisconnect.cancel', 0, 1, arguments.length);\r\n validateCallback('OnDisconnect.cancel', 1, onComplete, true);\r\n var deferred = new Deferred();\r\n this.repo_.onDisconnectCancel(this.path_, deferred.wrapCallback(onComplete));\r\n return deferred.promise;\r\n };\r\n /**\r\n * @param {function(?Error)=} onComplete\r\n * @return {!firebase.Promise}\r\n */\r\n OnDisconnect.prototype.remove = function (onComplete) {\r\n validateArgCount('OnDisconnect.remove', 0, 1, arguments.length);\r\n validateWritablePath('OnDisconnect.remove', this.path_);\r\n validateCallback('OnDisconnect.remove', 1, onComplete, true);\r\n var deferred = new Deferred();\r\n this.repo_.onDisconnectSet(this.path_, null, deferred.wrapCallback(onComplete));\r\n return deferred.promise;\r\n };\r\n /**\r\n * @param {*} value\r\n * @param {function(?Error)=} onComplete\r\n * @return {!firebase.Promise}\r\n */\r\n OnDisconnect.prototype.set = function (value, onComplete) {\r\n validateArgCount('OnDisconnect.set', 1, 2, arguments.length);\r\n validateWritablePath('OnDisconnect.set', this.path_);\r\n validateFirebaseDataArg('OnDisconnect.set', 1, value, this.path_, false);\r\n validateCallback('OnDisconnect.set', 2, onComplete, true);\r\n var deferred = new Deferred();\r\n this.repo_.onDisconnectSet(this.path_, value, deferred.wrapCallback(onComplete));\r\n return deferred.promise;\r\n };\r\n /**\r\n * @param {*} value\r\n * @param {number|string|null} priority\r\n * @param {function(?Error)=} onComplete\r\n * @return {!firebase.Promise}\r\n */\r\n OnDisconnect.prototype.setWithPriority = function (value, priority, onComplete) {\r\n validateArgCount('OnDisconnect.setWithPriority', 2, 3, arguments.length);\r\n validateWritablePath('OnDisconnect.setWithPriority', this.path_);\r\n validateFirebaseDataArg('OnDisconnect.setWithPriority', 1, value, this.path_, false);\r\n validatePriority('OnDisconnect.setWithPriority', 2, priority, false);\r\n validateCallback('OnDisconnect.setWithPriority', 3, onComplete, true);\r\n var deferred = new Deferred();\r\n this.repo_.onDisconnectSetWithPriority(this.path_, value, priority, deferred.wrapCallback(onComplete));\r\n return deferred.promise;\r\n };\r\n /**\r\n * @param {!Object} objectToMerge\r\n * @param {function(?Error)=} onComplete\r\n * @return {!firebase.Promise}\r\n */\r\n OnDisconnect.prototype.update = function (objectToMerge, onComplete) {\r\n validateArgCount('OnDisconnect.update', 1, 2, arguments.length);\r\n validateWritablePath('OnDisconnect.update', this.path_);\r\n if (Array.isArray(objectToMerge)) {\r\n var newObjectToMerge = {};\r\n for (var i = 0; i < objectToMerge.length; ++i) {\r\n newObjectToMerge['' + i] = objectToMerge[i];\r\n }\r\n objectToMerge = newObjectToMerge;\r\n warn('Passing an Array to firebase.database.onDisconnect().update() is deprecated. Use set() if you want to overwrite the ' +\r\n 'existing data, or an Object with integer keys if you really do want to only update some of the children.');\r\n }\r\n validateFirebaseMergeDataArg('OnDisconnect.update', 1, objectToMerge, this.path_, false);\r\n validateCallback('OnDisconnect.update', 2, onComplete, true);\r\n var deferred = new Deferred();\r\n this.repo_.onDisconnectUpdate(this.path_, objectToMerge, deferred.wrapCallback(onComplete));\r\n return deferred.promise;\r\n };\r\n return OnDisconnect;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar TransactionResult = /** @class */ (function () {\r\n /**\r\n * A type for the resolve value of Firebase.transaction.\r\n * @constructor\r\n * @dict\r\n * @param {boolean} committed\r\n * @param {DataSnapshot} snapshot\r\n */\r\n function TransactionResult(committed, snapshot) {\r\n this.committed = committed;\r\n this.snapshot = snapshot;\r\n }\r\n // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary\r\n // for end-users\r\n TransactionResult.prototype.toJSON = function () {\r\n validateArgCount('TransactionResult.toJSON', 0, 1, arguments.length);\r\n return { committed: this.committed, snapshot: this.snapshot.toJSON() };\r\n };\r\n return TransactionResult;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Fancy ID generator that creates 20-character string identifiers with the\r\n * following properties:\r\n *\r\n * 1. They're based on timestamp so that they sort *after* any existing ids.\r\n * 2. They contain 72-bits of random data after the timestamp so that IDs won't\r\n * collide with other clients' IDs.\r\n * 3. They sort *lexicographically* (so the timestamp is converted to characters\r\n * that will sort properly).\r\n * 4. They're monotonically increasing. Even if you generate more than one in\r\n * the same timestamp, the latter ones will sort after the former ones. We do\r\n * this by using the previous random bits but \"incrementing\" them by 1 (only\r\n * in the case of a timestamp collision).\r\n */\r\nvar nextPushId = (function () {\r\n // Modeled after base64 web-safe chars, but ordered by ASCII.\r\n var PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz';\r\n // Timestamp of last push, used to prevent local collisions if you push twice\r\n // in one ms.\r\n var lastPushTime = 0;\r\n // We generate 72-bits of randomness which get turned into 12 characters and\r\n // appended to the timestamp to prevent collisions with other clients. We\r\n // store the last characters we generated because in the event of a collision,\r\n // we'll use those same characters except \"incremented\" by one.\r\n var lastRandChars = [];\r\n return function (now) {\r\n var duplicateTime = now === lastPushTime;\r\n lastPushTime = now;\r\n var i;\r\n var timeStampChars = new Array(8);\r\n for (i = 7; i >= 0; i--) {\r\n timeStampChars[i] = PUSH_CHARS.charAt(now % 64);\r\n // NOTE: Can't use << here because javascript will convert to int and lose\r\n // the upper bits.\r\n now = Math.floor(now / 64);\r\n }\r\n assert(now === 0, 'Cannot push at time == 0');\r\n var id = timeStampChars.join('');\r\n if (!duplicateTime) {\r\n for (i = 0; i < 12; i++) {\r\n lastRandChars[i] = Math.floor(Math.random() * 64);\r\n }\r\n }\r\n else {\r\n // If the timestamp hasn't changed since last push, use the same random\r\n // number, except incremented by 1.\r\n for (i = 11; i >= 0 && lastRandChars[i] === 63; i--) {\r\n lastRandChars[i] = 0;\r\n }\r\n lastRandChars[i]++;\r\n }\r\n for (i = 0; i < 12; i++) {\r\n id += PUSH_CHARS.charAt(lastRandChars[i]);\r\n }\r\n assert(id.length === 20, 'nextPushId: Length should be 20.');\r\n return id;\r\n };\r\n})();\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n *\r\n * @param {!string} name\r\n * @param {!Node} node\r\n * @constructor\r\n * @struct\r\n */\r\nvar NamedNode = /** @class */ (function () {\r\n function NamedNode(name, node) {\r\n this.name = name;\r\n this.node = node;\r\n }\r\n /**\r\n *\r\n * @param {!string} name\r\n * @param {!Node} node\r\n * @return {NamedNode}\r\n */\r\n NamedNode.Wrap = function (name, node) {\r\n return new NamedNode(name, node);\r\n };\r\n return NamedNode;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n *\r\n * @constructor\r\n */\r\nvar Index = /** @class */ (function () {\r\n function Index() {\r\n }\r\n /**\r\n * @return {function(!NamedNode, !NamedNode):number} A standalone comparison function for\r\n * this index\r\n */\r\n Index.prototype.getCompare = function () {\r\n return this.compare.bind(this);\r\n };\r\n /**\r\n * Given a before and after value for a node, determine if the indexed value has changed. Even if they are different,\r\n * it's possible that the changes are isolated to parts of the snapshot that are not indexed.\r\n *\r\n * @param {!Node} oldNode\r\n * @param {!Node} newNode\r\n * @return {boolean} True if the portion of the snapshot being indexed changed between oldNode and newNode\r\n */\r\n Index.prototype.indexedValueChanged = function (oldNode, newNode) {\r\n var oldWrapped = new NamedNode(MIN_NAME, oldNode);\r\n var newWrapped = new NamedNode(MIN_NAME, newNode);\r\n return this.compare(oldWrapped, newWrapped) !== 0;\r\n };\r\n /**\r\n * @return {!NamedNode} a node wrapper that will sort equal to or less than\r\n * any other node wrapper, using this index\r\n */\r\n Index.prototype.minPost = function () {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return NamedNode.MIN;\r\n };\r\n return Index;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __EMPTY_NODE;\r\nvar KeyIndex = /** @class */ (function (_super) {\r\n __extends(KeyIndex, _super);\r\n function KeyIndex() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Object.defineProperty(KeyIndex, \"__EMPTY_NODE\", {\r\n get: function () {\r\n return __EMPTY_NODE;\r\n },\r\n set: function (val) {\r\n __EMPTY_NODE = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * @inheritDoc\r\n */\r\n KeyIndex.prototype.compare = function (a, b) {\r\n return nameCompare(a.name, b.name);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n KeyIndex.prototype.isDefinedOn = function (node) {\r\n // We could probably return true here (since every node has a key), but it's never called\r\n // so just leaving unimplemented for now.\r\n throw assertionError('KeyIndex.isDefinedOn not expected to be called.');\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n KeyIndex.prototype.indexedValueChanged = function (oldNode, newNode) {\r\n return false; // The key for a node never changes.\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n KeyIndex.prototype.minPost = function () {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return NamedNode.MIN;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n KeyIndex.prototype.maxPost = function () {\r\n // TODO: This should really be created once and cached in a static property, but\r\n // NamedNode isn't defined yet, so I can't use it in a static. Bleh.\r\n return new NamedNode(MAX_NAME, __EMPTY_NODE);\r\n };\r\n /**\r\n * @param {*} indexValue\r\n * @param {string} name\r\n * @return {!NamedNode}\r\n */\r\n KeyIndex.prototype.makePost = function (indexValue, name) {\r\n assert(typeof indexValue === 'string', 'KeyIndex indexValue must always be a string.');\r\n // We just use empty node, but it'll never be compared, since our comparator only looks at name.\r\n return new NamedNode(indexValue, __EMPTY_NODE);\r\n };\r\n /**\r\n * @return {!string} String representation for inclusion in a query spec\r\n */\r\n KeyIndex.prototype.toString = function () {\r\n return '.key';\r\n };\r\n return KeyIndex;\r\n}(Index));\r\nvar KEY_INDEX = new KeyIndex();\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar MAX_NODE;\r\nfunction setMaxNode(val) {\r\n MAX_NODE = val;\r\n}\r\n/**\r\n * @param {(!string|!number)} priority\r\n * @return {!string}\r\n */\r\nvar priorityHashText = function (priority) {\r\n if (typeof priority === 'number') {\r\n return 'number:' + doubleToIEEE754String(priority);\r\n }\r\n else {\r\n return 'string:' + priority;\r\n }\r\n};\r\n/**\r\n * Validates that a priority snapshot Node is valid.\r\n *\r\n * @param {!Node} priorityNode\r\n */\r\nvar validatePriorityNode = function (priorityNode) {\r\n if (priorityNode.isLeafNode()) {\r\n var val = priorityNode.val();\r\n assert(typeof val === 'string' ||\r\n typeof val === 'number' ||\r\n (typeof val === 'object' && contains(val, '.sv')), 'Priority must be a string or number.');\r\n }\r\n else {\r\n assert(priorityNode === MAX_NODE || priorityNode.isEmpty(), 'priority of unexpected type.');\r\n }\r\n // Don't call getPriority() on MAX_NODE to avoid hitting assertion.\r\n assert(priorityNode === MAX_NODE || priorityNode.getPriority().isEmpty(), \"Priority nodes can't have a priority of their own.\");\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __childrenNodeConstructor;\r\n/**\r\n * LeafNode is a class for storing leaf nodes in a DataSnapshot. It\r\n * implements Node and stores the value of the node (a string,\r\n * number, or boolean) accessible via getValue().\r\n */\r\nvar LeafNode = /** @class */ (function () {\r\n /**\r\n * @implements {Node}\r\n * @param {!(string|number|boolean|Object)} value_ The value to store in this leaf node.\r\n * The object type is possible in the event of a deferred value\r\n * @param {!Node=} priorityNode_ The priority of this node.\r\n */\r\n function LeafNode(value_, priorityNode_) {\r\n if (priorityNode_ === void 0) { priorityNode_ = LeafNode.__childrenNodeConstructor.EMPTY_NODE; }\r\n this.value_ = value_;\r\n this.priorityNode_ = priorityNode_;\r\n this.lazyHash_ = null;\r\n assert(this.value_ !== undefined && this.value_ !== null, \"LeafNode shouldn't be created with null/undefined value.\");\r\n validatePriorityNode(this.priorityNode_);\r\n }\r\n Object.defineProperty(LeafNode, \"__childrenNodeConstructor\", {\r\n get: function () {\r\n return __childrenNodeConstructor;\r\n },\r\n set: function (val) {\r\n __childrenNodeConstructor = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /** @inheritDoc */\r\n LeafNode.prototype.isLeafNode = function () {\r\n return true;\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.getPriority = function () {\r\n return this.priorityNode_;\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.updatePriority = function (newPriorityNode) {\r\n return new LeafNode(this.value_, newPriorityNode);\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.getImmediateChild = function (childName) {\r\n // Hack to treat priority as a regular child\r\n if (childName === '.priority') {\r\n return this.priorityNode_;\r\n }\r\n else {\r\n return LeafNode.__childrenNodeConstructor.EMPTY_NODE;\r\n }\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.getChild = function (path) {\r\n if (path.isEmpty()) {\r\n return this;\r\n }\r\n else if (path.getFront() === '.priority') {\r\n return this.priorityNode_;\r\n }\r\n else {\r\n return LeafNode.__childrenNodeConstructor.EMPTY_NODE;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LeafNode.prototype.hasChild = function () {\r\n return false;\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.getPredecessorChildName = function (childName, childNode) {\r\n return null;\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.updateImmediateChild = function (childName, newChildNode) {\r\n if (childName === '.priority') {\r\n return this.updatePriority(newChildNode);\r\n }\r\n else if (newChildNode.isEmpty() && childName !== '.priority') {\r\n return this;\r\n }\r\n else {\r\n return LeafNode.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(childName, newChildNode).updatePriority(this.priorityNode_);\r\n }\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.updateChild = function (path, newChildNode) {\r\n var front = path.getFront();\r\n if (front === null) {\r\n return newChildNode;\r\n }\r\n else if (newChildNode.isEmpty() && front !== '.priority') {\r\n return this;\r\n }\r\n else {\r\n assert(front !== '.priority' || path.getLength() === 1, '.priority must be the last token in a path');\r\n return this.updateImmediateChild(front, LeafNode.__childrenNodeConstructor.EMPTY_NODE.updateChild(path.popFront(), newChildNode));\r\n }\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.isEmpty = function () {\r\n return false;\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.numChildren = function () {\r\n return 0;\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.forEachChild = function (index, action) {\r\n return false;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LeafNode.prototype.val = function (exportFormat) {\r\n if (exportFormat && !this.getPriority().isEmpty()) {\r\n return {\r\n '.value': this.getValue(),\r\n '.priority': this.getPriority().val()\r\n };\r\n }\r\n else {\r\n return this.getValue();\r\n }\r\n };\r\n /** @inheritDoc */\r\n LeafNode.prototype.hash = function () {\r\n if (this.lazyHash_ === null) {\r\n var toHash = '';\r\n if (!this.priorityNode_.isEmpty()) {\r\n toHash +=\r\n 'priority:' +\r\n priorityHashText(this.priorityNode_.val()) +\r\n ':';\r\n }\r\n var type = typeof this.value_;\r\n toHash += type + ':';\r\n if (type === 'number') {\r\n toHash += doubleToIEEE754String(this.value_);\r\n }\r\n else {\r\n toHash += this.value_;\r\n }\r\n this.lazyHash_ = sha1(toHash);\r\n }\r\n return this.lazyHash_;\r\n };\r\n /**\r\n * Returns the value of the leaf node.\r\n * @return {Object|string|number|boolean} The value of the node.\r\n */\r\n LeafNode.prototype.getValue = function () {\r\n return this.value_;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LeafNode.prototype.compareTo = function (other) {\r\n if (other === LeafNode.__childrenNodeConstructor.EMPTY_NODE) {\r\n return 1;\r\n }\r\n else if (other instanceof LeafNode.__childrenNodeConstructor) {\r\n return -1;\r\n }\r\n else {\r\n assert(other.isLeafNode(), 'Unknown node type');\r\n return this.compareToLeafNode_(other);\r\n }\r\n };\r\n /**\r\n * Comparison specifically for two leaf nodes\r\n * @param {!LeafNode} otherLeaf\r\n * @return {!number}\r\n * @private\r\n */\r\n LeafNode.prototype.compareToLeafNode_ = function (otherLeaf) {\r\n var otherLeafType = typeof otherLeaf.value_;\r\n var thisLeafType = typeof this.value_;\r\n var otherIndex = LeafNode.VALUE_TYPE_ORDER.indexOf(otherLeafType);\r\n var thisIndex = LeafNode.VALUE_TYPE_ORDER.indexOf(thisLeafType);\r\n assert(otherIndex >= 0, 'Unknown leaf type: ' + otherLeafType);\r\n assert(thisIndex >= 0, 'Unknown leaf type: ' + thisLeafType);\r\n if (otherIndex === thisIndex) {\r\n // Same type, compare values\r\n if (thisLeafType === 'object') {\r\n // Deferred value nodes are all equal, but we should also never get to this point...\r\n return 0;\r\n }\r\n else {\r\n // Note that this works because true > false, all others are number or string comparisons\r\n if (this.value_ < otherLeaf.value_) {\r\n return -1;\r\n }\r\n else if (this.value_ === otherLeaf.value_) {\r\n return 0;\r\n }\r\n else {\r\n return 1;\r\n }\r\n }\r\n }\r\n else {\r\n return thisIndex - otherIndex;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LeafNode.prototype.withIndex = function () {\r\n return this;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LeafNode.prototype.isIndexed = function () {\r\n return true;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LeafNode.prototype.equals = function (other) {\r\n /**\r\n * @inheritDoc\r\n */\r\n if (other === this) {\r\n return true;\r\n }\r\n else if (other.isLeafNode()) {\r\n var otherLeaf = other;\r\n return (this.value_ === otherLeaf.value_ &&\r\n this.priorityNode_.equals(otherLeaf.priorityNode_));\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n /**\r\n * The sort order for comparing leaf nodes of different types. If two leaf nodes have\r\n * the same type, the comparison falls back to their value\r\n * @type {Array.<!string>}\r\n * @const\r\n */\r\n LeafNode.VALUE_TYPE_ORDER = ['object', 'boolean', 'number', 'string'];\r\n return LeafNode;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar nodeFromJSON;\r\nvar MAX_NODE$1;\r\nfunction setNodeFromJSON(val) {\r\n nodeFromJSON = val;\r\n}\r\nfunction setMaxNode$1(val) {\r\n MAX_NODE$1 = val;\r\n}\r\n/**\r\n * @constructor\r\n * @extends {Index}\r\n * @private\r\n */\r\nvar PriorityIndex = /** @class */ (function (_super) {\r\n __extends(PriorityIndex, _super);\r\n function PriorityIndex() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n PriorityIndex.prototype.compare = function (a, b) {\r\n var aPriority = a.node.getPriority();\r\n var bPriority = b.node.getPriority();\r\n var indexCmp = aPriority.compareTo(bPriority);\r\n if (indexCmp === 0) {\r\n return nameCompare(a.name, b.name);\r\n }\r\n else {\r\n return indexCmp;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PriorityIndex.prototype.isDefinedOn = function (node) {\r\n return !node.getPriority().isEmpty();\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PriorityIndex.prototype.indexedValueChanged = function (oldNode, newNode) {\r\n return !oldNode.getPriority().equals(newNode.getPriority());\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PriorityIndex.prototype.minPost = function () {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return NamedNode.MIN;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PriorityIndex.prototype.maxPost = function () {\r\n return new NamedNode(MAX_NAME, new LeafNode('[PRIORITY-POST]', MAX_NODE$1));\r\n };\r\n /**\r\n * @param {*} indexValue\r\n * @param {string} name\r\n * @return {!NamedNode}\r\n */\r\n PriorityIndex.prototype.makePost = function (indexValue, name) {\r\n var priorityNode = nodeFromJSON(indexValue);\r\n return new NamedNode(name, new LeafNode('[PRIORITY-POST]', priorityNode));\r\n };\r\n /**\r\n * @return {!string} String representation for inclusion in a query spec\r\n */\r\n PriorityIndex.prototype.toString = function () {\r\n return '.priority';\r\n };\r\n return PriorityIndex;\r\n}(Index));\r\nvar PRIORITY_INDEX = new PriorityIndex();\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An iterator over an LLRBNode.\r\n */\r\nvar SortedMapIterator = /** @class */ (function () {\r\n /**\r\n * @template K, V, T\r\n * @param {LLRBNode|LLRBEmptyNode} node Node to iterate.\r\n * @param {?K} startKey\r\n * @param {function(K, K): number} comparator\r\n * @param {boolean} isReverse_ Whether or not to iterate in reverse\r\n * @param {(function(K, V):T)=} resultGenerator_\r\n */\r\n function SortedMapIterator(node, startKey, comparator, isReverse_, resultGenerator_) {\r\n if (resultGenerator_ === void 0) { resultGenerator_ = null; }\r\n this.isReverse_ = isReverse_;\r\n this.resultGenerator_ = resultGenerator_;\r\n /** @private\r\n * @type {Array.<!LLRBNode>}\r\n */\r\n this.nodeStack_ = [];\r\n var cmp = 1;\r\n while (!node.isEmpty()) {\r\n node = node;\r\n cmp = startKey ? comparator(node.key, startKey) : 1;\r\n // flip the comparison if we're going in reverse\r\n if (isReverse_) {\r\n cmp *= -1;\r\n }\r\n if (cmp < 0) {\r\n // This node is less than our start key. ignore it\r\n if (this.isReverse_) {\r\n node = node.left;\r\n }\r\n else {\r\n node = node.right;\r\n }\r\n }\r\n else if (cmp === 0) {\r\n // This node is exactly equal to our start key. Push it on the stack, but stop iterating;\r\n this.nodeStack_.push(node);\r\n break;\r\n }\r\n else {\r\n // This node is greater than our start key, add it to the stack and move to the next one\r\n this.nodeStack_.push(node);\r\n if (this.isReverse_) {\r\n node = node.right;\r\n }\r\n else {\r\n node = node.left;\r\n }\r\n }\r\n }\r\n }\r\n SortedMapIterator.prototype.getNext = function () {\r\n if (this.nodeStack_.length === 0) {\r\n return null;\r\n }\r\n var node = this.nodeStack_.pop();\r\n var result;\r\n if (this.resultGenerator_) {\r\n result = this.resultGenerator_(node.key, node.value);\r\n }\r\n else {\r\n result = { key: node.key, value: node.value };\r\n }\r\n if (this.isReverse_) {\r\n node = node.left;\r\n while (!node.isEmpty()) {\r\n this.nodeStack_.push(node);\r\n node = node.right;\r\n }\r\n }\r\n else {\r\n node = node.right;\r\n while (!node.isEmpty()) {\r\n this.nodeStack_.push(node);\r\n node = node.left;\r\n }\r\n }\r\n return result;\r\n };\r\n SortedMapIterator.prototype.hasNext = function () {\r\n return this.nodeStack_.length > 0;\r\n };\r\n SortedMapIterator.prototype.peek = function () {\r\n if (this.nodeStack_.length === 0) {\r\n return null;\r\n }\r\n var node = this.nodeStack_[this.nodeStack_.length - 1];\r\n if (this.resultGenerator_) {\r\n return this.resultGenerator_(node.key, node.value);\r\n }\r\n else {\r\n return { key: node.key, value: node.value };\r\n }\r\n };\r\n return SortedMapIterator;\r\n}());\r\n/**\r\n * Represents a node in a Left-leaning Red-Black tree.\r\n */\r\nvar LLRBNode = /** @class */ (function () {\r\n /**\r\n * @template K, V\r\n * @param {!K} key Key associated with this node.\r\n * @param {!V} value Value associated with this node.\r\n * @param {?boolean} color Whether this node is red.\r\n * @param {?(LLRBNode|LLRBEmptyNode)=} left Left child.\r\n * @param {?(LLRBNode|LLRBEmptyNode)=} right Right child.\r\n */\r\n function LLRBNode(key, value, color, left, right) {\r\n this.key = key;\r\n this.value = value;\r\n this.color = color != null ? color : LLRBNode.RED;\r\n this.left =\r\n left != null ? left : SortedMap.EMPTY_NODE;\r\n this.right =\r\n right != null ? right : SortedMap.EMPTY_NODE;\r\n }\r\n /**\r\n * Returns a copy of the current node, optionally replacing pieces of it.\r\n *\r\n * @param {?K} key New key for the node, or null.\r\n * @param {?V} value New value for the node, or null.\r\n * @param {?boolean} color New color for the node, or null.\r\n * @param {?LLRBNode|LLRBEmptyNode} left New left child for the node, or null.\r\n * @param {?LLRBNode|LLRBEmptyNode} right New right child for the node, or null.\r\n * @return {!LLRBNode} The node copy.\r\n */\r\n LLRBNode.prototype.copy = function (key, value, color, left, right) {\r\n return new LLRBNode(key != null ? key : this.key, value != null ? value : this.value, color != null ? color : this.color, left != null ? left : this.left, right != null ? right : this.right);\r\n };\r\n /**\r\n * @return {number} The total number of nodes in the tree.\r\n */\r\n LLRBNode.prototype.count = function () {\r\n return this.left.count() + 1 + this.right.count();\r\n };\r\n /**\r\n * @return {boolean} True if the tree is empty.\r\n */\r\n LLRBNode.prototype.isEmpty = function () {\r\n return false;\r\n };\r\n /**\r\n * Traverses the tree in key order and calls the specified action function\r\n * for each node.\r\n *\r\n * @param {function(!K, !V):*} action Callback function to be called for each\r\n * node. If it returns true, traversal is aborted.\r\n * @return {*} The first truthy value returned by action, or the last falsey\r\n * value returned by action\r\n */\r\n LLRBNode.prototype.inorderTraversal = function (action) {\r\n return (this.left.inorderTraversal(action) ||\r\n !!action(this.key, this.value) ||\r\n this.right.inorderTraversal(action));\r\n };\r\n /**\r\n * Traverses the tree in reverse key order and calls the specified action function\r\n * for each node.\r\n *\r\n * @param {function(!Object, !Object)} action Callback function to be called for each\r\n * node. If it returns true, traversal is aborted.\r\n * @return {*} True if traversal was aborted.\r\n */\r\n LLRBNode.prototype.reverseTraversal = function (action) {\r\n return (this.right.reverseTraversal(action) ||\r\n action(this.key, this.value) ||\r\n this.left.reverseTraversal(action));\r\n };\r\n /**\r\n * @return {!Object} The minimum node in the tree.\r\n * @private\r\n */\r\n LLRBNode.prototype.min_ = function () {\r\n if (this.left.isEmpty()) {\r\n return this;\r\n }\r\n else {\r\n return this.left.min_();\r\n }\r\n };\r\n /**\r\n * @return {!K} The maximum key in the tree.\r\n */\r\n LLRBNode.prototype.minKey = function () {\r\n return this.min_().key;\r\n };\r\n /**\r\n * @return {!K} The maximum key in the tree.\r\n */\r\n LLRBNode.prototype.maxKey = function () {\r\n if (this.right.isEmpty()) {\r\n return this.key;\r\n }\r\n else {\r\n return this.right.maxKey();\r\n }\r\n };\r\n /**\r\n *\r\n * @param {!Object} key Key to insert.\r\n * @param {!Object} value Value to insert.\r\n * @param {Comparator} comparator Comparator.\r\n * @return {!LLRBNode} New tree, with the key/value added.\r\n */\r\n LLRBNode.prototype.insert = function (key, value, comparator) {\r\n var n = this;\r\n var cmp = comparator(key, n.key);\r\n if (cmp < 0) {\r\n n = n.copy(null, null, null, n.left.insert(key, value, comparator), null);\r\n }\r\n else if (cmp === 0) {\r\n n = n.copy(null, value, null, null, null);\r\n }\r\n else {\r\n n = n.copy(null, null, null, null, n.right.insert(key, value, comparator));\r\n }\r\n return n.fixUp_();\r\n };\r\n /**\r\n * @private\r\n * @return {!LLRBNode|LLRBEmptyNode} New tree, with the minimum key removed.\r\n */\r\n LLRBNode.prototype.removeMin_ = function () {\r\n if (this.left.isEmpty()) {\r\n return SortedMap.EMPTY_NODE;\r\n }\r\n var n = this;\r\n if (!n.left.isRed_() && !n.left.left.isRed_()) {\r\n n = n.moveRedLeft_();\r\n }\r\n n = n.copy(null, null, null, n.left.removeMin_(), null);\r\n return n.fixUp_();\r\n };\r\n /**\r\n * @param {!Object} key The key of the item to remove.\r\n * @param {Comparator} comparator Comparator.\r\n * @return {!LLRBNode|LLRBEmptyNode} New tree, with the specified item removed.\r\n */\r\n LLRBNode.prototype.remove = function (key, comparator) {\r\n var n, smallest;\r\n n = this;\r\n if (comparator(key, n.key) < 0) {\r\n if (!n.left.isEmpty() && !n.left.isRed_() && !n.left.left.isRed_()) {\r\n n = n.moveRedLeft_();\r\n }\r\n n = n.copy(null, null, null, n.left.remove(key, comparator), null);\r\n }\r\n else {\r\n if (n.left.isRed_()) {\r\n n = n.rotateRight_();\r\n }\r\n if (!n.right.isEmpty() && !n.right.isRed_() && !n.right.left.isRed_()) {\r\n n = n.moveRedRight_();\r\n }\r\n if (comparator(key, n.key) === 0) {\r\n if (n.right.isEmpty()) {\r\n return SortedMap.EMPTY_NODE;\r\n }\r\n else {\r\n smallest = n.right.min_();\r\n n = n.copy(smallest.key, smallest.value, null, null, n.right.removeMin_());\r\n }\r\n }\r\n n = n.copy(null, null, null, null, n.right.remove(key, comparator));\r\n }\r\n return n.fixUp_();\r\n };\r\n /**\r\n * @private\r\n * @return {boolean} Whether this is a RED node.\r\n */\r\n LLRBNode.prototype.isRed_ = function () {\r\n return this.color;\r\n };\r\n /**\r\n * @private\r\n * @return {!LLRBNode} New tree after performing any needed rotations.\r\n */\r\n LLRBNode.prototype.fixUp_ = function () {\r\n var n = this;\r\n if (n.right.isRed_() && !n.left.isRed_()) {\r\n n = n.rotateLeft_();\r\n }\r\n if (n.left.isRed_() && n.left.left.isRed_()) {\r\n n = n.rotateRight_();\r\n }\r\n if (n.left.isRed_() && n.right.isRed_()) {\r\n n = n.colorFlip_();\r\n }\r\n return n;\r\n };\r\n /**\r\n * @private\r\n * @return {!LLRBNode} New tree, after moveRedLeft.\r\n */\r\n LLRBNode.prototype.moveRedLeft_ = function () {\r\n var n = this.colorFlip_();\r\n if (n.right.left.isRed_()) {\r\n n = n.copy(null, null, null, null, n.right.rotateRight_());\r\n n = n.rotateLeft_();\r\n n = n.colorFlip_();\r\n }\r\n return n;\r\n };\r\n /**\r\n * @private\r\n * @return {!LLRBNode} New tree, after moveRedRight.\r\n */\r\n LLRBNode.prototype.moveRedRight_ = function () {\r\n var n = this.colorFlip_();\r\n if (n.left.left.isRed_()) {\r\n n = n.rotateRight_();\r\n n = n.colorFlip_();\r\n }\r\n return n;\r\n };\r\n /**\r\n * @private\r\n * @return {!LLRBNode} New tree, after rotateLeft.\r\n */\r\n LLRBNode.prototype.rotateLeft_ = function () {\r\n var nl = this.copy(null, null, LLRBNode.RED, null, this.right.left);\r\n return this.right.copy(null, null, this.color, nl, null);\r\n };\r\n /**\r\n * @private\r\n * @return {!LLRBNode} New tree, after rotateRight.\r\n */\r\n LLRBNode.prototype.rotateRight_ = function () {\r\n var nr = this.copy(null, null, LLRBNode.RED, this.left.right, null);\r\n return this.left.copy(null, null, this.color, null, nr);\r\n };\r\n /**\r\n * @private\r\n * @return {!LLRBNode} New tree, after colorFlip.\r\n */\r\n LLRBNode.prototype.colorFlip_ = function () {\r\n var left = this.left.copy(null, null, !this.left.color, null, null);\r\n var right = this.right.copy(null, null, !this.right.color, null, null);\r\n return this.copy(null, null, !this.color, left, right);\r\n };\r\n /**\r\n * For testing.\r\n *\r\n * @private\r\n * @return {boolean} True if all is well.\r\n */\r\n LLRBNode.prototype.checkMaxDepth_ = function () {\r\n var blackDepth = this.check_();\r\n return Math.pow(2.0, blackDepth) <= this.count() + 1;\r\n };\r\n /**\r\n * @private\r\n * @return {number} Not sure what this returns exactly. :-).\r\n */\r\n LLRBNode.prototype.check_ = function () {\r\n if (this.isRed_() && this.left.isRed_()) {\r\n throw new Error('Red node has red child(' + this.key + ',' + this.value + ')');\r\n }\r\n if (this.right.isRed_()) {\r\n throw new Error('Right child of (' + this.key + ',' + this.value + ') is red');\r\n }\r\n var blackDepth = this.left.check_();\r\n if (blackDepth !== this.right.check_()) {\r\n throw new Error('Black depths differ');\r\n }\r\n else {\r\n return blackDepth + (this.isRed_() ? 0 : 1);\r\n }\r\n };\r\n LLRBNode.RED = true;\r\n LLRBNode.BLACK = false;\r\n return LLRBNode;\r\n}());\r\n/**\r\n * Represents an empty node (a leaf node in the Red-Black Tree).\r\n */\r\nvar LLRBEmptyNode = /** @class */ (function () {\r\n function LLRBEmptyNode() {\r\n }\r\n /**\r\n * Returns a copy of the current node.\r\n *\r\n * @return {!LLRBEmptyNode} The node copy.\r\n */\r\n LLRBEmptyNode.prototype.copy = function (key, value, color, left, right) {\r\n return this;\r\n };\r\n /**\r\n * Returns a copy of the tree, with the specified key/value added.\r\n *\r\n * @param {!K} key Key to be added.\r\n * @param {!V} value Value to be added.\r\n * @param {Comparator} comparator Comparator.\r\n * @return {!LLRBNode} New tree, with item added.\r\n */\r\n LLRBEmptyNode.prototype.insert = function (key, value, comparator) {\r\n return new LLRBNode(key, value, null);\r\n };\r\n /**\r\n * Returns a copy of the tree, with the specified key removed.\r\n *\r\n * @param {!K} key The key to remove.\r\n * @param {Comparator} comparator Comparator.\r\n * @return {!LLRBEmptyNode} New tree, with item removed.\r\n */\r\n LLRBEmptyNode.prototype.remove = function (key, comparator) {\r\n return this;\r\n };\r\n /**\r\n * @return {number} The total number of nodes in the tree.\r\n */\r\n LLRBEmptyNode.prototype.count = function () {\r\n return 0;\r\n };\r\n /**\r\n * @return {boolean} True if the tree is empty.\r\n */\r\n LLRBEmptyNode.prototype.isEmpty = function () {\r\n return true;\r\n };\r\n /**\r\n * Traverses the tree in key order and calls the specified action function\r\n * for each node.\r\n *\r\n * @param {function(!K, !V):*} action Callback function to be called for each\r\n * node. If it returns true, traversal is aborted.\r\n * @return {boolean} True if traversal was aborted.\r\n */\r\n LLRBEmptyNode.prototype.inorderTraversal = function (action) {\r\n return false;\r\n };\r\n /**\r\n * Traverses the tree in reverse key order and calls the specified action function\r\n * for each node.\r\n *\r\n * @param {function(!K, !V)} action Callback function to be called for each\r\n * node. If it returns true, traversal is aborted.\r\n * @return {boolean} True if traversal was aborted.\r\n */\r\n LLRBEmptyNode.prototype.reverseTraversal = function (action) {\r\n return false;\r\n };\r\n /**\r\n * @return {null}\r\n */\r\n LLRBEmptyNode.prototype.minKey = function () {\r\n return null;\r\n };\r\n /**\r\n * @return {null}\r\n */\r\n LLRBEmptyNode.prototype.maxKey = function () {\r\n return null;\r\n };\r\n /**\r\n * @private\r\n * @return {number} Not sure what this returns exactly. :-).\r\n */\r\n LLRBEmptyNode.prototype.check_ = function () {\r\n return 0;\r\n };\r\n /**\r\n * @private\r\n * @return {boolean} Whether this node is red.\r\n */\r\n LLRBEmptyNode.prototype.isRed_ = function () {\r\n return false;\r\n };\r\n return LLRBEmptyNode;\r\n}());\r\n/**\r\n * An immutable sorted map implementation, based on a Left-leaning Red-Black\r\n * tree.\r\n */\r\nvar SortedMap = /** @class */ (function () {\r\n /**\r\n * @template K, V\r\n * @param {function(K, K):number} comparator_ Key comparator.\r\n * @param {LLRBNode=} root_ (Optional) Root node for the map.\r\n */\r\n function SortedMap(comparator_, root_) {\r\n if (root_ === void 0) { root_ = SortedMap.EMPTY_NODE; }\r\n this.comparator_ = comparator_;\r\n this.root_ = root_;\r\n }\r\n /**\r\n * Returns a copy of the map, with the specified key/value added or replaced.\r\n * (TODO: We should perhaps rename this method to 'put')\r\n *\r\n * @param {!K} key Key to be added.\r\n * @param {!V} value Value to be added.\r\n * @return {!SortedMap.<K, V>} New map, with item added.\r\n */\r\n SortedMap.prototype.insert = function (key, value) {\r\n return new SortedMap(this.comparator_, this.root_\r\n .insert(key, value, this.comparator_)\r\n .copy(null, null, LLRBNode.BLACK, null, null));\r\n };\r\n /**\r\n * Returns a copy of the map, with the specified key removed.\r\n *\r\n * @param {!K} key The key to remove.\r\n * @return {!SortedMap.<K, V>} New map, with item removed.\r\n */\r\n SortedMap.prototype.remove = function (key) {\r\n return new SortedMap(this.comparator_, this.root_\r\n .remove(key, this.comparator_)\r\n .copy(null, null, LLRBNode.BLACK, null, null));\r\n };\r\n /**\r\n * Returns the value of the node with the given key, or null.\r\n *\r\n * @param {!K} key The key to look up.\r\n * @return {?V} The value of the node with the given key, or null if the\r\n * key doesn't exist.\r\n */\r\n SortedMap.prototype.get = function (key) {\r\n var cmp;\r\n var node = this.root_;\r\n while (!node.isEmpty()) {\r\n cmp = this.comparator_(key, node.key);\r\n if (cmp === 0) {\r\n return node.value;\r\n }\r\n else if (cmp < 0) {\r\n node = node.left;\r\n }\r\n else if (cmp > 0) {\r\n node = node.right;\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * Returns the key of the item *before* the specified key, or null if key is the first item.\r\n * @param {K} key The key to find the predecessor of\r\n * @return {?K} The predecessor key.\r\n */\r\n SortedMap.prototype.getPredecessorKey = function (key) {\r\n var cmp, node = this.root_, rightParent = null;\r\n while (!node.isEmpty()) {\r\n cmp = this.comparator_(key, node.key);\r\n if (cmp === 0) {\r\n if (!node.left.isEmpty()) {\r\n node = node.left;\r\n while (!node.right.isEmpty()) {\r\n node = node.right;\r\n }\r\n return node.key;\r\n }\r\n else if (rightParent) {\r\n return rightParent.key;\r\n }\r\n else {\r\n return null; // first item.\r\n }\r\n }\r\n else if (cmp < 0) {\r\n node = node.left;\r\n }\r\n else if (cmp > 0) {\r\n rightParent = node;\r\n node = node.right;\r\n }\r\n }\r\n throw new Error('Attempted to find predecessor key for a nonexistent key. What gives?');\r\n };\r\n /**\r\n * @return {boolean} True if the map is empty.\r\n */\r\n SortedMap.prototype.isEmpty = function () {\r\n return this.root_.isEmpty();\r\n };\r\n /**\r\n * @return {number} The total number of nodes in the map.\r\n */\r\n SortedMap.prototype.count = function () {\r\n return this.root_.count();\r\n };\r\n /**\r\n * @return {?K} The minimum key in the map.\r\n */\r\n SortedMap.prototype.minKey = function () {\r\n return this.root_.minKey();\r\n };\r\n /**\r\n * @return {?K} The maximum key in the map.\r\n */\r\n SortedMap.prototype.maxKey = function () {\r\n return this.root_.maxKey();\r\n };\r\n /**\r\n * Traverses the map in key order and calls the specified action function\r\n * for each key/value pair.\r\n *\r\n * @param {function(!K, !V):*} action Callback function to be called\r\n * for each key/value pair. If action returns true, traversal is aborted.\r\n * @return {*} The first truthy value returned by action, or the last falsey\r\n * value returned by action\r\n */\r\n SortedMap.prototype.inorderTraversal = function (action) {\r\n return this.root_.inorderTraversal(action);\r\n };\r\n /**\r\n * Traverses the map in reverse key order and calls the specified action function\r\n * for each key/value pair.\r\n *\r\n * @param {function(!Object, !Object)} action Callback function to be called\r\n * for each key/value pair. If action returns true, traversal is aborted.\r\n * @return {*} True if the traversal was aborted.\r\n */\r\n SortedMap.prototype.reverseTraversal = function (action) {\r\n return this.root_.reverseTraversal(action);\r\n };\r\n /**\r\n * Returns an iterator over the SortedMap.\r\n * @template T\r\n * @param {(function(K, V):T)=} resultGenerator\r\n * @return {SortedMapIterator.<K, V, T>} The iterator.\r\n */\r\n SortedMap.prototype.getIterator = function (resultGenerator) {\r\n return new SortedMapIterator(this.root_, null, this.comparator_, false, resultGenerator);\r\n };\r\n SortedMap.prototype.getIteratorFrom = function (key, resultGenerator) {\r\n return new SortedMapIterator(this.root_, key, this.comparator_, false, resultGenerator);\r\n };\r\n SortedMap.prototype.getReverseIteratorFrom = function (key, resultGenerator) {\r\n return new SortedMapIterator(this.root_, key, this.comparator_, true, resultGenerator);\r\n };\r\n SortedMap.prototype.getReverseIterator = function (resultGenerator) {\r\n return new SortedMapIterator(this.root_, null, this.comparator_, true, resultGenerator);\r\n };\r\n /**\r\n * Always use the same empty node, to reduce memory.\r\n * @const\r\n */\r\n SortedMap.EMPTY_NODE = new LLRBEmptyNode();\r\n return SortedMap;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar LOG_2 = Math.log(2);\r\n/**\r\n * @constructor\r\n */\r\nvar Base12Num = /** @class */ (function () {\r\n /**\r\n * @param {number} length\r\n */\r\n function Base12Num(length) {\r\n var logBase2 = function (num) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return parseInt((Math.log(num) / LOG_2), 10);\r\n };\r\n var bitMask = function (bits) { return parseInt(Array(bits + 1).join('1'), 2); };\r\n this.count = logBase2(length + 1);\r\n this.current_ = this.count - 1;\r\n var mask = bitMask(this.count);\r\n this.bits_ = (length + 1) & mask;\r\n }\r\n /**\r\n * @return {boolean}\r\n */\r\n Base12Num.prototype.nextBitIsOne = function () {\r\n //noinspection JSBitwiseOperatorUsage\r\n var result = !(this.bits_ & (0x1 << this.current_));\r\n this.current_--;\r\n return result;\r\n };\r\n return Base12Num;\r\n}());\r\n/**\r\n * Takes a list of child nodes and constructs a SortedSet using the given comparison\r\n * function\r\n *\r\n * Uses the algorithm described in the paper linked here:\r\n * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.46.1458\r\n *\r\n * @template K, V\r\n * @param {Array.<!NamedNode>} childList Unsorted list of children\r\n * @param {function(!NamedNode, !NamedNode):number} cmp The comparison method to be used\r\n * @param {(function(NamedNode):K)=} keyFn An optional function to extract K from a node wrapper, if K's\r\n * type is not NamedNode\r\n * @param {(function(K, K):number)=} mapSortFn An optional override for comparator used by the generated sorted map\r\n * @return {SortedMap.<K, V>}\r\n */\r\nvar buildChildSet = function (childList, cmp, keyFn, mapSortFn) {\r\n childList.sort(cmp);\r\n var buildBalancedTree = function (low, high) {\r\n var length = high - low;\r\n var namedNode;\r\n var key;\r\n if (length === 0) {\r\n return null;\r\n }\r\n else if (length === 1) {\r\n namedNode = childList[low];\r\n key = keyFn ? keyFn(namedNode) : namedNode;\r\n return new LLRBNode(key, namedNode.node, LLRBNode.BLACK, null, null);\r\n }\r\n else {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n var middle = parseInt((length / 2), 10) + low;\r\n var left = buildBalancedTree(low, middle);\r\n var right = buildBalancedTree(middle + 1, high);\r\n namedNode = childList[middle];\r\n key = keyFn ? keyFn(namedNode) : namedNode;\r\n return new LLRBNode(key, namedNode.node, LLRBNode.BLACK, left, right);\r\n }\r\n };\r\n var buildFrom12Array = function (base12) {\r\n var node = null;\r\n var root = null;\r\n var index = childList.length;\r\n var buildPennant = function (chunkSize, color) {\r\n var low = index - chunkSize;\r\n var high = index;\r\n index -= chunkSize;\r\n var childTree = buildBalancedTree(low + 1, high);\r\n var namedNode = childList[low];\r\n var key = keyFn ? keyFn(namedNode) : namedNode;\r\n attachPennant(new LLRBNode(key, namedNode.node, color, null, childTree));\r\n };\r\n var attachPennant = function (pennant) {\r\n if (node) {\r\n node.left = pennant;\r\n node = pennant;\r\n }\r\n else {\r\n root = pennant;\r\n node = pennant;\r\n }\r\n };\r\n for (var i = 0; i < base12.count; ++i) {\r\n var isOne = base12.nextBitIsOne();\r\n // The number of nodes taken in each slice is 2^(arr.length - (i + 1))\r\n var chunkSize = Math.pow(2, base12.count - (i + 1));\r\n if (isOne) {\r\n buildPennant(chunkSize, LLRBNode.BLACK);\r\n }\r\n else {\r\n // current == 2\r\n buildPennant(chunkSize, LLRBNode.BLACK);\r\n buildPennant(chunkSize, LLRBNode.RED);\r\n }\r\n }\r\n return root;\r\n };\r\n var base12 = new Base12Num(childList.length);\r\n var root = buildFrom12Array(base12);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return new SortedMap(mapSortFn || cmp, root);\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar _defaultIndexMap;\r\nvar fallbackObject = {};\r\nvar IndexMap = /** @class */ (function () {\r\n function IndexMap(indexes_, indexSet_) {\r\n this.indexes_ = indexes_;\r\n this.indexSet_ = indexSet_;\r\n }\r\n Object.defineProperty(IndexMap, \"Default\", {\r\n /**\r\n * The default IndexMap for nodes without a priority\r\n */\r\n get: function () {\r\n assert(fallbackObject && PRIORITY_INDEX, 'ChildrenNode.ts has not been loaded');\r\n _defaultIndexMap =\r\n _defaultIndexMap ||\r\n new IndexMap({ '.priority': fallbackObject }, { '.priority': PRIORITY_INDEX });\r\n return _defaultIndexMap;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n IndexMap.prototype.get = function (indexKey) {\r\n var sortedMap = safeGet(this.indexes_, indexKey);\r\n if (!sortedMap) {\r\n throw new Error('No index defined for ' + indexKey);\r\n }\r\n if (sortedMap instanceof SortedMap) {\r\n return sortedMap;\r\n }\r\n else {\r\n // The index exists, but it falls back to just name comparison. Return null so that the calling code uses the\r\n // regular child map\r\n return null;\r\n }\r\n };\r\n IndexMap.prototype.hasIndex = function (indexDefinition) {\r\n return contains(this.indexSet_, indexDefinition.toString());\r\n };\r\n IndexMap.prototype.addIndex = function (indexDefinition, existingChildren) {\r\n assert(indexDefinition !== KEY_INDEX, \"KeyIndex always exists and isn't meant to be added to the IndexMap.\");\r\n var childList = [];\r\n var sawIndexedValue = false;\r\n var iter = existingChildren.getIterator(NamedNode.Wrap);\r\n var next = iter.getNext();\r\n while (next) {\r\n sawIndexedValue =\r\n sawIndexedValue || indexDefinition.isDefinedOn(next.node);\r\n childList.push(next);\r\n next = iter.getNext();\r\n }\r\n var newIndex;\r\n if (sawIndexedValue) {\r\n newIndex = buildChildSet(childList, indexDefinition.getCompare());\r\n }\r\n else {\r\n newIndex = fallbackObject;\r\n }\r\n var indexName = indexDefinition.toString();\r\n var newIndexSet = __assign({}, this.indexSet_);\r\n newIndexSet[indexName] = indexDefinition;\r\n var newIndexes = __assign({}, this.indexes_);\r\n newIndexes[indexName] = newIndex;\r\n return new IndexMap(newIndexes, newIndexSet);\r\n };\r\n /**\r\n * Ensure that this node is properly tracked in any indexes that we're maintaining\r\n */\r\n IndexMap.prototype.addToIndexes = function (namedNode, existingChildren) {\r\n var _this = this;\r\n var newIndexes = map(this.indexes_, function (indexedChildren, indexName) {\r\n var index = safeGet(_this.indexSet_, indexName);\r\n assert(index, 'Missing index implementation for ' + indexName);\r\n if (indexedChildren === fallbackObject) {\r\n // Check to see if we need to index everything\r\n if (index.isDefinedOn(namedNode.node)) {\r\n // We need to build this index\r\n var childList = [];\r\n var iter = existingChildren.getIterator(NamedNode.Wrap);\r\n var next = iter.getNext();\r\n while (next) {\r\n if (next.name !== namedNode.name) {\r\n childList.push(next);\r\n }\r\n next = iter.getNext();\r\n }\r\n childList.push(namedNode);\r\n return buildChildSet(childList, index.getCompare());\r\n }\r\n else {\r\n // No change, this remains a fallback\r\n return fallbackObject;\r\n }\r\n }\r\n else {\r\n var existingSnap = existingChildren.get(namedNode.name);\r\n var newChildren = indexedChildren;\r\n if (existingSnap) {\r\n newChildren = newChildren.remove(new NamedNode(namedNode.name, existingSnap));\r\n }\r\n return newChildren.insert(namedNode, namedNode.node);\r\n }\r\n });\r\n return new IndexMap(newIndexes, this.indexSet_);\r\n };\r\n /**\r\n * Create a new IndexMap instance with the given value removed\r\n */\r\n IndexMap.prototype.removeFromIndexes = function (namedNode, existingChildren) {\r\n var newIndexes = map(this.indexes_, function (indexedChildren) {\r\n if (indexedChildren === fallbackObject) {\r\n // This is the fallback. Just return it, nothing to do in this case\r\n return indexedChildren;\r\n }\r\n else {\r\n var existingSnap = existingChildren.get(namedNode.name);\r\n if (existingSnap) {\r\n return indexedChildren.remove(new NamedNode(namedNode.name, existingSnap));\r\n }\r\n else {\r\n // No record of this child\r\n return indexedChildren;\r\n }\r\n }\r\n });\r\n return new IndexMap(newIndexes, this.indexSet_);\r\n };\r\n return IndexMap;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction NAME_ONLY_COMPARATOR(left, right) {\r\n return nameCompare(left.name, right.name);\r\n}\r\nfunction NAME_COMPARATOR(left, right) {\r\n return nameCompare(left, right);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// TODO: For memory savings, don't store priorityNode_ if it's empty.\r\nvar EMPTY_NODE;\r\n/**\r\n * ChildrenNode is a class for storing internal nodes in a DataSnapshot\r\n * (i.e. nodes with children). It implements Node and stores the\r\n * list of children in the children property, sorted by child name.\r\n *\r\n * @constructor\r\n * @implements {Node}\r\n */\r\nvar ChildrenNode = /** @class */ (function () {\r\n /**\r\n *\r\n * @param {!SortedMap.<string, !Node>} children_ List of children\r\n * of this node..\r\n * @param {?Node} priorityNode_ The priority of this node (as a snapshot node).\r\n * @param {!IndexMap} indexMap_\r\n */\r\n function ChildrenNode(children_, priorityNode_, indexMap_) {\r\n this.children_ = children_;\r\n this.priorityNode_ = priorityNode_;\r\n this.indexMap_ = indexMap_;\r\n this.lazyHash_ = null;\r\n /**\r\n * Note: The only reason we allow null priority is for EMPTY_NODE, since we can't use\r\n * EMPTY_NODE as the priority of EMPTY_NODE. We might want to consider making EMPTY_NODE its own\r\n * class instead of an empty ChildrenNode.\r\n */\r\n if (this.priorityNode_) {\r\n validatePriorityNode(this.priorityNode_);\r\n }\r\n if (this.children_.isEmpty()) {\r\n assert(!this.priorityNode_ || this.priorityNode_.isEmpty(), 'An empty node cannot have a priority');\r\n }\r\n }\r\n Object.defineProperty(ChildrenNode, \"EMPTY_NODE\", {\r\n get: function () {\r\n return (EMPTY_NODE ||\r\n (EMPTY_NODE = new ChildrenNode(new SortedMap(NAME_COMPARATOR), null, IndexMap.Default)));\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.isLeafNode = function () {\r\n return false;\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.getPriority = function () {\r\n return this.priorityNode_ || EMPTY_NODE;\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.updatePriority = function (newPriorityNode) {\r\n if (this.children_.isEmpty()) {\r\n // Don't allow priorities on empty nodes\r\n return this;\r\n }\r\n else {\r\n return new ChildrenNode(this.children_, newPriorityNode, this.indexMap_);\r\n }\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.getImmediateChild = function (childName) {\r\n // Hack to treat priority as a regular child\r\n if (childName === '.priority') {\r\n return this.getPriority();\r\n }\r\n else {\r\n var child = this.children_.get(childName);\r\n return child === null ? EMPTY_NODE : child;\r\n }\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.getChild = function (path) {\r\n var front = path.getFront();\r\n if (front === null) {\r\n return this;\r\n }\r\n return this.getImmediateChild(front).getChild(path.popFront());\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.hasChild = function (childName) {\r\n return this.children_.get(childName) !== null;\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.updateImmediateChild = function (childName, newChildNode) {\r\n assert(newChildNode, 'We should always be passing snapshot nodes');\r\n if (childName === '.priority') {\r\n return this.updatePriority(newChildNode);\r\n }\r\n else {\r\n var namedNode = new NamedNode(childName, newChildNode);\r\n var newChildren = void 0, newIndexMap = void 0;\r\n if (newChildNode.isEmpty()) {\r\n newChildren = this.children_.remove(childName);\r\n newIndexMap = this.indexMap_.removeFromIndexes(namedNode, this.children_);\r\n }\r\n else {\r\n newChildren = this.children_.insert(childName, newChildNode);\r\n newIndexMap = this.indexMap_.addToIndexes(namedNode, this.children_);\r\n }\r\n var newPriority = newChildren.isEmpty()\r\n ? EMPTY_NODE\r\n : this.priorityNode_;\r\n return new ChildrenNode(newChildren, newPriority, newIndexMap);\r\n }\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.updateChild = function (path, newChildNode) {\r\n var front = path.getFront();\r\n if (front === null) {\r\n return newChildNode;\r\n }\r\n else {\r\n assert(path.getFront() !== '.priority' || path.getLength() === 1, '.priority must be the last token in a path');\r\n var newImmediateChild = this.getImmediateChild(front).updateChild(path.popFront(), newChildNode);\r\n return this.updateImmediateChild(front, newImmediateChild);\r\n }\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.isEmpty = function () {\r\n return this.children_.isEmpty();\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.numChildren = function () {\r\n return this.children_.count();\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.val = function (exportFormat) {\r\n if (this.isEmpty()) {\r\n return null;\r\n }\r\n var obj = {};\r\n var numKeys = 0, maxKey = 0, allIntegerKeys = true;\r\n this.forEachChild(PRIORITY_INDEX, function (key, childNode) {\r\n obj[key] = childNode.val(exportFormat);\r\n numKeys++;\r\n if (allIntegerKeys && ChildrenNode.INTEGER_REGEXP_.test(key)) {\r\n maxKey = Math.max(maxKey, Number(key));\r\n }\r\n else {\r\n allIntegerKeys = false;\r\n }\r\n });\r\n if (!exportFormat && allIntegerKeys && maxKey < 2 * numKeys) {\r\n // convert to array.\r\n var array = [];\r\n // eslint-disable-next-line guard-for-in\r\n for (var key in obj) {\r\n array[key] = obj[key];\r\n }\r\n return array;\r\n }\r\n else {\r\n if (exportFormat && !this.getPriority().isEmpty()) {\r\n obj['.priority'] = this.getPriority().val();\r\n }\r\n return obj;\r\n }\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.hash = function () {\r\n if (this.lazyHash_ === null) {\r\n var toHash_1 = '';\r\n if (!this.getPriority().isEmpty()) {\r\n toHash_1 +=\r\n 'priority:' +\r\n priorityHashText(this.getPriority().val()) +\r\n ':';\r\n }\r\n this.forEachChild(PRIORITY_INDEX, function (key, childNode) {\r\n var childHash = childNode.hash();\r\n if (childHash !== '') {\r\n toHash_1 += ':' + key + ':' + childHash;\r\n }\r\n });\r\n this.lazyHash_ = toHash_1 === '' ? '' : sha1(toHash_1);\r\n }\r\n return this.lazyHash_;\r\n };\r\n /** @inheritDoc */\r\n ChildrenNode.prototype.getPredecessorChildName = function (childName, childNode, index) {\r\n var idx = this.resolveIndex_(index);\r\n if (idx) {\r\n var predecessor = idx.getPredecessorKey(new NamedNode(childName, childNode));\r\n return predecessor ? predecessor.name : null;\r\n }\r\n else {\r\n return this.children_.getPredecessorKey(childName);\r\n }\r\n };\r\n /**\r\n * @param {!Index} indexDefinition\r\n * @return {?string}\r\n */\r\n ChildrenNode.prototype.getFirstChildName = function (indexDefinition) {\r\n var idx = this.resolveIndex_(indexDefinition);\r\n if (idx) {\r\n var minKey = idx.minKey();\r\n return minKey && minKey.name;\r\n }\r\n else {\r\n return this.children_.minKey();\r\n }\r\n };\r\n /**\r\n * @param {!Index} indexDefinition\r\n * @return {?NamedNode}\r\n */\r\n ChildrenNode.prototype.getFirstChild = function (indexDefinition) {\r\n var minKey = this.getFirstChildName(indexDefinition);\r\n if (minKey) {\r\n return new NamedNode(minKey, this.children_.get(minKey));\r\n }\r\n else {\r\n return null;\r\n }\r\n };\r\n /**\r\n * Given an index, return the key name of the largest value we have, according to that index\r\n * @param {!Index} indexDefinition\r\n * @return {?string}\r\n */\r\n ChildrenNode.prototype.getLastChildName = function (indexDefinition) {\r\n var idx = this.resolveIndex_(indexDefinition);\r\n if (idx) {\r\n var maxKey = idx.maxKey();\r\n return maxKey && maxKey.name;\r\n }\r\n else {\r\n return this.children_.maxKey();\r\n }\r\n };\r\n /**\r\n * @param {!Index} indexDefinition\r\n * @return {?NamedNode}\r\n */\r\n ChildrenNode.prototype.getLastChild = function (indexDefinition) {\r\n var maxKey = this.getLastChildName(indexDefinition);\r\n if (maxKey) {\r\n return new NamedNode(maxKey, this.children_.get(maxKey));\r\n }\r\n else {\r\n return null;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildrenNode.prototype.forEachChild = function (index, action) {\r\n var idx = this.resolveIndex_(index);\r\n if (idx) {\r\n return idx.inorderTraversal(function (wrappedNode) {\r\n return action(wrappedNode.name, wrappedNode.node);\r\n });\r\n }\r\n else {\r\n return this.children_.inorderTraversal(action);\r\n }\r\n };\r\n /**\r\n * @param {!Index} indexDefinition\r\n * @return {SortedMapIterator}\r\n */\r\n ChildrenNode.prototype.getIterator = function (indexDefinition) {\r\n return this.getIteratorFrom(indexDefinition.minPost(), indexDefinition);\r\n };\r\n /**\r\n *\r\n * @param {!NamedNode} startPost\r\n * @param {!Index} indexDefinition\r\n * @return {!SortedMapIterator}\r\n */\r\n ChildrenNode.prototype.getIteratorFrom = function (startPost, indexDefinition) {\r\n var idx = this.resolveIndex_(indexDefinition);\r\n if (idx) {\r\n return idx.getIteratorFrom(startPost, function (key) { return key; });\r\n }\r\n else {\r\n var iterator = this.children_.getIteratorFrom(startPost.name, NamedNode.Wrap);\r\n var next = iterator.peek();\r\n while (next != null && indexDefinition.compare(next, startPost) < 0) {\r\n iterator.getNext();\r\n next = iterator.peek();\r\n }\r\n return iterator;\r\n }\r\n };\r\n /**\r\n * @param {!Index} indexDefinition\r\n * @return {!SortedMapIterator}\r\n */\r\n ChildrenNode.prototype.getReverseIterator = function (indexDefinition) {\r\n return this.getReverseIteratorFrom(indexDefinition.maxPost(), indexDefinition);\r\n };\r\n /**\r\n * @param {!NamedNode} endPost\r\n * @param {!Index} indexDefinition\r\n * @return {!SortedMapIterator}\r\n */\r\n ChildrenNode.prototype.getReverseIteratorFrom = function (endPost, indexDefinition) {\r\n var idx = this.resolveIndex_(indexDefinition);\r\n if (idx) {\r\n return idx.getReverseIteratorFrom(endPost, function (key) {\r\n return key;\r\n });\r\n }\r\n else {\r\n var iterator = this.children_.getReverseIteratorFrom(endPost.name, NamedNode.Wrap);\r\n var next = iterator.peek();\r\n while (next != null && indexDefinition.compare(next, endPost) > 0) {\r\n iterator.getNext();\r\n next = iterator.peek();\r\n }\r\n return iterator;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildrenNode.prototype.compareTo = function (other) {\r\n if (this.isEmpty()) {\r\n if (other.isEmpty()) {\r\n return 0;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n else if (other.isLeafNode() || other.isEmpty()) {\r\n return 1;\r\n }\r\n else if (other === MAX_NODE$2) {\r\n return -1;\r\n }\r\n else {\r\n // Must be another node with children.\r\n return 0;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildrenNode.prototype.withIndex = function (indexDefinition) {\r\n if (indexDefinition === KEY_INDEX ||\r\n this.indexMap_.hasIndex(indexDefinition)) {\r\n return this;\r\n }\r\n else {\r\n var newIndexMap = this.indexMap_.addIndex(indexDefinition, this.children_);\r\n return new ChildrenNode(this.children_, this.priorityNode_, newIndexMap);\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildrenNode.prototype.isIndexed = function (index) {\r\n return index === KEY_INDEX || this.indexMap_.hasIndex(index);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildrenNode.prototype.equals = function (other) {\r\n if (other === this) {\r\n return true;\r\n }\r\n else if (other.isLeafNode()) {\r\n return false;\r\n }\r\n else {\r\n var otherChildrenNode = other;\r\n if (!this.getPriority().equals(otherChildrenNode.getPriority())) {\r\n return false;\r\n }\r\n else if (this.children_.count() === otherChildrenNode.children_.count()) {\r\n var thisIter = this.getIterator(PRIORITY_INDEX);\r\n var otherIter = otherChildrenNode.getIterator(PRIORITY_INDEX);\r\n var thisCurrent = thisIter.getNext();\r\n var otherCurrent = otherIter.getNext();\r\n while (thisCurrent && otherCurrent) {\r\n if (thisCurrent.name !== otherCurrent.name ||\r\n !thisCurrent.node.equals(otherCurrent.node)) {\r\n return false;\r\n }\r\n thisCurrent = thisIter.getNext();\r\n otherCurrent = otherIter.getNext();\r\n }\r\n return thisCurrent === null && otherCurrent === null;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n };\r\n /**\r\n * Returns a SortedMap ordered by index, or null if the default (by-key) ordering can be used\r\n * instead.\r\n *\r\n * @private\r\n * @param {!Index} indexDefinition\r\n * @return {?SortedMap.<NamedNode, Node>}\r\n */\r\n ChildrenNode.prototype.resolveIndex_ = function (indexDefinition) {\r\n if (indexDefinition === KEY_INDEX) {\r\n return null;\r\n }\r\n else {\r\n return this.indexMap_.get(indexDefinition.toString());\r\n }\r\n };\r\n /**\r\n * @private\r\n * @type {RegExp}\r\n */\r\n ChildrenNode.INTEGER_REGEXP_ = /^(0|[1-9]\\d*)$/;\r\n return ChildrenNode;\r\n}());\r\n/**\r\n * @constructor\r\n * @extends {ChildrenNode}\r\n * @private\r\n */\r\nvar MaxNode = /** @class */ (function (_super) {\r\n __extends(MaxNode, _super);\r\n function MaxNode() {\r\n return _super.call(this, new SortedMap(NAME_COMPARATOR), ChildrenNode.EMPTY_NODE, IndexMap.Default) || this;\r\n }\r\n MaxNode.prototype.compareTo = function (other) {\r\n if (other === this) {\r\n return 0;\r\n }\r\n else {\r\n return 1;\r\n }\r\n };\r\n MaxNode.prototype.equals = function (other) {\r\n // Not that we every compare it, but MAX_NODE is only ever equal to itself\r\n return other === this;\r\n };\r\n MaxNode.prototype.getPriority = function () {\r\n return this;\r\n };\r\n MaxNode.prototype.getImmediateChild = function (childName) {\r\n return ChildrenNode.EMPTY_NODE;\r\n };\r\n MaxNode.prototype.isEmpty = function () {\r\n return false;\r\n };\r\n return MaxNode;\r\n}(ChildrenNode));\r\n/**\r\n * Marker that will sort higher than any other snapshot.\r\n * @type {!MAX_NODE}\r\n * @const\r\n */\r\nvar MAX_NODE$2 = new MaxNode();\r\nObject.defineProperties(NamedNode, {\r\n MIN: {\r\n value: new NamedNode(MIN_NAME, ChildrenNode.EMPTY_NODE)\r\n },\r\n MAX: {\r\n value: new NamedNode(MAX_NAME, MAX_NODE$2)\r\n }\r\n});\r\n/**\r\n * Reference Extensions\r\n */\r\nKeyIndex.__EMPTY_NODE = ChildrenNode.EMPTY_NODE;\r\nLeafNode.__childrenNodeConstructor = ChildrenNode;\r\nsetMaxNode(MAX_NODE$2);\r\nsetMaxNode$1(MAX_NODE$2);\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar USE_HINZE = true;\r\n/**\r\n * Constructs a snapshot node representing the passed JSON and returns it.\r\n * @param {*} json JSON to create a node for.\r\n * @param {?string|?number=} priority Optional priority to use. This will be ignored if the\r\n * passed JSON contains a .priority property.\r\n * @return {!Node}\r\n */\r\nfunction nodeFromJSON$1(json, priority) {\r\n if (priority === void 0) { priority = null; }\r\n if (json === null) {\r\n return ChildrenNode.EMPTY_NODE;\r\n }\r\n if (typeof json === 'object' && '.priority' in json) {\r\n priority = json['.priority'];\r\n }\r\n assert(priority === null ||\r\n typeof priority === 'string' ||\r\n typeof priority === 'number' ||\r\n (typeof priority === 'object' && '.sv' in priority), 'Invalid priority type found: ' + typeof priority);\r\n if (typeof json === 'object' && '.value' in json && json['.value'] !== null) {\r\n json = json['.value'];\r\n }\r\n // Valid leaf nodes include non-objects or server-value wrapper objects\r\n if (typeof json !== 'object' || '.sv' in json) {\r\n var jsonLeaf = json;\r\n return new LeafNode(jsonLeaf, nodeFromJSON$1(priority));\r\n }\r\n if (!(json instanceof Array) && USE_HINZE) {\r\n var children_1 = [];\r\n var childrenHavePriority_1 = false;\r\n var hinzeJsonObj = json;\r\n each(hinzeJsonObj, function (key, child) {\r\n if (key.substring(0, 1) !== '.') {\r\n // Ignore metadata nodes\r\n var childNode = nodeFromJSON$1(child);\r\n if (!childNode.isEmpty()) {\r\n childrenHavePriority_1 =\r\n childrenHavePriority_1 || !childNode.getPriority().isEmpty();\r\n children_1.push(new NamedNode(key, childNode));\r\n }\r\n }\r\n });\r\n if (children_1.length === 0) {\r\n return ChildrenNode.EMPTY_NODE;\r\n }\r\n var childSet = buildChildSet(children_1, NAME_ONLY_COMPARATOR, function (namedNode) { return namedNode.name; }, NAME_COMPARATOR);\r\n if (childrenHavePriority_1) {\r\n var sortedChildSet = buildChildSet(children_1, PRIORITY_INDEX.getCompare());\r\n return new ChildrenNode(childSet, nodeFromJSON$1(priority), new IndexMap({ '.priority': sortedChildSet }, { '.priority': PRIORITY_INDEX }));\r\n }\r\n else {\r\n return new ChildrenNode(childSet, nodeFromJSON$1(priority), IndexMap.Default);\r\n }\r\n }\r\n else {\r\n var node_1 = ChildrenNode.EMPTY_NODE;\r\n each(json, function (key, childData) {\r\n if (contains(json, key)) {\r\n if (key.substring(0, 1) !== '.') {\r\n // ignore metadata nodes.\r\n var childNode = nodeFromJSON$1(childData);\r\n if (childNode.isLeafNode() || !childNode.isEmpty()) {\r\n node_1 = node_1.updateImmediateChild(key, childNode);\r\n }\r\n }\r\n }\r\n });\r\n return node_1.updatePriority(nodeFromJSON$1(priority));\r\n }\r\n}\r\nsetNodeFromJSON(nodeFromJSON$1);\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @constructor\r\n * @extends {Index}\r\n * @private\r\n */\r\nvar ValueIndex = /** @class */ (function (_super) {\r\n __extends(ValueIndex, _super);\r\n function ValueIndex() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueIndex.prototype.compare = function (a, b) {\r\n var indexCmp = a.node.compareTo(b.node);\r\n if (indexCmp === 0) {\r\n return nameCompare(a.name, b.name);\r\n }\r\n else {\r\n return indexCmp;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueIndex.prototype.isDefinedOn = function (node) {\r\n return true;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueIndex.prototype.indexedValueChanged = function (oldNode, newNode) {\r\n return !oldNode.equals(newNode);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueIndex.prototype.minPost = function () {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return NamedNode.MIN;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueIndex.prototype.maxPost = function () {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return NamedNode.MAX;\r\n };\r\n /**\r\n * @param {*} indexValue\r\n * @param {string} name\r\n * @return {!NamedNode}\r\n */\r\n ValueIndex.prototype.makePost = function (indexValue, name) {\r\n var valueNode = nodeFromJSON$1(indexValue);\r\n return new NamedNode(name, valueNode);\r\n };\r\n /**\r\n * @return {!string} String representation for inclusion in a query spec\r\n */\r\n ValueIndex.prototype.toString = function () {\r\n return '.value';\r\n };\r\n return ValueIndex;\r\n}(Index));\r\nvar VALUE_INDEX = new ValueIndex();\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @param {!Path} indexPath\r\n * @constructor\r\n * @extends {Index}\r\n */\r\nvar PathIndex = /** @class */ (function (_super) {\r\n __extends(PathIndex, _super);\r\n function PathIndex(indexPath_) {\r\n var _this = _super.call(this) || this;\r\n _this.indexPath_ = indexPath_;\r\n assert(!indexPath_.isEmpty() && indexPath_.getFront() !== '.priority', \"Can't create PathIndex with empty path or .priority key\");\r\n return _this;\r\n }\r\n /**\r\n * @param {!Node} snap\r\n * @return {!Node}\r\n * @protected\r\n */\r\n PathIndex.prototype.extractChild = function (snap) {\r\n return snap.getChild(this.indexPath_);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PathIndex.prototype.isDefinedOn = function (node) {\r\n return !node.getChild(this.indexPath_).isEmpty();\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PathIndex.prototype.compare = function (a, b) {\r\n var aChild = this.extractChild(a.node);\r\n var bChild = this.extractChild(b.node);\r\n var indexCmp = aChild.compareTo(bChild);\r\n if (indexCmp === 0) {\r\n return nameCompare(a.name, b.name);\r\n }\r\n else {\r\n return indexCmp;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PathIndex.prototype.makePost = function (indexValue, name) {\r\n var valueNode = nodeFromJSON$1(indexValue);\r\n var node = ChildrenNode.EMPTY_NODE.updateChild(this.indexPath_, valueNode);\r\n return new NamedNode(name, node);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PathIndex.prototype.maxPost = function () {\r\n var node = ChildrenNode.EMPTY_NODE.updateChild(this.indexPath_, MAX_NODE$2);\r\n return new NamedNode(MAX_NAME, node);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PathIndex.prototype.toString = function () {\r\n return this.indexPath_.slice().join('/');\r\n };\r\n return PathIndex;\r\n}(Index));\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Class representing a firebase data snapshot. It wraps a SnapshotNode and\r\n * surfaces the public methods (val, forEach, etc.) we want to expose.\r\n */\r\nvar DataSnapshot = /** @class */ (function () {\r\n /**\r\n * @param {!Node} node_ A SnapshotNode to wrap.\r\n * @param {!Reference} ref_ The ref of the location this snapshot came from.\r\n * @param {!Index} index_ The iteration order for this snapshot\r\n */\r\n function DataSnapshot(node_, ref_, index_) {\r\n this.node_ = node_;\r\n this.ref_ = ref_;\r\n this.index_ = index_;\r\n }\r\n /**\r\n * Retrieves the snapshot contents as JSON. Returns null if the snapshot is\r\n * empty.\r\n *\r\n * @return {*} JSON representation of the DataSnapshot contents, or null if empty.\r\n */\r\n DataSnapshot.prototype.val = function () {\r\n validateArgCount('DataSnapshot.val', 0, 0, arguments.length);\r\n return this.node_.val();\r\n };\r\n /**\r\n * Returns the snapshot contents as JSON, including priorities of node. Suitable for exporting\r\n * the entire node contents.\r\n * @return {*} JSON representation of the DataSnapshot contents, or null if empty.\r\n */\r\n DataSnapshot.prototype.exportVal = function () {\r\n validateArgCount('DataSnapshot.exportVal', 0, 0, arguments.length);\r\n return this.node_.val(true);\r\n };\r\n // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary\r\n // for end-users\r\n DataSnapshot.prototype.toJSON = function () {\r\n // Optional spacer argument is unnecessary because we're depending on recursion rather than stringifying the content\r\n validateArgCount('DataSnapshot.toJSON', 0, 1, arguments.length);\r\n return this.exportVal();\r\n };\r\n /**\r\n * Returns whether the snapshot contains a non-null value.\r\n *\r\n * @return {boolean} Whether the snapshot contains a non-null value, or is empty.\r\n */\r\n DataSnapshot.prototype.exists = function () {\r\n validateArgCount('DataSnapshot.exists', 0, 0, arguments.length);\r\n return !this.node_.isEmpty();\r\n };\r\n /**\r\n * Returns a DataSnapshot of the specified child node's contents.\r\n *\r\n * @param {!string} childPathString Path to a child.\r\n * @return {!DataSnapshot} DataSnapshot for child node.\r\n */\r\n DataSnapshot.prototype.child = function (childPathString) {\r\n validateArgCount('DataSnapshot.child', 0, 1, arguments.length);\r\n // Ensure the childPath is a string (can be a number)\r\n childPathString = String(childPathString);\r\n validatePathString('DataSnapshot.child', 1, childPathString, false);\r\n var childPath = new Path(childPathString);\r\n var childRef = this.ref_.child(childPath);\r\n return new DataSnapshot(this.node_.getChild(childPath), childRef, PRIORITY_INDEX);\r\n };\r\n /**\r\n * Returns whether the snapshot contains a child at the specified path.\r\n *\r\n * @param {!string} childPathString Path to a child.\r\n * @return {boolean} Whether the child exists.\r\n */\r\n DataSnapshot.prototype.hasChild = function (childPathString) {\r\n validateArgCount('DataSnapshot.hasChild', 1, 1, arguments.length);\r\n validatePathString('DataSnapshot.hasChild', 1, childPathString, false);\r\n var childPath = new Path(childPathString);\r\n return !this.node_.getChild(childPath).isEmpty();\r\n };\r\n /**\r\n * Returns the priority of the object, or null if no priority was set.\r\n *\r\n * @return {string|number|null} The priority.\r\n */\r\n DataSnapshot.prototype.getPriority = function () {\r\n validateArgCount('DataSnapshot.getPriority', 0, 0, arguments.length);\r\n // typecast here because we never return deferred values or internal priorities (MAX_PRIORITY)\r\n return this.node_.getPriority().val();\r\n };\r\n /**\r\n * Iterates through child nodes and calls the specified action for each one.\r\n *\r\n * @param {function(!DataSnapshot)} action Callback function to be called\r\n * for each child.\r\n * @return {boolean} True if forEach was canceled by action returning true for\r\n * one of the child nodes.\r\n */\r\n DataSnapshot.prototype.forEach = function (action) {\r\n var _this = this;\r\n validateArgCount('DataSnapshot.forEach', 1, 1, arguments.length);\r\n validateCallback('DataSnapshot.forEach', 1, action, false);\r\n if (this.node_.isLeafNode()) {\r\n return false;\r\n }\r\n var childrenNode = this.node_;\r\n // Sanitize the return value to a boolean. ChildrenNode.forEachChild has a weird return type...\r\n return !!childrenNode.forEachChild(this.index_, function (key, node) {\r\n return action(new DataSnapshot(node, _this.ref_.child(key), PRIORITY_INDEX));\r\n });\r\n };\r\n /**\r\n * Returns whether this DataSnapshot has children.\r\n * @return {boolean} True if the DataSnapshot contains 1 or more child nodes.\r\n */\r\n DataSnapshot.prototype.hasChildren = function () {\r\n validateArgCount('DataSnapshot.hasChildren', 0, 0, arguments.length);\r\n if (this.node_.isLeafNode()) {\r\n return false;\r\n }\r\n else {\r\n return !this.node_.isEmpty();\r\n }\r\n };\r\n Object.defineProperty(DataSnapshot.prototype, \"key\", {\r\n get: function () {\r\n return this.ref_.getKey();\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns the number of children for this DataSnapshot.\r\n * @return {number} The number of children that this DataSnapshot contains.\r\n */\r\n DataSnapshot.prototype.numChildren = function () {\r\n validateArgCount('DataSnapshot.numChildren', 0, 0, arguments.length);\r\n return this.node_.numChildren();\r\n };\r\n /**\r\n * @return {Reference} The Firebase reference for the location this snapshot's data came from.\r\n */\r\n DataSnapshot.prototype.getRef = function () {\r\n validateArgCount('DataSnapshot.ref', 0, 0, arguments.length);\r\n return this.ref_;\r\n };\r\n Object.defineProperty(DataSnapshot.prototype, \"ref\", {\r\n get: function () {\r\n return this.getRef();\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return DataSnapshot;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Encapsulates the data needed to raise an event\r\n * @implements {Event}\r\n */\r\nvar DataEvent = /** @class */ (function () {\r\n /**\r\n * @param {!string} eventType One of: value, child_added, child_changed, child_moved, child_removed\r\n * @param {!EventRegistration} eventRegistration The function to call to with the event data. User provided\r\n * @param {!DataSnapshot} snapshot The data backing the event\r\n * @param {?string=} prevName Optional, the name of the previous child for child_* events.\r\n */\r\n function DataEvent(eventType, eventRegistration, snapshot, prevName) {\r\n this.eventType = eventType;\r\n this.eventRegistration = eventRegistration;\r\n this.snapshot = snapshot;\r\n this.prevName = prevName;\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n DataEvent.prototype.getPath = function () {\r\n var ref = this.snapshot.getRef();\r\n if (this.eventType === 'value') {\r\n return ref.path;\r\n }\r\n else {\r\n return ref.getParent().path;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n DataEvent.prototype.getEventType = function () {\r\n return this.eventType;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n DataEvent.prototype.getEventRunner = function () {\r\n return this.eventRegistration.getEventRunner(this);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n DataEvent.prototype.toString = function () {\r\n return (this.getPath().toString() +\r\n ':' +\r\n this.eventType +\r\n ':' +\r\n stringify(this.snapshot.exportVal()));\r\n };\r\n return DataEvent;\r\n}());\r\nvar CancelEvent = /** @class */ (function () {\r\n /**\r\n * @param {EventRegistration} eventRegistration\r\n * @param {Error} error\r\n * @param {!Path} path\r\n */\r\n function CancelEvent(eventRegistration, error, path) {\r\n this.eventRegistration = eventRegistration;\r\n this.error = error;\r\n this.path = path;\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n CancelEvent.prototype.getPath = function () {\r\n return this.path;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n CancelEvent.prototype.getEventType = function () {\r\n return 'cancel';\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n CancelEvent.prototype.getEventRunner = function () {\r\n return this.eventRegistration.getEventRunner(this);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n CancelEvent.prototype.toString = function () {\r\n return this.path.toString() + ':cancel';\r\n };\r\n return CancelEvent;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Represents registration for 'value' events.\r\n */\r\nvar ValueEventRegistration = /** @class */ (function () {\r\n /**\r\n * @param {?function(!DataSnapshot)} callback_\r\n * @param {?function(Error)} cancelCallback_\r\n * @param {?Object} context_\r\n */\r\n function ValueEventRegistration(callback_, cancelCallback_, context_) {\r\n this.callback_ = callback_;\r\n this.cancelCallback_ = cancelCallback_;\r\n this.context_ = context_;\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueEventRegistration.prototype.respondsTo = function (eventType) {\r\n return eventType === 'value';\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueEventRegistration.prototype.createEvent = function (change, query) {\r\n var index = query.getQueryParams().getIndex();\r\n return new DataEvent('value', this, new DataSnapshot(change.snapshotNode, query.getRef(), index));\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueEventRegistration.prototype.getEventRunner = function (eventData) {\r\n var ctx = this.context_;\r\n if (eventData.getEventType() === 'cancel') {\r\n assert(this.cancelCallback_, 'Raising a cancel event on a listener with no cancel callback');\r\n var cancelCB_1 = this.cancelCallback_;\r\n return function () {\r\n // We know that error exists, we checked above that this is a cancel event\r\n cancelCB_1.call(ctx, eventData.error);\r\n };\r\n }\r\n else {\r\n var cb_1 = this.callback_;\r\n return function () {\r\n cb_1.call(ctx, eventData.snapshot);\r\n };\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueEventRegistration.prototype.createCancelEvent = function (error, path) {\r\n if (this.cancelCallback_) {\r\n return new CancelEvent(this, error, path);\r\n }\r\n else {\r\n return null;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueEventRegistration.prototype.matches = function (other) {\r\n if (!(other instanceof ValueEventRegistration)) {\r\n return false;\r\n }\r\n else if (!other.callback_ || !this.callback_) {\r\n // If no callback specified, we consider it to match any callback.\r\n return true;\r\n }\r\n else {\r\n return (other.callback_ === this.callback_ && other.context_ === this.context_);\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ValueEventRegistration.prototype.hasAnyCallback = function () {\r\n return this.callback_ !== null;\r\n };\r\n return ValueEventRegistration;\r\n}());\r\n/**\r\n * Represents the registration of 1 or more child_xxx events.\r\n *\r\n * Currently, it is always exactly 1 child_xxx event, but the idea is we might let you\r\n * register a group of callbacks together in the future.\r\n *\r\n * @constructor\r\n * @implements {EventRegistration}\r\n */\r\nvar ChildEventRegistration = /** @class */ (function () {\r\n /**\r\n * @param {?Object.<string, function(!DataSnapshot, ?string=)>} callbacks_\r\n * @param {?function(Error)} cancelCallback_\r\n * @param {Object=} context_\r\n */\r\n function ChildEventRegistration(callbacks_, cancelCallback_, context_) {\r\n this.callbacks_ = callbacks_;\r\n this.cancelCallback_ = cancelCallback_;\r\n this.context_ = context_;\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildEventRegistration.prototype.respondsTo = function (eventType) {\r\n var eventToCheck = eventType === 'children_added' ? 'child_added' : eventType;\r\n eventToCheck =\r\n eventToCheck === 'children_removed' ? 'child_removed' : eventToCheck;\r\n return contains(this.callbacks_, eventToCheck);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildEventRegistration.prototype.createCancelEvent = function (error, path) {\r\n if (this.cancelCallback_) {\r\n return new CancelEvent(this, error, path);\r\n }\r\n else {\r\n return null;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildEventRegistration.prototype.createEvent = function (change, query) {\r\n assert(change.childName != null, 'Child events should have a childName.');\r\n var ref = query.getRef().child(/** @type {!string} */ change.childName);\r\n var index = query.getQueryParams().getIndex();\r\n return new DataEvent(change.type, this, new DataSnapshot(change.snapshotNode, ref, index), change.prevName);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildEventRegistration.prototype.getEventRunner = function (eventData) {\r\n var ctx = this.context_;\r\n if (eventData.getEventType() === 'cancel') {\r\n assert(this.cancelCallback_, 'Raising a cancel event on a listener with no cancel callback');\r\n var cancelCB_2 = this.cancelCallback_;\r\n return function () {\r\n // We know that error exists, we checked above that this is a cancel event\r\n cancelCB_2.call(ctx, eventData.error);\r\n };\r\n }\r\n else {\r\n var cb_2 = this.callbacks_[eventData.eventType];\r\n return function () {\r\n cb_2.call(ctx, eventData.snapshot, eventData.prevName);\r\n };\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildEventRegistration.prototype.matches = function (other) {\r\n var _this = this;\r\n if (other instanceof ChildEventRegistration) {\r\n if (!this.callbacks_ || !other.callbacks_) {\r\n return true;\r\n }\r\n else if (this.context_ === other.context_) {\r\n var otherKeys = Object.keys(other.callbacks_);\r\n var thisKeys = Object.keys(this.callbacks_);\r\n var otherCount = otherKeys.length;\r\n var thisCount = thisKeys.length;\r\n if (otherCount === thisCount) {\r\n // If count is 1, do an exact match on eventType, if either is defined but null, it's a match.\r\n // If event types don't match, not a match\r\n // If count is not 1, exact match across all\r\n if (otherCount === 1) {\r\n var otherKey = otherKeys[0];\r\n var thisKey = thisKeys[0];\r\n return (thisKey === otherKey &&\r\n (!other.callbacks_[otherKey] ||\r\n !this.callbacks_[thisKey] ||\r\n other.callbacks_[otherKey] === this.callbacks_[thisKey]));\r\n }\r\n else {\r\n // Exact match on each key.\r\n return thisKeys.every(function (eventType) {\r\n return other.callbacks_[eventType] === _this.callbacks_[eventType];\r\n });\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n ChildEventRegistration.prototype.hasAnyCallback = function () {\r\n return this.callbacks_ !== null;\r\n };\r\n return ChildEventRegistration;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __referenceConstructor;\r\n/**\r\n * A Query represents a filter to be applied to a firebase location. This object purely represents the\r\n * query expression (and exposes our public API to build the query). The actual query logic is in ViewBase.js.\r\n *\r\n * Since every Firebase reference is a query, Firebase inherits from this object.\r\n */\r\nvar Query = /** @class */ (function () {\r\n function Query(repo, path, queryParams_, orderByCalled_) {\r\n this.repo = repo;\r\n this.path = path;\r\n this.queryParams_ = queryParams_;\r\n this.orderByCalled_ = orderByCalled_;\r\n }\r\n Object.defineProperty(Query, \"__referenceConstructor\", {\r\n get: function () {\r\n assert(__referenceConstructor, 'Reference.ts has not been loaded');\r\n return __referenceConstructor;\r\n },\r\n set: function (val) {\r\n __referenceConstructor = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Validates start/end values for queries.\r\n * @param {!QueryParams} params\r\n * @private\r\n */\r\n Query.validateQueryEndpoints_ = function (params) {\r\n var startNode = null;\r\n var endNode = null;\r\n if (params.hasStart()) {\r\n startNode = params.getIndexStartValue();\r\n }\r\n if (params.hasEnd()) {\r\n endNode = params.getIndexEndValue();\r\n }\r\n if (params.getIndex() === KEY_INDEX) {\r\n var tooManyArgsError = 'Query: When ordering by key, you may only pass one argument to ' +\r\n 'startAt(), endAt(), or equalTo().';\r\n var wrongArgTypeError = 'Query: When ordering by key, the argument passed to startAt(), endAt(),' +\r\n 'or equalTo() must be a string.';\r\n if (params.hasStart()) {\r\n var startName = params.getIndexStartName();\r\n if (startName !== MIN_NAME) {\r\n throw new Error(tooManyArgsError);\r\n }\r\n else if (typeof startNode !== 'string') {\r\n throw new Error(wrongArgTypeError);\r\n }\r\n }\r\n if (params.hasEnd()) {\r\n var endName = params.getIndexEndName();\r\n if (endName !== MAX_NAME) {\r\n throw new Error(tooManyArgsError);\r\n }\r\n else if (typeof endNode !== 'string') {\r\n throw new Error(wrongArgTypeError);\r\n }\r\n }\r\n }\r\n else if (params.getIndex() === PRIORITY_INDEX) {\r\n if ((startNode != null && !isValidPriority(startNode)) ||\r\n (endNode != null && !isValidPriority(endNode))) {\r\n throw new Error('Query: When ordering by priority, the first argument passed to startAt(), ' +\r\n 'endAt(), or equalTo() must be a valid priority value (null, a number, or a string).');\r\n }\r\n }\r\n else {\r\n assert(params.getIndex() instanceof PathIndex ||\r\n params.getIndex() === VALUE_INDEX, 'unknown index type.');\r\n if ((startNode != null && typeof startNode === 'object') ||\r\n (endNode != null && typeof endNode === 'object')) {\r\n throw new Error('Query: First argument passed to startAt(), endAt(), or equalTo() cannot be ' +\r\n 'an object.');\r\n }\r\n }\r\n };\r\n /**\r\n * Validates that limit* has been called with the correct combination of parameters\r\n * @param {!QueryParams} params\r\n * @private\r\n */\r\n Query.validateLimit_ = function (params) {\r\n if (params.hasStart() &&\r\n params.hasEnd() &&\r\n params.hasLimit() &&\r\n !params.hasAnchoredLimit()) {\r\n throw new Error(\"Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.\");\r\n }\r\n };\r\n /**\r\n * Validates that no other order by call has been made\r\n * @param {!string} fnName\r\n * @private\r\n */\r\n Query.prototype.validateNoPreviousOrderByCall_ = function (fnName) {\r\n if (this.orderByCalled_ === true) {\r\n throw new Error(fnName + \": You can't combine multiple orderBy calls.\");\r\n }\r\n };\r\n /**\r\n * @return {!QueryParams}\r\n */\r\n Query.prototype.getQueryParams = function () {\r\n return this.queryParams_;\r\n };\r\n /**\r\n * @return {!Reference}\r\n */\r\n Query.prototype.getRef = function () {\r\n validateArgCount('Query.ref', 0, 0, arguments.length);\r\n // This is a slight hack. We cannot goog.require('fb.api.Firebase'), since Firebase requires fb.api.Query.\r\n // However, we will always export 'Firebase' to the global namespace, so it's guaranteed to exist by the time this\r\n // method gets called.\r\n return new Query.__referenceConstructor(this.repo, this.path);\r\n };\r\n /**\r\n * @param {!string} eventType\r\n * @param {!function(DataSnapshot, string=)} callback\r\n * @param {(function(Error)|Object)=} cancelCallbackOrContext\r\n * @param {Object=} context\r\n * @return {!function(DataSnapshot, string=)}\r\n */\r\n Query.prototype.on = function (eventType, callback, cancelCallbackOrContext, context) {\r\n validateArgCount('Query.on', 2, 4, arguments.length);\r\n validateEventType('Query.on', 1, eventType, false);\r\n validateCallback('Query.on', 2, callback, false);\r\n var ret = Query.getCancelAndContextArgs_('Query.on', cancelCallbackOrContext, context);\r\n if (eventType === 'value') {\r\n this.onValueEvent(callback, ret.cancel, ret.context);\r\n }\r\n else {\r\n var callbacks = {};\r\n callbacks[eventType] = callback;\r\n this.onChildEvent(callbacks, ret.cancel, ret.context);\r\n }\r\n return callback;\r\n };\r\n /**\r\n * @param {!function(!DataSnapshot)} callback\r\n * @param {?function(Error)} cancelCallback\r\n * @param {?Object} context\r\n * @protected\r\n */\r\n Query.prototype.onValueEvent = function (callback, cancelCallback, context) {\r\n var container = new ValueEventRegistration(callback, cancelCallback || null, context || null);\r\n this.repo.addEventCallbackForQuery(this, container);\r\n };\r\n /**\r\n * @param {!Object.<string, !function(!DataSnapshot, ?string)>} callbacks\r\n * @param {?function(Error)} cancelCallback\r\n * @param {?Object} context\r\n * @protected\r\n */\r\n Query.prototype.onChildEvent = function (callbacks, cancelCallback, context) {\r\n var container = new ChildEventRegistration(callbacks, cancelCallback, context);\r\n this.repo.addEventCallbackForQuery(this, container);\r\n };\r\n /**\r\n * @param {string=} eventType\r\n * @param {(function(!DataSnapshot, ?string=))=} callback\r\n * @param {Object=} context\r\n */\r\n Query.prototype.off = function (eventType, callback, context) {\r\n validateArgCount('Query.off', 0, 3, arguments.length);\r\n validateEventType('Query.off', 1, eventType, true);\r\n validateCallback('Query.off', 2, callback, true);\r\n validateContextObject('Query.off', 3, context, true);\r\n var container = null;\r\n var callbacks = null;\r\n if (eventType === 'value') {\r\n var valueCallback = callback || null;\r\n container = new ValueEventRegistration(valueCallback, null, context || null);\r\n }\r\n else if (eventType) {\r\n if (callback) {\r\n callbacks = {};\r\n callbacks[eventType] = callback;\r\n }\r\n container = new ChildEventRegistration(callbacks, null, context || null);\r\n }\r\n this.repo.removeEventCallbackForQuery(this, container);\r\n };\r\n /**\r\n * Attaches a listener, waits for the first event, and then removes the listener\r\n * @param {!string} eventType\r\n * @param {!function(!DataSnapshot, string=)} userCallback\r\n * @param failureCallbackOrContext\r\n * @param context\r\n * @return {!firebase.Promise}\r\n */\r\n Query.prototype.once = function (eventType, userCallback, failureCallbackOrContext, context) {\r\n var _this = this;\r\n validateArgCount('Query.once', 1, 4, arguments.length);\r\n validateEventType('Query.once', 1, eventType, false);\r\n validateCallback('Query.once', 2, userCallback, true);\r\n var ret = Query.getCancelAndContextArgs_('Query.once', failureCallbackOrContext, context);\r\n // TODO: Implement this more efficiently (in particular, use 'get' wire protocol for 'value' event)\r\n // TODO: consider actually wiring the callbacks into the promise. We cannot do this without a breaking change\r\n // because the API currently expects callbacks will be called synchronously if the data is cached, but this is\r\n // against the Promise specification.\r\n var firstCall = true;\r\n var deferred = new Deferred();\r\n // A dummy error handler in case a user wasn't expecting promises\r\n deferred.promise.catch(function () { });\r\n var onceCallback = function (snapshot) {\r\n // NOTE: Even though we unsubscribe, we may get called multiple times if a single action (e.g. set() with JSON)\r\n // triggers multiple events (e.g. child_added or child_changed).\r\n if (firstCall) {\r\n firstCall = false;\r\n _this.off(eventType, onceCallback);\r\n if (userCallback) {\r\n userCallback.bind(ret.context)(snapshot);\r\n }\r\n deferred.resolve(snapshot);\r\n }\r\n };\r\n this.on(eventType, onceCallback, \r\n /*cancel=*/ function (err) {\r\n _this.off(eventType, onceCallback);\r\n if (ret.cancel) {\r\n ret.cancel.bind(ret.context)(err);\r\n }\r\n deferred.reject(err);\r\n });\r\n return deferred.promise;\r\n };\r\n /**\r\n * Set a limit and anchor it to the start of the window.\r\n * @param {!number} limit\r\n * @return {!Query}\r\n */\r\n Query.prototype.limitToFirst = function (limit) {\r\n validateArgCount('Query.limitToFirst', 1, 1, arguments.length);\r\n if (typeof limit !== 'number' ||\r\n Math.floor(limit) !== limit ||\r\n limit <= 0) {\r\n throw new Error('Query.limitToFirst: First argument must be a positive integer.');\r\n }\r\n if (this.queryParams_.hasLimit()) {\r\n throw new Error('Query.limitToFirst: Limit was already set (by another call to limit, ' +\r\n 'limitToFirst, or limitToLast).');\r\n }\r\n return new Query(this.repo, this.path, this.queryParams_.limitToFirst(limit), this.orderByCalled_);\r\n };\r\n /**\r\n * Set a limit and anchor it to the end of the window.\r\n * @param {!number} limit\r\n * @return {!Query}\r\n */\r\n Query.prototype.limitToLast = function (limit) {\r\n validateArgCount('Query.limitToLast', 1, 1, arguments.length);\r\n if (typeof limit !== 'number' ||\r\n Math.floor(limit) !== limit ||\r\n limit <= 0) {\r\n throw new Error('Query.limitToLast: First argument must be a positive integer.');\r\n }\r\n if (this.queryParams_.hasLimit()) {\r\n throw new Error('Query.limitToLast: Limit was already set (by another call to limit, ' +\r\n 'limitToFirst, or limitToLast).');\r\n }\r\n return new Query(this.repo, this.path, this.queryParams_.limitToLast(limit), this.orderByCalled_);\r\n };\r\n /**\r\n * Given a child path, return a new query ordered by the specified grandchild path.\r\n * @param {!string} path\r\n * @return {!Query}\r\n */\r\n Query.prototype.orderByChild = function (path) {\r\n validateArgCount('Query.orderByChild', 1, 1, arguments.length);\r\n if (path === '$key') {\r\n throw new Error('Query.orderByChild: \"$key\" is invalid. Use Query.orderByKey() instead.');\r\n }\r\n else if (path === '$priority') {\r\n throw new Error('Query.orderByChild: \"$priority\" is invalid. Use Query.orderByPriority() instead.');\r\n }\r\n else if (path === '$value') {\r\n throw new Error('Query.orderByChild: \"$value\" is invalid. Use Query.orderByValue() instead.');\r\n }\r\n validatePathString('Query.orderByChild', 1, path, false);\r\n this.validateNoPreviousOrderByCall_('Query.orderByChild');\r\n var parsedPath = new Path(path);\r\n if (parsedPath.isEmpty()) {\r\n throw new Error('Query.orderByChild: cannot pass in empty path. Use Query.orderByValue() instead.');\r\n }\r\n var index = new PathIndex(parsedPath);\r\n var newParams = this.queryParams_.orderBy(index);\r\n Query.validateQueryEndpoints_(newParams);\r\n return new Query(this.repo, this.path, newParams, /*orderByCalled=*/ true);\r\n };\r\n /**\r\n * Return a new query ordered by the KeyIndex\r\n * @return {!Query}\r\n */\r\n Query.prototype.orderByKey = function () {\r\n validateArgCount('Query.orderByKey', 0, 0, arguments.length);\r\n this.validateNoPreviousOrderByCall_('Query.orderByKey');\r\n var newParams = this.queryParams_.orderBy(KEY_INDEX);\r\n Query.validateQueryEndpoints_(newParams);\r\n return new Query(this.repo, this.path, newParams, /*orderByCalled=*/ true);\r\n };\r\n /**\r\n * Return a new query ordered by the PriorityIndex\r\n * @return {!Query}\r\n */\r\n Query.prototype.orderByPriority = function () {\r\n validateArgCount('Query.orderByPriority', 0, 0, arguments.length);\r\n this.validateNoPreviousOrderByCall_('Query.orderByPriority');\r\n var newParams = this.queryParams_.orderBy(PRIORITY_INDEX);\r\n Query.validateQueryEndpoints_(newParams);\r\n return new Query(this.repo, this.path, newParams, /*orderByCalled=*/ true);\r\n };\r\n /**\r\n * Return a new query ordered by the ValueIndex\r\n * @return {!Query}\r\n */\r\n Query.prototype.orderByValue = function () {\r\n validateArgCount('Query.orderByValue', 0, 0, arguments.length);\r\n this.validateNoPreviousOrderByCall_('Query.orderByValue');\r\n var newParams = this.queryParams_.orderBy(VALUE_INDEX);\r\n Query.validateQueryEndpoints_(newParams);\r\n return new Query(this.repo, this.path, newParams, /*orderByCalled=*/ true);\r\n };\r\n /**\r\n * @param {number|string|boolean|null} value\r\n * @param {?string=} name\r\n * @return {!Query}\r\n */\r\n Query.prototype.startAt = function (value, name) {\r\n if (value === void 0) { value = null; }\r\n validateArgCount('Query.startAt', 0, 2, arguments.length);\r\n validateFirebaseDataArg('Query.startAt', 1, value, this.path, true);\r\n validateKey('Query.startAt', 2, name, true);\r\n var newParams = this.queryParams_.startAt(value, name);\r\n Query.validateLimit_(newParams);\r\n Query.validateQueryEndpoints_(newParams);\r\n if (this.queryParams_.hasStart()) {\r\n throw new Error('Query.startAt: Starting point was already set (by another call to startAt ' +\r\n 'or equalTo).');\r\n }\r\n // Calling with no params tells us to start at the beginning.\r\n if (value === undefined) {\r\n value = null;\r\n name = null;\r\n }\r\n return new Query(this.repo, this.path, newParams, this.orderByCalled_);\r\n };\r\n /**\r\n * @param {number|string|boolean|null} value\r\n * @param {?string=} name\r\n * @return {!Query}\r\n */\r\n Query.prototype.endAt = function (value, name) {\r\n if (value === void 0) { value = null; }\r\n validateArgCount('Query.endAt', 0, 2, arguments.length);\r\n validateFirebaseDataArg('Query.endAt', 1, value, this.path, true);\r\n validateKey('Query.endAt', 2, name, true);\r\n var newParams = this.queryParams_.endAt(value, name);\r\n Query.validateLimit_(newParams);\r\n Query.validateQueryEndpoints_(newParams);\r\n if (this.queryParams_.hasEnd()) {\r\n throw new Error('Query.endAt: Ending point was already set (by another call to endAt or ' +\r\n 'equalTo).');\r\n }\r\n return new Query(this.repo, this.path, newParams, this.orderByCalled_);\r\n };\r\n /**\r\n * Load the selection of children with exactly the specified value, and, optionally,\r\n * the specified name.\r\n * @param {number|string|boolean|null} value\r\n * @param {string=} name\r\n * @return {!Query}\r\n */\r\n Query.prototype.equalTo = function (value, name) {\r\n validateArgCount('Query.equalTo', 1, 2, arguments.length);\r\n validateFirebaseDataArg('Query.equalTo', 1, value, this.path, false);\r\n validateKey('Query.equalTo', 2, name, true);\r\n if (this.queryParams_.hasStart()) {\r\n throw new Error('Query.equalTo: Starting point was already set (by another call to startAt or ' +\r\n 'equalTo).');\r\n }\r\n if (this.queryParams_.hasEnd()) {\r\n throw new Error('Query.equalTo: Ending point was already set (by another call to endAt or ' +\r\n 'equalTo).');\r\n }\r\n return this.startAt(value, name).endAt(value, name);\r\n };\r\n /**\r\n * @return {!string} URL for this location.\r\n */\r\n Query.prototype.toString = function () {\r\n validateArgCount('Query.toString', 0, 0, arguments.length);\r\n return this.repo.toString() + this.path.toUrlEncodedString();\r\n };\r\n // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary\r\n // for end-users.\r\n Query.prototype.toJSON = function () {\r\n // An optional spacer argument is unnecessary for a string.\r\n validateArgCount('Query.toJSON', 0, 1, arguments.length);\r\n return this.toString();\r\n };\r\n /**\r\n * An object representation of the query parameters used by this Query.\r\n * @return {!Object}\r\n */\r\n Query.prototype.queryObject = function () {\r\n return this.queryParams_.getQueryObject();\r\n };\r\n /**\r\n * @return {!string}\r\n */\r\n Query.prototype.queryIdentifier = function () {\r\n var obj = this.queryObject();\r\n var id = ObjectToUniqueKey(obj);\r\n return id === '{}' ? 'default' : id;\r\n };\r\n /**\r\n * Return true if this query and the provided query are equivalent; otherwise, return false.\r\n * @param {Query} other\r\n * @return {boolean}\r\n */\r\n Query.prototype.isEqual = function (other) {\r\n validateArgCount('Query.isEqual', 1, 1, arguments.length);\r\n if (!(other instanceof Query)) {\r\n var error = 'Query.isEqual failed: First argument must be an instance of firebase.database.Query.';\r\n throw new Error(error);\r\n }\r\n var sameRepo = this.repo === other.repo;\r\n var samePath = this.path.equals(other.path);\r\n var sameQueryIdentifier = this.queryIdentifier() === other.queryIdentifier();\r\n return sameRepo && samePath && sameQueryIdentifier;\r\n };\r\n /**\r\n * Helper used by .on and .once to extract the context and or cancel arguments.\r\n * @param {!string} fnName The function name (on or once)\r\n * @param {(function(Error)|Object)=} cancelOrContext\r\n * @param {Object=} context\r\n * @return {{cancel: ?function(Error), context: ?Object}}\r\n * @private\r\n */\r\n Query.getCancelAndContextArgs_ = function (fnName, cancelOrContext, context) {\r\n var ret = { cancel: null, context: null };\r\n if (cancelOrContext && context) {\r\n ret.cancel = cancelOrContext;\r\n validateCallback(fnName, 3, ret.cancel, true);\r\n ret.context = context;\r\n validateContextObject(fnName, 4, ret.context, true);\r\n }\r\n else if (cancelOrContext) {\r\n // we have either a cancel callback or a context.\r\n if (typeof cancelOrContext === 'object' && cancelOrContext !== null) {\r\n // it's a context!\r\n ret.context = cancelOrContext;\r\n }\r\n else if (typeof cancelOrContext === 'function') {\r\n ret.cancel = cancelOrContext;\r\n }\r\n else {\r\n throw new Error(errorPrefix(fnName, 3, true) +\r\n ' must either be a cancel callback or a context object.');\r\n }\r\n }\r\n return ret;\r\n };\r\n Object.defineProperty(Query.prototype, \"ref\", {\r\n get: function () {\r\n return this.getRef();\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return Query;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar ExistingValueProvider = /** @class */ (function () {\r\n function ExistingValueProvider(node_) {\r\n this.node_ = node_;\r\n }\r\n ExistingValueProvider.prototype.getImmediateChild = function (childName) {\r\n var child = this.node_.getImmediateChild(childName);\r\n return new ExistingValueProvider(child);\r\n };\r\n ExistingValueProvider.prototype.node = function () {\r\n return this.node_;\r\n };\r\n return ExistingValueProvider;\r\n}());\r\nvar DeferredValueProvider = /** @class */ (function () {\r\n function DeferredValueProvider(syncTree, path) {\r\n this.syncTree_ = syncTree;\r\n this.path_ = path;\r\n }\r\n DeferredValueProvider.prototype.getImmediateChild = function (childName) {\r\n var childPath = this.path_.child(childName);\r\n return new DeferredValueProvider(this.syncTree_, childPath);\r\n };\r\n DeferredValueProvider.prototype.node = function () {\r\n return this.syncTree_.calcCompleteEventCache(this.path_);\r\n };\r\n return DeferredValueProvider;\r\n}());\r\n/**\r\n * Generate placeholders for deferred values.\r\n * @param {?Object} values\r\n * @return {!Object}\r\n */\r\nvar generateWithValues = function (values) {\r\n values = values || {};\r\n values['timestamp'] = values['timestamp'] || new Date().getTime();\r\n return values;\r\n};\r\n/**\r\n * Value to use when firing local events. When writing server values, fire\r\n * local events with an approximate value, otherwise return value as-is.\r\n * @param {(Object|string|number|boolean)} value\r\n * @param {!Object} serverValues\r\n * @return {!(string|number|boolean)}\r\n */\r\nvar resolveDeferredLeafValue = function (value, existingVal, serverValues) {\r\n if (!value || typeof value !== 'object') {\r\n return value;\r\n }\r\n assert('.sv' in value, 'Unexpected leaf node or priority contents');\r\n if (typeof value['.sv'] === 'string') {\r\n return resolveScalarDeferredValue(value['.sv'], existingVal, serverValues);\r\n }\r\n else if (typeof value['.sv'] === 'object') {\r\n return resolveComplexDeferredValue(value['.sv'], existingVal);\r\n }\r\n else {\r\n assert(false, 'Unexpected server value: ' + JSON.stringify(value, null, 2));\r\n }\r\n};\r\nvar resolveScalarDeferredValue = function (op, existing, serverValues) {\r\n switch (op) {\r\n case 'timestamp':\r\n return serverValues['timestamp'];\r\n default:\r\n assert(false, 'Unexpected server value: ' + op);\r\n }\r\n};\r\nvar resolveComplexDeferredValue = function (op, existing, unused) {\r\n if (!op.hasOwnProperty('increment')) {\r\n assert(false, 'Unexpected server value: ' + JSON.stringify(op, null, 2));\r\n }\r\n var delta = op['increment'];\r\n if (typeof delta !== 'number') {\r\n assert(false, 'Unexpected increment value: ' + delta);\r\n }\r\n var existingNode = existing.node();\r\n assert(existingNode !== null && typeof existingNode !== 'undefined', 'Expected ChildrenNode.EMPTY_NODE for nulls');\r\n // Incrementing a non-number sets the value to the incremented amount\r\n if (!existingNode.isLeafNode()) {\r\n return delta;\r\n }\r\n var leaf = existingNode;\r\n var existingVal = leaf.getValue();\r\n if (typeof existingVal !== 'number') {\r\n return delta;\r\n }\r\n // No need to do over/underflow arithmetic here because JS only handles floats under the covers\r\n return existingVal + delta;\r\n};\r\n/**\r\n * Recursively replace all deferred values and priorities in the tree with the\r\n * specified generated replacement values.\r\n * @param {!Path} path path to which write is relative\r\n * @param {!Node} node new data written at path\r\n * @param {!SyncTree} syncTree current data\r\n * @param {!Object} serverValues\r\n * @return {!SparseSnapshotTree}\r\n */\r\nvar resolveDeferredValueTree = function (path, node, syncTree, serverValues) {\r\n return resolveDeferredValue(node, new DeferredValueProvider(syncTree, path), serverValues);\r\n};\r\n/**\r\n * Recursively replace all deferred values and priorities in the node with the\r\n * specified generated replacement values. If there are no server values in the node,\r\n * it'll be returned as-is.\r\n * @param {!Node} node\r\n * @param {!Object} serverValues\r\n * @return {!Node}\r\n */\r\nvar resolveDeferredValueSnapshot = function (node, existing, serverValues) {\r\n return resolveDeferredValue(node, new ExistingValueProvider(existing), serverValues);\r\n};\r\nfunction resolveDeferredValue(node, existingVal, serverValues) {\r\n var rawPri = node.getPriority().val();\r\n var priority = resolveDeferredLeafValue(rawPri, existingVal.getImmediateChild('.priority'), serverValues);\r\n var newNode;\r\n if (node.isLeafNode()) {\r\n var leafNode = node;\r\n var value = resolveDeferredLeafValue(leafNode.getValue(), existingVal, serverValues);\r\n if (value !== leafNode.getValue() ||\r\n priority !== leafNode.getPriority().val()) {\r\n return new LeafNode(value, nodeFromJSON$1(priority));\r\n }\r\n else {\r\n return node;\r\n }\r\n }\r\n else {\r\n var childrenNode = node;\r\n newNode = childrenNode;\r\n if (priority !== childrenNode.getPriority().val()) {\r\n newNode = newNode.updatePriority(new LeafNode(priority));\r\n }\r\n childrenNode.forEachChild(PRIORITY_INDEX, function (childName, childNode) {\r\n var newChildNode = resolveDeferredValue(childNode, existingVal.getImmediateChild(childName), serverValues);\r\n if (newChildNode !== childNode) {\r\n newNode = newNode.updateImmediateChild(childName, newChildNode);\r\n }\r\n });\r\n return newNode;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Helper class to store a sparse set of snapshots.\r\n */\r\nvar SparseSnapshotTree = /** @class */ (function () {\r\n function SparseSnapshotTree() {\r\n this.value = null;\r\n this.children = new Map();\r\n }\r\n /**\r\n * Gets the node stored at the given path if one exists.\r\n *\r\n * @param path Path to look up snapshot for.\r\n * @return The retrieved node, or null.\r\n */\r\n SparseSnapshotTree.prototype.find = function (path) {\r\n if (this.value != null) {\r\n return this.value.getChild(path);\r\n }\r\n else if (!path.isEmpty() && this.children.size > 0) {\r\n var childKey = path.getFront();\r\n path = path.popFront();\r\n if (this.children.has(childKey)) {\r\n var childTree = this.children.get(childKey);\r\n return childTree.find(path);\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n return null;\r\n }\r\n };\r\n /**\r\n * Stores the given node at the specified path. If there is already a node\r\n * at a shallower path, it merges the new data into that snapshot node.\r\n *\r\n * @param path Path to look up snapshot for.\r\n * @param data The new data, or null.\r\n */\r\n SparseSnapshotTree.prototype.remember = function (path, data) {\r\n if (path.isEmpty()) {\r\n this.value = data;\r\n this.children.clear();\r\n }\r\n else if (this.value !== null) {\r\n this.value = this.value.updateChild(path, data);\r\n }\r\n else {\r\n var childKey = path.getFront();\r\n if (!this.children.has(childKey)) {\r\n this.children.set(childKey, new SparseSnapshotTree());\r\n }\r\n var child = this.children.get(childKey);\r\n path = path.popFront();\r\n child.remember(path, data);\r\n }\r\n };\r\n /**\r\n * Purge the data at path from the cache.\r\n *\r\n * @param path Path to look up snapshot for.\r\n * @return True if this node should now be removed.\r\n */\r\n SparseSnapshotTree.prototype.forget = function (path) {\r\n if (path.isEmpty()) {\r\n this.value = null;\r\n this.children.clear();\r\n return true;\r\n }\r\n else {\r\n if (this.value !== null) {\r\n if (this.value.isLeafNode()) {\r\n // We're trying to forget a node that doesn't exist\r\n return false;\r\n }\r\n else {\r\n var value = this.value;\r\n this.value = null;\r\n var self_1 = this;\r\n value.forEachChild(PRIORITY_INDEX, function (key, tree) {\r\n self_1.remember(new Path(key), tree);\r\n });\r\n return this.forget(path);\r\n }\r\n }\r\n else if (this.children.size > 0) {\r\n var childKey = path.getFront();\r\n path = path.popFront();\r\n if (this.children.has(childKey)) {\r\n var safeToRemove = this.children.get(childKey).forget(path);\r\n if (safeToRemove) {\r\n this.children.delete(childKey);\r\n }\r\n }\r\n return this.children.size === 0;\r\n }\r\n else {\r\n return true;\r\n }\r\n }\r\n };\r\n /**\r\n * Recursively iterates through all of the stored tree and calls the\r\n * callback on each one.\r\n *\r\n * @param prefixPath Path to look up node for.\r\n * @param func The function to invoke for each tree.\r\n */\r\n SparseSnapshotTree.prototype.forEachTree = function (prefixPath, func) {\r\n if (this.value !== null) {\r\n func(prefixPath, this.value);\r\n }\r\n else {\r\n this.forEachChild(function (key, tree) {\r\n var path = new Path(prefixPath.toString() + '/' + key);\r\n tree.forEachTree(path, func);\r\n });\r\n }\r\n };\r\n /**\r\n * Iterates through each immediate child and triggers the callback.\r\n *\r\n * @param func The function to invoke for each child.\r\n */\r\n SparseSnapshotTree.prototype.forEachChild = function (func) {\r\n this.children.forEach(function (tree, key) {\r\n func(key, tree);\r\n });\r\n };\r\n return SparseSnapshotTree;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n *\r\n * @enum\r\n */\r\nvar OperationType;\r\n(function (OperationType) {\r\n OperationType[OperationType[\"OVERWRITE\"] = 0] = \"OVERWRITE\";\r\n OperationType[OperationType[\"MERGE\"] = 1] = \"MERGE\";\r\n OperationType[OperationType[\"ACK_USER_WRITE\"] = 2] = \"ACK_USER_WRITE\";\r\n OperationType[OperationType[\"LISTEN_COMPLETE\"] = 3] = \"LISTEN_COMPLETE\";\r\n})(OperationType || (OperationType = {}));\r\n/**\r\n * @param {boolean} fromUser\r\n * @param {boolean} fromServer\r\n * @param {?string} queryId\r\n * @param {boolean} tagged\r\n * @constructor\r\n */\r\nvar OperationSource = /** @class */ (function () {\r\n function OperationSource(fromUser, fromServer, queryId, tagged) {\r\n this.fromUser = fromUser;\r\n this.fromServer = fromServer;\r\n this.queryId = queryId;\r\n this.tagged = tagged;\r\n assert(!tagged || fromServer, 'Tagged queries must be from server.');\r\n }\r\n /**\r\n * @const\r\n * @type {!OperationSource}\r\n */\r\n OperationSource.User = new OperationSource(\r\n /*fromUser=*/ true, false, null, \r\n /*tagged=*/ false);\r\n /**\r\n * @const\r\n * @type {!OperationSource}\r\n */\r\n OperationSource.Server = new OperationSource(false, \r\n /*fromServer=*/ true, null, \r\n /*tagged=*/ false);\r\n /**\r\n * @param {string} queryId\r\n * @return {!OperationSource}\r\n */\r\n OperationSource.forServerTaggedQuery = function (queryId) {\r\n return new OperationSource(false, \r\n /*fromServer=*/ true, queryId, \r\n /*tagged=*/ true);\r\n };\r\n return OperationSource;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar AckUserWrite = /** @class */ (function () {\r\n /**\r\n *\r\n * @param {!Path} path\r\n * @param {!ImmutableTree<!boolean>} affectedTree A tree containing true for each affected path. Affected paths can't overlap.\r\n * @param {!boolean} revert\r\n */\r\n function AckUserWrite(\r\n /** @inheritDoc */ path, \r\n /** @inheritDoc */ affectedTree, \r\n /** @inheritDoc */ revert) {\r\n this.path = path;\r\n this.affectedTree = affectedTree;\r\n this.revert = revert;\r\n /** @inheritDoc */\r\n this.type = OperationType.ACK_USER_WRITE;\r\n /** @inheritDoc */\r\n this.source = OperationSource.User;\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n AckUserWrite.prototype.operationForChild = function (childName) {\r\n if (!this.path.isEmpty()) {\r\n assert(this.path.getFront() === childName, 'operationForChild called for unrelated child.');\r\n return new AckUserWrite(this.path.popFront(), this.affectedTree, this.revert);\r\n }\r\n else if (this.affectedTree.value != null) {\r\n assert(this.affectedTree.children.isEmpty(), 'affectedTree should not have overlapping affected paths.');\r\n // All child locations are affected as well; just return same operation.\r\n return this;\r\n }\r\n else {\r\n var childTree = this.affectedTree.subtree(new Path(childName));\r\n return new AckUserWrite(Path.Empty, childTree, this.revert);\r\n }\r\n };\r\n return AckUserWrite;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar emptyChildrenSingleton;\r\n/**\r\n * Singleton empty children collection.\r\n *\r\n * @const\r\n * @type {!SortedMap.<string, !ImmutableTree.<?>>}\r\n */\r\nvar EmptyChildren = function () {\r\n if (!emptyChildrenSingleton) {\r\n emptyChildrenSingleton = new SortedMap(stringCompare);\r\n }\r\n return emptyChildrenSingleton;\r\n};\r\n/**\r\n * A tree with immutable elements.\r\n */\r\nvar ImmutableTree = /** @class */ (function () {\r\n /**\r\n * @template T\r\n * @param {?T} value\r\n * @param {SortedMap.<string, !ImmutableTree.<T>>=} children\r\n */\r\n function ImmutableTree(value, children) {\r\n if (children === void 0) { children = EmptyChildren(); }\r\n this.value = value;\r\n this.children = children;\r\n }\r\n /**\r\n * @template T\r\n * @param {!Object.<string, !T>} obj\r\n * @return {!ImmutableTree.<!T>}\r\n */\r\n ImmutableTree.fromObject = function (obj) {\r\n var tree = ImmutableTree.Empty;\r\n each(obj, function (childPath, childSnap) {\r\n tree = tree.set(new Path(childPath), childSnap);\r\n });\r\n return tree;\r\n };\r\n /**\r\n * True if the value is empty and there are no children\r\n * @return {boolean}\r\n */\r\n ImmutableTree.prototype.isEmpty = function () {\r\n return this.value === null && this.children.isEmpty();\r\n };\r\n /**\r\n * Given a path and predicate, return the first node and the path to that node\r\n * where the predicate returns true.\r\n *\r\n * TODO Do a perf test -- If we're creating a bunch of {path: value:} objects\r\n * on the way back out, it may be better to pass down a pathSoFar obj.\r\n *\r\n * @param {!Path} relativePath The remainder of the path\r\n * @param {function(T):boolean} predicate The predicate to satisfy to return a\r\n * node\r\n * @return {?{path:!Path, value:!T}}\r\n */\r\n ImmutableTree.prototype.findRootMostMatchingPathAndValue = function (relativePath, predicate) {\r\n if (this.value != null && predicate(this.value)) {\r\n return { path: Path.Empty, value: this.value };\r\n }\r\n else {\r\n if (relativePath.isEmpty()) {\r\n return null;\r\n }\r\n else {\r\n var front = relativePath.getFront();\r\n var child = this.children.get(front);\r\n if (child !== null) {\r\n var childExistingPathAndValue = child.findRootMostMatchingPathAndValue(relativePath.popFront(), predicate);\r\n if (childExistingPathAndValue != null) {\r\n var fullPath = new Path(front).child(childExistingPathAndValue.path);\r\n return { path: fullPath, value: childExistingPathAndValue.value };\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Find, if it exists, the shortest subpath of the given path that points a defined\r\n * value in the tree\r\n * @param {!Path} relativePath\r\n * @return {?{path: !Path, value: !T}}\r\n */\r\n ImmutableTree.prototype.findRootMostValueAndPath = function (relativePath) {\r\n return this.findRootMostMatchingPathAndValue(relativePath, function () { return true; });\r\n };\r\n /**\r\n * @param {!Path} relativePath\r\n * @return {!ImmutableTree.<T>} The subtree at the given path\r\n */\r\n ImmutableTree.prototype.subtree = function (relativePath) {\r\n if (relativePath.isEmpty()) {\r\n return this;\r\n }\r\n else {\r\n var front = relativePath.getFront();\r\n var childTree = this.children.get(front);\r\n if (childTree !== null) {\r\n return childTree.subtree(relativePath.popFront());\r\n }\r\n else {\r\n return ImmutableTree.Empty;\r\n }\r\n }\r\n };\r\n /**\r\n * Sets a value at the specified path.\r\n *\r\n * @param {!Path} relativePath Path to set value at.\r\n * @param {?T} toSet Value to set.\r\n * @return {!ImmutableTree.<T>} Resulting tree.\r\n */\r\n ImmutableTree.prototype.set = function (relativePath, toSet) {\r\n if (relativePath.isEmpty()) {\r\n return new ImmutableTree(toSet, this.children);\r\n }\r\n else {\r\n var front = relativePath.getFront();\r\n var child = this.children.get(front) || ImmutableTree.Empty;\r\n var newChild = child.set(relativePath.popFront(), toSet);\r\n var newChildren = this.children.insert(front, newChild);\r\n return new ImmutableTree(this.value, newChildren);\r\n }\r\n };\r\n /**\r\n * Removes the value at the specified path.\r\n *\r\n * @param {!Path} relativePath Path to value to remove.\r\n * @return {!ImmutableTree.<T>} Resulting tree.\r\n */\r\n ImmutableTree.prototype.remove = function (relativePath) {\r\n if (relativePath.isEmpty()) {\r\n if (this.children.isEmpty()) {\r\n return ImmutableTree.Empty;\r\n }\r\n else {\r\n return new ImmutableTree(null, this.children);\r\n }\r\n }\r\n else {\r\n var front = relativePath.getFront();\r\n var child = this.children.get(front);\r\n if (child) {\r\n var newChild = child.remove(relativePath.popFront());\r\n var newChildren = void 0;\r\n if (newChild.isEmpty()) {\r\n newChildren = this.children.remove(front);\r\n }\r\n else {\r\n newChildren = this.children.insert(front, newChild);\r\n }\r\n if (this.value === null && newChildren.isEmpty()) {\r\n return ImmutableTree.Empty;\r\n }\r\n else {\r\n return new ImmutableTree(this.value, newChildren);\r\n }\r\n }\r\n else {\r\n return this;\r\n }\r\n }\r\n };\r\n /**\r\n * Gets a value from the tree.\r\n *\r\n * @param {!Path} relativePath Path to get value for.\r\n * @return {?T} Value at path, or null.\r\n */\r\n ImmutableTree.prototype.get = function (relativePath) {\r\n if (relativePath.isEmpty()) {\r\n return this.value;\r\n }\r\n else {\r\n var front = relativePath.getFront();\r\n var child = this.children.get(front);\r\n if (child) {\r\n return child.get(relativePath.popFront());\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n };\r\n /**\r\n * Replace the subtree at the specified path with the given new tree.\r\n *\r\n * @param {!Path} relativePath Path to replace subtree for.\r\n * @param {!ImmutableTree} newTree New tree.\r\n * @return {!ImmutableTree} Resulting tree.\r\n */\r\n ImmutableTree.prototype.setTree = function (relativePath, newTree) {\r\n if (relativePath.isEmpty()) {\r\n return newTree;\r\n }\r\n else {\r\n var front = relativePath.getFront();\r\n var child = this.children.get(front) || ImmutableTree.Empty;\r\n var newChild = child.setTree(relativePath.popFront(), newTree);\r\n var newChildren = void 0;\r\n if (newChild.isEmpty()) {\r\n newChildren = this.children.remove(front);\r\n }\r\n else {\r\n newChildren = this.children.insert(front, newChild);\r\n }\r\n return new ImmutableTree(this.value, newChildren);\r\n }\r\n };\r\n /**\r\n * Performs a depth first fold on this tree. Transforms a tree into a single\r\n * value, given a function that operates on the path to a node, an optional\r\n * current value, and a map of child names to folded subtrees\r\n * @template V\r\n * @param {function(Path, ?T, Object.<string, V>):V} fn\r\n * @return {V}\r\n */\r\n ImmutableTree.prototype.fold = function (fn) {\r\n return this.fold_(Path.Empty, fn);\r\n };\r\n /**\r\n * Recursive helper for public-facing fold() method\r\n * @template V\r\n * @param {!Path} pathSoFar\r\n * @param {function(Path, ?T, Object.<string, V>):V} fn\r\n * @return {V}\r\n * @private\r\n */\r\n ImmutableTree.prototype.fold_ = function (pathSoFar, fn) {\r\n var accum = {};\r\n this.children.inorderTraversal(function (childKey, childTree) {\r\n accum[childKey] = childTree.fold_(pathSoFar.child(childKey), fn);\r\n });\r\n return fn(pathSoFar, this.value, accum);\r\n };\r\n /**\r\n * Find the first matching value on the given path. Return the result of applying f to it.\r\n * @template V\r\n * @param {!Path} path\r\n * @param {!function(!Path, !T):?V} f\r\n * @return {?V}\r\n */\r\n ImmutableTree.prototype.findOnPath = function (path, f) {\r\n return this.findOnPath_(path, Path.Empty, f);\r\n };\r\n ImmutableTree.prototype.findOnPath_ = function (pathToFollow, pathSoFar, f) {\r\n var result = this.value ? f(pathSoFar, this.value) : false;\r\n if (result) {\r\n return result;\r\n }\r\n else {\r\n if (pathToFollow.isEmpty()) {\r\n return null;\r\n }\r\n else {\r\n var front = pathToFollow.getFront();\r\n var nextChild = this.children.get(front);\r\n if (nextChild) {\r\n return nextChild.findOnPath_(pathToFollow.popFront(), pathSoFar.child(front), f);\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n *\r\n * @param {!Path} path\r\n * @param {!function(!Path, !T)} f\r\n * @returns {!ImmutableTree.<T>}\r\n */\r\n ImmutableTree.prototype.foreachOnPath = function (path, f) {\r\n return this.foreachOnPath_(path, Path.Empty, f);\r\n };\r\n ImmutableTree.prototype.foreachOnPath_ = function (pathToFollow, currentRelativePath, f) {\r\n if (pathToFollow.isEmpty()) {\r\n return this;\r\n }\r\n else {\r\n if (this.value) {\r\n f(currentRelativePath, this.value);\r\n }\r\n var front = pathToFollow.getFront();\r\n var nextChild = this.children.get(front);\r\n if (nextChild) {\r\n return nextChild.foreachOnPath_(pathToFollow.popFront(), currentRelativePath.child(front), f);\r\n }\r\n else {\r\n return ImmutableTree.Empty;\r\n }\r\n }\r\n };\r\n /**\r\n * Calls the given function for each node in the tree that has a value.\r\n *\r\n * @param {function(!Path, !T)} f A function to be called with\r\n * the path from the root of the tree to a node, and the value at that node.\r\n * Called in depth-first order.\r\n */\r\n ImmutableTree.prototype.foreach = function (f) {\r\n this.foreach_(Path.Empty, f);\r\n };\r\n ImmutableTree.prototype.foreach_ = function (currentRelativePath, f) {\r\n this.children.inorderTraversal(function (childName, childTree) {\r\n childTree.foreach_(currentRelativePath.child(childName), f);\r\n });\r\n if (this.value) {\r\n f(currentRelativePath, this.value);\r\n }\r\n };\r\n /**\r\n *\r\n * @param {function(string, !T)} f\r\n */\r\n ImmutableTree.prototype.foreachChild = function (f) {\r\n this.children.inorderTraversal(function (childName, childTree) {\r\n if (childTree.value) {\r\n f(childName, childTree.value);\r\n }\r\n });\r\n };\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n ImmutableTree.Empty = new ImmutableTree(null);\r\n return ImmutableTree;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @param {!OperationSource} source\r\n * @param {!Path} path\r\n * @constructor\r\n * @implements {Operation}\r\n */\r\nvar ListenComplete = /** @class */ (function () {\r\n function ListenComplete(source, path) {\r\n this.source = source;\r\n this.path = path;\r\n /** @inheritDoc */\r\n this.type = OperationType.LISTEN_COMPLETE;\r\n }\r\n ListenComplete.prototype.operationForChild = function (childName) {\r\n if (this.path.isEmpty()) {\r\n return new ListenComplete(this.source, Path.Empty);\r\n }\r\n else {\r\n return new ListenComplete(this.source, this.path.popFront());\r\n }\r\n };\r\n return ListenComplete;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @param {!OperationSource} source\r\n * @param {!Path} path\r\n * @param {!Node} snap\r\n * @constructor\r\n * @implements {Operation}\r\n */\r\nvar Overwrite = /** @class */ (function () {\r\n function Overwrite(source, path, snap) {\r\n this.source = source;\r\n this.path = path;\r\n this.snap = snap;\r\n /** @inheritDoc */\r\n this.type = OperationType.OVERWRITE;\r\n }\r\n Overwrite.prototype.operationForChild = function (childName) {\r\n if (this.path.isEmpty()) {\r\n return new Overwrite(this.source, Path.Empty, this.snap.getImmediateChild(childName));\r\n }\r\n else {\r\n return new Overwrite(this.source, this.path.popFront(), this.snap);\r\n }\r\n };\r\n return Overwrite;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @param {!OperationSource} source\r\n * @param {!Path} path\r\n * @param {!ImmutableTree.<!Node>} children\r\n * @constructor\r\n * @implements {Operation}\r\n */\r\nvar Merge = /** @class */ (function () {\r\n function Merge(\r\n /** @inheritDoc */ source, \r\n /** @inheritDoc */ path, \r\n /** @inheritDoc */ children) {\r\n this.source = source;\r\n this.path = path;\r\n this.children = children;\r\n /** @inheritDoc */\r\n this.type = OperationType.MERGE;\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n Merge.prototype.operationForChild = function (childName) {\r\n if (this.path.isEmpty()) {\r\n var childTree = this.children.subtree(new Path(childName));\r\n if (childTree.isEmpty()) {\r\n // This child is unaffected\r\n return null;\r\n }\r\n else if (childTree.value) {\r\n // We have a snapshot for the child in question. This becomes an overwrite of the child.\r\n return new Overwrite(this.source, Path.Empty, childTree.value);\r\n }\r\n else {\r\n // This is a merge at a deeper level\r\n return new Merge(this.source, Path.Empty, childTree);\r\n }\r\n }\r\n else {\r\n assert(this.path.getFront() === childName, \"Can't get a merge for a child not on the path of the operation\");\r\n return new Merge(this.source, this.path.popFront(), this.children);\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n Merge.prototype.toString = function () {\r\n return ('Operation(' +\r\n this.path +\r\n ': ' +\r\n this.source.toString() +\r\n ' merge: ' +\r\n this.children.toString() +\r\n ')');\r\n };\r\n return Merge;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A cache node only stores complete children. Additionally it holds a flag whether the node can be considered fully\r\n * initialized in the sense that we know at one point in time this represented a valid state of the world, e.g.\r\n * initialized with data from the server, or a complete overwrite by the client. The filtered flag also tracks\r\n * whether a node potentially had children removed due to a filter.\r\n */\r\nvar CacheNode = /** @class */ (function () {\r\n /**\r\n * @param {!Node} node_\r\n * @param {boolean} fullyInitialized_\r\n * @param {boolean} filtered_\r\n */\r\n function CacheNode(node_, fullyInitialized_, filtered_) {\r\n this.node_ = node_;\r\n this.fullyInitialized_ = fullyInitialized_;\r\n this.filtered_ = filtered_;\r\n }\r\n /**\r\n * Returns whether this node was fully initialized with either server data or a complete overwrite by the client\r\n * @return {boolean}\r\n */\r\n CacheNode.prototype.isFullyInitialized = function () {\r\n return this.fullyInitialized_;\r\n };\r\n /**\r\n * Returns whether this node is potentially missing children due to a filter applied to the node\r\n * @return {boolean}\r\n */\r\n CacheNode.prototype.isFiltered = function () {\r\n return this.filtered_;\r\n };\r\n /**\r\n * @param {!Path} path\r\n * @return {boolean}\r\n */\r\n CacheNode.prototype.isCompleteForPath = function (path) {\r\n if (path.isEmpty()) {\r\n return this.isFullyInitialized() && !this.filtered_;\r\n }\r\n var childKey = path.getFront();\r\n return this.isCompleteForChild(childKey);\r\n };\r\n /**\r\n * @param {!string} key\r\n * @return {boolean}\r\n */\r\n CacheNode.prototype.isCompleteForChild = function (key) {\r\n return ((this.isFullyInitialized() && !this.filtered_) || this.node_.hasChild(key));\r\n };\r\n /**\r\n * @return {!Node}\r\n */\r\n CacheNode.prototype.getNode = function () {\r\n return this.node_;\r\n };\r\n return CacheNode;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Stores the data we have cached for a view.\r\n *\r\n * serverSnap is the cached server data, eventSnap is the cached event data (server data plus any local writes).\r\n *\r\n * @constructor\r\n */\r\nvar ViewCache = /** @class */ (function () {\r\n /**\r\n *\r\n * @param {!CacheNode} eventCache_\r\n * @param {!CacheNode} serverCache_\r\n */\r\n function ViewCache(eventCache_, serverCache_) {\r\n this.eventCache_ = eventCache_;\r\n this.serverCache_ = serverCache_;\r\n }\r\n /**\r\n * @param {!Node} eventSnap\r\n * @param {boolean} complete\r\n * @param {boolean} filtered\r\n * @return {!ViewCache}\r\n */\r\n ViewCache.prototype.updateEventSnap = function (eventSnap, complete, filtered) {\r\n return new ViewCache(new CacheNode(eventSnap, complete, filtered), this.serverCache_);\r\n };\r\n /**\r\n * @param {!Node} serverSnap\r\n * @param {boolean} complete\r\n * @param {boolean} filtered\r\n * @return {!ViewCache}\r\n */\r\n ViewCache.prototype.updateServerSnap = function (serverSnap, complete, filtered) {\r\n return new ViewCache(this.eventCache_, new CacheNode(serverSnap, complete, filtered));\r\n };\r\n /**\r\n * @return {!CacheNode}\r\n */\r\n ViewCache.prototype.getEventCache = function () {\r\n return this.eventCache_;\r\n };\r\n /**\r\n * @return {?Node}\r\n */\r\n ViewCache.prototype.getCompleteEventSnap = function () {\r\n return this.eventCache_.isFullyInitialized()\r\n ? this.eventCache_.getNode()\r\n : null;\r\n };\r\n /**\r\n * @return {!CacheNode}\r\n */\r\n ViewCache.prototype.getServerCache = function () {\r\n return this.serverCache_;\r\n };\r\n /**\r\n * @return {?Node}\r\n */\r\n ViewCache.prototype.getCompleteServerSnap = function () {\r\n return this.serverCache_.isFullyInitialized()\r\n ? this.serverCache_.getNode()\r\n : null;\r\n };\r\n /**\r\n * @const\r\n * @type {ViewCache}\r\n */\r\n ViewCache.Empty = new ViewCache(new CacheNode(ChildrenNode.EMPTY_NODE, \r\n /*fullyInitialized=*/ false, \r\n /*filtered=*/ false), new CacheNode(ChildrenNode.EMPTY_NODE, \r\n /*fullyInitialized=*/ false, \r\n /*filtered=*/ false));\r\n return ViewCache;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @constructor\r\n * @struct\r\n * @param {!string} type The event type\r\n * @param {!Node} snapshotNode The data\r\n * @param {string=} childName The name for this child, if it's a child event\r\n * @param {Node=} oldSnap Used for intermediate processing of child changed events\r\n * @param {string=} prevName The name for the previous child, if applicable\r\n */\r\nvar Change = /** @class */ (function () {\r\n function Change(type, snapshotNode, childName, oldSnap, prevName) {\r\n this.type = type;\r\n this.snapshotNode = snapshotNode;\r\n this.childName = childName;\r\n this.oldSnap = oldSnap;\r\n this.prevName = prevName;\r\n }\r\n /**\r\n * @param {!Node} snapshot\r\n * @return {!Change}\r\n */\r\n Change.valueChange = function (snapshot) {\r\n return new Change(Change.VALUE, snapshot);\r\n };\r\n /**\r\n * @param {string} childKey\r\n * @param {!Node} snapshot\r\n * @return {!Change}\r\n */\r\n Change.childAddedChange = function (childKey, snapshot) {\r\n return new Change(Change.CHILD_ADDED, snapshot, childKey);\r\n };\r\n /**\r\n * @param {string} childKey\r\n * @param {!Node} snapshot\r\n * @return {!Change}\r\n */\r\n Change.childRemovedChange = function (childKey, snapshot) {\r\n return new Change(Change.CHILD_REMOVED, snapshot, childKey);\r\n };\r\n /**\r\n * @param {string} childKey\r\n * @param {!Node} newSnapshot\r\n * @param {!Node} oldSnapshot\r\n * @return {!Change}\r\n */\r\n Change.childChangedChange = function (childKey, newSnapshot, oldSnapshot) {\r\n return new Change(Change.CHILD_CHANGED, newSnapshot, childKey, oldSnapshot);\r\n };\r\n /**\r\n * @param {string} childKey\r\n * @param {!Node} snapshot\r\n * @return {!Change}\r\n */\r\n Change.childMovedChange = function (childKey, snapshot) {\r\n return new Change(Change.CHILD_MOVED, snapshot, childKey);\r\n };\r\n //event types\r\n /** Event type for a child added */\r\n Change.CHILD_ADDED = 'child_added';\r\n /** Event type for a child removed */\r\n Change.CHILD_REMOVED = 'child_removed';\r\n /** Event type for a child changed */\r\n Change.CHILD_CHANGED = 'child_changed';\r\n /** Event type for a child moved */\r\n Change.CHILD_MOVED = 'child_moved';\r\n /** Event type for a value change */\r\n Change.VALUE = 'value';\r\n return Change;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Doesn't really filter nodes but applies an index to the node and keeps track of any changes\r\n *\r\n * @constructor\r\n * @implements {NodeFilter}\r\n * @param {!Index} index\r\n */\r\nvar IndexedFilter = /** @class */ (function () {\r\n function IndexedFilter(index_) {\r\n this.index_ = index_;\r\n }\r\n IndexedFilter.prototype.updateChild = function (snap, key, newChild, affectedPath, source, optChangeAccumulator) {\r\n assert(snap.isIndexed(this.index_), 'A node must be indexed if only a child is updated');\r\n var oldChild = snap.getImmediateChild(key);\r\n // Check if anything actually changed.\r\n if (oldChild.getChild(affectedPath).equals(newChild.getChild(affectedPath))) {\r\n // There's an edge case where a child can enter or leave the view because affectedPath was set to null.\r\n // In this case, affectedPath will appear null in both the old and new snapshots. So we need\r\n // to avoid treating these cases as \"nothing changed.\"\r\n if (oldChild.isEmpty() === newChild.isEmpty()) {\r\n // Nothing changed.\r\n // This assert should be valid, but it's expensive (can dominate perf testing) so don't actually do it.\r\n //assert(oldChild.equals(newChild), 'Old and new snapshots should be equal.');\r\n return snap;\r\n }\r\n }\r\n if (optChangeAccumulator != null) {\r\n if (newChild.isEmpty()) {\r\n if (snap.hasChild(key)) {\r\n optChangeAccumulator.trackChildChange(Change.childRemovedChange(key, oldChild));\r\n }\r\n else {\r\n assert(snap.isLeafNode(), 'A child remove without an old child only makes sense on a leaf node');\r\n }\r\n }\r\n else if (oldChild.isEmpty()) {\r\n optChangeAccumulator.trackChildChange(Change.childAddedChange(key, newChild));\r\n }\r\n else {\r\n optChangeAccumulator.trackChildChange(Change.childChangedChange(key, newChild, oldChild));\r\n }\r\n }\r\n if (snap.isLeafNode() && newChild.isEmpty()) {\r\n return snap;\r\n }\r\n else {\r\n // Make sure the node is indexed\r\n return snap.updateImmediateChild(key, newChild).withIndex(this.index_);\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n IndexedFilter.prototype.updateFullNode = function (oldSnap, newSnap, optChangeAccumulator) {\r\n if (optChangeAccumulator != null) {\r\n if (!oldSnap.isLeafNode()) {\r\n oldSnap.forEachChild(PRIORITY_INDEX, function (key, childNode) {\r\n if (!newSnap.hasChild(key)) {\r\n optChangeAccumulator.trackChildChange(Change.childRemovedChange(key, childNode));\r\n }\r\n });\r\n }\r\n if (!newSnap.isLeafNode()) {\r\n newSnap.forEachChild(PRIORITY_INDEX, function (key, childNode) {\r\n if (oldSnap.hasChild(key)) {\r\n var oldChild = oldSnap.getImmediateChild(key);\r\n if (!oldChild.equals(childNode)) {\r\n optChangeAccumulator.trackChildChange(Change.childChangedChange(key, childNode, oldChild));\r\n }\r\n }\r\n else {\r\n optChangeAccumulator.trackChildChange(Change.childAddedChange(key, childNode));\r\n }\r\n });\r\n }\r\n }\r\n return newSnap.withIndex(this.index_);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n IndexedFilter.prototype.updatePriority = function (oldSnap, newPriority) {\r\n if (oldSnap.isEmpty()) {\r\n return ChildrenNode.EMPTY_NODE;\r\n }\r\n else {\r\n return oldSnap.updatePriority(newPriority);\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n IndexedFilter.prototype.filtersNodes = function () {\r\n return false;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n IndexedFilter.prototype.getIndexedFilter = function () {\r\n return this;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n IndexedFilter.prototype.getIndex = function () {\r\n return this.index_;\r\n };\r\n return IndexedFilter;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar ChildChangeAccumulator = /** @class */ (function () {\r\n function ChildChangeAccumulator() {\r\n this.changeMap = new Map();\r\n }\r\n ChildChangeAccumulator.prototype.trackChildChange = function (change) {\r\n var type = change.type;\r\n var childKey = change.childName;\r\n assert(type === Change.CHILD_ADDED ||\r\n type === Change.CHILD_CHANGED ||\r\n type === Change.CHILD_REMOVED, 'Only child changes supported for tracking');\r\n assert(childKey !== '.priority', 'Only non-priority child changes can be tracked.');\r\n var oldChange = this.changeMap.get(childKey);\r\n if (oldChange) {\r\n var oldType = oldChange.type;\r\n if (type === Change.CHILD_ADDED && oldType === Change.CHILD_REMOVED) {\r\n this.changeMap.set(childKey, Change.childChangedChange(childKey, change.snapshotNode, oldChange.snapshotNode));\r\n }\r\n else if (type === Change.CHILD_REMOVED &&\r\n oldType === Change.CHILD_ADDED) {\r\n this.changeMap.delete(childKey);\r\n }\r\n else if (type === Change.CHILD_REMOVED &&\r\n oldType === Change.CHILD_CHANGED) {\r\n this.changeMap.set(childKey, Change.childRemovedChange(childKey, oldChange.oldSnap));\r\n }\r\n else if (type === Change.CHILD_CHANGED &&\r\n oldType === Change.CHILD_ADDED) {\r\n this.changeMap.set(childKey, Change.childAddedChange(childKey, change.snapshotNode));\r\n }\r\n else if (type === Change.CHILD_CHANGED &&\r\n oldType === Change.CHILD_CHANGED) {\r\n this.changeMap.set(childKey, Change.childChangedChange(childKey, change.snapshotNode, oldChange.oldSnap));\r\n }\r\n else {\r\n throw assertionError('Illegal combination of changes: ' +\r\n change +\r\n ' occurred after ' +\r\n oldChange);\r\n }\r\n }\r\n else {\r\n this.changeMap.set(childKey, change);\r\n }\r\n };\r\n ChildChangeAccumulator.prototype.getChanges = function () {\r\n return Array.from(this.changeMap.values());\r\n };\r\n return ChildChangeAccumulator;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An implementation of CompleteChildSource that never returns any additional children\r\n *\r\n * @private\r\n * @constructor\r\n * @implements CompleteChildSource\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nvar NoCompleteChildSource_ = /** @class */ (function () {\r\n function NoCompleteChildSource_() {\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n NoCompleteChildSource_.prototype.getCompleteChild = function (childKey) {\r\n return null;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n NoCompleteChildSource_.prototype.getChildAfterChild = function (index, child, reverse) {\r\n return null;\r\n };\r\n return NoCompleteChildSource_;\r\n}());\r\n/**\r\n * Singleton instance.\r\n * @const\r\n * @type {!CompleteChildSource}\r\n */\r\nvar NO_COMPLETE_CHILD_SOURCE = new NoCompleteChildSource_();\r\n/**\r\n * An implementation of CompleteChildSource that uses a WriteTree in addition to any other server data or\r\n * old event caches available to calculate complete children.\r\n *\r\n *\r\n * @implements CompleteChildSource\r\n */\r\nvar WriteTreeCompleteChildSource = /** @class */ (function () {\r\n /**\r\n * @param {!WriteTreeRef} writes_\r\n * @param {!ViewCache} viewCache_\r\n * @param {?Node} optCompleteServerCache_\r\n */\r\n function WriteTreeCompleteChildSource(writes_, viewCache_, optCompleteServerCache_) {\r\n if (optCompleteServerCache_ === void 0) { optCompleteServerCache_ = null; }\r\n this.writes_ = writes_;\r\n this.viewCache_ = viewCache_;\r\n this.optCompleteServerCache_ = optCompleteServerCache_;\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n WriteTreeCompleteChildSource.prototype.getCompleteChild = function (childKey) {\r\n var node = this.viewCache_.getEventCache();\r\n if (node.isCompleteForChild(childKey)) {\r\n return node.getNode().getImmediateChild(childKey);\r\n }\r\n else {\r\n var serverNode = this.optCompleteServerCache_ != null\r\n ? new CacheNode(this.optCompleteServerCache_, true, false)\r\n : this.viewCache_.getServerCache();\r\n return this.writes_.calcCompleteChild(childKey, serverNode);\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n WriteTreeCompleteChildSource.prototype.getChildAfterChild = function (index, child, reverse) {\r\n var completeServerData = this.optCompleteServerCache_ != null\r\n ? this.optCompleteServerCache_\r\n : this.viewCache_.getCompleteServerSnap();\r\n var nodes = this.writes_.calcIndexedSlice(completeServerData, child, 1, reverse, index);\r\n if (nodes.length === 0) {\r\n return null;\r\n }\r\n else {\r\n return nodes[0];\r\n }\r\n };\r\n return WriteTreeCompleteChildSource;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @constructor\r\n * @struct\r\n */\r\nvar ProcessorResult = /** @class */ (function () {\r\n /**\r\n * @param {!ViewCache} viewCache\r\n * @param {!Array.<!Change>} changes\r\n */\r\n function ProcessorResult(viewCache, changes) {\r\n this.viewCache = viewCache;\r\n this.changes = changes;\r\n }\r\n return ProcessorResult;\r\n}());\r\n/**\r\n * @constructor\r\n */\r\nvar ViewProcessor = /** @class */ (function () {\r\n /**\r\n * @param {!NodeFilter} filter_\r\n */\r\n function ViewProcessor(filter_) {\r\n this.filter_ = filter_;\r\n }\r\n /**\r\n * @param {!ViewCache} viewCache\r\n */\r\n ViewProcessor.prototype.assertIndexed = function (viewCache) {\r\n assert(viewCache.getEventCache().getNode().isIndexed(this.filter_.getIndex()), 'Event snap not indexed');\r\n assert(viewCache.getServerCache().getNode().isIndexed(this.filter_.getIndex()), 'Server snap not indexed');\r\n };\r\n /**\r\n * @param {!ViewCache} oldViewCache\r\n * @param {!Operation} operation\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {?Node} completeCache\r\n * @return {!ProcessorResult}\r\n */\r\n ViewProcessor.prototype.applyOperation = function (oldViewCache, operation, writesCache, completeCache) {\r\n var accumulator = new ChildChangeAccumulator();\r\n var newViewCache, filterServerNode;\r\n if (operation.type === OperationType.OVERWRITE) {\r\n var overwrite = operation;\r\n if (overwrite.source.fromUser) {\r\n newViewCache = this.applyUserOverwrite_(oldViewCache, overwrite.path, overwrite.snap, writesCache, completeCache, accumulator);\r\n }\r\n else {\r\n assert(overwrite.source.fromServer, 'Unknown source.');\r\n // We filter the node if it's a tagged update or the node has been previously filtered and the\r\n // update is not at the root in which case it is ok (and necessary) to mark the node unfiltered\r\n // again\r\n filterServerNode =\r\n overwrite.source.tagged ||\r\n (oldViewCache.getServerCache().isFiltered() &&\r\n !overwrite.path.isEmpty());\r\n newViewCache = this.applyServerOverwrite_(oldViewCache, overwrite.path, overwrite.snap, writesCache, completeCache, filterServerNode, accumulator);\r\n }\r\n }\r\n else if (operation.type === OperationType.MERGE) {\r\n var merge = operation;\r\n if (merge.source.fromUser) {\r\n newViewCache = this.applyUserMerge_(oldViewCache, merge.path, merge.children, writesCache, completeCache, accumulator);\r\n }\r\n else {\r\n assert(merge.source.fromServer, 'Unknown source.');\r\n // We filter the node if it's a tagged update or the node has been previously filtered\r\n filterServerNode =\r\n merge.source.tagged || oldViewCache.getServerCache().isFiltered();\r\n newViewCache = this.applyServerMerge_(oldViewCache, merge.path, merge.children, writesCache, completeCache, filterServerNode, accumulator);\r\n }\r\n }\r\n else if (operation.type === OperationType.ACK_USER_WRITE) {\r\n var ackUserWrite = operation;\r\n if (!ackUserWrite.revert) {\r\n newViewCache = this.ackUserWrite_(oldViewCache, ackUserWrite.path, ackUserWrite.affectedTree, writesCache, completeCache, accumulator);\r\n }\r\n else {\r\n newViewCache = this.revertUserWrite_(oldViewCache, ackUserWrite.path, writesCache, completeCache, accumulator);\r\n }\r\n }\r\n else if (operation.type === OperationType.LISTEN_COMPLETE) {\r\n newViewCache = this.listenComplete_(oldViewCache, operation.path, writesCache, accumulator);\r\n }\r\n else {\r\n throw assertionError('Unknown operation type: ' + operation.type);\r\n }\r\n var changes = accumulator.getChanges();\r\n ViewProcessor.maybeAddValueEvent_(oldViewCache, newViewCache, changes);\r\n return new ProcessorResult(newViewCache, changes);\r\n };\r\n /**\r\n * @param {!ViewCache} oldViewCache\r\n * @param {!ViewCache} newViewCache\r\n * @param {!Array.<!Change>} accumulator\r\n * @private\r\n */\r\n ViewProcessor.maybeAddValueEvent_ = function (oldViewCache, newViewCache, accumulator) {\r\n var eventSnap = newViewCache.getEventCache();\r\n if (eventSnap.isFullyInitialized()) {\r\n var isLeafOrEmpty = eventSnap.getNode().isLeafNode() || eventSnap.getNode().isEmpty();\r\n var oldCompleteSnap = oldViewCache.getCompleteEventSnap();\r\n if (accumulator.length > 0 ||\r\n !oldViewCache.getEventCache().isFullyInitialized() ||\r\n (isLeafOrEmpty &&\r\n !eventSnap.getNode().equals(/** @type {!Node} */ oldCompleteSnap)) ||\r\n !eventSnap.getNode().getPriority().equals(oldCompleteSnap.getPriority())) {\r\n accumulator.push(Change.valueChange(\r\n /** @type {!Node} */ newViewCache.getCompleteEventSnap()));\r\n }\r\n }\r\n };\r\n /**\r\n * @param {!ViewCache} viewCache\r\n * @param {!Path} changePath\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {!CompleteChildSource} source\r\n * @param {!ChildChangeAccumulator} accumulator\r\n * @return {!ViewCache}\r\n * @private\r\n */\r\n ViewProcessor.prototype.generateEventCacheAfterServerEvent_ = function (viewCache, changePath, writesCache, source, accumulator) {\r\n var oldEventSnap = viewCache.getEventCache();\r\n if (writesCache.shadowingWrite(changePath) != null) {\r\n // we have a shadowing write, ignore changes\r\n return viewCache;\r\n }\r\n else {\r\n var newEventCache = void 0, serverNode = void 0;\r\n if (changePath.isEmpty()) {\r\n // TODO: figure out how this plays with \"sliding ack windows\"\r\n assert(viewCache.getServerCache().isFullyInitialized(), 'If change path is empty, we must have complete server data');\r\n if (viewCache.getServerCache().isFiltered()) {\r\n // We need to special case this, because we need to only apply writes to complete children, or\r\n // we might end up raising events for incomplete children. If the server data is filtered deep\r\n // writes cannot be guaranteed to be complete\r\n var serverCache = viewCache.getCompleteServerSnap();\r\n var completeChildren = serverCache instanceof ChildrenNode\r\n ? serverCache\r\n : ChildrenNode.EMPTY_NODE;\r\n var completeEventChildren = writesCache.calcCompleteEventChildren(completeChildren);\r\n newEventCache = this.filter_.updateFullNode(viewCache.getEventCache().getNode(), completeEventChildren, accumulator);\r\n }\r\n else {\r\n var completeNode = writesCache.calcCompleteEventCache(viewCache.getCompleteServerSnap());\r\n newEventCache = this.filter_.updateFullNode(viewCache.getEventCache().getNode(), completeNode, accumulator);\r\n }\r\n }\r\n else {\r\n var childKey = changePath.getFront();\r\n if (childKey === '.priority') {\r\n assert(changePath.getLength() === 1, \"Can't have a priority with additional path components\");\r\n var oldEventNode = oldEventSnap.getNode();\r\n serverNode = viewCache.getServerCache().getNode();\r\n // we might have overwrites for this priority\r\n var updatedPriority = writesCache.calcEventCacheAfterServerOverwrite(changePath, oldEventNode, serverNode);\r\n if (updatedPriority != null) {\r\n newEventCache = this.filter_.updatePriority(oldEventNode, updatedPriority);\r\n }\r\n else {\r\n // priority didn't change, keep old node\r\n newEventCache = oldEventSnap.getNode();\r\n }\r\n }\r\n else {\r\n var childChangePath = changePath.popFront();\r\n // update child\r\n var newEventChild = void 0;\r\n if (oldEventSnap.isCompleteForChild(childKey)) {\r\n serverNode = viewCache.getServerCache().getNode();\r\n var eventChildUpdate = writesCache.calcEventCacheAfterServerOverwrite(changePath, oldEventSnap.getNode(), serverNode);\r\n if (eventChildUpdate != null) {\r\n newEventChild = oldEventSnap\r\n .getNode()\r\n .getImmediateChild(childKey)\r\n .updateChild(childChangePath, eventChildUpdate);\r\n }\r\n else {\r\n // Nothing changed, just keep the old child\r\n newEventChild = oldEventSnap\r\n .getNode()\r\n .getImmediateChild(childKey);\r\n }\r\n }\r\n else {\r\n newEventChild = writesCache.calcCompleteChild(childKey, viewCache.getServerCache());\r\n }\r\n if (newEventChild != null) {\r\n newEventCache = this.filter_.updateChild(oldEventSnap.getNode(), childKey, newEventChild, childChangePath, source, accumulator);\r\n }\r\n else {\r\n // no complete child available or no change\r\n newEventCache = oldEventSnap.getNode();\r\n }\r\n }\r\n }\r\n return viewCache.updateEventSnap(newEventCache, oldEventSnap.isFullyInitialized() || changePath.isEmpty(), this.filter_.filtersNodes());\r\n }\r\n };\r\n /**\r\n * @param {!ViewCache} oldViewCache\r\n * @param {!Path} changePath\r\n * @param {!Node} changedSnap\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {?Node} completeCache\r\n * @param {boolean} filterServerNode\r\n * @param {!ChildChangeAccumulator} accumulator\r\n * @return {!ViewCache}\r\n * @private\r\n */\r\n ViewProcessor.prototype.applyServerOverwrite_ = function (oldViewCache, changePath, changedSnap, writesCache, completeCache, filterServerNode, accumulator) {\r\n var oldServerSnap = oldViewCache.getServerCache();\r\n var newServerCache;\r\n var serverFilter = filterServerNode\r\n ? this.filter_\r\n : this.filter_.getIndexedFilter();\r\n if (changePath.isEmpty()) {\r\n newServerCache = serverFilter.updateFullNode(oldServerSnap.getNode(), changedSnap, null);\r\n }\r\n else if (serverFilter.filtersNodes() && !oldServerSnap.isFiltered()) {\r\n // we want to filter the server node, but we didn't filter the server node yet, so simulate a full update\r\n var newServerNode = oldServerSnap\r\n .getNode()\r\n .updateChild(changePath, changedSnap);\r\n newServerCache = serverFilter.updateFullNode(oldServerSnap.getNode(), newServerNode, null);\r\n }\r\n else {\r\n var childKey = changePath.getFront();\r\n if (!oldServerSnap.isCompleteForPath(changePath) &&\r\n changePath.getLength() > 1) {\r\n // We don't update incomplete nodes with updates intended for other listeners\r\n return oldViewCache;\r\n }\r\n var childChangePath = changePath.popFront();\r\n var childNode = oldServerSnap.getNode().getImmediateChild(childKey);\r\n var newChildNode = childNode.updateChild(childChangePath, changedSnap);\r\n if (childKey === '.priority') {\r\n newServerCache = serverFilter.updatePriority(oldServerSnap.getNode(), newChildNode);\r\n }\r\n else {\r\n newServerCache = serverFilter.updateChild(oldServerSnap.getNode(), childKey, newChildNode, childChangePath, NO_COMPLETE_CHILD_SOURCE, null);\r\n }\r\n }\r\n var newViewCache = oldViewCache.updateServerSnap(newServerCache, oldServerSnap.isFullyInitialized() || changePath.isEmpty(), serverFilter.filtersNodes());\r\n var source = new WriteTreeCompleteChildSource(writesCache, newViewCache, completeCache);\r\n return this.generateEventCacheAfterServerEvent_(newViewCache, changePath, writesCache, source, accumulator);\r\n };\r\n /**\r\n * @param {!ViewCache} oldViewCache\r\n * @param {!Path} changePath\r\n * @param {!Node} changedSnap\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {?Node} completeCache\r\n * @param {!ChildChangeAccumulator} accumulator\r\n * @return {!ViewCache}\r\n * @private\r\n */\r\n ViewProcessor.prototype.applyUserOverwrite_ = function (oldViewCache, changePath, changedSnap, writesCache, completeCache, accumulator) {\r\n var oldEventSnap = oldViewCache.getEventCache();\r\n var newViewCache, newEventCache;\r\n var source = new WriteTreeCompleteChildSource(writesCache, oldViewCache, completeCache);\r\n if (changePath.isEmpty()) {\r\n newEventCache = this.filter_.updateFullNode(oldViewCache.getEventCache().getNode(), changedSnap, accumulator);\r\n newViewCache = oldViewCache.updateEventSnap(newEventCache, true, this.filter_.filtersNodes());\r\n }\r\n else {\r\n var childKey = changePath.getFront();\r\n if (childKey === '.priority') {\r\n newEventCache = this.filter_.updatePriority(oldViewCache.getEventCache().getNode(), changedSnap);\r\n newViewCache = oldViewCache.updateEventSnap(newEventCache, oldEventSnap.isFullyInitialized(), oldEventSnap.isFiltered());\r\n }\r\n else {\r\n var childChangePath = changePath.popFront();\r\n var oldChild = oldEventSnap.getNode().getImmediateChild(childKey);\r\n var newChild = void 0;\r\n if (childChangePath.isEmpty()) {\r\n // Child overwrite, we can replace the child\r\n newChild = changedSnap;\r\n }\r\n else {\r\n var childNode = source.getCompleteChild(childKey);\r\n if (childNode != null) {\r\n if (childChangePath.getBack() === '.priority' &&\r\n childNode.getChild(childChangePath.parent()).isEmpty()) {\r\n // This is a priority update on an empty node. If this node exists on the server, the\r\n // server will send down the priority in the update, so ignore for now\r\n newChild = childNode;\r\n }\r\n else {\r\n newChild = childNode.updateChild(childChangePath, changedSnap);\r\n }\r\n }\r\n else {\r\n // There is no complete child node available\r\n newChild = ChildrenNode.EMPTY_NODE;\r\n }\r\n }\r\n if (!oldChild.equals(newChild)) {\r\n var newEventSnap = this.filter_.updateChild(oldEventSnap.getNode(), childKey, newChild, childChangePath, source, accumulator);\r\n newViewCache = oldViewCache.updateEventSnap(newEventSnap, oldEventSnap.isFullyInitialized(), this.filter_.filtersNodes());\r\n }\r\n else {\r\n newViewCache = oldViewCache;\r\n }\r\n }\r\n }\r\n return newViewCache;\r\n };\r\n /**\r\n * @param {!ViewCache} viewCache\r\n * @param {string} childKey\r\n * @return {boolean}\r\n * @private\r\n */\r\n ViewProcessor.cacheHasChild_ = function (viewCache, childKey) {\r\n return viewCache.getEventCache().isCompleteForChild(childKey);\r\n };\r\n /**\r\n * @param {!ViewCache} viewCache\r\n * @param {!Path} path\r\n * @param {ImmutableTree.<!Node>} changedChildren\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {?Node} serverCache\r\n * @param {!ChildChangeAccumulator} accumulator\r\n * @return {!ViewCache}\r\n * @private\r\n */\r\n ViewProcessor.prototype.applyUserMerge_ = function (viewCache, path, changedChildren, writesCache, serverCache, accumulator) {\r\n var _this = this;\r\n // HACK: In the case of a limit query, there may be some changes that bump things out of the\r\n // window leaving room for new items. It's important we process these changes first, so we\r\n // iterate the changes twice, first processing any that affect items currently in view.\r\n // TODO: I consider an item \"in view\" if cacheHasChild is true, which checks both the server\r\n // and event snap. I'm not sure if this will result in edge cases when a child is in one but\r\n // not the other.\r\n var curViewCache = viewCache;\r\n changedChildren.foreach(function (relativePath, childNode) {\r\n var writePath = path.child(relativePath);\r\n if (ViewProcessor.cacheHasChild_(viewCache, writePath.getFront())) {\r\n curViewCache = _this.applyUserOverwrite_(curViewCache, writePath, childNode, writesCache, serverCache, accumulator);\r\n }\r\n });\r\n changedChildren.foreach(function (relativePath, childNode) {\r\n var writePath = path.child(relativePath);\r\n if (!ViewProcessor.cacheHasChild_(viewCache, writePath.getFront())) {\r\n curViewCache = _this.applyUserOverwrite_(curViewCache, writePath, childNode, writesCache, serverCache, accumulator);\r\n }\r\n });\r\n return curViewCache;\r\n };\r\n /**\r\n * @param {!Node} node\r\n * @param {ImmutableTree.<!Node>} merge\r\n * @return {!Node}\r\n * @private\r\n */\r\n ViewProcessor.prototype.applyMerge_ = function (node, merge) {\r\n merge.foreach(function (relativePath, childNode) {\r\n node = node.updateChild(relativePath, childNode);\r\n });\r\n return node;\r\n };\r\n /**\r\n * @param {!ViewCache} viewCache\r\n * @param {!Path} path\r\n * @param {!ImmutableTree.<!Node>} changedChildren\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {?Node} serverCache\r\n * @param {boolean} filterServerNode\r\n * @param {!ChildChangeAccumulator} accumulator\r\n * @return {!ViewCache}\r\n * @private\r\n */\r\n ViewProcessor.prototype.applyServerMerge_ = function (viewCache, path, changedChildren, writesCache, serverCache, filterServerNode, accumulator) {\r\n var _this = this;\r\n // If we don't have a cache yet, this merge was intended for a previously listen in the same location. Ignore it and\r\n // wait for the complete data update coming soon.\r\n if (viewCache.getServerCache().getNode().isEmpty() &&\r\n !viewCache.getServerCache().isFullyInitialized()) {\r\n return viewCache;\r\n }\r\n // HACK: In the case of a limit query, there may be some changes that bump things out of the\r\n // window leaving room for new items. It's important we process these changes first, so we\r\n // iterate the changes twice, first processing any that affect items currently in view.\r\n // TODO: I consider an item \"in view\" if cacheHasChild is true, which checks both the server\r\n // and event snap. I'm not sure if this will result in edge cases when a child is in one but\r\n // not the other.\r\n var curViewCache = viewCache;\r\n var viewMergeTree;\r\n if (path.isEmpty()) {\r\n viewMergeTree = changedChildren;\r\n }\r\n else {\r\n viewMergeTree = ImmutableTree.Empty.setTree(path, changedChildren);\r\n }\r\n var serverNode = viewCache.getServerCache().getNode();\r\n viewMergeTree.children.inorderTraversal(function (childKey, childTree) {\r\n if (serverNode.hasChild(childKey)) {\r\n var serverChild = viewCache\r\n .getServerCache()\r\n .getNode()\r\n .getImmediateChild(childKey);\r\n var newChild = _this.applyMerge_(serverChild, childTree);\r\n curViewCache = _this.applyServerOverwrite_(curViewCache, new Path(childKey), newChild, writesCache, serverCache, filterServerNode, accumulator);\r\n }\r\n });\r\n viewMergeTree.children.inorderTraversal(function (childKey, childMergeTree) {\r\n var isUnknownDeepMerge = !viewCache.getServerCache().isCompleteForChild(childKey) &&\r\n childMergeTree.value == null;\r\n if (!serverNode.hasChild(childKey) && !isUnknownDeepMerge) {\r\n var serverChild = viewCache\r\n .getServerCache()\r\n .getNode()\r\n .getImmediateChild(childKey);\r\n var newChild = _this.applyMerge_(serverChild, childMergeTree);\r\n curViewCache = _this.applyServerOverwrite_(curViewCache, new Path(childKey), newChild, writesCache, serverCache, filterServerNode, accumulator);\r\n }\r\n });\r\n return curViewCache;\r\n };\r\n /**\r\n * @param {!ViewCache} viewCache\r\n * @param {!Path} ackPath\r\n * @param {!ImmutableTree<!boolean>} affectedTree\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {?Node} completeCache\r\n * @param {!ChildChangeAccumulator} accumulator\r\n * @return {!ViewCache}\r\n * @private\r\n */\r\n ViewProcessor.prototype.ackUserWrite_ = function (viewCache, ackPath, affectedTree, writesCache, completeCache, accumulator) {\r\n if (writesCache.shadowingWrite(ackPath) != null) {\r\n return viewCache;\r\n }\r\n // Only filter server node if it is currently filtered\r\n var filterServerNode = viewCache.getServerCache().isFiltered();\r\n // Essentially we'll just get our existing server cache for the affected paths and re-apply it as a server update\r\n // now that it won't be shadowed.\r\n var serverCache = viewCache.getServerCache();\r\n if (affectedTree.value != null) {\r\n // This is an overwrite.\r\n if ((ackPath.isEmpty() && serverCache.isFullyInitialized()) ||\r\n serverCache.isCompleteForPath(ackPath)) {\r\n return this.applyServerOverwrite_(viewCache, ackPath, serverCache.getNode().getChild(ackPath), writesCache, completeCache, filterServerNode, accumulator);\r\n }\r\n else if (ackPath.isEmpty()) {\r\n // This is a goofy edge case where we are acking data at this location but don't have full data. We\r\n // should just re-apply whatever we have in our cache as a merge.\r\n var changedChildren_1 = ImmutableTree.Empty;\r\n serverCache.getNode().forEachChild(KEY_INDEX, function (name, node) {\r\n changedChildren_1 = changedChildren_1.set(new Path(name), node);\r\n });\r\n return this.applyServerMerge_(viewCache, ackPath, changedChildren_1, writesCache, completeCache, filterServerNode, accumulator);\r\n }\r\n else {\r\n return viewCache;\r\n }\r\n }\r\n else {\r\n // This is a merge.\r\n var changedChildren_2 = ImmutableTree.Empty;\r\n affectedTree.foreach(function (mergePath, value) {\r\n var serverCachePath = ackPath.child(mergePath);\r\n if (serverCache.isCompleteForPath(serverCachePath)) {\r\n changedChildren_2 = changedChildren_2.set(mergePath, serverCache.getNode().getChild(serverCachePath));\r\n }\r\n });\r\n return this.applyServerMerge_(viewCache, ackPath, changedChildren_2, writesCache, completeCache, filterServerNode, accumulator);\r\n }\r\n };\r\n /**\r\n * @param {!ViewCache} viewCache\r\n * @param {!Path} path\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {!ChildChangeAccumulator} accumulator\r\n * @return {!ViewCache}\r\n * @private\r\n */\r\n ViewProcessor.prototype.listenComplete_ = function (viewCache, path, writesCache, accumulator) {\r\n var oldServerNode = viewCache.getServerCache();\r\n var newViewCache = viewCache.updateServerSnap(oldServerNode.getNode(), oldServerNode.isFullyInitialized() || path.isEmpty(), oldServerNode.isFiltered());\r\n return this.generateEventCacheAfterServerEvent_(newViewCache, path, writesCache, NO_COMPLETE_CHILD_SOURCE, accumulator);\r\n };\r\n /**\r\n * @param {!ViewCache} viewCache\r\n * @param {!Path} path\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {?Node} completeServerCache\r\n * @param {!ChildChangeAccumulator} accumulator\r\n * @return {!ViewCache}\r\n * @private\r\n */\r\n ViewProcessor.prototype.revertUserWrite_ = function (viewCache, path, writesCache, completeServerCache, accumulator) {\r\n var complete;\r\n if (writesCache.shadowingWrite(path) != null) {\r\n return viewCache;\r\n }\r\n else {\r\n var source = new WriteTreeCompleteChildSource(writesCache, viewCache, completeServerCache);\r\n var oldEventCache = viewCache.getEventCache().getNode();\r\n var newEventCache = void 0;\r\n if (path.isEmpty() || path.getFront() === '.priority') {\r\n var newNode = void 0;\r\n if (viewCache.getServerCache().isFullyInitialized()) {\r\n newNode = writesCache.calcCompleteEventCache(viewCache.getCompleteServerSnap());\r\n }\r\n else {\r\n var serverChildren = viewCache.getServerCache().getNode();\r\n assert(serverChildren instanceof ChildrenNode, 'serverChildren would be complete if leaf node');\r\n newNode = writesCache.calcCompleteEventChildren(serverChildren);\r\n }\r\n newNode = newNode;\r\n newEventCache = this.filter_.updateFullNode(oldEventCache, newNode, accumulator);\r\n }\r\n else {\r\n var childKey = path.getFront();\r\n var newChild = writesCache.calcCompleteChild(childKey, viewCache.getServerCache());\r\n if (newChild == null &&\r\n viewCache.getServerCache().isCompleteForChild(childKey)) {\r\n newChild = oldEventCache.getImmediateChild(childKey);\r\n }\r\n if (newChild != null) {\r\n newEventCache = this.filter_.updateChild(oldEventCache, childKey, newChild, path.popFront(), source, accumulator);\r\n }\r\n else if (viewCache.getEventCache().getNode().hasChild(childKey)) {\r\n // No complete child available, delete the existing one, if any\r\n newEventCache = this.filter_.updateChild(oldEventCache, childKey, ChildrenNode.EMPTY_NODE, path.popFront(), source, accumulator);\r\n }\r\n else {\r\n newEventCache = oldEventCache;\r\n }\r\n if (newEventCache.isEmpty() &&\r\n viewCache.getServerCache().isFullyInitialized()) {\r\n // We might have reverted all child writes. Maybe the old event was a leaf node\r\n complete = writesCache.calcCompleteEventCache(viewCache.getCompleteServerSnap());\r\n if (complete.isLeafNode()) {\r\n newEventCache = this.filter_.updateFullNode(newEventCache, complete, accumulator);\r\n }\r\n }\r\n }\r\n complete =\r\n viewCache.getServerCache().isFullyInitialized() ||\r\n writesCache.shadowingWrite(Path.Empty) != null;\r\n return viewCache.updateEventSnap(newEventCache, complete, this.filter_.filtersNodes());\r\n }\r\n };\r\n return ViewProcessor;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An EventGenerator is used to convert \"raw\" changes (Change) as computed by the\r\n * CacheDiffer into actual events (Event) that can be raised. See generateEventsForChanges()\r\n * for details.\r\n *\r\n * @constructor\r\n */\r\nvar EventGenerator = /** @class */ (function () {\r\n /**\r\n *\r\n * @param {!Query} query_\r\n */\r\n function EventGenerator(query_) {\r\n this.query_ = query_;\r\n /**\r\n * @private\r\n * @type {!Index}\r\n */\r\n this.index_ = this.query_.getQueryParams().getIndex();\r\n }\r\n /**\r\n * Given a set of raw changes (no moved events and prevName not specified yet), and a set of\r\n * EventRegistrations that should be notified of these changes, generate the actual events to be raised.\r\n *\r\n * Notes:\r\n * - child_moved events will be synthesized at this time for any child_changed events that affect\r\n * our index.\r\n * - prevName will be calculated based on the index ordering.\r\n *\r\n * @param {!Array.<!Change>} changes\r\n * @param {!Node} eventCache\r\n * @param {!Array.<!EventRegistration>} eventRegistrations\r\n * @return {!Array.<!Event>}\r\n */\r\n EventGenerator.prototype.generateEventsForChanges = function (changes, eventCache, eventRegistrations) {\r\n var _this = this;\r\n var events = [];\r\n var moves = [];\r\n changes.forEach(function (change) {\r\n if (change.type === Change.CHILD_CHANGED &&\r\n _this.index_.indexedValueChanged(change.oldSnap, change.snapshotNode)) {\r\n moves.push(Change.childMovedChange(change.childName, change.snapshotNode));\r\n }\r\n });\r\n this.generateEventsForType_(events, Change.CHILD_REMOVED, changes, eventRegistrations, eventCache);\r\n this.generateEventsForType_(events, Change.CHILD_ADDED, changes, eventRegistrations, eventCache);\r\n this.generateEventsForType_(events, Change.CHILD_MOVED, moves, eventRegistrations, eventCache);\r\n this.generateEventsForType_(events, Change.CHILD_CHANGED, changes, eventRegistrations, eventCache);\r\n this.generateEventsForType_(events, Change.VALUE, changes, eventRegistrations, eventCache);\r\n return events;\r\n };\r\n /**\r\n * Given changes of a single change type, generate the corresponding events.\r\n *\r\n * @param {!Array.<!Event>} events\r\n * @param {!string} eventType\r\n * @param {!Array.<!Change>} changes\r\n * @param {!Array.<!EventRegistration>} registrations\r\n * @param {!Node} eventCache\r\n * @private\r\n */\r\n EventGenerator.prototype.generateEventsForType_ = function (events, eventType, changes, registrations, eventCache) {\r\n var _this = this;\r\n var filteredChanges = changes.filter(function (change) { return change.type === eventType; });\r\n filteredChanges.sort(this.compareChanges_.bind(this));\r\n filteredChanges.forEach(function (change) {\r\n var materializedChange = _this.materializeSingleChange_(change, eventCache);\r\n registrations.forEach(function (registration) {\r\n if (registration.respondsTo(change.type)) {\r\n events.push(registration.createEvent(materializedChange, _this.query_));\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * @param {!Change} change\r\n * @param {!Node} eventCache\r\n * @return {!Change}\r\n * @private\r\n */\r\n EventGenerator.prototype.materializeSingleChange_ = function (change, eventCache) {\r\n if (change.type === 'value' || change.type === 'child_removed') {\r\n return change;\r\n }\r\n else {\r\n change.prevName = eventCache.getPredecessorChildName(\r\n /** @type {!string} */\r\n change.childName, change.snapshotNode, this.index_);\r\n return change;\r\n }\r\n };\r\n /**\r\n * @param {!Change} a\r\n * @param {!Change} b\r\n * @return {number}\r\n * @private\r\n */\r\n EventGenerator.prototype.compareChanges_ = function (a, b) {\r\n if (a.childName == null || b.childName == null) {\r\n throw assertionError('Should only compare child_ events.');\r\n }\r\n var aWrapped = new NamedNode(a.childName, a.snapshotNode);\r\n var bWrapped = new NamedNode(b.childName, b.snapshotNode);\r\n return this.index_.compare(aWrapped, bWrapped);\r\n };\r\n return EventGenerator;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A view represents a specific location and query that has 1 or more event registrations.\r\n *\r\n * It does several things:\r\n * - Maintains the list of event registrations for this location/query.\r\n * - Maintains a cache of the data visible for this location/query.\r\n * - Applies new operations (via applyOperation), updates the cache, and based on the event\r\n * registrations returns the set of events to be raised.\r\n * @constructor\r\n */\r\nvar View = /** @class */ (function () {\r\n /**\r\n *\r\n * @param {!Query} query_\r\n * @param {!ViewCache} initialViewCache\r\n */\r\n function View(query_, initialViewCache) {\r\n this.query_ = query_;\r\n this.eventRegistrations_ = [];\r\n var params = this.query_.getQueryParams();\r\n var indexFilter = new IndexedFilter(params.getIndex());\r\n var filter = params.getNodeFilter();\r\n /**\r\n * @type {ViewProcessor}\r\n * @private\r\n */\r\n this.processor_ = new ViewProcessor(filter);\r\n var initialServerCache = initialViewCache.getServerCache();\r\n var initialEventCache = initialViewCache.getEventCache();\r\n // Don't filter server node with other filter than index, wait for tagged listen\r\n var serverSnap = indexFilter.updateFullNode(ChildrenNode.EMPTY_NODE, initialServerCache.getNode(), null);\r\n var eventSnap = filter.updateFullNode(ChildrenNode.EMPTY_NODE, initialEventCache.getNode(), null);\r\n var newServerCache = new CacheNode(serverSnap, initialServerCache.isFullyInitialized(), indexFilter.filtersNodes());\r\n var newEventCache = new CacheNode(eventSnap, initialEventCache.isFullyInitialized(), filter.filtersNodes());\r\n /**\r\n * @type {!ViewCache}\r\n * @private\r\n */\r\n this.viewCache_ = new ViewCache(newEventCache, newServerCache);\r\n /**\r\n * @type {!EventGenerator}\r\n * @private\r\n */\r\n this.eventGenerator_ = new EventGenerator(this.query_);\r\n }\r\n /**\r\n * @return {!Query}\r\n */\r\n View.prototype.getQuery = function () {\r\n return this.query_;\r\n };\r\n /**\r\n * @return {?Node}\r\n */\r\n View.prototype.getServerCache = function () {\r\n return this.viewCache_.getServerCache().getNode();\r\n };\r\n /**\r\n * @param {!Path} path\r\n * @return {?Node}\r\n */\r\n View.prototype.getCompleteServerCache = function (path) {\r\n var cache = this.viewCache_.getCompleteServerSnap();\r\n if (cache) {\r\n // If this isn't a \"loadsAllData\" view, then cache isn't actually a complete cache and\r\n // we need to see if it contains the child we're interested in.\r\n if (this.query_.getQueryParams().loadsAllData() ||\r\n (!path.isEmpty() && !cache.getImmediateChild(path.getFront()).isEmpty())) {\r\n return cache.getChild(path);\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * @return {boolean}\r\n */\r\n View.prototype.isEmpty = function () {\r\n return this.eventRegistrations_.length === 0;\r\n };\r\n /**\r\n * @param {!EventRegistration} eventRegistration\r\n */\r\n View.prototype.addEventRegistration = function (eventRegistration) {\r\n this.eventRegistrations_.push(eventRegistration);\r\n };\r\n /**\r\n * @param {?EventRegistration} eventRegistration If null, remove all callbacks.\r\n * @param {Error=} cancelError If a cancelError is provided, appropriate cancel events will be returned.\r\n * @return {!Array.<!Event>} Cancel events, if cancelError was provided.\r\n */\r\n View.prototype.removeEventRegistration = function (eventRegistration, cancelError) {\r\n var cancelEvents = [];\r\n if (cancelError) {\r\n assert(eventRegistration == null, 'A cancel should cancel all event registrations.');\r\n var path_1 = this.query_.path;\r\n this.eventRegistrations_.forEach(function (registration) {\r\n cancelError /** @type {!Error} */ = cancelError;\r\n var maybeEvent = registration.createCancelEvent(cancelError, path_1);\r\n if (maybeEvent) {\r\n cancelEvents.push(maybeEvent);\r\n }\r\n });\r\n }\r\n if (eventRegistration) {\r\n var remaining = [];\r\n for (var i = 0; i < this.eventRegistrations_.length; ++i) {\r\n var existing = this.eventRegistrations_[i];\r\n if (!existing.matches(eventRegistration)) {\r\n remaining.push(existing);\r\n }\r\n else if (eventRegistration.hasAnyCallback()) {\r\n // We're removing just this one\r\n remaining = remaining.concat(this.eventRegistrations_.slice(i + 1));\r\n break;\r\n }\r\n }\r\n this.eventRegistrations_ = remaining;\r\n }\r\n else {\r\n this.eventRegistrations_ = [];\r\n }\r\n return cancelEvents;\r\n };\r\n /**\r\n * Applies the given Operation, updates our cache, and returns the appropriate events.\r\n *\r\n * @param {!Operation} operation\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {?Node} completeServerCache\r\n * @return {!Array.<!Event>}\r\n */\r\n View.prototype.applyOperation = function (operation, writesCache, completeServerCache) {\r\n if (operation.type === OperationType.MERGE &&\r\n operation.source.queryId !== null) {\r\n assert(this.viewCache_.getCompleteServerSnap(), 'We should always have a full cache before handling merges');\r\n assert(this.viewCache_.getCompleteEventSnap(), 'Missing event cache, even though we have a server cache');\r\n }\r\n var oldViewCache = this.viewCache_;\r\n var result = this.processor_.applyOperation(oldViewCache, operation, writesCache, completeServerCache);\r\n this.processor_.assertIndexed(result.viewCache);\r\n assert(result.viewCache.getServerCache().isFullyInitialized() ||\r\n !oldViewCache.getServerCache().isFullyInitialized(), 'Once a server snap is complete, it should never go back');\r\n this.viewCache_ = result.viewCache;\r\n return this.generateEventsForChanges_(result.changes, result.viewCache.getEventCache().getNode(), null);\r\n };\r\n /**\r\n * @param {!EventRegistration} registration\r\n * @return {!Array.<!Event>}\r\n */\r\n View.prototype.getInitialEvents = function (registration) {\r\n var eventSnap = this.viewCache_.getEventCache();\r\n var initialChanges = [];\r\n if (!eventSnap.getNode().isLeafNode()) {\r\n var eventNode = eventSnap.getNode();\r\n eventNode.forEachChild(PRIORITY_INDEX, function (key, childNode) {\r\n initialChanges.push(Change.childAddedChange(key, childNode));\r\n });\r\n }\r\n if (eventSnap.isFullyInitialized()) {\r\n initialChanges.push(Change.valueChange(eventSnap.getNode()));\r\n }\r\n return this.generateEventsForChanges_(initialChanges, eventSnap.getNode(), registration);\r\n };\r\n /**\r\n * @private\r\n * @param {!Array.<!Change>} changes\r\n * @param {!Node} eventCache\r\n * @param {EventRegistration=} eventRegistration\r\n * @return {!Array.<!Event>}\r\n */\r\n View.prototype.generateEventsForChanges_ = function (changes, eventCache, eventRegistration) {\r\n var registrations = eventRegistration\r\n ? [eventRegistration]\r\n : this.eventRegistrations_;\r\n return this.eventGenerator_.generateEventsForChanges(changes, eventCache, registrations);\r\n };\r\n return View;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __referenceConstructor$1;\r\n/**\r\n * SyncPoint represents a single location in a SyncTree with 1 or more event registrations, meaning we need to\r\n * maintain 1 or more Views at this location to cache server data and raise appropriate events for server changes\r\n * and user writes (set, transaction, update).\r\n *\r\n * It's responsible for:\r\n * - Maintaining the set of 1 or more views necessary at this location (a SyncPoint with 0 views should be removed).\r\n * - Proxying user / server operations to the views as appropriate (i.e. applyServerOverwrite,\r\n * applyUserOverwrite, etc.)\r\n */\r\nvar SyncPoint = /** @class */ (function () {\r\n function SyncPoint() {\r\n /**\r\n * The Views being tracked at this location in the tree, stored as a map where the key is a\r\n * queryId and the value is the View for that query.\r\n *\r\n * NOTE: This list will be quite small (usually 1, but perhaps 2 or 3; any more is an odd use case).\r\n */\r\n this.views = new Map();\r\n }\r\n Object.defineProperty(SyncPoint, \"__referenceConstructor\", {\r\n get: function () {\r\n assert(__referenceConstructor$1, 'Reference.ts has not been loaded');\r\n return __referenceConstructor$1;\r\n },\r\n set: function (val) {\r\n assert(!__referenceConstructor$1, '__referenceConstructor has already been defined');\r\n __referenceConstructor$1 = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n SyncPoint.prototype.isEmpty = function () {\r\n return this.views.size === 0;\r\n };\r\n SyncPoint.prototype.applyOperation = function (operation, writesCache, optCompleteServerCache) {\r\n var e_1, _a;\r\n var queryId = operation.source.queryId;\r\n if (queryId !== null) {\r\n var view = this.views.get(queryId);\r\n assert(view != null, 'SyncTree gave us an op for an invalid query.');\r\n return view.applyOperation(operation, writesCache, optCompleteServerCache);\r\n }\r\n else {\r\n var events = [];\r\n try {\r\n for (var _b = __values(this.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var view = _c.value;\r\n events = events.concat(view.applyOperation(operation, writesCache, optCompleteServerCache));\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n return events;\r\n }\r\n };\r\n /**\r\n * Add an event callback for the specified query.\r\n *\r\n * @param {!Query} query\r\n * @param {!EventRegistration} eventRegistration\r\n * @param {!WriteTreeRef} writesCache\r\n * @param {?Node} serverCache Complete server cache, if we have it.\r\n * @param {boolean} serverCacheComplete\r\n * @return {!Array.<!Event>} Events to raise.\r\n */\r\n SyncPoint.prototype.addEventRegistration = function (query, eventRegistration, writesCache, serverCache, serverCacheComplete) {\r\n var queryId = query.queryIdentifier();\r\n var view = this.views.get(queryId);\r\n if (!view) {\r\n // TODO: make writesCache take flag for complete server node\r\n var eventCache = writesCache.calcCompleteEventCache(serverCacheComplete ? serverCache : null);\r\n var eventCacheComplete = false;\r\n if (eventCache) {\r\n eventCacheComplete = true;\r\n }\r\n else if (serverCache instanceof ChildrenNode) {\r\n eventCache = writesCache.calcCompleteEventChildren(serverCache);\r\n eventCacheComplete = false;\r\n }\r\n else {\r\n eventCache = ChildrenNode.EMPTY_NODE;\r\n eventCacheComplete = false;\r\n }\r\n var viewCache = new ViewCache(new CacheNode(\r\n /** @type {!Node} */ eventCache, eventCacheComplete, false), new CacheNode(\r\n /** @type {!Node} */ serverCache, serverCacheComplete, false));\r\n view = new View(query, viewCache);\r\n this.views.set(queryId, view);\r\n }\r\n // This is guaranteed to exist now, we just created anything that was missing\r\n view.addEventRegistration(eventRegistration);\r\n return view.getInitialEvents(eventRegistration);\r\n };\r\n /**\r\n * Remove event callback(s). Return cancelEvents if a cancelError is specified.\r\n *\r\n * If query is the default query, we'll check all views for the specified eventRegistration.\r\n * If eventRegistration is null, we'll remove all callbacks for the specified view(s).\r\n *\r\n * @param {!Query} query\r\n * @param {?EventRegistration} eventRegistration If null, remove all callbacks.\r\n * @param {Error=} cancelError If a cancelError is provided, appropriate cancel events will be returned.\r\n * @return {{removed:!Array.<!Query>, events:!Array.<!Event>}} removed queries and any cancel events\r\n */\r\n SyncPoint.prototype.removeEventRegistration = function (query, eventRegistration, cancelError) {\r\n var e_2, _a;\r\n var queryId = query.queryIdentifier();\r\n var removed = [];\r\n var cancelEvents = [];\r\n var hadCompleteView = this.hasCompleteView();\r\n if (queryId === 'default') {\r\n try {\r\n // When you do ref.off(...), we search all views for the registration to remove.\r\n for (var _b = __values(this.views.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var _d = __read(_c.value, 2), viewQueryId = _d[0], view = _d[1];\r\n cancelEvents = cancelEvents.concat(view.removeEventRegistration(eventRegistration, cancelError));\r\n if (view.isEmpty()) {\r\n this.views.delete(viewQueryId);\r\n // We'll deal with complete views later.\r\n if (!view.getQuery().getQueryParams().loadsAllData()) {\r\n removed.push(view.getQuery());\r\n }\r\n }\r\n }\r\n }\r\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_2) throw e_2.error; }\r\n }\r\n }\r\n else {\r\n // remove the callback from the specific view.\r\n var view = this.views.get(queryId);\r\n if (view) {\r\n cancelEvents = cancelEvents.concat(view.removeEventRegistration(eventRegistration, cancelError));\r\n if (view.isEmpty()) {\r\n this.views.delete(queryId);\r\n // We'll deal with complete views later.\r\n if (!view.getQuery().getQueryParams().loadsAllData()) {\r\n removed.push(view.getQuery());\r\n }\r\n }\r\n }\r\n }\r\n if (hadCompleteView && !this.hasCompleteView()) {\r\n // We removed our last complete view.\r\n removed.push(new SyncPoint.__referenceConstructor(query.repo, query.path));\r\n }\r\n return { removed: removed, events: cancelEvents };\r\n };\r\n SyncPoint.prototype.getQueryViews = function () {\r\n var e_3, _a;\r\n var result = [];\r\n try {\r\n for (var _b = __values(this.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var view = _c.value;\r\n if (!view.getQuery().getQueryParams().loadsAllData()) {\r\n result.push(view);\r\n }\r\n }\r\n }\r\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_3) throw e_3.error; }\r\n }\r\n return result;\r\n };\r\n /**\r\n * @param path The path to the desired complete snapshot\r\n * @return A complete cache, if it exists\r\n */\r\n SyncPoint.prototype.getCompleteServerCache = function (path) {\r\n var e_4, _a;\r\n var serverCache = null;\r\n try {\r\n for (var _b = __values(this.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var view = _c.value;\r\n serverCache = serverCache || view.getCompleteServerCache(path);\r\n }\r\n }\r\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_4) throw e_4.error; }\r\n }\r\n return serverCache;\r\n };\r\n SyncPoint.prototype.viewForQuery = function (query) {\r\n var params = query.getQueryParams();\r\n if (params.loadsAllData()) {\r\n return this.getCompleteView();\r\n }\r\n else {\r\n var queryId = query.queryIdentifier();\r\n return this.views.get(queryId);\r\n }\r\n };\r\n SyncPoint.prototype.viewExistsForQuery = function (query) {\r\n return this.viewForQuery(query) != null;\r\n };\r\n SyncPoint.prototype.hasCompleteView = function () {\r\n return this.getCompleteView() != null;\r\n };\r\n SyncPoint.prototype.getCompleteView = function () {\r\n var e_5, _a;\r\n try {\r\n for (var _b = __values(this.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var view = _c.value;\r\n if (view.getQuery().getQueryParams().loadsAllData()) {\r\n return view;\r\n }\r\n }\r\n }\r\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_5) throw e_5.error; }\r\n }\r\n return null;\r\n };\r\n return SyncPoint;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * This class holds a collection of writes that can be applied to nodes in unison. It abstracts away the logic with\r\n * dealing with priority writes and multiple nested writes. At any given path there is only allowed to be one write\r\n * modifying that path. Any write to an existing path or shadowing an existing path will modify that existing write\r\n * to reflect the write added.\r\n */\r\nvar CompoundWrite = /** @class */ (function () {\r\n function CompoundWrite(writeTree_) {\r\n this.writeTree_ = writeTree_;\r\n }\r\n CompoundWrite.prototype.addWrite = function (path, node) {\r\n if (path.isEmpty()) {\r\n return new CompoundWrite(new ImmutableTree(node));\r\n }\r\n else {\r\n var rootmost = this.writeTree_.findRootMostValueAndPath(path);\r\n if (rootmost != null) {\r\n var rootMostPath = rootmost.path;\r\n var value = rootmost.value;\r\n var relativePath = Path.relativePath(rootMostPath, path);\r\n value = value.updateChild(relativePath, node);\r\n return new CompoundWrite(this.writeTree_.set(rootMostPath, value));\r\n }\r\n else {\r\n var subtree = new ImmutableTree(node);\r\n var newWriteTree = this.writeTree_.setTree(path, subtree);\r\n return new CompoundWrite(newWriteTree);\r\n }\r\n }\r\n };\r\n CompoundWrite.prototype.addWrites = function (path, updates) {\r\n var newWrite = this;\r\n each(updates, function (childKey, node) {\r\n newWrite = newWrite.addWrite(path.child(childKey), node);\r\n });\r\n return newWrite;\r\n };\r\n /**\r\n * Will remove a write at the given path and deeper paths. This will <em>not</em> modify a write at a higher\r\n * location, which must be removed by calling this method with that path.\r\n *\r\n * @param path The path at which a write and all deeper writes should be removed\r\n * @return {!CompoundWrite} The new CompoundWrite with the removed path\r\n */\r\n CompoundWrite.prototype.removeWrite = function (path) {\r\n if (path.isEmpty()) {\r\n return CompoundWrite.Empty;\r\n }\r\n else {\r\n var newWriteTree = this.writeTree_.setTree(path, ImmutableTree.Empty);\r\n return new CompoundWrite(newWriteTree);\r\n }\r\n };\r\n /**\r\n * Returns whether this CompoundWrite will fully overwrite a node at a given location and can therefore be\r\n * considered \"complete\".\r\n *\r\n * @param path The path to check for\r\n * @return Whether there is a complete write at that path\r\n */\r\n CompoundWrite.prototype.hasCompleteWrite = function (path) {\r\n return this.getCompleteNode(path) != null;\r\n };\r\n /**\r\n * Returns a node for a path if and only if the node is a \"complete\" overwrite at that path. This will not aggregate\r\n * writes from deeper paths, but will return child nodes from a more shallow path.\r\n *\r\n * @param path The path to get a complete write\r\n * @return The node if complete at that path, or null otherwise.\r\n */\r\n CompoundWrite.prototype.getCompleteNode = function (path) {\r\n var rootmost = this.writeTree_.findRootMostValueAndPath(path);\r\n if (rootmost != null) {\r\n return this.writeTree_\r\n .get(rootmost.path)\r\n .getChild(Path.relativePath(rootmost.path, path));\r\n }\r\n else {\r\n return null;\r\n }\r\n };\r\n /**\r\n * Returns all children that are guaranteed to be a complete overwrite.\r\n *\r\n * @return A list of all complete children.\r\n */\r\n CompoundWrite.prototype.getCompleteChildren = function () {\r\n var children = [];\r\n var node = this.writeTree_.value;\r\n if (node != null) {\r\n // If it's a leaf node, it has no children; so nothing to do.\r\n if (!node.isLeafNode()) {\r\n node.forEachChild(PRIORITY_INDEX, function (childName, childNode) {\r\n children.push(new NamedNode(childName, childNode));\r\n });\r\n }\r\n }\r\n else {\r\n this.writeTree_.children.inorderTraversal(function (childName, childTree) {\r\n if (childTree.value != null) {\r\n children.push(new NamedNode(childName, childTree.value));\r\n }\r\n });\r\n }\r\n return children;\r\n };\r\n CompoundWrite.prototype.childCompoundWrite = function (path) {\r\n if (path.isEmpty()) {\r\n return this;\r\n }\r\n else {\r\n var shadowingNode = this.getCompleteNode(path);\r\n if (shadowingNode != null) {\r\n return new CompoundWrite(new ImmutableTree(shadowingNode));\r\n }\r\n else {\r\n return new CompoundWrite(this.writeTree_.subtree(path));\r\n }\r\n }\r\n };\r\n /**\r\n * Returns true if this CompoundWrite is empty and therefore does not modify any nodes.\r\n * @return Whether this CompoundWrite is empty\r\n */\r\n CompoundWrite.prototype.isEmpty = function () {\r\n return this.writeTree_.isEmpty();\r\n };\r\n /**\r\n * Applies this CompoundWrite to a node. The node is returned with all writes from this CompoundWrite applied to the\r\n * node\r\n * @param node The node to apply this CompoundWrite to\r\n * @return The node with all writes applied\r\n */\r\n CompoundWrite.prototype.apply = function (node) {\r\n return applySubtreeWrite(Path.Empty, this.writeTree_, node);\r\n };\r\n CompoundWrite.Empty = new CompoundWrite(new ImmutableTree(null));\r\n return CompoundWrite;\r\n}());\r\nfunction applySubtreeWrite(relativePath, writeTree, node) {\r\n if (writeTree.value != null) {\r\n // Since there a write is always a leaf, we're done here\r\n return node.updateChild(relativePath, writeTree.value);\r\n }\r\n else {\r\n var priorityWrite_1 = null;\r\n writeTree.children.inorderTraversal(function (childKey, childTree) {\r\n if (childKey === '.priority') {\r\n // Apply priorities at the end so we don't update priorities for either empty nodes or forget\r\n // to apply priorities to empty nodes that are later filled\r\n assert(childTree.value !== null, 'Priority writes must always be leaf nodes');\r\n priorityWrite_1 = childTree.value;\r\n }\r\n else {\r\n node = applySubtreeWrite(relativePath.child(childKey), childTree, node);\r\n }\r\n });\r\n // If there was a priority write, we only apply it if the node is not empty\r\n if (!node.getChild(relativePath).isEmpty() && priorityWrite_1 !== null) {\r\n node = node.updateChild(relativePath.child('.priority'), priorityWrite_1);\r\n }\r\n return node;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * WriteTree tracks all pending user-initiated writes and has methods to calculate the result of merging them\r\n * with underlying server data (to create \"event cache\" data). Pending writes are added with addOverwrite()\r\n * and addMerge(), and removed with removeWrite().\r\n *\r\n * @constructor\r\n */\r\nvar WriteTree = /** @class */ (function () {\r\n function WriteTree() {\r\n /**\r\n * A tree tracking the result of applying all visible writes. This does not include transactions with\r\n * applyLocally=false or writes that are completely shadowed by other writes.\r\n *\r\n * @type {!CompoundWrite}\r\n * @private\r\n */\r\n this.visibleWrites_ = CompoundWrite.Empty;\r\n /**\r\n * A list of all pending writes, regardless of visibility and shadowed-ness. Used to calculate arbitrary\r\n * sets of the changed data, such as hidden writes (from transactions) or changes with certain writes excluded (also\r\n * used by transactions).\r\n *\r\n * @type {!Array.<!WriteRecord>}\r\n * @private\r\n */\r\n this.allWrites_ = [];\r\n this.lastWriteId_ = -1;\r\n }\r\n /**\r\n * Create a new WriteTreeRef for the given path. For use with a new sync point at the given path.\r\n *\r\n * @param {!Path} path\r\n * @return {!WriteTreeRef}\r\n */\r\n WriteTree.prototype.childWrites = function (path) {\r\n return new WriteTreeRef(path, this);\r\n };\r\n /**\r\n * Record a new overwrite from user code.\r\n *\r\n * @param {!Path} path\r\n * @param {!Node} snap\r\n * @param {!number} writeId\r\n * @param {boolean=} visible This is set to false by some transactions. It should be excluded from event caches\r\n */\r\n WriteTree.prototype.addOverwrite = function (path, snap, writeId, visible) {\r\n assert(writeId > this.lastWriteId_, 'Stacking an older write on top of newer ones');\r\n if (visible === undefined) {\r\n visible = true;\r\n }\r\n this.allWrites_.push({\r\n path: path,\r\n snap: snap,\r\n writeId: writeId,\r\n visible: visible\r\n });\r\n if (visible) {\r\n this.visibleWrites_ = this.visibleWrites_.addWrite(path, snap);\r\n }\r\n this.lastWriteId_ = writeId;\r\n };\r\n /**\r\n * Record a new merge from user code.\r\n *\r\n * @param {!Path} path\r\n * @param {!Object.<string, !Node>} changedChildren\r\n * @param {!number} writeId\r\n */\r\n WriteTree.prototype.addMerge = function (path, changedChildren, writeId) {\r\n assert(writeId > this.lastWriteId_, 'Stacking an older merge on top of newer ones');\r\n this.allWrites_.push({\r\n path: path,\r\n children: changedChildren,\r\n writeId: writeId,\r\n visible: true\r\n });\r\n this.visibleWrites_ = this.visibleWrites_.addWrites(path, changedChildren);\r\n this.lastWriteId_ = writeId;\r\n };\r\n /**\r\n * @param {!number} writeId\r\n * @return {?WriteRecord}\r\n */\r\n WriteTree.prototype.getWrite = function (writeId) {\r\n for (var i = 0; i < this.allWrites_.length; i++) {\r\n var record = this.allWrites_[i];\r\n if (record.writeId === writeId) {\r\n return record;\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * Remove a write (either an overwrite or merge) that has been successfully acknowledge by the server. Recalculates\r\n * the tree if necessary. We return true if it may have been visible, meaning views need to reevaluate.\r\n *\r\n * @param {!number} writeId\r\n * @return {boolean} true if the write may have been visible (meaning we'll need to reevaluate / raise\r\n * events as a result).\r\n */\r\n WriteTree.prototype.removeWrite = function (writeId) {\r\n // Note: disabling this check. It could be a transaction that preempted another transaction, and thus was applied\r\n // out of order.\r\n //const validClear = revert || this.allWrites_.length === 0 || writeId <= this.allWrites_[0].writeId;\r\n //assert(validClear, \"Either we don't have this write, or it's the first one in the queue\");\r\n var _this = this;\r\n var idx = this.allWrites_.findIndex(function (s) {\r\n return s.writeId === writeId;\r\n });\r\n assert(idx >= 0, 'removeWrite called with nonexistent writeId.');\r\n var writeToRemove = this.allWrites_[idx];\r\n this.allWrites_.splice(idx, 1);\r\n var removedWriteWasVisible = writeToRemove.visible;\r\n var removedWriteOverlapsWithOtherWrites = false;\r\n var i = this.allWrites_.length - 1;\r\n while (removedWriteWasVisible && i >= 0) {\r\n var currentWrite = this.allWrites_[i];\r\n if (currentWrite.visible) {\r\n if (i >= idx &&\r\n this.recordContainsPath_(currentWrite, writeToRemove.path)) {\r\n // The removed write was completely shadowed by a subsequent write.\r\n removedWriteWasVisible = false;\r\n }\r\n else if (writeToRemove.path.contains(currentWrite.path)) {\r\n // Either we're covering some writes or they're covering part of us (depending on which came first).\r\n removedWriteOverlapsWithOtherWrites = true;\r\n }\r\n }\r\n i--;\r\n }\r\n if (!removedWriteWasVisible) {\r\n return false;\r\n }\r\n else if (removedWriteOverlapsWithOtherWrites) {\r\n // There's some shadowing going on. Just rebuild the visible writes from scratch.\r\n this.resetTree_();\r\n return true;\r\n }\r\n else {\r\n // There's no shadowing. We can safely just remove the write(s) from visibleWrites.\r\n if (writeToRemove.snap) {\r\n this.visibleWrites_ = this.visibleWrites_.removeWrite(writeToRemove.path);\r\n }\r\n else {\r\n var children = writeToRemove.children;\r\n each(children, function (childName) {\r\n _this.visibleWrites_ = _this.visibleWrites_.removeWrite(writeToRemove.path.child(childName));\r\n });\r\n }\r\n return true;\r\n }\r\n };\r\n /**\r\n * Return a complete snapshot for the given path if there's visible write data at that path, else null.\r\n * No server data is considered.\r\n *\r\n * @param {!Path} path\r\n * @return {?Node}\r\n */\r\n WriteTree.prototype.getCompleteWriteData = function (path) {\r\n return this.visibleWrites_.getCompleteNode(path);\r\n };\r\n /**\r\n * Given optional, underlying server data, and an optional set of constraints (exclude some sets, include hidden\r\n * writes), attempt to calculate a complete snapshot for the given path\r\n *\r\n * @param {!Path} treePath\r\n * @param {?Node} completeServerCache\r\n * @param {Array.<number>=} writeIdsToExclude An optional set to be excluded\r\n * @param {boolean=} includeHiddenWrites Defaults to false, whether or not to layer on writes with visible set to false\r\n * @return {?Node}\r\n */\r\n WriteTree.prototype.calcCompleteEventCache = function (treePath, completeServerCache, writeIdsToExclude, includeHiddenWrites) {\r\n if (!writeIdsToExclude && !includeHiddenWrites) {\r\n var shadowingNode = this.visibleWrites_.getCompleteNode(treePath);\r\n if (shadowingNode != null) {\r\n return shadowingNode;\r\n }\r\n else {\r\n var subMerge = this.visibleWrites_.childCompoundWrite(treePath);\r\n if (subMerge.isEmpty()) {\r\n return completeServerCache;\r\n }\r\n else if (completeServerCache == null &&\r\n !subMerge.hasCompleteWrite(Path.Empty)) {\r\n // We wouldn't have a complete snapshot, since there's no underlying data and no complete shadow\r\n return null;\r\n }\r\n else {\r\n var layeredCache = completeServerCache || ChildrenNode.EMPTY_NODE;\r\n return subMerge.apply(layeredCache);\r\n }\r\n }\r\n }\r\n else {\r\n var merge = this.visibleWrites_.childCompoundWrite(treePath);\r\n if (!includeHiddenWrites && merge.isEmpty()) {\r\n return completeServerCache;\r\n }\r\n else {\r\n // If the server cache is null, and we don't have a complete cache, we need to return null\r\n if (!includeHiddenWrites &&\r\n completeServerCache == null &&\r\n !merge.hasCompleteWrite(Path.Empty)) {\r\n return null;\r\n }\r\n else {\r\n var filter = function (write) {\r\n return ((write.visible || includeHiddenWrites) &&\r\n (!writeIdsToExclude ||\r\n !~writeIdsToExclude.indexOf(write.writeId)) &&\r\n (write.path.contains(treePath) || treePath.contains(write.path)));\r\n };\r\n var mergeAtPath = WriteTree.layerTree_(this.allWrites_, filter, treePath);\r\n var layeredCache = completeServerCache || ChildrenNode.EMPTY_NODE;\r\n return mergeAtPath.apply(layeredCache);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * With optional, underlying server data, attempt to return a children node of children that we have complete data for.\r\n * Used when creating new views, to pre-fill their complete event children snapshot.\r\n *\r\n * @param {!Path} treePath\r\n * @param {?ChildrenNode} completeServerChildren\r\n * @return {!ChildrenNode}\r\n */\r\n WriteTree.prototype.calcCompleteEventChildren = function (treePath, completeServerChildren) {\r\n var completeChildren = ChildrenNode.EMPTY_NODE;\r\n var topLevelSet = this.visibleWrites_.getCompleteNode(treePath);\r\n if (topLevelSet) {\r\n if (!topLevelSet.isLeafNode()) {\r\n // we're shadowing everything. Return the children.\r\n topLevelSet.forEachChild(PRIORITY_INDEX, function (childName, childSnap) {\r\n completeChildren = completeChildren.updateImmediateChild(childName, childSnap);\r\n });\r\n }\r\n return completeChildren;\r\n }\r\n else if (completeServerChildren) {\r\n // Layer any children we have on top of this\r\n // We know we don't have a top-level set, so just enumerate existing children\r\n var merge_1 = this.visibleWrites_.childCompoundWrite(treePath);\r\n completeServerChildren.forEachChild(PRIORITY_INDEX, function (childName, childNode) {\r\n var node = merge_1\r\n .childCompoundWrite(new Path(childName))\r\n .apply(childNode);\r\n completeChildren = completeChildren.updateImmediateChild(childName, node);\r\n });\r\n // Add any complete children we have from the set\r\n merge_1.getCompleteChildren().forEach(function (namedNode) {\r\n completeChildren = completeChildren.updateImmediateChild(namedNode.name, namedNode.node);\r\n });\r\n return completeChildren;\r\n }\r\n else {\r\n // We don't have anything to layer on top of. Layer on any children we have\r\n // Note that we can return an empty snap if we have a defined delete\r\n var merge = this.visibleWrites_.childCompoundWrite(treePath);\r\n merge.getCompleteChildren().forEach(function (namedNode) {\r\n completeChildren = completeChildren.updateImmediateChild(namedNode.name, namedNode.node);\r\n });\r\n return completeChildren;\r\n }\r\n };\r\n /**\r\n * Given that the underlying server data has updated, determine what, if anything, needs to be\r\n * applied to the event cache.\r\n *\r\n * Possibilities:\r\n *\r\n * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data\r\n *\r\n * 2. Some write is completely shadowing. No events to be raised\r\n *\r\n * 3. Is partially shadowed. Events\r\n *\r\n * Either existingEventSnap or existingServerSnap must exist\r\n *\r\n * @param {!Path} treePath\r\n * @param {!Path} childPath\r\n * @param {?Node} existingEventSnap\r\n * @param {?Node} existingServerSnap\r\n * @return {?Node}\r\n */\r\n WriteTree.prototype.calcEventCacheAfterServerOverwrite = function (treePath, childPath, existingEventSnap, existingServerSnap) {\r\n assert(existingEventSnap || existingServerSnap, 'Either existingEventSnap or existingServerSnap must exist');\r\n var path = treePath.child(childPath);\r\n if (this.visibleWrites_.hasCompleteWrite(path)) {\r\n // At this point we can probably guarantee that we're in case 2, meaning no events\r\n // May need to check visibility while doing the findRootMostValueAndPath call\r\n return null;\r\n }\r\n else {\r\n // No complete shadowing. We're either partially shadowing or not shadowing at all.\r\n var childMerge = this.visibleWrites_.childCompoundWrite(path);\r\n if (childMerge.isEmpty()) {\r\n // We're not shadowing at all. Case 1\r\n return existingServerSnap.getChild(childPath);\r\n }\r\n else {\r\n // This could be more efficient if the serverNode + updates doesn't change the eventSnap\r\n // However this is tricky to find out, since user updates don't necessary change the server\r\n // snap, e.g. priority updates on empty nodes, or deep deletes. Another special case is if the server\r\n // adds nodes, but doesn't change any existing writes. It is therefore not enough to\r\n // only check if the updates change the serverNode.\r\n // Maybe check if the merge tree contains these special cases and only do a full overwrite in that case?\r\n return childMerge.apply(existingServerSnap.getChild(childPath));\r\n }\r\n }\r\n };\r\n /**\r\n * Returns a complete child for a given server snap after applying all user writes or null if there is no\r\n * complete child for this ChildKey.\r\n *\r\n * @param {!Path} treePath\r\n * @param {!string} childKey\r\n * @param {!CacheNode} existingServerSnap\r\n * @return {?Node}\r\n */\r\n WriteTree.prototype.calcCompleteChild = function (treePath, childKey, existingServerSnap) {\r\n var path = treePath.child(childKey);\r\n var shadowingNode = this.visibleWrites_.getCompleteNode(path);\r\n if (shadowingNode != null) {\r\n return shadowingNode;\r\n }\r\n else {\r\n if (existingServerSnap.isCompleteForChild(childKey)) {\r\n var childMerge = this.visibleWrites_.childCompoundWrite(path);\r\n return childMerge.apply(existingServerSnap.getNode().getImmediateChild(childKey));\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n };\r\n /**\r\n * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at\r\n * a higher path, this will return the child of that write relative to the write and this path.\r\n * Returns null if there is no write at this path.\r\n */\r\n WriteTree.prototype.shadowingWrite = function (path) {\r\n return this.visibleWrites_.getCompleteNode(path);\r\n };\r\n /**\r\n * This method is used when processing child remove events on a query. If we can, we pull in children that were outside\r\n * the window, but may now be in the window.\r\n */\r\n WriteTree.prototype.calcIndexedSlice = function (treePath, completeServerData, startPost, count, reverse, index) {\r\n var toIterate;\r\n var merge = this.visibleWrites_.childCompoundWrite(treePath);\r\n var shadowingNode = merge.getCompleteNode(Path.Empty);\r\n if (shadowingNode != null) {\r\n toIterate = shadowingNode;\r\n }\r\n else if (completeServerData != null) {\r\n toIterate = merge.apply(completeServerData);\r\n }\r\n else {\r\n // no children to iterate on\r\n return [];\r\n }\r\n toIterate = toIterate.withIndex(index);\r\n if (!toIterate.isEmpty() && !toIterate.isLeafNode()) {\r\n var nodes = [];\r\n var cmp = index.getCompare();\r\n var iter = reverse\r\n ? toIterate.getReverseIteratorFrom(startPost, index)\r\n : toIterate.getIteratorFrom(startPost, index);\r\n var next = iter.getNext();\r\n while (next && nodes.length < count) {\r\n if (cmp(next, startPost) !== 0) {\r\n nodes.push(next);\r\n }\r\n next = iter.getNext();\r\n }\r\n return nodes;\r\n }\r\n else {\r\n return [];\r\n }\r\n };\r\n WriteTree.prototype.recordContainsPath_ = function (writeRecord, path) {\r\n if (writeRecord.snap) {\r\n return writeRecord.path.contains(path);\r\n }\r\n else {\r\n for (var childName in writeRecord.children) {\r\n if (writeRecord.children.hasOwnProperty(childName) &&\r\n writeRecord.path.child(childName).contains(path)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n };\r\n /**\r\n * Re-layer the writes and merges into a tree so we can efficiently calculate event snapshots\r\n */\r\n WriteTree.prototype.resetTree_ = function () {\r\n this.visibleWrites_ = WriteTree.layerTree_(this.allWrites_, WriteTree.DefaultFilter_, Path.Empty);\r\n if (this.allWrites_.length > 0) {\r\n this.lastWriteId_ = this.allWrites_[this.allWrites_.length - 1].writeId;\r\n }\r\n else {\r\n this.lastWriteId_ = -1;\r\n }\r\n };\r\n /**\r\n * The default filter used when constructing the tree. Keep everything that's visible.\r\n */\r\n WriteTree.DefaultFilter_ = function (write) {\r\n return write.visible;\r\n };\r\n /**\r\n * Static method. Given an array of WriteRecords, a filter for which ones to include, and a path, construct the tree of\r\n * event data at that path.\r\n */\r\n WriteTree.layerTree_ = function (writes, filter, treeRoot) {\r\n var compoundWrite = CompoundWrite.Empty;\r\n for (var i = 0; i < writes.length; ++i) {\r\n var write = writes[i];\r\n // Theory, a later set will either:\r\n // a) abort a relevant transaction, so no need to worry about excluding it from calculating that transaction\r\n // b) not be relevant to a transaction (separate branch), so again will not affect the data for that transaction\r\n if (filter(write)) {\r\n var writePath = write.path;\r\n var relativePath = void 0;\r\n if (write.snap) {\r\n if (treeRoot.contains(writePath)) {\r\n relativePath = Path.relativePath(treeRoot, writePath);\r\n compoundWrite = compoundWrite.addWrite(relativePath, write.snap);\r\n }\r\n else if (writePath.contains(treeRoot)) {\r\n relativePath = Path.relativePath(writePath, treeRoot);\r\n compoundWrite = compoundWrite.addWrite(Path.Empty, write.snap.getChild(relativePath));\r\n }\r\n else ;\r\n }\r\n else if (write.children) {\r\n if (treeRoot.contains(writePath)) {\r\n relativePath = Path.relativePath(treeRoot, writePath);\r\n compoundWrite = compoundWrite.addWrites(relativePath, write.children);\r\n }\r\n else if (writePath.contains(treeRoot)) {\r\n relativePath = Path.relativePath(writePath, treeRoot);\r\n if (relativePath.isEmpty()) {\r\n compoundWrite = compoundWrite.addWrites(Path.Empty, write.children);\r\n }\r\n else {\r\n var child = safeGet(write.children, relativePath.getFront());\r\n if (child) {\r\n // There exists a child in this node that matches the root path\r\n var deepNode = child.getChild(relativePath.popFront());\r\n compoundWrite = compoundWrite.addWrite(Path.Empty, deepNode);\r\n }\r\n }\r\n }\r\n else ;\r\n }\r\n else {\r\n throw assertionError('WriteRecord should have .snap or .children');\r\n }\r\n }\r\n }\r\n return compoundWrite;\r\n };\r\n return WriteTree;\r\n}());\r\n/**\r\n * A WriteTreeRef wraps a WriteTree and a path, for convenient access to a particular subtree. All of the methods\r\n * just proxy to the underlying WriteTree.\r\n *\r\n * @constructor\r\n */\r\nvar WriteTreeRef = /** @class */ (function () {\r\n /**\r\n * @param {!Path} path\r\n * @param {!WriteTree} writeTree\r\n */\r\n function WriteTreeRef(path, writeTree) {\r\n this.treePath_ = path;\r\n this.writeTree_ = writeTree;\r\n }\r\n /**\r\n * If possible, returns a complete event cache, using the underlying server data if possible. In addition, can be used\r\n * to get a cache that includes hidden writes, and excludes arbitrary writes. Note that customizing the returned node\r\n * can lead to a more expensive calculation.\r\n *\r\n * @param {?Node} completeServerCache\r\n * @param {Array.<number>=} writeIdsToExclude Optional writes to exclude.\r\n * @param {boolean=} includeHiddenWrites Defaults to false, whether or not to layer on writes with visible set to false\r\n * @return {?Node}\r\n */\r\n WriteTreeRef.prototype.calcCompleteEventCache = function (completeServerCache, writeIdsToExclude, includeHiddenWrites) {\r\n return this.writeTree_.calcCompleteEventCache(this.treePath_, completeServerCache, writeIdsToExclude, includeHiddenWrites);\r\n };\r\n /**\r\n * If possible, returns a children node containing all of the complete children we have data for. The returned data is a\r\n * mix of the given server data and write data.\r\n *\r\n * @param {?ChildrenNode} completeServerChildren\r\n * @return {!ChildrenNode}\r\n */\r\n WriteTreeRef.prototype.calcCompleteEventChildren = function (completeServerChildren) {\r\n return this.writeTree_.calcCompleteEventChildren(this.treePath_, completeServerChildren);\r\n };\r\n /**\r\n * Given that either the underlying server data has updated or the outstanding writes have updated, determine what,\r\n * if anything, needs to be applied to the event cache.\r\n *\r\n * Possibilities:\r\n *\r\n * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data\r\n *\r\n * 2. Some write is completely shadowing. No events to be raised\r\n *\r\n * 3. Is partially shadowed. Events should be raised\r\n *\r\n * Either existingEventSnap or existingServerSnap must exist, this is validated via an assert\r\n *\r\n * @param {!Path} path\r\n * @param {?Node} existingEventSnap\r\n * @param {?Node} existingServerSnap\r\n * @return {?Node}\r\n */\r\n WriteTreeRef.prototype.calcEventCacheAfterServerOverwrite = function (path, existingEventSnap, existingServerSnap) {\r\n return this.writeTree_.calcEventCacheAfterServerOverwrite(this.treePath_, path, existingEventSnap, existingServerSnap);\r\n };\r\n /**\r\n * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at\r\n * a higher path, this will return the child of that write relative to the write and this path.\r\n * Returns null if there is no write at this path.\r\n *\r\n * @param {!Path} path\r\n * @return {?Node}\r\n */\r\n WriteTreeRef.prototype.shadowingWrite = function (path) {\r\n return this.writeTree_.shadowingWrite(this.treePath_.child(path));\r\n };\r\n /**\r\n * This method is used when processing child remove events on a query. If we can, we pull in children that were outside\r\n * the window, but may now be in the window\r\n *\r\n * @param {?Node} completeServerData\r\n * @param {!NamedNode} startPost\r\n * @param {!number} count\r\n * @param {boolean} reverse\r\n * @param {!Index} index\r\n * @return {!Array.<!NamedNode>}\r\n */\r\n WriteTreeRef.prototype.calcIndexedSlice = function (completeServerData, startPost, count, reverse, index) {\r\n return this.writeTree_.calcIndexedSlice(this.treePath_, completeServerData, startPost, count, reverse, index);\r\n };\r\n /**\r\n * Returns a complete child for a given server snap after applying all user writes or null if there is no\r\n * complete child for this ChildKey.\r\n *\r\n * @param {!string} childKey\r\n * @param {!CacheNode} existingServerCache\r\n * @return {?Node}\r\n */\r\n WriteTreeRef.prototype.calcCompleteChild = function (childKey, existingServerCache) {\r\n return this.writeTree_.calcCompleteChild(this.treePath_, childKey, existingServerCache);\r\n };\r\n /**\r\n * Return a WriteTreeRef for a child.\r\n *\r\n * @param {string} childName\r\n * @return {!WriteTreeRef}\r\n */\r\n WriteTreeRef.prototype.child = function (childName) {\r\n return new WriteTreeRef(this.treePath_.child(childName), this.writeTree_);\r\n };\r\n return WriteTreeRef;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * SyncTree is the central class for managing event callback registration, data caching, views\r\n * (query processing), and event generation. There are typically two SyncTree instances for\r\n * each Repo, one for the normal Firebase data, and one for the .info data.\r\n *\r\n * It has a number of responsibilities, including:\r\n * - Tracking all user event callbacks (registered via addEventRegistration() and removeEventRegistration()).\r\n * - Applying and caching data changes for user set(), transaction(), and update() calls\r\n * (applyUserOverwrite(), applyUserMerge()).\r\n * - Applying and caching data changes for server data changes (applyServerOverwrite(),\r\n * applyServerMerge()).\r\n * - Generating user-facing events for server and user changes (all of the apply* methods\r\n * return the set of events that need to be raised as a result).\r\n * - Maintaining the appropriate set of server listens to ensure we are always subscribed\r\n * to the correct set of paths and queries to satisfy the current set of user event\r\n * callbacks (listens are started/stopped using the provided listenProvider).\r\n *\r\n * NOTE: Although SyncTree tracks event callbacks and calculates events to raise, the actual\r\n * events are returned to the caller rather than raised synchronously.\r\n *\r\n * @constructor\r\n */\r\nvar SyncTree = /** @class */ (function () {\r\n /**\r\n * @param {!ListenProvider} listenProvider_ Used by SyncTree to start / stop listening\r\n * to server data.\r\n */\r\n function SyncTree(listenProvider_) {\r\n this.listenProvider_ = listenProvider_;\r\n /**\r\n * Tree of SyncPoints. There's a SyncPoint at any location that has 1 or more views.\r\n */\r\n this.syncPointTree_ = ImmutableTree.Empty;\r\n /**\r\n * A tree of all pending user writes (user-initiated set()'s, transaction()'s, update()'s, etc.).\r\n */\r\n this.pendingWriteTree_ = new WriteTree();\r\n this.tagToQueryMap = new Map();\r\n this.queryToTagMap = new Map();\r\n }\r\n /**\r\n * Apply the data changes for a user-generated set() or transaction() call.\r\n *\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.applyUserOverwrite = function (path, newData, writeId, visible) {\r\n // Record pending write.\r\n this.pendingWriteTree_.addOverwrite(path, newData, writeId, visible);\r\n if (!visible) {\r\n return [];\r\n }\r\n else {\r\n return this.applyOperationToSyncPoints_(new Overwrite(OperationSource.User, path, newData));\r\n }\r\n };\r\n /**\r\n * Apply the data from a user-generated update() call\r\n *\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.applyUserMerge = function (path, changedChildren, writeId) {\r\n // Record pending merge.\r\n this.pendingWriteTree_.addMerge(path, changedChildren, writeId);\r\n var changeTree = ImmutableTree.fromObject(changedChildren);\r\n return this.applyOperationToSyncPoints_(new Merge(OperationSource.User, path, changeTree));\r\n };\r\n /**\r\n * Acknowledge a pending user write that was previously registered with applyUserOverwrite() or applyUserMerge().\r\n *\r\n * @param revert True if the given write failed and needs to be reverted\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.ackUserWrite = function (writeId, revert) {\r\n if (revert === void 0) { revert = false; }\r\n var write = this.pendingWriteTree_.getWrite(writeId);\r\n var needToReevaluate = this.pendingWriteTree_.removeWrite(writeId);\r\n if (!needToReevaluate) {\r\n return [];\r\n }\r\n else {\r\n var affectedTree_1 = ImmutableTree.Empty;\r\n if (write.snap != null) {\r\n // overwrite\r\n affectedTree_1 = affectedTree_1.set(Path.Empty, true);\r\n }\r\n else {\r\n each(write.children, function (pathString, node) {\r\n affectedTree_1 = affectedTree_1.set(new Path(pathString), node);\r\n });\r\n }\r\n return this.applyOperationToSyncPoints_(new AckUserWrite(write.path, affectedTree_1, revert));\r\n }\r\n };\r\n /**\r\n * Apply new server data for the specified path..\r\n *\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.applyServerOverwrite = function (path, newData) {\r\n return this.applyOperationToSyncPoints_(new Overwrite(OperationSource.Server, path, newData));\r\n };\r\n /**\r\n * Apply new server data to be merged in at the specified path.\r\n *\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.applyServerMerge = function (path, changedChildren) {\r\n var changeTree = ImmutableTree.fromObject(changedChildren);\r\n return this.applyOperationToSyncPoints_(new Merge(OperationSource.Server, path, changeTree));\r\n };\r\n /**\r\n * Apply a listen complete for a query\r\n *\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.applyListenComplete = function (path) {\r\n return this.applyOperationToSyncPoints_(new ListenComplete(OperationSource.Server, path));\r\n };\r\n /**\r\n * Apply new server data for the specified tagged query.\r\n *\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.applyTaggedQueryOverwrite = function (path, snap, tag) {\r\n var queryKey = this.queryKeyForTag_(tag);\r\n if (queryKey != null) {\r\n var r = SyncTree.parseQueryKey_(queryKey);\r\n var queryPath = r.path, queryId = r.queryId;\r\n var relativePath = Path.relativePath(queryPath, path);\r\n var op = new Overwrite(OperationSource.forServerTaggedQuery(queryId), relativePath, snap);\r\n return this.applyTaggedOperation_(queryPath, op);\r\n }\r\n else {\r\n // Query must have been removed already\r\n return [];\r\n }\r\n };\r\n /**\r\n * Apply server data to be merged in for the specified tagged query.\r\n *\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.applyTaggedQueryMerge = function (path, changedChildren, tag) {\r\n var queryKey = this.queryKeyForTag_(tag);\r\n if (queryKey) {\r\n var r = SyncTree.parseQueryKey_(queryKey);\r\n var queryPath = r.path, queryId = r.queryId;\r\n var relativePath = Path.relativePath(queryPath, path);\r\n var changeTree = ImmutableTree.fromObject(changedChildren);\r\n var op = new Merge(OperationSource.forServerTaggedQuery(queryId), relativePath, changeTree);\r\n return this.applyTaggedOperation_(queryPath, op);\r\n }\r\n else {\r\n // We've already removed the query. No big deal, ignore the update\r\n return [];\r\n }\r\n };\r\n /**\r\n * Apply a listen complete for a tagged query\r\n *\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.applyTaggedListenComplete = function (path, tag) {\r\n var queryKey = this.queryKeyForTag_(tag);\r\n if (queryKey) {\r\n var r = SyncTree.parseQueryKey_(queryKey);\r\n var queryPath = r.path, queryId = r.queryId;\r\n var relativePath = Path.relativePath(queryPath, path);\r\n var op = new ListenComplete(OperationSource.forServerTaggedQuery(queryId), relativePath);\r\n return this.applyTaggedOperation_(queryPath, op);\r\n }\r\n else {\r\n // We've already removed the query. No big deal, ignore the update\r\n return [];\r\n }\r\n };\r\n /**\r\n * Add an event callback for the specified query.\r\n *\r\n * @return Events to raise.\r\n */\r\n SyncTree.prototype.addEventRegistration = function (query, eventRegistration) {\r\n var path = query.path;\r\n var serverCache = null;\r\n var foundAncestorDefaultView = false;\r\n // Any covering writes will necessarily be at the root, so really all we need to find is the server cache.\r\n // Consider optimizing this once there's a better understanding of what actual behavior will be.\r\n this.syncPointTree_.foreachOnPath(path, function (pathToSyncPoint, sp) {\r\n var relativePath = Path.relativePath(pathToSyncPoint, path);\r\n serverCache = serverCache || sp.getCompleteServerCache(relativePath);\r\n foundAncestorDefaultView =\r\n foundAncestorDefaultView || sp.hasCompleteView();\r\n });\r\n var syncPoint = this.syncPointTree_.get(path);\r\n if (!syncPoint) {\r\n syncPoint = new SyncPoint();\r\n this.syncPointTree_ = this.syncPointTree_.set(path, syncPoint);\r\n }\r\n else {\r\n foundAncestorDefaultView =\r\n foundAncestorDefaultView || syncPoint.hasCompleteView();\r\n serverCache = serverCache || syncPoint.getCompleteServerCache(Path.Empty);\r\n }\r\n var serverCacheComplete;\r\n if (serverCache != null) {\r\n serverCacheComplete = true;\r\n }\r\n else {\r\n serverCacheComplete = false;\r\n serverCache = ChildrenNode.EMPTY_NODE;\r\n var subtree = this.syncPointTree_.subtree(path);\r\n subtree.foreachChild(function (childName, childSyncPoint) {\r\n var completeCache = childSyncPoint.getCompleteServerCache(Path.Empty);\r\n if (completeCache) {\r\n serverCache = serverCache.updateImmediateChild(childName, completeCache);\r\n }\r\n });\r\n }\r\n var viewAlreadyExists = syncPoint.viewExistsForQuery(query);\r\n if (!viewAlreadyExists && !query.getQueryParams().loadsAllData()) {\r\n // We need to track a tag for this query\r\n var queryKey = SyncTree.makeQueryKey_(query);\r\n assert(!this.queryToTagMap.has(queryKey), 'View does not exist, but we have a tag');\r\n var tag = SyncTree.getNextQueryTag_();\r\n this.queryToTagMap.set(queryKey, tag);\r\n this.tagToQueryMap.set(tag, queryKey);\r\n }\r\n var writesCache = this.pendingWriteTree_.childWrites(path);\r\n var events = syncPoint.addEventRegistration(query, eventRegistration, writesCache, serverCache, serverCacheComplete);\r\n if (!viewAlreadyExists && !foundAncestorDefaultView) {\r\n var view /** @type !View */ = syncPoint.viewForQuery(query);\r\n events = events.concat(this.setupListener_(query, view));\r\n }\r\n return events;\r\n };\r\n /**\r\n * Remove event callback(s).\r\n *\r\n * If query is the default query, we'll check all queries for the specified eventRegistration.\r\n * If eventRegistration is null, we'll remove all callbacks for the specified query/queries.\r\n *\r\n * @param eventRegistration If null, all callbacks are removed.\r\n * @param cancelError If a cancelError is provided, appropriate cancel events will be returned.\r\n * @return Cancel events, if cancelError was provided.\r\n */\r\n SyncTree.prototype.removeEventRegistration = function (query, eventRegistration, cancelError) {\r\n var _this = this;\r\n // Find the syncPoint first. Then deal with whether or not it has matching listeners\r\n var path = query.path;\r\n var maybeSyncPoint = this.syncPointTree_.get(path);\r\n var cancelEvents = [];\r\n // A removal on a default query affects all queries at that location. A removal on an indexed query, even one without\r\n // other query constraints, does *not* affect all queries at that location. So this check must be for 'default', and\r\n // not loadsAllData().\r\n if (maybeSyncPoint &&\r\n (query.queryIdentifier() === 'default' ||\r\n maybeSyncPoint.viewExistsForQuery(query))) {\r\n /**\r\n * @type {{removed: !Array.<!Query>, events: !Array.<!Event>}}\r\n */\r\n var removedAndEvents = maybeSyncPoint.removeEventRegistration(query, eventRegistration, cancelError);\r\n if (maybeSyncPoint.isEmpty()) {\r\n this.syncPointTree_ = this.syncPointTree_.remove(path);\r\n }\r\n var removed = removedAndEvents.removed;\r\n cancelEvents = removedAndEvents.events;\r\n // We may have just removed one of many listeners and can short-circuit this whole process\r\n // We may also not have removed a default listener, in which case all of the descendant listeners should already be\r\n // properly set up.\r\n //\r\n // Since indexed queries can shadow if they don't have other query constraints, check for loadsAllData(), instead of\r\n // queryId === 'default'\r\n var removingDefault = -1 !==\r\n removed.findIndex(function (query) {\r\n return query.getQueryParams().loadsAllData();\r\n });\r\n var covered = this.syncPointTree_.findOnPath(path, function (relativePath, parentSyncPoint) {\r\n return parentSyncPoint.hasCompleteView();\r\n });\r\n if (removingDefault && !covered) {\r\n var subtree = this.syncPointTree_.subtree(path);\r\n // There are potentially child listeners. Determine what if any listens we need to send before executing the\r\n // removal\r\n if (!subtree.isEmpty()) {\r\n // We need to fold over our subtree and collect the listeners to send\r\n var newViews = this.collectDistinctViewsForSubTree_(subtree);\r\n // Ok, we've collected all the listens we need. Set them up.\r\n for (var i = 0; i < newViews.length; ++i) {\r\n var view = newViews[i], newQuery = view.getQuery();\r\n var listener = this.createListenerForView_(view);\r\n this.listenProvider_.startListening(SyncTree.queryForListening_(newQuery), this.tagForQuery_(newQuery), listener.hashFn, listener.onComplete);\r\n }\r\n }\r\n }\r\n // If we removed anything and we're not covered by a higher up listen, we need to stop listening on this query\r\n // The above block has us covered in terms of making sure we're set up on listens lower in the tree.\r\n // Also, note that if we have a cancelError, it's already been removed at the provider level.\r\n if (!covered && removed.length > 0 && !cancelError) {\r\n // If we removed a default, then we weren't listening on any of the other queries here. Just cancel the one\r\n // default. Otherwise, we need to iterate through and cancel each individual query\r\n if (removingDefault) {\r\n // We don't tag default listeners\r\n var defaultTag = null;\r\n this.listenProvider_.stopListening(SyncTree.queryForListening_(query), defaultTag);\r\n }\r\n else {\r\n removed.forEach(function (queryToRemove) {\r\n var tagToRemove = _this.queryToTagMap.get(SyncTree.makeQueryKey_(queryToRemove));\r\n _this.listenProvider_.stopListening(SyncTree.queryForListening_(queryToRemove), tagToRemove);\r\n });\r\n }\r\n }\r\n // Now, clear all of the tags we're tracking for the removed listens\r\n this.removeTags_(removed);\r\n }\r\n return cancelEvents;\r\n };\r\n /**\r\n * Returns a complete cache, if we have one, of the data at a particular path. If the location does not have a\r\n * listener above it, we will get a false \"null\". This shouldn't be a problem because transactions will always\r\n * have a listener above, and atomic operations would correctly show a jitter of <increment value> ->\r\n * <incremented total> as the write is applied locally and then acknowledged at the server.\r\n *\r\n * Note: this method will *include* hidden writes from transaction with applyLocally set to false.\r\n *\r\n * @param path The path to the data we want\r\n * @param writeIdsToExclude A specific set to be excluded\r\n */\r\n SyncTree.prototype.calcCompleteEventCache = function (path, writeIdsToExclude) {\r\n var includeHiddenSets = true;\r\n var writeTree = this.pendingWriteTree_;\r\n var serverCache = this.syncPointTree_.findOnPath(path, function (pathSoFar, syncPoint) {\r\n var relativePath = Path.relativePath(pathSoFar, path);\r\n var serverCache = syncPoint.getCompleteServerCache(relativePath);\r\n if (serverCache) {\r\n return serverCache;\r\n }\r\n });\r\n return writeTree.calcCompleteEventCache(path, serverCache, writeIdsToExclude, includeHiddenSets);\r\n };\r\n /**\r\n * This collapses multiple unfiltered views into a single view, since we only need a single\r\n * listener for them.\r\n */\r\n SyncTree.prototype.collectDistinctViewsForSubTree_ = function (subtree) {\r\n return subtree.fold(function (relativePath, maybeChildSyncPoint, childMap) {\r\n if (maybeChildSyncPoint && maybeChildSyncPoint.hasCompleteView()) {\r\n var completeView = maybeChildSyncPoint.getCompleteView();\r\n return [completeView];\r\n }\r\n else {\r\n // No complete view here, flatten any deeper listens into an array\r\n var views_1 = [];\r\n if (maybeChildSyncPoint) {\r\n views_1 = maybeChildSyncPoint.getQueryViews();\r\n }\r\n each(childMap, function (_key, childViews) {\r\n views_1 = views_1.concat(childViews);\r\n });\r\n return views_1;\r\n }\r\n });\r\n };\r\n SyncTree.prototype.removeTags_ = function (queries) {\r\n for (var j = 0; j < queries.length; ++j) {\r\n var removedQuery = queries[j];\r\n if (!removedQuery.getQueryParams().loadsAllData()) {\r\n // We should have a tag for this\r\n var removedQueryKey = SyncTree.makeQueryKey_(removedQuery);\r\n var removedQueryTag = this.queryToTagMap.get(removedQueryKey);\r\n this.queryToTagMap.delete(removedQueryKey);\r\n this.tagToQueryMap.delete(removedQueryTag);\r\n }\r\n }\r\n };\r\n /**\r\n * Normalizes a query to a query we send the server for listening\r\n *\r\n * @return The normalized query\r\n */\r\n SyncTree.queryForListening_ = function (query) {\r\n if (query.getQueryParams().loadsAllData() &&\r\n !query.getQueryParams().isDefault()) {\r\n // We treat queries that load all data as default queries\r\n // Cast is necessary because ref() technically returns Firebase which is actually fb.api.Firebase which inherits\r\n // from Query\r\n return query.getRef();\r\n }\r\n else {\r\n return query;\r\n }\r\n };\r\n /**\r\n * For a given new listen, manage the de-duplication of outstanding subscriptions.\r\n *\r\n * @return This method can return events to support synchronous data sources\r\n */\r\n SyncTree.prototype.setupListener_ = function (query, view) {\r\n var path = query.path;\r\n var tag = this.tagForQuery_(query);\r\n var listener = this.createListenerForView_(view);\r\n var events = this.listenProvider_.startListening(SyncTree.queryForListening_(query), tag, listener.hashFn, listener.onComplete);\r\n var subtree = this.syncPointTree_.subtree(path);\r\n // The root of this subtree has our query. We're here because we definitely need to send a listen for that, but we\r\n // may need to shadow other listens as well.\r\n if (tag) {\r\n assert(!subtree.value.hasCompleteView(), \"If we're adding a query, it shouldn't be shadowed\");\r\n }\r\n else {\r\n // Shadow everything at or below this location, this is a default listener.\r\n var queriesToStop = subtree.fold(function (relativePath, maybeChildSyncPoint, childMap) {\r\n if (!relativePath.isEmpty() &&\r\n maybeChildSyncPoint &&\r\n maybeChildSyncPoint.hasCompleteView()) {\r\n return [maybeChildSyncPoint.getCompleteView().getQuery()];\r\n }\r\n else {\r\n // No default listener here, flatten any deeper queries into an array\r\n var queries_1 = [];\r\n if (maybeChildSyncPoint) {\r\n queries_1 = queries_1.concat(maybeChildSyncPoint.getQueryViews().map(function (view) { return view.getQuery(); }));\r\n }\r\n each(childMap, function (_key, childQueries) {\r\n queries_1 = queries_1.concat(childQueries);\r\n });\r\n return queries_1;\r\n }\r\n });\r\n for (var i = 0; i < queriesToStop.length; ++i) {\r\n var queryToStop = queriesToStop[i];\r\n this.listenProvider_.stopListening(SyncTree.queryForListening_(queryToStop), this.tagForQuery_(queryToStop));\r\n }\r\n }\r\n return events;\r\n };\r\n SyncTree.prototype.createListenerForView_ = function (view) {\r\n var _this = this;\r\n var query = view.getQuery();\r\n var tag = this.tagForQuery_(query);\r\n return {\r\n hashFn: function () {\r\n var cache = view.getServerCache() || ChildrenNode.EMPTY_NODE;\r\n return cache.hash();\r\n },\r\n onComplete: function (status) {\r\n if (status === 'ok') {\r\n if (tag) {\r\n return _this.applyTaggedListenComplete(query.path, tag);\r\n }\r\n else {\r\n return _this.applyListenComplete(query.path);\r\n }\r\n }\r\n else {\r\n // If a listen failed, kill all of the listeners here, not just the one that triggered the error.\r\n // Note that this may need to be scoped to just this listener if we change permissions on filtered children\r\n var error = errorForServerCode(status, query);\r\n return _this.removeEventRegistration(query, \r\n /*eventRegistration*/ null, error);\r\n }\r\n }\r\n };\r\n };\r\n /**\r\n * Given a query, computes a \"queryKey\" suitable for use in our queryToTagMap_.\r\n */\r\n SyncTree.makeQueryKey_ = function (query) {\r\n return query.path.toString() + '$' + query.queryIdentifier();\r\n };\r\n /**\r\n * Given a queryKey (created by makeQueryKey), parse it back into a path and queryId.\r\n */\r\n SyncTree.parseQueryKey_ = function (queryKey) {\r\n var splitIndex = queryKey.indexOf('$');\r\n assert(splitIndex !== -1 && splitIndex < queryKey.length - 1, 'Bad queryKey.');\r\n return {\r\n queryId: queryKey.substr(splitIndex + 1),\r\n path: new Path(queryKey.substr(0, splitIndex))\r\n };\r\n };\r\n /**\r\n * Return the query associated with the given tag, if we have one\r\n */\r\n SyncTree.prototype.queryKeyForTag_ = function (tag) {\r\n return this.tagToQueryMap.get(tag);\r\n };\r\n /**\r\n * Return the tag associated with the given query.\r\n */\r\n SyncTree.prototype.tagForQuery_ = function (query) {\r\n var queryKey = SyncTree.makeQueryKey_(query);\r\n return this.queryToTagMap.get(queryKey);\r\n };\r\n /**\r\n * Static accessor for query tags.\r\n */\r\n SyncTree.getNextQueryTag_ = function () {\r\n return SyncTree.nextQueryTag_++;\r\n };\r\n /**\r\n * A helper method to apply tagged operations\r\n */\r\n SyncTree.prototype.applyTaggedOperation_ = function (queryPath, operation) {\r\n var syncPoint = this.syncPointTree_.get(queryPath);\r\n assert(syncPoint, \"Missing sync point for query tag that we're tracking\");\r\n var writesCache = this.pendingWriteTree_.childWrites(queryPath);\r\n return syncPoint.applyOperation(operation, writesCache, \r\n /*serverCache=*/ null);\r\n };\r\n /**\r\n * A helper method that visits all descendant and ancestor SyncPoints, applying the operation.\r\n *\r\n * NOTES:\r\n * - Descendant SyncPoints will be visited first (since we raise events depth-first).\r\n *\r\n * - We call applyOperation() on each SyncPoint passing three things:\r\n * 1. A version of the Operation that has been made relative to the SyncPoint location.\r\n * 2. A WriteTreeRef of any writes we have cached at the SyncPoint location.\r\n * 3. A snapshot Node with cached server data, if we have it.\r\n *\r\n * - We concatenate all of the events returned by each SyncPoint and return the result.\r\n */\r\n SyncTree.prototype.applyOperationToSyncPoints_ = function (operation) {\r\n return this.applyOperationHelper_(operation, this.syncPointTree_, \r\n /*serverCache=*/ null, this.pendingWriteTree_.childWrites(Path.Empty));\r\n };\r\n /**\r\n * Recursive helper for applyOperationToSyncPoints_\r\n */\r\n SyncTree.prototype.applyOperationHelper_ = function (operation, syncPointTree, serverCache, writesCache) {\r\n if (operation.path.isEmpty()) {\r\n return this.applyOperationDescendantsHelper_(operation, syncPointTree, serverCache, writesCache);\r\n }\r\n else {\r\n var syncPoint = syncPointTree.get(Path.Empty);\r\n // If we don't have cached server data, see if we can get it from this SyncPoint.\r\n if (serverCache == null && syncPoint != null) {\r\n serverCache = syncPoint.getCompleteServerCache(Path.Empty);\r\n }\r\n var events = [];\r\n var childName = operation.path.getFront();\r\n var childOperation = operation.operationForChild(childName);\r\n var childTree = syncPointTree.children.get(childName);\r\n if (childTree && childOperation) {\r\n var childServerCache = serverCache\r\n ? serverCache.getImmediateChild(childName)\r\n : null;\r\n var childWritesCache = writesCache.child(childName);\r\n events = events.concat(this.applyOperationHelper_(childOperation, childTree, childServerCache, childWritesCache));\r\n }\r\n if (syncPoint) {\r\n events = events.concat(syncPoint.applyOperation(operation, writesCache, serverCache));\r\n }\r\n return events;\r\n }\r\n };\r\n /**\r\n * Recursive helper for applyOperationToSyncPoints_\r\n */\r\n SyncTree.prototype.applyOperationDescendantsHelper_ = function (operation, syncPointTree, serverCache, writesCache) {\r\n var _this = this;\r\n var syncPoint = syncPointTree.get(Path.Empty);\r\n // If we don't have cached server data, see if we can get it from this SyncPoint.\r\n if (serverCache == null && syncPoint != null) {\r\n serverCache = syncPoint.getCompleteServerCache(Path.Empty);\r\n }\r\n var events = [];\r\n syncPointTree.children.inorderTraversal(function (childName, childTree) {\r\n var childServerCache = serverCache\r\n ? serverCache.getImmediateChild(childName)\r\n : null;\r\n var childWritesCache = writesCache.child(childName);\r\n var childOperation = operation.operationForChild(childName);\r\n if (childOperation) {\r\n events = events.concat(_this.applyOperationDescendantsHelper_(childOperation, childTree, childServerCache, childWritesCache));\r\n }\r\n });\r\n if (syncPoint) {\r\n events = events.concat(syncPoint.applyOperation(operation, writesCache, serverCache));\r\n }\r\n return events;\r\n };\r\n /**\r\n * Static tracker for next query tag.\r\n */\r\n SyncTree.nextQueryTag_ = 1;\r\n return SyncTree;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Mutable object which basically just stores a reference to the \"latest\" immutable snapshot.\r\n *\r\n * @constructor\r\n */\r\nvar SnapshotHolder = /** @class */ (function () {\r\n function SnapshotHolder() {\r\n this.rootNode_ = ChildrenNode.EMPTY_NODE;\r\n }\r\n SnapshotHolder.prototype.getNode = function (path) {\r\n return this.rootNode_.getChild(path);\r\n };\r\n SnapshotHolder.prototype.updateSnapshot = function (path, newSnapshotNode) {\r\n this.rootNode_ = this.rootNode_.updateChild(path, newSnapshotNode);\r\n };\r\n return SnapshotHolder;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Tracks a collection of stats.\r\n *\r\n * @constructor\r\n */\r\nvar StatsCollection = /** @class */ (function () {\r\n function StatsCollection() {\r\n this.counters_ = {};\r\n }\r\n StatsCollection.prototype.incrementCounter = function (name, amount) {\r\n if (amount === void 0) { amount = 1; }\r\n if (!contains(this.counters_, name)) {\r\n this.counters_[name] = 0;\r\n }\r\n this.counters_[name] += amount;\r\n };\r\n StatsCollection.prototype.get = function () {\r\n return deepCopy(this.counters_);\r\n };\r\n return StatsCollection;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar StatsManager = /** @class */ (function () {\r\n function StatsManager() {\r\n }\r\n StatsManager.getCollection = function (repoInfo) {\r\n var hashString = repoInfo.toString();\r\n if (!this.collections_[hashString]) {\r\n this.collections_[hashString] = new StatsCollection();\r\n }\r\n return this.collections_[hashString];\r\n };\r\n StatsManager.getOrCreateReporter = function (repoInfo, creatorFunction) {\r\n var hashString = repoInfo.toString();\r\n if (!this.reporters_[hashString]) {\r\n this.reporters_[hashString] = creatorFunction();\r\n }\r\n return this.reporters_[hashString];\r\n };\r\n StatsManager.collections_ = {};\r\n StatsManager.reporters_ = {};\r\n return StatsManager;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns the delta from the previous call to get stats.\r\n *\r\n * @param collection_ The collection to \"listen\" to.\r\n * @constructor\r\n */\r\nvar StatsListener = /** @class */ (function () {\r\n function StatsListener(collection_) {\r\n this.collection_ = collection_;\r\n this.last_ = null;\r\n }\r\n StatsListener.prototype.get = function () {\r\n var newStats = this.collection_.get();\r\n var delta = __assign({}, newStats);\r\n if (this.last_) {\r\n each(this.last_, function (stat, value) {\r\n delta[stat] = delta[stat] - value;\r\n });\r\n }\r\n this.last_ = newStats;\r\n return delta;\r\n };\r\n return StatsListener;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// Assuming some apps may have a short amount of time on page, and a bulk of firebase operations probably\r\n// happen on page load, we try to report our first set of stats pretty quickly, but we wait at least 10\r\n// seconds to try to ensure the Firebase connection is established / settled.\r\nvar FIRST_STATS_MIN_TIME = 10 * 1000;\r\nvar FIRST_STATS_MAX_TIME = 30 * 1000;\r\n// We'll continue to report stats on average every 5 minutes.\r\nvar REPORT_STATS_INTERVAL = 5 * 60 * 1000;\r\n/**\r\n * @constructor\r\n */\r\nvar StatsReporter = /** @class */ (function () {\r\n /**\r\n * @param collection\r\n * @param server_\r\n */\r\n function StatsReporter(collection, server_) {\r\n this.server_ = server_;\r\n this.statsToReport_ = {};\r\n this.statsListener_ = new StatsListener(collection);\r\n var timeout = FIRST_STATS_MIN_TIME +\r\n (FIRST_STATS_MAX_TIME - FIRST_STATS_MIN_TIME) * Math.random();\r\n setTimeoutNonBlocking(this.reportStats_.bind(this), Math.floor(timeout));\r\n }\r\n StatsReporter.prototype.includeStat = function (stat) {\r\n this.statsToReport_[stat] = true;\r\n };\r\n StatsReporter.prototype.reportStats_ = function () {\r\n var _this = this;\r\n var stats = this.statsListener_.get();\r\n var reportedStats = {};\r\n var haveStatsToReport = false;\r\n each(stats, function (stat, value) {\r\n if (value > 0 && contains(_this.statsToReport_, stat)) {\r\n reportedStats[stat] = value;\r\n haveStatsToReport = true;\r\n }\r\n });\r\n if (haveStatsToReport) {\r\n this.server_.reportStats(reportedStats);\r\n }\r\n // queue our next run.\r\n setTimeoutNonBlocking(this.reportStats_.bind(this), Math.floor(Math.random() * 2 * REPORT_STATS_INTERVAL));\r\n };\r\n return StatsReporter;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * The event queue serves a few purposes:\r\n * 1. It ensures we maintain event order in the face of event callbacks doing operations that result in more\r\n * events being queued.\r\n * 2. raiseQueuedEvents() handles being called reentrantly nicely. That is, if in the course of raising events,\r\n * raiseQueuedEvents() is called again, the \"inner\" call will pick up raising events where the \"outer\" call\r\n * left off, ensuring that the events are still raised synchronously and in order.\r\n * 3. You can use raiseEventsAtPath and raiseEventsForChangedPath to ensure only relevant previously-queued\r\n * events are raised synchronously.\r\n *\r\n * NOTE: This can all go away if/when we move to async events.\r\n *\r\n * @constructor\r\n */\r\nvar EventQueue = /** @class */ (function () {\r\n function EventQueue() {\r\n /**\r\n * @private\r\n * @type {!Array.<EventList>}\r\n */\r\n this.eventLists_ = [];\r\n /**\r\n * Tracks recursion depth of raiseQueuedEvents_, for debugging purposes.\r\n * @private\r\n * @type {!number}\r\n */\r\n this.recursionDepth_ = 0;\r\n }\r\n /**\r\n * @param {!Array.<Event>} eventDataList The new events to queue.\r\n */\r\n EventQueue.prototype.queueEvents = function (eventDataList) {\r\n // We group events by path, storing them in a single EventList, to make it easier to skip over them quickly.\r\n var currList = null;\r\n for (var i = 0; i < eventDataList.length; i++) {\r\n var eventData = eventDataList[i];\r\n var eventPath = eventData.getPath();\r\n if (currList !== null && !eventPath.equals(currList.getPath())) {\r\n this.eventLists_.push(currList);\r\n currList = null;\r\n }\r\n if (currList === null) {\r\n currList = new EventList(eventPath);\r\n }\r\n currList.add(eventData);\r\n }\r\n if (currList) {\r\n this.eventLists_.push(currList);\r\n }\r\n };\r\n /**\r\n * Queues the specified events and synchronously raises all events (including previously queued ones)\r\n * for the specified path.\r\n *\r\n * It is assumed that the new events are all for the specified path.\r\n *\r\n * @param {!Path} path The path to raise events for.\r\n * @param {!Array.<Event>} eventDataList The new events to raise.\r\n */\r\n EventQueue.prototype.raiseEventsAtPath = function (path, eventDataList) {\r\n this.queueEvents(eventDataList);\r\n this.raiseQueuedEventsMatchingPredicate_(function (eventPath) {\r\n return eventPath.equals(path);\r\n });\r\n };\r\n /**\r\n * Queues the specified events and synchronously raises all events (including previously queued ones) for\r\n * locations related to the specified change path (i.e. all ancestors and descendants).\r\n *\r\n * It is assumed that the new events are all related (ancestor or descendant) to the specified path.\r\n *\r\n * @param {!Path} changedPath The path to raise events for.\r\n * @param {!Array.<!Event>} eventDataList The events to raise\r\n */\r\n EventQueue.prototype.raiseEventsForChangedPath = function (changedPath, eventDataList) {\r\n this.queueEvents(eventDataList);\r\n this.raiseQueuedEventsMatchingPredicate_(function (eventPath) {\r\n return eventPath.contains(changedPath) || changedPath.contains(eventPath);\r\n });\r\n };\r\n /**\r\n * @param {!function(!Path):boolean} predicate\r\n * @private\r\n */\r\n EventQueue.prototype.raiseQueuedEventsMatchingPredicate_ = function (predicate) {\r\n this.recursionDepth_++;\r\n var sentAll = true;\r\n for (var i = 0; i < this.eventLists_.length; i++) {\r\n var eventList = this.eventLists_[i];\r\n if (eventList) {\r\n var eventPath = eventList.getPath();\r\n if (predicate(eventPath)) {\r\n this.eventLists_[i].raise();\r\n this.eventLists_[i] = null;\r\n }\r\n else {\r\n sentAll = false;\r\n }\r\n }\r\n }\r\n if (sentAll) {\r\n this.eventLists_ = [];\r\n }\r\n this.recursionDepth_--;\r\n };\r\n return EventQueue;\r\n}());\r\n/**\r\n * @param {!Path} path\r\n * @constructor\r\n */\r\nvar EventList = /** @class */ (function () {\r\n function EventList(path_) {\r\n this.path_ = path_;\r\n /**\r\n * @type {!Array.<Event>}\r\n * @private\r\n */\r\n this.events_ = [];\r\n }\r\n /**\r\n * @param {!Event} eventData\r\n */\r\n EventList.prototype.add = function (eventData) {\r\n this.events_.push(eventData);\r\n };\r\n /**\r\n * Iterates through the list and raises each event\r\n */\r\n EventList.prototype.raise = function () {\r\n for (var i = 0; i < this.events_.length; i++) {\r\n var eventData = this.events_[i];\r\n if (eventData !== null) {\r\n this.events_[i] = null;\r\n var eventFn = eventData.getEventRunner();\r\n if (logger) {\r\n log('event: ' + eventData.toString());\r\n }\r\n exceptionGuard(eventFn);\r\n }\r\n }\r\n };\r\n /**\r\n * @return {!Path}\r\n */\r\n EventList.prototype.getPath = function () {\r\n return this.path_;\r\n };\r\n return EventList;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Base class to be used if you want to emit events. Call the constructor with\r\n * the set of allowed event names.\r\n */\r\nvar EventEmitter = /** @class */ (function () {\r\n /**\r\n * @param {!Array.<string>} allowedEvents_\r\n */\r\n function EventEmitter(allowedEvents_) {\r\n this.allowedEvents_ = allowedEvents_;\r\n this.listeners_ = {};\r\n assert(Array.isArray(allowedEvents_) && allowedEvents_.length > 0, 'Requires a non-empty array');\r\n }\r\n /**\r\n * To be called by derived classes to trigger events.\r\n * @param {!string} eventType\r\n * @param {...*} varArgs\r\n */\r\n EventEmitter.prototype.trigger = function (eventType) {\r\n var varArgs = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n varArgs[_i - 1] = arguments[_i];\r\n }\r\n if (Array.isArray(this.listeners_[eventType])) {\r\n // Clone the list, since callbacks could add/remove listeners.\r\n var listeners = __spread(this.listeners_[eventType]);\r\n for (var i = 0; i < listeners.length; i++) {\r\n listeners[i].callback.apply(listeners[i].context, varArgs);\r\n }\r\n }\r\n };\r\n EventEmitter.prototype.on = function (eventType, callback, context) {\r\n this.validateEventType_(eventType);\r\n this.listeners_[eventType] = this.listeners_[eventType] || [];\r\n this.listeners_[eventType].push({ callback: callback, context: context });\r\n var eventData = this.getInitialEvent(eventType);\r\n if (eventData) {\r\n callback.apply(context, eventData);\r\n }\r\n };\r\n EventEmitter.prototype.off = function (eventType, callback, context) {\r\n this.validateEventType_(eventType);\r\n var listeners = this.listeners_[eventType] || [];\r\n for (var i = 0; i < listeners.length; i++) {\r\n if (listeners[i].callback === callback &&\r\n (!context || context === listeners[i].context)) {\r\n listeners.splice(i, 1);\r\n return;\r\n }\r\n }\r\n };\r\n EventEmitter.prototype.validateEventType_ = function (eventType) {\r\n assert(this.allowedEvents_.find(function (et) {\r\n return et === eventType;\r\n }), 'Unknown event: ' + eventType);\r\n };\r\n return EventEmitter;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @extends {EventEmitter}\r\n */\r\nvar VisibilityMonitor = /** @class */ (function (_super) {\r\n __extends(VisibilityMonitor, _super);\r\n function VisibilityMonitor() {\r\n var _this = _super.call(this, ['visible']) || this;\r\n var hidden;\r\n var visibilityChange;\r\n if (typeof document !== 'undefined' &&\r\n typeof document.addEventListener !== 'undefined') {\r\n if (typeof document['hidden'] !== 'undefined') {\r\n // Opera 12.10 and Firefox 18 and later support\r\n visibilityChange = 'visibilitychange';\r\n hidden = 'hidden';\r\n }\r\n else if (typeof document['mozHidden'] !== 'undefined') {\r\n visibilityChange = 'mozvisibilitychange';\r\n hidden = 'mozHidden';\r\n }\r\n else if (typeof document['msHidden'] !== 'undefined') {\r\n visibilityChange = 'msvisibilitychange';\r\n hidden = 'msHidden';\r\n }\r\n else if (typeof document['webkitHidden'] !== 'undefined') {\r\n visibilityChange = 'webkitvisibilitychange';\r\n hidden = 'webkitHidden';\r\n }\r\n }\r\n // Initially, we always assume we are visible. This ensures that in browsers\r\n // without page visibility support or in cases where we are never visible\r\n // (e.g. chrome extension), we act as if we are visible, i.e. don't delay\r\n // reconnects\r\n _this.visible_ = true;\r\n if (visibilityChange) {\r\n document.addEventListener(visibilityChange, function () {\r\n var visible = !document[hidden];\r\n if (visible !== _this.visible_) {\r\n _this.visible_ = visible;\r\n _this.trigger('visible', visible);\r\n }\r\n }, false);\r\n }\r\n return _this;\r\n }\r\n VisibilityMonitor.getInstance = function () {\r\n return new VisibilityMonitor();\r\n };\r\n /**\r\n * @param {!string} eventType\r\n * @return {Array.<boolean>}\r\n */\r\n VisibilityMonitor.prototype.getInitialEvent = function (eventType) {\r\n assert(eventType === 'visible', 'Unknown event type: ' + eventType);\r\n return [this.visible_];\r\n };\r\n return VisibilityMonitor;\r\n}(EventEmitter));\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Monitors online state (as reported by window.online/offline events).\r\n *\r\n * The expectation is that this could have many false positives (thinks we are online\r\n * when we're not), but no false negatives. So we can safely use it to determine when\r\n * we definitely cannot reach the internet.\r\n *\r\n * @extends {EventEmitter}\r\n */\r\nvar OnlineMonitor = /** @class */ (function (_super) {\r\n __extends(OnlineMonitor, _super);\r\n function OnlineMonitor() {\r\n var _this = _super.call(this, ['online']) || this;\r\n _this.online_ = true;\r\n // We've had repeated complaints that Cordova apps can get stuck \"offline\", e.g.\r\n // https://forum.ionicframework.com/t/firebase-connection-is-lost-and-never-come-back/43810\r\n // It would seem that the 'online' event does not always fire consistently. So we disable it\r\n // for Cordova.\r\n if (typeof window !== 'undefined' &&\r\n typeof window.addEventListener !== 'undefined' &&\r\n !isMobileCordova()) {\r\n window.addEventListener('online', function () {\r\n if (!_this.online_) {\r\n _this.online_ = true;\r\n _this.trigger('online', true);\r\n }\r\n }, false);\r\n window.addEventListener('offline', function () {\r\n if (_this.online_) {\r\n _this.online_ = false;\r\n _this.trigger('online', false);\r\n }\r\n }, false);\r\n }\r\n return _this;\r\n }\r\n OnlineMonitor.getInstance = function () {\r\n return new OnlineMonitor();\r\n };\r\n /**\r\n * @param {!string} eventType\r\n * @return {Array.<boolean>}\r\n */\r\n OnlineMonitor.prototype.getInitialEvent = function (eventType) {\r\n assert(eventType === 'online', 'Unknown event type: ' + eventType);\r\n return [this.online_];\r\n };\r\n /**\r\n * @return {boolean}\r\n */\r\n OnlineMonitor.prototype.currentlyOnline = function () {\r\n return this.online_;\r\n };\r\n return OnlineMonitor;\r\n}(EventEmitter));\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * This class ensures the packets from the server arrive in order\r\n * This class takes data from the server and ensures it gets passed into the callbacks in order.\r\n * @constructor\r\n */\r\nvar PacketReceiver = /** @class */ (function () {\r\n /**\r\n * @param onMessage_\r\n */\r\n function PacketReceiver(onMessage_) {\r\n this.onMessage_ = onMessage_;\r\n this.pendingResponses = [];\r\n this.currentResponseNum = 0;\r\n this.closeAfterResponse = -1;\r\n this.onClose = null;\r\n }\r\n PacketReceiver.prototype.closeAfter = function (responseNum, callback) {\r\n this.closeAfterResponse = responseNum;\r\n this.onClose = callback;\r\n if (this.closeAfterResponse < this.currentResponseNum) {\r\n this.onClose();\r\n this.onClose = null;\r\n }\r\n };\r\n /**\r\n * Each message from the server comes with a response number, and an array of data. The responseNumber\r\n * allows us to ensure that we process them in the right order, since we can't be guaranteed that all\r\n * browsers will respond in the same order as the requests we sent\r\n * @param {number} requestNum\r\n * @param {Array} data\r\n */\r\n PacketReceiver.prototype.handleResponse = function (requestNum, data) {\r\n var _this = this;\r\n this.pendingResponses[requestNum] = data;\r\n var _loop_1 = function () {\r\n var toProcess = this_1.pendingResponses[this_1.currentResponseNum];\r\n delete this_1.pendingResponses[this_1.currentResponseNum];\r\n var _loop_2 = function (i) {\r\n if (toProcess[i]) {\r\n exceptionGuard(function () {\r\n _this.onMessage_(toProcess[i]);\r\n });\r\n }\r\n };\r\n for (var i = 0; i < toProcess.length; ++i) {\r\n _loop_2(i);\r\n }\r\n if (this_1.currentResponseNum === this_1.closeAfterResponse) {\r\n if (this_1.onClose) {\r\n this_1.onClose();\r\n this_1.onClose = null;\r\n }\r\n return \"break\";\r\n }\r\n this_1.currentResponseNum++;\r\n };\r\n var this_1 = this;\r\n while (this.pendingResponses[this.currentResponseNum]) {\r\n var state_1 = _loop_1();\r\n if (state_1 === \"break\")\r\n break;\r\n }\r\n };\r\n return PacketReceiver;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// URL query parameters associated with longpolling\r\nvar FIREBASE_LONGPOLL_START_PARAM = 'start';\r\nvar FIREBASE_LONGPOLL_CLOSE_COMMAND = 'close';\r\nvar FIREBASE_LONGPOLL_COMMAND_CB_NAME = 'pLPCommand';\r\nvar FIREBASE_LONGPOLL_DATA_CB_NAME = 'pRTLPCB';\r\nvar FIREBASE_LONGPOLL_ID_PARAM = 'id';\r\nvar FIREBASE_LONGPOLL_PW_PARAM = 'pw';\r\nvar FIREBASE_LONGPOLL_SERIAL_PARAM = 'ser';\r\nvar FIREBASE_LONGPOLL_CALLBACK_ID_PARAM = 'cb';\r\nvar FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM = 'seg';\r\nvar FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET = 'ts';\r\nvar FIREBASE_LONGPOLL_DATA_PARAM = 'd';\r\nvar FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM = 'dframe';\r\n//Data size constants.\r\n//TODO: Perf: the maximum length actually differs from browser to browser.\r\n// We should check what browser we're on and set accordingly.\r\nvar MAX_URL_DATA_SIZE = 1870;\r\nvar SEG_HEADER_SIZE = 30; //ie: &seg=8299234&ts=982389123&d=\r\nvar MAX_PAYLOAD_SIZE = MAX_URL_DATA_SIZE - SEG_HEADER_SIZE;\r\n/**\r\n * Keepalive period\r\n * send a fresh request at minimum every 25 seconds. Opera has a maximum request\r\n * length of 30 seconds that we can't exceed.\r\n * @const\r\n * @type {number}\r\n */\r\nvar KEEPALIVE_REQUEST_INTERVAL = 25000;\r\n/**\r\n * How long to wait before aborting a long-polling connection attempt.\r\n * @const\r\n * @type {number}\r\n */\r\nvar LP_CONNECT_TIMEOUT = 30000;\r\n/**\r\n * This class manages a single long-polling connection.\r\n *\r\n * @constructor\r\n * @implements {Transport}\r\n */\r\nvar BrowserPollConnection = /** @class */ (function () {\r\n /**\r\n * @param connId An identifier for this connection, used for logging\r\n * @param repoInfo The info for the endpoint to send data to.\r\n * @param applicationId The Firebase App ID for this project.\r\n * @param transportSessionId Optional transportSessionid if we are reconnecting for an existing\r\n * transport session\r\n * @param lastSessionId Optional lastSessionId if the PersistentConnection has already created a\r\n * connection previously\r\n */\r\n function BrowserPollConnection(connId, repoInfo, applicationId, transportSessionId, lastSessionId) {\r\n this.connId = connId;\r\n this.repoInfo = repoInfo;\r\n this.applicationId = applicationId;\r\n this.transportSessionId = transportSessionId;\r\n this.lastSessionId = lastSessionId;\r\n this.bytesSent = 0;\r\n this.bytesReceived = 0;\r\n this.everConnected_ = false;\r\n this.log_ = logWrapper(connId);\r\n this.stats_ = StatsManager.getCollection(repoInfo);\r\n this.urlFn = function (params) {\r\n return repoInfo.connectionURL(LONG_POLLING, params);\r\n };\r\n }\r\n /**\r\n *\r\n * @param {function(Object)} onMessage Callback when messages arrive\r\n * @param {function()} onDisconnect Callback with connection lost.\r\n */\r\n BrowserPollConnection.prototype.open = function (onMessage, onDisconnect) {\r\n var _this = this;\r\n this.curSegmentNum = 0;\r\n this.onDisconnect_ = onDisconnect;\r\n this.myPacketOrderer = new PacketReceiver(onMessage);\r\n this.isClosed_ = false;\r\n this.connectTimeoutTimer_ = setTimeout(function () {\r\n _this.log_('Timed out trying to connect.');\r\n // Make sure we clear the host cache\r\n _this.onClosed_();\r\n _this.connectTimeoutTimer_ = null;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n }, Math.floor(LP_CONNECT_TIMEOUT));\r\n // Ensure we delay the creation of the iframe until the DOM is loaded.\r\n executeWhenDOMReady(function () {\r\n if (_this.isClosed_) {\r\n return;\r\n }\r\n //Set up a callback that gets triggered once a connection is set up.\r\n _this.scriptTagHolder = new FirebaseIFrameScriptHolder(function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var _a = __read(args, 5), command = _a[0], arg1 = _a[1], arg2 = _a[2], arg3 = _a[3], arg4 = _a[4];\r\n _this.incrementIncomingBytes_(args);\r\n if (!_this.scriptTagHolder) {\r\n return; // we closed the connection.\r\n }\r\n if (_this.connectTimeoutTimer_) {\r\n clearTimeout(_this.connectTimeoutTimer_);\r\n _this.connectTimeoutTimer_ = null;\r\n }\r\n _this.everConnected_ = true;\r\n if (command === FIREBASE_LONGPOLL_START_PARAM) {\r\n _this.id = arg1;\r\n _this.password = arg2;\r\n }\r\n else if (command === FIREBASE_LONGPOLL_CLOSE_COMMAND) {\r\n // Don't clear the host cache. We got a response from the server, so we know it's reachable\r\n if (arg1) {\r\n // We aren't expecting any more data (other than what the server's already in the process of sending us\r\n // through our already open polls), so don't send any more.\r\n _this.scriptTagHolder.sendNewPolls = false;\r\n // arg1 in this case is the last response number sent by the server. We should try to receive\r\n // all of the responses up to this one before closing\r\n _this.myPacketOrderer.closeAfter(arg1, function () {\r\n _this.onClosed_();\r\n });\r\n }\r\n else {\r\n _this.onClosed_();\r\n }\r\n }\r\n else {\r\n throw new Error('Unrecognized command received: ' + command);\r\n }\r\n }, function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var _a = __read(args, 2), pN = _a[0], data = _a[1];\r\n _this.incrementIncomingBytes_(args);\r\n _this.myPacketOrderer.handleResponse(pN, data);\r\n }, function () {\r\n _this.onClosed_();\r\n }, _this.urlFn);\r\n //Send the initial request to connect. The serial number is simply to keep the browser from pulling previous results\r\n //from cache.\r\n var urlParams = {};\r\n urlParams[FIREBASE_LONGPOLL_START_PARAM] = 't';\r\n urlParams[FIREBASE_LONGPOLL_SERIAL_PARAM] = Math.floor(Math.random() * 100000000);\r\n if (_this.scriptTagHolder.uniqueCallbackIdentifier) {\r\n urlParams[FIREBASE_LONGPOLL_CALLBACK_ID_PARAM] = _this.scriptTagHolder.uniqueCallbackIdentifier;\r\n }\r\n urlParams[VERSION_PARAM] = PROTOCOL_VERSION;\r\n if (_this.transportSessionId) {\r\n urlParams[TRANSPORT_SESSION_PARAM] = _this.transportSessionId;\r\n }\r\n if (_this.lastSessionId) {\r\n urlParams[LAST_SESSION_PARAM] = _this.lastSessionId;\r\n }\r\n if (_this.applicationId) {\r\n urlParams[APPLICATION_ID_PARAM] = _this.applicationId;\r\n }\r\n if (typeof location !== 'undefined' &&\r\n location.href &&\r\n location.href.indexOf(FORGE_DOMAIN) !== -1) {\r\n urlParams[REFERER_PARAM] = FORGE_REF;\r\n }\r\n var connectURL = _this.urlFn(urlParams);\r\n _this.log_('Connecting via long-poll to ' + connectURL);\r\n _this.scriptTagHolder.addTag(connectURL, function () {\r\n /* do nothing */\r\n });\r\n });\r\n };\r\n /**\r\n * Call this when a handshake has completed successfully and we want to consider the connection established\r\n */\r\n BrowserPollConnection.prototype.start = function () {\r\n this.scriptTagHolder.startLongPoll(this.id, this.password);\r\n this.addDisconnectPingFrame(this.id, this.password);\r\n };\r\n /**\r\n * Forces long polling to be considered as a potential transport\r\n */\r\n BrowserPollConnection.forceAllow = function () {\r\n BrowserPollConnection.forceAllow_ = true;\r\n };\r\n /**\r\n * Forces longpolling to not be considered as a potential transport\r\n */\r\n BrowserPollConnection.forceDisallow = function () {\r\n BrowserPollConnection.forceDisallow_ = true;\r\n };\r\n // Static method, use string literal so it can be accessed in a generic way\r\n BrowserPollConnection.isAvailable = function () {\r\n if (isNodeSdk()) {\r\n return false;\r\n }\r\n else if (BrowserPollConnection.forceAllow_) {\r\n return true;\r\n }\r\n else {\r\n // NOTE: In React-Native there's normally no 'document', but if you debug a React-Native app in\r\n // the Chrome debugger, 'document' is defined, but document.createElement is null (2015/06/08).\r\n return (!BrowserPollConnection.forceDisallow_ &&\r\n typeof document !== 'undefined' &&\r\n document.createElement != null &&\r\n !isChromeExtensionContentScript() &&\r\n !isWindowsStoreApp());\r\n }\r\n };\r\n /**\r\n * No-op for polling\r\n */\r\n BrowserPollConnection.prototype.markConnectionHealthy = function () { };\r\n /**\r\n * Stops polling and cleans up the iframe\r\n * @private\r\n */\r\n BrowserPollConnection.prototype.shutdown_ = function () {\r\n this.isClosed_ = true;\r\n if (this.scriptTagHolder) {\r\n this.scriptTagHolder.close();\r\n this.scriptTagHolder = null;\r\n }\r\n //remove the disconnect frame, which will trigger an XHR call to the server to tell it we're leaving.\r\n if (this.myDisconnFrame) {\r\n document.body.removeChild(this.myDisconnFrame);\r\n this.myDisconnFrame = null;\r\n }\r\n if (this.connectTimeoutTimer_) {\r\n clearTimeout(this.connectTimeoutTimer_);\r\n this.connectTimeoutTimer_ = null;\r\n }\r\n };\r\n /**\r\n * Triggered when this transport is closed\r\n * @private\r\n */\r\n BrowserPollConnection.prototype.onClosed_ = function () {\r\n if (!this.isClosed_) {\r\n this.log_('Longpoll is closing itself');\r\n this.shutdown_();\r\n if (this.onDisconnect_) {\r\n this.onDisconnect_(this.everConnected_);\r\n this.onDisconnect_ = null;\r\n }\r\n }\r\n };\r\n /**\r\n * External-facing close handler. RealTime has requested we shut down. Kill our connection and tell the server\r\n * that we've left.\r\n */\r\n BrowserPollConnection.prototype.close = function () {\r\n if (!this.isClosed_) {\r\n this.log_('Longpoll is being closed.');\r\n this.shutdown_();\r\n }\r\n };\r\n /**\r\n * Send the JSON object down to the server. It will need to be stringified, base64 encoded, and then\r\n * broken into chunks (since URLs have a small maximum length).\r\n * @param {!Object} data The JSON data to transmit.\r\n */\r\n BrowserPollConnection.prototype.send = function (data) {\r\n var dataStr = stringify(data);\r\n this.bytesSent += dataStr.length;\r\n this.stats_.incrementCounter('bytes_sent', dataStr.length);\r\n //first, lets get the base64-encoded data\r\n var base64data = base64Encode(dataStr);\r\n //We can only fit a certain amount in each URL, so we need to split this request\r\n //up into multiple pieces if it doesn't fit in one request.\r\n var dataSegs = splitStringBySize(base64data, MAX_PAYLOAD_SIZE);\r\n //Enqueue each segment for transmission. We assign each chunk a sequential ID and a total number\r\n //of segments so that we can reassemble the packet on the server.\r\n for (var i = 0; i < dataSegs.length; i++) {\r\n this.scriptTagHolder.enqueueSegment(this.curSegmentNum, dataSegs.length, dataSegs[i]);\r\n this.curSegmentNum++;\r\n }\r\n };\r\n /**\r\n * This is how we notify the server that we're leaving.\r\n * We aren't able to send requests with DHTML on a window close event, but we can\r\n * trigger XHR requests in some browsers (everything but Opera basically).\r\n * @param {!string} id\r\n * @param {!string} pw\r\n */\r\n BrowserPollConnection.prototype.addDisconnectPingFrame = function (id, pw) {\r\n if (isNodeSdk()) {\r\n return;\r\n }\r\n this.myDisconnFrame = document.createElement('iframe');\r\n var urlParams = {};\r\n urlParams[FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM] = 't';\r\n urlParams[FIREBASE_LONGPOLL_ID_PARAM] = id;\r\n urlParams[FIREBASE_LONGPOLL_PW_PARAM] = pw;\r\n this.myDisconnFrame.src = this.urlFn(urlParams);\r\n this.myDisconnFrame.style.display = 'none';\r\n document.body.appendChild(this.myDisconnFrame);\r\n };\r\n /**\r\n * Used to track the bytes received by this client\r\n * @param {*} args\r\n * @private\r\n */\r\n BrowserPollConnection.prototype.incrementIncomingBytes_ = function (args) {\r\n // TODO: This is an annoying perf hit just to track the number of incoming bytes. Maybe it should be opt-in.\r\n var bytesReceived = stringify(args).length;\r\n this.bytesReceived += bytesReceived;\r\n this.stats_.incrementCounter('bytes_received', bytesReceived);\r\n };\r\n return BrowserPollConnection;\r\n}());\r\n/*********************************************************************************************\r\n * A wrapper around an iframe that is used as a long-polling script holder.\r\n * @constructor\r\n *********************************************************************************************/\r\nvar FirebaseIFrameScriptHolder = /** @class */ (function () {\r\n /**\r\n * @param commandCB - The callback to be called when control commands are recevied from the server.\r\n * @param onMessageCB - The callback to be triggered when responses arrive from the server.\r\n * @param onDisconnect - The callback to be triggered when this tag holder is closed\r\n * @param urlFn - A function that provides the URL of the endpoint to send data to.\r\n */\r\n function FirebaseIFrameScriptHolder(commandCB, onMessageCB, onDisconnect, urlFn) {\r\n this.onDisconnect = onDisconnect;\r\n this.urlFn = urlFn;\r\n //We maintain a count of all of the outstanding requests, because if we have too many active at once it can cause\r\n //problems in some browsers.\r\n this.outstandingRequests = new Set();\r\n //A queue of the pending segments waiting for transmission to the server.\r\n this.pendingSegs = [];\r\n //A serial number. We use this for two things:\r\n // 1) A way to ensure the browser doesn't cache responses to polls\r\n // 2) A way to make the server aware when long-polls arrive in a different order than we started them. The\r\n // server needs to release both polls in this case or it will cause problems in Opera since Opera can only execute\r\n // JSONP code in the order it was added to the iframe.\r\n this.currentSerial = Math.floor(Math.random() * 100000000);\r\n // This gets set to false when we're \"closing down\" the connection (e.g. we're switching transports but there's still\r\n // incoming data from the server that we're waiting for).\r\n this.sendNewPolls = true;\r\n if (!isNodeSdk()) {\r\n //Each script holder registers a couple of uniquely named callbacks with the window. These are called from the\r\n //iframes where we put the long-polling script tags. We have two callbacks:\r\n // 1) Command Callback - Triggered for control issues, like starting a connection.\r\n // 2) Message Callback - Triggered when new data arrives.\r\n this.uniqueCallbackIdentifier = LUIDGenerator();\r\n window[FIREBASE_LONGPOLL_COMMAND_CB_NAME + this.uniqueCallbackIdentifier] = commandCB;\r\n window[FIREBASE_LONGPOLL_DATA_CB_NAME + this.uniqueCallbackIdentifier] = onMessageCB;\r\n //Create an iframe for us to add script tags to.\r\n this.myIFrame = FirebaseIFrameScriptHolder.createIFrame_();\r\n // Set the iframe's contents.\r\n var script = '';\r\n // if we set a javascript url, it's IE and we need to set the document domain. The javascript url is sufficient\r\n // for ie9, but ie8 needs to do it again in the document itself.\r\n if (this.myIFrame.src &&\r\n this.myIFrame.src.substr(0, 'javascript:'.length) === 'javascript:') {\r\n var currentDomain = document.domain;\r\n script = '<script>document.domain=\"' + currentDomain + '\";</script>';\r\n }\r\n var iframeContents = '<html><body>' + script + '</body></html>';\r\n try {\r\n this.myIFrame.doc.open();\r\n this.myIFrame.doc.write(iframeContents);\r\n this.myIFrame.doc.close();\r\n }\r\n catch (e) {\r\n log('frame writing exception');\r\n if (e.stack) {\r\n log(e.stack);\r\n }\r\n log(e);\r\n }\r\n }\r\n else {\r\n this.commandCB = commandCB;\r\n this.onMessageCB = onMessageCB;\r\n }\r\n }\r\n /**\r\n * Each browser has its own funny way to handle iframes. Here we mush them all together into one object that I can\r\n * actually use.\r\n * @private\r\n * @return {Element}\r\n */\r\n FirebaseIFrameScriptHolder.createIFrame_ = function () {\r\n var iframe = document.createElement('iframe');\r\n iframe.style.display = 'none';\r\n // This is necessary in order to initialize the document inside the iframe\r\n if (document.body) {\r\n document.body.appendChild(iframe);\r\n try {\r\n // If document.domain has been modified in IE, this will throw an error, and we need to set the\r\n // domain of the iframe's document manually. We can do this via a javascript: url as the src attribute\r\n // Also note that we must do this *after* the iframe has been appended to the page. Otherwise it doesn't work.\r\n var a = iframe.contentWindow.document;\r\n if (!a) {\r\n // Apologies for the log-spam, I need to do something to keep closure from optimizing out the assignment above.\r\n log('No IE domain setting required');\r\n }\r\n }\r\n catch (e) {\r\n var domain = document.domain;\r\n iframe.src =\r\n \"javascript:void((function(){document.open();document.domain='\" +\r\n domain +\r\n \"';document.close();})())\";\r\n }\r\n }\r\n else {\r\n // LongPollConnection attempts to delay initialization until the document is ready, so hopefully this\r\n // never gets hit.\r\n throw 'Document body has not initialized. Wait to initialize Firebase until after the document is ready.';\r\n }\r\n // Get the document of the iframe in a browser-specific way.\r\n if (iframe.contentDocument) {\r\n iframe.doc = iframe.contentDocument; // Firefox, Opera, Safari\r\n }\r\n else if (iframe.contentWindow) {\r\n iframe.doc = iframe.contentWindow.document; // Internet Explorer\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n }\r\n else if (iframe.document) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n iframe.doc = iframe.document; //others?\r\n }\r\n return iframe;\r\n };\r\n /**\r\n * Cancel all outstanding queries and remove the frame.\r\n */\r\n FirebaseIFrameScriptHolder.prototype.close = function () {\r\n var _this = this;\r\n //Mark this iframe as dead, so no new requests are sent.\r\n this.alive = false;\r\n if (this.myIFrame) {\r\n //We have to actually remove all of the html inside this iframe before removing it from the\r\n //window, or IE will continue loading and executing the script tags we've already added, which\r\n //can lead to some errors being thrown. Setting innerHTML seems to be the easiest way to do this.\r\n this.myIFrame.doc.body.innerHTML = '';\r\n setTimeout(function () {\r\n if (_this.myIFrame !== null) {\r\n document.body.removeChild(_this.myIFrame);\r\n _this.myIFrame = null;\r\n }\r\n }, Math.floor(0));\r\n }\r\n // Protect from being called recursively.\r\n var onDisconnect = this.onDisconnect;\r\n if (onDisconnect) {\r\n this.onDisconnect = null;\r\n onDisconnect();\r\n }\r\n };\r\n /**\r\n * Actually start the long-polling session by adding the first script tag(s) to the iframe.\r\n * @param {!string} id - The ID of this connection\r\n * @param {!string} pw - The password for this connection\r\n */\r\n FirebaseIFrameScriptHolder.prototype.startLongPoll = function (id, pw) {\r\n this.myID = id;\r\n this.myPW = pw;\r\n this.alive = true;\r\n //send the initial request. If there are requests queued, make sure that we transmit as many as we are currently able to.\r\n while (this.newRequest_()) { }\r\n };\r\n /**\r\n * This is called any time someone might want a script tag to be added. It adds a script tag when there aren't\r\n * too many outstanding requests and we are still alive.\r\n *\r\n * If there are outstanding packet segments to send, it sends one. If there aren't, it sends a long-poll anyways if\r\n * needed.\r\n */\r\n FirebaseIFrameScriptHolder.prototype.newRequest_ = function () {\r\n // We keep one outstanding request open all the time to receive data, but if we need to send data\r\n // (pendingSegs.length > 0) then we create a new request to send the data. The server will automatically\r\n // close the old request.\r\n if (this.alive &&\r\n this.sendNewPolls &&\r\n this.outstandingRequests.size < (this.pendingSegs.length > 0 ? 2 : 1)) {\r\n //construct our url\r\n this.currentSerial++;\r\n var urlParams = {};\r\n urlParams[FIREBASE_LONGPOLL_ID_PARAM] = this.myID;\r\n urlParams[FIREBASE_LONGPOLL_PW_PARAM] = this.myPW;\r\n urlParams[FIREBASE_LONGPOLL_SERIAL_PARAM] = this.currentSerial;\r\n var theURL = this.urlFn(urlParams);\r\n //Now add as much data as we can.\r\n var curDataString = '';\r\n var i = 0;\r\n while (this.pendingSegs.length > 0) {\r\n //first, lets see if the next segment will fit.\r\n var nextSeg = this.pendingSegs[0];\r\n if (nextSeg.d.length +\r\n SEG_HEADER_SIZE +\r\n curDataString.length <=\r\n MAX_URL_DATA_SIZE) {\r\n //great, the segment will fit. Lets append it.\r\n var theSeg = this.pendingSegs.shift();\r\n curDataString =\r\n curDataString +\r\n '&' +\r\n FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM +\r\n i +\r\n '=' +\r\n theSeg.seg +\r\n '&' +\r\n FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET +\r\n i +\r\n '=' +\r\n theSeg.ts +\r\n '&' +\r\n FIREBASE_LONGPOLL_DATA_PARAM +\r\n i +\r\n '=' +\r\n theSeg.d;\r\n i++;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n theURL = theURL + curDataString;\r\n this.addLongPollTag_(theURL, this.currentSerial);\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n /**\r\n * Queue a packet for transmission to the server.\r\n * @param segnum - A sequential id for this packet segment used for reassembly\r\n * @param totalsegs - The total number of segments in this packet\r\n * @param data - The data for this segment.\r\n */\r\n FirebaseIFrameScriptHolder.prototype.enqueueSegment = function (segnum, totalsegs, data) {\r\n //add this to the queue of segments to send.\r\n this.pendingSegs.push({ seg: segnum, ts: totalsegs, d: data });\r\n //send the data immediately if there isn't already data being transmitted, unless\r\n //startLongPoll hasn't been called yet.\r\n if (this.alive) {\r\n this.newRequest_();\r\n }\r\n };\r\n /**\r\n * Add a script tag for a regular long-poll request.\r\n * @param {!string} url - The URL of the script tag.\r\n * @param {!number} serial - The serial number of the request.\r\n * @private\r\n */\r\n FirebaseIFrameScriptHolder.prototype.addLongPollTag_ = function (url, serial) {\r\n var _this = this;\r\n //remember that we sent this request.\r\n this.outstandingRequests.add(serial);\r\n var doNewRequest = function () {\r\n _this.outstandingRequests.delete(serial);\r\n _this.newRequest_();\r\n };\r\n // If this request doesn't return on its own accord (by the server sending us some data), we'll\r\n // create a new one after the KEEPALIVE interval to make sure we always keep a fresh request open.\r\n var keepaliveTimeout = setTimeout(doNewRequest, Math.floor(KEEPALIVE_REQUEST_INTERVAL));\r\n var readyStateCB = function () {\r\n // Request completed. Cancel the keepalive.\r\n clearTimeout(keepaliveTimeout);\r\n // Trigger a new request so we can continue receiving data.\r\n doNewRequest();\r\n };\r\n this.addTag(url, readyStateCB);\r\n };\r\n /**\r\n * Add an arbitrary script tag to the iframe.\r\n * @param {!string} url - The URL for the script tag source.\r\n * @param {!function()} loadCB - A callback to be triggered once the script has loaded.\r\n */\r\n FirebaseIFrameScriptHolder.prototype.addTag = function (url, loadCB) {\r\n var _this = this;\r\n if (isNodeSdk()) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n this.doNodeLongPoll(url, loadCB);\r\n }\r\n else {\r\n setTimeout(function () {\r\n try {\r\n // if we're already closed, don't add this poll\r\n if (!_this.sendNewPolls) {\r\n return;\r\n }\r\n var newScript_1 = _this.myIFrame.doc.createElement('script');\r\n newScript_1.type = 'text/javascript';\r\n newScript_1.async = true;\r\n newScript_1.src = url;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n newScript_1.onload = newScript_1.onreadystatechange = function () {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n var rstate = newScript_1.readyState;\r\n if (!rstate || rstate === 'loaded' || rstate === 'complete') {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n newScript_1.onload = newScript_1.onreadystatechange = null;\r\n if (newScript_1.parentNode) {\r\n newScript_1.parentNode.removeChild(newScript_1);\r\n }\r\n loadCB();\r\n }\r\n };\r\n newScript_1.onerror = function () {\r\n log('Long-poll script failed to load: ' + url);\r\n _this.sendNewPolls = false;\r\n _this.close();\r\n };\r\n _this.myIFrame.doc.body.appendChild(newScript_1);\r\n }\r\n catch (e) {\r\n // TODO: we should make this error visible somehow\r\n }\r\n }, Math.floor(1));\r\n }\r\n };\r\n return FirebaseIFrameScriptHolder;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** The semver (www.semver.org) version of the SDK. */\r\nvar SDK_VERSION = '';\r\n// SDK_VERSION should be set before any database instance is created\r\nfunction setSDKVersion(version) {\r\n SDK_VERSION = version;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar WEBSOCKET_MAX_FRAME_SIZE = 16384;\r\nvar WEBSOCKET_KEEPALIVE_INTERVAL = 45000;\r\nvar WebSocketImpl = null;\r\nif (typeof MozWebSocket !== 'undefined') {\r\n WebSocketImpl = MozWebSocket;\r\n}\r\nelse if (typeof WebSocket !== 'undefined') {\r\n WebSocketImpl = WebSocket;\r\n}\r\n/**\r\n * Create a new websocket connection with the given callbacks.\r\n * @constructor\r\n * @implements {Transport}\r\n */\r\nvar WebSocketConnection = /** @class */ (function () {\r\n /**\r\n * @param connId identifier for this transport\r\n * @param repoInfo The info for the websocket endpoint.\r\n * @param applicationId The Firebase App ID for this project.\r\n * @param transportSessionId Optional transportSessionId if this is connecting to an existing transport\r\n * session\r\n * @param lastSessionId Optional lastSessionId if there was a previous connection\r\n */\r\n function WebSocketConnection(connId, repoInfo, applicationId, transportSessionId, lastSessionId) {\r\n this.connId = connId;\r\n this.applicationId = applicationId;\r\n this.keepaliveTimer = null;\r\n this.frames = null;\r\n this.totalFrames = 0;\r\n this.bytesSent = 0;\r\n this.bytesReceived = 0;\r\n this.log_ = logWrapper(this.connId);\r\n this.stats_ = StatsManager.getCollection(repoInfo);\r\n this.connURL = WebSocketConnection.connectionURL_(repoInfo, transportSessionId, lastSessionId);\r\n this.nodeAdmin = repoInfo.nodeAdmin;\r\n }\r\n /**\r\n * @param {RepoInfo} repoInfo The info for the websocket endpoint.\r\n * @param {string=} transportSessionId Optional transportSessionId if this is connecting to an existing transport\r\n * session\r\n * @param {string=} lastSessionId Optional lastSessionId if there was a previous connection\r\n * @return {string} connection url\r\n * @private\r\n */\r\n WebSocketConnection.connectionURL_ = function (repoInfo, transportSessionId, lastSessionId) {\r\n var urlParams = {};\r\n urlParams[VERSION_PARAM] = PROTOCOL_VERSION;\r\n if (!isNodeSdk() &&\r\n typeof location !== 'undefined' &&\r\n location.href &&\r\n location.href.indexOf(FORGE_DOMAIN) !== -1) {\r\n urlParams[REFERER_PARAM] = FORGE_REF;\r\n }\r\n if (transportSessionId) {\r\n urlParams[TRANSPORT_SESSION_PARAM] = transportSessionId;\r\n }\r\n if (lastSessionId) {\r\n urlParams[LAST_SESSION_PARAM] = lastSessionId;\r\n }\r\n return repoInfo.connectionURL(WEBSOCKET, urlParams);\r\n };\r\n /**\r\n *\r\n * @param onMessage Callback when messages arrive\r\n * @param onDisconnect Callback with connection lost.\r\n */\r\n WebSocketConnection.prototype.open = function (onMessage, onDisconnect) {\r\n var _this = this;\r\n this.onDisconnect = onDisconnect;\r\n this.onMessage = onMessage;\r\n this.log_('Websocket connecting to ' + this.connURL);\r\n this.everConnected_ = false;\r\n // Assume failure until proven otherwise.\r\n PersistentStorage.set('previous_websocket_failure', true);\r\n try {\r\n if (isNodeSdk()) {\r\n var device = this.nodeAdmin ? 'AdminNode' : 'Node';\r\n // UA Format: Firebase/<wire_protocol>/<sdk_version>/<platform>/<device>\r\n var options = {\r\n headers: {\r\n 'User-Agent': \"Firebase/\" + PROTOCOL_VERSION + \"/\" + SDK_VERSION + \"/\" + process.platform + \"/\" + device,\r\n 'X-Firebase-GMPID': this.applicationId || ''\r\n }\r\n };\r\n // Plumb appropriate http_proxy environment variable into faye-websocket if it exists.\r\n var env = process['env'];\r\n var proxy = this.connURL.indexOf('wss://') === 0\r\n ? env['HTTPS_PROXY'] || env['https_proxy']\r\n : env['HTTP_PROXY'] || env['http_proxy'];\r\n if (proxy) {\r\n options['proxy'] = { origin: proxy };\r\n }\r\n this.mySock = new WebSocketImpl(this.connURL, [], options);\r\n }\r\n else {\r\n var options = {\r\n headers: {\r\n 'X-Firebase-GMPID': this.applicationId || ''\r\n }\r\n };\r\n this.mySock = new WebSocketImpl(this.connURL, [], options);\r\n }\r\n }\r\n catch (e) {\r\n this.log_('Error instantiating WebSocket.');\r\n var error = e.message || e.data;\r\n if (error) {\r\n this.log_(error);\r\n }\r\n this.onClosed_();\r\n return;\r\n }\r\n this.mySock.onopen = function () {\r\n _this.log_('Websocket connected.');\r\n _this.everConnected_ = true;\r\n };\r\n this.mySock.onclose = function () {\r\n _this.log_('Websocket connection was disconnected.');\r\n _this.mySock = null;\r\n _this.onClosed_();\r\n };\r\n this.mySock.onmessage = function (m) {\r\n _this.handleIncomingFrame(m);\r\n };\r\n this.mySock.onerror = function (e) {\r\n _this.log_('WebSocket error. Closing connection.');\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n var error = e.message || e.data;\r\n if (error) {\r\n _this.log_(error);\r\n }\r\n _this.onClosed_();\r\n };\r\n };\r\n /**\r\n * No-op for websockets, we don't need to do anything once the connection is confirmed as open\r\n */\r\n WebSocketConnection.prototype.start = function () { };\r\n WebSocketConnection.forceDisallow = function () {\r\n WebSocketConnection.forceDisallow_ = true;\r\n };\r\n WebSocketConnection.isAvailable = function () {\r\n var isOldAndroid = false;\r\n if (typeof navigator !== 'undefined' && navigator.userAgent) {\r\n var oldAndroidRegex = /Android ([0-9]{0,}\\.[0-9]{0,})/;\r\n var oldAndroidMatch = navigator.userAgent.match(oldAndroidRegex);\r\n if (oldAndroidMatch && oldAndroidMatch.length > 1) {\r\n if (parseFloat(oldAndroidMatch[1]) < 4.4) {\r\n isOldAndroid = true;\r\n }\r\n }\r\n }\r\n return (!isOldAndroid &&\r\n WebSocketImpl !== null &&\r\n !WebSocketConnection.forceDisallow_);\r\n };\r\n /**\r\n * Returns true if we previously failed to connect with this transport.\r\n * @return {boolean}\r\n */\r\n WebSocketConnection.previouslyFailed = function () {\r\n // If our persistent storage is actually only in-memory storage,\r\n // we default to assuming that it previously failed to be safe.\r\n return (PersistentStorage.isInMemoryStorage ||\r\n PersistentStorage.get('previous_websocket_failure') === true);\r\n };\r\n WebSocketConnection.prototype.markConnectionHealthy = function () {\r\n PersistentStorage.remove('previous_websocket_failure');\r\n };\r\n WebSocketConnection.prototype.appendFrame_ = function (data) {\r\n this.frames.push(data);\r\n if (this.frames.length === this.totalFrames) {\r\n var fullMess = this.frames.join('');\r\n this.frames = null;\r\n var jsonMess = jsonEval(fullMess);\r\n //handle the message\r\n this.onMessage(jsonMess);\r\n }\r\n };\r\n /**\r\n * @param {number} frameCount The number of frames we are expecting from the server\r\n * @private\r\n */\r\n WebSocketConnection.prototype.handleNewFrameCount_ = function (frameCount) {\r\n this.totalFrames = frameCount;\r\n this.frames = [];\r\n };\r\n /**\r\n * Attempts to parse a frame count out of some text. If it can't, assumes a value of 1\r\n * @param {!String} data\r\n * @return {?String} Any remaining data to be process, or null if there is none\r\n * @private\r\n */\r\n WebSocketConnection.prototype.extractFrameCount_ = function (data) {\r\n assert(this.frames === null, 'We already have a frame buffer');\r\n // TODO: The server is only supposed to send up to 9999 frames (i.e. length <= 4), but that isn't being enforced\r\n // currently. So allowing larger frame counts (length <= 6). See https://app.asana.com/0/search/8688598998380/8237608042508\r\n if (data.length <= 6) {\r\n var frameCount = Number(data);\r\n if (!isNaN(frameCount)) {\r\n this.handleNewFrameCount_(frameCount);\r\n return null;\r\n }\r\n }\r\n this.handleNewFrameCount_(1);\r\n return data;\r\n };\r\n /**\r\n * Process a websocket frame that has arrived from the server.\r\n * @param mess The frame data\r\n */\r\n WebSocketConnection.prototype.handleIncomingFrame = function (mess) {\r\n if (this.mySock === null) {\r\n return; // Chrome apparently delivers incoming packets even after we .close() the connection sometimes.\r\n }\r\n var data = mess['data'];\r\n this.bytesReceived += data.length;\r\n this.stats_.incrementCounter('bytes_received', data.length);\r\n this.resetKeepAlive();\r\n if (this.frames !== null) {\r\n // we're buffering\r\n this.appendFrame_(data);\r\n }\r\n else {\r\n // try to parse out a frame count, otherwise, assume 1 and process it\r\n var remainingData = this.extractFrameCount_(data);\r\n if (remainingData !== null) {\r\n this.appendFrame_(remainingData);\r\n }\r\n }\r\n };\r\n /**\r\n * Send a message to the server\r\n * @param {Object} data The JSON object to transmit\r\n */\r\n WebSocketConnection.prototype.send = function (data) {\r\n this.resetKeepAlive();\r\n var dataStr = stringify(data);\r\n this.bytesSent += dataStr.length;\r\n this.stats_.incrementCounter('bytes_sent', dataStr.length);\r\n //We can only fit a certain amount in each websocket frame, so we need to split this request\r\n //up into multiple pieces if it doesn't fit in one request.\r\n var dataSegs = splitStringBySize(dataStr, WEBSOCKET_MAX_FRAME_SIZE);\r\n //Send the length header\r\n if (dataSegs.length > 1) {\r\n this.sendString_(String(dataSegs.length));\r\n }\r\n //Send the actual data in segments.\r\n for (var i = 0; i < dataSegs.length; i++) {\r\n this.sendString_(dataSegs[i]);\r\n }\r\n };\r\n WebSocketConnection.prototype.shutdown_ = function () {\r\n this.isClosed_ = true;\r\n if (this.keepaliveTimer) {\r\n clearInterval(this.keepaliveTimer);\r\n this.keepaliveTimer = null;\r\n }\r\n if (this.mySock) {\r\n this.mySock.close();\r\n this.mySock = null;\r\n }\r\n };\r\n WebSocketConnection.prototype.onClosed_ = function () {\r\n if (!this.isClosed_) {\r\n this.log_('WebSocket is closing itself');\r\n this.shutdown_();\r\n // since this is an internal close, trigger the close listener\r\n if (this.onDisconnect) {\r\n this.onDisconnect(this.everConnected_);\r\n this.onDisconnect = null;\r\n }\r\n }\r\n };\r\n /**\r\n * External-facing close handler.\r\n * Close the websocket and kill the connection.\r\n */\r\n WebSocketConnection.prototype.close = function () {\r\n if (!this.isClosed_) {\r\n this.log_('WebSocket is being closed');\r\n this.shutdown_();\r\n }\r\n };\r\n /**\r\n * Kill the current keepalive timer and start a new one, to ensure that it always fires N seconds after\r\n * the last activity.\r\n */\r\n WebSocketConnection.prototype.resetKeepAlive = function () {\r\n var _this = this;\r\n clearInterval(this.keepaliveTimer);\r\n this.keepaliveTimer = setInterval(function () {\r\n //If there has been no websocket activity for a while, send a no-op\r\n if (_this.mySock) {\r\n _this.sendString_('0');\r\n }\r\n _this.resetKeepAlive();\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n }, Math.floor(WEBSOCKET_KEEPALIVE_INTERVAL));\r\n };\r\n /**\r\n * Send a string over the websocket.\r\n *\r\n * @param {string} str String to send.\r\n * @private\r\n */\r\n WebSocketConnection.prototype.sendString_ = function (str) {\r\n // Firefox seems to sometimes throw exceptions (NS_ERROR_UNEXPECTED) from websocket .send()\r\n // calls for some unknown reason. We treat these as an error and disconnect.\r\n // See https://app.asana.com/0/58926111402292/68021340250410\r\n try {\r\n this.mySock.send(str);\r\n }\r\n catch (e) {\r\n this.log_('Exception thrown from WebSocket.send():', e.message || e.data, 'Closing connection.');\r\n setTimeout(this.onClosed_.bind(this), 0);\r\n }\r\n };\r\n /**\r\n * Number of response before we consider the connection \"healthy.\"\r\n * @type {number}\r\n */\r\n WebSocketConnection.responsesRequiredToBeHealthy = 2;\r\n /**\r\n * Time to wait for the connection te become healthy before giving up.\r\n * @type {number}\r\n */\r\n WebSocketConnection.healthyTimeout = 30000;\r\n return WebSocketConnection;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Currently simplistic, this class manages what transport a Connection should use at various stages of its\r\n * lifecycle.\r\n *\r\n * It starts with longpolling in a browser, and httppolling on node. It then upgrades to websockets if\r\n * they are available.\r\n * @constructor\r\n */\r\nvar TransportManager = /** @class */ (function () {\r\n /**\r\n * @param {!RepoInfo} repoInfo Metadata around the namespace we're connecting to\r\n */\r\n function TransportManager(repoInfo) {\r\n this.initTransports_(repoInfo);\r\n }\r\n Object.defineProperty(TransportManager, \"ALL_TRANSPORTS\", {\r\n /**\r\n * @const\r\n * @type {!Array.<function(new:Transport, string, RepoInfo, string=)>}\r\n */\r\n get: function () {\r\n return [BrowserPollConnection, WebSocketConnection];\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * @param {!RepoInfo} repoInfo\r\n * @private\r\n */\r\n TransportManager.prototype.initTransports_ = function (repoInfo) {\r\n var e_1, _a;\r\n var isWebSocketsAvailable = WebSocketConnection && WebSocketConnection['isAvailable']();\r\n var isSkipPollConnection = isWebSocketsAvailable && !WebSocketConnection.previouslyFailed();\r\n if (repoInfo.webSocketOnly) {\r\n if (!isWebSocketsAvailable) {\r\n warn(\"wss:// URL used, but browser isn't known to support websockets. Trying anyway.\");\r\n }\r\n isSkipPollConnection = true;\r\n }\r\n if (isSkipPollConnection) {\r\n this.transports_ = [WebSocketConnection];\r\n }\r\n else {\r\n var transports = (this.transports_ = []);\r\n try {\r\n for (var _b = __values(TransportManager.ALL_TRANSPORTS), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var transport = _c.value;\r\n if (transport && transport['isAvailable']()) {\r\n transports.push(transport);\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n }\r\n };\r\n /**\r\n * @return {function(new:Transport, !string, !RepoInfo, string=, string=)} The constructor for the\r\n * initial transport to use\r\n */\r\n TransportManager.prototype.initialTransport = function () {\r\n if (this.transports_.length > 0) {\r\n return this.transports_[0];\r\n }\r\n else {\r\n throw new Error('No transports available');\r\n }\r\n };\r\n /**\r\n * @return {?function(new:Transport, function(),function(), string=)} The constructor for the next\r\n * transport, or null\r\n */\r\n TransportManager.prototype.upgradeTransport = function () {\r\n if (this.transports_.length > 1) {\r\n return this.transports_[1];\r\n }\r\n else {\r\n return null;\r\n }\r\n };\r\n return TransportManager;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// Abort upgrade attempt if it takes longer than 60s.\r\nvar UPGRADE_TIMEOUT = 60000;\r\n// For some transports (WebSockets), we need to \"validate\" the transport by exchanging a few requests and responses.\r\n// If we haven't sent enough requests within 5s, we'll start sending noop ping requests.\r\nvar DELAY_BEFORE_SENDING_EXTRA_REQUESTS = 5000;\r\n// If the initial data sent triggers a lot of bandwidth (i.e. it's a large put or a listen for a large amount of data)\r\n// then we may not be able to exchange our ping/pong requests within the healthy timeout. So if we reach the timeout\r\n// but we've sent/received enough bytes, we don't cancel the connection.\r\nvar BYTES_SENT_HEALTHY_OVERRIDE = 10 * 1024;\r\nvar BYTES_RECEIVED_HEALTHY_OVERRIDE = 100 * 1024;\r\nvar MESSAGE_TYPE = 't';\r\nvar MESSAGE_DATA = 'd';\r\nvar CONTROL_SHUTDOWN = 's';\r\nvar CONTROL_RESET = 'r';\r\nvar CONTROL_ERROR = 'e';\r\nvar CONTROL_PONG = 'o';\r\nvar SWITCH_ACK = 'a';\r\nvar END_TRANSMISSION = 'n';\r\nvar PING = 'p';\r\nvar SERVER_HELLO = 'h';\r\n/**\r\n * Creates a new real-time connection to the server using whichever method works\r\n * best in the current browser.\r\n *\r\n * @constructor\r\n */\r\nvar Connection = /** @class */ (function () {\r\n /**\r\n * @param id - an id for this connection\r\n * @param repoInfo_ - the info for the endpoint to connect to\r\n * @param applicationId_ - the Firebase App ID for this project\r\n * @param onMessage_ - the callback to be triggered when a server-push message arrives\r\n * @param onReady_ - the callback to be triggered when this connection is ready to send messages.\r\n * @param onDisconnect_ - the callback to be triggered when a connection was lost\r\n * @param onKill_ - the callback to be triggered when this connection has permanently shut down.\r\n * @param lastSessionId - last session id in persistent connection. is used to clean up old session in real-time server\r\n */\r\n function Connection(id, repoInfo_, applicationId_, onMessage_, onReady_, onDisconnect_, onKill_, lastSessionId) {\r\n this.id = id;\r\n this.repoInfo_ = repoInfo_;\r\n this.applicationId_ = applicationId_;\r\n this.onMessage_ = onMessage_;\r\n this.onReady_ = onReady_;\r\n this.onDisconnect_ = onDisconnect_;\r\n this.onKill_ = onKill_;\r\n this.lastSessionId = lastSessionId;\r\n this.connectionCount = 0;\r\n this.pendingDataMessages = [];\r\n this.state_ = 0 /* CONNECTING */;\r\n this.log_ = logWrapper('c:' + this.id + ':');\r\n this.transportManager_ = new TransportManager(repoInfo_);\r\n this.log_('Connection created');\r\n this.start_();\r\n }\r\n /**\r\n * Starts a connection attempt\r\n * @private\r\n */\r\n Connection.prototype.start_ = function () {\r\n var _this = this;\r\n var conn = this.transportManager_.initialTransport();\r\n this.conn_ = new conn(this.nextTransportId_(), this.repoInfo_, this.applicationId_, undefined, this.lastSessionId);\r\n // For certain transports (WebSockets), we need to send and receive several messages back and forth before we\r\n // can consider the transport healthy.\r\n this.primaryResponsesRequired_ = conn['responsesRequiredToBeHealthy'] || 0;\r\n var onMessageReceived = this.connReceiver_(this.conn_);\r\n var onConnectionLost = this.disconnReceiver_(this.conn_);\r\n this.tx_ = this.conn_;\r\n this.rx_ = this.conn_;\r\n this.secondaryConn_ = null;\r\n this.isHealthy_ = false;\r\n /*\r\n * Firefox doesn't like when code from one iframe tries to create another iframe by way of the parent frame.\r\n * This can occur in the case of a redirect, i.e. we guessed wrong on what server to connect to and received a reset.\r\n * Somehow, setTimeout seems to make this ok. That doesn't make sense from a security perspective, since you should\r\n * still have the context of your originating frame.\r\n */\r\n setTimeout(function () {\r\n // this.conn_ gets set to null in some of the tests. Check to make sure it still exists before using it\r\n _this.conn_ && _this.conn_.open(onMessageReceived, onConnectionLost);\r\n }, Math.floor(0));\r\n var healthyTimeoutMS = conn['healthyTimeout'] || 0;\r\n if (healthyTimeoutMS > 0) {\r\n this.healthyTimeout_ = setTimeoutNonBlocking(function () {\r\n _this.healthyTimeout_ = null;\r\n if (!_this.isHealthy_) {\r\n if (_this.conn_ &&\r\n _this.conn_.bytesReceived > BYTES_RECEIVED_HEALTHY_OVERRIDE) {\r\n _this.log_('Connection exceeded healthy timeout but has received ' +\r\n _this.conn_.bytesReceived +\r\n ' bytes. Marking connection healthy.');\r\n _this.isHealthy_ = true;\r\n _this.conn_.markConnectionHealthy();\r\n }\r\n else if (_this.conn_ &&\r\n _this.conn_.bytesSent > BYTES_SENT_HEALTHY_OVERRIDE) {\r\n _this.log_('Connection exceeded healthy timeout but has sent ' +\r\n _this.conn_.bytesSent +\r\n ' bytes. Leaving connection alive.');\r\n // NOTE: We don't want to mark it healthy, since we have no guarantee that the bytes have made it to\r\n // the server.\r\n }\r\n else {\r\n _this.log_('Closing unhealthy connection after timeout.');\r\n _this.close();\r\n }\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n }, Math.floor(healthyTimeoutMS));\r\n }\r\n };\r\n /**\r\n * @return {!string}\r\n * @private\r\n */\r\n Connection.prototype.nextTransportId_ = function () {\r\n return 'c:' + this.id + ':' + this.connectionCount++;\r\n };\r\n Connection.prototype.disconnReceiver_ = function (conn) {\r\n var _this = this;\r\n return function (everConnected) {\r\n if (conn === _this.conn_) {\r\n _this.onConnectionLost_(everConnected);\r\n }\r\n else if (conn === _this.secondaryConn_) {\r\n _this.log_('Secondary connection lost.');\r\n _this.onSecondaryConnectionLost_();\r\n }\r\n else {\r\n _this.log_('closing an old connection');\r\n }\r\n };\r\n };\r\n Connection.prototype.connReceiver_ = function (conn) {\r\n var _this = this;\r\n return function (message) {\r\n if (_this.state_ !== 2 /* DISCONNECTED */) {\r\n if (conn === _this.rx_) {\r\n _this.onPrimaryMessageReceived_(message);\r\n }\r\n else if (conn === _this.secondaryConn_) {\r\n _this.onSecondaryMessageReceived_(message);\r\n }\r\n else {\r\n _this.log_('message on old connection');\r\n }\r\n }\r\n };\r\n };\r\n /**\r\n *\r\n * @param {Object} dataMsg An arbitrary data message to be sent to the server\r\n */\r\n Connection.prototype.sendRequest = function (dataMsg) {\r\n // wrap in a data message envelope and send it on\r\n var msg = { t: 'd', d: dataMsg };\r\n this.sendData_(msg);\r\n };\r\n Connection.prototype.tryCleanupConnection = function () {\r\n if (this.tx_ === this.secondaryConn_ && this.rx_ === this.secondaryConn_) {\r\n this.log_('cleaning up and promoting a connection: ' + this.secondaryConn_.connId);\r\n this.conn_ = this.secondaryConn_;\r\n this.secondaryConn_ = null;\r\n // the server will shutdown the old connection\r\n }\r\n };\r\n Connection.prototype.onSecondaryControl_ = function (controlData) {\r\n if (MESSAGE_TYPE in controlData) {\r\n var cmd = controlData[MESSAGE_TYPE];\r\n if (cmd === SWITCH_ACK) {\r\n this.upgradeIfSecondaryHealthy_();\r\n }\r\n else if (cmd === CONTROL_RESET) {\r\n // Most likely the session wasn't valid. Abandon the switch attempt\r\n this.log_('Got a reset on secondary, closing it');\r\n this.secondaryConn_.close();\r\n // If we were already using this connection for something, than we need to fully close\r\n if (this.tx_ === this.secondaryConn_ ||\r\n this.rx_ === this.secondaryConn_) {\r\n this.close();\r\n }\r\n }\r\n else if (cmd === CONTROL_PONG) {\r\n this.log_('got pong on secondary.');\r\n this.secondaryResponsesRequired_--;\r\n this.upgradeIfSecondaryHealthy_();\r\n }\r\n }\r\n };\r\n Connection.prototype.onSecondaryMessageReceived_ = function (parsedData) {\r\n var layer = requireKey('t', parsedData);\r\n var data = requireKey('d', parsedData);\r\n if (layer === 'c') {\r\n this.onSecondaryControl_(data);\r\n }\r\n else if (layer === 'd') {\r\n // got a data message, but we're still second connection. Need to buffer it up\r\n this.pendingDataMessages.push(data);\r\n }\r\n else {\r\n throw new Error('Unknown protocol layer: ' + layer);\r\n }\r\n };\r\n Connection.prototype.upgradeIfSecondaryHealthy_ = function () {\r\n if (this.secondaryResponsesRequired_ <= 0) {\r\n this.log_('Secondary connection is healthy.');\r\n this.isHealthy_ = true;\r\n this.secondaryConn_.markConnectionHealthy();\r\n this.proceedWithUpgrade_();\r\n }\r\n else {\r\n // Send a ping to make sure the connection is healthy.\r\n this.log_('sending ping on secondary.');\r\n this.secondaryConn_.send({ t: 'c', d: { t: PING, d: {} } });\r\n }\r\n };\r\n Connection.prototype.proceedWithUpgrade_ = function () {\r\n // tell this connection to consider itself open\r\n this.secondaryConn_.start();\r\n // send ack\r\n this.log_('sending client ack on secondary');\r\n this.secondaryConn_.send({ t: 'c', d: { t: SWITCH_ACK, d: {} } });\r\n // send end packet on primary transport, switch to sending on this one\r\n // can receive on this one, buffer responses until end received on primary transport\r\n this.log_('Ending transmission on primary');\r\n this.conn_.send({ t: 'c', d: { t: END_TRANSMISSION, d: {} } });\r\n this.tx_ = this.secondaryConn_;\r\n this.tryCleanupConnection();\r\n };\r\n Connection.prototype.onPrimaryMessageReceived_ = function (parsedData) {\r\n // Must refer to parsedData properties in quotes, so closure doesn't touch them.\r\n var layer = requireKey('t', parsedData);\r\n var data = requireKey('d', parsedData);\r\n if (layer === 'c') {\r\n this.onControl_(data);\r\n }\r\n else if (layer === 'd') {\r\n this.onDataMessage_(data);\r\n }\r\n };\r\n Connection.prototype.onDataMessage_ = function (message) {\r\n this.onPrimaryResponse_();\r\n // We don't do anything with data messages, just kick them up a level\r\n this.onMessage_(message);\r\n };\r\n Connection.prototype.onPrimaryResponse_ = function () {\r\n if (!this.isHealthy_) {\r\n this.primaryResponsesRequired_--;\r\n if (this.primaryResponsesRequired_ <= 0) {\r\n this.log_('Primary connection is healthy.');\r\n this.isHealthy_ = true;\r\n this.conn_.markConnectionHealthy();\r\n }\r\n }\r\n };\r\n Connection.prototype.onControl_ = function (controlData) {\r\n var cmd = requireKey(MESSAGE_TYPE, controlData);\r\n if (MESSAGE_DATA in controlData) {\r\n var payload = controlData[MESSAGE_DATA];\r\n if (cmd === SERVER_HELLO) {\r\n this.onHandshake_(payload);\r\n }\r\n else if (cmd === END_TRANSMISSION) {\r\n this.log_('recvd end transmission on primary');\r\n this.rx_ = this.secondaryConn_;\r\n for (var i = 0; i < this.pendingDataMessages.length; ++i) {\r\n this.onDataMessage_(this.pendingDataMessages[i]);\r\n }\r\n this.pendingDataMessages = [];\r\n this.tryCleanupConnection();\r\n }\r\n else if (cmd === CONTROL_SHUTDOWN) {\r\n // This was previously the 'onKill' callback passed to the lower-level connection\r\n // payload in this case is the reason for the shutdown. Generally a human-readable error\r\n this.onConnectionShutdown_(payload);\r\n }\r\n else if (cmd === CONTROL_RESET) {\r\n // payload in this case is the host we should contact\r\n this.onReset_(payload);\r\n }\r\n else if (cmd === CONTROL_ERROR) {\r\n error('Server Error: ' + payload);\r\n }\r\n else if (cmd === CONTROL_PONG) {\r\n this.log_('got pong on primary.');\r\n this.onPrimaryResponse_();\r\n this.sendPingOnPrimaryIfNecessary_();\r\n }\r\n else {\r\n error('Unknown control packet command: ' + cmd);\r\n }\r\n }\r\n };\r\n /**\r\n *\r\n * @param {Object} handshake The handshake data returned from the server\r\n * @private\r\n */\r\n Connection.prototype.onHandshake_ = function (handshake) {\r\n var timestamp = handshake.ts;\r\n var version = handshake.v;\r\n var host = handshake.h;\r\n this.sessionId = handshake.s;\r\n this.repoInfo_.updateHost(host);\r\n // if we've already closed the connection, then don't bother trying to progress further\r\n if (this.state_ === 0 /* CONNECTING */) {\r\n this.conn_.start();\r\n this.onConnectionEstablished_(this.conn_, timestamp);\r\n if (PROTOCOL_VERSION !== version) {\r\n warn('Protocol version mismatch detected');\r\n }\r\n // TODO: do we want to upgrade? when? maybe a delay?\r\n this.tryStartUpgrade_();\r\n }\r\n };\r\n Connection.prototype.tryStartUpgrade_ = function () {\r\n var conn = this.transportManager_.upgradeTransport();\r\n if (conn) {\r\n this.startUpgrade_(conn);\r\n }\r\n };\r\n Connection.prototype.startUpgrade_ = function (conn) {\r\n var _this = this;\r\n this.secondaryConn_ = new conn(this.nextTransportId_(), this.repoInfo_, this.applicationId_, this.sessionId);\r\n // For certain transports (WebSockets), we need to send and receive several messages back and forth before we\r\n // can consider the transport healthy.\r\n this.secondaryResponsesRequired_ =\r\n conn['responsesRequiredToBeHealthy'] || 0;\r\n var onMessage = this.connReceiver_(this.secondaryConn_);\r\n var onDisconnect = this.disconnReceiver_(this.secondaryConn_);\r\n this.secondaryConn_.open(onMessage, onDisconnect);\r\n // If we haven't successfully upgraded after UPGRADE_TIMEOUT, give up and kill the secondary.\r\n setTimeoutNonBlocking(function () {\r\n if (_this.secondaryConn_) {\r\n _this.log_('Timed out trying to upgrade.');\r\n _this.secondaryConn_.close();\r\n }\r\n }, Math.floor(UPGRADE_TIMEOUT));\r\n };\r\n Connection.prototype.onReset_ = function (host) {\r\n this.log_('Reset packet received. New host: ' + host);\r\n this.repoInfo_.updateHost(host);\r\n // TODO: if we're already \"connected\", we need to trigger a disconnect at the next layer up.\r\n // We don't currently support resets after the connection has already been established\r\n if (this.state_ === 1 /* CONNECTED */) {\r\n this.close();\r\n }\r\n else {\r\n // Close whatever connections we have open and start again.\r\n this.closeConnections_();\r\n this.start_();\r\n }\r\n };\r\n Connection.prototype.onConnectionEstablished_ = function (conn, timestamp) {\r\n var _this = this;\r\n this.log_('Realtime connection established.');\r\n this.conn_ = conn;\r\n this.state_ = 1 /* CONNECTED */;\r\n if (this.onReady_) {\r\n this.onReady_(timestamp, this.sessionId);\r\n this.onReady_ = null;\r\n }\r\n // If after 5 seconds we haven't sent enough requests to the server to get the connection healthy,\r\n // send some pings.\r\n if (this.primaryResponsesRequired_ === 0) {\r\n this.log_('Primary connection is healthy.');\r\n this.isHealthy_ = true;\r\n }\r\n else {\r\n setTimeoutNonBlocking(function () {\r\n _this.sendPingOnPrimaryIfNecessary_();\r\n }, Math.floor(DELAY_BEFORE_SENDING_EXTRA_REQUESTS));\r\n }\r\n };\r\n Connection.prototype.sendPingOnPrimaryIfNecessary_ = function () {\r\n // If the connection isn't considered healthy yet, we'll send a noop ping packet request.\r\n if (!this.isHealthy_ && this.state_ === 1 /* CONNECTED */) {\r\n this.log_('sending ping on primary.');\r\n this.sendData_({ t: 'c', d: { t: PING, d: {} } });\r\n }\r\n };\r\n Connection.prototype.onSecondaryConnectionLost_ = function () {\r\n var conn = this.secondaryConn_;\r\n this.secondaryConn_ = null;\r\n if (this.tx_ === conn || this.rx_ === conn) {\r\n // we are relying on this connection already in some capacity. Therefore, a failure is real\r\n this.close();\r\n }\r\n };\r\n /**\r\n *\r\n * @param {boolean} everConnected Whether or not the connection ever reached a server. Used to determine if\r\n * we should flush the host cache\r\n * @private\r\n */\r\n Connection.prototype.onConnectionLost_ = function (everConnected) {\r\n this.conn_ = null;\r\n // NOTE: IF you're seeing a Firefox error for this line, I think it might be because it's getting\r\n // called on window close and RealtimeState.CONNECTING is no longer defined. Just a guess.\r\n if (!everConnected && this.state_ === 0 /* CONNECTING */) {\r\n this.log_('Realtime connection failed.');\r\n // Since we failed to connect at all, clear any cached entry for this namespace in case the machine went away\r\n if (this.repoInfo_.isCacheableHost()) {\r\n PersistentStorage.remove('host:' + this.repoInfo_.host);\r\n // reset the internal host to what we would show the user, i.e. <ns>.firebaseio.com\r\n this.repoInfo_.internalHost = this.repoInfo_.host;\r\n }\r\n }\r\n else if (this.state_ === 1 /* CONNECTED */) {\r\n this.log_('Realtime connection lost.');\r\n }\r\n this.close();\r\n };\r\n /**\r\n *\r\n * @param {string} reason\r\n * @private\r\n */\r\n Connection.prototype.onConnectionShutdown_ = function (reason) {\r\n this.log_('Connection shutdown command received. Shutting down...');\r\n if (this.onKill_) {\r\n this.onKill_(reason);\r\n this.onKill_ = null;\r\n }\r\n // We intentionally don't want to fire onDisconnect (kill is a different case),\r\n // so clear the callback.\r\n this.onDisconnect_ = null;\r\n this.close();\r\n };\r\n Connection.prototype.sendData_ = function (data) {\r\n if (this.state_ !== 1 /* CONNECTED */) {\r\n throw 'Connection is not connected';\r\n }\r\n else {\r\n this.tx_.send(data);\r\n }\r\n };\r\n /**\r\n * Cleans up this connection, calling the appropriate callbacks\r\n */\r\n Connection.prototype.close = function () {\r\n if (this.state_ !== 2 /* DISCONNECTED */) {\r\n this.log_('Closing realtime connection.');\r\n this.state_ = 2 /* DISCONNECTED */;\r\n this.closeConnections_();\r\n if (this.onDisconnect_) {\r\n this.onDisconnect_();\r\n this.onDisconnect_ = null;\r\n }\r\n }\r\n };\r\n /**\r\n *\r\n * @private\r\n */\r\n Connection.prototype.closeConnections_ = function () {\r\n this.log_('Shutting down all connections');\r\n if (this.conn_) {\r\n this.conn_.close();\r\n this.conn_ = null;\r\n }\r\n if (this.secondaryConn_) {\r\n this.secondaryConn_.close();\r\n this.secondaryConn_ = null;\r\n }\r\n if (this.healthyTimeout_) {\r\n clearTimeout(this.healthyTimeout_);\r\n this.healthyTimeout_ = null;\r\n }\r\n };\r\n return Connection;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Interface defining the set of actions that can be performed against the Firebase server\r\n * (basically corresponds to our wire protocol).\r\n *\r\n * @interface\r\n */\r\nvar ServerActions = /** @class */ (function () {\r\n function ServerActions() {\r\n }\r\n /**\r\n * @param {string} pathString\r\n * @param {*} data\r\n * @param {function(string, string)=} onComplete\r\n * @param {string=} hash\r\n */\r\n ServerActions.prototype.put = function (pathString, data, onComplete, hash) { };\r\n /**\r\n * @param {string} pathString\r\n * @param {*} data\r\n * @param {function(string, ?string)} onComplete\r\n * @param {string=} hash\r\n */\r\n ServerActions.prototype.merge = function (pathString, data, onComplete, hash) { };\r\n /**\r\n * Refreshes the auth token for the current connection.\r\n * @param {string} token The authentication token\r\n */\r\n ServerActions.prototype.refreshAuthToken = function (token) { };\r\n /**\r\n * @param {string} pathString\r\n * @param {*} data\r\n * @param {function(string, string)=} onComplete\r\n */\r\n ServerActions.prototype.onDisconnectPut = function (pathString, data, onComplete) { };\r\n /**\r\n * @param {string} pathString\r\n * @param {*} data\r\n * @param {function(string, string)=} onComplete\r\n */\r\n ServerActions.prototype.onDisconnectMerge = function (pathString, data, onComplete) { };\r\n /**\r\n * @param {string} pathString\r\n * @param {function(string, string)=} onComplete\r\n */\r\n ServerActions.prototype.onDisconnectCancel = function (pathString, onComplete) { };\r\n /**\r\n * @param {Object.<string, *>} stats\r\n */\r\n ServerActions.prototype.reportStats = function (stats) { };\r\n return ServerActions;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar RECONNECT_MIN_DELAY = 1000;\r\nvar RECONNECT_MAX_DELAY_DEFAULT = 60 * 5 * 1000; // 5 minutes in milliseconds (Case: 1858)\r\nvar RECONNECT_MAX_DELAY_FOR_ADMINS = 30 * 1000; // 30 seconds for admin clients (likely to be a backend server)\r\nvar RECONNECT_DELAY_MULTIPLIER = 1.3;\r\nvar RECONNECT_DELAY_RESET_TIMEOUT = 30000; // Reset delay back to MIN_DELAY after being connected for 30sec.\r\nvar SERVER_KILL_INTERRUPT_REASON = 'server_kill';\r\n// If auth fails repeatedly, we'll assume something is wrong and log a warning / back off.\r\nvar INVALID_AUTH_TOKEN_THRESHOLD = 3;\r\n/**\r\n * Firebase connection. Abstracts wire protocol and handles reconnecting.\r\n *\r\n * NOTE: All JSON objects sent to the realtime connection must have property names enclosed\r\n * in quotes to make sure the closure compiler does not minify them.\r\n */\r\nvar PersistentConnection = /** @class */ (function (_super) {\r\n __extends(PersistentConnection, _super);\r\n /**\r\n * @implements {ServerActions}\r\n * @param repoInfo_ Data about the namespace we are connecting to\r\n * @param applicationId_ The Firebase App ID for this project\r\n * @param onDataUpdate_ A callback for new data from the server\r\n */\r\n function PersistentConnection(repoInfo_, applicationId_, onDataUpdate_, onConnectStatus_, onServerInfoUpdate_, authTokenProvider_, authOverride_) {\r\n var _this = _super.call(this) || this;\r\n _this.repoInfo_ = repoInfo_;\r\n _this.applicationId_ = applicationId_;\r\n _this.onDataUpdate_ = onDataUpdate_;\r\n _this.onConnectStatus_ = onConnectStatus_;\r\n _this.onServerInfoUpdate_ = onServerInfoUpdate_;\r\n _this.authTokenProvider_ = authTokenProvider_;\r\n _this.authOverride_ = authOverride_;\r\n // Used for diagnostic logging.\r\n _this.id = PersistentConnection.nextPersistentConnectionId_++;\r\n _this.log_ = logWrapper('p:' + _this.id + ':');\r\n _this.interruptReasons_ = {};\r\n /** Map<path, Map<queryId, ListenSpec>> */\r\n _this.listens = new Map();\r\n _this.outstandingPuts_ = [];\r\n _this.outstandingPutCount_ = 0;\r\n _this.onDisconnectRequestQueue_ = [];\r\n _this.connected_ = false;\r\n _this.reconnectDelay_ = RECONNECT_MIN_DELAY;\r\n _this.maxReconnectDelay_ = RECONNECT_MAX_DELAY_DEFAULT;\r\n _this.securityDebugCallback_ = null;\r\n _this.lastSessionId = null;\r\n _this.establishConnectionTimer_ = null;\r\n _this.visible_ = false;\r\n // Before we get connected, we keep a queue of pending messages to send.\r\n _this.requestCBHash_ = {};\r\n _this.requestNumber_ = 0;\r\n _this.realtime_ = null;\r\n _this.authToken_ = null;\r\n _this.forceTokenRefresh_ = false;\r\n _this.invalidAuthTokenCount_ = 0;\r\n _this.firstConnection_ = true;\r\n _this.lastConnectionAttemptTime_ = null;\r\n _this.lastConnectionEstablishedTime_ = null;\r\n if (authOverride_ && !isNodeSdk()) {\r\n throw new Error('Auth override specified in options, but not supported on non Node.js platforms');\r\n }\r\n _this.scheduleConnect_(0);\r\n VisibilityMonitor.getInstance().on('visible', _this.onVisible_, _this);\r\n if (repoInfo_.host.indexOf('fblocal') === -1) {\r\n OnlineMonitor.getInstance().on('online', _this.onOnline_, _this);\r\n }\r\n return _this;\r\n }\r\n PersistentConnection.prototype.sendRequest = function (action, body, onResponse) {\r\n var curReqNum = ++this.requestNumber_;\r\n var msg = { r: curReqNum, a: action, b: body };\r\n this.log_(stringify(msg));\r\n assert(this.connected_, \"sendRequest call when we're not connected not allowed.\");\r\n this.realtime_.sendRequest(msg);\r\n if (onResponse) {\r\n this.requestCBHash_[curReqNum] = onResponse;\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PersistentConnection.prototype.listen = function (query, currentHashFn, tag, onComplete) {\r\n var queryId = query.queryIdentifier();\r\n var pathString = query.path.toString();\r\n this.log_('Listen called for ' + pathString + ' ' + queryId);\r\n if (!this.listens.has(pathString)) {\r\n this.listens.set(pathString, new Map());\r\n }\r\n assert(query.getQueryParams().isDefault() ||\r\n !query.getQueryParams().loadsAllData(), 'listen() called for non-default but complete query');\r\n assert(!this.listens.get(pathString).has(queryId), 'listen() called twice for same path/queryId.');\r\n var listenSpec = {\r\n onComplete: onComplete,\r\n hashFn: currentHashFn,\r\n query: query,\r\n tag: tag\r\n };\r\n this.listens.get(pathString).set(queryId, listenSpec);\r\n if (this.connected_) {\r\n this.sendListen_(listenSpec);\r\n }\r\n };\r\n PersistentConnection.prototype.sendListen_ = function (listenSpec) {\r\n var _this = this;\r\n var query = listenSpec.query;\r\n var pathString = query.path.toString();\r\n var queryId = query.queryIdentifier();\r\n this.log_('Listen on ' + pathString + ' for ' + queryId);\r\n var req = { /*path*/ p: pathString };\r\n var action = 'q';\r\n // Only bother to send query if it's non-default.\r\n if (listenSpec.tag) {\r\n req['q'] = query.queryObject();\r\n req['t'] = listenSpec.tag;\r\n }\r\n req[ /*hash*/'h'] = listenSpec.hashFn();\r\n this.sendRequest(action, req, function (message) {\r\n var payload = message[ /*data*/'d'];\r\n var status = message[ /*status*/'s'];\r\n // print warnings in any case...\r\n PersistentConnection.warnOnListenWarnings_(payload, query);\r\n var currentListenSpec = _this.listens.get(pathString) &&\r\n _this.listens.get(pathString).get(queryId);\r\n // only trigger actions if the listen hasn't been removed and readded\r\n if (currentListenSpec === listenSpec) {\r\n _this.log_('listen response', message);\r\n if (status !== 'ok') {\r\n _this.removeListen_(pathString, queryId);\r\n }\r\n if (listenSpec.onComplete) {\r\n listenSpec.onComplete(status, payload);\r\n }\r\n }\r\n });\r\n };\r\n PersistentConnection.warnOnListenWarnings_ = function (payload, query) {\r\n if (payload && typeof payload === 'object' && contains(payload, 'w')) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n var warnings = safeGet(payload, 'w');\r\n if (Array.isArray(warnings) && ~warnings.indexOf('no_index')) {\r\n var indexSpec = '\".indexOn\": \"' + query.getQueryParams().getIndex().toString() + '\"';\r\n var indexPath = query.path.toString();\r\n warn(\"Using an unspecified index. Your data will be downloaded and \" +\r\n (\"filtered on the client. Consider adding \" + indexSpec + \" at \") +\r\n (indexPath + \" to your security rules for better performance.\"));\r\n }\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PersistentConnection.prototype.refreshAuthToken = function (token) {\r\n this.authToken_ = token;\r\n this.log_('Auth token refreshed');\r\n if (this.authToken_) {\r\n this.tryAuth();\r\n }\r\n else {\r\n //If we're connected we want to let the server know to unauthenticate us. If we're not connected, simply delete\r\n //the credential so we dont become authenticated next time we connect.\r\n if (this.connected_) {\r\n this.sendRequest('unauth', {}, function () { });\r\n }\r\n }\r\n this.reduceReconnectDelayIfAdminCredential_(token);\r\n };\r\n PersistentConnection.prototype.reduceReconnectDelayIfAdminCredential_ = function (credential) {\r\n // NOTE: This isn't intended to be bulletproof (a malicious developer can always just modify the client).\r\n // Additionally, we don't bother resetting the max delay back to the default if auth fails / expires.\r\n var isFirebaseSecret = credential && credential.length === 40;\r\n if (isFirebaseSecret || isAdmin(credential)) {\r\n this.log_('Admin auth credential detected. Reducing max reconnect time.');\r\n this.maxReconnectDelay_ = RECONNECT_MAX_DELAY_FOR_ADMINS;\r\n }\r\n };\r\n /**\r\n * Attempts to authenticate with the given credentials. If the authentication attempt fails, it's triggered like\r\n * a auth revoked (the connection is closed).\r\n */\r\n PersistentConnection.prototype.tryAuth = function () {\r\n var _this = this;\r\n if (this.connected_ && this.authToken_) {\r\n var token_1 = this.authToken_;\r\n var authMethod = isValidFormat(token_1) ? 'auth' : 'gauth';\r\n var requestData = { cred: token_1 };\r\n if (this.authOverride_ === null) {\r\n requestData['noauth'] = true;\r\n }\r\n else if (typeof this.authOverride_ === 'object') {\r\n requestData['authvar'] = this.authOverride_;\r\n }\r\n this.sendRequest(authMethod, requestData, function (res) {\r\n var status = res[ /*status*/'s'];\r\n var data = res[ /*data*/'d'] || 'error';\r\n if (_this.authToken_ === token_1) {\r\n if (status === 'ok') {\r\n _this.invalidAuthTokenCount_ = 0;\r\n }\r\n else {\r\n // Triggers reconnect and force refresh for auth token\r\n _this.onAuthRevoked_(status, data);\r\n }\r\n }\r\n });\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PersistentConnection.prototype.unlisten = function (query, tag) {\r\n var pathString = query.path.toString();\r\n var queryId = query.queryIdentifier();\r\n this.log_('Unlisten called for ' + pathString + ' ' + queryId);\r\n assert(query.getQueryParams().isDefault() ||\r\n !query.getQueryParams().loadsAllData(), 'unlisten() called for non-default but complete query');\r\n var listen = this.removeListen_(pathString, queryId);\r\n if (listen && this.connected_) {\r\n this.sendUnlisten_(pathString, queryId, query.queryObject(), tag);\r\n }\r\n };\r\n PersistentConnection.prototype.sendUnlisten_ = function (pathString, queryId, queryObj, tag) {\r\n this.log_('Unlisten on ' + pathString + ' for ' + queryId);\r\n var req = { /*path*/ p: pathString };\r\n var action = 'n';\r\n // Only bother sending queryId if it's non-default.\r\n if (tag) {\r\n req['q'] = queryObj;\r\n req['t'] = tag;\r\n }\r\n this.sendRequest(action, req);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PersistentConnection.prototype.onDisconnectPut = function (pathString, data, onComplete) {\r\n if (this.connected_) {\r\n this.sendOnDisconnect_('o', pathString, data, onComplete);\r\n }\r\n else {\r\n this.onDisconnectRequestQueue_.push({\r\n pathString: pathString,\r\n action: 'o',\r\n data: data,\r\n onComplete: onComplete\r\n });\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PersistentConnection.prototype.onDisconnectMerge = function (pathString, data, onComplete) {\r\n if (this.connected_) {\r\n this.sendOnDisconnect_('om', pathString, data, onComplete);\r\n }\r\n else {\r\n this.onDisconnectRequestQueue_.push({\r\n pathString: pathString,\r\n action: 'om',\r\n data: data,\r\n onComplete: onComplete\r\n });\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PersistentConnection.prototype.onDisconnectCancel = function (pathString, onComplete) {\r\n if (this.connected_) {\r\n this.sendOnDisconnect_('oc', pathString, null, onComplete);\r\n }\r\n else {\r\n this.onDisconnectRequestQueue_.push({\r\n pathString: pathString,\r\n action: 'oc',\r\n data: null,\r\n onComplete: onComplete\r\n });\r\n }\r\n };\r\n PersistentConnection.prototype.sendOnDisconnect_ = function (action, pathString, data, onComplete) {\r\n var request = { /*path*/ p: pathString, /*data*/ d: data };\r\n this.log_('onDisconnect ' + action, request);\r\n this.sendRequest(action, request, function (response) {\r\n if (onComplete) {\r\n setTimeout(function () {\r\n onComplete(response[ /*status*/'s'], response[ /* data */'d']);\r\n }, Math.floor(0));\r\n }\r\n });\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PersistentConnection.prototype.put = function (pathString, data, onComplete, hash) {\r\n this.putInternal('p', pathString, data, onComplete, hash);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PersistentConnection.prototype.merge = function (pathString, data, onComplete, hash) {\r\n this.putInternal('m', pathString, data, onComplete, hash);\r\n };\r\n PersistentConnection.prototype.putInternal = function (action, pathString, data, onComplete, hash) {\r\n var request = {\r\n /*path*/ p: pathString,\r\n /*data*/ d: data\r\n };\r\n if (hash !== undefined) {\r\n request[ /*hash*/'h'] = hash;\r\n }\r\n // TODO: Only keep track of the most recent put for a given path?\r\n this.outstandingPuts_.push({\r\n action: action,\r\n request: request,\r\n onComplete: onComplete\r\n });\r\n this.outstandingPutCount_++;\r\n var index = this.outstandingPuts_.length - 1;\r\n if (this.connected_) {\r\n this.sendPut_(index);\r\n }\r\n else {\r\n this.log_('Buffering put: ' + pathString);\r\n }\r\n };\r\n PersistentConnection.prototype.sendPut_ = function (index) {\r\n var _this = this;\r\n var action = this.outstandingPuts_[index].action;\r\n var request = this.outstandingPuts_[index].request;\r\n var onComplete = this.outstandingPuts_[index].onComplete;\r\n this.outstandingPuts_[index].queued = this.connected_;\r\n this.sendRequest(action, request, function (message) {\r\n _this.log_(action + ' response', message);\r\n delete _this.outstandingPuts_[index];\r\n _this.outstandingPutCount_--;\r\n // Clean up array occasionally.\r\n if (_this.outstandingPutCount_ === 0) {\r\n _this.outstandingPuts_ = [];\r\n }\r\n if (onComplete) {\r\n onComplete(message[ /*status*/'s'], message[ /* data */'d']);\r\n }\r\n });\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n PersistentConnection.prototype.reportStats = function (stats) {\r\n var _this = this;\r\n // If we're not connected, we just drop the stats.\r\n if (this.connected_) {\r\n var request = { /*counters*/ c: stats };\r\n this.log_('reportStats', request);\r\n this.sendRequest(/*stats*/ 's', request, function (result) {\r\n var status = result[ /*status*/'s'];\r\n if (status !== 'ok') {\r\n var errorReason = result[ /* data */'d'];\r\n _this.log_('reportStats', 'Error sending stats: ' + errorReason);\r\n }\r\n });\r\n }\r\n };\r\n PersistentConnection.prototype.onDataMessage_ = function (message) {\r\n if ('r' in message) {\r\n // this is a response\r\n this.log_('from server: ' + stringify(message));\r\n var reqNum = message['r'];\r\n var onResponse = this.requestCBHash_[reqNum];\r\n if (onResponse) {\r\n delete this.requestCBHash_[reqNum];\r\n onResponse(message[ /*body*/'b']);\r\n }\r\n }\r\n else if ('error' in message) {\r\n throw 'A server-side error has occurred: ' + message['error'];\r\n }\r\n else if ('a' in message) {\r\n // a and b are action and body, respectively\r\n this.onDataPush_(message['a'], message['b']);\r\n }\r\n };\r\n PersistentConnection.prototype.onDataPush_ = function (action, body) {\r\n this.log_('handleServerMessage', action, body);\r\n if (action === 'd') {\r\n this.onDataUpdate_(body[ /*path*/'p'], body[ /*data*/'d'], \r\n /*isMerge*/ false, body['t']);\r\n }\r\n else if (action === 'm') {\r\n this.onDataUpdate_(body[ /*path*/'p'], body[ /*data*/'d'], \r\n /*isMerge=*/ true, body['t']);\r\n }\r\n else if (action === 'c') {\r\n this.onListenRevoked_(body[ /*path*/'p'], body[ /*query*/'q']);\r\n }\r\n else if (action === 'ac') {\r\n this.onAuthRevoked_(body[ /*status code*/'s'], body[ /* explanation */'d']);\r\n }\r\n else if (action === 'sd') {\r\n this.onSecurityDebugPacket_(body);\r\n }\r\n else {\r\n error('Unrecognized action received from server: ' +\r\n stringify(action) +\r\n '\\nAre you using the latest client?');\r\n }\r\n };\r\n PersistentConnection.prototype.onReady_ = function (timestamp, sessionId) {\r\n this.log_('connection ready');\r\n this.connected_ = true;\r\n this.lastConnectionEstablishedTime_ = new Date().getTime();\r\n this.handleTimestamp_(timestamp);\r\n this.lastSessionId = sessionId;\r\n if (this.firstConnection_) {\r\n this.sendConnectStats_();\r\n }\r\n this.restoreState_();\r\n this.firstConnection_ = false;\r\n this.onConnectStatus_(true);\r\n };\r\n PersistentConnection.prototype.scheduleConnect_ = function (timeout) {\r\n var _this = this;\r\n assert(!this.realtime_, \"Scheduling a connect when we're already connected/ing?\");\r\n if (this.establishConnectionTimer_) {\r\n clearTimeout(this.establishConnectionTimer_);\r\n }\r\n // NOTE: Even when timeout is 0, it's important to do a setTimeout to work around an infuriating \"Security Error\" in\r\n // Firefox when trying to write to our long-polling iframe in some scenarios (e.g. Forge or our unit tests).\r\n this.establishConnectionTimer_ = setTimeout(function () {\r\n _this.establishConnectionTimer_ = null;\r\n _this.establishConnection_();\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n }, Math.floor(timeout));\r\n };\r\n PersistentConnection.prototype.onVisible_ = function (visible) {\r\n // NOTE: Tabbing away and back to a window will defeat our reconnect backoff, but I think that's fine.\r\n if (visible &&\r\n !this.visible_ &&\r\n this.reconnectDelay_ === this.maxReconnectDelay_) {\r\n this.log_('Window became visible. Reducing delay.');\r\n this.reconnectDelay_ = RECONNECT_MIN_DELAY;\r\n if (!this.realtime_) {\r\n this.scheduleConnect_(0);\r\n }\r\n }\r\n this.visible_ = visible;\r\n };\r\n PersistentConnection.prototype.onOnline_ = function (online) {\r\n if (online) {\r\n this.log_('Browser went online.');\r\n this.reconnectDelay_ = RECONNECT_MIN_DELAY;\r\n if (!this.realtime_) {\r\n this.scheduleConnect_(0);\r\n }\r\n }\r\n else {\r\n this.log_('Browser went offline. Killing connection.');\r\n if (this.realtime_) {\r\n this.realtime_.close();\r\n }\r\n }\r\n };\r\n PersistentConnection.prototype.onRealtimeDisconnect_ = function () {\r\n this.log_('data client disconnected');\r\n this.connected_ = false;\r\n this.realtime_ = null;\r\n // Since we don't know if our sent transactions succeeded or not, we need to cancel them.\r\n this.cancelSentTransactions_();\r\n // Clear out the pending requests.\r\n this.requestCBHash_ = {};\r\n if (this.shouldReconnect_()) {\r\n if (!this.visible_) {\r\n this.log_(\"Window isn't visible. Delaying reconnect.\");\r\n this.reconnectDelay_ = this.maxReconnectDelay_;\r\n this.lastConnectionAttemptTime_ = new Date().getTime();\r\n }\r\n else if (this.lastConnectionEstablishedTime_) {\r\n // If we've been connected long enough, reset reconnect delay to minimum.\r\n var timeSinceLastConnectSucceeded = new Date().getTime() - this.lastConnectionEstablishedTime_;\r\n if (timeSinceLastConnectSucceeded > RECONNECT_DELAY_RESET_TIMEOUT) {\r\n this.reconnectDelay_ = RECONNECT_MIN_DELAY;\r\n }\r\n this.lastConnectionEstablishedTime_ = null;\r\n }\r\n var timeSinceLastConnectAttempt = new Date().getTime() - this.lastConnectionAttemptTime_;\r\n var reconnectDelay = Math.max(0, this.reconnectDelay_ - timeSinceLastConnectAttempt);\r\n reconnectDelay = Math.random() * reconnectDelay;\r\n this.log_('Trying to reconnect in ' + reconnectDelay + 'ms');\r\n this.scheduleConnect_(reconnectDelay);\r\n // Adjust reconnect delay for next time.\r\n this.reconnectDelay_ = Math.min(this.maxReconnectDelay_, this.reconnectDelay_ * RECONNECT_DELAY_MULTIPLIER);\r\n }\r\n this.onConnectStatus_(false);\r\n };\r\n PersistentConnection.prototype.establishConnection_ = function () {\r\n var _this = this;\r\n if (this.shouldReconnect_()) {\r\n this.log_('Making a connection attempt');\r\n this.lastConnectionAttemptTime_ = new Date().getTime();\r\n this.lastConnectionEstablishedTime_ = null;\r\n var onDataMessage_1 = this.onDataMessage_.bind(this);\r\n var onReady_1 = this.onReady_.bind(this);\r\n var onDisconnect_1 = this.onRealtimeDisconnect_.bind(this);\r\n var connId_1 = this.id + ':' + PersistentConnection.nextConnectionId_++;\r\n var self_1 = this;\r\n var lastSessionId_1 = this.lastSessionId;\r\n var canceled_1 = false;\r\n var connection_1 = null;\r\n var closeFn_1 = function () {\r\n if (connection_1) {\r\n connection_1.close();\r\n }\r\n else {\r\n canceled_1 = true;\r\n onDisconnect_1();\r\n }\r\n };\r\n var sendRequestFn = function (msg) {\r\n assert(connection_1, \"sendRequest call when we're not connected not allowed.\");\r\n connection_1.sendRequest(msg);\r\n };\r\n this.realtime_ = {\r\n close: closeFn_1,\r\n sendRequest: sendRequestFn\r\n };\r\n var forceRefresh = this.forceTokenRefresh_;\r\n this.forceTokenRefresh_ = false;\r\n // First fetch auth token, and establish connection after fetching the token was successful\r\n this.authTokenProvider_\r\n .getToken(forceRefresh)\r\n .then(function (result) {\r\n if (!canceled_1) {\r\n log('getToken() completed. Creating connection.');\r\n self_1.authToken_ = result && result.accessToken;\r\n connection_1 = new Connection(connId_1, self_1.repoInfo_, self_1.applicationId_, onDataMessage_1, onReady_1, onDisconnect_1, \r\n /* onKill= */ function (reason) {\r\n warn(reason + ' (' + self_1.repoInfo_.toString() + ')');\r\n self_1.interrupt(SERVER_KILL_INTERRUPT_REASON);\r\n }, lastSessionId_1);\r\n }\r\n else {\r\n log('getToken() completed but was canceled');\r\n }\r\n })\r\n .then(null, function (error) {\r\n self_1.log_('Failed to get token: ' + error);\r\n if (!canceled_1) {\r\n if (_this.repoInfo_.nodeAdmin) {\r\n // This may be a critical error for the Admin Node.js SDK, so log a warning.\r\n // But getToken() may also just have temporarily failed, so we still want to\r\n // continue retrying.\r\n warn(error);\r\n }\r\n closeFn_1();\r\n }\r\n });\r\n }\r\n };\r\n PersistentConnection.prototype.interrupt = function (reason) {\r\n log('Interrupting connection for reason: ' + reason);\r\n this.interruptReasons_[reason] = true;\r\n if (this.realtime_) {\r\n this.realtime_.close();\r\n }\r\n else {\r\n if (this.establishConnectionTimer_) {\r\n clearTimeout(this.establishConnectionTimer_);\r\n this.establishConnectionTimer_ = null;\r\n }\r\n if (this.connected_) {\r\n this.onRealtimeDisconnect_();\r\n }\r\n }\r\n };\r\n PersistentConnection.prototype.resume = function (reason) {\r\n log('Resuming connection for reason: ' + reason);\r\n delete this.interruptReasons_[reason];\r\n if (isEmpty(this.interruptReasons_)) {\r\n this.reconnectDelay_ = RECONNECT_MIN_DELAY;\r\n if (!this.realtime_) {\r\n this.scheduleConnect_(0);\r\n }\r\n }\r\n };\r\n PersistentConnection.prototype.handleTimestamp_ = function (timestamp) {\r\n var delta = timestamp - new Date().getTime();\r\n this.onServerInfoUpdate_({ serverTimeOffset: delta });\r\n };\r\n PersistentConnection.prototype.cancelSentTransactions_ = function () {\r\n for (var i = 0; i < this.outstandingPuts_.length; i++) {\r\n var put = this.outstandingPuts_[i];\r\n if (put && /*hash*/ 'h' in put.request && put.queued) {\r\n if (put.onComplete) {\r\n put.onComplete('disconnect');\r\n }\r\n delete this.outstandingPuts_[i];\r\n this.outstandingPutCount_--;\r\n }\r\n }\r\n // Clean up array occasionally.\r\n if (this.outstandingPutCount_ === 0) {\r\n this.outstandingPuts_ = [];\r\n }\r\n };\r\n PersistentConnection.prototype.onListenRevoked_ = function (pathString, query) {\r\n // Remove the listen and manufacture a \"permission_denied\" error for the failed listen.\r\n var queryId;\r\n if (!query) {\r\n queryId = 'default';\r\n }\r\n else {\r\n queryId = query.map(function (q) { return ObjectToUniqueKey(q); }).join('$');\r\n }\r\n var listen = this.removeListen_(pathString, queryId);\r\n if (listen && listen.onComplete) {\r\n listen.onComplete('permission_denied');\r\n }\r\n };\r\n PersistentConnection.prototype.removeListen_ = function (pathString, queryId) {\r\n var normalizedPathString = new Path(pathString).toString(); // normalize path.\r\n var listen;\r\n if (this.listens.has(normalizedPathString)) {\r\n var map = this.listens.get(normalizedPathString);\r\n listen = map.get(queryId);\r\n map.delete(queryId);\r\n if (map.size === 0) {\r\n this.listens.delete(normalizedPathString);\r\n }\r\n }\r\n else {\r\n // all listens for this path has already been removed\r\n listen = undefined;\r\n }\r\n return listen;\r\n };\r\n PersistentConnection.prototype.onAuthRevoked_ = function (statusCode, explanation) {\r\n log('Auth token revoked: ' + statusCode + '/' + explanation);\r\n this.authToken_ = null;\r\n this.forceTokenRefresh_ = true;\r\n this.realtime_.close();\r\n if (statusCode === 'invalid_token' || statusCode === 'permission_denied') {\r\n // We'll wait a couple times before logging the warning / increasing the\r\n // retry period since oauth tokens will report as \"invalid\" if they're\r\n // just expired. Plus there may be transient issues that resolve themselves.\r\n this.invalidAuthTokenCount_++;\r\n if (this.invalidAuthTokenCount_ >= INVALID_AUTH_TOKEN_THRESHOLD) {\r\n // Set a long reconnect delay because recovery is unlikely\r\n this.reconnectDelay_ = RECONNECT_MAX_DELAY_FOR_ADMINS;\r\n // Notify the auth token provider that the token is invalid, which will log\r\n // a warning\r\n this.authTokenProvider_.notifyForInvalidToken();\r\n }\r\n }\r\n };\r\n PersistentConnection.prototype.onSecurityDebugPacket_ = function (body) {\r\n if (this.securityDebugCallback_) {\r\n this.securityDebugCallback_(body);\r\n }\r\n else {\r\n if ('msg' in body) {\r\n console.log('FIREBASE: ' + body['msg'].replace('\\n', '\\nFIREBASE: '));\r\n }\r\n }\r\n };\r\n PersistentConnection.prototype.restoreState_ = function () {\r\n var e_1, _a, e_2, _b;\r\n //Re-authenticate ourselves if we have a credential stored.\r\n this.tryAuth();\r\n try {\r\n // Puts depend on having received the corresponding data update from the server before they complete, so we must\r\n // make sure to send listens before puts.\r\n for (var _c = __values(this.listens.values()), _d = _c.next(); !_d.done; _d = _c.next()) {\r\n var queries = _d.value;\r\n try {\r\n for (var _e = (e_2 = void 0, __values(queries.values())), _f = _e.next(); !_f.done; _f = _e.next()) {\r\n var listenSpec = _f.value;\r\n this.sendListen_(listenSpec);\r\n }\r\n }\r\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\r\n finally {\r\n try {\r\n if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\r\n }\r\n finally { if (e_2) throw e_2.error; }\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n for (var i = 0; i < this.outstandingPuts_.length; i++) {\r\n if (this.outstandingPuts_[i]) {\r\n this.sendPut_(i);\r\n }\r\n }\r\n while (this.onDisconnectRequestQueue_.length) {\r\n var request = this.onDisconnectRequestQueue_.shift();\r\n this.sendOnDisconnect_(request.action, request.pathString, request.data, request.onComplete);\r\n }\r\n };\r\n /**\r\n * Sends client stats for first connection\r\n */\r\n PersistentConnection.prototype.sendConnectStats_ = function () {\r\n var stats = {};\r\n var clientName = 'js';\r\n if (isNodeSdk()) {\r\n if (this.repoInfo_.nodeAdmin) {\r\n clientName = 'admin_node';\r\n }\r\n else {\r\n clientName = 'node';\r\n }\r\n }\r\n stats['sdk.' + clientName + '.' + SDK_VERSION.replace(/\\./g, '-')] = 1;\r\n if (isMobileCordova()) {\r\n stats['framework.cordova'] = 1;\r\n }\r\n else if (isReactNative()) {\r\n stats['framework.reactnative'] = 1;\r\n }\r\n this.reportStats(stats);\r\n };\r\n PersistentConnection.prototype.shouldReconnect_ = function () {\r\n var online = OnlineMonitor.getInstance().currentlyOnline();\r\n return isEmpty(this.interruptReasons_) && online;\r\n };\r\n PersistentConnection.nextPersistentConnectionId_ = 0;\r\n /**\r\n * Counter for number of connections created. Mainly used for tagging in the logs\r\n */\r\n PersistentConnection.nextConnectionId_ = 0;\r\n return PersistentConnection;\r\n}(ServerActions));\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An implementation of ServerActions that communicates with the server via REST requests.\r\n * This is mostly useful for compatibility with crawlers, where we don't want to spin up a full\r\n * persistent connection (using WebSockets or long-polling)\r\n */\r\nvar ReadonlyRestClient = /** @class */ (function (_super) {\r\n __extends(ReadonlyRestClient, _super);\r\n /**\r\n * @param {!RepoInfo} repoInfo_ Data about the namespace we are connecting to\r\n * @param {function(string, *, boolean, ?number)} onDataUpdate_ A callback for new data from the server\r\n * @param {AuthTokenProvider} authTokenProvider_\r\n * @implements {ServerActions}\r\n */\r\n function ReadonlyRestClient(repoInfo_, onDataUpdate_, authTokenProvider_) {\r\n var _this = _super.call(this) || this;\r\n _this.repoInfo_ = repoInfo_;\r\n _this.onDataUpdate_ = onDataUpdate_;\r\n _this.authTokenProvider_ = authTokenProvider_;\r\n /** @private {function(...[*])} */\r\n _this.log_ = logWrapper('p:rest:');\r\n /**\r\n * We don't actually need to track listens, except to prevent us calling an onComplete for a listen\r\n * that's been removed. :-/\r\n *\r\n * @private {!Object.<string, !Object>}\r\n */\r\n _this.listens_ = {};\r\n return _this;\r\n }\r\n ReadonlyRestClient.prototype.reportStats = function (stats) {\r\n throw new Error('Method not implemented.');\r\n };\r\n /**\r\n * @param {!Query} query\r\n * @param {?number=} tag\r\n * @return {string}\r\n * @private\r\n */\r\n ReadonlyRestClient.getListenId_ = function (query, tag) {\r\n if (tag !== undefined) {\r\n return 'tag$' + tag;\r\n }\r\n else {\r\n assert(query.getQueryParams().isDefault(), \"should have a tag if it's not a default query.\");\r\n return query.path.toString();\r\n }\r\n };\r\n /** @inheritDoc */\r\n ReadonlyRestClient.prototype.listen = function (query, currentHashFn, tag, onComplete) {\r\n var _this = this;\r\n var pathString = query.path.toString();\r\n this.log_('Listen called for ' + pathString + ' ' + query.queryIdentifier());\r\n // Mark this listener so we can tell if it's removed.\r\n var listenId = ReadonlyRestClient.getListenId_(query, tag);\r\n var thisListen = {};\r\n this.listens_[listenId] = thisListen;\r\n var queryStringParameters = query\r\n .getQueryParams()\r\n .toRestQueryStringParameters();\r\n this.restRequest_(pathString + '.json', queryStringParameters, function (error, result) {\r\n var data = result;\r\n if (error === 404) {\r\n data = null;\r\n error = null;\r\n }\r\n if (error === null) {\r\n _this.onDataUpdate_(pathString, data, /*isMerge=*/ false, tag);\r\n }\r\n if (safeGet(_this.listens_, listenId) === thisListen) {\r\n var status_1;\r\n if (!error) {\r\n status_1 = 'ok';\r\n }\r\n else if (error === 401) {\r\n status_1 = 'permission_denied';\r\n }\r\n else {\r\n status_1 = 'rest_error:' + error;\r\n }\r\n onComplete(status_1, null);\r\n }\r\n });\r\n };\r\n /** @inheritDoc */\r\n ReadonlyRestClient.prototype.unlisten = function (query, tag) {\r\n var listenId = ReadonlyRestClient.getListenId_(query, tag);\r\n delete this.listens_[listenId];\r\n };\r\n /** @inheritDoc */\r\n ReadonlyRestClient.prototype.refreshAuthToken = function (token) {\r\n // no-op since we just always call getToken.\r\n };\r\n /**\r\n * Performs a REST request to the given path, with the provided query string parameters,\r\n * and any auth credentials we have.\r\n *\r\n * @param {!string} pathString\r\n * @param {!Object.<string, *>} queryStringParameters\r\n * @param {?function(?number, *=)} callback\r\n * @private\r\n */\r\n ReadonlyRestClient.prototype.restRequest_ = function (pathString, queryStringParameters, callback) {\r\n var _this = this;\r\n if (queryStringParameters === void 0) { queryStringParameters = {}; }\r\n queryStringParameters['format'] = 'export';\r\n this.authTokenProvider_\r\n .getToken(/*forceRefresh=*/ false)\r\n .then(function (authTokenData) {\r\n var authToken = authTokenData && authTokenData.accessToken;\r\n if (authToken) {\r\n queryStringParameters['auth'] = authToken;\r\n }\r\n var url = (_this.repoInfo_.secure ? 'https://' : 'http://') +\r\n _this.repoInfo_.host +\r\n pathString +\r\n '?' +\r\n 'ns=' +\r\n _this.repoInfo_.namespace +\r\n querystring(queryStringParameters);\r\n _this.log_('Sending REST request for ' + url);\r\n var xhr = new XMLHttpRequest();\r\n xhr.onreadystatechange = function () {\r\n if (callback && xhr.readyState === 4) {\r\n _this.log_('REST Response for ' + url + ' received. status:', xhr.status, 'response:', xhr.responseText);\r\n var res = null;\r\n if (xhr.status >= 200 && xhr.status < 300) {\r\n try {\r\n res = jsonEval(xhr.responseText);\r\n }\r\n catch (e) {\r\n warn('Failed to parse JSON response for ' +\r\n url +\r\n ': ' +\r\n xhr.responseText);\r\n }\r\n callback(null, res);\r\n }\r\n else {\r\n // 401 and 404 are expected.\r\n if (xhr.status !== 401 && xhr.status !== 404) {\r\n warn('Got unsuccessful REST response for ' +\r\n url +\r\n ' Status: ' +\r\n xhr.status);\r\n }\r\n callback(xhr.status);\r\n }\r\n callback = null;\r\n }\r\n };\r\n xhr.open('GET', url, /*asynchronous=*/ true);\r\n xhr.send();\r\n });\r\n };\r\n return ReadonlyRestClient;\r\n}(ServerActions));\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar INTERRUPT_REASON = 'repo_interrupt';\r\n/**\r\n * A connection to a single data repository.\r\n */\r\nvar Repo = /** @class */ (function () {\r\n function Repo(repoInfo_, forceRestClient_, app, authTokenProvider_) {\r\n this.repoInfo_ = repoInfo_;\r\n this.forceRestClient_ = forceRestClient_;\r\n this.app = app;\r\n this.authTokenProvider_ = authTokenProvider_;\r\n this.dataUpdateCount = 0;\r\n this.statsListener_ = null;\r\n this.eventQueue_ = new EventQueue();\r\n this.nextWriteId_ = 1;\r\n this.interceptServerDataCallback_ = null;\r\n /** A list of data pieces and paths to be set when this client disconnects. */\r\n this.onDisconnect_ = new SparseSnapshotTree();\r\n // TODO: This should be @private but it's used by test_access.js and internal.js\r\n this.persistentConnection_ = null;\r\n // This key is intentionally not updated if RepoInfo is later changed or replaced\r\n this.key = this.repoInfo_.toURLString();\r\n }\r\n Repo.prototype.start = function () {\r\n var _this = this;\r\n this.stats_ = StatsManager.getCollection(this.repoInfo_);\r\n if (this.forceRestClient_ || beingCrawled()) {\r\n this.server_ = new ReadonlyRestClient(this.repoInfo_, this.onDataUpdate_.bind(this), this.authTokenProvider_);\r\n // Minor hack: Fire onConnect immediately, since there's no actual connection.\r\n setTimeout(this.onConnectStatus_.bind(this, true), 0);\r\n }\r\n else {\r\n var authOverride = this.app.options['databaseAuthVariableOverride'];\r\n // Validate authOverride\r\n if (typeof authOverride !== 'undefined' && authOverride !== null) {\r\n if (typeof authOverride !== 'object') {\r\n throw new Error('Only objects are supported for option databaseAuthVariableOverride');\r\n }\r\n try {\r\n stringify(authOverride);\r\n }\r\n catch (e) {\r\n throw new Error('Invalid authOverride provided: ' + e);\r\n }\r\n }\r\n this.persistentConnection_ = new PersistentConnection(this.repoInfo_, this.app.options.appId, this.onDataUpdate_.bind(this), this.onConnectStatus_.bind(this), this.onServerInfoUpdate_.bind(this), this.authTokenProvider_, authOverride);\r\n this.server_ = this.persistentConnection_;\r\n }\r\n this.authTokenProvider_.addTokenChangeListener(function (token) {\r\n _this.server_.refreshAuthToken(token);\r\n });\r\n // In the case of multiple Repos for the same repoInfo (i.e. there are multiple Firebase.Contexts being used),\r\n // we only want to create one StatsReporter. As such, we'll report stats over the first Repo created.\r\n this.statsReporter_ = StatsManager.getOrCreateReporter(this.repoInfo_, function () { return new StatsReporter(_this.stats_, _this.server_); });\r\n this.transactionsInit_();\r\n // Used for .info.\r\n this.infoData_ = new SnapshotHolder();\r\n this.infoSyncTree_ = new SyncTree({\r\n startListening: function (query, tag, currentHashFn, onComplete) {\r\n var infoEvents = [];\r\n var node = _this.infoData_.getNode(query.path);\r\n // This is possibly a hack, but we have different semantics for .info endpoints. We don't raise null events\r\n // on initial data...\r\n if (!node.isEmpty()) {\r\n infoEvents = _this.infoSyncTree_.applyServerOverwrite(query.path, node);\r\n setTimeout(function () {\r\n onComplete('ok');\r\n }, 0);\r\n }\r\n return infoEvents;\r\n },\r\n stopListening: function () { }\r\n });\r\n this.updateInfo_('connected', false);\r\n this.serverSyncTree_ = new SyncTree({\r\n startListening: function (query, tag, currentHashFn, onComplete) {\r\n _this.server_.listen(query, currentHashFn, tag, function (status, data) {\r\n var events = onComplete(status, data);\r\n _this.eventQueue_.raiseEventsForChangedPath(query.path, events);\r\n });\r\n // No synchronous events for network-backed sync trees\r\n return [];\r\n },\r\n stopListening: function (query, tag) {\r\n _this.server_.unlisten(query, tag);\r\n }\r\n });\r\n };\r\n /**\r\n * @return The URL corresponding to the root of this Firebase.\r\n */\r\n Repo.prototype.toString = function () {\r\n return ((this.repoInfo_.secure ? 'https://' : 'http://') + this.repoInfo_.host);\r\n };\r\n /**\r\n * @return The namespace represented by the repo.\r\n */\r\n Repo.prototype.name = function () {\r\n return this.repoInfo_.namespace;\r\n };\r\n /**\r\n * @return The time in milliseconds, taking the server offset into account if we have one.\r\n */\r\n Repo.prototype.serverTime = function () {\r\n var offsetNode = this.infoData_.getNode(new Path('.info/serverTimeOffset'));\r\n var offset = offsetNode.val() || 0;\r\n return new Date().getTime() + offset;\r\n };\r\n /**\r\n * Generate ServerValues using some variables from the repo object.\r\n */\r\n Repo.prototype.generateServerValues = function () {\r\n return generateWithValues({\r\n timestamp: this.serverTime()\r\n });\r\n };\r\n /**\r\n * Called by realtime when we get new messages from the server.\r\n */\r\n Repo.prototype.onDataUpdate_ = function (pathString, data, isMerge, tag) {\r\n // For testing.\r\n this.dataUpdateCount++;\r\n var path = new Path(pathString);\r\n data = this.interceptServerDataCallback_\r\n ? this.interceptServerDataCallback_(pathString, data)\r\n : data;\r\n var events = [];\r\n if (tag) {\r\n if (isMerge) {\r\n var taggedChildren = map(data, function (raw) { return nodeFromJSON$1(raw); });\r\n events = this.serverSyncTree_.applyTaggedQueryMerge(path, taggedChildren, tag);\r\n }\r\n else {\r\n var taggedSnap = nodeFromJSON$1(data);\r\n events = this.serverSyncTree_.applyTaggedQueryOverwrite(path, taggedSnap, tag);\r\n }\r\n }\r\n else if (isMerge) {\r\n var changedChildren = map(data, function (raw) { return nodeFromJSON$1(raw); });\r\n events = this.serverSyncTree_.applyServerMerge(path, changedChildren);\r\n }\r\n else {\r\n var snap = nodeFromJSON$1(data);\r\n events = this.serverSyncTree_.applyServerOverwrite(path, snap);\r\n }\r\n var affectedPath = path;\r\n if (events.length > 0) {\r\n // Since we have a listener outstanding for each transaction, receiving any events\r\n // is a proxy for some change having occurred.\r\n affectedPath = this.rerunTransactions_(path);\r\n }\r\n this.eventQueue_.raiseEventsForChangedPath(affectedPath, events);\r\n };\r\n // TODO: This should be @private but it's used by test_access.js and internal.js\r\n Repo.prototype.interceptServerData_ = function (callback) {\r\n this.interceptServerDataCallback_ = callback;\r\n };\r\n Repo.prototype.onConnectStatus_ = function (connectStatus) {\r\n this.updateInfo_('connected', connectStatus);\r\n if (connectStatus === false) {\r\n this.runOnDisconnectEvents_();\r\n }\r\n };\r\n Repo.prototype.onServerInfoUpdate_ = function (updates) {\r\n var _this = this;\r\n each(updates, function (key, value) {\r\n _this.updateInfo_(key, value);\r\n });\r\n };\r\n Repo.prototype.updateInfo_ = function (pathString, value) {\r\n var path = new Path('/.info/' + pathString);\r\n var newNode = nodeFromJSON$1(value);\r\n this.infoData_.updateSnapshot(path, newNode);\r\n var events = this.infoSyncTree_.applyServerOverwrite(path, newNode);\r\n this.eventQueue_.raiseEventsForChangedPath(path, events);\r\n };\r\n Repo.prototype.getNextWriteId_ = function () {\r\n return this.nextWriteId_++;\r\n };\r\n Repo.prototype.setWithPriority = function (path, newVal, newPriority, onComplete) {\r\n var _this = this;\r\n this.log_('set', {\r\n path: path.toString(),\r\n value: newVal,\r\n priority: newPriority\r\n });\r\n // TODO: Optimize this behavior to either (a) store flag to skip resolving where possible and / or\r\n // (b) store unresolved paths on JSON parse\r\n var serverValues = this.generateServerValues();\r\n var newNodeUnresolved = nodeFromJSON$1(newVal, newPriority);\r\n var existing = this.serverSyncTree_.calcCompleteEventCache(path);\r\n var newNode = resolveDeferredValueSnapshot(newNodeUnresolved, existing, serverValues);\r\n var writeId = this.getNextWriteId_();\r\n var events = this.serverSyncTree_.applyUserOverwrite(path, newNode, writeId, true);\r\n this.eventQueue_.queueEvents(events);\r\n this.server_.put(path.toString(), newNodeUnresolved.val(/*export=*/ true), function (status, errorReason) {\r\n var success = status === 'ok';\r\n if (!success) {\r\n warn('set at ' + path + ' failed: ' + status);\r\n }\r\n var clearEvents = _this.serverSyncTree_.ackUserWrite(writeId, !success);\r\n _this.eventQueue_.raiseEventsForChangedPath(path, clearEvents);\r\n _this.callOnCompleteCallback(onComplete, status, errorReason);\r\n });\r\n var affectedPath = this.abortTransactions_(path);\r\n this.rerunTransactions_(affectedPath);\r\n // We queued the events above, so just flush the queue here\r\n this.eventQueue_.raiseEventsForChangedPath(affectedPath, []);\r\n };\r\n Repo.prototype.update = function (path, childrenToMerge, onComplete) {\r\n var _this = this;\r\n this.log_('update', { path: path.toString(), value: childrenToMerge });\r\n // Start with our existing data and merge each child into it.\r\n var empty = true;\r\n var serverValues = this.generateServerValues();\r\n var changedChildren = {};\r\n each(childrenToMerge, function (changedKey, changedValue) {\r\n empty = false;\r\n changedChildren[changedKey] = resolveDeferredValueTree(path.child(changedKey), nodeFromJSON$1(changedValue), _this.serverSyncTree_, serverValues);\r\n });\r\n if (!empty) {\r\n var writeId_1 = this.getNextWriteId_();\r\n var events = this.serverSyncTree_.applyUserMerge(path, changedChildren, writeId_1);\r\n this.eventQueue_.queueEvents(events);\r\n this.server_.merge(path.toString(), childrenToMerge, function (status, errorReason) {\r\n var success = status === 'ok';\r\n if (!success) {\r\n warn('update at ' + path + ' failed: ' + status);\r\n }\r\n var clearEvents = _this.serverSyncTree_.ackUserWrite(writeId_1, !success);\r\n var affectedPath = clearEvents.length > 0 ? _this.rerunTransactions_(path) : path;\r\n _this.eventQueue_.raiseEventsForChangedPath(affectedPath, clearEvents);\r\n _this.callOnCompleteCallback(onComplete, status, errorReason);\r\n });\r\n each(childrenToMerge, function (changedPath) {\r\n var affectedPath = _this.abortTransactions_(path.child(changedPath));\r\n _this.rerunTransactions_(affectedPath);\r\n });\r\n // We queued the events above, so just flush the queue here\r\n this.eventQueue_.raiseEventsForChangedPath(path, []);\r\n }\r\n else {\r\n log(\"update() called with empty data. Don't do anything.\");\r\n this.callOnCompleteCallback(onComplete, 'ok');\r\n }\r\n };\r\n /**\r\n * Applies all of the changes stored up in the onDisconnect_ tree.\r\n */\r\n Repo.prototype.runOnDisconnectEvents_ = function () {\r\n var _this = this;\r\n this.log_('onDisconnectEvents');\r\n var serverValues = this.generateServerValues();\r\n var resolvedOnDisconnectTree = new SparseSnapshotTree();\r\n this.onDisconnect_.forEachTree(Path.Empty, function (path, node) {\r\n var resolved = resolveDeferredValueTree(path, node, _this.serverSyncTree_, serverValues);\r\n resolvedOnDisconnectTree.remember(path, resolved);\r\n });\r\n var events = [];\r\n resolvedOnDisconnectTree.forEachTree(Path.Empty, function (path, snap) {\r\n events = events.concat(_this.serverSyncTree_.applyServerOverwrite(path, snap));\r\n var affectedPath = _this.abortTransactions_(path);\r\n _this.rerunTransactions_(affectedPath);\r\n });\r\n this.onDisconnect_ = new SparseSnapshotTree();\r\n this.eventQueue_.raiseEventsForChangedPath(Path.Empty, events);\r\n };\r\n Repo.prototype.onDisconnectCancel = function (path, onComplete) {\r\n var _this = this;\r\n this.server_.onDisconnectCancel(path.toString(), function (status, errorReason) {\r\n if (status === 'ok') {\r\n _this.onDisconnect_.forget(path);\r\n }\r\n _this.callOnCompleteCallback(onComplete, status, errorReason);\r\n });\r\n };\r\n Repo.prototype.onDisconnectSet = function (path, value, onComplete) {\r\n var _this = this;\r\n var newNode = nodeFromJSON$1(value);\r\n this.server_.onDisconnectPut(path.toString(), newNode.val(/*export=*/ true), function (status, errorReason) {\r\n if (status === 'ok') {\r\n _this.onDisconnect_.remember(path, newNode);\r\n }\r\n _this.callOnCompleteCallback(onComplete, status, errorReason);\r\n });\r\n };\r\n Repo.prototype.onDisconnectSetWithPriority = function (path, value, priority, onComplete) {\r\n var _this = this;\r\n var newNode = nodeFromJSON$1(value, priority);\r\n this.server_.onDisconnectPut(path.toString(), newNode.val(/*export=*/ true), function (status, errorReason) {\r\n if (status === 'ok') {\r\n _this.onDisconnect_.remember(path, newNode);\r\n }\r\n _this.callOnCompleteCallback(onComplete, status, errorReason);\r\n });\r\n };\r\n Repo.prototype.onDisconnectUpdate = function (path, childrenToMerge, onComplete) {\r\n var _this = this;\r\n if (isEmpty(childrenToMerge)) {\r\n log(\"onDisconnect().update() called with empty data. Don't do anything.\");\r\n this.callOnCompleteCallback(onComplete, 'ok');\r\n return;\r\n }\r\n this.server_.onDisconnectMerge(path.toString(), childrenToMerge, function (status, errorReason) {\r\n if (status === 'ok') {\r\n each(childrenToMerge, function (childName, childNode) {\r\n var newChildNode = nodeFromJSON$1(childNode);\r\n _this.onDisconnect_.remember(path.child(childName), newChildNode);\r\n });\r\n }\r\n _this.callOnCompleteCallback(onComplete, status, errorReason);\r\n });\r\n };\r\n Repo.prototype.addEventCallbackForQuery = function (query, eventRegistration) {\r\n var events;\r\n if (query.path.getFront() === '.info') {\r\n events = this.infoSyncTree_.addEventRegistration(query, eventRegistration);\r\n }\r\n else {\r\n events = this.serverSyncTree_.addEventRegistration(query, eventRegistration);\r\n }\r\n this.eventQueue_.raiseEventsAtPath(query.path, events);\r\n };\r\n Repo.prototype.removeEventCallbackForQuery = function (query, eventRegistration) {\r\n // These are guaranteed not to raise events, since we're not passing in a cancelError. However, we can future-proof\r\n // a little bit by handling the return values anyways.\r\n var events;\r\n if (query.path.getFront() === '.info') {\r\n events = this.infoSyncTree_.removeEventRegistration(query, eventRegistration);\r\n }\r\n else {\r\n events = this.serverSyncTree_.removeEventRegistration(query, eventRegistration);\r\n }\r\n this.eventQueue_.raiseEventsAtPath(query.path, events);\r\n };\r\n Repo.prototype.interrupt = function () {\r\n if (this.persistentConnection_) {\r\n this.persistentConnection_.interrupt(INTERRUPT_REASON);\r\n }\r\n };\r\n Repo.prototype.resume = function () {\r\n if (this.persistentConnection_) {\r\n this.persistentConnection_.resume(INTERRUPT_REASON);\r\n }\r\n };\r\n Repo.prototype.stats = function (showDelta) {\r\n if (showDelta === void 0) { showDelta = false; }\r\n if (typeof console === 'undefined') {\r\n return;\r\n }\r\n var stats;\r\n if (showDelta) {\r\n if (!this.statsListener_) {\r\n this.statsListener_ = new StatsListener(this.stats_);\r\n }\r\n stats = this.statsListener_.get();\r\n }\r\n else {\r\n stats = this.stats_.get();\r\n }\r\n var longestName = Object.keys(stats).reduce(function (previousValue, currentValue) {\r\n return Math.max(currentValue.length, previousValue);\r\n }, 0);\r\n each(stats, function (stat, value) {\r\n var paddedStat = stat;\r\n // pad stat names to be the same length (plus 2 extra spaces).\r\n for (var i = stat.length; i < longestName + 2; i++) {\r\n paddedStat += ' ';\r\n }\r\n console.log(paddedStat + value);\r\n });\r\n };\r\n Repo.prototype.statsIncrementCounter = function (metric) {\r\n this.stats_.incrementCounter(metric);\r\n this.statsReporter_.includeStat(metric);\r\n };\r\n Repo.prototype.log_ = function () {\r\n var varArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n varArgs[_i] = arguments[_i];\r\n }\r\n var prefix = '';\r\n if (this.persistentConnection_) {\r\n prefix = this.persistentConnection_.id + ':';\r\n }\r\n log.apply(void 0, __spread([prefix], varArgs));\r\n };\r\n Repo.prototype.callOnCompleteCallback = function (callback, status, errorReason) {\r\n if (callback) {\r\n exceptionGuard(function () {\r\n if (status === 'ok') {\r\n callback(null);\r\n }\r\n else {\r\n var code = (status || 'error').toUpperCase();\r\n var message = code;\r\n if (errorReason) {\r\n message += ': ' + errorReason;\r\n }\r\n var error = new Error(message);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n error.code = code;\r\n callback(error);\r\n }\r\n });\r\n }\r\n };\r\n Object.defineProperty(Repo.prototype, \"database\", {\r\n get: function () {\r\n return this.__database || (this.__database = new Database(this));\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return Repo;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Filters nodes by range and uses an IndexFilter to track any changes after filtering the node\r\n *\r\n * @constructor\r\n * @implements {NodeFilter}\r\n */\r\nvar RangedFilter = /** @class */ (function () {\r\n /**\r\n * @param {!QueryParams} params\r\n */\r\n function RangedFilter(params) {\r\n this.indexedFilter_ = new IndexedFilter(params.getIndex());\r\n this.index_ = params.getIndex();\r\n this.startPost_ = RangedFilter.getStartPost_(params);\r\n this.endPost_ = RangedFilter.getEndPost_(params);\r\n }\r\n /**\r\n * @return {!NamedNode}\r\n */\r\n RangedFilter.prototype.getStartPost = function () {\r\n return this.startPost_;\r\n };\r\n /**\r\n * @return {!NamedNode}\r\n */\r\n RangedFilter.prototype.getEndPost = function () {\r\n return this.endPost_;\r\n };\r\n /**\r\n * @param {!NamedNode} node\r\n * @return {boolean}\r\n */\r\n RangedFilter.prototype.matches = function (node) {\r\n return (this.index_.compare(this.getStartPost(), node) <= 0 &&\r\n this.index_.compare(node, this.getEndPost()) <= 0);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n RangedFilter.prototype.updateChild = function (snap, key, newChild, affectedPath, source, optChangeAccumulator) {\r\n if (!this.matches(new NamedNode(key, newChild))) {\r\n newChild = ChildrenNode.EMPTY_NODE;\r\n }\r\n return this.indexedFilter_.updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n RangedFilter.prototype.updateFullNode = function (oldSnap, newSnap, optChangeAccumulator) {\r\n if (newSnap.isLeafNode()) {\r\n // Make sure we have a children node with the correct index, not a leaf node;\r\n newSnap = ChildrenNode.EMPTY_NODE;\r\n }\r\n var filtered = newSnap.withIndex(this.index_);\r\n // Don't support priorities on queries\r\n filtered = filtered.updatePriority(ChildrenNode.EMPTY_NODE);\r\n var self = this;\r\n newSnap.forEachChild(PRIORITY_INDEX, function (key, childNode) {\r\n if (!self.matches(new NamedNode(key, childNode))) {\r\n filtered = filtered.updateImmediateChild(key, ChildrenNode.EMPTY_NODE);\r\n }\r\n });\r\n return this.indexedFilter_.updateFullNode(oldSnap, filtered, optChangeAccumulator);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n RangedFilter.prototype.updatePriority = function (oldSnap, newPriority) {\r\n // Don't support priorities on queries\r\n return oldSnap;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n RangedFilter.prototype.filtersNodes = function () {\r\n return true;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n RangedFilter.prototype.getIndexedFilter = function () {\r\n return this.indexedFilter_;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n RangedFilter.prototype.getIndex = function () {\r\n return this.index_;\r\n };\r\n /**\r\n * @param {!QueryParams} params\r\n * @return {!NamedNode}\r\n * @private\r\n */\r\n RangedFilter.getStartPost_ = function (params) {\r\n if (params.hasStart()) {\r\n var startName = params.getIndexStartName();\r\n return params.getIndex().makePost(params.getIndexStartValue(), startName);\r\n }\r\n else {\r\n return params.getIndex().minPost();\r\n }\r\n };\r\n /**\r\n * @param {!QueryParams} params\r\n * @return {!NamedNode}\r\n * @private\r\n */\r\n RangedFilter.getEndPost_ = function (params) {\r\n if (params.hasEnd()) {\r\n var endName = params.getIndexEndName();\r\n return params.getIndex().makePost(params.getIndexEndValue(), endName);\r\n }\r\n else {\r\n return params.getIndex().maxPost();\r\n }\r\n };\r\n return RangedFilter;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Applies a limit and a range to a node and uses RangedFilter to do the heavy lifting where possible\r\n *\r\n * @constructor\r\n * @implements {NodeFilter}\r\n */\r\nvar LimitedFilter = /** @class */ (function () {\r\n /**\r\n * @param {!QueryParams} params\r\n */\r\n function LimitedFilter(params) {\r\n this.rangedFilter_ = new RangedFilter(params);\r\n this.index_ = params.getIndex();\r\n this.limit_ = params.getLimit();\r\n this.reverse_ = !params.isViewFromLeft();\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n LimitedFilter.prototype.updateChild = function (snap, key, newChild, affectedPath, source, optChangeAccumulator) {\r\n if (!this.rangedFilter_.matches(new NamedNode(key, newChild))) {\r\n newChild = ChildrenNode.EMPTY_NODE;\r\n }\r\n if (snap.getImmediateChild(key).equals(newChild)) {\r\n // No change\r\n return snap;\r\n }\r\n else if (snap.numChildren() < this.limit_) {\r\n return this.rangedFilter_\r\n .getIndexedFilter()\r\n .updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator);\r\n }\r\n else {\r\n return this.fullLimitUpdateChild_(snap, key, newChild, source, optChangeAccumulator);\r\n }\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LimitedFilter.prototype.updateFullNode = function (oldSnap, newSnap, optChangeAccumulator) {\r\n var filtered;\r\n if (newSnap.isLeafNode() || newSnap.isEmpty()) {\r\n // Make sure we have a children node with the correct index, not a leaf node;\r\n filtered = ChildrenNode.EMPTY_NODE.withIndex(this.index_);\r\n }\r\n else {\r\n if (this.limit_ * 2 < newSnap.numChildren() &&\r\n newSnap.isIndexed(this.index_)) {\r\n // Easier to build up a snapshot, since what we're given has more than twice the elements we want\r\n filtered = ChildrenNode.EMPTY_NODE.withIndex(this.index_);\r\n // anchor to the startPost, endPost, or last element as appropriate\r\n var iterator = void 0;\r\n if (this.reverse_) {\r\n iterator = newSnap.getReverseIteratorFrom(this.rangedFilter_.getEndPost(), this.index_);\r\n }\r\n else {\r\n iterator = newSnap.getIteratorFrom(this.rangedFilter_.getStartPost(), this.index_);\r\n }\r\n var count = 0;\r\n while (iterator.hasNext() && count < this.limit_) {\r\n var next = iterator.getNext();\r\n var inRange = void 0;\r\n if (this.reverse_) {\r\n inRange =\r\n this.index_.compare(this.rangedFilter_.getStartPost(), next) <= 0;\r\n }\r\n else {\r\n inRange =\r\n this.index_.compare(next, this.rangedFilter_.getEndPost()) <= 0;\r\n }\r\n if (inRange) {\r\n filtered = filtered.updateImmediateChild(next.name, next.node);\r\n count++;\r\n }\r\n else {\r\n // if we have reached the end post, we cannot keep adding elemments\r\n break;\r\n }\r\n }\r\n }\r\n else {\r\n // The snap contains less than twice the limit. Faster to delete from the snap than build up a new one\r\n filtered = newSnap.withIndex(this.index_);\r\n // Don't support priorities on queries\r\n filtered = filtered.updatePriority(ChildrenNode.EMPTY_NODE);\r\n var startPost = void 0;\r\n var endPost = void 0;\r\n var cmp = void 0;\r\n var iterator = void 0;\r\n if (this.reverse_) {\r\n iterator = filtered.getReverseIterator(this.index_);\r\n startPost = this.rangedFilter_.getEndPost();\r\n endPost = this.rangedFilter_.getStartPost();\r\n var indexCompare_1 = this.index_.getCompare();\r\n cmp = function (a, b) { return indexCompare_1(b, a); };\r\n }\r\n else {\r\n iterator = filtered.getIterator(this.index_);\r\n startPost = this.rangedFilter_.getStartPost();\r\n endPost = this.rangedFilter_.getEndPost();\r\n cmp = this.index_.getCompare();\r\n }\r\n var count = 0;\r\n var foundStartPost = false;\r\n while (iterator.hasNext()) {\r\n var next = iterator.getNext();\r\n if (!foundStartPost && cmp(startPost, next) <= 0) {\r\n // start adding\r\n foundStartPost = true;\r\n }\r\n var inRange = foundStartPost && count < this.limit_ && cmp(next, endPost) <= 0;\r\n if (inRange) {\r\n count++;\r\n }\r\n else {\r\n filtered = filtered.updateImmediateChild(next.name, ChildrenNode.EMPTY_NODE);\r\n }\r\n }\r\n }\r\n }\r\n return this.rangedFilter_\r\n .getIndexedFilter()\r\n .updateFullNode(oldSnap, filtered, optChangeAccumulator);\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LimitedFilter.prototype.updatePriority = function (oldSnap, newPriority) {\r\n // Don't support priorities on queries\r\n return oldSnap;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LimitedFilter.prototype.filtersNodes = function () {\r\n return true;\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LimitedFilter.prototype.getIndexedFilter = function () {\r\n return this.rangedFilter_.getIndexedFilter();\r\n };\r\n /**\r\n * @inheritDoc\r\n */\r\n LimitedFilter.prototype.getIndex = function () {\r\n return this.index_;\r\n };\r\n /**\r\n * @param {!Node} snap\r\n * @param {string} childKey\r\n * @param {!Node} childSnap\r\n * @param {!CompleteChildSource} source\r\n * @param {?ChildChangeAccumulator} changeAccumulator\r\n * @return {!Node}\r\n * @private\r\n */\r\n LimitedFilter.prototype.fullLimitUpdateChild_ = function (snap, childKey, childSnap, source, changeAccumulator) {\r\n // TODO: rename all cache stuff etc to general snap terminology\r\n var cmp;\r\n if (this.reverse_) {\r\n var indexCmp_1 = this.index_.getCompare();\r\n cmp = function (a, b) { return indexCmp_1(b, a); };\r\n }\r\n else {\r\n cmp = this.index_.getCompare();\r\n }\r\n var oldEventCache = snap;\r\n assert(oldEventCache.numChildren() === this.limit_, '');\r\n var newChildNamedNode = new NamedNode(childKey, childSnap);\r\n var windowBoundary = this.reverse_\r\n ? oldEventCache.getFirstChild(this.index_)\r\n : oldEventCache.getLastChild(this.index_);\r\n var inRange = this.rangedFilter_.matches(newChildNamedNode);\r\n if (oldEventCache.hasChild(childKey)) {\r\n var oldChildSnap = oldEventCache.getImmediateChild(childKey);\r\n var nextChild = source.getChildAfterChild(this.index_, windowBoundary, this.reverse_);\r\n while (nextChild != null &&\r\n (nextChild.name === childKey || oldEventCache.hasChild(nextChild.name))) {\r\n // There is a weird edge case where a node is updated as part of a merge in the write tree, but hasn't\r\n // been applied to the limited filter yet. Ignore this next child which will be updated later in\r\n // the limited filter...\r\n nextChild = source.getChildAfterChild(this.index_, nextChild, this.reverse_);\r\n }\r\n var compareNext = nextChild == null ? 1 : cmp(nextChild, newChildNamedNode);\r\n var remainsInWindow = inRange && !childSnap.isEmpty() && compareNext >= 0;\r\n if (remainsInWindow) {\r\n if (changeAccumulator != null) {\r\n changeAccumulator.trackChildChange(Change.childChangedChange(childKey, childSnap, oldChildSnap));\r\n }\r\n return oldEventCache.updateImmediateChild(childKey, childSnap);\r\n }\r\n else {\r\n if (changeAccumulator != null) {\r\n changeAccumulator.trackChildChange(Change.childRemovedChange(childKey, oldChildSnap));\r\n }\r\n var newEventCache = oldEventCache.updateImmediateChild(childKey, ChildrenNode.EMPTY_NODE);\r\n var nextChildInRange = nextChild != null && this.rangedFilter_.matches(nextChild);\r\n if (nextChildInRange) {\r\n if (changeAccumulator != null) {\r\n changeAccumulator.trackChildChange(Change.childAddedChange(nextChild.name, nextChild.node));\r\n }\r\n return newEventCache.updateImmediateChild(nextChild.name, nextChild.node);\r\n }\r\n else {\r\n return newEventCache;\r\n }\r\n }\r\n }\r\n else if (childSnap.isEmpty()) {\r\n // we're deleting a node, but it was not in the window, so ignore it\r\n return snap;\r\n }\r\n else if (inRange) {\r\n if (cmp(windowBoundary, newChildNamedNode) >= 0) {\r\n if (changeAccumulator != null) {\r\n changeAccumulator.trackChildChange(Change.childRemovedChange(windowBoundary.name, windowBoundary.node));\r\n changeAccumulator.trackChildChange(Change.childAddedChange(childKey, childSnap));\r\n }\r\n return oldEventCache\r\n .updateImmediateChild(childKey, childSnap)\r\n .updateImmediateChild(windowBoundary.name, ChildrenNode.EMPTY_NODE);\r\n }\r\n else {\r\n return snap;\r\n }\r\n }\r\n else {\r\n return snap;\r\n }\r\n };\r\n return LimitedFilter;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * This class is an immutable-from-the-public-api struct containing a set of query parameters defining a\r\n * range to be returned for a particular location. It is assumed that validation of parameters is done at the\r\n * user-facing API level, so it is not done here.\r\n * @constructor\r\n */\r\nvar QueryParams = /** @class */ (function () {\r\n function QueryParams() {\r\n this.limitSet_ = false;\r\n this.startSet_ = false;\r\n this.startNameSet_ = false;\r\n this.endSet_ = false;\r\n this.endNameSet_ = false;\r\n this.limit_ = 0;\r\n this.viewFrom_ = '';\r\n this.indexStartValue_ = null;\r\n this.indexStartName_ = '';\r\n this.indexEndValue_ = null;\r\n this.indexEndName_ = '';\r\n this.index_ = PRIORITY_INDEX;\r\n }\r\n /**\r\n * @return {boolean}\r\n */\r\n QueryParams.prototype.hasStart = function () {\r\n return this.startSet_;\r\n };\r\n /**\r\n * @return {boolean} True if it would return from left.\r\n */\r\n QueryParams.prototype.isViewFromLeft = function () {\r\n if (this.viewFrom_ === '') {\r\n // limit(), rather than limitToFirst or limitToLast was called.\r\n // This means that only one of startSet_ and endSet_ is true. Use them\r\n // to calculate which side of the view to anchor to. If neither is set,\r\n // anchor to the end.\r\n return this.startSet_;\r\n }\r\n else {\r\n return (this.viewFrom_ === QueryParams.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT);\r\n }\r\n };\r\n /**\r\n * Only valid to call if hasStart() returns true\r\n * @return {*}\r\n */\r\n QueryParams.prototype.getIndexStartValue = function () {\r\n assert(this.startSet_, 'Only valid if start has been set');\r\n return this.indexStartValue_;\r\n };\r\n /**\r\n * Only valid to call if hasStart() returns true.\r\n * Returns the starting key name for the range defined by these query parameters\r\n * @return {!string}\r\n */\r\n QueryParams.prototype.getIndexStartName = function () {\r\n assert(this.startSet_, 'Only valid if start has been set');\r\n if (this.startNameSet_) {\r\n return this.indexStartName_;\r\n }\r\n else {\r\n return MIN_NAME;\r\n }\r\n };\r\n /**\r\n * @return {boolean}\r\n */\r\n QueryParams.prototype.hasEnd = function () {\r\n return this.endSet_;\r\n };\r\n /**\r\n * Only valid to call if hasEnd() returns true.\r\n * @return {*}\r\n */\r\n QueryParams.prototype.getIndexEndValue = function () {\r\n assert(this.endSet_, 'Only valid if end has been set');\r\n return this.indexEndValue_;\r\n };\r\n /**\r\n * Only valid to call if hasEnd() returns true.\r\n * Returns the end key name for the range defined by these query parameters\r\n * @return {!string}\r\n */\r\n QueryParams.prototype.getIndexEndName = function () {\r\n assert(this.endSet_, 'Only valid if end has been set');\r\n if (this.endNameSet_) {\r\n return this.indexEndName_;\r\n }\r\n else {\r\n return MAX_NAME;\r\n }\r\n };\r\n /**\r\n * @return {boolean}\r\n */\r\n QueryParams.prototype.hasLimit = function () {\r\n return this.limitSet_;\r\n };\r\n /**\r\n * @return {boolean} True if a limit has been set and it has been explicitly anchored\r\n */\r\n QueryParams.prototype.hasAnchoredLimit = function () {\r\n return this.limitSet_ && this.viewFrom_ !== '';\r\n };\r\n /**\r\n * Only valid to call if hasLimit() returns true\r\n * @return {!number}\r\n */\r\n QueryParams.prototype.getLimit = function () {\r\n assert(this.limitSet_, 'Only valid if limit has been set');\r\n return this.limit_;\r\n };\r\n /**\r\n * @return {!Index}\r\n */\r\n QueryParams.prototype.getIndex = function () {\r\n return this.index_;\r\n };\r\n /**\r\n * @return {!QueryParams}\r\n * @private\r\n */\r\n QueryParams.prototype.copy_ = function () {\r\n var copy = new QueryParams();\r\n copy.limitSet_ = this.limitSet_;\r\n copy.limit_ = this.limit_;\r\n copy.startSet_ = this.startSet_;\r\n copy.indexStartValue_ = this.indexStartValue_;\r\n copy.startNameSet_ = this.startNameSet_;\r\n copy.indexStartName_ = this.indexStartName_;\r\n copy.endSet_ = this.endSet_;\r\n copy.indexEndValue_ = this.indexEndValue_;\r\n copy.endNameSet_ = this.endNameSet_;\r\n copy.indexEndName_ = this.indexEndName_;\r\n copy.index_ = this.index_;\r\n copy.viewFrom_ = this.viewFrom_;\r\n return copy;\r\n };\r\n /**\r\n * @param {!number} newLimit\r\n * @return {!QueryParams}\r\n */\r\n QueryParams.prototype.limit = function (newLimit) {\r\n var newParams = this.copy_();\r\n newParams.limitSet_ = true;\r\n newParams.limit_ = newLimit;\r\n newParams.viewFrom_ = '';\r\n return newParams;\r\n };\r\n /**\r\n * @param {!number} newLimit\r\n * @return {!QueryParams}\r\n */\r\n QueryParams.prototype.limitToFirst = function (newLimit) {\r\n var newParams = this.copy_();\r\n newParams.limitSet_ = true;\r\n newParams.limit_ = newLimit;\r\n newParams.viewFrom_ = QueryParams.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT;\r\n return newParams;\r\n };\r\n /**\r\n * @param {!number} newLimit\r\n * @return {!QueryParams}\r\n */\r\n QueryParams.prototype.limitToLast = function (newLimit) {\r\n var newParams = this.copy_();\r\n newParams.limitSet_ = true;\r\n newParams.limit_ = newLimit;\r\n newParams.viewFrom_ = QueryParams.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_RIGHT;\r\n return newParams;\r\n };\r\n /**\r\n * @param {*} indexValue\r\n * @param {?string=} key\r\n * @return {!QueryParams}\r\n */\r\n QueryParams.prototype.startAt = function (indexValue, key) {\r\n var newParams = this.copy_();\r\n newParams.startSet_ = true;\r\n if (indexValue === undefined) {\r\n indexValue = null;\r\n }\r\n newParams.indexStartValue_ = indexValue;\r\n if (key != null) {\r\n newParams.startNameSet_ = true;\r\n newParams.indexStartName_ = key;\r\n }\r\n else {\r\n newParams.startNameSet_ = false;\r\n newParams.indexStartName_ = '';\r\n }\r\n return newParams;\r\n };\r\n /**\r\n * @param {*} indexValue\r\n * @param {?string=} key\r\n * @return {!QueryParams}\r\n */\r\n QueryParams.prototype.endAt = function (indexValue, key) {\r\n var newParams = this.copy_();\r\n newParams.endSet_ = true;\r\n if (indexValue === undefined) {\r\n indexValue = null;\r\n }\r\n newParams.indexEndValue_ = indexValue;\r\n if (key !== undefined) {\r\n newParams.endNameSet_ = true;\r\n newParams.indexEndName_ = key;\r\n }\r\n else {\r\n newParams.endNameSet_ = false;\r\n newParams.indexEndName_ = '';\r\n }\r\n return newParams;\r\n };\r\n /**\r\n * @param {!Index} index\r\n * @return {!QueryParams}\r\n */\r\n QueryParams.prototype.orderBy = function (index) {\r\n var newParams = this.copy_();\r\n newParams.index_ = index;\r\n return newParams;\r\n };\r\n /**\r\n * @return {!Object}\r\n */\r\n QueryParams.prototype.getQueryObject = function () {\r\n var WIRE_PROTOCOL_CONSTANTS = QueryParams.WIRE_PROTOCOL_CONSTANTS_;\r\n var obj = {};\r\n if (this.startSet_) {\r\n obj[WIRE_PROTOCOL_CONSTANTS.INDEX_START_VALUE] = this.indexStartValue_;\r\n if (this.startNameSet_) {\r\n obj[WIRE_PROTOCOL_CONSTANTS.INDEX_START_NAME] = this.indexStartName_;\r\n }\r\n }\r\n if (this.endSet_) {\r\n obj[WIRE_PROTOCOL_CONSTANTS.INDEX_END_VALUE] = this.indexEndValue_;\r\n if (this.endNameSet_) {\r\n obj[WIRE_PROTOCOL_CONSTANTS.INDEX_END_NAME] = this.indexEndName_;\r\n }\r\n }\r\n if (this.limitSet_) {\r\n obj[WIRE_PROTOCOL_CONSTANTS.LIMIT] = this.limit_;\r\n var viewFrom = this.viewFrom_;\r\n if (viewFrom === '') {\r\n if (this.isViewFromLeft()) {\r\n viewFrom = WIRE_PROTOCOL_CONSTANTS.VIEW_FROM_LEFT;\r\n }\r\n else {\r\n viewFrom = WIRE_PROTOCOL_CONSTANTS.VIEW_FROM_RIGHT;\r\n }\r\n }\r\n obj[WIRE_PROTOCOL_CONSTANTS.VIEW_FROM] = viewFrom;\r\n }\r\n // For now, priority index is the default, so we only specify if it's some other index\r\n if (this.index_ !== PRIORITY_INDEX) {\r\n obj[WIRE_PROTOCOL_CONSTANTS.INDEX] = this.index_.toString();\r\n }\r\n return obj;\r\n };\r\n /**\r\n * @return {boolean}\r\n */\r\n QueryParams.prototype.loadsAllData = function () {\r\n return !(this.startSet_ || this.endSet_ || this.limitSet_);\r\n };\r\n /**\r\n * @return {boolean}\r\n */\r\n QueryParams.prototype.isDefault = function () {\r\n return this.loadsAllData() && this.index_ === PRIORITY_INDEX;\r\n };\r\n /**\r\n * @return {!NodeFilter}\r\n */\r\n QueryParams.prototype.getNodeFilter = function () {\r\n if (this.loadsAllData()) {\r\n return new IndexedFilter(this.getIndex());\r\n }\r\n else if (this.hasLimit()) {\r\n return new LimitedFilter(this);\r\n }\r\n else {\r\n return new RangedFilter(this);\r\n }\r\n };\r\n /**\r\n * Returns a set of REST query string parameters representing this query.\r\n *\r\n * @return {!Object.<string,*>} query string parameters\r\n */\r\n QueryParams.prototype.toRestQueryStringParameters = function () {\r\n var REST_CONSTANTS = QueryParams.REST_QUERY_CONSTANTS_;\r\n var qs = {};\r\n if (this.isDefault()) {\r\n return qs;\r\n }\r\n var orderBy;\r\n if (this.index_ === PRIORITY_INDEX) {\r\n orderBy = REST_CONSTANTS.PRIORITY_INDEX;\r\n }\r\n else if (this.index_ === VALUE_INDEX) {\r\n orderBy = REST_CONSTANTS.VALUE_INDEX;\r\n }\r\n else if (this.index_ === KEY_INDEX) {\r\n orderBy = REST_CONSTANTS.KEY_INDEX;\r\n }\r\n else {\r\n assert(this.index_ instanceof PathIndex, 'Unrecognized index type!');\r\n orderBy = this.index_.toString();\r\n }\r\n qs[REST_CONSTANTS.ORDER_BY] = stringify(orderBy);\r\n if (this.startSet_) {\r\n qs[REST_CONSTANTS.START_AT] = stringify(this.indexStartValue_);\r\n if (this.startNameSet_) {\r\n qs[REST_CONSTANTS.START_AT] += ',' + stringify(this.indexStartName_);\r\n }\r\n }\r\n if (this.endSet_) {\r\n qs[REST_CONSTANTS.END_AT] = stringify(this.indexEndValue_);\r\n if (this.endNameSet_) {\r\n qs[REST_CONSTANTS.END_AT] += ',' + stringify(this.indexEndName_);\r\n }\r\n }\r\n if (this.limitSet_) {\r\n if (this.isViewFromLeft()) {\r\n qs[REST_CONSTANTS.LIMIT_TO_FIRST] = this.limit_;\r\n }\r\n else {\r\n qs[REST_CONSTANTS.LIMIT_TO_LAST] = this.limit_;\r\n }\r\n }\r\n return qs;\r\n };\r\n /**\r\n * Wire Protocol Constants\r\n * @const\r\n * @enum {string}\r\n * @private\r\n */\r\n QueryParams.WIRE_PROTOCOL_CONSTANTS_ = {\r\n INDEX_START_VALUE: 'sp',\r\n INDEX_START_NAME: 'sn',\r\n INDEX_END_VALUE: 'ep',\r\n INDEX_END_NAME: 'en',\r\n LIMIT: 'l',\r\n VIEW_FROM: 'vf',\r\n VIEW_FROM_LEFT: 'l',\r\n VIEW_FROM_RIGHT: 'r',\r\n INDEX: 'i'\r\n };\r\n /**\r\n * REST Query Constants\r\n * @const\r\n * @enum {string}\r\n * @private\r\n */\r\n QueryParams.REST_QUERY_CONSTANTS_ = {\r\n ORDER_BY: 'orderBy',\r\n PRIORITY_INDEX: '$priority',\r\n VALUE_INDEX: '$value',\r\n KEY_INDEX: '$key',\r\n START_AT: 'startAt',\r\n END_AT: 'endAt',\r\n LIMIT_TO_FIRST: 'limitToFirst',\r\n LIMIT_TO_LAST: 'limitToLast'\r\n };\r\n /**\r\n * Default, empty query parameters\r\n * @type {!QueryParams}\r\n * @const\r\n */\r\n QueryParams.DEFAULT = new QueryParams();\r\n return QueryParams;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar Reference = /** @class */ (function (_super) {\r\n __extends(Reference, _super);\r\n /**\r\n * Call options:\r\n * new Reference(Repo, Path) or\r\n * new Reference(url: string, string|RepoManager)\r\n *\r\n * Externally - this is the firebase.database.Reference type.\r\n *\r\n * @param {!Repo} repo\r\n * @param {(!Path)} path\r\n * @extends {Query}\r\n */\r\n function Reference(repo, path) {\r\n var _this = this;\r\n if (!(repo instanceof Repo)) {\r\n throw new Error('new Reference() no longer supported - use app.database().');\r\n }\r\n // call Query's constructor, passing in the repo and path.\r\n _this = _super.call(this, repo, path, QueryParams.DEFAULT, false) || this;\r\n return _this;\r\n }\r\n /** @return {?string} */\r\n Reference.prototype.getKey = function () {\r\n validateArgCount('Reference.key', 0, 0, arguments.length);\r\n if (this.path.isEmpty()) {\r\n return null;\r\n }\r\n else {\r\n return this.path.getBack();\r\n }\r\n };\r\n /**\r\n * @param {!(string|Path)} pathString\r\n * @return {!Reference}\r\n */\r\n Reference.prototype.child = function (pathString) {\r\n validateArgCount('Reference.child', 1, 1, arguments.length);\r\n if (typeof pathString === 'number') {\r\n pathString = String(pathString);\r\n }\r\n else if (!(pathString instanceof Path)) {\r\n if (this.path.getFront() === null) {\r\n validateRootPathString('Reference.child', 1, pathString, false);\r\n }\r\n else {\r\n validatePathString('Reference.child', 1, pathString, false);\r\n }\r\n }\r\n return new Reference(this.repo, this.path.child(pathString));\r\n };\r\n /** @return {?Reference} */\r\n Reference.prototype.getParent = function () {\r\n validateArgCount('Reference.parent', 0, 0, arguments.length);\r\n var parentPath = this.path.parent();\r\n return parentPath === null ? null : new Reference(this.repo, parentPath);\r\n };\r\n /** @return {!Reference} */\r\n Reference.prototype.getRoot = function () {\r\n validateArgCount('Reference.root', 0, 0, arguments.length);\r\n var ref = this;\r\n while (ref.getParent() !== null) {\r\n ref = ref.getParent();\r\n }\r\n return ref;\r\n };\r\n /** @return {!Database} */\r\n Reference.prototype.databaseProp = function () {\r\n return this.repo.database;\r\n };\r\n /**\r\n * @param {*} newVal\r\n * @param {function(?Error)=} onComplete\r\n * @return {!Promise}\r\n */\r\n Reference.prototype.set = function (newVal, onComplete) {\r\n validateArgCount('Reference.set', 1, 2, arguments.length);\r\n validateWritablePath('Reference.set', this.path);\r\n validateFirebaseDataArg('Reference.set', 1, newVal, this.path, false);\r\n validateCallback('Reference.set', 2, onComplete, true);\r\n var deferred = new Deferred();\r\n this.repo.setWithPriority(this.path, newVal, \r\n /*priority=*/ null, deferred.wrapCallback(onComplete));\r\n return deferred.promise;\r\n };\r\n /**\r\n * @param {!Object} objectToMerge\r\n * @param {function(?Error)=} onComplete\r\n * @return {!Promise}\r\n */\r\n Reference.prototype.update = function (objectToMerge, onComplete) {\r\n validateArgCount('Reference.update', 1, 2, arguments.length);\r\n validateWritablePath('Reference.update', this.path);\r\n if (Array.isArray(objectToMerge)) {\r\n var newObjectToMerge = {};\r\n for (var i = 0; i < objectToMerge.length; ++i) {\r\n newObjectToMerge['' + i] = objectToMerge[i];\r\n }\r\n objectToMerge = newObjectToMerge;\r\n warn('Passing an Array to Firebase.update() is deprecated. ' +\r\n 'Use set() if you want to overwrite the existing data, or ' +\r\n 'an Object with integer keys if you really do want to ' +\r\n 'only update some of the children.');\r\n }\r\n validateFirebaseMergeDataArg('Reference.update', 1, objectToMerge, this.path, false);\r\n validateCallback('Reference.update', 2, onComplete, true);\r\n var deferred = new Deferred();\r\n this.repo.update(this.path, objectToMerge, deferred.wrapCallback(onComplete));\r\n return deferred.promise;\r\n };\r\n /**\r\n * @param {*} newVal\r\n * @param {string|number|null} newPriority\r\n * @param {function(?Error)=} onComplete\r\n * @return {!Promise}\r\n */\r\n Reference.prototype.setWithPriority = function (newVal, newPriority, onComplete) {\r\n validateArgCount('Reference.setWithPriority', 2, 3, arguments.length);\r\n validateWritablePath('Reference.setWithPriority', this.path);\r\n validateFirebaseDataArg('Reference.setWithPriority', 1, newVal, this.path, false);\r\n validatePriority('Reference.setWithPriority', 2, newPriority, false);\r\n validateCallback('Reference.setWithPriority', 3, onComplete, true);\r\n if (this.getKey() === '.length' || this.getKey() === '.keys') {\r\n throw ('Reference.setWithPriority failed: ' +\r\n this.getKey() +\r\n ' is a read-only object.');\r\n }\r\n var deferred = new Deferred();\r\n this.repo.setWithPriority(this.path, newVal, newPriority, deferred.wrapCallback(onComplete));\r\n return deferred.promise;\r\n };\r\n /**\r\n * @param {function(?Error)=} onComplete\r\n * @return {!Promise}\r\n */\r\n Reference.prototype.remove = function (onComplete) {\r\n validateArgCount('Reference.remove', 0, 1, arguments.length);\r\n validateWritablePath('Reference.remove', this.path);\r\n validateCallback('Reference.remove', 1, onComplete, true);\r\n return this.set(null, onComplete);\r\n };\r\n /**\r\n * @param {function(*):*} transactionUpdate\r\n * @param {(function(?Error, boolean, ?DataSnapshot))=} onComplete\r\n * @param {boolean=} applyLocally\r\n * @return {!Promise}\r\n */\r\n Reference.prototype.transaction = function (transactionUpdate, onComplete, applyLocally) {\r\n validateArgCount('Reference.transaction', 1, 3, arguments.length);\r\n validateWritablePath('Reference.transaction', this.path);\r\n validateCallback('Reference.transaction', 1, transactionUpdate, false);\r\n validateCallback('Reference.transaction', 2, onComplete, true);\r\n // NOTE: applyLocally is an internal-only option for now. We need to decide if we want to keep it and how\r\n // to expose it.\r\n validateBoolean('Reference.transaction', 3, applyLocally, true);\r\n if (this.getKey() === '.length' || this.getKey() === '.keys') {\r\n throw ('Reference.transaction failed: ' +\r\n this.getKey() +\r\n ' is a read-only object.');\r\n }\r\n if (applyLocally === undefined) {\r\n applyLocally = true;\r\n }\r\n var deferred = new Deferred();\r\n if (typeof onComplete === 'function') {\r\n deferred.promise.catch(function () { });\r\n }\r\n var promiseComplete = function (error, committed, snapshot) {\r\n if (error) {\r\n deferred.reject(error);\r\n }\r\n else {\r\n deferred.resolve(new TransactionResult(committed, snapshot));\r\n }\r\n if (typeof onComplete === 'function') {\r\n onComplete(error, committed, snapshot);\r\n }\r\n };\r\n this.repo.startTransaction(this.path, transactionUpdate, promiseComplete, applyLocally);\r\n return deferred.promise;\r\n };\r\n /**\r\n * @param {string|number|null} priority\r\n * @param {function(?Error)=} onComplete\r\n * @return {!Promise}\r\n */\r\n Reference.prototype.setPriority = function (priority, onComplete) {\r\n validateArgCount('Reference.setPriority', 1, 2, arguments.length);\r\n validateWritablePath('Reference.setPriority', this.path);\r\n validatePriority('Reference.setPriority', 1, priority, false);\r\n validateCallback('Reference.setPriority', 2, onComplete, true);\r\n var deferred = new Deferred();\r\n this.repo.setWithPriority(this.path.child('.priority'), priority, null, deferred.wrapCallback(onComplete));\r\n return deferred.promise;\r\n };\r\n /**\r\n * @param {*=} value\r\n * @param {function(?Error)=} onComplete\r\n * @return {!Reference}\r\n */\r\n Reference.prototype.push = function (value, onComplete) {\r\n validateArgCount('Reference.push', 0, 2, arguments.length);\r\n validateWritablePath('Reference.push', this.path);\r\n validateFirebaseDataArg('Reference.push', 1, value, this.path, true);\r\n validateCallback('Reference.push', 2, onComplete, true);\r\n var now = this.repo.serverTime();\r\n var name = nextPushId(now);\r\n // push() returns a ThennableReference whose promise is fulfilled with a regular Reference.\r\n // We use child() to create handles to two different references. The first is turned into a\r\n // ThennableReference below by adding then() and catch() methods and is used as the\r\n // return value of push(). The second remains a regular Reference and is used as the fulfilled\r\n // value of the first ThennableReference.\r\n var thennablePushRef = this.child(name);\r\n var pushRef = this.child(name);\r\n var promise;\r\n if (value != null) {\r\n promise = thennablePushRef.set(value, onComplete).then(function () { return pushRef; });\r\n }\r\n else {\r\n promise = Promise.resolve(pushRef);\r\n }\r\n thennablePushRef.then = promise.then.bind(promise);\r\n thennablePushRef.catch = promise.then.bind(promise, undefined);\r\n if (typeof onComplete === 'function') {\r\n promise.catch(function () { });\r\n }\r\n return thennablePushRef;\r\n };\r\n /**\r\n * @return {!OnDisconnect}\r\n */\r\n Reference.prototype.onDisconnect = function () {\r\n validateWritablePath('Reference.onDisconnect', this.path);\r\n return new OnDisconnect(this.repo, this.path);\r\n };\r\n Object.defineProperty(Reference.prototype, \"database\", {\r\n get: function () {\r\n return this.databaseProp();\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Reference.prototype, \"key\", {\r\n get: function () {\r\n return this.getKey();\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Reference.prototype, \"parent\", {\r\n get: function () {\r\n return this.getParent();\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Reference.prototype, \"root\", {\r\n get: function () {\r\n return this.getRoot();\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return Reference;\r\n}(Query));\r\n/**\r\n * Define reference constructor in various modules\r\n *\r\n * We are doing this here to avoid several circular\r\n * dependency issues\r\n */\r\nQuery.__referenceConstructor = Reference;\r\nSyncPoint.__referenceConstructor = Reference;\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Node in a Tree.\r\n */\r\nvar TreeNode = /** @class */ (function () {\r\n function TreeNode() {\r\n // TODO: Consider making accessors that create children and value lazily or\r\n // separate Internal / Leaf 'types'.\r\n this.children = {};\r\n this.childCount = 0;\r\n this.value = null;\r\n }\r\n return TreeNode;\r\n}());\r\n/**\r\n * A light-weight tree, traversable by path. Nodes can have both values and children.\r\n * Nodes are not enumerated (by forEachChild) unless they have a value or non-empty\r\n * children.\r\n */\r\nvar Tree = /** @class */ (function () {\r\n /**\r\n * @template T\r\n * @param {string=} name_ Optional name of the node.\r\n * @param {Tree=} parent_ Optional parent node.\r\n * @param {TreeNode=} node_ Optional node to wrap.\r\n */\r\n function Tree(name_, parent_, node_) {\r\n if (name_ === void 0) { name_ = ''; }\r\n if (parent_ === void 0) { parent_ = null; }\r\n if (node_ === void 0) { node_ = new TreeNode(); }\r\n this.name_ = name_;\r\n this.parent_ = parent_;\r\n this.node_ = node_;\r\n }\r\n /**\r\n * Returns a sub-Tree for the given path.\r\n *\r\n * @param {!(string|Path)} pathObj Path to look up.\r\n * @return {!Tree.<T>} Tree for path.\r\n */\r\n Tree.prototype.subTree = function (pathObj) {\r\n // TODO: Require pathObj to be Path?\r\n var path = pathObj instanceof Path ? pathObj : new Path(pathObj);\r\n var child = this, next = path.getFront();\r\n while (next !== null) {\r\n var childNode = safeGet(child.node_.children, next) || new TreeNode();\r\n child = new Tree(next, child, childNode);\r\n path = path.popFront();\r\n next = path.getFront();\r\n }\r\n return child;\r\n };\r\n /**\r\n * Returns the data associated with this tree node.\r\n *\r\n * @return {?T} The data or null if no data exists.\r\n */\r\n Tree.prototype.getValue = function () {\r\n return this.node_.value;\r\n };\r\n /**\r\n * Sets data to this tree node.\r\n *\r\n * @param {!T} value Value to set.\r\n */\r\n Tree.prototype.setValue = function (value) {\r\n assert(typeof value !== 'undefined', 'Cannot set value to undefined');\r\n this.node_.value = value;\r\n this.updateParents_();\r\n };\r\n /**\r\n * Clears the contents of the tree node (its value and all children).\r\n */\r\n Tree.prototype.clear = function () {\r\n this.node_.value = null;\r\n this.node_.children = {};\r\n this.node_.childCount = 0;\r\n this.updateParents_();\r\n };\r\n /**\r\n * @return {boolean} Whether the tree has any children.\r\n */\r\n Tree.prototype.hasChildren = function () {\r\n return this.node_.childCount > 0;\r\n };\r\n /**\r\n * @return {boolean} Whether the tree is empty (no value or children).\r\n */\r\n Tree.prototype.isEmpty = function () {\r\n return this.getValue() === null && !this.hasChildren();\r\n };\r\n /**\r\n * Calls action for each child of this tree node.\r\n *\r\n * @param {function(!Tree.<T>)} action Action to be called for each child.\r\n */\r\n Tree.prototype.forEachChild = function (action) {\r\n var _this = this;\r\n each(this.node_.children, function (child, childTree) {\r\n action(new Tree(child, _this, childTree));\r\n });\r\n };\r\n /**\r\n * Does a depth-first traversal of this node's descendants, calling action for each one.\r\n *\r\n * @param {function(!Tree.<T>)} action Action to be called for each child.\r\n * @param {boolean=} includeSelf Whether to call action on this node as well. Defaults to\r\n * false.\r\n * @param {boolean=} childrenFirst Whether to call action on children before calling it on\r\n * parent.\r\n */\r\n Tree.prototype.forEachDescendant = function (action, includeSelf, childrenFirst) {\r\n if (includeSelf && !childrenFirst) {\r\n action(this);\r\n }\r\n this.forEachChild(function (child) {\r\n child.forEachDescendant(action, /*includeSelf=*/ true, childrenFirst);\r\n });\r\n if (includeSelf && childrenFirst) {\r\n action(this);\r\n }\r\n };\r\n /**\r\n * Calls action on each ancestor node.\r\n *\r\n * @param {function(!Tree.<T>)} action Action to be called on each parent; return\r\n * true to abort.\r\n * @param {boolean=} includeSelf Whether to call action on this node as well.\r\n * @return {boolean} true if the action callback returned true.\r\n */\r\n Tree.prototype.forEachAncestor = function (action, includeSelf) {\r\n var node = includeSelf ? this : this.parent();\r\n while (node !== null) {\r\n if (action(node)) {\r\n return true;\r\n }\r\n node = node.parent();\r\n }\r\n return false;\r\n };\r\n /**\r\n * Does a depth-first traversal of this node's descendants. When a descendant with a value\r\n * is found, action is called on it and traversal does not continue inside the node.\r\n * Action is *not* called on this node.\r\n *\r\n * @param {function(!Tree.<T>)} action Action to be called for each child.\r\n */\r\n Tree.prototype.forEachImmediateDescendantWithValue = function (action) {\r\n this.forEachChild(function (child) {\r\n if (child.getValue() !== null) {\r\n action(child);\r\n }\r\n else {\r\n child.forEachImmediateDescendantWithValue(action);\r\n }\r\n });\r\n };\r\n /**\r\n * @return {!Path} The path of this tree node, as a Path.\r\n */\r\n Tree.prototype.path = function () {\r\n return new Path(this.parent_ === null\r\n ? this.name_\r\n : this.parent_.path() + '/' + this.name_);\r\n };\r\n /**\r\n * @return {string} The name of the tree node.\r\n */\r\n Tree.prototype.name = function () {\r\n return this.name_;\r\n };\r\n /**\r\n * @return {?Tree} The parent tree node, or null if this is the root of the tree.\r\n */\r\n Tree.prototype.parent = function () {\r\n return this.parent_;\r\n };\r\n /**\r\n * Adds or removes this child from its parent based on whether it's empty or not.\r\n *\r\n * @private\r\n */\r\n Tree.prototype.updateParents_ = function () {\r\n if (this.parent_ !== null) {\r\n this.parent_.updateChild_(this.name_, this);\r\n }\r\n };\r\n /**\r\n * Adds or removes the passed child to this tree node, depending on whether it's empty.\r\n *\r\n * @param {string} childName The name of the child to update.\r\n * @param {!Tree.<T>} child The child to update.\r\n * @private\r\n */\r\n Tree.prototype.updateChild_ = function (childName, child) {\r\n var childEmpty = child.isEmpty();\r\n var childExists = contains(this.node_.children, childName);\r\n if (childEmpty && childExists) {\r\n delete this.node_.children[childName];\r\n this.node_.childCount--;\r\n this.updateParents_();\r\n }\r\n else if (!childEmpty && !childExists) {\r\n this.node_.children[childName] = child.node_;\r\n this.node_.childCount++;\r\n this.updateParents_();\r\n }\r\n };\r\n return Tree;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// TODO: This is pretty messy. Ideally, a lot of this would move into FirebaseData, or a transaction-specific\r\n// component used by FirebaseData, but it has ties to user callbacks (transaction update and onComplete) as well\r\n// as the realtime connection (to send transactions to the server). So that all needs to be decoupled first.\r\n// For now it's part of Repo, but in its own file.\r\n/**\r\n * @enum {number}\r\n */\r\nvar TransactionStatus;\r\n(function (TransactionStatus) {\r\n // We've run the transaction and updated transactionResultData_ with the result, but it isn't currently sent to the\r\n // server. A transaction will go from RUN -> SENT -> RUN if it comes back from the server as rejected due to\r\n // mismatched hash.\r\n TransactionStatus[TransactionStatus[\"RUN\"] = 0] = \"RUN\";\r\n // We've run the transaction and sent it to the server and it's currently outstanding (hasn't come back as accepted\r\n // or rejected yet).\r\n TransactionStatus[TransactionStatus[\"SENT\"] = 1] = \"SENT\";\r\n // Temporary state used to mark completed transactions (whether successful or aborted). The transaction will be\r\n // removed when we get a chance to prune completed ones.\r\n TransactionStatus[TransactionStatus[\"COMPLETED\"] = 2] = \"COMPLETED\";\r\n // Used when an already-sent transaction needs to be aborted (e.g. due to a conflicting set() call that was made).\r\n // If it comes back as unsuccessful, we'll abort it.\r\n TransactionStatus[TransactionStatus[\"SENT_NEEDS_ABORT\"] = 3] = \"SENT_NEEDS_ABORT\";\r\n // Temporary state used to mark transactions that need to be aborted.\r\n TransactionStatus[TransactionStatus[\"NEEDS_ABORT\"] = 4] = \"NEEDS_ABORT\";\r\n})(TransactionStatus || (TransactionStatus = {}));\r\n/**\r\n * If a transaction does not succeed after 25 retries, we abort it. Among other things this ensure that if there's\r\n * ever a bug causing a mismatch between client / server hashes for some data, we won't retry indefinitely.\r\n * @type {number}\r\n * @const\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.MAX_TRANSACTION_RETRIES_ = 25;\r\n/**\r\n * Setup the transaction data structures\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.transactionsInit_ = function () {\r\n /**\r\n * Stores queues of outstanding transactions for Firebase locations.\r\n *\r\n * @type {!Tree.<Array.<!Transaction>>}\r\n * @private\r\n */\r\n this.transactionQueueTree_ = new Tree();\r\n};\r\n/**\r\n * Creates a new transaction, adds it to the transactions we're tracking, and sends it to the server if possible.\r\n *\r\n * @param {!Path} path Path at which to do transaction.\r\n * @param {function(*):*} transactionUpdate Update callback.\r\n * @param {?function(?Error, boolean, ?DataSnapshot)} onComplete Completion callback.\r\n * @param {boolean} applyLocally Whether or not to make intermediate results visible\r\n */\r\nRepo.prototype.startTransaction = function (path, transactionUpdate, onComplete, applyLocally) {\r\n this.log_('transaction on ' + path);\r\n // Add a watch to make sure we get server updates.\r\n var valueCallback = function () { };\r\n var watchRef = new Reference(this, path);\r\n watchRef.on('value', valueCallback);\r\n var unwatcher = function () {\r\n watchRef.off('value', valueCallback);\r\n };\r\n // Initialize transaction.\r\n var transaction = {\r\n path: path,\r\n update: transactionUpdate,\r\n onComplete: onComplete,\r\n // One of TransactionStatus enums.\r\n status: null,\r\n // Used when combining transactions at different locations to figure out which one goes first.\r\n order: LUIDGenerator(),\r\n // Whether to raise local events for this transaction.\r\n applyLocally: applyLocally,\r\n // Count of how many times we've retried the transaction.\r\n retryCount: 0,\r\n // Function to call to clean up our .on() listener.\r\n unwatcher: unwatcher,\r\n // Stores why a transaction was aborted.\r\n abortReason: null,\r\n currentWriteId: null,\r\n currentInputSnapshot: null,\r\n currentOutputSnapshotRaw: null,\r\n currentOutputSnapshotResolved: null\r\n };\r\n // Run transaction initially.\r\n var currentState = this.getLatestState_(path);\r\n transaction.currentInputSnapshot = currentState;\r\n var newVal = transaction.update(currentState.val());\r\n if (newVal === undefined) {\r\n // Abort transaction.\r\n transaction.unwatcher();\r\n transaction.currentOutputSnapshotRaw = null;\r\n transaction.currentOutputSnapshotResolved = null;\r\n if (transaction.onComplete) {\r\n // We just set the input snapshot, so this cast should be safe\r\n var snapshot = new DataSnapshot(transaction.currentInputSnapshot, new Reference(this, transaction.path), PRIORITY_INDEX);\r\n transaction.onComplete(null, false, snapshot);\r\n }\r\n }\r\n else {\r\n validateFirebaseData('transaction failed: Data returned ', newVal, transaction.path);\r\n // Mark as run and add to our queue.\r\n transaction.status = TransactionStatus.RUN;\r\n var queueNode = this.transactionQueueTree_.subTree(path);\r\n var nodeQueue = queueNode.getValue() || [];\r\n nodeQueue.push(transaction);\r\n queueNode.setValue(nodeQueue);\r\n // Update visibleData and raise events\r\n // Note: We intentionally raise events after updating all of our transaction state, since the user could\r\n // start new transactions from the event callbacks.\r\n var priorityForNode = void 0;\r\n if (typeof newVal === 'object' &&\r\n newVal !== null &&\r\n contains(newVal, '.priority')) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n priorityForNode = safeGet(newVal, '.priority');\r\n assert(isValidPriority(priorityForNode), 'Invalid priority returned by transaction. ' +\r\n 'Priority must be a valid string, finite number, server value, or null.');\r\n }\r\n else {\r\n var currentNode = this.serverSyncTree_.calcCompleteEventCache(path) ||\r\n ChildrenNode.EMPTY_NODE;\r\n priorityForNode = currentNode.getPriority().val();\r\n }\r\n priorityForNode /** @type {null|number|string} */ = priorityForNode;\r\n var serverValues = this.generateServerValues();\r\n var newNodeUnresolved = nodeFromJSON$1(newVal, priorityForNode);\r\n var newNode = resolveDeferredValueSnapshot(newNodeUnresolved, currentState, serverValues);\r\n transaction.currentOutputSnapshotRaw = newNodeUnresolved;\r\n transaction.currentOutputSnapshotResolved = newNode;\r\n transaction.currentWriteId = this.getNextWriteId_();\r\n var events = this.serverSyncTree_.applyUserOverwrite(path, newNode, transaction.currentWriteId, transaction.applyLocally);\r\n this.eventQueue_.raiseEventsForChangedPath(path, events);\r\n this.sendReadyTransactions_();\r\n }\r\n};\r\n/**\r\n * @param {!Path} path\r\n * @param {Array.<number>=} excludeSets A specific set to exclude\r\n * @return {Node}\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.getLatestState_ = function (path, excludeSets) {\r\n return (this.serverSyncTree_.calcCompleteEventCache(path, excludeSets) ||\r\n ChildrenNode.EMPTY_NODE);\r\n};\r\n/**\r\n * Sends any already-run transactions that aren't waiting for outstanding transactions to\r\n * complete.\r\n *\r\n * Externally it's called with no arguments, but it calls itself recursively with a particular\r\n * transactionQueueTree node to recurse through the tree.\r\n *\r\n * @param {Tree.<Array.<Transaction>>=} node transactionQueueTree node to start at.\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.sendReadyTransactions_ = function (node) {\r\n var _this = this;\r\n if (node === void 0) { node = this.transactionQueueTree_; }\r\n // Before recursing, make sure any completed transactions are removed.\r\n if (!node) {\r\n this.pruneCompletedTransactionsBelowNode_(node);\r\n }\r\n if (node.getValue() !== null) {\r\n var queue = this.buildTransactionQueue_(node);\r\n assert(queue.length > 0, 'Sending zero length transaction queue');\r\n var allRun = queue.every(function (transaction) { return transaction.status === TransactionStatus.RUN; });\r\n // If they're all run (and not sent), we can send them. Else, we must wait.\r\n if (allRun) {\r\n this.sendTransactionQueue_(node.path(), queue);\r\n }\r\n }\r\n else if (node.hasChildren()) {\r\n node.forEachChild(function (childNode) {\r\n _this.sendReadyTransactions_(childNode);\r\n });\r\n }\r\n};\r\n/**\r\n * Given a list of run transactions, send them to the server and then handle the result (success or failure).\r\n *\r\n * @param {!Path} path The location of the queue.\r\n * @param {!Array.<Transaction>} queue Queue of transactions under the specified location.\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.sendTransactionQueue_ = function (path, queue) {\r\n var _this = this;\r\n // Mark transactions as sent and increment retry count!\r\n var setsToIgnore = queue.map(function (txn) {\r\n return txn.currentWriteId;\r\n });\r\n var latestState = this.getLatestState_(path, setsToIgnore);\r\n var snapToSend = latestState;\r\n var latestHash = latestState.hash();\r\n for (var i = 0; i < queue.length; i++) {\r\n var txn = queue[i];\r\n assert(txn.status === TransactionStatus.RUN, 'tryToSendTransactionQueue_: items in queue should all be run.');\r\n txn.status = TransactionStatus.SENT;\r\n txn.retryCount++;\r\n var relativePath = Path.relativePath(path, txn.path);\r\n // If we've gotten to this point, the output snapshot must be defined.\r\n snapToSend = snapToSend.updateChild(relativePath /** @type {!Node} */, txn.currentOutputSnapshotRaw);\r\n }\r\n var dataToSend = snapToSend.val(true);\r\n var pathToSend = path;\r\n // Send the put.\r\n this.server_.put(pathToSend.toString(), dataToSend, function (status) {\r\n _this.log_('transaction put response', {\r\n path: pathToSend.toString(),\r\n status: status\r\n });\r\n var events = [];\r\n if (status === 'ok') {\r\n // Queue up the callbacks and fire them after cleaning up all of our transaction state, since\r\n // the callback could trigger more transactions or sets.\r\n var callbacks = [];\r\n for (var i = 0; i < queue.length; i++) {\r\n queue[i].status = TransactionStatus.COMPLETED;\r\n events = events.concat(_this.serverSyncTree_.ackUserWrite(queue[i].currentWriteId));\r\n if (queue[i].onComplete) {\r\n // We never unset the output snapshot, and given that this transaction is complete, it should be set\r\n var node = queue[i].currentOutputSnapshotResolved;\r\n var ref = new Reference(_this, queue[i].path);\r\n var snapshot = new DataSnapshot(node, ref, PRIORITY_INDEX);\r\n callbacks.push(queue[i].onComplete.bind(null, null, true, snapshot));\r\n }\r\n queue[i].unwatcher();\r\n }\r\n // Now remove the completed transactions.\r\n _this.pruneCompletedTransactionsBelowNode_(_this.transactionQueueTree_.subTree(path));\r\n // There may be pending transactions that we can now send.\r\n _this.sendReadyTransactions_();\r\n _this.eventQueue_.raiseEventsForChangedPath(path, events);\r\n // Finally, trigger onComplete callbacks.\r\n for (var i = 0; i < callbacks.length; i++) {\r\n exceptionGuard(callbacks[i]);\r\n }\r\n }\r\n else {\r\n // transactions are no longer sent. Update their status appropriately.\r\n if (status === 'datastale') {\r\n for (var i = 0; i < queue.length; i++) {\r\n if (queue[i].status === TransactionStatus.SENT_NEEDS_ABORT) {\r\n queue[i].status = TransactionStatus.NEEDS_ABORT;\r\n }\r\n else {\r\n queue[i].status = TransactionStatus.RUN;\r\n }\r\n }\r\n }\r\n else {\r\n warn('transaction at ' + pathToSend.toString() + ' failed: ' + status);\r\n for (var i = 0; i < queue.length; i++) {\r\n queue[i].status = TransactionStatus.NEEDS_ABORT;\r\n queue[i].abortReason = status;\r\n }\r\n }\r\n _this.rerunTransactions_(path);\r\n }\r\n }, latestHash);\r\n};\r\n/**\r\n * Finds all transactions dependent on the data at changedPath and reruns them.\r\n *\r\n * Should be called any time cached data changes.\r\n *\r\n * Return the highest path that was affected by rerunning transactions. This is the path at which events need to\r\n * be raised for.\r\n *\r\n * @param {!Path} changedPath The path in mergedData that changed.\r\n * @return {!Path} The rootmost path that was affected by rerunning transactions.\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.rerunTransactions_ = function (changedPath) {\r\n var rootMostTransactionNode = this.getAncestorTransactionNode_(changedPath);\r\n var path = rootMostTransactionNode.path();\r\n var queue = this.buildTransactionQueue_(rootMostTransactionNode);\r\n this.rerunTransactionQueue_(queue, path);\r\n return path;\r\n};\r\n/**\r\n * Does all the work of rerunning transactions (as well as cleans up aborted transactions and whatnot).\r\n *\r\n * @param {Array.<Transaction>} queue The queue of transactions to run.\r\n * @param {!Path} path The path the queue is for.\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.rerunTransactionQueue_ = function (queue, path) {\r\n if (queue.length === 0) {\r\n return; // Nothing to do!\r\n }\r\n // Queue up the callbacks and fire them after cleaning up all of our transaction state, since\r\n // the callback could trigger more transactions or sets.\r\n var callbacks = [];\r\n var events = [];\r\n // Ignore all of the sets we're going to re-run.\r\n var txnsToRerun = queue.filter(function (q) {\r\n return q.status === TransactionStatus.RUN;\r\n });\r\n var setsToIgnore = txnsToRerun.map(function (q) {\r\n return q.currentWriteId;\r\n });\r\n for (var i = 0; i < queue.length; i++) {\r\n var transaction = queue[i];\r\n var relativePath = Path.relativePath(path, transaction.path);\r\n var abortTransaction = false, abortReason = void 0;\r\n assert(relativePath !== null, 'rerunTransactionsUnderNode_: relativePath should not be null.');\r\n if (transaction.status === TransactionStatus.NEEDS_ABORT) {\r\n abortTransaction = true;\r\n abortReason = transaction.abortReason;\r\n events = events.concat(this.serverSyncTree_.ackUserWrite(transaction.currentWriteId, true));\r\n }\r\n else if (transaction.status === TransactionStatus.RUN) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n if (transaction.retryCount >= Repo.MAX_TRANSACTION_RETRIES_) {\r\n abortTransaction = true;\r\n abortReason = 'maxretry';\r\n events = events.concat(this.serverSyncTree_.ackUserWrite(transaction.currentWriteId, true));\r\n }\r\n else {\r\n // This code reruns a transaction\r\n var currentNode = this.getLatestState_(transaction.path, setsToIgnore);\r\n transaction.currentInputSnapshot = currentNode;\r\n var newData = queue[i].update(currentNode.val());\r\n if (newData !== undefined) {\r\n validateFirebaseData('transaction failed: Data returned ', newData, transaction.path);\r\n var newDataNode = nodeFromJSON$1(newData);\r\n var hasExplicitPriority = typeof newData === 'object' &&\r\n newData != null &&\r\n contains(newData, '.priority');\r\n if (!hasExplicitPriority) {\r\n // Keep the old priority if there wasn't a priority explicitly specified.\r\n newDataNode = newDataNode.updatePriority(currentNode.getPriority());\r\n }\r\n var oldWriteId = transaction.currentWriteId;\r\n var serverValues = this.generateServerValues();\r\n var newNodeResolved = resolveDeferredValueSnapshot(newDataNode, currentNode, serverValues);\r\n transaction.currentOutputSnapshotRaw = newDataNode;\r\n transaction.currentOutputSnapshotResolved = newNodeResolved;\r\n transaction.currentWriteId = this.getNextWriteId_();\r\n // Mutates setsToIgnore in place\r\n setsToIgnore.splice(setsToIgnore.indexOf(oldWriteId), 1);\r\n events = events.concat(this.serverSyncTree_.applyUserOverwrite(transaction.path, newNodeResolved, transaction.currentWriteId, transaction.applyLocally));\r\n events = events.concat(this.serverSyncTree_.ackUserWrite(oldWriteId, true));\r\n }\r\n else {\r\n abortTransaction = true;\r\n abortReason = 'nodata';\r\n events = events.concat(this.serverSyncTree_.ackUserWrite(transaction.currentWriteId, true));\r\n }\r\n }\r\n }\r\n this.eventQueue_.raiseEventsForChangedPath(path, events);\r\n events = [];\r\n if (abortTransaction) {\r\n // Abort.\r\n queue[i].status = TransactionStatus.COMPLETED;\r\n // Removing a listener can trigger pruning which can muck with mergedData/visibleData (as it prunes data).\r\n // So defer the unwatcher until we're done.\r\n (function (unwatcher) {\r\n setTimeout(unwatcher, Math.floor(0));\r\n })(queue[i].unwatcher);\r\n if (queue[i].onComplete) {\r\n if (abortReason === 'nodata') {\r\n var ref = new Reference(this, queue[i].path);\r\n // We set this field immediately, so it's safe to cast to an actual snapshot\r\n var lastInput /** @type {!Node} */ = queue[i].currentInputSnapshot;\r\n var snapshot = new DataSnapshot(lastInput, ref, PRIORITY_INDEX);\r\n callbacks.push(queue[i].onComplete.bind(null, null, false, snapshot));\r\n }\r\n else {\r\n callbacks.push(queue[i].onComplete.bind(null, new Error(abortReason), false, null));\r\n }\r\n }\r\n }\r\n }\r\n // Clean up completed transactions.\r\n this.pruneCompletedTransactionsBelowNode_(this.transactionQueueTree_);\r\n // Now fire callbacks, now that we're in a good, known state.\r\n for (var i = 0; i < callbacks.length; i++) {\r\n exceptionGuard(callbacks[i]);\r\n }\r\n // Try to send the transaction result to the server.\r\n this.sendReadyTransactions_();\r\n};\r\n/**\r\n * Returns the rootmost ancestor node of the specified path that has a pending transaction on it, or just returns\r\n * the node for the given path if there are no pending transactions on any ancestor.\r\n *\r\n * @param {!Path} path The location to start at.\r\n * @return {!Tree.<Array.<!Transaction>>} The rootmost node with a transaction.\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.getAncestorTransactionNode_ = function (path) {\r\n var front;\r\n // Start at the root and walk deeper into the tree towards path until we find a node with pending transactions.\r\n var transactionNode = this.transactionQueueTree_;\r\n front = path.getFront();\r\n while (front !== null && transactionNode.getValue() === null) {\r\n transactionNode = transactionNode.subTree(front);\r\n path = path.popFront();\r\n front = path.getFront();\r\n }\r\n return transactionNode;\r\n};\r\n/**\r\n * Builds the queue of all transactions at or below the specified transactionNode.\r\n *\r\n * @param {!Tree.<Array.<Transaction>>} transactionNode\r\n * @return {Array.<Transaction>} The generated queue.\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.buildTransactionQueue_ = function (transactionNode) {\r\n // Walk any child transaction queues and aggregate them into a single queue.\r\n var transactionQueue = [];\r\n this.aggregateTransactionQueuesForNode_(transactionNode, transactionQueue);\r\n // Sort them by the order the transactions were created.\r\n transactionQueue.sort(function (a, b) {\r\n return a.order - b.order;\r\n });\r\n return transactionQueue;\r\n};\r\n/**\r\n * @param {!Tree.<Array.<Transaction>>} node\r\n * @param {Array.<Transaction>} queue\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.aggregateTransactionQueuesForNode_ = function (node, queue) {\r\n var _this = this;\r\n var nodeQueue = node.getValue();\r\n if (nodeQueue !== null) {\r\n for (var i = 0; i < nodeQueue.length; i++) {\r\n queue.push(nodeQueue[i]);\r\n }\r\n }\r\n node.forEachChild(function (child) {\r\n _this.aggregateTransactionQueuesForNode_(child, queue);\r\n });\r\n};\r\n/**\r\n * Remove COMPLETED transactions at or below this node in the transactionQueueTree_.\r\n *\r\n * @param {!Tree.<Array.<!Transaction>>} node\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.pruneCompletedTransactionsBelowNode_ = function (node) {\r\n var _this = this;\r\n var queue = node.getValue();\r\n if (queue) {\r\n var to = 0;\r\n for (var from = 0; from < queue.length; from++) {\r\n if (queue[from].status !== TransactionStatus.COMPLETED) {\r\n queue[to] = queue[from];\r\n to++;\r\n }\r\n }\r\n queue.length = to;\r\n node.setValue(queue.length > 0 ? queue : null);\r\n }\r\n node.forEachChild(function (childNode) {\r\n _this.pruneCompletedTransactionsBelowNode_(childNode);\r\n });\r\n};\r\n/**\r\n * Aborts all transactions on ancestors or descendants of the specified path. Called when doing a set() or update()\r\n * since we consider them incompatible with transactions.\r\n *\r\n * @param {!Path} path Path for which we want to abort related transactions.\r\n * @return {!Path}\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.abortTransactions_ = function (path) {\r\n var _this = this;\r\n var affectedPath = this.getAncestorTransactionNode_(path).path();\r\n var transactionNode = this.transactionQueueTree_.subTree(path);\r\n transactionNode.forEachAncestor(function (node) {\r\n _this.abortTransactionsOnNode_(node);\r\n });\r\n this.abortTransactionsOnNode_(transactionNode);\r\n transactionNode.forEachDescendant(function (node) {\r\n _this.abortTransactionsOnNode_(node);\r\n });\r\n return affectedPath;\r\n};\r\n/**\r\n * Abort transactions stored in this transaction queue node.\r\n *\r\n * @param {!Tree.<Array.<Transaction>>} node Node to abort transactions for.\r\n * @private\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nRepo.prototype.abortTransactionsOnNode_ = function (node) {\r\n var queue = node.getValue();\r\n if (queue !== null) {\r\n // Queue up the callbacks and fire them after cleaning up all of our transaction state, since\r\n // the callback could trigger more transactions or sets.\r\n var callbacks = [];\r\n // Go through queue. Any already-sent transactions must be marked for abort, while the unsent ones\r\n // can be immediately aborted and removed.\r\n var events = [];\r\n var lastSent = -1;\r\n for (var i = 0; i < queue.length; i++) {\r\n if (queue[i].status === TransactionStatus.SENT_NEEDS_ABORT) ;\r\n else if (queue[i].status === TransactionStatus.SENT) {\r\n assert(lastSent === i - 1, 'All SENT items should be at beginning of queue.');\r\n lastSent = i;\r\n // Mark transaction for abort when it comes back.\r\n queue[i].status = TransactionStatus.SENT_NEEDS_ABORT;\r\n queue[i].abortReason = 'set';\r\n }\r\n else {\r\n assert(queue[i].status === TransactionStatus.RUN, 'Unexpected transaction status in abort');\r\n // We can abort it immediately.\r\n queue[i].unwatcher();\r\n events = events.concat(this.serverSyncTree_.ackUserWrite(queue[i].currentWriteId, true));\r\n if (queue[i].onComplete) {\r\n var snapshot = null;\r\n callbacks.push(queue[i].onComplete.bind(null, new Error('set'), false, snapshot));\r\n }\r\n }\r\n }\r\n if (lastSent === -1) {\r\n // We're not waiting for any sent transactions. We can clear the queue.\r\n node.setValue(null);\r\n }\r\n else {\r\n // Remove the transactions we aborted.\r\n queue.length = lastSent + 1;\r\n }\r\n // Now fire the callbacks.\r\n this.eventQueue_.raiseEventsForChangedPath(node.path(), events);\r\n for (var i = 0; i < callbacks.length; i++) {\r\n exceptionGuard(callbacks[i]);\r\n }\r\n }\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Abstraction around FirebaseApp's token fetching capabilities.\r\n */\r\nvar FirebaseAuthTokenProvider = /** @class */ (function () {\r\n function FirebaseAuthTokenProvider(app_, authProvider_) {\r\n var _this = this;\r\n this.app_ = app_;\r\n this.authProvider_ = authProvider_;\r\n this.auth_ = null;\r\n this.auth_ = authProvider_.getImmediate({ optional: true });\r\n if (!this.auth_) {\r\n authProvider_.get().then(function (auth) { return (_this.auth_ = auth); });\r\n }\r\n }\r\n /**\r\n * @param {boolean} forceRefresh\r\n * @return {!Promise<FirebaseAuthTokenData>}\r\n */\r\n FirebaseAuthTokenProvider.prototype.getToken = function (forceRefresh) {\r\n if (!this.auth_) {\r\n return Promise.resolve(null);\r\n }\r\n return this.auth_.getToken(forceRefresh).catch(function (error) {\r\n // TODO: Need to figure out all the cases this is raised and whether\r\n // this makes sense.\r\n if (error && error.code === 'auth/token-not-initialized') {\r\n log('Got auth/token-not-initialized error. Treating as null token.');\r\n return null;\r\n }\r\n else {\r\n return Promise.reject(error);\r\n }\r\n });\r\n };\r\n FirebaseAuthTokenProvider.prototype.addTokenChangeListener = function (listener) {\r\n // TODO: We might want to wrap the listener and call it with no args to\r\n // avoid a leaky abstraction, but that makes removing the listener harder.\r\n if (this.auth_) {\r\n this.auth_.addAuthTokenListener(listener);\r\n }\r\n else {\r\n setTimeout(function () { return listener(null); }, 0);\r\n this.authProvider_\r\n .get()\r\n .then(function (auth) { return auth.addAuthTokenListener(listener); });\r\n }\r\n };\r\n FirebaseAuthTokenProvider.prototype.removeTokenChangeListener = function (listener) {\r\n this.authProvider_\r\n .get()\r\n .then(function (auth) { return auth.removeAuthTokenListener(listener); });\r\n };\r\n FirebaseAuthTokenProvider.prototype.notifyForInvalidToken = function () {\r\n var errorMessage = 'Provided authentication credentials for the app named \"' +\r\n this.app_.name +\r\n '\" are invalid. This usually indicates your app was not ' +\r\n 'initialized correctly. ';\r\n if ('credential' in this.app_.options) {\r\n errorMessage +=\r\n 'Make sure the \"credential\" property provided to initializeApp() ' +\r\n 'is authorized to access the specified \"databaseURL\" and is from the correct ' +\r\n 'project.';\r\n }\r\n else if ('serviceAccount' in this.app_.options) {\r\n errorMessage +=\r\n 'Make sure the \"serviceAccount\" property provided to initializeApp() ' +\r\n 'is authorized to access the specified \"databaseURL\" and is from the correct ' +\r\n 'project.';\r\n }\r\n else {\r\n errorMessage +=\r\n 'Make sure the \"apiKey\" and \"databaseURL\" properties provided to ' +\r\n 'initializeApp() match the values provided for your app at ' +\r\n 'https://console.firebase.google.com/.';\r\n }\r\n warn(errorMessage);\r\n };\r\n return FirebaseAuthTokenProvider;\r\n}());\r\n/* Auth token provider that the Admin SDK uses to connect to the Emulator. */\r\nvar EmulatorAdminTokenProvider = /** @class */ (function () {\r\n function EmulatorAdminTokenProvider() {\r\n }\r\n EmulatorAdminTokenProvider.prototype.getToken = function (forceRefresh) {\r\n return Promise.resolve({\r\n accessToken: EmulatorAdminTokenProvider.EMULATOR_AUTH_TOKEN\r\n });\r\n };\r\n EmulatorAdminTokenProvider.prototype.addTokenChangeListener = function (listener) {\r\n // Invoke the listener immediately to match the behavior in Firebase Auth\r\n // (see packages/auth/src/auth.js#L1807)\r\n listener(EmulatorAdminTokenProvider.EMULATOR_AUTH_TOKEN);\r\n };\r\n EmulatorAdminTokenProvider.prototype.removeTokenChangeListener = function (listener) { };\r\n EmulatorAdminTokenProvider.prototype.notifyForInvalidToken = function () { };\r\n EmulatorAdminTokenProvider.EMULATOR_AUTH_TOKEN = 'owner';\r\n return EmulatorAdminTokenProvider;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * This variable is also defined in the firebase node.js admin SDK. Before\r\n * modifying this definition, consult the definition in:\r\n *\r\n * https://github.com/firebase/firebase-admin-node\r\n *\r\n * and make sure the two are consistent.\r\n */\r\nvar FIREBASE_DATABASE_EMULATOR_HOST_VAR = 'FIREBASE_DATABASE_EMULATOR_HOST';\r\nvar _staticInstance;\r\n/**\r\n * Creates and caches Repo instances.\r\n */\r\nvar RepoManager = /** @class */ (function () {\r\n function RepoManager() {\r\n /**\r\n * @private {!Object.<string, Object<string, !fb.core.Repo>>}\r\n */\r\n this.repos_ = {};\r\n /**\r\n * If true, new Repos will be created to use ReadonlyRestClient (for testing purposes).\r\n * @private {boolean}\r\n */\r\n this.useRestClient_ = false;\r\n }\r\n RepoManager.getInstance = function () {\r\n if (!_staticInstance) {\r\n _staticInstance = new RepoManager();\r\n }\r\n return _staticInstance;\r\n };\r\n // TODO(koss): Remove these functions unless used in tests?\r\n RepoManager.prototype.interrupt = function () {\r\n var e_1, _a, e_2, _b;\r\n try {\r\n for (var _c = __values(Object.keys(this.repos_)), _d = _c.next(); !_d.done; _d = _c.next()) {\r\n var appName = _d.value;\r\n try {\r\n for (var _e = (e_2 = void 0, __values(Object.keys(this.repos_[appName]))), _f = _e.next(); !_f.done; _f = _e.next()) {\r\n var dbUrl = _f.value;\r\n this.repos_[appName][dbUrl].interrupt();\r\n }\r\n }\r\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\r\n finally {\r\n try {\r\n if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\r\n }\r\n finally { if (e_2) throw e_2.error; }\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n };\r\n RepoManager.prototype.resume = function () {\r\n var e_3, _a, e_4, _b;\r\n try {\r\n for (var _c = __values(Object.keys(this.repos_)), _d = _c.next(); !_d.done; _d = _c.next()) {\r\n var appName = _d.value;\r\n try {\r\n for (var _e = (e_4 = void 0, __values(Object.keys(this.repos_[appName]))), _f = _e.next(); !_f.done; _f = _e.next()) {\r\n var dbUrl = _f.value;\r\n this.repos_[appName][dbUrl].resume();\r\n }\r\n }\r\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\r\n finally {\r\n try {\r\n if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\r\n }\r\n finally { if (e_4) throw e_4.error; }\r\n }\r\n }\r\n }\r\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\r\n finally {\r\n try {\r\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\r\n }\r\n finally { if (e_3) throw e_3.error; }\r\n }\r\n };\r\n /**\r\n * Update an existing repo in place to point to a new host/port.\r\n */\r\n RepoManager.prototype.applyEmulatorSettings = function (repo, host, port) {\r\n repo.repoInfo_ = new RepoInfo(host + \":\" + port, \r\n /* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams);\r\n if (repo.repoInfo_.nodeAdmin) {\r\n repo.authTokenProvider_ = new EmulatorAdminTokenProvider();\r\n }\r\n };\r\n /**\r\n * This function should only ever be called to CREATE a new database instance.\r\n *\r\n * @param {!FirebaseApp} app\r\n * @return {!Database}\r\n */\r\n RepoManager.prototype.databaseFromApp = function (app, authProvider, url, nodeAdmin) {\r\n var dbUrl = url || app.options.databaseURL;\r\n if (dbUrl === undefined) {\r\n if (!app.options.projectId) {\r\n fatal(\"Can't determine Firebase Database URL. Be sure to include \" +\r\n ' a Project ID when calling firebase.initializeApp().');\r\n }\r\n log('Using default host for project ', app.options.projectId);\r\n dbUrl = app.options.projectId + \"-default-rtdb.firebaseio.com\";\r\n }\r\n var parsedUrl = parseRepoInfo(dbUrl, nodeAdmin);\r\n var repoInfo = parsedUrl.repoInfo;\r\n var isEmulator;\r\n var dbEmulatorHost = undefined;\r\n if (typeof process !== 'undefined') {\r\n dbEmulatorHost = process.env[FIREBASE_DATABASE_EMULATOR_HOST_VAR];\r\n }\r\n if (dbEmulatorHost) {\r\n isEmulator = true;\r\n dbUrl = \"http://\" + dbEmulatorHost + \"?ns=\" + repoInfo.namespace;\r\n parsedUrl = parseRepoInfo(dbUrl, nodeAdmin);\r\n repoInfo = parsedUrl.repoInfo;\r\n }\r\n else {\r\n isEmulator = !parsedUrl.repoInfo.secure;\r\n }\r\n var authTokenProvider = nodeAdmin && isEmulator\r\n ? new EmulatorAdminTokenProvider()\r\n : new FirebaseAuthTokenProvider(app, authProvider);\r\n validateUrl('Invalid Firebase Database URL', 1, parsedUrl);\r\n if (!parsedUrl.path.isEmpty()) {\r\n fatal('Database URL must point to the root of a Firebase Database ' +\r\n '(not including a child path).');\r\n }\r\n var repo = this.createRepo(repoInfo, app, authTokenProvider);\r\n return repo.database;\r\n };\r\n /**\r\n * Remove the repo and make sure it is disconnected.\r\n *\r\n * @param {!Repo} repo\r\n */\r\n RepoManager.prototype.deleteRepo = function (repo) {\r\n var appRepos = safeGet(this.repos_, repo.app.name);\r\n // This should never happen...\r\n if (!appRepos || safeGet(appRepos, repo.key) !== repo) {\r\n fatal(\"Database \" + repo.app.name + \"(\" + repo.repoInfo_ + \") has already been deleted.\");\r\n }\r\n repo.interrupt();\r\n delete appRepos[repo.key];\r\n };\r\n /**\r\n * Ensures a repo doesn't already exist and then creates one using the\r\n * provided app.\r\n *\r\n * @param {!RepoInfo} repoInfo The metadata about the Repo\r\n * @param {!FirebaseApp} app\r\n * @return {!Repo} The Repo object for the specified server / repoName.\r\n */\r\n RepoManager.prototype.createRepo = function (repoInfo, app, authTokenProvider) {\r\n var appRepos = safeGet(this.repos_, app.name);\r\n if (!appRepos) {\r\n appRepos = {};\r\n this.repos_[app.name] = appRepos;\r\n }\r\n var repo = safeGet(appRepos, repoInfo.toURLString());\r\n if (repo) {\r\n fatal('Database initialized multiple times. Please make sure the format of the database URL matches with each database() call.');\r\n }\r\n repo = new Repo(repoInfo, this.useRestClient_, app, authTokenProvider);\r\n appRepos[repoInfo.toURLString()] = repo;\r\n return repo;\r\n };\r\n /**\r\n * Forces us to use ReadonlyRestClient instead of PersistentConnection for new Repos.\r\n * @param {boolean} forceRestClient\r\n */\r\n RepoManager.prototype.forceRestClient = function (forceRestClient) {\r\n this.useRestClient_ = forceRestClient;\r\n };\r\n return RepoManager;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Class representing a firebase database.\r\n * @implements {FirebaseService}\r\n */\r\nvar Database = /** @class */ (function () {\r\n /**\r\n * The constructor should not be called by users of our public API.\r\n * @param {!Repo} repoInternal_\r\n */\r\n function Database(repoInternal_) {\r\n var _this = this;\r\n this.repoInternal_ = repoInternal_;\r\n /** Track if the instance has been used (root or repo accessed) */\r\n this.instanceStarted_ = false;\r\n this.INTERNAL = {\r\n delete: function () { return __awaiter(_this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n this.checkDeleted_('delete');\r\n RepoManager.getInstance().deleteRepo(this.repo_);\r\n this.repoInternal_ = null;\r\n this.rootInternal_ = null;\r\n return [2 /*return*/];\r\n });\r\n }); }\r\n };\r\n if (!(repoInternal_ instanceof Repo)) {\r\n fatal(\"Don't call new Database() directly - please use firebase.database().\");\r\n }\r\n }\r\n Object.defineProperty(Database.prototype, \"repo_\", {\r\n get: function () {\r\n if (!this.instanceStarted_) {\r\n this.repoInternal_.start();\r\n this.instanceStarted_ = true;\r\n }\r\n return this.repoInternal_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Database.prototype, \"root_\", {\r\n get: function () {\r\n if (!this.rootInternal_) {\r\n this.rootInternal_ = new Reference(this.repo_, Path.Empty);\r\n }\r\n return this.rootInternal_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Database.prototype, \"app\", {\r\n get: function () {\r\n return this.repo_.app;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Modify this instance to communicate with the Realtime Database emulator.\r\n *\r\n * <p>Note: This method must be called before performing any other operation.\r\n *\r\n * @param host the emulator host (ex: localhost)\r\n * @param port the emulator port (ex: 8080)\r\n */\r\n Database.prototype.useEmulator = function (host, port) {\r\n this.checkDeleted_('useEmulator');\r\n if (this.instanceStarted_) {\r\n fatal('Cannot call useEmulator() after instance has already been initialized.');\r\n return;\r\n }\r\n // Modify the repo to apply emulator settings\r\n RepoManager.getInstance().applyEmulatorSettings(this.repoInternal_, host, port);\r\n };\r\n Database.prototype.ref = function (path) {\r\n this.checkDeleted_('ref');\r\n validateArgCount('database.ref', 0, 1, arguments.length);\r\n if (path instanceof Reference) {\r\n return this.refFromURL(path.toString());\r\n }\r\n return path !== undefined ? this.root_.child(path) : this.root_;\r\n };\r\n /**\r\n * Returns a reference to the root or the path specified in url.\r\n * We throw a exception if the url is not in the same domain as the\r\n * current repo.\r\n * @param {string} url\r\n * @return {!Reference} Firebase reference.\r\n */\r\n Database.prototype.refFromURL = function (url) {\r\n /** @const {string} */\r\n var apiName = 'database.refFromURL';\r\n this.checkDeleted_(apiName);\r\n validateArgCount(apiName, 1, 1, arguments.length);\r\n var parsedURL = parseRepoInfo(url, this.repo_.repoInfo_.nodeAdmin);\r\n validateUrl(apiName, 1, parsedURL);\r\n var repoInfo = parsedURL.repoInfo;\r\n if (!repoInfo.isCustomHost() && repoInfo.host !== this.repo_.repoInfo_.host) {\r\n fatal(apiName +\r\n ': Host name does not match the current database: ' +\r\n '(found ' +\r\n repoInfo.host +\r\n ' but expected ' +\r\n this.repo_.repoInfo_.host +\r\n ')');\r\n }\r\n return this.ref(parsedURL.path.toString());\r\n };\r\n /**\r\n * @param {string} apiName\r\n */\r\n Database.prototype.checkDeleted_ = function (apiName) {\r\n if (this.repoInternal_ === null) {\r\n fatal('Cannot call ' + apiName + ' on a deleted database.');\r\n }\r\n };\r\n // Make individual repo go offline.\r\n Database.prototype.goOffline = function () {\r\n validateArgCount('database.goOffline', 0, 0, arguments.length);\r\n this.checkDeleted_('goOffline');\r\n this.repo_.interrupt();\r\n };\r\n Database.prototype.goOnline = function () {\r\n validateArgCount('database.goOnline', 0, 0, arguments.length);\r\n this.checkDeleted_('goOnline');\r\n this.repo_.resume();\r\n };\r\n Database.ServerValue = {\r\n TIMESTAMP: {\r\n '.sv': 'timestamp'\r\n },\r\n increment: function (delta) {\r\n return {\r\n '.sv': {\r\n 'increment': delta\r\n }\r\n };\r\n }\r\n };\r\n return Database;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * INTERNAL methods for internal-use only (tests, etc.).\r\n *\r\n * Customers shouldn't use these or else should be aware that they could break at any time.\r\n *\r\n * @const\r\n */\r\nvar forceLongPolling = function () {\r\n WebSocketConnection.forceDisallow();\r\n BrowserPollConnection.forceAllow();\r\n};\r\nvar forceWebSockets = function () {\r\n BrowserPollConnection.forceDisallow();\r\n};\r\n/* Used by App Manager */\r\nvar isWebSocketsAvailable = function () {\r\n return WebSocketConnection['isAvailable']();\r\n};\r\nvar setSecurityDebugCallback = function (ref, callback) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n ref.repo.persistentConnection_.securityDebugCallback_ = callback;\r\n};\r\nvar stats = function (ref, showDelta) {\r\n ref.repo.stats(showDelta);\r\n};\r\nvar statsIncrementCounter = function (ref, metric) {\r\n ref.repo.statsIncrementCounter(metric);\r\n};\r\nvar dataUpdateCount = function (ref) {\r\n return ref.repo.dataUpdateCount;\r\n};\r\nvar interceptServerData = function (ref, callback) {\r\n return ref.repo.interceptServerData_(callback);\r\n};\r\n/**\r\n * Used by console to create a database based on the app,\r\n * passed database URL and a custom auth implementation.\r\n *\r\n * @param app A valid FirebaseApp-like object\r\n * @param url A valid Firebase databaseURL\r\n * @param version custom version e.g. firebase-admin version\r\n * @param customAuthImpl custom auth implementation\r\n */\r\nfunction initStandalone(_a) {\r\n var app = _a.app, url = _a.url, version = _a.version, customAuthImpl = _a.customAuthImpl, namespace = _a.namespace, _b = _a.nodeAdmin, nodeAdmin = _b === void 0 ? false : _b;\r\n setSDKVersion(version);\r\n /**\r\n * ComponentContainer('database-standalone') is just a placeholder that doesn't perform\r\n * any actual function.\r\n */\r\n var authProvider = new Provider('auth-internal', new ComponentContainer('database-standalone'));\r\n authProvider.setComponent(new Component('auth-internal', function () { return customAuthImpl; }, \"PRIVATE\" /* PRIVATE */));\r\n return {\r\n instance: RepoManager.getInstance().databaseFromApp(app, authProvider, url, nodeAdmin),\r\n namespace: namespace\r\n };\r\n}\n\nvar INTERNAL = /*#__PURE__*/Object.freeze({\n __proto__: null,\n forceLongPolling: forceLongPolling,\n forceWebSockets: forceWebSockets,\n isWebSocketsAvailable: isWebSocketsAvailable,\n setSecurityDebugCallback: setSecurityDebugCallback,\n stats: stats,\n statsIncrementCounter: statsIncrementCounter,\n dataUpdateCount: dataUpdateCount,\n interceptServerData: interceptServerData,\n initStandalone: initStandalone\n});\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DataConnection = PersistentConnection;\r\n/**\r\n * @param {!string} pathString\r\n * @param {function(*)} onComplete\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nPersistentConnection.prototype.simpleListen = function (pathString, onComplete) {\r\n this.sendRequest('q', { p: pathString }, onComplete);\r\n};\r\n/**\r\n * @param {*} data\r\n * @param {function(*)} onEcho\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nPersistentConnection.prototype.echo = function (data, onEcho) {\r\n this.sendRequest('echo', { d: data }, onEcho);\r\n};\r\n// RealTimeConnection properties that we use in tests.\r\nvar RealTimeConnection = Connection;\r\n/**\r\n * @param {function(): string} newHash\r\n * @return {function()}\r\n */\r\nvar hijackHash = function (newHash) {\r\n var oldPut = PersistentConnection.prototype.put;\r\n PersistentConnection.prototype.put = function (pathString, data, onComplete, hash) {\r\n if (hash !== undefined) {\r\n hash = newHash();\r\n }\r\n oldPut.call(this, pathString, data, onComplete, hash);\r\n };\r\n return function () {\r\n PersistentConnection.prototype.put = oldPut;\r\n };\r\n};\r\n/**\r\n * @type {function(new:RepoInfo, !string, boolean, !string, boolean): undefined}\r\n */\r\nvar ConnectionTarget = RepoInfo;\r\n/**\r\n * @param {!Query} query\r\n * @return {!string}\r\n */\r\nvar queryIdentifier = function (query) {\r\n return query.queryIdentifier();\r\n};\r\n/**\r\n * Forces the RepoManager to create Repos that use ReadonlyRestClient instead of PersistentConnection.\r\n *\r\n * @param {boolean} forceRestClient\r\n */\r\nvar forceRestClient = function (forceRestClient) {\r\n RepoManager.getInstance().forceRestClient(forceRestClient);\r\n};\n\nvar TEST_ACCESS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n DataConnection: DataConnection,\n RealTimeConnection: RealTimeConnection,\n hijackHash: hijackHash,\n ConnectionTarget: ConnectionTarget,\n queryIdentifier: queryIdentifier,\n forceRestClient: forceRestClient\n});\n\nvar name = \"@firebase/database\";\nvar version = \"0.7.0\";\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar ServerValue = Database.ServerValue;\r\nfunction registerDatabase(instance) {\r\n // set SDK_VERSION\r\n setSDKVersion(instance.SDK_VERSION);\r\n // Register the Database Service with the 'firebase' namespace.\r\n var namespace = instance.INTERNAL.registerComponent(new Component('database', function (container, url) {\r\n /* Dependencies */\r\n // getImmediate for FirebaseApp will always succeed\r\n var app = container.getProvider('app').getImmediate();\r\n var authProvider = container.getProvider('auth-internal');\r\n return RepoManager.getInstance().databaseFromApp(app, authProvider, url);\r\n }, \"PUBLIC\" /* PUBLIC */)\r\n .setServiceProps(\r\n // firebase.database namespace properties\r\n {\r\n Reference: Reference,\r\n Query: Query,\r\n Database: Database,\r\n DataSnapshot: DataSnapshot,\r\n enableLogging: enableLogging,\r\n INTERNAL: INTERNAL,\r\n ServerValue: ServerValue,\r\n TEST_ACCESS: TEST_ACCESS\r\n })\r\n .setMultipleInstances(true));\r\n instance.registerVersion(name, version);\r\n if (isNodeSdk()) {\r\n module.exports = namespace;\r\n }\r\n}\r\nregisterDatabase(firebase);\n\nexport { DataSnapshot, Database, OnDisconnect, Query, Reference, ServerValue, enableLogging, registerDatabase };\n//# sourceMappingURL=index.esm.js.map\n","import { __extends as t, __awaiter as e, __generator as n, __spreadArrays as r } from \"tslib\";\n\nimport i from \"@firebase/app\";\n\nimport { Logger as o, LogLevel as u } from \"@firebase/logger\";\n\nimport { getUA as s, isMobileCordova as a, isReactNative as c, isElectron as h, isIE as f, isUWP as l, isBrowserExtension as p } from \"@firebase/util\";\n\nimport { XhrIo as d, EventType as v, ErrorCode as y, createWebChannelTransport as m, WebChannel as g } from \"@firebase/webchannel-wrapper\";\n\nimport { Component as w } from \"@firebase/component\";\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Converts a Base64 encoded string to a binary string. */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ var b = {\n // Causes are copied from:\n // https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\n /** Not an error; returned on success. */\n OK: \"ok\",\n /** The operation was cancelled (typically by the caller). */\n CANCELLED: \"cancelled\",\n /** Unknown error or an error from a different error domain. */\n UNKNOWN: \"unknown\",\n /**\n * Client specified an invalid argument. Note that this differs from\n * FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are\n * problematic regardless of the state of the system (e.g., a malformed file\n * name).\n */\n INVALID_ARGUMENT: \"invalid-argument\",\n /**\n * Deadline expired before operation could complete. For operations that\n * change the state of the system, this error may be returned even if the\n * operation has completed successfully. For example, a successful response\n * from a server could have been delayed long enough for the deadline to\n * expire.\n */\n DEADLINE_EXCEEDED: \"deadline-exceeded\",\n /** Some requested entity (e.g., file or directory) was not found. */\n NOT_FOUND: \"not-found\",\n /**\n * Some entity that we attempted to create (e.g., file or directory) already\n * exists.\n */\n ALREADY_EXISTS: \"already-exists\",\n /**\n * The caller does not have permission to execute the specified operation.\n * PERMISSION_DENIED must not be used for rejections caused by exhausting\n * some resource (use RESOURCE_EXHAUSTED instead for those errors).\n * PERMISSION_DENIED must not be used if the caller can not be identified\n * (use UNAUTHENTICATED instead for those errors).\n */\n PERMISSION_DENIED: \"permission-denied\",\n /**\n * The request does not have valid authentication credentials for the\n * operation.\n */\n UNAUTHENTICATED: \"unauthenticated\",\n /**\n * Some resource has been exhausted, perhaps a per-user quota, or perhaps the\n * entire file system is out of space.\n */\n RESOURCE_EXHAUSTED: \"resource-exhausted\",\n /**\n * Operation was rejected because the system is not in a state required for\n * the operation's execution. For example, directory to be deleted may be\n * non-empty, an rmdir operation is applied to a non-directory, etc.\n *\n * A litmus test that may help a service implementor in deciding\n * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:\n * (a) Use UNAVAILABLE if the client can retry just the failing call.\n * (b) Use ABORTED if the client should retry at a higher-level\n * (e.g., restarting a read-modify-write sequence).\n * (c) Use FAILED_PRECONDITION if the client should not retry until\n * the system state has been explicitly fixed. E.g., if an \"rmdir\"\n * fails because the directory is non-empty, FAILED_PRECONDITION\n * should be returned since the client should not retry unless\n * they have first fixed up the directory by deleting files from it.\n * (d) Use FAILED_PRECONDITION if the client performs conditional\n * REST Get/Update/Delete on a resource and the resource on the\n * server does not match the condition. E.g., conflicting\n * read-modify-write on the same resource.\n */\n FAILED_PRECONDITION: \"failed-precondition\",\n /**\n * The operation was aborted, typically due to a concurrency issue like\n * sequencer check failures, transaction aborts, etc.\n *\n * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\n * and UNAVAILABLE.\n */\n ABORTED: \"aborted\",\n /**\n * Operation was attempted past the valid range. E.g., seeking or reading\n * past end of file.\n *\n * Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed\n * if the system state changes. For example, a 32-bit file system will\n * generate INVALID_ARGUMENT if asked to read at an offset that is not in the\n * range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from\n * an offset past the current file size.\n *\n * There is a fair bit of overlap between FAILED_PRECONDITION and\n * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)\n * when it applies so that callers who are iterating through a space can\n * easily look for an OUT_OF_RANGE error to detect when they are done.\n */\n OUT_OF_RANGE: \"out-of-range\",\n /** Operation is not implemented or not supported/enabled in this service. */\n UNIMPLEMENTED: \"unimplemented\",\n /**\n * Internal errors. Means some invariants expected by underlying System has\n * been broken. If you see one of these errors, Something is very broken.\n */\n INTERNAL: \"internal\",\n /**\n * The service is currently unavailable. This is a most likely a transient\n * condition and may be corrected by retrying with a backoff.\n *\n * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\n * and UNAVAILABLE.\n */\n UNAVAILABLE: \"unavailable\",\n /** Unrecoverable data loss or corruption. */\n DATA_LOSS: \"data-loss\"\n}, I = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this, n) || this).code = t, r.message = n, r.name = \"FirebaseError\", \n // HACK: We write a toString property directly because Error is not a real\n // class and so inheritance does not work correctly. We could alternatively\n // do the same \"back-door inheritance\" trick that FirebaseError does.\n r.toString = function() {\n return r.name + \": [code=\" + r.code + \"]: \" + r.message;\n }, r;\n }\n return t(n, e), n;\n}(Error), E = new o(\"@firebase/firestore\");\n\n/** An error returned by a Firestore operation. */\n// Helper methods are needed because variables can't be exported as read/write\nfunction _() {\n return E.logLevel;\n}\n\n/**\n * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).\n *\n * @param logLevel\n * The verbosity you set for activity and error logging. Can be any of\n * the following values:\n *\n * <ul>\n * <li>`debug` for the most verbose logging level, primarily for\n * debugging.</li>\n * <li>`error` to log errors only.</li>\n * <li><code>`silent` to turn off logging.</li>\n * </ul>\n */ function T(t) {\n for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];\n if (E.logLevel <= u.DEBUG) {\n var i = e.map(D);\n E.debug.apply(E, r([ \"Firestore (8.0.0): \" + t ], i));\n }\n}\n\nfunction N(t) {\n for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];\n if (E.logLevel <= u.ERROR) {\n var i = e.map(D);\n E.error.apply(E, r([ \"Firestore (8.0.0): \" + t ], i));\n }\n}\n\nfunction A(t) {\n for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];\n if (E.logLevel <= u.WARN) {\n var i = e.map(D);\n E.warn.apply(E, r([ \"Firestore (8.0.0): \" + t ], i));\n }\n}\n\n/**\n * Converts an additional log parameter to a string representation.\n */ function D(t) {\n if (\"string\" == typeof t) return t;\n try {\n return e = t, JSON.stringify(e);\n } catch (e) {\n // Converting to JSON failed, just log the object directly\n return t;\n }\n /**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n /** Formats an object as a JSON string, suitable for logging. */ var e;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Unconditionally fails, throwing an Error with the given message.\n * Messages are stripped in production builds.\n *\n * Returns `never` and can be used in expressions:\n * @example\n * let futureVar = fail('not implemented yet');\n */ function S(t) {\n void 0 === t && (t = \"Unexpected state\");\n // Log the failure in addition to throw an exception, just in case the\n // exception is swallowed.\n var e = \"FIRESTORE (8.0.0) INTERNAL ASSERTION FAILED: \" + t;\n // NOTE: We don't use FirestoreError here because these are internal failures\n // that cannot be handled by the user. (Also it would create a circular\n // dependency between the error and assert modules which doesn't work.)\n throw N(e), new Error(e)\n /**\n * Fails if the given assertion condition is false, throwing an Error with the\n * given message if it did.\n *\n * Messages are stripped in production builds.\n */;\n}\n\nfunction x(t, e) {\n t || S();\n}\n\n/**\n * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an\n * instance of `T` before casting.\n */ function k(t, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ne) {\n return t;\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Generates `nBytes` of random bytes.\n *\n * If `nBytes < 0` , an error will be thrown.\n */ function P(t) {\n // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.\n var e = \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n \"undefined\" != typeof self && (self.crypto || self.msCrypto), n = new Uint8Array(t);\n if (e && \"function\" == typeof e.getRandomValues) e.getRandomValues(n); else \n // Falls back to Math.random\n for (var r = 0; r < t; r++) n[r] = Math.floor(256 * Math.random());\n return n;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ var O = /** @class */ function() {\n function t() {}\n return t.t = function() {\n for (\n // Alphanumeric characters\n var t = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\", e = Math.floor(256 / t.length) * t.length, n = \"\"\n // The largest byte value that is a multiple of `char.length`.\n ; n.length < 20; ) for (var r = P(40), i = 0; i < r.length; ++i) \n // Only accept values that are [0, maxMultiple), this ensures they can\n // be evenly mapped to indices of `chars` via a modulo operation.\n n.length < 20 && r[i] < e && (n += t.charAt(r[i] % t.length));\n return n;\n }, t;\n}();\n\nfunction L(t, e) {\n return t < e ? -1 : t > e ? 1 : 0;\n}\n\n/** Helper to compare arrays using isEqual(). */ function V(t, e, n) {\n return t.length === e.length && t.every((function(t, r) {\n return n(t, e[r]);\n }));\n}\n\n/**\n * Returns the immediate lexicographically-following string. This is useful to\n * construct an inclusive range for indexeddb iterators.\n */ function R(t) {\n // Return the input string, with an additional NUL byte appended.\n return t + \"\\0\";\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Immutable class that represents a \"proto\" byte string.\n *\n * Proto byte strings can either be Base64-encoded strings or Uint8Arrays when\n * sent on the wire. This class abstracts away this differentiation by holding\n * the proto byte string in a common class that must be converted into a string\n * before being sent as a proto.\n */ var C = /** @class */ function() {\n function t(t) {\n this.i = t;\n }\n return t.fromBase64String = function(e) {\n return new t(atob(e));\n }, t.fromUint8Array = function(e) {\n return new t(\n /**\n * Helper function to convert an Uint8array to a binary string.\n */\n function(t) {\n for (var e = \"\", n = 0; n < t.length; ++n) e += String.fromCharCode(t[n]);\n return e;\n }(e));\n }, t.prototype.toBase64 = function() {\n return t = this.i, btoa(t);\n /** Converts a binary string to a Base64 encoded string. */ var t;\n /** True if and only if the Base64 conversion functions are available. */ }, \n t.prototype.toUint8Array = function() {\n return function(t) {\n for (var e = new Uint8Array(t.length), n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);\n return e;\n }(this.i);\n }, t.prototype.o = function() {\n return 2 * this.i.length;\n }, t.prototype.h = function(t) {\n return L(this.i, t.i);\n }, t.prototype.isEqual = function(t) {\n return this.i === t.i;\n }, t;\n}();\n\nC.u = new C(\"\");\n\nvar U = /** @class */ function() {\n function t(t) {\n this.l = t;\n }\n /**\n * Creates a new `Bytes` object from the given Base64 string, converting it to\n * bytes.\n *\n * @param base64 The Base64 string used to create the `Bytes` object.\n */ return t.fromBase64String = function(e) {\n try {\n return new t(C.fromBase64String(e));\n } catch (e) {\n throw new I(b.INVALID_ARGUMENT, \"Failed to construct Bytes from Base64 string: \" + e);\n }\n }, \n /**\n * Creates a new `Bytes` object from the given Uint8Array.\n *\n * @param array The Uint8Array used to create the `Bytes` object.\n */\n t.fromUint8Array = function(e) {\n return new t(C.fromUint8Array(e));\n }, \n /**\n * Returns the underlying bytes as a Base64-encoded string.\n *\n * @return The Base64-encoded string created from the `Bytes` object.\n */\n t.prototype.toBase64 = function() {\n return this.l.toBase64();\n }, \n /**\n * Returns the underlying bytes in a new `Uint8Array`.\n *\n * @return The Uint8Array created from the `Bytes` object.\n */\n t.prototype.toUint8Array = function() {\n return this.l.toUint8Array();\n }, \n /**\n * Returns a string representation of the `Bytes` object.\n *\n * @return A string representation of the `Bytes` object.\n */\n t.prototype.toString = function() {\n return \"Bytes(base64: \" + this.toBase64() + \")\";\n }, \n /**\n * Returns true if this `Bytes` object is equal to the provided one.\n *\n * @param other The `Bytes` object to compare against.\n * @return true if this `Bytes` object is equal to the provided one.\n */\n t.prototype.isEqual = function(t) {\n return this.l.isEqual(t.l);\n }, t;\n}();\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Helper function to assert Uint8Array is available at runtime. */ function M() {\n if (\"undefined\" == typeof Uint8Array) throw new I(b.UNIMPLEMENTED, \"Uint8Arrays are not available in this environment.\");\n}\n\n/** Helper function to assert Base64 functions are available at runtime. */ function q() {\n if (\"undefined\" == typeof atob) throw new I(b.UNIMPLEMENTED, \"Blobs are unavailable in Firestore in this environment.\");\n}\n\n/**\n * Immutable class holding a blob (binary data).\n *\n * This class is directly exposed in the public API. It extends the Bytes class\n * of the firestore-exp API to support `instanceof Bytes` checks during user\n * data conversion.\n *\n * Note that while you can't hide the constructor in JavaScript code, we are\n * using the hack above to make sure no-one outside this module can call it.\n */ var F = /** @class */ function(e) {\n function n() {\n return null !== e && e.apply(this, arguments) || this;\n }\n return t(n, e), n.fromBase64String = function(t) {\n q();\n try {\n return new n(C.fromBase64String(t));\n } catch (t) {\n throw new I(b.INVALID_ARGUMENT, \"Failed to construct Blob from Base64 string: \" + t);\n }\n }, n.fromUint8Array = function(t) {\n return M(), new n(C.fromUint8Array(t));\n }, n.prototype.toBase64 = function() {\n return q(), e.prototype.toBase64.call(this);\n }, n.prototype.toUint8Array = function() {\n return M(), e.prototype.toUint8Array.call(this);\n }, n.prototype.toString = function() {\n return \"Blob(base64: \" + this.toBase64() + \")\";\n }, n;\n}(U), j = \n/**\n * Constructs a DatabaseInfo using the provided host, databaseId and\n * persistenceKey.\n *\n * @param databaseId The database to use.\n * @param persistenceKey A unique identifier for this Firestore's local\n * storage (used in conjunction with the databaseId).\n * @param host The Firestore backend host to connect to.\n * @param ssl Whether to use SSL when connecting.\n * @param forceLongPolling Whether to use the forceLongPolling option\n * when using WebChannel as the network transport.\n * @param autoDetectLongPolling Whether to use the detectBufferingProxy\n * option when using WebChannel as the network transport.\n */\nfunction(t, e, n, r, i, o) {\n this._ = t, this.persistenceKey = e, this.host = n, this.ssl = r, this.forceLongPolling = i, \n this.T = o;\n}, G = /** @class */ function() {\n function t(t, e) {\n this.projectId = t, this.database = e || \"(default)\";\n }\n return Object.defineProperty(t.prototype, \"I\", {\n get: function() {\n return \"(default)\" === this.database;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.isEqual = function(e) {\n return e instanceof t && e.projectId === this.projectId && e.database === this.database;\n }, t.prototype.h = function(t) {\n return L(this.projectId, t.projectId) || L(this.database, t.database);\n }, t;\n}();\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction B(t) {\n var e = 0;\n for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;\n return e;\n}\n\nfunction z(t, e) {\n for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);\n}\n\nfunction K(t) {\n for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;\n return !0;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A map implementation that uses objects as keys. Objects must have an\n * associated equals function and must be immutable. Entries in the map are\n * stored together with the key being produced from the mapKeyFn. This map\n * automatically handles collisions of keys.\n */ var W = /** @class */ function() {\n function t(t, e) {\n this.m = t, this.A = e, \n /**\n * The inner map for a key -> value pair. Due to the possibility of\n * collisions we keep a list of entries that we do a linear search through\n * to find an actual match. Note that collisions should be rare, so we still\n * expect near constant time lookups in practice.\n */\n this.R = {}\n /** Get a value for this key, or undefined if it does not exist. */;\n }\n return t.prototype.get = function(t) {\n var e = this.m(t), n = this.R[e];\n if (void 0 !== n) for (var r = 0, i = n; r < i.length; r++) {\n var o = i[r], u = o[0], s = o[1];\n if (this.A(u, t)) return s;\n }\n }, t.prototype.has = function(t) {\n return void 0 !== this.get(t);\n }, \n /** Put this key and value in the map. */ t.prototype.set = function(t, e) {\n var n = this.m(t), r = this.R[n];\n if (void 0 !== r) {\n for (var i = 0; i < r.length; i++) if (this.A(r[i][0], t)) return void (r[i] = [ t, e ]);\n r.push([ t, e ]);\n } else this.R[n] = [ [ t, e ] ];\n }, \n /**\n * Remove this key from the map. Returns a boolean if anything was deleted.\n */\n t.prototype.delete = function(t) {\n var e = this.m(t), n = this.R[e];\n if (void 0 === n) return !1;\n for (var r = 0; r < n.length; r++) if (this.A(n[r][0], t)) return 1 === n.length ? delete this.R[e] : n.splice(r, 1), \n !0;\n return !1;\n }, t.prototype.forEach = function(t) {\n z(this.R, (function(e, n) {\n for (var r = 0, i = n; r < i.length; r++) {\n var o = i[r], u = o[0], s = o[1];\n t(u, s);\n }\n }));\n }, t.prototype.P = function() {\n return K(this.R);\n }, t;\n}(), Q = /** @class */ function() {\n /**\n * Creates a new timestamp.\n *\n * @param seconds The number of seconds of UTC time since Unix epoch\n * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n * 9999-12-31T23:59:59Z inclusive.\n * @param nanoseconds The non-negative fractions of a second at nanosecond\n * resolution. Negative second values with fractions must still have\n * non-negative nanoseconds values that count forward in time. Must be\n * from 0 to 999,999,999 inclusive.\n */\n function t(t, e) {\n if (this.seconds = t, this.nanoseconds = e, e < 0) throw new I(b.INVALID_ARGUMENT, \"Timestamp nanoseconds out of range: \" + e);\n if (e >= 1e9) throw new I(b.INVALID_ARGUMENT, \"Timestamp nanoseconds out of range: \" + e);\n if (t < -62135596800) throw new I(b.INVALID_ARGUMENT, \"Timestamp seconds out of range: \" + t);\n // This will break in the year 10,000.\n if (t >= 253402300800) throw new I(b.INVALID_ARGUMENT, \"Timestamp seconds out of range: \" + t);\n }\n /**\n * Creates a new timestamp with the current date, with millisecond precision.\n *\n * @return a new timestamp representing the current date.\n */ return t.now = function() {\n return t.fromMillis(Date.now());\n }, \n /**\n * Creates a new timestamp from the given date.\n *\n * @param date The date to initialize the `Timestamp` from.\n * @return A new `Timestamp` representing the same point in time as the given\n * date.\n */\n t.fromDate = function(e) {\n return t.fromMillis(e.getTime());\n }, \n /**\n * Creates a new timestamp from the given number of milliseconds.\n *\n * @param milliseconds Number of milliseconds since Unix epoch\n * 1970-01-01T00:00:00Z.\n * @return A new `Timestamp` representing the same point in time as the given\n * number of milliseconds.\n */\n t.fromMillis = function(e) {\n var n = Math.floor(e / 1e3);\n return new t(n, 1e6 * (e - 1e3 * n));\n }, \n /**\n * Converts a `Timestamp` to a JavaScript `Date` object. This conversion causes\n * a loss of precision since `Date` objects only support millisecond precision.\n *\n * @return JavaScript `Date` object representing the same point in time as\n * this `Timestamp`, with millisecond precision.\n */\n t.prototype.toDate = function() {\n return new Date(this.toMillis());\n }, \n /**\n * Converts a `Timestamp` to a numeric timestamp (in milliseconds since\n * epoch). This operation causes a loss of precision.\n *\n * @return The point in time corresponding to this timestamp, represented as\n * the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.\n */\n t.prototype.toMillis = function() {\n return 1e3 * this.seconds + this.nanoseconds / 1e6;\n }, t.prototype.g = function(t) {\n return this.seconds === t.seconds ? L(this.nanoseconds, t.nanoseconds) : L(this.seconds, t.seconds);\n }, \n /**\n * Returns true if this `Timestamp` is equal to the provided one.\n *\n * @param other The `Timestamp` to compare against.\n * @return true if this `Timestamp` is equal to the provided one.\n */\n t.prototype.isEqual = function(t) {\n return t.seconds === this.seconds && t.nanoseconds === this.nanoseconds;\n }, t.prototype.toString = function() {\n return \"Timestamp(seconds=\" + this.seconds + \", nanoseconds=\" + this.nanoseconds + \")\";\n }, t.prototype.toJSON = function() {\n return {\n seconds: this.seconds,\n nanoseconds: this.nanoseconds\n };\n }, \n /**\n * Converts this object to a primitive string, which allows Timestamp objects to be compared\n * using the `>`, `<=`, `>=` and `>` operators.\n */\n t.prototype.valueOf = function() {\n // This method returns a string of the form <seconds>.<nanoseconds> where <seconds> is\n // translated to have a non-negative value and both <seconds> and <nanoseconds> are left-padded\n // with zeroes to be a consistent length. Strings with this format then have a lexiographical\n // ordering that matches the expected ordering. The <seconds> translation is done to avoid\n // having a leading negative sign (i.e. a leading '-' character) in its string representation,\n // which would affect its lexiographical ordering.\n var t = this.seconds - -62135596800;\n // Note: Up to 12 decimal digits are required to represent all valid 'seconds' values.\n return String(t).padStart(12, \"0\") + \".\" + String(this.nanoseconds).padStart(9, \"0\");\n }, t;\n}(), H = /** @class */ function() {\n function t(t) {\n this.timestamp = t;\n }\n return t.V = function(e) {\n return new t(e);\n }, t.min = function() {\n return new t(new Q(0, 0));\n }, t.prototype.h = function(t) {\n return this.timestamp.g(t.timestamp);\n }, t.prototype.isEqual = function(t) {\n return this.timestamp.isEqual(t.timestamp);\n }, \n /** Returns a number representation of the version for use in spec tests. */ t.prototype.p = function() {\n // Convert to microseconds.\n return 1e6 * this.timestamp.seconds + this.timestamp.nanoseconds / 1e3;\n }, t.prototype.toString = function() {\n return \"SnapshotVersion(\" + this.timestamp.toString() + \")\";\n }, t.prototype.v = function() {\n return this.timestamp;\n }, t;\n}(), Y = /** @class */ function() {\n function t(t, e, n) {\n void 0 === e ? e = 0 : e > t.length && S(), void 0 === n ? n = t.length - e : n > t.length - e && S(), \n this.segments = t, this.offset = e, this.S = n;\n }\n return Object.defineProperty(t.prototype, \"length\", {\n get: function() {\n return this.S;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.isEqual = function(e) {\n return 0 === t.D(this, e);\n }, t.prototype.child = function(e) {\n var n = this.segments.slice(this.offset, this.limit());\n return e instanceof t ? e.forEach((function(t) {\n n.push(t);\n })) : n.push(e), this.C(n);\n }, \n /** The index of one past the last segment of the path. */ t.prototype.limit = function() {\n return this.offset + this.length;\n }, t.prototype.N = function(t) {\n return t = void 0 === t ? 1 : t, this.C(this.segments, this.offset + t, this.length - t);\n }, t.prototype.F = function() {\n return this.C(this.segments, this.offset, this.length - 1);\n }, t.prototype.k = function() {\n return this.segments[this.offset];\n }, t.prototype.O = function() {\n return this.get(this.length - 1);\n }, t.prototype.get = function(t) {\n return this.segments[this.offset + t];\n }, t.prototype.P = function() {\n return 0 === this.length;\n }, t.prototype.M = function(t) {\n if (t.length < this.length) return !1;\n for (var e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\n return !0;\n }, t.prototype.$ = function(t) {\n if (this.length + 1 !== t.length) return !1;\n for (var e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\n return !0;\n }, t.prototype.forEach = function(t) {\n for (var e = this.offset, n = this.limit(); e < n; e++) t(this.segments[e]);\n }, t.prototype.L = function() {\n return this.segments.slice(this.offset, this.limit());\n }, t.D = function(t, e) {\n for (var n = Math.min(t.length, e.length), r = 0; r < n; r++) {\n var i = t.get(r), o = e.get(r);\n if (i < o) return -1;\n if (i > o) return 1;\n }\n return t.length < e.length ? -1 : t.length > e.length ? 1 : 0;\n }, t;\n}(), X = /** @class */ function(e) {\n function n() {\n return null !== e && e.apply(this, arguments) || this;\n }\n return t(n, e), n.prototype.C = function(t, e, r) {\n return new n(t, e, r);\n }, n.prototype.B = function() {\n // NOTE: The client is ignorant of any path segments containing escape\n // sequences (e.g. __id123__) and just passes them through raw (they exist\n // for legacy reasons and should not be used frequently).\n return this.L().join(\"/\");\n }, n.prototype.toString = function() {\n return this.B();\n }, \n /**\n * Creates a resource path from the given slash-delimited string. If multiple\n * arguments are provided, all components are combined. Leading and trailing\n * slashes from all components are ignored.\n */\n n.q = function() {\n for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];\n // NOTE: The client is ignorant of any path segments containing escape\n // sequences (e.g. __id123__) and just passes them through raw (they exist\n // for legacy reasons and should not be used frequently).\n for (var r = [], i = 0, o = t; i < o.length; i++) {\n var u = o[i];\n if (u.indexOf(\"//\") >= 0) throw new I(b.INVALID_ARGUMENT, \"Invalid segment (\" + u + \"). Paths must not contain // in them.\");\n // Strip leading and traling slashed.\n r.push.apply(r, u.split(\"/\").filter((function(t) {\n return t.length > 0;\n })));\n }\n return new n(r);\n }, n.U = function() {\n return new n([]);\n }, n;\n}(Y), J = /^[_a-zA-Z][_a-zA-Z0-9]*$/, $ = /** @class */ function(e) {\n function n() {\n return null !== e && e.apply(this, arguments) || this;\n }\n return t(n, e), n.prototype.C = function(t, e, r) {\n return new n(t, e, r);\n }, \n /**\n * Returns true if the string could be used as a segment in a field path\n * without escaping.\n */\n n.K = function(t) {\n return J.test(t);\n }, n.prototype.B = function() {\n return this.L().map((function(t) {\n return t = t.replace(\"\\\\\", \"\\\\\\\\\").replace(\"`\", \"\\\\`\"), n.K(t) || (t = \"`\" + t + \"`\"), \n t;\n })).join(\".\");\n }, n.prototype.toString = function() {\n return this.B();\n }, \n /**\n * Returns true if this field references the key of a document.\n */\n n.prototype.W = function() {\n return 1 === this.length && \"__name__\" === this.get(0);\n }, \n /**\n * The field designating the key of a document.\n */\n n.j = function() {\n return new n([ \"__name__\" ]);\n }, \n /**\n * Parses a field string from the given server-formatted string.\n *\n * - Splitting the empty string is not allowed (for now at least).\n * - Empty segments within the string (e.g. if there are two consecutive\n * separators) are not allowed.\n *\n * TODO(b/37244157): we should make this more strict. Right now, it allows\n * non-identifier path components, even if they aren't escaped.\n */\n n.G = function(t) {\n for (var e = [], r = \"\", i = 0, o = function() {\n if (0 === r.length) throw new I(b.INVALID_ARGUMENT, \"Invalid field path (\" + t + \"). Paths must not be empty, begin with '.', end with '.', or contain '..'\");\n e.push(r), r = \"\";\n }, u = !1; i < t.length; ) {\n var s = t[i];\n if (\"\\\\\" === s) {\n if (i + 1 === t.length) throw new I(b.INVALID_ARGUMENT, \"Path has trailing escape character: \" + t);\n var a = t[i + 1];\n if (\"\\\\\" !== a && \".\" !== a && \"`\" !== a) throw new I(b.INVALID_ARGUMENT, \"Path has invalid escape sequence: \" + t);\n r += a, i += 2;\n } else \"`\" === s ? (u = !u, i++) : \".\" !== s || u ? (r += s, i++) : (o(), i++);\n }\n if (o(), u) throw new I(b.INVALID_ARGUMENT, \"Unterminated ` in path: \" + t);\n return new n(e);\n }, n.U = function() {\n return new n([]);\n }, n;\n}(Y), Z = /** @class */ function() {\n function t(t) {\n this.path = t;\n }\n return t.H = function(e) {\n return new t(X.q(e));\n }, t.J = function(e) {\n return new t(X.q(e).N(5));\n }, \n /** Returns true if the document is in the specified collectionId. */ t.prototype.Y = function(t) {\n return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;\n }, t.prototype.isEqual = function(t) {\n return null !== t && 0 === X.D(this.path, t.path);\n }, t.prototype.toString = function() {\n return this.path.toString();\n }, t.D = function(t, e) {\n return X.D(t.path, e.path);\n }, t.X = function(t) {\n return t.length % 2 == 0;\n }, \n /**\n * Creates and returns a new document key with the given segments.\n *\n * @param segments The segments of the path to the document\n * @return A new instance of DocumentKey\n */\n t.Z = function(e) {\n return new t(new X(e.slice()));\n }, t;\n}();\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// The earlist date supported by Firestore timestamps (0001-01-01T00:00:00Z).\n/**\n * A `Timestamp` represents a point in time independent of any time zone or\n * calendar, represented as seconds and fractions of seconds at nanosecond\n * resolution in UTC Epoch time.\n *\n * It is encoded using the Proleptic Gregorian Calendar which extends the\n * Gregorian calendar backwards to year one. It is encoded assuming all minutes\n * are 60 seconds long, i.e. leap seconds are \"smeared\" so that no leap second\n * table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to\n * 9999-12-31T23:59:59.999999999Z.\n *\n * @see https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto\n */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Returns whether a variable is either undefined or null.\n */\nfunction tt(t) {\n return null == t;\n}\n\n/** Returns whether the value represents -0. */ function et(t) {\n // Detect if the value is -0.0. Based on polyfill from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n return 0 === t && 1 / t == -1 / 0;\n}\n\n/**\n * Returns whether a value is an integer and in the safe integer range\n * @param value The value to test for being an integer and in the safe range\n */ function nt(t) {\n return \"number\" == typeof t && Number.isInteger(t) && !et(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Visible for testing\nvar rt = function(t, e, n, r, i, o, u) {\n void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []), \n void 0 === i && (i = null), void 0 === o && (o = null), void 0 === u && (u = null), \n this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = r, this.limit = i, \n this.startAt = o, this.endAt = u, this.tt = null;\n};\n\n/**\n * Initializes a Target with a path and optional additional query constraints.\n * Path must currently be empty if this is a collection group query.\n *\n * NOTE: you should always construct `Target` from `Query.toTarget` instead of\n * using this factory method, because `Query` provides an implicit `orderBy`\n * property.\n */ function it(t, e, n, r, i, o, u) {\n return void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []), \n void 0 === i && (i = null), void 0 === o && (o = null), void 0 === u && (u = null), \n new rt(t, e, n, r, i, o, u);\n}\n\nfunction ot(t) {\n var e = k(t);\n if (null === e.tt) {\n var n = e.path.B();\n null !== e.collectionGroup && (n += \"|cg:\" + e.collectionGroup), n += \"|f:\", n += e.filters.map((function(t) {\n return function(t) {\n // TODO(b/29183165): Technically, this won't be unique if two values have\n // the same description, such as the int 3 and the string \"3\". So we should\n // add the types in here somehow, too.\n return t.field.B() + t.op.toString() + Xt(t.value);\n }(t);\n })).join(\",\"), n += \"|ob:\", n += e.orderBy.map((function(t) {\n return (e = t).field.B() + e.dir;\n var e;\n })).join(\",\"), tt(e.limit) || (n += \"|l:\", n += e.limit), e.startAt && (n += \"|lb:\", \n n += er(e.startAt)), e.endAt && (n += \"|ub:\", n += er(e.endAt)), e.tt = n;\n }\n return e.tt;\n}\n\nfunction ut(t, e) {\n if (t.limit !== e.limit) return !1;\n if (t.orderBy.length !== e.orderBy.length) return !1;\n for (var n = 0; n < t.orderBy.length; n++) if (!ur(t.orderBy[n], e.orderBy[n])) return !1;\n if (t.filters.length !== e.filters.length) return !1;\n for (var r = 0; r < t.filters.length; r++) if (i = t.filters[r], o = e.filters[r], \n i.op !== o.op || !i.field.isEqual(o.field) || !Wt(i.value, o.value)) return !1;\n var i, o;\n return t.collectionGroup === e.collectionGroup && !!t.path.isEqual(e.path) && !!rr(t.startAt, e.startAt) && rr(t.endAt, e.endAt);\n}\n\nfunction st(t) {\n return Z.X(t.path) && null === t.collectionGroup && 0 === t.filters.length;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An immutable set of metadata that the local store tracks for each target.\n */ var at, ct, ht = /** @class */ function() {\n function t(\n /** The target being listened to. */\n t, \n /**\n * The target ID to which the target corresponds; Assigned by the\n * LocalStore for user listens and by the SyncEngine for limbo watches.\n */\n e, \n /** The purpose of the target. */\n n, \n /**\n * The sequence number of the last transaction during which this target data\n * was modified.\n */\n r, \n /** The latest snapshot version seen for this target. */\n i\n /**\n * The maximum snapshot version at which the associated view\n * contained no limbo documents.\n */ , o\n /**\n * An opaque, server-assigned token that allows watching a target to be\n * resumed after disconnecting without retransmitting all the data that\n * matches the target. The resume token essentially identifies a point in\n * time from which the server should resume sending results.\n */ , u) {\n void 0 === i && (i = H.min()), void 0 === o && (o = H.min()), void 0 === u && (u = C.u), \n this.target = t, this.targetId = e, this.et = n, this.sequenceNumber = r, this.nt = i, \n this.lastLimboFreeSnapshotVersion = o, this.resumeToken = u;\n }\n /** Creates a new target data instance with an updated sequence number. */ return t.prototype.st = function(e) {\n return new t(this.target, this.targetId, this.et, e, this.nt, this.lastLimboFreeSnapshotVersion, this.resumeToken);\n }, \n /**\n * Creates a new target data instance with an updated resume token and\n * snapshot version.\n */\n t.prototype.it = function(e, n) {\n return new t(this.target, this.targetId, this.et, this.sequenceNumber, n, this.lastLimboFreeSnapshotVersion, e);\n }, \n /**\n * Creates a new target data instance with an updated last limbo free\n * snapshot version number.\n */\n t.prototype.rt = function(e) {\n return new t(this.target, this.targetId, this.et, this.sequenceNumber, this.nt, e, this.resumeToken);\n }, t;\n}(), ft = \n// TODO(b/33078163): just use simplest form of existence filter for now\nfunction(t) {\n this.count = t;\n};\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Determines whether an error code represents a permanent error when received\n * in response to a non-write operation.\n *\n * See isPermanentWriteError for classifying write errors.\n */\nfunction lt(t) {\n switch (t) {\n case b.OK:\n return S();\n\n case b.CANCELLED:\n case b.UNKNOWN:\n case b.DEADLINE_EXCEEDED:\n case b.RESOURCE_EXHAUSTED:\n case b.INTERNAL:\n case b.UNAVAILABLE:\n // Unauthenticated means something went wrong with our token and we need\n // to retry with new credentials which will happen automatically.\n case b.UNAUTHENTICATED:\n return !1;\n\n case b.INVALID_ARGUMENT:\n case b.NOT_FOUND:\n case b.ALREADY_EXISTS:\n case b.PERMISSION_DENIED:\n case b.FAILED_PRECONDITION:\n // Aborted might be retried in some scenarios, but that is dependant on\n // the context and should handled individually by the calling code.\n // See https://cloud.google.com/apis/design/errors.\n case b.ABORTED:\n case b.OUT_OF_RANGE:\n case b.UNIMPLEMENTED:\n case b.DATA_LOSS:\n return !0;\n\n default:\n return S();\n }\n}\n\n/**\n * Determines whether an error code represents a permanent error when received\n * in response to a write operation.\n *\n * Write operations must be handled specially because as of b/119437764, ABORTED\n * errors on the write stream should be retried too (even though ABORTED errors\n * are not generally retryable).\n *\n * Note that during the initial handshake on the write stream an ABORTED error\n * signals that we should discard our stream token (i.e. it is permanent). This\n * means a handshake error should be classified with isPermanentError, above.\n */\n/**\n * Maps an error Code from GRPC status code number, like 0, 1, or 14. These\n * are not the same as HTTP status codes.\n *\n * @returns The Code equivalent to the given GRPC status code. Fails if there\n * is no match.\n */ function pt(t) {\n if (void 0 === t) \n // This shouldn't normally happen, but in certain error cases (like trying\n // to send invalid proto messages) we may get an error with no GRPC code.\n return N(\"GRPC error has no .code\"), b.UNKNOWN;\n switch (t) {\n case at.OK:\n return b.OK;\n\n case at.CANCELLED:\n return b.CANCELLED;\n\n case at.UNKNOWN:\n return b.UNKNOWN;\n\n case at.DEADLINE_EXCEEDED:\n return b.DEADLINE_EXCEEDED;\n\n case at.RESOURCE_EXHAUSTED:\n return b.RESOURCE_EXHAUSTED;\n\n case at.INTERNAL:\n return b.INTERNAL;\n\n case at.UNAVAILABLE:\n return b.UNAVAILABLE;\n\n case at.UNAUTHENTICATED:\n return b.UNAUTHENTICATED;\n\n case at.INVALID_ARGUMENT:\n return b.INVALID_ARGUMENT;\n\n case at.NOT_FOUND:\n return b.NOT_FOUND;\n\n case at.ALREADY_EXISTS:\n return b.ALREADY_EXISTS;\n\n case at.PERMISSION_DENIED:\n return b.PERMISSION_DENIED;\n\n case at.FAILED_PRECONDITION:\n return b.FAILED_PRECONDITION;\n\n case at.ABORTED:\n return b.ABORTED;\n\n case at.OUT_OF_RANGE:\n return b.OUT_OF_RANGE;\n\n case at.UNIMPLEMENTED:\n return b.UNIMPLEMENTED;\n\n case at.DATA_LOSS:\n return b.DATA_LOSS;\n\n default:\n return S();\n }\n}\n\n/**\n * Converts an HTTP response's error status to the equivalent error code.\n *\n * @param status An HTTP error response status (\"FAILED_PRECONDITION\",\n * \"UNKNOWN\", etc.)\n * @returns The equivalent Code. Non-matching responses are mapped to\n * Code.UNKNOWN.\n */ (ct = at || (at = {}))[ct.OK = 0] = \"OK\", ct[ct.CANCELLED = 1] = \"CANCELLED\", \nct[ct.UNKNOWN = 2] = \"UNKNOWN\", ct[ct.INVALID_ARGUMENT = 3] = \"INVALID_ARGUMENT\", \nct[ct.DEADLINE_EXCEEDED = 4] = \"DEADLINE_EXCEEDED\", ct[ct.NOT_FOUND = 5] = \"NOT_FOUND\", \nct[ct.ALREADY_EXISTS = 6] = \"ALREADY_EXISTS\", ct[ct.PERMISSION_DENIED = 7] = \"PERMISSION_DENIED\", \nct[ct.UNAUTHENTICATED = 16] = \"UNAUTHENTICATED\", ct[ct.RESOURCE_EXHAUSTED = 8] = \"RESOURCE_EXHAUSTED\", \nct[ct.FAILED_PRECONDITION = 9] = \"FAILED_PRECONDITION\", ct[ct.ABORTED = 10] = \"ABORTED\", \nct[ct.OUT_OF_RANGE = 11] = \"OUT_OF_RANGE\", ct[ct.UNIMPLEMENTED = 12] = \"UNIMPLEMENTED\", \nct[ct.INTERNAL = 13] = \"INTERNAL\", ct[ct.UNAVAILABLE = 14] = \"UNAVAILABLE\", ct[ct.DATA_LOSS = 15] = \"DATA_LOSS\";\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// An immutable sorted map implementation, based on a Left-leaning Red-Black\n// tree.\nvar dt = /** @class */ function() {\n function t(t, e) {\n this.D = t, this.root = e || yt.EMPTY;\n }\n // Returns a copy of the map, with the specified key/value added or replaced.\n return t.prototype.ot = function(e, n) {\n return new t(this.D, this.root.ot(e, n, this.D).copy(null, null, yt.at, null, null));\n }, \n // Returns a copy of the map, with the specified key removed.\n t.prototype.remove = function(e) {\n return new t(this.D, this.root.remove(e, this.D).copy(null, null, yt.at, null, null));\n }, \n // Returns the value of the node with the given key, or null.\n t.prototype.get = function(t) {\n for (var e = this.root; !e.P(); ) {\n var n = this.D(t, e.key);\n if (0 === n) return e.value;\n n < 0 ? e = e.left : n > 0 && (e = e.right);\n }\n return null;\n }, \n // Returns the index of the element in this sorted map, or -1 if it doesn't\n // exist.\n t.prototype.indexOf = function(t) {\n for (\n // Number of nodes that were pruned when descending right\n var e = 0, n = this.root; !n.P(); ) {\n var r = this.D(t, n.key);\n if (0 === r) return e + n.left.size;\n r < 0 ? n = n.left : (\n // Count all nodes left of the node plus the node itself\n e += n.left.size + 1, n = n.right);\n }\n // Node not found\n return -1;\n }, t.prototype.P = function() {\n return this.root.P();\n }, Object.defineProperty(t.prototype, \"size\", {\n // Returns the total number of nodes in the map.\n get: function() {\n return this.root.size;\n },\n enumerable: !1,\n configurable: !0\n }), \n // Returns the minimum key in the map.\n t.prototype.ht = function() {\n return this.root.ht();\n }, \n // Returns the maximum key in the map.\n t.prototype.ct = function() {\n return this.root.ct();\n }, \n // Traverses the map in key order and calls the specified action function\n // for each key/value pair. If action returns true, traversal is aborted.\n // Returns the first truthy value returned by action, or the last falsey\n // value returned by action.\n t.prototype.ut = function(t) {\n return this.root.ut(t);\n }, t.prototype.forEach = function(t) {\n this.ut((function(e, n) {\n return t(e, n), !1;\n }));\n }, t.prototype.toString = function() {\n var t = [];\n return this.ut((function(e, n) {\n return t.push(e + \":\" + n), !1;\n })), \"{\" + t.join(\", \") + \"}\";\n }, \n // Traverses the map in reverse key order and calls the specified action\n // function for each key/value pair. If action returns true, traversal is\n // aborted.\n // Returns the first truthy value returned by action, or the last falsey\n // value returned by action.\n t.prototype.lt = function(t) {\n return this.root.lt(t);\n }, \n // Returns an iterator over the SortedMap.\n t.prototype._t = function() {\n return new vt(this.root, null, this.D, !1);\n }, t.prototype.ft = function(t) {\n return new vt(this.root, t, this.D, !1);\n }, t.prototype.dt = function() {\n return new vt(this.root, null, this.D, !0);\n }, t.prototype.wt = function(t) {\n return new vt(this.root, t, this.D, !0);\n }, t;\n}(), vt = /** @class */ function() {\n function t(t, e, n, r) {\n this.Et = r, this.Tt = [];\n for (var i = 1; !t.P(); ) if (i = e ? n(t.key, e) : 1, \n // flip the comparison if we're going in reverse\n r && (i *= -1), i < 0) \n // This node is less than our start key. ignore it\n t = this.Et ? t.left : t.right; else {\n if (0 === i) {\n // This node is exactly equal to our start key. Push it on the stack,\n // but stop iterating;\n this.Tt.push(t);\n break;\n }\n // This node is greater than our start key, add it to the stack and move\n // to the next one\n this.Tt.push(t), t = this.Et ? t.right : t.left;\n }\n }\n return t.prototype.It = function() {\n var t = this.Tt.pop(), e = {\n key: t.key,\n value: t.value\n };\n if (this.Et) for (t = t.left; !t.P(); ) this.Tt.push(t), t = t.right; else for (t = t.right; !t.P(); ) this.Tt.push(t), \n t = t.left;\n return e;\n }, t.prototype.At = function() {\n return this.Tt.length > 0;\n }, t.prototype.Rt = function() {\n if (0 === this.Tt.length) return null;\n var t = this.Tt[this.Tt.length - 1];\n return {\n key: t.key,\n value: t.value\n };\n }, t;\n}(), yt = /** @class */ function() {\n function t(e, n, r, i, o) {\n this.key = e, this.value = n, this.color = null != r ? r : t.RED, this.left = null != i ? i : t.EMPTY, \n this.right = null != o ? o : t.EMPTY, this.size = this.left.size + 1 + this.right.size;\n }\n // Returns a copy of the current node, optionally replacing pieces of it.\n return t.prototype.copy = function(e, n, r, i, o) {\n return new t(null != e ? e : this.key, null != n ? n : this.value, null != r ? r : this.color, null != i ? i : this.left, null != o ? o : this.right);\n }, t.prototype.P = function() {\n return !1;\n }, \n // Traverses the tree in key order and calls the specified action function\n // for each node. If action returns true, traversal is aborted.\n // Returns the first truthy value returned by action, or the last falsey\n // value returned by action.\n t.prototype.ut = function(t) {\n return this.left.ut(t) || t(this.key, this.value) || this.right.ut(t);\n }, \n // Traverses the tree in reverse key order and calls the specified action\n // function for each node. If action returns true, traversal is aborted.\n // Returns the first truthy value returned by action, or the last falsey\n // value returned by action.\n t.prototype.lt = function(t) {\n return this.right.lt(t) || t(this.key, this.value) || this.left.lt(t);\n }, \n // Returns the minimum node in the tree.\n t.prototype.min = function() {\n return this.left.P() ? this : this.left.min();\n }, \n // Returns the maximum key in the tree.\n t.prototype.ht = function() {\n return this.min().key;\n }, \n // Returns the maximum key in the tree.\n t.prototype.ct = function() {\n return this.right.P() ? this.key : this.right.ct();\n }, \n // Returns new tree, with the key/value added.\n t.prototype.ot = function(t, e, n) {\n var r = this, i = n(t, r.key);\n return (r = i < 0 ? r.copy(null, null, null, r.left.ot(t, e, n), null) : 0 === i ? r.copy(null, e, null, null, null) : r.copy(null, null, null, null, r.right.ot(t, e, n))).Pt();\n }, t.prototype.gt = function() {\n if (this.left.P()) return t.EMPTY;\n var e = this;\n return e.left.Vt() || e.left.left.Vt() || (e = e.yt()), (e = e.copy(null, null, null, e.left.gt(), null)).Pt();\n }, \n // Returns new tree, with the specified item removed.\n t.prototype.remove = function(e, n) {\n var r, i = this;\n if (n(e, i.key) < 0) i.left.P() || i.left.Vt() || i.left.left.Vt() || (i = i.yt()), \n i = i.copy(null, null, null, i.left.remove(e, n), null); else {\n if (i.left.Vt() && (i = i.bt()), i.right.P() || i.right.Vt() || i.right.left.Vt() || (i = i.vt()), \n 0 === n(e, i.key)) {\n if (i.right.P()) return t.EMPTY;\n r = i.right.min(), i = i.copy(r.key, r.value, null, null, i.right.gt());\n }\n i = i.copy(null, null, null, null, i.right.remove(e, n));\n }\n return i.Pt();\n }, t.prototype.Vt = function() {\n return this.color;\n }, \n // Returns new tree after performing any needed rotations.\n t.prototype.Pt = function() {\n var t = this;\n return t.right.Vt() && !t.left.Vt() && (t = t.St()), t.left.Vt() && t.left.left.Vt() && (t = t.bt()), \n t.left.Vt() && t.right.Vt() && (t = t.Dt()), t;\n }, t.prototype.yt = function() {\n var t = this.Dt();\n return t.right.left.Vt() && (t = (t = (t = t.copy(null, null, null, null, t.right.bt())).St()).Dt()), \n t;\n }, t.prototype.vt = function() {\n var t = this.Dt();\n return t.left.left.Vt() && (t = (t = t.bt()).Dt()), t;\n }, t.prototype.St = function() {\n var e = this.copy(null, null, t.RED, null, this.right.left);\n return this.right.copy(null, null, this.color, e, null);\n }, t.prototype.bt = function() {\n var e = this.copy(null, null, t.RED, this.left.right, null);\n return this.left.copy(null, null, this.color, null, e);\n }, t.prototype.Dt = function() {\n var t = this.left.copy(null, null, !this.left.color, null, null), e = this.right.copy(null, null, !this.right.color, null, null);\n return this.copy(null, null, !this.color, t, e);\n }, \n // For testing.\n t.prototype.Ct = function() {\n var t = this.Nt();\n return Math.pow(2, t) <= this.size + 1;\n }, \n // In a balanced RB tree, the black-depth (number of black nodes) from root to\n // leaves is equal on both sides. This function verifies that or asserts.\n t.prototype.Nt = function() {\n if (this.Vt() && this.left.Vt()) throw S();\n if (this.right.Vt()) throw S();\n var t = this.left.Nt();\n if (t !== this.right.Nt()) throw S();\n return t + (this.Vt() ? 0 : 1);\n }, t;\n}();\n\n// end SortedMap\n// An iterator over an LLRBNode.\n// end LLRBNode\n// Empty node is shared between all LLRB trees.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nyt.EMPTY = null, yt.RED = !0, yt.at = !1, \n// end LLRBEmptyNode\nyt.EMPTY = new (/** @class */ function() {\n function t() {\n this.size = 0;\n }\n return Object.defineProperty(t.prototype, \"key\", {\n get: function() {\n throw S();\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"value\", {\n get: function() {\n throw S();\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"color\", {\n get: function() {\n throw S();\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"left\", {\n get: function() {\n throw S();\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"right\", {\n get: function() {\n throw S();\n },\n enumerable: !1,\n configurable: !0\n }), \n // Returns a copy of the current node.\n t.prototype.copy = function(t, e, n, r, i) {\n return this;\n }, \n // Returns a copy of the tree, with the specified key/value added.\n t.prototype.ot = function(t, e, n) {\n return new yt(t, e);\n }, \n // Returns a copy of the tree, with the specified key removed.\n t.prototype.remove = function(t, e) {\n return this;\n }, t.prototype.P = function() {\n return !0;\n }, t.prototype.ut = function(t) {\n return !1;\n }, t.prototype.lt = function(t) {\n return !1;\n }, t.prototype.ht = function() {\n return null;\n }, t.prototype.ct = function() {\n return null;\n }, t.prototype.Vt = function() {\n return !1;\n }, \n // For testing.\n t.prototype.Ct = function() {\n return !0;\n }, t.prototype.Nt = function() {\n return 0;\n }, t;\n}());\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * SortedSet is an immutable (copy-on-write) collection that holds elements\n * in order specified by the provided comparator.\n *\n * NOTE: if provided comparator returns 0 for two elements, we consider them to\n * be equal!\n */\nvar mt = /** @class */ function() {\n function t(t) {\n this.D = t, this.data = new dt(this.D);\n }\n return t.prototype.has = function(t) {\n return null !== this.data.get(t);\n }, t.prototype.first = function() {\n return this.data.ht();\n }, t.prototype.last = function() {\n return this.data.ct();\n }, Object.defineProperty(t.prototype, \"size\", {\n get: function() {\n return this.data.size;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.indexOf = function(t) {\n return this.data.indexOf(t);\n }, \n /** Iterates elements in order defined by \"comparator\" */ t.prototype.forEach = function(t) {\n this.data.ut((function(e, n) {\n return t(e), !1;\n }));\n }, \n /** Iterates over `elem`s such that: range[0] <= elem < range[1]. */ t.prototype.xt = function(t, e) {\n for (var n = this.data.ft(t[0]); n.At(); ) {\n var r = n.It();\n if (this.D(r.key, t[1]) >= 0) return;\n e(r.key);\n }\n }, \n /**\n * Iterates over `elem`s such that: start <= elem until false is returned.\n */\n t.prototype.Ft = function(t, e) {\n var n;\n for (n = void 0 !== e ? this.data.ft(e) : this.data._t(); n.At(); ) if (!t(n.It().key)) return;\n }, \n /** Finds the least element greater than or equal to `elem`. */ t.prototype.kt = function(t) {\n var e = this.data.ft(t);\n return e.At() ? e.It().key : null;\n }, t.prototype._t = function() {\n return new gt(this.data._t());\n }, t.prototype.ft = function(t) {\n return new gt(this.data.ft(t));\n }, \n /** Inserts or updates an element */ t.prototype.add = function(t) {\n return this.copy(this.data.remove(t).ot(t, !0));\n }, \n /** Deletes an element */ t.prototype.delete = function(t) {\n return this.has(t) ? this.copy(this.data.remove(t)) : this;\n }, t.prototype.P = function() {\n return this.data.P();\n }, t.prototype.Ot = function(t) {\n var e = this;\n // Make sure `result` always refers to the larger one of the two sets.\n return e.size < t.size && (e = t, t = this), t.forEach((function(t) {\n e = e.add(t);\n })), e;\n }, t.prototype.isEqual = function(e) {\n if (!(e instanceof t)) return !1;\n if (this.size !== e.size) return !1;\n for (var n = this.data._t(), r = e.data._t(); n.At(); ) {\n var i = n.It().key, o = r.It().key;\n if (0 !== this.D(i, o)) return !1;\n }\n return !0;\n }, t.prototype.L = function() {\n var t = [];\n return this.forEach((function(e) {\n t.push(e);\n })), t;\n }, t.prototype.toString = function() {\n var t = [];\n return this.forEach((function(e) {\n return t.push(e);\n })), \"SortedSet(\" + t.toString() + \")\";\n }, t.prototype.copy = function(e) {\n var n = new t(this.D);\n return n.data = e, n;\n }, t;\n}(), gt = /** @class */ function() {\n function t(t) {\n this.Mt = t;\n }\n return t.prototype.It = function() {\n return this.Mt.It().key;\n }, t.prototype.At = function() {\n return this.Mt.At();\n }, t;\n}(), wt = new dt(Z.D);\n\nfunction bt() {\n return wt;\n}\n\nfunction It() {\n return bt();\n}\n\nvar Et = new dt(Z.D);\n\nfunction _t() {\n return Et;\n}\n\nvar Tt = new dt(Z.D), Nt = new mt(Z.D);\n\nfunction At() {\n for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];\n for (var n = Nt, r = 0, i = t; r < i.length; r++) {\n var o = i[r];\n n = n.add(o);\n }\n return n;\n}\n\nvar Dt = new mt(L);\n\nfunction St() {\n return Dt;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * DocumentSet is an immutable (copy-on-write) collection that holds documents\n * in order specified by the provided comparator. We always add a document key\n * comparator on top of what is provided to guarantee document equality based on\n * the key.\n */ var xt = /** @class */ function() {\n /** The default ordering is by key if the comparator is omitted */\n function t(t) {\n // We are adding document key comparator to the end as it's the only\n // guaranteed unique property of a document.\n this.D = t ? function(e, n) {\n return t(e, n) || Z.D(e.key, n.key);\n } : function(t, e) {\n return Z.D(t.key, e.key);\n }, this.$t = _t(), this.Lt = new dt(this.D)\n /**\n * Returns an empty copy of the existing DocumentSet, using the same\n * comparator.\n */;\n }\n return t.Bt = function(e) {\n return new t(e.D);\n }, t.prototype.has = function(t) {\n return null != this.$t.get(t);\n }, t.prototype.get = function(t) {\n return this.$t.get(t);\n }, t.prototype.first = function() {\n return this.Lt.ht();\n }, t.prototype.last = function() {\n return this.Lt.ct();\n }, t.prototype.P = function() {\n return this.Lt.P();\n }, \n /**\n * Returns the index of the provided key in the document set, or -1 if the\n * document key is not present in the set;\n */\n t.prototype.indexOf = function(t) {\n var e = this.$t.get(t);\n return e ? this.Lt.indexOf(e) : -1;\n }, Object.defineProperty(t.prototype, \"size\", {\n get: function() {\n return this.Lt.size;\n },\n enumerable: !1,\n configurable: !0\n }), \n /** Iterates documents in order defined by \"comparator\" */ t.prototype.forEach = function(t) {\n this.Lt.ut((function(e, n) {\n return t(e), !1;\n }));\n }, \n /** Inserts or updates a document with the same key */ t.prototype.add = function(t) {\n // First remove the element if we have it.\n var e = this.delete(t.key);\n return e.copy(e.$t.ot(t.key, t), e.Lt.ot(t, null));\n }, \n /** Deletes a document with a given key */ t.prototype.delete = function(t) {\n var e = this.get(t);\n return e ? this.copy(this.$t.remove(t), this.Lt.remove(e)) : this;\n }, t.prototype.isEqual = function(e) {\n if (!(e instanceof t)) return !1;\n if (this.size !== e.size) return !1;\n for (var n = this.Lt._t(), r = e.Lt._t(); n.At(); ) {\n var i = n.It().key, o = r.It().key;\n if (!i.isEqual(o)) return !1;\n }\n return !0;\n }, t.prototype.toString = function() {\n var t = [];\n return this.forEach((function(e) {\n t.push(e.toString());\n })), 0 === t.length ? \"DocumentSet ()\" : \"DocumentSet (\\n \" + t.join(\" \\n\") + \"\\n)\";\n }, t.prototype.copy = function(e, n) {\n var r = new t;\n return r.D = this.D, r.$t = e, r.Lt = n, r;\n }, t;\n}(), kt = /** @class */ function() {\n function t() {\n this.qt = new dt(Z.D);\n }\n return t.prototype.track = function(t) {\n var e = t.doc.key, n = this.qt.get(e);\n n ? \n // Merge the new change with the existing change.\n 0 /* Added */ !== t.type && 3 /* Metadata */ === n.type ? this.qt = this.qt.ot(e, t) : 3 /* Metadata */ === t.type && 1 /* Removed */ !== n.type ? this.qt = this.qt.ot(e, {\n type: n.type,\n doc: t.doc\n }) : 2 /* Modified */ === t.type && 2 /* Modified */ === n.type ? this.qt = this.qt.ot(e, {\n type: 2 /* Modified */ ,\n doc: t.doc\n }) : 2 /* Modified */ === t.type && 0 /* Added */ === n.type ? this.qt = this.qt.ot(e, {\n type: 0 /* Added */ ,\n doc: t.doc\n }) : 1 /* Removed */ === t.type && 0 /* Added */ === n.type ? this.qt = this.qt.remove(e) : 1 /* Removed */ === t.type && 2 /* Modified */ === n.type ? this.qt = this.qt.ot(e, {\n type: 1 /* Removed */ ,\n doc: n.doc\n }) : 0 /* Added */ === t.type && 1 /* Removed */ === n.type ? this.qt = this.qt.ot(e, {\n type: 2 /* Modified */ ,\n doc: t.doc\n }) : \n // This includes these cases, which don't make sense:\n // Added->Added\n // Removed->Removed\n // Modified->Added\n // Removed->Modified\n // Metadata->Added\n // Removed->Metadata\n S() : this.qt = this.qt.ot(e, t);\n }, t.prototype.Ut = function() {\n var t = [];\n return this.qt.ut((function(e, n) {\n t.push(n);\n })), t;\n }, t;\n}(), Pt = /** @class */ function() {\n function t(t, e, n, r, i, o, u, s) {\n this.query = t, this.docs = e, this.Kt = n, this.docChanges = r, this.Qt = i, this.fromCache = o, \n this.Wt = u, this.jt = s\n /** Returns a view snapshot as if all documents in the snapshot were added. */;\n }\n return t.Gt = function(e, n, r, i) {\n var o = [];\n return n.forEach((function(t) {\n o.push({\n type: 0 /* Added */ ,\n doc: t\n });\n })), new t(e, n, xt.Bt(n), o, r, i, \n /* syncStateChanged= */ !0, \n /* excludesMetadataChanges= */ !1);\n }, Object.defineProperty(t.prototype, \"hasPendingWrites\", {\n get: function() {\n return !this.Qt.P();\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.isEqual = function(t) {\n if (!(this.fromCache === t.fromCache && this.Wt === t.Wt && this.Qt.isEqual(t.Qt) && Fn(this.query, t.query) && this.docs.isEqual(t.docs) && this.Kt.isEqual(t.Kt))) return !1;\n var e = this.docChanges, n = t.docChanges;\n if (e.length !== n.length) return !1;\n for (var r = 0; r < e.length; r++) if (e[r].type !== n[r].type || !e[r].doc.isEqual(n[r].doc)) return !1;\n return !0;\n }, t;\n}(), Ot = /** @class */ function() {\n function t(\n /**\n * The snapshot version this event brings us up to, or MIN if not set.\n */\n t, \n /**\n * A map from target to changes to the target. See TargetChange.\n */\n e, \n /**\n * A set of targets that is known to be inconsistent. Listens for these\n * targets should be re-established without resume tokens.\n */\n n, \n /**\n * A set of which documents have changed or been deleted, along with the\n * doc's new values (if not deleted).\n */\n r, \n /**\n * A set of which document updates are due only to limbo resolution targets.\n */\n i) {\n this.nt = t, this.zt = e, this.Ht = n, this.Jt = r, this.Yt = i;\n }\n /**\n * HACK: Views require RemoteEvents in order to determine whether the view is\n * CURRENT, but secondary tabs don't receive remote events. So this method is\n * used to create a synthesized RemoteEvent that can be used to apply a\n * CURRENT status change to a View, for queries executed in a different tab.\n */\n // PORTING NOTE: Multi-tab only\n return t.Xt = function(e, n) {\n var r = new Map;\n return r.set(e, Lt.Zt(e, n)), new t(H.min(), r, St(), bt(), At());\n }, t;\n}(), Lt = /** @class */ function() {\n function t(\n /**\n * An opaque, server-assigned token that allows watching a query to be resumed\n * after disconnecting without retransmitting all the data that matches the\n * query. The resume token essentially identifies a point in time from which\n * the server should resume sending results.\n */\n t, \n /**\n * The \"current\" (synced) status of this target. Note that \"current\"\n * has special meaning in the RPC protocol that implies that a target is\n * both up-to-date and consistent with the rest of the watch stream.\n */\n e, \n /**\n * The set of documents that were newly assigned to this target as part of\n * this remote event.\n */\n n, \n /**\n * The set of documents that were already assigned to this target but received\n * an update during this remote event.\n */\n r, \n /**\n * The set of documents that were removed from this target as part of this\n * remote event.\n */\n i) {\n this.resumeToken = t, this.te = e, this.ee = n, this.ne = r, this.se = i\n /**\n * This method is used to create a synthesized TargetChanges that can be used to\n * apply a CURRENT status change to a View (for queries executed in a different\n * tab) or for new queries (to raise snapshots with correct CURRENT status).\n */;\n }\n return t.Zt = function(e, n) {\n return new t(C.u, n, At(), At(), At());\n }, t;\n}(), Vt = function(\n/** The new document applies to all of these targets. */\nt, \n/** The new document is removed from all of these targets. */\ne, \n/** The key of the document for this change. */\nn, \n/**\n * The new document or NoDocument if it was deleted. Is null if the\n * document went out of view without the server sending a new document.\n */\nr) {\n this.ie = t, this.removedTargetIds = e, this.key = n, this.re = r;\n}, Rt = function(t, e) {\n this.targetId = t, this.oe = e;\n}, Ct = function(\n/** What kind of change occurred to the watch target. */\nt, \n/** The target IDs that were added/removed/set. */\ne, \n/**\n * An opaque, server-assigned token that allows watching a target to be\n * resumed after disconnecting without retransmitting all the data that\n * matches the target. The resume token essentially identifies a point in\n * time from which the server should resume sending results.\n */\nn\n/** An RPC error indicating why the watch failed. */ , r) {\n void 0 === n && (n = C.u), void 0 === r && (r = null), this.state = t, this.targetIds = e, \n this.resumeToken = n, this.cause = r;\n}, Ut = /** @class */ function() {\n function t() {\n /**\n * The number of pending responses (adds or removes) that we are waiting on.\n * We only consider targets active that have no pending responses.\n */\n this.ae = 0, \n /**\n * Keeps track of the document changes since the last raised snapshot.\n *\n * These changes are continuously updated as we receive document updates and\n * always reflect the current set of changes against the last issued snapshot.\n */\n this.he = Ft(), \n /** See public getters for explanations of these fields. */\n this.ce = C.u, this.ue = !1, \n /**\n * Whether this target state should be included in the next snapshot. We\n * initialize to true so that newly-added targets are included in the next\n * RemoteEvent.\n */\n this.le = !0;\n }\n return Object.defineProperty(t.prototype, \"te\", {\n /**\n * Whether this target has been marked 'current'.\n *\n * 'Current' has special meaning in the RPC protocol: It implies that the\n * Watch backend has sent us all changes up to the point at which the target\n * was added and that the target is consistent with the rest of the watch\n * stream.\n */\n get: function() {\n return this.ue;\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"resumeToken\", {\n /** The last resume token sent to us for this target. */ get: function() {\n return this.ce;\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"_e\", {\n /** Whether this target has pending target adds or target removes. */ get: function() {\n return 0 !== this.ae;\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"fe\", {\n /** Whether we have modified any state that should trigger a snapshot. */ get: function() {\n return this.le;\n },\n enumerable: !1,\n configurable: !0\n }), \n /**\n * Applies the resume token to the TargetChange, but only when it has a new\n * value. Empty resumeTokens are discarded.\n */\n t.prototype.de = function(t) {\n t.o() > 0 && (this.le = !0, this.ce = t);\n }, \n /**\n * Creates a target change from the current set of changes.\n *\n * To reset the document changes after raising this snapshot, call\n * `clearPendingChanges()`.\n */\n t.prototype.we = function() {\n var t = At(), e = At(), n = At();\n return this.he.forEach((function(r, i) {\n switch (i) {\n case 0 /* Added */ :\n t = t.add(r);\n break;\n\n case 2 /* Modified */ :\n e = e.add(r);\n break;\n\n case 1 /* Removed */ :\n n = n.add(r);\n break;\n\n default:\n S();\n }\n })), new Lt(this.ce, this.ue, t, e, n);\n }, \n /**\n * Resets the document changes and sets `hasPendingChanges` to false.\n */\n t.prototype.Ee = function() {\n this.le = !1, this.he = Ft();\n }, t.prototype.Te = function(t, e) {\n this.le = !0, this.he = this.he.ot(t, e);\n }, t.prototype.Ie = function(t) {\n this.le = !0, this.he = this.he.remove(t);\n }, t.prototype.me = function() {\n this.ae += 1;\n }, t.prototype.Ae = function() {\n this.ae -= 1;\n }, t.prototype.Re = function() {\n this.le = !0, this.ue = !0;\n }, t;\n}(), Mt = /** @class */ function() {\n function t(t) {\n this.Pe = t, \n /** The internal state of all tracked targets. */\n this.ge = new Map, \n /** Keeps track of the documents to update since the last raised snapshot. */\n this.Ve = bt(), \n /** A mapping of document keys to their set of target IDs. */\n this.ye = qt(), \n /**\n * A list of targets with existence filter mismatches. These targets are\n * known to be inconsistent and their listens needs to be re-established by\n * RemoteStore.\n */\n this.pe = new mt(L)\n /**\n * Processes and adds the DocumentWatchChange to the current set of changes.\n */;\n }\n return t.prototype.be = function(t) {\n for (var e = 0, n = t.ie; e < n.length; e++) {\n var r = n[e];\n t.re instanceof Tn ? this.ve(r, t.re) : t.re instanceof Nn && this.Se(r, t.key, t.re);\n }\n for (var i = 0, o = t.removedTargetIds; i < o.length; i++) {\n var u = o[i];\n this.Se(u, t.key, t.re);\n }\n }, \n /** Processes and adds the WatchTargetChange to the current set of changes. */ t.prototype.De = function(t) {\n var e = this;\n this.Ce(t, (function(n) {\n var r = e.Ne(n);\n switch (t.state) {\n case 0 /* NoChange */ :\n e.xe(n) && r.de(t.resumeToken);\n break;\n\n case 1 /* Added */ :\n // We need to decrement the number of pending acks needed from watch\n // for this targetId.\n r.Ae(), r._e || \n // We have a freshly added target, so we need to reset any state\n // that we had previously. This can happen e.g. when remove and add\n // back a target for existence filter mismatches.\n r.Ee(), r.de(t.resumeToken);\n break;\n\n case 2 /* Removed */ :\n // We need to keep track of removed targets to we can post-filter and\n // remove any target changes.\n // We need to decrement the number of pending acks needed from watch\n // for this targetId.\n r.Ae(), r._e || e.removeTarget(n);\n break;\n\n case 3 /* Current */ :\n e.xe(n) && (r.Re(), r.de(t.resumeToken));\n break;\n\n case 4 /* Reset */ :\n e.xe(n) && (\n // Reset the target and synthesizes removes for all existing\n // documents. The backend will re-add any documents that still\n // match the target before it sends the next global snapshot.\n e.Fe(n), r.de(t.resumeToken));\n break;\n\n default:\n S();\n }\n }));\n }, \n /**\n * Iterates over all targetIds that the watch change applies to: either the\n * targetIds explicitly listed in the change or the targetIds of all currently\n * active targets.\n */\n t.prototype.Ce = function(t, e) {\n var n = this;\n t.targetIds.length > 0 ? t.targetIds.forEach(e) : this.ge.forEach((function(t, r) {\n n.xe(r) && e(r);\n }));\n }, \n /**\n * Handles existence filters and synthesizes deletes for filter mismatches.\n * Targets that are invalidated by filter mismatches are added to\n * `pendingTargetResets`.\n */\n t.prototype.ke = function(t) {\n var e = t.targetId, n = t.oe.count, r = this.Oe(e);\n if (r) {\n var i = r.target;\n if (st(i)) if (0 === n) {\n // The existence filter told us the document does not exist. We deduce\n // that this document does not exist and apply a deleted document to\n // our updates. Without applying this deleted document there might be\n // another query that will raise this document as part of a snapshot\n // until it is resolved, essentially exposing inconsistency between\n // queries.\n var o = new Z(i.path);\n this.Se(e, o, new Nn(o, H.min()));\n } else x(1 === n); else this.Me(e) !== n && (\n // Existence filter mismatch: We reset the mapping and raise a new\n // snapshot with `isFromCache:true`.\n this.Fe(e), this.pe = this.pe.add(e));\n }\n }, \n /**\n * Converts the currently accumulated state into a remote event at the\n * provided snapshot version. Resets the accumulated changes before returning.\n */\n t.prototype.$e = function(t) {\n var e = this, n = new Map;\n this.ge.forEach((function(r, i) {\n var o = e.Oe(i);\n if (o) {\n if (r.te && st(o.target)) {\n // Document queries for document that don't exist can produce an empty\n // result set. To update our local cache, we synthesize a document\n // delete if we have not previously received the document. This\n // resolves the limbo state of the document, removing it from\n // limboDocumentRefs.\n // TODO(dimond): Ideally we would have an explicit lookup target\n // instead resulting in an explicit delete message and we could\n // remove this special logic.\n var u = new Z(o.target.path);\n null !== e.Ve.get(u) || e.Le(i, u) || e.Se(i, u, new Nn(u, t));\n }\n r.fe && (n.set(i, r.we()), r.Ee());\n }\n }));\n var r = At();\n // We extract the set of limbo-only document updates as the GC logic\n // special-cases documents that do not appear in the target cache.\n // TODO(gsoltis): Expand on this comment once GC is available in the JS\n // client.\n this.ye.forEach((function(t, n) {\n var i = !0;\n n.Ft((function(t) {\n var n = e.Oe(t);\n return !n || 2 /* LimboResolution */ === n.et || (i = !1, !1);\n })), i && (r = r.add(t));\n }));\n var i = new Ot(t, n, this.pe, this.Ve, r);\n return this.Ve = bt(), this.ye = qt(), this.pe = new mt(L), i;\n }, \n /**\n * Adds the provided document to the internal list of document updates and\n * its document key to the given target's mapping.\n */\n // Visible for testing.\n t.prototype.ve = function(t, e) {\n if (this.xe(t)) {\n var n = this.Le(t, e.key) ? 2 /* Modified */ : 0 /* Added */;\n this.Ne(t).Te(e.key, n), this.Ve = this.Ve.ot(e.key, e), this.ye = this.ye.ot(e.key, this.Be(e.key).add(t));\n }\n }, \n /**\n * Removes the provided document from the target mapping. If the\n * document no longer matches the target, but the document's state is still\n * known (e.g. we know that the document was deleted or we received the change\n * that caused the filter mismatch), the new document can be provided\n * to update the remote document cache.\n */\n // Visible for testing.\n t.prototype.Se = function(t, e, n) {\n if (this.xe(t)) {\n var r = this.Ne(t);\n this.Le(t, e) ? r.Te(e, 1 /* Removed */) : \n // The document may have entered and left the target before we raised a\n // snapshot, so we can just ignore the change.\n r.Ie(e), this.ye = this.ye.ot(e, this.Be(e).delete(t)), n && (this.Ve = this.Ve.ot(e, n));\n }\n }, t.prototype.removeTarget = function(t) {\n this.ge.delete(t);\n }, \n /**\n * Returns the current count of documents in the target. This includes both\n * the number of documents that the LocalStore considers to be part of the\n * target as well as any accumulated changes.\n */\n t.prototype.Me = function(t) {\n var e = this.Ne(t).we();\n return this.Pe.qe(t).size + e.ee.size - e.se.size;\n }, \n /**\n * Increment the number of acks needed from watch before we can consider the\n * server to be 'in-sync' with the client's active targets.\n */\n t.prototype.me = function(t) {\n this.Ne(t).me();\n }, t.prototype.Ne = function(t) {\n var e = this.ge.get(t);\n return e || (e = new Ut, this.ge.set(t, e)), e;\n }, t.prototype.Be = function(t) {\n var e = this.ye.get(t);\n return e || (e = new mt(L), this.ye = this.ye.ot(t, e)), e;\n }, \n /**\n * Verifies that the user is still interested in this target (by calling\n * `getTargetDataForTarget()`) and that we are not waiting for pending ADDs\n * from watch.\n */\n t.prototype.xe = function(t) {\n var e = null !== this.Oe(t);\n return e || T(\"WatchChangeAggregator\", \"Detected inactive target\", t), e;\n }, \n /**\n * Returns the TargetData for an active target (i.e. a target that the user\n * is still interested in that has no outstanding target change requests).\n */\n t.prototype.Oe = function(t) {\n var e = this.ge.get(t);\n return e && e._e ? null : this.Pe.Ue(t);\n }, \n /**\n * Resets the state of a Watch target to its initial state (e.g. sets\n * 'current' to false, clears the resume token and removes its target mapping\n * from all documents).\n */\n t.prototype.Fe = function(t) {\n var e = this;\n this.ge.set(t, new Ut), this.Pe.qe(t).forEach((function(n) {\n e.Se(t, n, /*updatedDocument=*/ null);\n }));\n }, \n /**\n * Returns whether the LocalStore considers the document to be part of the\n * specified target.\n */\n t.prototype.Le = function(t, e) {\n return this.Pe.qe(t).has(e);\n }, t;\n}();\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * DocumentChangeSet keeps track of a set of changes to docs in a query, merging\n * duplicate events for the same doc.\n */ function qt() {\n return new dt(Z.D);\n}\n\nfunction Ft() {\n return new dt(Z.D);\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents a locally-applied ServerTimestamp.\n *\n * Server Timestamps are backed by MapValues that contain an internal field\n * `__type__` with a value of `server_timestamp`. The previous value and local\n * write time are stored in its `__previous_value__` and `__local_write_time__`\n * fields respectively.\n *\n * Notes:\n * - ServerTimestampValue instances are created as the result of applying a\n * TransformMutation (see TransformMutation.applyTo()). They can only exist in\n * the local view of a document. Therefore they do not need to be parsed or\n * serialized.\n * - When evaluated locally (e.g. for snapshot.data()), they by default\n * evaluate to `null`. This behavior can be configured by passing custom\n * FieldValueOptions to value().\n * - With respect to other ServerTimestampValues, they sort by their\n * localWriteTime.\n */ function jt(t) {\n var e, n;\n return \"server_timestamp\" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);\n}\n\n/**\n * Creates a new ServerTimestamp proto value (using the internal format).\n */\n/**\n * Returns the value of the field before this ServerTimestamp was set.\n *\n * Preserving the previous values allows the user to display the last resoled\n * value until the backend responds with the timestamp.\n */ function Gt(t) {\n var e = t.mapValue.fields.__previous_value__;\n return jt(e) ? Gt(e) : e;\n}\n\n/**\n * Returns the local time at which this timestamp was first set.\n */ function Bt(t) {\n var e = $t(t.mapValue.fields.__local_write_time__.timestampValue);\n return new Q(e.seconds, e.nanos);\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// A RegExp matching ISO 8601 UTC timestamps with optional fraction.\nvar zt = new RegExp(/^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d(?:\\.(\\d+))?Z$/);\n\n/** Extracts the backend's type order for the provided value. */ function Kt(t) {\n return \"nullValue\" in t ? 0 /* NullValue */ : \"booleanValue\" in t ? 1 /* BooleanValue */ : \"integerValue\" in t || \"doubleValue\" in t ? 2 /* NumberValue */ : \"timestampValue\" in t ? 3 /* TimestampValue */ : \"stringValue\" in t ? 5 /* StringValue */ : \"bytesValue\" in t ? 6 /* BlobValue */ : \"referenceValue\" in t ? 7 /* RefValue */ : \"geoPointValue\" in t ? 8 /* GeoPointValue */ : \"arrayValue\" in t ? 9 /* ArrayValue */ : \"mapValue\" in t ? jt(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : S();\n}\n\n/** Tests `left` and `right` for equality based on the backend semantics. */ function Wt(t, e) {\n var n = Kt(t);\n if (n !== Kt(e)) return !1;\n switch (n) {\n case 0 /* NullValue */ :\n return !0;\n\n case 1 /* BooleanValue */ :\n return t.booleanValue === e.booleanValue;\n\n case 4 /* ServerTimestampValue */ :\n return Bt(t).isEqual(Bt(e));\n\n case 3 /* TimestampValue */ :\n return function(t, e) {\n if (\"string\" == typeof t.timestampValue && \"string\" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length) \n // Use string equality for ISO 8601 timestamps\n return t.timestampValue === e.timestampValue;\n var n = $t(t.timestampValue), r = $t(e.timestampValue);\n return n.seconds === r.seconds && n.nanos === r.nanos;\n }(t, e);\n\n case 5 /* StringValue */ :\n return t.stringValue === e.stringValue;\n\n case 6 /* BlobValue */ :\n return function(t, e) {\n return te(t.bytesValue).isEqual(te(e.bytesValue));\n }(t, e);\n\n case 7 /* RefValue */ :\n return t.referenceValue === e.referenceValue;\n\n case 8 /* GeoPointValue */ :\n return function(t, e) {\n return Zt(t.geoPointValue.latitude) === Zt(e.geoPointValue.latitude) && Zt(t.geoPointValue.longitude) === Zt(e.geoPointValue.longitude);\n }(t, e);\n\n case 2 /* NumberValue */ :\n return function(t, e) {\n if (\"integerValue\" in t && \"integerValue\" in e) return Zt(t.integerValue) === Zt(e.integerValue);\n if (\"doubleValue\" in t && \"doubleValue\" in e) {\n var n = Zt(t.doubleValue), r = Zt(e.doubleValue);\n return n === r ? et(n) === et(r) : isNaN(n) && isNaN(r);\n }\n return !1;\n }(t, e);\n\n case 9 /* ArrayValue */ :\n return V(t.arrayValue.values || [], e.arrayValue.values || [], Wt);\n\n case 10 /* ObjectValue */ :\n return function(t, e) {\n var n = t.mapValue.fields || {}, r = e.mapValue.fields || {};\n if (B(n) !== B(r)) return !1;\n for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !Wt(n[i], r[i]))) return !1;\n return !0;\n }(t, e);\n\n default:\n return S();\n }\n}\n\nfunction Qt(t, e) {\n return void 0 !== (t.values || []).find((function(t) {\n return Wt(t, e);\n }));\n}\n\nfunction Ht(t, e) {\n var n = Kt(t), r = Kt(e);\n if (n !== r) return L(n, r);\n switch (n) {\n case 0 /* NullValue */ :\n return 0;\n\n case 1 /* BooleanValue */ :\n return L(t.booleanValue, e.booleanValue);\n\n case 2 /* NumberValue */ :\n return function(t, e) {\n var n = Zt(t.integerValue || t.doubleValue), r = Zt(e.integerValue || e.doubleValue);\n return n < r ? -1 : n > r ? 1 : n === r ? 0 : \n // one or both are NaN.\n isNaN(n) ? isNaN(r) ? 0 : -1 : 1;\n }(t, e);\n\n case 3 /* TimestampValue */ :\n return Yt(t.timestampValue, e.timestampValue);\n\n case 4 /* ServerTimestampValue */ :\n return Yt(Bt(t), Bt(e));\n\n case 5 /* StringValue */ :\n return L(t.stringValue, e.stringValue);\n\n case 6 /* BlobValue */ :\n return function(t, e) {\n var n = te(t), r = te(e);\n return n.h(r);\n }(t.bytesValue, e.bytesValue);\n\n case 7 /* RefValue */ :\n return function(t, e) {\n for (var n = t.split(\"/\"), r = e.split(\"/\"), i = 0; i < n.length && i < r.length; i++) {\n var o = L(n[i], r[i]);\n if (0 !== o) return o;\n }\n return L(n.length, r.length);\n }(t.referenceValue, e.referenceValue);\n\n case 8 /* GeoPointValue */ :\n return function(t, e) {\n var n = L(Zt(t.latitude), Zt(e.latitude));\n return 0 !== n ? n : L(Zt(t.longitude), Zt(e.longitude));\n }(t.geoPointValue, e.geoPointValue);\n\n case 9 /* ArrayValue */ :\n return function(t, e) {\n for (var n = t.values || [], r = e.values || [], i = 0; i < n.length && i < r.length; ++i) {\n var o = Ht(n[i], r[i]);\n if (o) return o;\n }\n return L(n.length, r.length);\n }(t.arrayValue, e.arrayValue);\n\n case 10 /* ObjectValue */ :\n return function(t, e) {\n var n = t.fields || {}, r = Object.keys(n), i = e.fields || {}, o = Object.keys(i);\n // Even though MapValues are likely sorted correctly based on their insertion\n // order (e.g. when received from the backend), local modifications can bring\n // elements out of order. We need to re-sort the elements to ensure that\n // canonical IDs are independent of insertion order.\n r.sort(), o.sort();\n for (var u = 0; u < r.length && u < o.length; ++u) {\n var s = L(r[u], o[u]);\n if (0 !== s) return s;\n var a = Ht(n[r[u]], i[o[u]]);\n if (0 !== a) return a;\n }\n return L(r.length, o.length);\n }(t.mapValue, e.mapValue);\n\n default:\n throw S();\n }\n}\n\nfunction Yt(t, e) {\n if (\"string\" == typeof t && \"string\" == typeof e && t.length === e.length) return L(t, e);\n var n = $t(t), r = $t(e), i = L(n.seconds, r.seconds);\n return 0 !== i ? i : L(n.nanos, r.nanos);\n}\n\nfunction Xt(t) {\n return Jt(t);\n}\n\nfunction Jt(t) {\n return \"nullValue\" in t ? \"null\" : \"booleanValue\" in t ? \"\" + t.booleanValue : \"integerValue\" in t ? \"\" + t.integerValue : \"doubleValue\" in t ? \"\" + t.doubleValue : \"timestampValue\" in t ? function(t) {\n var e = $t(t);\n return \"time(\" + e.seconds + \",\" + e.nanos + \")\";\n }(t.timestampValue) : \"stringValue\" in t ? t.stringValue : \"bytesValue\" in t ? te(t.bytesValue).toBase64() : \"referenceValue\" in t ? (n = t.referenceValue, \n Z.J(n).toString()) : \"geoPointValue\" in t ? \"geo(\" + (e = t.geoPointValue).latitude + \",\" + e.longitude + \")\" : \"arrayValue\" in t ? function(t) {\n for (var e = \"[\", n = !0, r = 0, i = t.values || []; r < i.length; r++) {\n n ? n = !1 : e += \",\", e += Jt(i[r]);\n }\n return e + \"]\";\n }(t.arrayValue) : \"mapValue\" in t ? function(t) {\n for (\n // Iteration order in JavaScript is not guaranteed. To ensure that we generate\n // matching canonical IDs for identical maps, we need to sort the keys.\n var e = \"{\", n = !0, r = 0, i = Object.keys(t.fields || {}).sort(); r < i.length; r++) {\n var o = i[r];\n n ? n = !1 : e += \",\", e += o + \":\" + Jt(t.fields[o]);\n }\n return e + \"}\";\n }(t.mapValue) : S();\n var e, n;\n}\n\nfunction $t(t) {\n // The json interface (for the browser) will return an iso timestamp string,\n // while the proto js library (for node) will return a\n // google.protobuf.Timestamp instance.\n if (x(!!t), \"string\" == typeof t) {\n // The date string can have higher precision (nanos) than the Date class\n // (millis), so we do some custom parsing here.\n // Parse the nanos right out of the string.\n var e = 0, n = zt.exec(t);\n if (x(!!n), n[1]) {\n // Pad the fraction out to 9 digits (nanos).\n var r = n[1];\n r = (r + \"000000000\").substr(0, 9), e = Number(r);\n }\n // Parse the date to get the seconds.\n var i = new Date(t);\n return {\n seconds: Math.floor(i.getTime() / 1e3),\n nanos: e\n };\n }\n return {\n seconds: Zt(t.seconds),\n nanos: Zt(t.nanos)\n };\n}\n\n/**\n * Converts the possible Proto types for numbers into a JavaScript number.\n * Returns 0 if the value is not numeric.\n */ function Zt(t) {\n // TODO(bjornick): Handle int64 greater than 53 bits.\n return \"number\" == typeof t ? t : \"string\" == typeof t ? Number(t) : 0;\n}\n\n/** Converts the possible Proto types for Blobs into a ByteString. */ function te(t) {\n return \"string\" == typeof t ? C.fromBase64String(t) : C.fromUint8Array(t);\n}\n\n/** Returns a reference value for the provided database and key. */ function ee(t, e) {\n return {\n referenceValue: \"projects/\" + t.projectId + \"/databases/\" + t.database + \"/documents/\" + e.path.B()\n };\n}\n\n/** Returns true if `value` is an IntegerValue . */ function ne(t) {\n return !!t && \"integerValue\" in t;\n}\n\n/** Returns true if `value` is a DoubleValue. */\n/** Returns true if `value` is an ArrayValue. */ function re(t) {\n return !!t && \"arrayValue\" in t;\n}\n\n/** Returns true if `value` is a NullValue. */ function ie(t) {\n return !!t && \"nullValue\" in t;\n}\n\n/** Returns true if `value` is NaN. */ function oe(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}\n\n/** Returns true if `value` is a MapValue. */ function ue(t) {\n return !!t && \"mapValue\" in t;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ var se = {\n asc: \"ASCENDING\",\n desc: \"DESCENDING\"\n}, ae = {\n \"<\": \"LESS_THAN\",\n \"<=\": \"LESS_THAN_OR_EQUAL\",\n \">\": \"GREATER_THAN\",\n \">=\": \"GREATER_THAN_OR_EQUAL\",\n \"==\": \"EQUAL\",\n \"!=\": \"NOT_EQUAL\",\n \"array-contains\": \"ARRAY_CONTAINS\",\n in: \"IN\",\n \"not-in\": \"NOT_IN\",\n \"array-contains-any\": \"ARRAY_CONTAINS_ANY\"\n}, ce = function(t, e) {\n this._ = t, this.Ke = e;\n};\n\n/**\n * This class generates JsonObject values for the Datastore API suitable for\n * sending to either GRPC stub methods or via the JSON/HTTP REST API.\n *\n * The serializer supports both Protobuf.js and Proto3 JSON formats. By\n * setting `useProto3Json` to true, the serializer will use the Proto3 JSON\n * format.\n *\n * For a description of the Proto3 JSON format check\n * https://developers.google.com/protocol-buffers/docs/proto3#json\n *\n * TODO(klimt): We can remove the databaseId argument if we keep the full\n * resource name in documents.\n */\n/**\n * Returns an IntegerValue for `value`.\n */\nfunction he(t) {\n return {\n integerValue: \"\" + t\n };\n}\n\n/**\n * Returns an DoubleValue for `value` that is encoded based the serializer's\n * `useProto3Json` setting.\n */ function fe(t, e) {\n if (t.Ke) {\n if (isNaN(e)) return {\n doubleValue: \"NaN\"\n };\n if (e === 1 / 0) return {\n doubleValue: \"Infinity\"\n };\n if (e === -1 / 0) return {\n doubleValue: \"-Infinity\"\n };\n }\n return {\n doubleValue: et(e) ? \"-0\" : e\n };\n}\n\n/**\n * Returns a value for a number that's appropriate to put into a proto.\n * The return value is an IntegerValue if it can safely represent the value,\n * otherwise a DoubleValue is returned.\n */ function le(t, e) {\n return nt(e) ? he(e) : fe(t, e);\n}\n\n/**\n * Returns a value for a Date that's appropriate to put into a proto.\n */ function pe(t, e) {\n return t.Ke ? new Date(1e3 * e.seconds).toISOString().replace(/\\.\\d*/, \"\").replace(\"Z\", \"\") + \".\" + (\"000000000\" + e.nanoseconds).slice(-9) + \"Z\" : {\n seconds: \"\" + e.seconds,\n nanos: e.nanoseconds\n };\n}\n\n/**\n * Returns a value for bytes that's appropriate to put in a proto.\n *\n * Visible for testing.\n */ function de(t, e) {\n return t.Ke ? e.toBase64() : e.toUint8Array();\n}\n\n/**\n * Returns a ByteString based on the proto string value.\n */ function ve(t, e) {\n return pe(t, e.v());\n}\n\nfunction ye(t) {\n return x(!!t), H.V(function(t) {\n var e = $t(t);\n return new Q(e.seconds, e.nanos);\n }(t));\n}\n\nfunction me(t, e) {\n return function(t) {\n return new X([ \"projects\", t.projectId, \"databases\", t.database ]);\n }(t).child(\"documents\").child(e).B();\n}\n\nfunction ge(t) {\n var e = X.q(t);\n return x(je(e)), e;\n}\n\nfunction we(t, e) {\n return me(t._, e.path);\n}\n\nfunction be(t, e) {\n var n = ge(e);\n return x(n.get(1) === t._.projectId), x(!n.get(3) && !t._.database || n.get(3) === t._.database), \n new Z(Te(n));\n}\n\nfunction Ie(t, e) {\n return me(t._, e);\n}\n\nfunction Ee(t) {\n var e = ge(t);\n // In v1beta1 queries for collections at the root did not have a trailing\n // \"/documents\". In v1 all resource paths contain \"/documents\". Preserve the\n // ability to read the v1beta1 form for compatibility with queries persisted\n // in the local target cache.\n return 4 === e.length ? X.U() : Te(e);\n}\n\nfunction _e(t) {\n return new X([ \"projects\", t._.projectId, \"databases\", t._.database ]).B();\n}\n\nfunction Te(t) {\n return x(t.length > 4 && \"documents\" === t.get(4)), t.N(5)\n /** Creates a Document proto from key and fields (but no create/update time) */;\n}\n\nfunction Ne(t, e, n) {\n return {\n name: we(t, e),\n fields: n.proto.mapValue.fields\n };\n}\n\nfunction Ae(t, e) {\n var n;\n if (e instanceof ln) n = {\n update: Ne(t, e.key, e.value)\n }; else if (e instanceof gn) n = {\n delete: we(t, e.key)\n }; else if (e instanceof pn) n = {\n update: Ne(t, e.key, e.data),\n updateMask: Fe(e.Qe)\n }; else if (e instanceof vn) n = {\n transform: {\n document: we(t, e.key),\n fieldTransforms: e.fieldTransforms.map((function(t) {\n return function(t, e) {\n var n = e.transform;\n if (n instanceof We) return {\n fieldPath: e.field.B(),\n setToServerValue: \"REQUEST_TIME\"\n };\n if (n instanceof Qe) return {\n fieldPath: e.field.B(),\n appendMissingElements: {\n values: n.elements\n }\n };\n if (n instanceof Ye) return {\n fieldPath: e.field.B(),\n removeAllFromArray: {\n values: n.elements\n }\n };\n if (n instanceof Je) return {\n fieldPath: e.field.B(),\n increment: n.We\n };\n throw S();\n }(0, t);\n }))\n }\n }; else {\n if (!(e instanceof wn)) return S();\n n = {\n verify: we(t, e.key)\n };\n }\n return e.Ge.je || (n.currentDocument = function(t, e) {\n return void 0 !== e.updateTime ? {\n updateTime: ve(t, e.updateTime)\n } : void 0 !== e.exists ? {\n exists: e.exists\n } : S();\n }(t, e.Ge)), n;\n}\n\nfunction De(t, e) {\n var n = e.currentDocument ? function(t) {\n return void 0 !== t.updateTime ? rn.updateTime(ye(t.updateTime)) : void 0 !== t.exists ? rn.exists(t.exists) : rn.ze();\n }(e.currentDocument) : rn.ze();\n if (e.update) {\n e.update.name;\n var r = be(t, e.update.name), i = new bn({\n mapValue: {\n fields: e.update.fields\n }\n });\n if (e.updateMask) {\n var o = function(t) {\n var e = t.fieldPaths || [];\n return new tn(e.map((function(t) {\n return $.G(t);\n })));\n }(e.updateMask);\n return new pn(r, i, o, n);\n }\n return new ln(r, i, n);\n }\n if (e.delete) {\n var u = be(t, e.delete);\n return new gn(u, n);\n }\n if (e.transform) {\n var s = be(t, e.transform.document), a = e.transform.fieldTransforms.map((function(e) {\n return function(t, e) {\n var n = null;\n if (\"setToServerValue\" in e) x(\"REQUEST_TIME\" === e.setToServerValue), n = new We; else if (\"appendMissingElements\" in e) {\n var r = e.appendMissingElements.values || [];\n n = new Qe(r);\n } else if (\"removeAllFromArray\" in e) {\n var i = e.removeAllFromArray.values || [];\n n = new Ye(i);\n } else \"increment\" in e ? n = new Je(t, e.increment) : S();\n var o = $.G(e.fieldPath);\n return new en(o, n);\n }(t, e);\n }));\n return x(!0 === n.exists), new vn(s, a);\n }\n if (e.verify) {\n var c = be(t, e.verify);\n return new wn(c, n);\n }\n return S();\n}\n\nfunction Se(t, e) {\n return {\n documents: [ Ie(t, e.path) ]\n };\n}\n\nfunction xe(t, e) {\n // Dissect the path into parent, collectionId, and optional key filter.\n var n = {\n structuredQuery: {}\n }, r = e.path;\n null !== e.collectionGroup ? (n.parent = Ie(t, r), n.structuredQuery.from = [ {\n collectionId: e.collectionGroup,\n allDescendants: !0\n } ]) : (n.parent = Ie(t, r.F()), n.structuredQuery.from = [ {\n collectionId: r.O()\n } ]);\n var i = function(t) {\n if (0 !== t.length) {\n var e = t.map((function(t) {\n // visible for testing\n return function(t) {\n if (\"==\" /* EQUAL */ === t.op) {\n if (oe(t.value)) return {\n unaryFilter: {\n field: Ce(t.field),\n op: \"IS_NAN\"\n }\n };\n if (ie(t.value)) return {\n unaryFilter: {\n field: Ce(t.field),\n op: \"IS_NULL\"\n }\n };\n } else if (\"!=\" /* NOT_EQUAL */ === t.op) {\n if (oe(t.value)) return {\n unaryFilter: {\n field: Ce(t.field),\n op: \"IS_NOT_NAN\"\n }\n };\n if (ie(t.value)) return {\n unaryFilter: {\n field: Ce(t.field),\n op: \"IS_NOT_NULL\"\n }\n };\n }\n return {\n fieldFilter: {\n field: Ce(t.field),\n op: Re(t.op),\n value: t.value\n }\n };\n }(t);\n }));\n return 1 === e.length ? e[0] : {\n compositeFilter: {\n op: \"AND\",\n filters: e\n }\n };\n }\n }(e.filters);\n i && (n.structuredQuery.where = i);\n var o = function(t) {\n if (0 !== t.length) return t.map((function(t) {\n // visible for testing\n return function(t) {\n return {\n field: Ce(t.field),\n direction: Ve(t.dir)\n };\n }(t);\n }));\n }(e.orderBy);\n o && (n.structuredQuery.orderBy = o);\n var u = function(t, e) {\n return t.Ke || tt(e) ? e : {\n value: e\n };\n }(t, e.limit);\n return null !== u && (n.structuredQuery.limit = u), e.startAt && (n.structuredQuery.startAt = Oe(e.startAt)), \n e.endAt && (n.structuredQuery.endAt = Oe(e.endAt)), n;\n}\n\nfunction ke(t) {\n var e = Ee(t.parent), n = t.structuredQuery, r = n.from ? n.from.length : 0, i = null;\n if (r > 0) {\n x(1 === r);\n var o = n.from[0];\n o.allDescendants ? i = o.collectionId : e = e.child(o.collectionId);\n }\n var u = [];\n n.where && (u = Pe(n.where));\n var s = [];\n n.orderBy && (s = n.orderBy.map((function(t) {\n return function(t) {\n return new ir(Ue(t.field), \n // visible for testing\n function(t) {\n switch (t) {\n case \"ASCENDING\":\n return \"asc\" /* ASCENDING */;\n\n case \"DESCENDING\":\n return \"desc\" /* DESCENDING */;\n\n default:\n return;\n }\n }(t.direction));\n }(t);\n })));\n var a = null;\n n.limit && (a = function(t) {\n var e;\n return tt(e = \"object\" == typeof t ? t.value : t) ? null : e;\n }(n.limit));\n var c = null;\n n.startAt && (c = Le(n.startAt));\n var h = null;\n return n.endAt && (h = Le(n.endAt)), Cn(Sn(e, i, s, u, a, \"F\" /* First */ , c, h));\n}\n\nfunction Pe(t) {\n return t ? void 0 !== t.unaryFilter ? [ qe(t) ] : void 0 !== t.fieldFilter ? [ Me(t) ] : void 0 !== t.compositeFilter ? t.compositeFilter.filters.map((function(t) {\n return Pe(t);\n })).reduce((function(t, e) {\n return t.concat(e);\n })) : S() : [];\n}\n\nfunction Oe(t) {\n return {\n before: t.before,\n values: t.position\n };\n}\n\nfunction Le(t) {\n var e = !!t.before, n = t.values || [];\n return new tr(n, e);\n}\n\n// visible for testing\nfunction Ve(t) {\n return se[t];\n}\n\nfunction Re(t) {\n return ae[t];\n}\n\nfunction Ce(t) {\n return {\n fieldPath: t.B()\n };\n}\n\nfunction Ue(t) {\n return $.G(t.fieldPath);\n}\n\nfunction Me(t) {\n return Kn.create(Ue(t.fieldFilter.field), function(t) {\n switch (t) {\n case \"EQUAL\":\n return \"==\" /* EQUAL */;\n\n case \"NOT_EQUAL\":\n return \"!=\" /* NOT_EQUAL */;\n\n case \"GREATER_THAN\":\n return \">\" /* GREATER_THAN */;\n\n case \"GREATER_THAN_OR_EQUAL\":\n return \">=\" /* GREATER_THAN_OR_EQUAL */;\n\n case \"LESS_THAN\":\n return \"<\" /* LESS_THAN */;\n\n case \"LESS_THAN_OR_EQUAL\":\n return \"<=\" /* LESS_THAN_OR_EQUAL */;\n\n case \"ARRAY_CONTAINS\":\n return \"array-contains\" /* ARRAY_CONTAINS */;\n\n case \"IN\":\n return \"in\" /* IN */;\n\n case \"NOT_IN\":\n return \"not-in\" /* NOT_IN */;\n\n case \"ARRAY_CONTAINS_ANY\":\n return \"array-contains-any\" /* ARRAY_CONTAINS_ANY */;\n\n case \"OPERATOR_UNSPECIFIED\":\n default:\n return S();\n }\n }(t.fieldFilter.op), t.fieldFilter.value);\n}\n\nfunction qe(t) {\n switch (t.unaryFilter.op) {\n case \"IS_NAN\":\n var e = Ue(t.unaryFilter.field);\n return Kn.create(e, \"==\" /* EQUAL */ , {\n doubleValue: NaN\n });\n\n case \"IS_NULL\":\n var n = Ue(t.unaryFilter.field);\n return Kn.create(n, \"==\" /* EQUAL */ , {\n nullValue: \"NULL_VALUE\"\n });\n\n case \"IS_NOT_NAN\":\n var r = Ue(t.unaryFilter.field);\n return Kn.create(r, \"!=\" /* NOT_EQUAL */ , {\n doubleValue: NaN\n });\n\n case \"IS_NOT_NULL\":\n var i = Ue(t.unaryFilter.field);\n return Kn.create(i, \"!=\" /* NOT_EQUAL */ , {\n nullValue: \"NULL_VALUE\"\n });\n\n case \"OPERATOR_UNSPECIFIED\":\n default:\n return S();\n }\n}\n\nfunction Fe(t) {\n var e = [];\n return t.fields.forEach((function(t) {\n return e.push(t.B());\n })), {\n fieldPaths: e\n };\n}\n\nfunction je(t) {\n // Resource names have at least 4 components (project ID, database ID)\n return t.length >= 4 && \"projects\" === t.get(0) && \"databases\" === t.get(2);\n}\n\n/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Represents a transform within a TransformMutation. */ var Ge = function() {\n // Make sure that the structural type of `TransformOperation` is unique.\n // See https://github.com/microsoft/TypeScript/issues/5451\n this.He = void 0;\n};\n\n/**\n * Computes the local transform result against the provided `previousValue`,\n * optionally using the provided localWriteTime.\n */ function Be(t, e, n) {\n return t instanceof We ? function(t, e) {\n var n = {\n fields: {\n __type__: {\n stringValue: \"server_timestamp\"\n },\n __local_write_time__: {\n timestampValue: {\n seconds: t.seconds,\n nanos: t.nanoseconds\n }\n }\n }\n };\n return e && (n.fields.__previous_value__ = e), {\n mapValue: n\n };\n }(n, e) : t instanceof Qe ? He(t, e) : t instanceof Ye ? Xe(t, e) : function(t, e) {\n // PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit\n // precision and resolves overflows by reducing precision, we do not\n // manually cap overflows at 2^63.\n var n = Ke(t, e), r = $e(n) + $e(t.We);\n return ne(n) && ne(t.We) ? he(r) : fe(t.serializer, r);\n }(t, e);\n}\n\n/**\n * Computes a final transform result after the transform has been acknowledged\n * by the server, potentially using the server-provided transformResult.\n */ function ze(t, e, n) {\n // The server just sends null as the transform result for array operations,\n // so we have to calculate a result the same as we do for local\n // applications.\n return t instanceof Qe ? He(t, e) : t instanceof Ye ? Xe(t, e) : n;\n}\n\n/**\n * If this transform operation is not idempotent, returns the base value to\n * persist for this transform. If a base value is returned, the transform\n * operation is always applied to this base value, even if document has\n * already been updated.\n *\n * Base values provide consistent behavior for non-idempotent transforms and\n * allow us to return the same latency-compensated value even if the backend\n * has already applied the transform operation. The base value is null for\n * idempotent transforms, as they can be re-played even if the backend has\n * already applied them.\n *\n * @return a base value to store along with the mutation, or null for\n * idempotent transforms.\n */ function Ke(t, e) {\n return t instanceof Je ? ne(n = e) || function(t) {\n return !!t && \"doubleValue\" in t;\n }(n) ? e : {\n integerValue: 0\n } : null;\n var n;\n}\n\n/** Transforms a value into a server-generated timestamp. */ var We = /** @class */ function(e) {\n function n() {\n return null !== e && e.apply(this, arguments) || this;\n }\n return t(n, e), n;\n}(Ge), Qe = /** @class */ function(e) {\n function n(t) {\n var n = this;\n return (n = e.call(this) || this).elements = t, n;\n }\n return t(n, e), n;\n}(Ge);\n\n/** Transforms an array value via a union operation. */ function He(t, e) {\n for (var n = Ze(e), r = function(t) {\n n.some((function(e) {\n return Wt(e, t);\n })) || n.push(t);\n }, i = 0, o = t.elements; i < o.length; i++) {\n r(o[i]);\n }\n return {\n arrayValue: {\n values: n\n }\n };\n}\n\n/** Transforms an array value via a remove operation. */ var Ye = /** @class */ function(e) {\n function n(t) {\n var n = this;\n return (n = e.call(this) || this).elements = t, n;\n }\n return t(n, e), n;\n}(Ge);\n\nfunction Xe(t, e) {\n for (var n = Ze(e), r = function(t) {\n n = n.filter((function(e) {\n return !Wt(e, t);\n }));\n }, i = 0, o = t.elements; i < o.length; i++) {\n r(o[i]);\n }\n return {\n arrayValue: {\n values: n\n }\n };\n}\n\n/**\n * Implements the backend semantics for locally computed NUMERIC_ADD (increment)\n * transforms. Converts all field values to integers or doubles, but unlike the\n * backend does not cap integer values at 2^63. Instead, JavaScript number\n * arithmetic is used and precision loss can occur for values greater than 2^53.\n */ var Je = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this) || this).serializer = t, r.We = n, r;\n }\n return t(n, e), n;\n}(Ge);\n\nfunction $e(t) {\n return Zt(t.integerValue || t.doubleValue);\n}\n\nfunction Ze(t) {\n return re(t) && t.arrayValue.values ? t.arrayValue.values.slice() : [];\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Provides a set of fields that can be used to partially patch a document.\n * FieldMask is used in conjunction with ObjectValue.\n * Examples:\n * foo - Overwrites foo entirely with the provided value. If foo is not\n * present in the companion ObjectValue, the field is deleted.\n * foo.bar - Overwrites only the field bar of the object foo.\n * If foo is not an object, foo is replaced with an object\n * containing foo\n */ var tn = /** @class */ function() {\n function t(t) {\n this.fields = t, \n // TODO(dimond): validation of FieldMask\n // Sort the field mask to support `FieldMask.isEqual()` and assert below.\n t.sort($.D)\n /**\n * Verifies that `fieldPath` is included by at least one field in this field\n * mask.\n *\n * This is an O(n) operation, where `n` is the size of the field mask.\n */;\n }\n return t.prototype.Je = function(t) {\n for (var e = 0, n = this.fields; e < n.length; e++) {\n if (n[e].M(t)) return !0;\n }\n return !1;\n }, t.prototype.isEqual = function(t) {\n return V(this.fields, t.fields, (function(t, e) {\n return t.isEqual(e);\n }));\n }, t;\n}(), en = function(t, e) {\n this.field = t, this.transform = e;\n};\n\n/** A field path and the TransformOperation to perform upon it. */\n/** The result of successfully applying a mutation to the backend. */ var nn = function(\n/**\n * The version at which the mutation was committed:\n *\n * - For most operations, this is the updateTime in the WriteResult.\n * - For deletes, the commitTime of the WriteResponse (because deletes are\n * not stored and have no updateTime).\n *\n * Note that these versions can be different: No-op writes will not change\n * the updateTime even though the commitTime advances.\n */\nt, \n/**\n * The resulting fields returned from the backend after a\n * TransformMutation has been committed. Contains one FieldValue for each\n * FieldTransform that was in the mutation.\n *\n * Will be null if the mutation was not a TransformMutation.\n */\ne) {\n this.version = t, this.transformResults = e;\n}, rn = /** @class */ function() {\n function t(t, e) {\n this.updateTime = t, this.exists = e\n /** Creates a new empty Precondition. */;\n }\n return t.ze = function() {\n return new t;\n }, \n /** Creates a new Precondition with an exists flag. */ t.exists = function(e) {\n return new t(void 0, e);\n }, \n /** Creates a new Precondition based on a version a document exists at. */ t.updateTime = function(e) {\n return new t(e);\n }, Object.defineProperty(t.prototype, \"je\", {\n /** Returns whether this Precondition is empty. */ get: function() {\n return void 0 === this.updateTime && void 0 === this.exists;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.isEqual = function(t) {\n return this.exists === t.exists && (this.updateTime ? !!t.updateTime && this.updateTime.isEqual(t.updateTime) : !t.updateTime);\n }, t;\n}();\n\n/**\n * Encodes a precondition for a mutation. This follows the model that the\n * backend accepts with the special case of an explicit \"empty\" precondition\n * (meaning no precondition).\n */\n/**\n * Returns true if the preconditions is valid for the given document\n * (or null if no document is available).\n */\nfunction on(t, e) {\n return void 0 !== t.updateTime ? e instanceof Tn && e.version.isEqual(t.updateTime) : void 0 === t.exists || t.exists === e instanceof Tn;\n}\n\n/**\n * A mutation describes a self-contained change to a document. Mutations can\n * create, replace, delete, and update subsets of documents.\n *\n * Mutations not only act on the value of the document but also its version.\n *\n * For local mutations (mutations that haven't been committed yet), we preserve\n * the existing version for Set, Patch, and Transform mutations. For Delete\n * mutations, we reset the version to 0.\n *\n * Here's the expected transition table.\n *\n * MUTATION APPLIED TO RESULTS IN\n *\n * SetMutation Document(v3) Document(v3)\n * SetMutation NoDocument(v3) Document(v0)\n * SetMutation null Document(v0)\n * PatchMutation Document(v3) Document(v3)\n * PatchMutation NoDocument(v3) NoDocument(v3)\n * PatchMutation null null\n * TransformMutation Document(v3) Document(v3)\n * TransformMutation NoDocument(v3) NoDocument(v3)\n * TransformMutation null null\n * DeleteMutation Document(v3) NoDocument(v0)\n * DeleteMutation NoDocument(v3) NoDocument(v0)\n * DeleteMutation null NoDocument(v0)\n *\n * For acknowledged mutations, we use the updateTime of the WriteResponse as\n * the resulting version for Set, Patch, and Transform mutations. As deletes\n * have no explicit update time, we use the commitTime of the WriteResponse for\n * Delete mutations.\n *\n * If a mutation is acknowledged by the backend but fails the precondition check\n * locally, we return an `UnknownDocument` and rely on Watch to send us the\n * updated version.\n *\n * Note that TransformMutations don't create Documents (in the case of being\n * applied to a NoDocument), even though they would on the backend. This is\n * because the client always combines the TransformMutation with a SetMutation\n * or PatchMutation and we only want to apply the transform if the prior\n * mutation resulted in a Document (always true for a SetMutation, but not\n * necessarily for a PatchMutation).\n *\n * ## Subclassing Notes\n *\n * Subclasses of Mutation need to implement applyToRemoteDocument() and\n * applyToLocalView() to implement the actual behavior of applying the mutation\n * to some source document.\n */ var un = function() {};\n\n/**\n * Applies this mutation to the given MaybeDocument or null for the purposes\n * of computing a new remote document. If the input document doesn't match the\n * expected state (e.g. it is null or outdated), an `UnknownDocument` can be\n * returned.\n *\n * @param mutation The mutation to apply.\n * @param maybeDoc The document to mutate. The input document can be null if\n * the client has no knowledge of the pre-mutation state of the document.\n * @param mutationResult The result of applying the mutation from the backend.\n * @return The mutated document. The returned document may be an\n * UnknownDocument if the mutation could not be applied to the locally\n * cached base document.\n */ function sn(t, e, n) {\n return t instanceof ln ? function(t, e, n) {\n // Unlike applySetMutationToLocalView, if we're applying a mutation to a\n // remote document the server has accepted the mutation so the precondition\n // must have held.\n return new Tn(t.key, n.version, t.value, {\n hasCommittedMutations: !0\n });\n }(t, 0, n) : t instanceof pn ? function(t, e, n) {\n if (!on(t.Ge, e)) \n // Since the mutation was not rejected, we know that the precondition\n // matched on the backend. We therefore must not have the expected version\n // of the document in our cache and return an UnknownDocument with the\n // known updateTime.\n return new An(t.key, n.version);\n var r = dn(t, e);\n return new Tn(t.key, n.version, r, {\n hasCommittedMutations: !0\n });\n }(t, e, n) : t instanceof vn ? function(t, e, n) {\n if (x(null != n.transformResults), !on(t.Ge, e)) \n // Since the mutation was not rejected, we know that the precondition\n // matched on the backend. We therefore must not have the expected version\n // of the document in our cache and return an UnknownDocument with the\n // known updateTime.\n return new An(t.key, n.version);\n var r = yn(t, e), i = \n /**\n * Creates a list of \"transform results\" (a transform result is a field value\n * representing the result of applying a transform) for use after a\n * TransformMutation has been acknowledged by the server.\n *\n * @param fieldTransforms The field transforms to apply the result to.\n * @param baseDoc The document prior to applying this mutation batch.\n * @param serverTransformResults The transform results received by the server.\n * @return The transform results list.\n */\n function(t, e, n) {\n var r = [];\n x(t.length === n.length);\n for (var i = 0; i < n.length; i++) {\n var o = t[i], u = o.transform, s = null;\n e instanceof Tn && (s = e.field(o.field)), r.push(ze(u, s, n[i]));\n }\n return r;\n }(t.fieldTransforms, e, n.transformResults), o = n.version, u = mn(t, r.data(), i);\n return new Tn(t.key, o, u, {\n hasCommittedMutations: !0\n });\n }(t, e, n) : function(t, e, n) {\n // Unlike applyToLocalView, if we're applying a mutation to a remote\n // document the server has accepted the mutation so the precondition must\n // have held.\n return new Nn(t.key, n.version, {\n hasCommittedMutations: !0\n });\n }(t, 0, n);\n}\n\n/**\n * Applies this mutation to the given MaybeDocument or null for the purposes\n * of computing the new local view of a document. Both the input and returned\n * documents can be null.\n *\n * @param mutation The mutation to apply.\n * @param maybeDoc The document to mutate. The input document can be null if\n * the client has no knowledge of the pre-mutation state of the document.\n * @param baseDoc The state of the document prior to this mutation batch. The\n * input document can be null if the client has no knowledge of the\n * pre-mutation state of the document.\n * @param localWriteTime A timestamp indicating the local write time of the\n * batch this mutation is a part of.\n * @return The mutated document. The returned document may be null, but only\n * if maybeDoc was null and the mutation would not create a new document.\n */ function an(t, e, n, r) {\n return t instanceof ln ? function(t, e) {\n if (!on(t.Ge, e)) return e;\n var n = fn(e);\n return new Tn(t.key, n, t.value, {\n Ye: !0\n });\n }(t, e) : t instanceof pn ? function(t, e) {\n if (!on(t.Ge, e)) return e;\n var n = fn(e), r = dn(t, e);\n return new Tn(t.key, n, r, {\n Ye: !0\n });\n }(t, e) : t instanceof vn ? function(t, e, n, r) {\n if (!on(t.Ge, e)) return e;\n var i = yn(t, e), o = function(t, e, n, r) {\n for (var i = [], o = 0, u = t; o < u.length; o++) {\n var s = u[o], a = s.transform, c = null;\n n instanceof Tn && (c = n.field(s.field)), null === c && r instanceof Tn && (\n // If the current document does not contain a value for the mutated\n // field, use the value that existed before applying this mutation\n // batch. This solves an edge case where a PatchMutation clears the\n // values in a nested map before the TransformMutation is applied.\n c = r.field(s.field)), i.push(Be(a, c, e));\n }\n return i;\n }(t.fieldTransforms, n, e, r), u = mn(t, i.data(), o);\n return new Tn(t.key, i.version, u, {\n Ye: !0\n });\n }(t, e, r, n) : function(t, e) {\n return on(t.Ge, e) ? new Nn(t.key, H.min()) : e;\n }(t, e);\n}\n\n/**\n * If this mutation is not idempotent, returns the base value to persist with\n * this mutation. If a base value is returned, the mutation is always applied\n * to this base value, even if document has already been updated.\n *\n * The base value is a sparse object that consists of only the document\n * fields for which this mutation contains a non-idempotent transformation\n * (e.g. a numeric increment). The provided value guarantees consistent\n * behavior for non-idempotent transforms and allow us to return the same\n * latency-compensated value even if the backend has already applied the\n * mutation. The base value is null for idempotent mutations, as they can be\n * re-played even if the backend has already applied them.\n *\n * @return a base value to store along with the mutation, or null for\n * idempotent mutations.\n */ function cn(t, e) {\n return t instanceof vn ? function(t, e) {\n for (var n = null, r = 0, i = t.fieldTransforms; r < i.length; r++) {\n var o = i[r], u = e instanceof Tn ? e.field(o.field) : void 0, s = Ke(o.transform, u || null);\n null != s && (n = null == n ? (new In).set(o.field, s) : n.set(o.field, s));\n }\n return n ? n.Xe() : null;\n }(t, e) : null;\n}\n\nfunction hn(t, e) {\n return t.type === e.type && !!t.key.isEqual(e.key) && !!t.Ge.isEqual(e.Ge) && (0 /* Set */ === t.type ? t.value.isEqual(e.value) : 1 /* Patch */ === t.type ? t.data.isEqual(e.data) && t.Qe.isEqual(e.Qe) : 2 /* Transform */ !== t.type || V(t.fieldTransforms, t.fieldTransforms, (function(t, e) {\n return function(t, e) {\n return t.field.isEqual(e.field) && function(t, e) {\n return t instanceof Qe && e instanceof Qe || t instanceof Ye && e instanceof Ye ? V(t.elements, e.elements, Wt) : t instanceof Je && e instanceof Je ? Wt(t.We, e.We) : t instanceof We && e instanceof We;\n }(t.transform, e.transform);\n }(t, e);\n })));\n}\n\n/**\n * Returns the version from the given document for use as the result of a\n * mutation. Mutations are defined to return the version of the base document\n * only if it is an existing document. Deleted and unknown documents have a\n * post-mutation version of SnapshotVersion.min().\n */ function fn(t) {\n return t instanceof Tn ? t.version : H.min();\n}\n\n/**\n * A mutation that creates or replaces the document at the given key with the\n * object value contents.\n */ var ln = /** @class */ function(e) {\n function n(t, n, r) {\n var i = this;\n return (i = e.call(this) || this).key = t, i.value = n, i.Ge = r, i.type = 0 /* Set */ , \n i;\n }\n return t(n, e), n;\n}(un), pn = /** @class */ function(e) {\n function n(t, n, r, i) {\n var o = this;\n return (o = e.call(this) || this).key = t, o.data = n, o.Qe = r, o.Ge = i, o.type = 1 /* Patch */ , \n o;\n }\n return t(n, e), n;\n}(un);\n\nfunction dn(t, e) {\n return function(t, e) {\n var n = new In(e);\n return t.Qe.fields.forEach((function(e) {\n if (!e.P()) {\n var r = t.data.field(e);\n null !== r ? n.set(e, r) : n.delete(e);\n }\n })), n.Xe();\n }(t, e instanceof Tn ? e.data() : bn.empty());\n}\n\nvar vn = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this) || this).key = t, r.fieldTransforms = n, r.type = 2 /* Transform */ , \n // NOTE: We set a precondition of exists: true as a safety-check, since we\n // always combine TransformMutations with a SetMutation or PatchMutation which\n // (if successful) should end up with an existing document.\n r.Ge = rn.exists(!0), r;\n }\n return t(n, e), n;\n}(un);\n\nfunction yn(t, e) {\n return e;\n}\n\nfunction mn(t, e, n) {\n for (var r = new In(e), i = 0; i < t.fieldTransforms.length; i++) {\n var o = t.fieldTransforms[i];\n r.set(o.field, n[i]);\n }\n return r.Xe();\n}\n\n/** A mutation that deletes the document at the given key. */ var gn = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this) || this).key = t, r.Ge = n, r.type = 3 /* Delete */ , r;\n }\n return t(n, e), n;\n}(un), wn = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this) || this).key = t, r.Ge = n, r.type = 4 /* Verify */ , r;\n }\n return t(n, e), n;\n}(un), bn = /** @class */ function() {\n function t(t) {\n this.proto = t;\n }\n return t.empty = function() {\n return new t({\n mapValue: {}\n });\n }, \n /**\n * Returns the value at the given path or null.\n *\n * @param path the path to search\n * @return The value at the path or if there it doesn't exist.\n */\n t.prototype.field = function(t) {\n if (t.P()) return this.proto;\n for (var e = this.proto, n = 0; n < t.length - 1; ++n) {\n if (!e.mapValue.fields) return null;\n if (!ue(e = e.mapValue.fields[t.get(n)])) return null;\n }\n return (e = (e.mapValue.fields || {})[t.O()]) || null;\n }, t.prototype.isEqual = function(t) {\n return Wt(this.proto, t.proto);\n }, t;\n}(), In = /** @class */ function() {\n /**\n * @param baseObject The object to mutate.\n */\n function t(t) {\n void 0 === t && (t = bn.empty()), this.Ze = t, \n /** A map that contains the accumulated changes in this builder. */\n this.tn = new Map;\n }\n /**\n * Sets the field to the provided value.\n *\n * @param path The field path to set.\n * @param value The value to set.\n * @return The current Builder instance.\n */ return t.prototype.set = function(t, e) {\n return this.en(t, e), this;\n }, \n /**\n * Removes the field at the specified path. If there is no field at the\n * specified path, nothing is changed.\n *\n * @param path The field path to remove.\n * @return The current Builder instance.\n */\n t.prototype.delete = function(t) {\n return this.en(t, null), this;\n }, \n /**\n * Adds `value` to the overlay map at `path`. Creates nested map entries if\n * needed.\n */\n t.prototype.en = function(t, e) {\n for (var n = this.tn, r = 0; r < t.length - 1; ++r) {\n var i = t.get(r), o = n.get(i);\n o instanceof Map ? \n // Re-use a previously created map\n n = o : o && 10 /* ObjectValue */ === Kt(o) ? (\n // Convert the existing Protobuf MapValue into a map\n o = new Map(Object.entries(o.mapValue.fields || {})), n.set(i, o), n = o) : (\n // Create an empty map to represent the current nesting level\n o = new Map, n.set(i, o), n = o);\n }\n n.set(t.O(), e);\n }, \n /** Returns an ObjectValue with all mutations applied. */ t.prototype.Xe = function() {\n var t = this.nn($.U(), this.tn);\n return null != t ? new bn(t) : this.Ze;\n }, \n /**\n * Applies any overlays from `currentOverlays` that exist at `currentPath`\n * and returns the merged data at `currentPath` (or null if there were no\n * changes).\n *\n * @param currentPath The path at the current nesting level. Can be set to\n * FieldValue.emptyPath() to represent the root.\n * @param currentOverlays The overlays at the current nesting level in the\n * same format as `overlayMap`.\n * @return The merged data at `currentPath` or null if no modifications\n * were applied.\n */\n t.prototype.nn = function(t, e) {\n var n = this, r = !1, i = this.Ze.field(t), o = ue(i) ? // If there is already data at the current path, base our\n Object.assign({}, i.mapValue.fields) : {};\n return e.forEach((function(e, i) {\n if (e instanceof Map) {\n var u = n.nn(t.child(i), e);\n null != u && (o[i] = u, r = !0);\n } else null !== e ? (o[i] = e, r = !0) : o.hasOwnProperty(i) && (delete o[i], r = !0);\n })), r ? {\n mapValue: {\n fields: o\n }\n } : null;\n }, t;\n}();\n\n/**\n * Returns a FieldMask built from all fields in a MapValue.\n */\nfunction En(t) {\n var e = [];\n return z(t.fields || {}, (function(t, n) {\n var r = new $([ t ]);\n if (ue(n)) {\n var i = En(n.mapValue).fields;\n if (0 === i.length) \n // Preserve the empty map by adding it to the FieldMask.\n e.push(r); else \n // For nested and non-empty ObjectValues, add the FieldPath of the\n // leaf nodes.\n for (var o = 0, u = i; o < u.length; o++) {\n var s = u[o];\n e.push(r.child(s));\n }\n } else \n // For nested and non-empty ObjectValues, add the FieldPath of the leaf\n // nodes.\n e.push(r);\n })), new tn(e)\n /**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n /**\n * The result of a lookup for a given path may be an existing document or a\n * marker that this document does not exist at a given version.\n */;\n}\n\nvar _n = function(t, e) {\n this.key = t, this.version = e;\n}, Tn = /** @class */ function(e) {\n function n(t, n, r, i) {\n var o = this;\n return (o = e.call(this, t, n) || this).sn = r, o.Ye = !!i.Ye, o.hasCommittedMutations = !!i.hasCommittedMutations, \n o;\n }\n return t(n, e), n.prototype.field = function(t) {\n return this.sn.field(t);\n }, n.prototype.data = function() {\n return this.sn;\n }, n.prototype.rn = function() {\n return this.sn.proto;\n }, n.prototype.isEqual = function(t) {\n return t instanceof n && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.Ye === t.Ye && this.hasCommittedMutations === t.hasCommittedMutations && this.sn.isEqual(t.sn);\n }, n.prototype.toString = function() {\n return \"Document(\" + this.key + \", \" + this.version + \", \" + this.sn.toString() + \", {hasLocalMutations: \" + this.Ye + \"}), {hasCommittedMutations: \" + this.hasCommittedMutations + \"})\";\n }, Object.defineProperty(n.prototype, \"hasPendingWrites\", {\n get: function() {\n return this.Ye || this.hasCommittedMutations;\n },\n enumerable: !1,\n configurable: !0\n }), n;\n}(_n), Nn = /** @class */ function(e) {\n function n(t, n, r) {\n var i = this;\n return (i = e.call(this, t, n) || this).hasCommittedMutations = !(!r || !r.hasCommittedMutations), \n i;\n }\n return t(n, e), n.prototype.toString = function() {\n return \"NoDocument(\" + this.key + \", \" + this.version + \")\";\n }, Object.defineProperty(n.prototype, \"hasPendingWrites\", {\n get: function() {\n return this.hasCommittedMutations;\n },\n enumerable: !1,\n configurable: !0\n }), n.prototype.isEqual = function(t) {\n return t instanceof n && t.hasCommittedMutations === this.hasCommittedMutations && t.version.isEqual(this.version) && t.key.isEqual(this.key);\n }, n;\n}(_n), An = /** @class */ function(e) {\n function n() {\n return null !== e && e.apply(this, arguments) || this;\n }\n return t(n, e), n.prototype.toString = function() {\n return \"UnknownDocument(\" + this.key + \", \" + this.version + \")\";\n }, Object.defineProperty(n.prototype, \"hasPendingWrites\", {\n get: function() {\n return !0;\n },\n enumerable: !1,\n configurable: !0\n }), n.prototype.isEqual = function(t) {\n return t instanceof n && t.version.isEqual(this.version) && t.key.isEqual(this.key);\n }, n;\n}(_n), Dn = \n/**\n * Initializes a Query with a path and optional additional query constraints.\n * Path must currently be empty if this is a collection group query.\n */\nfunction(t, e, n, r, i, o /* First */ , u, s) {\n void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []), \n void 0 === i && (i = null), void 0 === o && (o = \"F\"), void 0 === u && (u = null), \n void 0 === s && (s = null), this.path = t, this.collectionGroup = e, this.on = n, \n this.filters = r, this.limit = i, this.an = o, this.startAt = u, this.endAt = s, \n this.hn = null, \n // The corresponding `Target` of this `Query` instance.\n this.cn = null, this.startAt, this.endAt;\n};\n\n/**\n * Represents a document in Firestore with a key, version, data and whether the\n * data has local mutations applied to it.\n */\n/** Creates a new Query instance with the options provided. */ function Sn(t, e, n, r, i, o, u, s) {\n return new Dn(t, e, n, r, i, o, u, s);\n}\n\n/** Creates a new Query for a query that matches all documents at `path` */ function xn(t) {\n return new Dn(t);\n}\n\n/**\n * Helper to convert a collection group query into a collection query at a\n * specific path. This is used when executing collection group queries, since\n * we have to split the query into a set of collection queries at multiple\n * paths.\n */ function kn(t) {\n return !tt(t.limit) && \"F\" /* First */ === t.an;\n}\n\nfunction Pn(t) {\n return !tt(t.limit) && \"L\" /* Last */ === t.an;\n}\n\nfunction On(t) {\n return t.on.length > 0 ? t.on[0].field : null;\n}\n\nfunction Ln(t) {\n for (var e = 0, n = t.filters; e < n.length; e++) {\n var r = n[e];\n if (r.un()) return r.field;\n }\n return null;\n}\n\n/**\n * Checks if any of the provided Operators are included in the query and\n * returns the first one that is, or null if none are.\n */\n/**\n * Returns whether the query matches a collection group rather than a specific\n * collection.\n */ function Vn(t) {\n return null !== t.collectionGroup;\n}\n\n/**\n * Returns the implicit order by constraint that is used to execute the Query,\n * which can be different from the order by constraints the user provided (e.g.\n * the SDK and backend always orders by `__name__`).\n */ function Rn(t) {\n var e = k(t);\n if (null === e.hn) {\n e.hn = [];\n var n = Ln(e), r = On(e);\n if (null !== n && null === r) \n // In order to implicitly add key ordering, we must also add the\n // inequality filter field for it to be a valid query.\n // Note that the default inequality field and key ordering is ascending.\n n.W() || e.hn.push(new ir(n)), e.hn.push(new ir($.j(), \"asc\" /* ASCENDING */)); else {\n for (var i = !1, o = 0, u = e.on; o < u.length; o++) {\n var s = u[o];\n e.hn.push(s), s.field.W() && (i = !0);\n }\n if (!i) {\n // The order of the implicit key ordering always matches the last\n // explicit order by\n var a = e.on.length > 0 ? e.on[e.on.length - 1].dir : \"asc\" /* ASCENDING */;\n e.hn.push(new ir($.j(), a));\n }\n }\n }\n return e.hn;\n}\n\n/**\n * Converts this `Query` instance to it's corresponding `Target` representation.\n */ function Cn(t) {\n var e = k(t);\n if (!e.cn) if (\"F\" /* First */ === e.an) e.cn = it(e.path, e.collectionGroup, Rn(e), e.filters, e.limit, e.startAt, e.endAt); else {\n for (\n // Flip the orderBy directions since we want the last results\n var n = [], r = 0, i = Rn(e); r < i.length; r++) {\n var o = i[r], u = \"desc\" /* DESCENDING */ === o.dir ? \"asc\" /* ASCENDING */ : \"desc\" /* DESCENDING */;\n n.push(new ir(o.field, u));\n }\n // We need to swap the cursors to match the now-flipped query ordering.\n var s = e.endAt ? new tr(e.endAt.position, !e.endAt.before) : null, a = e.startAt ? new tr(e.startAt.position, !e.startAt.before) : null;\n // Now return as a LimitType.First query.\n e.cn = it(e.path, e.collectionGroup, n, e.filters, e.limit, s, a);\n }\n return e.cn;\n}\n\nfunction Un(t, e, n) {\n return new Dn(t.path, t.collectionGroup, t.on.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);\n}\n\nfunction Mn(t, e) {\n return new Dn(t.path, t.collectionGroup, t.on.slice(), t.filters.slice(), t.limit, t.an, e, t.endAt);\n}\n\nfunction qn(t, e) {\n return new Dn(t.path, t.collectionGroup, t.on.slice(), t.filters.slice(), t.limit, t.an, t.startAt, e);\n}\n\nfunction Fn(t, e) {\n return ut(Cn(t), Cn(e)) && t.an === e.an;\n}\n\n// TODO(b/29183165): This is used to get a unique string from a query to, for\n// example, use as a dictionary key, but the implementation is subject to\n// collisions. Make it collision-free.\nfunction jn(t) {\n return ot(Cn(t)) + \"|lt:\" + t.an;\n}\n\nfunction Gn(t) {\n return \"Query(target=\" + function(t) {\n var e = t.path.B();\n return null !== t.collectionGroup && (e += \" collectionGroup=\" + t.collectionGroup), \n t.filters.length > 0 && (e += \", filters: [\" + t.filters.map((function(t) {\n return (e = t).field.B() + \" \" + e.op + \" \" + Xt(e.value);\n /** Returns a debug description for `filter`. */ var e;\n /** Filter that matches on key fields (i.e. '__name__'). */ })).join(\", \") + \"]\"), \n tt(t.limit) || (e += \", limit: \" + t.limit), t.orderBy.length > 0 && (e += \", orderBy: [\" + t.orderBy.map((function(t) {\n return (e = t).field.B() + \" (\" + e.dir + \")\";\n var e;\n })).join(\", \") + \"]\"), t.startAt && (e += \", startAt: \" + er(t.startAt)), t.endAt && (e += \", endAt: \" + er(t.endAt)), \n \"Target(\" + e + \")\";\n }(Cn(t)) + \"; limitType=\" + t.an + \")\";\n}\n\n/** Returns whether `doc` matches the constraints of `query`. */ function Bn(t, e) {\n return function(t, e) {\n var n = e.key.path;\n return null !== t.collectionGroup ? e.key.Y(t.collectionGroup) && t.path.M(n) : Z.X(t.path) ? t.path.isEqual(n) : t.path.$(n);\n }(t, e) && function(t, e) {\n for (var n = 0, r = t.on; n < r.length; n++) {\n var i = r[n];\n // order by key always matches\n if (!i.field.W() && null === e.field(i.field)) return !1;\n }\n return !0;\n }(t, e) && function(t, e) {\n for (var n = 0, r = t.filters; n < r.length; n++) {\n if (!r[n].matches(e)) return !1;\n }\n return !0;\n }(t, e) && function(t, e) {\n return !(t.startAt && !nr(t.startAt, Rn(t), e)) && (!t.endAt || !nr(t.endAt, Rn(t), e));\n }(t, e);\n}\n\nfunction zn(t) {\n return function(e, n) {\n for (var r = !1, i = 0, o = Rn(t); i < o.length; i++) {\n var u = o[i], s = or(u, e, n);\n if (0 !== s) return s;\n r = r || u.field.W();\n }\n return 0;\n };\n}\n\nvar Kn = /** @class */ function(e) {\n function n(t, n, r) {\n var i = this;\n return (i = e.call(this) || this).field = t, i.op = n, i.value = r, i;\n }\n /**\n * Creates a filter based on the provided arguments.\n */ return t(n, e), n.create = function(t, e, r) {\n return t.W() ? \"in\" /* IN */ === e || \"not-in\" /* NOT_IN */ === e ? this.ln(t, e, r) : new Wn(t, e, r) : \"array-contains\" /* ARRAY_CONTAINS */ === e ? new Xn(t, r) : \"in\" /* IN */ === e ? new Jn(t, r) : \"not-in\" /* NOT_IN */ === e ? new $n(t, r) : \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ === e ? new Zn(t, r) : new n(t, e, r);\n }, n.ln = function(t, e, n) {\n return \"in\" /* IN */ === e ? new Qn(t, n) : new Hn(t, n);\n }, n.prototype.matches = function(t) {\n var e = t.field(this.field);\n // Types do not have to match in NOT_EQUAL filters.\n return \"!=\" /* NOT_EQUAL */ === this.op ? null !== e && this._n(Ht(e, this.value)) : null !== e && Kt(this.value) === Kt(e) && this._n(Ht(e, this.value));\n // Only compare types with matching backend order (such as double and int).\n }, n.prototype._n = function(t) {\n switch (this.op) {\n case \"<\" /* LESS_THAN */ :\n return t < 0;\n\n case \"<=\" /* LESS_THAN_OR_EQUAL */ :\n return t <= 0;\n\n case \"==\" /* EQUAL */ :\n return 0 === t;\n\n case \"!=\" /* NOT_EQUAL */ :\n return 0 !== t;\n\n case \">\" /* GREATER_THAN */ :\n return t > 0;\n\n case \">=\" /* GREATER_THAN_OR_EQUAL */ :\n return t >= 0;\n\n default:\n return S();\n }\n }, n.prototype.un = function() {\n return [ \"<\" /* LESS_THAN */ , \"<=\" /* LESS_THAN_OR_EQUAL */ , \">\" /* GREATER_THAN */ , \">=\" /* GREATER_THAN_OR_EQUAL */ , \"!=\" /* NOT_EQUAL */ , \"not-in\" /* NOT_IN */ ].indexOf(this.op) >= 0;\n }, n;\n}((function() {}));\n\nvar Wn = /** @class */ function(e) {\n function n(t, n, r) {\n var i = this;\n return (i = e.call(this, t, n, r) || this).key = Z.J(r.referenceValue), i;\n }\n return t(n, e), n.prototype.matches = function(t) {\n var e = Z.D(t.key, this.key);\n return this._n(e);\n }, n;\n}(Kn), Qn = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this, t, \"in\" /* IN */ , n) || this).keys = Yn(\"in\" /* IN */ , n), \n r;\n }\n return t(n, e), n.prototype.matches = function(t) {\n return this.keys.some((function(e) {\n return e.isEqual(t.key);\n }));\n }, n;\n}(Kn), Hn = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this, t, \"not-in\" /* NOT_IN */ , n) || this).keys = Yn(\"not-in\" /* NOT_IN */ , n), \n r;\n }\n return t(n, e), n.prototype.matches = function(t) {\n return !this.keys.some((function(e) {\n return e.isEqual(t.key);\n }));\n }, n;\n}(Kn);\n\n/** Filter that matches on key fields within an array. */ function Yn(t, e) {\n var n;\n return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((function(t) {\n return Z.J(t.referenceValue);\n }));\n}\n\n/** A Filter that implements the array-contains operator. */ var Xn = /** @class */ function(e) {\n function n(t, n) {\n return e.call(this, t, \"array-contains\" /* ARRAY_CONTAINS */ , n) || this;\n }\n return t(n, e), n.prototype.matches = function(t) {\n var e = t.field(this.field);\n return re(e) && Qt(e.arrayValue, this.value);\n }, n;\n}(Kn), Jn = /** @class */ function(e) {\n function n(t, n) {\n return e.call(this, t, \"in\" /* IN */ , n) || this;\n }\n return t(n, e), n.prototype.matches = function(t) {\n var e = t.field(this.field);\n return null !== e && Qt(this.value.arrayValue, e);\n }, n;\n}(Kn), $n = /** @class */ function(e) {\n function n(t, n) {\n return e.call(this, t, \"not-in\" /* NOT_IN */ , n) || this;\n }\n return t(n, e), n.prototype.matches = function(t) {\n if (Qt(this.value.arrayValue, {\n nullValue: \"NULL_VALUE\"\n })) return !1;\n var e = t.field(this.field);\n return null !== e && !Qt(this.value.arrayValue, e);\n }, n;\n}(Kn), Zn = /** @class */ function(e) {\n function n(t, n) {\n return e.call(this, t, \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , n) || this;\n }\n return t(n, e), n.prototype.matches = function(t) {\n var e = this, n = t.field(this.field);\n return !(!re(n) || !n.arrayValue.values) && n.arrayValue.values.some((function(t) {\n return Qt(e.value.arrayValue, t);\n }));\n }, n;\n}(Kn), tr = function(t, e) {\n this.position = t, this.before = e;\n};\n\n/** A Filter that implements the IN operator. */ function er(t) {\n // TODO(b/29183165): Make this collision robust.\n return (t.before ? \"b\" : \"a\") + \":\" + t.position.map((function(t) {\n return Xt(t);\n })).join(\",\");\n}\n\n/**\n * Returns true if a document sorts before a bound using the provided sort\n * order.\n */ function nr(t, e, n) {\n for (var r = 0, i = 0; i < t.position.length; i++) {\n var o = e[i], u = t.position[i];\n if (r = o.field.W() ? Z.D(Z.J(u.referenceValue), n.key) : Ht(u, n.field(o.field)), \n \"desc\" /* DESCENDING */ === o.dir && (r *= -1), 0 !== r) break;\n }\n return t.before ? r <= 0 : r < 0;\n}\n\nfunction rr(t, e) {\n if (null === t) return null === e;\n if (null === e) return !1;\n if (t.before !== e.before || t.position.length !== e.position.length) return !1;\n for (var n = 0; n < t.position.length; n++) if (!Wt(t.position[n], e.position[n])) return !1;\n return !0;\n}\n\n/**\n * An ordering on a field, in some Direction. Direction defaults to ASCENDING.\n */ var ir = function(t, e /* ASCENDING */) {\n void 0 === e && (e = \"asc\"), this.field = t, this.dir = e;\n};\n\nfunction or(t, e, n) {\n var r = t.field.W() ? Z.D(e.key, n.key) : function(t, e, n) {\n var r = e.field(t), i = n.field(t);\n return null !== r && null !== i ? Ht(r, i) : S();\n }(t.field, e, n);\n switch (t.dir) {\n case \"asc\" /* ASCENDING */ :\n return r;\n\n case \"desc\" /* DESCENDING */ :\n return -1 * r;\n\n default:\n return S();\n }\n}\n\nfunction ur(t, e) {\n return t.dir === e.dir && t.field.isEqual(e.field);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ var sr = function() {\n var t = this;\n this.promise = new Promise((function(e, n) {\n t.resolve = e, t.reject = n;\n }));\n}, ar = /** @class */ function() {\n function t(\n /**\n * The AsyncQueue to run backoff operations on.\n */\n t, \n /**\n * The ID to use when scheduling backoff operations on the AsyncQueue.\n */\n e, \n /**\n * The initial delay (used as the base delay on the first retry attempt).\n * Note that jitter will still be applied, so the actual delay could be as\n * little as 0.5*initialDelayMs.\n */\n n\n /**\n * The multiplier to use to determine the extended base delay after each\n * attempt.\n */ , r\n /**\n * The maximum base delay after which no further backoff is performed.\n * Note that jitter will still be applied, so the actual delay could be as\n * much as 1.5*maxDelayMs.\n */ , i) {\n void 0 === n && (n = 1e3), void 0 === r && (r = 1.5), void 0 === i && (i = 6e4), \n this.fn = t, this.dn = e, this.wn = n, this.En = r, this.Tn = i, this.In = 0, this.mn = null, \n /** The last backoff attempt, as epoch milliseconds. */\n this.An = Date.now(), this.reset();\n }\n /**\n * Resets the backoff delay.\n *\n * The very next backoffAndWait() will have no delay. If it is called again\n * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and\n * subsequent ones will increase according to the backoffFactor.\n */ return t.prototype.reset = function() {\n this.In = 0;\n }, \n /**\n * Resets the backoff delay to the maximum delay (e.g. for use after a\n * RESOURCE_EXHAUSTED error).\n */\n t.prototype.Rn = function() {\n this.In = this.Tn;\n }, \n /**\n * Returns a promise that resolves after currentDelayMs, and increases the\n * delay for any subsequent attempts. If there was a pending backoff operation\n * already, it will be canceled.\n */\n t.prototype.Pn = function(t) {\n var e = this;\n // Cancel any pending backoff operation.\n this.cancel();\n // First schedule using the current base (which may be 0 and should be\n // honored as such).\n var n = Math.floor(this.In + this.gn()), r = Math.max(0, Date.now() - this.An), i = Math.max(0, n - r);\n // Guard against lastAttemptTime being in the future due to a clock change.\n i > 0 && T(\"ExponentialBackoff\", \"Backing off for \" + i + \" ms (base delay: \" + this.In + \" ms, delay with jitter: \" + n + \" ms, last attempt: \" + r + \" ms ago)\"), \n this.mn = this.fn.Vn(this.dn, i, (function() {\n return e.An = Date.now(), t();\n })), \n // Apply backoff factor to determine next delay and ensure it is within\n // bounds.\n this.In *= this.En, this.In < this.wn && (this.In = this.wn), this.In > this.Tn && (this.In = this.Tn);\n }, t.prototype.yn = function() {\n null !== this.mn && (this.mn.pn(), this.mn = null);\n }, t.prototype.cancel = function() {\n null !== this.mn && (this.mn.cancel(), this.mn = null);\n }, \n /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ t.prototype.gn = function() {\n return (Math.random() - .5) * this.In;\n }, t;\n}(), cr = /** @class */ function() {\n function t(t) {\n var e = this;\n // NOTE: next/catchCallback will always point to our own wrapper functions,\n // not the user's raw next() or catch() callbacks.\n this.bn = null, this.vn = null, \n // When the operation resolves, we'll set result or error and mark isDone.\n this.result = void 0, this.error = void 0, this.Sn = !1, \n // Set to true when .then() or .catch() are called and prevents additional\n // chaining.\n this.Dn = !1, t((function(t) {\n e.Sn = !0, e.result = t, e.bn && \n // value should be defined unless T is Void, but we can't express\n // that in the type system.\n e.bn(t);\n }), (function(t) {\n e.Sn = !0, e.error = t, e.vn && e.vn(t);\n }));\n }\n return t.prototype.catch = function(t) {\n return this.next(void 0, t);\n }, t.prototype.next = function(e, n) {\n var r = this;\n return this.Dn && S(), this.Dn = !0, this.Sn ? this.error ? this.Cn(n, this.error) : this.Nn(e, this.result) : new t((function(t, i) {\n r.bn = function(n) {\n r.Nn(e, n).next(t, i);\n }, r.vn = function(e) {\n r.Cn(n, e).next(t, i);\n };\n }));\n }, t.prototype.xn = function() {\n var t = this;\n return new Promise((function(e, n) {\n t.next(e, n);\n }));\n }, t.prototype.Fn = function(e) {\n try {\n var n = e();\n return n instanceof t ? n : t.resolve(n);\n } catch (e) {\n return t.reject(e);\n }\n }, t.prototype.Nn = function(e, n) {\n return e ? this.Fn((function() {\n return e(n);\n })) : t.resolve(n);\n }, t.prototype.Cn = function(e, n) {\n return e ? this.Fn((function() {\n return e(n);\n })) : t.reject(n);\n }, t.resolve = function(e) {\n return new t((function(t, n) {\n t(e);\n }));\n }, t.reject = function(e) {\n return new t((function(t, n) {\n n(e);\n }));\n }, t.kn = function(\n // Accept all Promise types in waitFor().\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n e) {\n return new t((function(t, n) {\n var r = 0, i = 0, o = !1;\n e.forEach((function(e) {\n ++r, e.next((function() {\n ++i, o && i === r && t();\n }), (function(t) {\n return n(t);\n }));\n })), o = !0, i === r && t();\n }));\n }, \n /**\n * Given an array of predicate functions that asynchronously evaluate to a\n * boolean, implements a short-circuiting `or` between the results. Predicates\n * will be evaluated until one of them returns `true`, then stop. The final\n * result will be whether any of them returned `true`.\n */\n t.On = function(e) {\n for (var n = t.resolve(!1), r = function(e) {\n n = n.next((function(n) {\n return n ? t.resolve(n) : e();\n }));\n }, i = 0, o = e; i < o.length; i++) {\n r(o[i]);\n }\n return n;\n }, t.forEach = function(t, e) {\n var n = this, r = [];\n return t.forEach((function(t, i) {\n r.push(e.call(n, t, i));\n })), this.kn(r);\n }, t;\n}(), hr = /** @class */ function() {\n /*\n * Creates a new SimpleDb wrapper for IndexedDb database `name`.\n *\n * Note that `version` must not be a downgrade. IndexedDB does not support\n * downgrading the schema version. We currently do not support any way to do\n * versioning outside of IndexedDB's versioning mechanism, as only\n * version-upgrade transactions are allowed to do things like create\n * objectstores.\n */\n function t(e, n, r) {\n this.name = e, this.version = n, this.Mn = r, \n // NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the\n // bug we're checking for should exist in iOS >= 12.2 and < 13, but for\n // whatever reason it's much harder to hit after 12.2 so we only proactively\n // log on 12.2.\n 12.2 === t.$n(s()) && N(\"Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.\");\n }\n /** Deletes the specified database. */ return t.delete = function(t) {\n return T(\"SimpleDb\", \"Removing database:\", t), yr(window.indexedDB.deleteDatabase(t)).xn();\n }, \n /** Returns true if IndexedDB is available in the current environment. */ t.Ln = function() {\n if (\"undefined\" == typeof indexedDB) return !1;\n if (t.Bn()) return !0;\n // We extensively use indexed array values and compound keys,\n // which IE and Edge do not support. However, they still have indexedDB\n // defined on the window, so we need to check for them here and make sure\n // to return that persistence is not enabled for those browsers.\n // For tracking support of this feature, see here:\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/\n // Check the UA string to find out the browser.\n var e = s(), n = t.$n(e), r = 0 < n && n < 10, i = t.qn(e), o = 0 < i && i < 4.5;\n // IE 10\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n // IE 11\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n // Edge\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,\n // like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n // iOS Safari: Disable for users running iOS version < 10.\n return !(e.indexOf(\"MSIE \") > 0 || e.indexOf(\"Trident/\") > 0 || e.indexOf(\"Edge/\") > 0 || r || o);\n }, \n /**\n * Returns true if the backing IndexedDB store is the Node IndexedDBShim\n * (see https://github.com/axemclion/IndexedDBShim).\n */\n t.Bn = function() {\n var t;\n return \"undefined\" != typeof process && \"YES\" === (null === (t = process.env) || void 0 === t ? void 0 : t.Un);\n }, \n /** Helper to get a typed SimpleDbStore from a transaction. */ t.Kn = function(t, e) {\n return t.store(e);\n }, \n // visible for testing\n /** Parse User Agent to determine iOS version. Returns -1 if not found. */\n t.$n = function(t) {\n var e = t.match(/i(?:phone|pad|pod) os ([\\d_]+)/i), n = e ? e[1].split(\"_\").slice(0, 2).join(\".\") : \"-1\";\n return Number(n);\n }, \n // visible for testing\n /** Parse User Agent to determine Android version. Returns -1 if not found. */\n t.qn = function(t) {\n var e = t.match(/Android ([\\d.]+)/i), n = e ? e[1].split(\".\").slice(0, 2).join(\".\") : \"-1\";\n return Number(n);\n }, \n /**\n * Opens the specified database, creating or upgrading it if necessary.\n */\n t.prototype.Qn = function(t) {\n return e(this, void 0, void 0, (function() {\n var e, r = this;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return this.db ? [ 3 /*break*/ , 2 ] : (T(\"SimpleDb\", \"Opening database:\", this.name), \n e = this, [ 4 /*yield*/ , new Promise((function(e, n) {\n // TODO(mikelehen): Investigate browser compatibility.\n // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB\n // suggests IE9 and older WebKit browsers handle upgrade\n // differently. They expect setVersion, as described here:\n // https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeRequest/setVersion\n var i = indexedDB.open(r.name, r.version);\n i.onsuccess = function(t) {\n var n = t.target.result;\n e(n);\n }, i.onblocked = function() {\n n(new lr(t, \"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed.\"));\n }, i.onerror = function(e) {\n var r = e.target.error;\n \"VersionError\" === r.name ? n(new I(b.FAILED_PRECONDITION, \"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.\")) : n(new lr(t, r));\n }, i.onupgradeneeded = function(t) {\n T(\"SimpleDb\", 'Database \"' + r.name + '\" requires upgrade from version:', t.oldVersion);\n var e = t.target.result;\n r.Mn.createOrUpgrade(e, i.transaction, t.oldVersion, r.version).next((function() {\n T(\"SimpleDb\", \"Database upgrade to version \" + r.version + \" complete\");\n }));\n };\n })) ]);\n\n case 1:\n e.db = n.sent(), n.label = 2;\n\n case 2:\n return [ 2 /*return*/ , (this.Wn && (this.db.onversionchange = function(t) {\n return r.Wn(t);\n }), this.db) ];\n }\n }));\n }));\n }, t.prototype.jn = function(t) {\n this.Wn = t, this.db && (this.db.onversionchange = function(e) {\n return t(e);\n });\n }, t.prototype.runTransaction = function(t, r, i, o) {\n return e(this, void 0, void 0, (function() {\n var e, u, s, a, c;\n return n(this, (function(h) {\n switch (h.label) {\n case 0:\n e = \"readonly\" === r, u = 0, s = function() {\n var r, s, c, h, f;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n ++u, n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 4, , 5 ]), [ 4 /*yield*/ , a.Qn(t) ];\n\n case 2:\n // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to\n // fire), but still return the original transactionFnResult back to the\n // caller.\n return a.db = n.sent(), r = dr.open(a.db, t, e ? \"readonly\" : \"readwrite\", i), s = o(r).catch((function(t) {\n // Abort the transaction if there was an error.\n return r.abort(t), cr.reject(t);\n })).xn(), c = {}, s.catch((function() {})), [ 4 /*yield*/ , r.Gn ];\n\n case 3:\n return [ 2 /*return*/ , (c.value = (\n // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to\n // fire), but still return the original transactionFnResult back to the\n // caller.\n n.sent(), s), c) ];\n\n case 4:\n return h = n.sent(), f = \"FirebaseError\" !== h.name && u < 3, T(\"SimpleDb\", \"Transaction failed with error:\", h.message, \"Retrying:\", f), \n a.close(), f ? [ 3 /*break*/ , 5 ] : [ 2 /*return*/ , {\n value: Promise.reject(h)\n } ];\n\n case 5:\n return [ 2 /*return*/ ];\n }\n }));\n }, a = this, h.label = 1;\n\n case 1:\n return [ 5 /*yield**/ , s() ];\n\n case 2:\n if (\"object\" == typeof (c = h.sent())) return [ 2 /*return*/ , c.value ];\n h.label = 3;\n\n case 3:\n return [ 3 /*break*/ , 1 ];\n\n case 4:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }, t.prototype.close = function() {\n this.db && this.db.close(), this.db = void 0;\n }, t;\n}(), fr = /** @class */ function() {\n function t(t) {\n this.zn = t, this.Hn = !1, this.Jn = null;\n }\n return Object.defineProperty(t.prototype, \"Sn\", {\n get: function() {\n return this.Hn;\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"Yn\", {\n get: function() {\n return this.Jn;\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"cursor\", {\n set: function(t) {\n this.zn = t;\n },\n enumerable: !1,\n configurable: !0\n }), \n /**\n * This function can be called to stop iteration at any point.\n */\n t.prototype.done = function() {\n this.Hn = !0;\n }, \n /**\n * This function can be called to skip to that next key, which could be\n * an index or a primary key.\n */\n t.prototype.Xn = function(t) {\n this.Jn = t;\n }, \n /**\n * Delete the current cursor value from the object store.\n *\n * NOTE: You CANNOT do this with a keysOnly query.\n */\n t.prototype.delete = function() {\n return yr(this.zn.delete());\n }, t;\n}(), lr = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this, b.UNAVAILABLE, \"IndexedDB transaction '\" + t + \"' failed: \" + n) || this).name = \"IndexedDbTransactionError\", \n r;\n }\n return t(n, e), n;\n}(I);\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A helper for running delayed tasks following an exponential backoff curve\n * between attempts.\n *\n * Each delay is made up of a \"base\" delay which follows the exponential\n * backoff curve, and a +/- 50% \"jitter\" that is calculated and added to the\n * base delay. This prevents clients from accidentally synchronizing their\n * delays causing spikes of load to the backend.\n */\n/** Verifies whether `e` is an IndexedDbTransactionError. */ function pr(t) {\n // Use name equality, as instanceof checks on errors don't work with errors\n // that wrap other errors.\n return \"IndexedDbTransactionError\" === t.name;\n}\n\n/**\n * Wraps an IDBTransaction and exposes a store() method to get a handle to a\n * specific object store.\n */ var dr = /** @class */ function() {\n function t(t, e) {\n var n = this;\n this.action = t, this.transaction = e, this.aborted = !1, \n /**\n * A promise that resolves with the result of the IndexedDb transaction.\n */\n this.Zn = new sr, this.transaction.oncomplete = function() {\n n.Zn.resolve();\n }, this.transaction.onabort = function() {\n e.error ? n.Zn.reject(new lr(t, e.error)) : n.Zn.resolve();\n }, this.transaction.onerror = function(e) {\n var r = gr(e.target.error);\n n.Zn.reject(new lr(t, r));\n };\n }\n return t.open = function(e, n, r, i) {\n try {\n return new t(n, e.transaction(i, r));\n } catch (e) {\n throw new lr(n, e);\n }\n }, Object.defineProperty(t.prototype, \"Gn\", {\n get: function() {\n return this.Zn.promise;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.abort = function(t) {\n t && this.Zn.reject(t), this.aborted || (T(\"SimpleDb\", \"Aborting transaction:\", t ? t.message : \"Client-initiated abort\"), \n this.aborted = !0, this.transaction.abort());\n }, \n /**\n * Returns a SimpleDbStore<KeyType, ValueType> for the specified store. All\n * operations performed on the SimpleDbStore happen within the context of this\n * transaction and it cannot be used anymore once the transaction is\n * completed.\n *\n * Note that we can't actually enforce that the KeyType and ValueType are\n * correct, but they allow type safety through the rest of the consuming code.\n */\n t.prototype.store = function(t) {\n var e = this.transaction.objectStore(t);\n return new vr(e);\n }, t;\n}(), vr = /** @class */ function() {\n function t(t) {\n this.store = t;\n }\n return t.prototype.put = function(t, e) {\n var n;\n return void 0 !== e ? (T(\"SimpleDb\", \"PUT\", this.store.name, t, e), n = this.store.put(e, t)) : (T(\"SimpleDb\", \"PUT\", this.store.name, \"<auto-key>\", t), \n n = this.store.put(t)), yr(n);\n }, \n /**\n * Adds a new value into an Object Store and returns the new key. Similar to\n * IndexedDb's `add()`, this method will fail on primary key collisions.\n *\n * @param value The object to write.\n * @return The key of the value to add.\n */\n t.prototype.add = function(t) {\n return T(\"SimpleDb\", \"ADD\", this.store.name, t, t), yr(this.store.add(t));\n }, \n /**\n * Gets the object with the specified key from the specified store, or null\n * if no object exists with the specified key.\n *\n * @key The key of the object to get.\n * @return The object with the specified key or null if no object exists.\n */\n t.prototype.get = function(t) {\n var e = this;\n // We're doing an unsafe cast to ValueType.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return yr(this.store.get(t)).next((function(n) {\n // Normalize nonexistence to null.\n return void 0 === n && (n = null), T(\"SimpleDb\", \"GET\", e.store.name, t, n), n;\n }));\n }, t.prototype.delete = function(t) {\n return T(\"SimpleDb\", \"DELETE\", this.store.name, t), yr(this.store.delete(t));\n }, \n /**\n * If we ever need more of the count variants, we can add overloads. For now,\n * all we need is to count everything in a store.\n *\n * Returns the number of rows in the store.\n */\n t.prototype.count = function() {\n return T(\"SimpleDb\", \"COUNT\", this.store.name), yr(this.store.count());\n }, t.prototype.ts = function(t, e) {\n var n = this.cursor(this.options(t, e)), r = [];\n return this.es(n, (function(t, e) {\n r.push(e);\n })).next((function() {\n return r;\n }));\n }, t.prototype.ns = function(t, e) {\n T(\"SimpleDb\", \"DELETE ALL\", this.store.name);\n var n = this.options(t, e);\n n.ss = !1;\n var r = this.cursor(n);\n return this.es(r, (function(t, e, n) {\n return n.delete();\n }));\n }, t.prototype.rs = function(t, e) {\n var n;\n e ? n = t : (n = {}, e = t);\n var r = this.cursor(n);\n return this.es(r, e);\n }, \n /**\n * Iterates over a store, but waits for the given callback to complete for\n * each entry before iterating the next entry. This allows the callback to do\n * asynchronous work to determine if this iteration should continue.\n *\n * The provided callback should return `true` to continue iteration, and\n * `false` otherwise.\n */\n t.prototype.os = function(t) {\n var e = this.cursor({});\n return new cr((function(n, r) {\n e.onerror = function(t) {\n var e = gr(t.target.error);\n r(e);\n }, e.onsuccess = function(e) {\n var r = e.target.result;\n r ? t(r.primaryKey, r.value).next((function(t) {\n t ? r.continue() : n();\n })) : n();\n };\n }));\n }, t.prototype.es = function(t, e) {\n var n = [];\n return new cr((function(r, i) {\n t.onerror = function(t) {\n i(t.target.error);\n }, t.onsuccess = function(t) {\n var i = t.target.result;\n if (i) {\n var o = new fr(i), u = e(i.primaryKey, i.value, o);\n if (u instanceof cr) {\n var s = u.catch((function(t) {\n return o.done(), cr.reject(t);\n }));\n n.push(s);\n }\n o.Sn ? r() : null === o.Yn ? i.continue() : i.continue(o.Yn);\n } else r();\n };\n })).next((function() {\n return cr.kn(n);\n }));\n }, t.prototype.options = function(t, e) {\n var n = void 0;\n return void 0 !== t && (\"string\" == typeof t ? n = t : e = t), {\n index: n,\n range: e\n };\n }, t.prototype.cursor = function(t) {\n var e = \"next\";\n if (t.reverse && (e = \"prev\"), t.index) {\n var n = this.store.index(t.index);\n return t.ss ? n.openKeyCursor(t.range, e) : n.openCursor(t.range, e);\n }\n return this.store.openCursor(t.range, e);\n }, t;\n}();\n\n/**\n * A wrapper around an IDBObjectStore providing an API that:\n *\n * 1) Has generic KeyType / ValueType parameters to provide strongly-typed\n * methods for acting against the object store.\n * 2) Deals with IndexedDB's onsuccess / onerror event callbacks, making every\n * method return a PersistencePromise instead.\n * 3) Provides a higher-level API to avoid needing to do excessive wrapping of\n * intermediate IndexedDB types (IDBCursorWithValue, etc.)\n */\n/**\n * Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror\n * handlers to resolve / reject the PersistencePromise as appropriate.\n */\nfunction yr(t) {\n return new cr((function(e, n) {\n t.onsuccess = function(t) {\n var n = t.target.result;\n e(n);\n }, t.onerror = function(t) {\n var e = gr(t.target.error);\n n(e);\n };\n }));\n}\n\n// Guard so we only report the error once.\nvar mr = !1;\n\nfunction gr(t) {\n var e = hr.$n(s());\n if (e >= 12.2 && e < 13) {\n var n = \"An internal error was encountered in the Indexed Database server\";\n if (t.message.indexOf(n) >= 0) {\n // Wrap error in a more descriptive one.\n var r = new I(\"internal\", \"IOS_INDEXEDDB_BUG1: IndexedDb has thrown '\" + n + \"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.\");\n return mr || (mr = !0, \n // Throw a global exception outside of this promise chain, for the user to\n // potentially catch.\n setTimeout((function() {\n throw r;\n }), 0)), r;\n }\n }\n return t;\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** The Platform's 'window' implementation or null if not available. */ function wr() {\n // `window` is not always available, e.g. in ReactNative and WebWorkers.\n // eslint-disable-next-line no-restricted-globals\n return \"undefined\" != typeof window ? window : null;\n}\n\n/** The Platform's 'document' implementation or null if not available. */ function br() {\n // `document` is not always available, e.g. in ReactNative and WebWorkers.\n // eslint-disable-next-line no-restricted-globals\n return \"undefined\" != typeof document ? document : null;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents an operation scheduled to be run in the future on an AsyncQueue.\n *\n * It is created via DelayedOperation.createAndSchedule().\n *\n * Supports cancellation (via cancel()) and early execution (via skipDelay()).\n *\n * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type\n * in newer versions of TypeScript defines `finally`, which is not available in\n * IE.\n */ var Ir = /** @class */ function() {\n function t(t, e, n, r, i) {\n this.hs = t, this.dn = e, this.cs = n, this.op = r, this.us = i, this.ls = new sr, \n this.then = this.ls.promise.then.bind(this.ls.promise), \n // It's normal for the deferred promise to be canceled (due to cancellation)\n // and so we attach a dummy catch callback to avoid\n // 'UnhandledPromiseRejectionWarning' log spam.\n this.ls.promise.catch((function(t) {}))\n /**\n * Creates and returns a DelayedOperation that has been scheduled to be\n * executed on the provided asyncQueue after the provided delayMs.\n *\n * @param asyncQueue The queue to schedule the operation on.\n * @param id A Timer ID identifying the type of operation this is.\n * @param delayMs The delay (ms) before the operation should be scheduled.\n * @param op The operation to run.\n * @param removalCallback A callback to be called synchronously once the\n * operation is executed or canceled, notifying the AsyncQueue to remove it\n * from its delayedOperations list.\n * PORTING NOTE: This exists to prevent making removeDelayedOperation() and\n * the DelayedOperation class public.\n */;\n }\n return t._s = function(e, n, r, i, o) {\n var u = new t(e, n, Date.now() + r, i, o);\n return u.start(r), u;\n }, \n /**\n * Starts the timer. This is called immediately after construction by\n * createAndSchedule().\n */\n t.prototype.start = function(t) {\n var e = this;\n this.fs = setTimeout((function() {\n return e.ds();\n }), t);\n }, \n /**\n * Queues the operation to run immediately (if it hasn't already been run or\n * canceled).\n */\n t.prototype.pn = function() {\n return this.ds();\n }, \n /**\n * Cancels the operation if it hasn't already been executed or canceled. The\n * promise will be rejected.\n *\n * As long as the operation has not yet been run, calling cancel() provides a\n * guarantee that the operation will not be run.\n */\n t.prototype.cancel = function(t) {\n null !== this.fs && (this.clearTimeout(), this.ls.reject(new I(b.CANCELLED, \"Operation cancelled\" + (t ? \": \" + t : \"\"))));\n }, t.prototype.ds = function() {\n var t = this;\n this.hs.ws((function() {\n return null !== t.fs ? (t.clearTimeout(), t.op().then((function(e) {\n return t.ls.resolve(e);\n }))) : Promise.resolve();\n }));\n }, t.prototype.clearTimeout = function() {\n null !== this.fs && (this.us(this), clearTimeout(this.fs), this.fs = null);\n }, t;\n}(), Er = /** @class */ function() {\n function t() {\n var t = this;\n // The last promise in the queue.\n this.Es = Promise.resolve(), \n // A list of retryable operations. Retryable operations are run in order and\n // retried with backoff.\n this.Ts = [], \n // Is this AsyncQueue being shut down? Once it is set to true, it will not\n // be changed again.\n this.Is = !1, \n // Operations scheduled to be queued in the future. Operations are\n // automatically removed after they are run or canceled.\n this.As = [], \n // visible for testing\n this.Rs = null, \n // Flag set while there's an outstanding AsyncQueue operation, used for\n // assertion sanity-checks.\n this.Ps = !1, \n // List of TimerIds to fast-forward delays for.\n this.gs = [], \n // Backoff timer used to schedule retries for retryable operations\n this.Vs = new ar(this, \"async_queue_retry\" /* AsyncQueueRetry */), \n // Visibility handler that triggers an immediate retry of all retryable\n // operations. Meant to speed up recovery when we regain file system access\n // after page comes into foreground.\n this.ys = function() {\n var e = br();\n e && T(\"AsyncQueue\", \"Visibility state changed to \", e.visibilityState), t.Vs.yn();\n };\n var e = br();\n e && \"function\" == typeof e.addEventListener && e.addEventListener(\"visibilitychange\", this.ys);\n }\n return Object.defineProperty(t.prototype, \"ps\", {\n // Is this AsyncQueue being shut down? If true, this instance will not enqueue\n // any new operations, Promises from enqueue requests will not resolve.\n get: function() {\n return this.Is;\n },\n enumerable: !1,\n configurable: !0\n }), \n /**\n * Adds a new operation to the queue without waiting for it to complete (i.e.\n * we ignore the Promise result).\n */\n t.prototype.ws = function(t) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.enqueue(t);\n }, \n /**\n * Regardless if the queue has initialized shutdown, adds a new operation to the\n * queue without waiting for it to complete (i.e. we ignore the Promise result).\n */\n t.prototype.bs = function(t) {\n this.vs(), \n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.Ss(t);\n }, \n /**\n * Initialize the shutdown of this queue. Once this method is called, the\n * only possible way to request running an operation is through\n * `enqueueEvenWhileRestricted()`.\n */\n t.prototype.Ds = function() {\n if (!this.Is) {\n this.Is = !0;\n var t = br();\n t && \"function\" == typeof t.removeEventListener && t.removeEventListener(\"visibilitychange\", this.ys);\n }\n }, \n /**\n * Adds a new operation to the queue. Returns a promise that will be resolved\n * when the promise returned by the new operation is (with its value).\n */\n t.prototype.enqueue = function(t) {\n return this.vs(), this.Is ? new Promise((function(t) {})) : this.Ss(t);\n }, \n /**\n * Enqueue a retryable operation.\n *\n * A retryable operation is rescheduled with backoff if it fails with a\n * IndexedDbTransactionError (the error type used by SimpleDb). All\n * retryable operations are executed in order and only run if all prior\n * operations were retried successfully.\n */\n t.prototype.Cs = function(t) {\n var e = this;\n this.ws((function() {\n return e.Ts.push(t), e.Ns();\n }));\n }, \n /**\n * Runs the next operation from the retryable queue. If the operation fails,\n * reschedules with backoff.\n */\n t.prototype.Ns = function() {\n return e(this, void 0, void 0, (function() {\n var t, e = this;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n if (0 === this.Ts.length) return [ 3 /*break*/ , 5 ];\n n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 3, , 4 ]), [ 4 /*yield*/ , this.Ts[0]() ];\n\n case 2:\n return n.sent(), this.Ts.shift(), this.Vs.reset(), [ 3 /*break*/ , 4 ];\n\n case 3:\n if (!pr(t = n.sent())) throw t;\n // Failure will be handled by AsyncQueue\n return T(\"AsyncQueue\", \"Operation failed with retryable error: \" + t), \n [ 3 /*break*/ , 4 ];\n\n case 4:\n this.Ts.length > 0 && \n // If there are additional operations, we re-schedule `retryNextOp()`.\n // This is necessary to run retryable operations that failed during\n // their initial attempt since we don't know whether they are already\n // enqueued. If, for example, `op1`, `op2`, `op3` are enqueued and `op1`\n // needs to be re-run, we will run `op1`, `op1`, `op2` using the\n // already enqueued calls to `retryNextOp()`. `op3()` will then run in the\n // call scheduled here.\n // Since `backoffAndRun()` cancels an existing backoff and schedules a\n // new backoff on every call, there is only ever a single additional\n // operation in the queue.\n this.Vs.Pn((function() {\n return e.Ns();\n })), n.label = 5;\n\n case 5:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }, t.prototype.Ss = function(t) {\n var e = this, n = this.Es.then((function() {\n return e.Ps = !0, t().catch((function(t) {\n // Re-throw the error so that this.tail becomes a rejected Promise and\n // all further attempts to chain (via .then) will just short-circuit\n // and return the rejected Promise.\n throw e.Rs = t, e.Ps = !1, N(\"INTERNAL UNHANDLED ERROR: \", \n /**\n * Chrome includes Error.message in Error.stack. Other browsers do not.\n * This returns expected output of message + stack when available.\n * @param error Error or FirestoreError\n */\n function(t) {\n var e = t.message || \"\";\n return t.stack && (e = t.stack.includes(t.message) ? t.stack : t.message + \"\\n\" + t.stack), \n e;\n }(t)), t;\n })).then((function(t) {\n return e.Ps = !1, t;\n }));\n }));\n return this.Es = n, n;\n }, \n /**\n * Schedules an operation to be queued on the AsyncQueue once the specified\n * `delayMs` has elapsed. The returned DelayedOperation can be used to cancel\n * or fast-forward the operation prior to its running.\n */\n t.prototype.Vn = function(t, e, n) {\n var r = this;\n this.vs(), \n // Fast-forward delays for timerIds that have been overriden.\n this.gs.indexOf(t) > -1 && (e = 0);\n var i = Ir._s(this, t, e, n, (function(t) {\n return r.xs(t);\n }));\n return this.As.push(i), i;\n }, t.prototype.vs = function() {\n this.Rs && S();\n }, \n /**\n * Verifies there's an operation currently in-progress on the AsyncQueue.\n * Unfortunately we can't verify that the running code is in the promise chain\n * of that operation, so this isn't a foolproof check, but it should be enough\n * to catch some bugs.\n */\n t.prototype.Fs = function() {}, \n /**\n * Waits until all currently queued tasks are finished executing. Delayed\n * operations are not run.\n */\n t.prototype.ks = function() {\n return e(this, void 0, void 0, (function() {\n var t;\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n return [ 4 /*yield*/ , t = this.Es ];\n\n case 1:\n e.sent(), e.label = 2;\n\n case 2:\n if (t !== this.Es) return [ 3 /*break*/ , 0 ];\n e.label = 3;\n\n case 3:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }, \n /**\n * For Tests: Determine if a delayed operation with a particular TimerId\n * exists.\n */\n t.prototype.Os = function(t) {\n for (var e = 0, n = this.As; e < n.length; e++) {\n if (n[e].dn === t) return !0;\n }\n return !1;\n }, \n /**\n * For Tests: Runs some or all delayed operations early.\n *\n * @param lastTimerId Delayed operations up to and including this TimerId will\n * be drained. Pass TimerId.All to run all delayed operations.\n * @returns a Promise that resolves once all operations have been run.\n */\n t.prototype.Ms = function(t) {\n var e = this;\n // Note that draining may generate more delayed ops, so we do that first.\n return this.ks().then((function() {\n // Run ops in the same order they'd run if they ran naturally.\n e.As.sort((function(t, e) {\n return t.cs - e.cs;\n }));\n for (var n = 0, r = e.As; n < r.length; n++) {\n var i = r[n];\n if (i.pn(), \"all\" /* All */ !== t && i.dn === t) break;\n }\n return e.ks();\n }));\n }, \n /**\n * For Tests: Skip all subsequent delays for a timer id.\n */\n t.prototype.$s = function(t) {\n this.gs.push(t);\n }, \n /** Called once a DelayedOperation is run or canceled. */ t.prototype.xs = function(t) {\n // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.\n var e = this.As.indexOf(t);\n this.As.splice(e, 1);\n }, t;\n}();\n\n/**\n * Returns a FirestoreError that can be surfaced to the user if the provided\n * error is an IndexedDbTransactionError. Re-throws the error otherwise.\n */\nfunction _r(t, e) {\n if (N(\"AsyncQueue\", e + \": \" + t), pr(t)) return new I(b.UNAVAILABLE, e + \": \" + t);\n throw t;\n}\n\nvar Tr = function() {\n this.Ls = void 0, this.listeners = [];\n}, Nr = function() {\n this.Bs = new W((function(t) {\n return jn(t);\n }), Fn), this.onlineState = \"Unknown\" /* Unknown */ , this.qs = new Set;\n};\n\nfunction Ar(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u, s, a, c;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n if (e = k(t), i = r.query, o = !1, (u = e.Bs.get(i)) || (o = !0, u = new Tr), !o) return [ 3 /*break*/ , 4 ];\n n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 3, , 4 ]), s = u, [ 4 /*yield*/ , e.Us(i) ];\n\n case 2:\n return s.Ls = n.sent(), [ 3 /*break*/ , 4 ];\n\n case 3:\n return a = n.sent(), c = _r(a, \"Initialization of query '\" + Gn(r.query) + \"' failed\"), \n [ 2 /*return*/ , void r.onError(c) ];\n\n case 4:\n return e.Bs.set(i, u), u.listeners.push(r), \n // Run global snapshot listeners if a consistent snapshot has been emitted.\n r.Ks(e.onlineState), u.Ls && r.Qs(u.Ls) && kr(e), [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction Dr(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u, s;\n return n(this, (function(n) {\n return e = k(t), i = r.query, o = !1, (u = e.Bs.get(i)) && (s = u.listeners.indexOf(r)) >= 0 && (u.listeners.splice(s, 1), \n o = 0 === u.listeners.length), o ? [ 2 /*return*/ , (e.Bs.delete(i), e.Ws(i)) ] : [ 2 /*return*/ ];\n }));\n }));\n}\n\nfunction Sr(t, e) {\n for (var n = k(t), r = !1, i = 0, o = e; i < o.length; i++) {\n var u = o[i], s = u.query, a = n.Bs.get(s);\n if (a) {\n for (var c = 0, h = a.listeners; c < h.length; c++) {\n h[c].Qs(u) && (r = !0);\n }\n a.Ls = u;\n }\n }\n r && kr(n);\n}\n\nfunction xr(t, e, n) {\n var r = k(t), i = r.Bs.get(e);\n if (i) for (var o = 0, u = i.listeners; o < u.length; o++) {\n u[o].onError(n);\n }\n // Remove all listeners. NOTE: We don't need to call syncEngine.unlisten()\n // after an error.\n r.Bs.delete(e);\n}\n\n// Call all global snapshot listeners that have been set.\nfunction kr(t) {\n t.qs.forEach((function(t) {\n t.next();\n }));\n}\n\n/**\n * QueryListener takes a series of internal view snapshots and determines\n * when to raise the event.\n *\n * It uses an Observer to dispatch events.\n */ var Pr = /** @class */ function() {\n function t(t, e, n) {\n this.query = t, this.js = e, \n /**\n * Initial snapshots (e.g. from cache) may not be propagated to the wrapped\n * observer. This flag is set to true once we've actually raised an event.\n */\n this.Gs = !1, this.zs = null, this.onlineState = \"Unknown\" /* Unknown */ , this.options = n || {}\n /**\n * Applies the new ViewSnapshot to this listener, raising a user-facing event\n * if applicable (depending on what changed, whether the user has opted into\n * metadata-only changes, etc.). Returns true if a user-facing event was\n * indeed raised.\n */;\n }\n return t.prototype.Qs = function(t) {\n if (!this.options.includeMetadataChanges) {\n for (\n // Remove the metadata only changes.\n var e = [], n = 0, r = t.docChanges; n < r.length; n++) {\n var i = r[n];\n 3 /* Metadata */ !== i.type && e.push(i);\n }\n t = new Pt(t.query, t.docs, t.Kt, e, t.Qt, t.fromCache, t.Wt, \n /* excludesMetadataChanges= */ !0);\n }\n var o = !1;\n return this.Gs ? this.Hs(t) && (this.js.next(t), o = !0) : this.Js(t, this.onlineState) && (this.Ys(t), \n o = !0), this.zs = t, o;\n }, t.prototype.onError = function(t) {\n this.js.error(t);\n }, \n /** Returns whether a snapshot was raised. */ t.prototype.Ks = function(t) {\n this.onlineState = t;\n var e = !1;\n return this.zs && !this.Gs && this.Js(this.zs, t) && (this.Ys(this.zs), e = !0), \n e;\n }, t.prototype.Js = function(t, e) {\n // Always raise the first event when we're synced\n if (!t.fromCache) return !0;\n // NOTE: We consider OnlineState.Unknown as online (it should become Offline\n // or Online if we wait long enough).\n var n = \"Offline\" /* Offline */ !== e;\n // Don't raise the event if we're online, aren't synced yet (checked\n // above) and are waiting for a sync.\n return !(this.options.Xs && n || t.docs.P() && \"Offline\" /* Offline */ !== e);\n // Raise data from cache if we have any documents or we are offline\n }, t.prototype.Hs = function(t) {\n // We don't need to handle includeDocumentMetadataChanges here because\n // the Metadata only changes have already been stripped out if needed.\n // At this point the only changes we will see are the ones we should\n // propagate.\n if (t.docChanges.length > 0) return !0;\n var e = this.zs && this.zs.hasPendingWrites !== t.hasPendingWrites;\n return !(!t.Wt && !e) && !0 === this.options.includeMetadataChanges;\n // Generally we should have hit one of the cases above, but it's possible\n // to get here if there were only metadata docChanges and they got\n // stripped out.\n }, t.prototype.Ys = function(t) {\n t = Pt.Gt(t.query, t.docs, t.Qt, t.fromCache), this.Gs = !0, this.js.next(t);\n }, t;\n}(), Or = /** @class */ function() {\n function t(t) {\n this.uid = t;\n }\n return t.prototype.Zs = function() {\n return null != this.uid;\n }, \n /**\n * Returns a key representing this user, suitable for inclusion in a\n * dictionary.\n */\n t.prototype.ti = function() {\n return this.Zs() ? \"uid:\" + this.uid : \"anonymous-user\";\n }, t.prototype.isEqual = function(t) {\n return t.uid === this.uid;\n }, t;\n}();\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Simple wrapper around a nullable UID. Mostly exists to make code more\n * readable.\n */\n/** A user with a null UID. */ Or.UNAUTHENTICATED = new Or(null), \n// TODO(mikelehen): Look into getting a proper uid-equivalent for\n// non-FirebaseAuth providers.\nOr.ei = new Or(\"google-credentials-uid\"), Or.ni = new Or(\"first-party-uid\");\n\n/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * `ListenSequence` is a monotonic sequence. It is initialized with a minimum value to\n * exceed. All subsequent calls to next will return increasing values. If provided with a\n * `SequenceNumberSyncer`, it will additionally bump its next value when told of a new value, as\n * well as write out sequence numbers that it produces via `next()`.\n */\nvar Lr = /** @class */ function() {\n function t(t, e) {\n var n = this;\n this.previousValue = t, e && (e.si = function(t) {\n return n.ii(t);\n }, this.ri = function(t) {\n return e.oi(t);\n });\n }\n return t.prototype.ii = function(t) {\n return this.previousValue = Math.max(t, this.previousValue), this.previousValue;\n }, t.prototype.next = function() {\n var t = ++this.previousValue;\n return this.ri && this.ri(t), t;\n }, t;\n}();\n\n/** Assembles the key for a client state in WebStorage */\nfunction Vr(t, e) {\n return \"firestore_clients_\" + t + \"_\" + e;\n}\n\n// The format of the WebStorage key that stores the mutation state is:\n// firestore_mutations_<persistence_prefix>_<batch_id>\n// (for unauthenticated users)\n// or: firestore_mutations_<persistence_prefix>_<batch_id>_<user_uid>\n// 'user_uid' is last to avoid needing to escape '_' characters that it might\n// contain.\n/** Assembles the key for a mutation batch in WebStorage */ function Rr(t, e, n) {\n var r = \"firestore_mutations_\" + t + \"_\" + n;\n return e.Zs() && (r += \"_\" + e.uid), r;\n}\n\n// The format of the WebStorage key that stores a query target's metadata is:\n// firestore_targets_<persistence_prefix>_<target_id>\n/** Assembles the key for a query state in WebStorage */ function Cr(t, e) {\n return \"firestore_targets_\" + t + \"_\" + e;\n}\n\n// The WebStorage prefix that stores the primary tab's online state. The\n// format of the key is:\n// firestore_online_state_<persistence_prefix>\n/**\n * Holds the state of a mutation batch, including its user ID, batch ID and\n * whether the batch is 'pending', 'acknowledged' or 'rejected'.\n */\n// Visible for testing\nLr.ai = -1;\n\nvar Ur = /** @class */ function() {\n function t(t, e, n, r) {\n this.user = t, this.batchId = e, this.state = n, this.error = r\n /**\n * Parses a MutationMetadata from its JSON representation in WebStorage.\n * Logs a warning and returns null if the format of the data is not valid.\n */;\n }\n return t.hi = function(e, n, r) {\n var i = JSON.parse(r), o = \"object\" == typeof i && -1 !== [ \"pending\", \"acknowledged\", \"rejected\" ].indexOf(i.state) && (void 0 === i.error || \"object\" == typeof i.error), u = void 0;\n return o && i.error && ((o = \"string\" == typeof i.error.message && \"string\" == typeof i.error.code) && (u = new I(i.error.code, i.error.message))), \n o ? new t(e, n, i.state, u) : (N(\"SharedClientState\", \"Failed to parse mutation state for ID '\" + n + \"': \" + r), \n null);\n }, t.prototype.ci = function() {\n var t = {\n state: this.state,\n updateTimeMs: Date.now()\n };\n return this.error && (t.error = {\n code: this.error.code,\n message: this.error.message\n }), JSON.stringify(t);\n }, t;\n}(), Mr = /** @class */ function() {\n function t(t, e, n) {\n this.targetId = t, this.state = e, this.error = n\n /**\n * Parses a QueryTargetMetadata from its JSON representation in WebStorage.\n * Logs a warning and returns null if the format of the data is not valid.\n */;\n }\n return t.hi = function(e, n) {\n var r = JSON.parse(n), i = \"object\" == typeof r && -1 !== [ \"not-current\", \"current\", \"rejected\" ].indexOf(r.state) && (void 0 === r.error || \"object\" == typeof r.error), o = void 0;\n return i && r.error && ((i = \"string\" == typeof r.error.message && \"string\" == typeof r.error.code) && (o = new I(r.error.code, r.error.message))), \n i ? new t(e, r.state, o) : (N(\"SharedClientState\", \"Failed to parse target state for ID '\" + e + \"': \" + n), \n null);\n }, t.prototype.ci = function() {\n var t = {\n state: this.state,\n updateTimeMs: Date.now()\n };\n return this.error && (t.error = {\n code: this.error.code,\n message: this.error.message\n }), JSON.stringify(t);\n }, t;\n}(), qr = /** @class */ function() {\n function t(t, e) {\n this.clientId = t, this.activeTargetIds = e\n /**\n * Parses a RemoteClientState from the JSON representation in WebStorage.\n * Logs a warning and returns null if the format of the data is not valid.\n */;\n }\n return t.hi = function(e, n) {\n for (var r = JSON.parse(n), i = \"object\" == typeof r && r.activeTargetIds instanceof Array, o = St(), u = 0; i && u < r.activeTargetIds.length; ++u) i = nt(r.activeTargetIds[u]), \n o = o.add(r.activeTargetIds[u]);\n return i ? new t(e, o) : (N(\"SharedClientState\", \"Failed to parse client data for instance '\" + e + \"': \" + n), \n null);\n }, t;\n}(), Fr = /** @class */ function() {\n function t(t, e) {\n this.clientId = t, this.onlineState = e\n /**\n * Parses a SharedOnlineState from its JSON representation in WebStorage.\n * Logs a warning and returns null if the format of the data is not valid.\n */;\n }\n return t.hi = function(e) {\n var n = JSON.parse(e);\n return \"object\" == typeof n && -1 !== [ \"Unknown\", \"Online\", \"Offline\" ].indexOf(n.onlineState) && \"string\" == typeof n.clientId ? new t(n.clientId, n.onlineState) : (N(\"SharedClientState\", \"Failed to parse online state: \" + e), \n null);\n }, t;\n}(), jr = /** @class */ function() {\n function t() {\n this.activeTargetIds = St();\n }\n return t.prototype.ui = function(t) {\n this.activeTargetIds = this.activeTargetIds.add(t);\n }, t.prototype.li = function(t) {\n this.activeTargetIds = this.activeTargetIds.delete(t);\n }, \n /**\n * Converts this entry into a JSON-encoded format we can use for WebStorage.\n * Does not encode `clientId` as it is part of the key in WebStorage.\n */\n t.prototype.ci = function() {\n var t = {\n activeTargetIds: this.activeTargetIds.L(),\n updateTimeMs: Date.now()\n };\n return JSON.stringify(t);\n }, t;\n}(), Gr = /** @class */ function() {\n function t(t, e, n, r, i) {\n this.window = t, this.fn = e, this.persistenceKey = n, this._i = r, this.fi = null, \n this.di = null, this.si = null, this.wi = this.Ei.bind(this), this.Ti = new dt(L), \n this.Ii = !1, \n /**\n * Captures WebStorage events that occur before `start()` is called. These\n * events are replayed once `WebStorageSharedClientState` is started.\n */\n this.mi = [];\n // Escape the special characters mentioned here:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\n var o = n.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n this.storage = this.window.localStorage, this.currentUser = i, this.Ai = Vr(this.persistenceKey, this._i), \n this.Ri = \n /** Assembles the key for the current sequence number. */\n function(t) {\n return \"firestore_sequence_number_\" + t;\n }(this.persistenceKey), this.Ti = this.Ti.ot(this._i, new jr), this.Pi = new RegExp(\"^firestore_clients_\" + o + \"_([^_]*)$\"), \n this.gi = new RegExp(\"^firestore_mutations_\" + o + \"_(\\\\d+)(?:_(.*))?$\"), this.Vi = new RegExp(\"^firestore_targets_\" + o + \"_(\\\\d+)$\"), \n this.yi = \n /** Assembles the key for the online state of the primary tab. */\n function(t) {\n return \"firestore_online_state_\" + t;\n }(this.persistenceKey), \n // Rather than adding the storage observer during start(), we add the\n // storage observer during initialization. This ensures that we collect\n // events before other components populate their initial state (during their\n // respective start() calls). Otherwise, we might for example miss a\n // mutation that is added after LocalStore's start() processed the existing\n // mutations but before we observe WebStorage events.\n this.window.addEventListener(\"storage\", this.wi);\n }\n /** Returns 'true' if WebStorage is available in the current environment. */ return t.Ln = function(t) {\n return !(!t || !t.localStorage);\n }, t.prototype.start = function() {\n return e(this, void 0, void 0, (function() {\n var t, e, r, i, o, u, s, a, c, h, f, l = this;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return [ 4 /*yield*/ , this.fi.pi() ];\n\n case 1:\n for (t = n.sent(), e = 0, r = t; e < r.length; e++) (i = r[e]) !== this._i && (o = this.getItem(Vr(this.persistenceKey, i))) && (u = qr.hi(i, o)) && (this.Ti = this.Ti.ot(u.clientId, u));\n for (this.bi(), (s = this.storage.getItem(this.yi)) && (a = this.vi(s)) && this.Si(a), \n c = 0, h = this.mi; c < h.length; c++) f = h[c], this.Ei(f);\n return this.mi = [], \n // Register a window unload hook to remove the client metadata entry from\n // WebStorage even if `shutdown()` was not called.\n this.window.addEventListener(\"unload\", (function() {\n return l.Di();\n })), this.Ii = !0, [ 2 /*return*/ ];\n }\n }));\n }));\n }, t.prototype.oi = function(t) {\n this.setItem(this.Ri, JSON.stringify(t));\n }, t.prototype.Ci = function() {\n return this.Ni(this.Ti);\n }, t.prototype.xi = function(t) {\n var e = !1;\n return this.Ti.forEach((function(n, r) {\n r.activeTargetIds.has(t) && (e = !0);\n })), e;\n }, t.prototype.Fi = function(t) {\n this.ki(t, \"pending\");\n }, t.prototype.Oi = function(t, e, n) {\n this.ki(t, e, n), \n // Once a final mutation result is observed by other clients, they no longer\n // access the mutation's metadata entry. Since WebStorage replays events\n // in order, it is safe to delete the entry right after updating it.\n this.Mi(t);\n }, t.prototype.$i = function(t) {\n var e = \"not-current\";\n // Lookup an existing query state if the target ID was already registered\n // by another tab\n if (this.xi(t)) {\n var n = this.storage.getItem(Cr(this.persistenceKey, t));\n if (n) {\n var r = Mr.hi(t, n);\n r && (e = r.state);\n }\n }\n return this.Li.ui(t), this.bi(), e;\n }, t.prototype.Bi = function(t) {\n this.Li.li(t), this.bi();\n }, t.prototype.qi = function(t) {\n return this.Li.activeTargetIds.has(t);\n }, t.prototype.Ui = function(t) {\n this.removeItem(Cr(this.persistenceKey, t));\n }, t.prototype.Ki = function(t, e, n) {\n this.Qi(t, e, n);\n }, t.prototype.Wi = function(t, e, n) {\n var r = this;\n e.forEach((function(t) {\n r.Mi(t);\n })), this.currentUser = t, n.forEach((function(t) {\n r.Fi(t);\n }));\n }, t.prototype.ji = function(t) {\n this.Gi(t);\n }, t.prototype.Di = function() {\n this.Ii && (this.window.removeEventListener(\"storage\", this.wi), this.removeItem(this.Ai), \n this.Ii = !1);\n }, t.prototype.getItem = function(t) {\n var e = this.storage.getItem(t);\n return T(\"SharedClientState\", \"READ\", t, e), e;\n }, t.prototype.setItem = function(t, e) {\n T(\"SharedClientState\", \"SET\", t, e), this.storage.setItem(t, e);\n }, t.prototype.removeItem = function(t) {\n T(\"SharedClientState\", \"REMOVE\", t), this.storage.removeItem(t);\n }, t.prototype.Ei = function(t) {\n var r = this, i = t;\n // Note: The function is typed to take Event to be interface-compatible with\n // `Window.addEventListener`.\n if (i.storageArea === this.storage) {\n if (T(\"SharedClientState\", \"EVENT\", i.key, i.newValue), i.key === this.Ai) return void N(\"Received WebStorage notification for local change. Another client might have garbage-collected our state\");\n this.fn.Cs((function() {\n return e(r, void 0, void 0, (function() {\n var t, e, r, o, u, s;\n return n(this, (function(n) {\n if (this.Ii) {\n if (null !== i.key) if (this.Pi.test(i.key)) {\n if (null == i.newValue) return t = this.zi(i.key), [ 2 /*return*/ , this.Hi(t, null) ];\n if (e = this.Ji(i.key, i.newValue)) return [ 2 /*return*/ , this.Hi(e.clientId, e) ];\n } else if (this.gi.test(i.key)) {\n if (null !== i.newValue && (r = this.Yi(i.key, i.newValue))) return [ 2 /*return*/ , this.Xi(r) ];\n } else if (this.Vi.test(i.key)) {\n if (null !== i.newValue && (o = this.Zi(i.key, i.newValue))) return [ 2 /*return*/ , this.tr(o) ];\n } else if (i.key === this.yi) {\n if (null !== i.newValue && (u = this.vi(i.newValue))) return [ 2 /*return*/ , this.Si(u) ];\n } else i.key === this.Ri && (s = function(t) {\n var e = Lr.ai;\n if (null != t) try {\n var n = JSON.parse(t);\n x(\"number\" == typeof n), e = n;\n } catch (t) {\n N(\"SharedClientState\", \"Failed to read sequence number from WebStorage\", t);\n }\n return e;\n }(i.newValue)) !== Lr.ai && this.si(s);\n } else this.mi.push(i);\n return [ 2 /*return*/ ];\n }));\n }));\n }));\n }\n }, Object.defineProperty(t.prototype, \"Li\", {\n get: function() {\n return this.Ti.get(this._i);\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.bi = function() {\n this.setItem(this.Ai, this.Li.ci());\n }, t.prototype.ki = function(t, e, n) {\n var r = new Ur(this.currentUser, t, e, n), i = Rr(this.persistenceKey, this.currentUser, t);\n this.setItem(i, r.ci());\n }, t.prototype.Mi = function(t) {\n var e = Rr(this.persistenceKey, this.currentUser, t);\n this.removeItem(e);\n }, t.prototype.Gi = function(t) {\n var e = {\n clientId: this._i,\n onlineState: t\n };\n this.storage.setItem(this.yi, JSON.stringify(e));\n }, t.prototype.Qi = function(t, e, n) {\n var r = Cr(this.persistenceKey, t), i = new Mr(t, e, n);\n this.setItem(r, i.ci());\n }, \n /**\n * Parses a client state key in WebStorage. Returns null if the key does not\n * match the expected key format.\n */\n t.prototype.zi = function(t) {\n var e = this.Pi.exec(t);\n return e ? e[1] : null;\n }, \n /**\n * Parses a client state in WebStorage. Returns 'null' if the value could not\n * be parsed.\n */\n t.prototype.Ji = function(t, e) {\n var n = this.zi(t);\n return qr.hi(n, e);\n }, \n /**\n * Parses a mutation batch state in WebStorage. Returns 'null' if the value\n * could not be parsed.\n */\n t.prototype.Yi = function(t, e) {\n var n = this.gi.exec(t), r = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;\n return Ur.hi(new Or(i), r, e);\n }, \n /**\n * Parses a query target state from WebStorage. Returns 'null' if the value\n * could not be parsed.\n */\n t.prototype.Zi = function(t, e) {\n var n = this.Vi.exec(t), r = Number(n[1]);\n return Mr.hi(r, e);\n }, \n /**\n * Parses an online state from WebStorage. Returns 'null' if the value\n * could not be parsed.\n */\n t.prototype.vi = function(t) {\n return Fr.hi(t);\n }, t.prototype.Xi = function(t) {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(e) {\n return t.user.uid === this.currentUser.uid ? [ 2 /*return*/ , this.fi.er(t.batchId, t.state, t.error) ] : (T(\"SharedClientState\", \"Ignoring mutation for non-active user \" + t.user.uid), \n [ 2 /*return*/ ]);\n }));\n }));\n }, t.prototype.tr = function(t) {\n return this.fi.nr(t.targetId, t.state, t.error);\n }, t.prototype.Hi = function(t, e) {\n var n = this, r = e ? this.Ti.ot(t, e) : this.Ti.remove(t), i = this.Ni(this.Ti), o = this.Ni(r), u = [], s = [];\n return o.forEach((function(t) {\n i.has(t) || u.push(t);\n })), i.forEach((function(t) {\n o.has(t) || s.push(t);\n })), this.fi.sr(u, s).then((function() {\n n.Ti = r;\n }));\n }, t.prototype.Si = function(t) {\n // We check whether the client that wrote this online state is still active\n // by comparing its client ID to the list of clients kept active in\n // IndexedDb. If a client does not update their IndexedDb client state\n // within 5 seconds, it is considered inactive and we don't emit an online\n // state event.\n this.Ti.get(t.clientId) && this.di(t.onlineState);\n }, t.prototype.Ni = function(t) {\n var e = St();\n return t.forEach((function(t, n) {\n e = e.Ot(n.activeTargetIds);\n })), e;\n }, t;\n}(), Br = /** @class */ function() {\n function t() {\n this.ir = new jr, this.rr = {}, this.di = null, this.si = null;\n }\n return t.prototype.Fi = function(t) {\n // No op.\n }, t.prototype.Oi = function(t, e, n) {\n // No op.\n }, t.prototype.$i = function(t) {\n return this.ir.ui(t), this.rr[t] || \"not-current\";\n }, t.prototype.Ki = function(t, e, n) {\n this.rr[t] = e;\n }, t.prototype.Bi = function(t) {\n this.ir.li(t);\n }, t.prototype.qi = function(t) {\n return this.ir.activeTargetIds.has(t);\n }, t.prototype.Ui = function(t) {\n delete this.rr[t];\n }, t.prototype.Ci = function() {\n return this.ir.activeTargetIds;\n }, t.prototype.xi = function(t) {\n return this.ir.activeTargetIds.has(t);\n }, t.prototype.start = function() {\n return this.ir = new jr, Promise.resolve();\n }, t.prototype.Wi = function(t, e, n) {\n // No op.\n }, t.prototype.ji = function(t) {\n // No op.\n }, t.prototype.Di = function() {}, t.prototype.oi = function(t) {}, t;\n}(), zr = /** @class */ function() {\n /**\n * @param batchId The unique ID of this mutation batch.\n * @param localWriteTime The original write time of this mutation.\n * @param baseMutations Mutations that are used to populate the base\n * values when this mutation is applied locally. This can be used to locally\n * overwrite values that are persisted in the remote document cache. Base\n * mutations are never sent to the backend.\n * @param mutations The user-provided mutations in this mutation batch.\n * User-provided mutations are applied both locally and remotely on the\n * backend.\n */\n function t(t, e, n, r) {\n this.batchId = t, this.ar = e, this.baseMutations = n, this.mutations = r\n /**\n * Applies all the mutations in this MutationBatch to the specified document\n * to create a new remote document\n *\n * @param docKey The key of the document to apply mutations to.\n * @param maybeDoc The document to apply mutations to.\n * @param batchResult The result of applying the MutationBatch to the\n * backend.\n */;\n }\n return t.prototype.hr = function(t, e, n) {\n for (var r = n.cr, i = 0; i < this.mutations.length; i++) {\n var o = this.mutations[i];\n o.key.isEqual(t) && (e = sn(o, e, r[i]));\n }\n return e;\n }, \n /**\n * Computes the local view of a document given all the mutations in this\n * batch.\n *\n * @param docKey The key of the document to apply mutations to.\n * @param maybeDoc The document to apply mutations to.\n */\n t.prototype.ur = function(t, e) {\n // First, apply the base state. This allows us to apply non-idempotent\n // transform against a consistent set of values.\n for (var n = 0, r = this.baseMutations; n < r.length; n++) {\n var i = r[n];\n i.key.isEqual(t) && (e = an(i, e, e, this.ar));\n }\n // Second, apply all user-provided mutations.\n for (var o = e, u = 0, s = this.mutations; u < s.length; u++) {\n var a = s[u];\n a.key.isEqual(t) && (e = an(a, e, o, this.ar));\n }\n return e;\n }, \n /**\n * Computes the local view for all provided documents given the mutations in\n * this batch.\n */\n t.prototype.lr = function(t) {\n var e = this, n = t;\n // TODO(mrschmidt): This implementation is O(n^2). If we apply the mutations\n // directly (as done in `applyToLocalView()`), we can reduce the complexity\n // to O(n).\n return this.mutations.forEach((function(r) {\n var i = e.ur(r.key, t.get(r.key));\n i && (n = n.ot(r.key, i));\n })), n;\n }, t.prototype.keys = function() {\n return this.mutations.reduce((function(t, e) {\n return t.add(e.key);\n }), At());\n }, t.prototype.isEqual = function(t) {\n return this.batchId === t.batchId && V(this.mutations, t.mutations, (function(t, e) {\n return hn(t, e);\n })) && V(this.baseMutations, t.baseMutations, (function(t, e) {\n return hn(t, e);\n }));\n }, t;\n}(), Kr = /** @class */ function() {\n function t(t, e, n, \n /**\n * A pre-computed mapping from each mutated document to the resulting\n * version.\n */\n r) {\n this.batch = t, this._r = e, this.cr = n, this.dr = r\n /**\n * Creates a new MutationBatchResult for the given batch and results. There\n * must be one result for each mutation in the batch. This static factory\n * caches a document=>version mapping (docVersions).\n */;\n }\n return t.from = function(e, n, r) {\n x(e.mutations.length === r.length);\n for (var i = Tt, o = e.mutations, u = 0; u < o.length; u++) i = i.ot(o[u].key, r[u].version);\n return new t(e, n, r, i);\n }, t;\n}(), Wr = /** @class */ function() {\n function t() {\n // A mapping of document key to the new cache entry that should be written (or null if any\n // existing cache entry should be removed).\n this.wr = new W((function(t) {\n return t.toString();\n }), (function(t, e) {\n return t.isEqual(e);\n })), this.Er = !1;\n }\n return Object.defineProperty(t.prototype, \"readTime\", {\n get: function() {\n return this.Tr;\n },\n set: function(t) {\n this.Tr = t;\n },\n enumerable: !1,\n configurable: !0\n }), \n /**\n * Buffers a `RemoteDocumentCache.addEntry()` call.\n *\n * You can only modify documents that have already been retrieved via\n * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\n */\n t.prototype.Ir = function(t, e) {\n this.mr(), this.readTime = e, this.wr.set(t.key, t);\n }, \n /**\n * Buffers a `RemoteDocumentCache.removeEntry()` call.\n *\n * You can only remove documents that have already been retrieved via\n * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\n */\n t.prototype.Ar = function(t, e) {\n this.mr(), e && (this.readTime = e), this.wr.set(t, null);\n }, \n /**\n * Looks up an entry in the cache. The buffered changes will first be checked,\n * and if no buffered change applies, this will forward to\n * `RemoteDocumentCache.getEntry()`.\n *\n * @param transaction The transaction in which to perform any persistence\n * operations.\n * @param documentKey The key of the entry to look up.\n * @return The cached Document or NoDocument entry, or null if we have nothing\n * cached.\n */\n t.prototype.Rr = function(t, e) {\n this.mr();\n var n = this.wr.get(e);\n return void 0 !== n ? cr.resolve(n) : this.Pr(t, e);\n }, \n /**\n * Looks up several entries in the cache, forwarding to\n * `RemoteDocumentCache.getEntry()`.\n *\n * @param transaction The transaction in which to perform any persistence\n * operations.\n * @param documentKeys The keys of the entries to look up.\n * @return A map of cached `Document`s or `NoDocument`s, indexed by key. If an\n * entry cannot be found, the corresponding key will be mapped to a null\n * value.\n */\n t.prototype.getEntries = function(t, e) {\n return this.gr(t, e);\n }, \n /**\n * Applies buffered changes to the underlying RemoteDocumentCache, using\n * the provided transaction.\n */\n t.prototype.apply = function(t) {\n return this.mr(), this.Er = !0, this.Vr(t);\n }, \n /** Helper to assert this.changes is not null */ t.prototype.mr = function() {}, \n t;\n}(), Qr = \"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.\", Hr = /** @class */ function() {\n function t() {\n this.yr = [];\n }\n return t.prototype.pr = function(t) {\n this.yr.push(t);\n }, t.prototype.br = function() {\n this.yr.forEach((function(t) {\n return t();\n }));\n }, t;\n}(), Yr = /** @class */ function() {\n function t(t, e, n) {\n this.vr = t, this.Sr = e, this.Dr = n\n /**\n * Get the local view of the document identified by `key`.\n *\n * @return Local view of the document or null if we don't have any cached\n * state for it.\n */;\n }\n return t.prototype.Cr = function(t, e) {\n var n = this;\n return this.Sr.Nr(t, e).next((function(r) {\n return n.Fr(t, e, r);\n }));\n }, \n /** Internal version of `getDocument` that allows reusing batches. */ t.prototype.Fr = function(t, e, n) {\n return this.vr.Rr(t, e).next((function(t) {\n for (var r = 0, i = n; r < i.length; r++) {\n t = i[r].ur(e, t);\n }\n return t;\n }));\n }, \n // Returns the view of the given `docs` as they would appear after applying\n // all mutations in the given `batches`.\n t.prototype.kr = function(t, e, n) {\n var r = It();\n return e.forEach((function(t, e) {\n for (var i = 0, o = n; i < o.length; i++) {\n e = o[i].ur(t, e);\n }\n r = r.ot(t, e);\n })), r;\n }, \n /**\n * Gets the local view of the documents identified by `keys`.\n *\n * If we don't have cached state for a document in `keys`, a NoDocument will\n * be stored for that key in the resulting set.\n */\n t.prototype.Or = function(t, e) {\n var n = this;\n return this.vr.getEntries(t, e).next((function(e) {\n return n.Mr(t, e);\n }));\n }, \n /**\n * Similar to `getDocuments`, but creates the local view from the given\n * `baseDocs` without retrieving documents from the local store.\n */\n t.prototype.Mr = function(t, e) {\n var n = this;\n return this.Sr.$r(t, e).next((function(r) {\n var i = n.kr(t, e, r), o = bt();\n return i.forEach((function(t, e) {\n // TODO(http://b/32275378): Don't conflate missing / deleted.\n e || (e = new Nn(t, H.min())), o = o.ot(t, e);\n })), o;\n }));\n }, \n /**\n * Performs a query against the local view of all documents.\n *\n * @param transaction The persistence transaction.\n * @param query The query to match documents against.\n * @param sinceReadTime If not set to SnapshotVersion.min(), return only\n * documents that have been read since this snapshot version (exclusive).\n */\n t.prototype.Lr = function(t, e, n) {\n /**\n * Returns whether the query matches a single document by path (rather than a\n * collection).\n */\n return function(t) {\n return Z.X(t.path) && null === t.collectionGroup && 0 === t.filters.length;\n }(e) ? this.Br(t, e.path) : Vn(e) ? this.qr(t, e, n) : this.Ur(t, e, n);\n }, t.prototype.Br = function(t, e) {\n // Just do a simple document lookup.\n return this.Cr(t, new Z(e)).next((function(t) {\n var e = _t();\n return t instanceof Tn && (e = e.ot(t.key, t)), e;\n }));\n }, t.prototype.qr = function(t, e, n) {\n var r = this, i = e.collectionGroup, o = _t();\n return this.Dr.Kr(t, i).next((function(u) {\n return cr.forEach(u, (function(u) {\n var s = function(t, e) {\n return new Dn(e, \n /*collectionGroup=*/ null, t.on.slice(), t.filters.slice(), t.limit, t.an, t.startAt, t.endAt);\n }(e, u.child(i));\n return r.Ur(t, s, n).next((function(t) {\n t.forEach((function(t, e) {\n o = o.ot(t, e);\n }));\n }));\n })).next((function() {\n return o;\n }));\n }));\n }, t.prototype.Ur = function(t, e, n) {\n var r, i, o = this;\n // Query the remote documents and overlay mutations.\n return this.vr.Lr(t, e, n).next((function(n) {\n return r = n, o.Sr.Qr(t, e);\n })).next((function(e) {\n return i = e, o.Wr(t, i, r).next((function(t) {\n r = t;\n for (var e = 0, n = i; e < n.length; e++) for (var o = n[e], u = 0, s = o.mutations; u < s.length; u++) {\n var a = s[u], c = a.key, h = r.get(c), f = an(a, h, h, o.ar);\n r = f instanceof Tn ? r.ot(c, f) : r.remove(c);\n }\n }));\n })).next((function() {\n // Finally, filter out any documents that don't actually match\n // the query.\n return r.forEach((function(t, n) {\n Bn(e, n) || (r = r.remove(t));\n })), r;\n }));\n }, t.prototype.Wr = function(t, e, n) {\n for (var r = At(), i = 0, o = e; i < o.length; i++) for (var u = 0, s = o[i].mutations; u < s.length; u++) {\n var a = s[u];\n a instanceof pn && null === n.get(a.key) && (r = r.add(a.key));\n }\n var c = n;\n return this.vr.getEntries(t, r).next((function(t) {\n return t.forEach((function(t, e) {\n null !== e && e instanceof Tn && (c = c.ot(t, e));\n })), c;\n }));\n }, t;\n}(), Xr = /** @class */ function() {\n function t(t, e, n, r) {\n this.targetId = t, this.fromCache = e, this.jr = n, this.Gr = r;\n }\n return t.zr = function(e, n) {\n for (var r = At(), i = At(), o = 0, u = n.docChanges; o < u.length; o++) {\n var s = u[o];\n switch (s.type) {\n case 0 /* Added */ :\n r = r.add(s.doc.key);\n break;\n\n case 1 /* Removed */ :\n i = i.add(s.doc.key);\n // do nothing\n }\n }\n return new t(e, n.fromCache, r, i);\n }, t;\n}();\n\n/**\n * Holds the state of a query target, including its target ID and whether the\n * target is 'not-current', 'current' or 'rejected'.\n */\n// Visible for testing\n/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction Jr(t, e) {\n var n = t[0], r = t[1], i = e[0], o = e[1], u = L(n, i);\n return 0 === u ? L(r, o) : u;\n}\n\n/**\n * Used to calculate the nth sequence number. Keeps a rolling buffer of the\n * lowest n values passed to `addElement`, and finally reports the largest of\n * them in `maxValue`.\n */ var $r = /** @class */ function() {\n function t(t) {\n this.Hr = t, this.buffer = new mt(Jr), this.Jr = 0;\n }\n return t.prototype.Yr = function() {\n return ++this.Jr;\n }, t.prototype.Xr = function(t) {\n var e = [ t, this.Yr() ];\n if (this.buffer.size < this.Hr) this.buffer = this.buffer.add(e); else {\n var n = this.buffer.last();\n Jr(e, n) < 0 && (this.buffer = this.buffer.delete(n).add(e));\n }\n }, Object.defineProperty(t.prototype, \"maxValue\", {\n get: function() {\n // Guaranteed to be non-empty. If we decide we are not collecting any\n // sequence numbers, nthSequenceNumber below short-circuits. If we have\n // decided that we are collecting n sequence numbers, it's because n is some\n // percentage of the existing sequence numbers. That means we should never\n // be in a situation where we are collecting sequence numbers but don't\n // actually have any.\n return this.buffer.last()[0];\n },\n enumerable: !1,\n configurable: !0\n }), t;\n}(), Zr = {\n Zr: !1,\n eo: 0,\n no: 0,\n so: 0\n}, ti = /** @class */ function() {\n function t(\n // When we attempt to collect, we will only do so if the cache size is greater than this\n // threshold. Passing `COLLECTION_DISABLED` here will cause collection to always be skipped.\n t, \n // The percentage of sequence numbers that we will attempt to collect\n e, \n // A cap on the total number of sequence numbers that will be collected. This prevents\n // us from collecting a huge number of sequence numbers if the cache has grown very large.\n n) {\n this.io = t, this.ro = e, this.oo = n;\n }\n return t.ao = function(e) {\n return new t(e, t.ho, t.co);\n }, t;\n}();\n\nti.uo = -1, ti.lo = 1048576, ti._o = 41943040, ti.ho = 10, ti.co = 1e3, ti.fo = new ti(ti._o, ti.ho, ti.co), \nti.do = new ti(ti.uo, 0, 0);\n\n/**\n * This class is responsible for the scheduling of LRU garbage collection. It handles checking\n * whether or not GC is enabled, as well as which delay to use before the next run.\n */\nvar ei = /** @class */ function() {\n function t(t, e) {\n this.wo = t, this.hs = e, this.Eo = !1, this.To = null;\n }\n return t.prototype.start = function(t) {\n this.wo.params.io !== ti.uo && this.Io(t);\n }, t.prototype.stop = function() {\n this.To && (this.To.cancel(), this.To = null);\n }, Object.defineProperty(t.prototype, \"Ii\", {\n get: function() {\n return null !== this.To;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.Io = function(t) {\n var r = this, i = this.Eo ? 3e5 : 6e4;\n T(\"LruGarbageCollector\", \"Garbage collection scheduled in \" + i + \"ms\"), this.To = this.hs.Vn(\"lru_garbage_collection\" /* LruGarbageCollection */ , i, (function() {\n return e(r, void 0, void 0, (function() {\n var e;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n this.To = null, this.Eo = !0, n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 3, , 7 ]), [ 4 /*yield*/ , t.mo(this.wo) ];\n\n case 2:\n return n.sent(), [ 3 /*break*/ , 7 ];\n\n case 3:\n return pr(e = n.sent()) ? (T(\"LruGarbageCollector\", \"Ignoring IndexedDB error during garbage collection: \", e), \n [ 3 /*break*/ , 6 ]) : [ 3 /*break*/ , 4 ];\n\n case 4:\n return [ 4 /*yield*/ , Io(e) ];\n\n case 5:\n n.sent(), n.label = 6;\n\n case 6:\n return [ 3 /*break*/ , 7 ];\n\n case 7:\n return [ 4 /*yield*/ , this.Io(t) ];\n\n case 8:\n return n.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }));\n }, t;\n}(), ni = /** @class */ function() {\n function t(t, e) {\n this.Ao = t, this.params = e\n /** Given a percentile of target to collect, returns the number of targets to collect. */;\n }\n return t.prototype.Ro = function(t, e) {\n return this.Ao.Po(t).next((function(t) {\n return Math.floor(e / 100 * t);\n }));\n }, \n /** Returns the nth sequence number, counting in order from the smallest. */ t.prototype.Vo = function(t, e) {\n var n = this;\n if (0 === e) return cr.resolve(Lr.ai);\n var r = new $r(e);\n return this.Ao.Ce(t, (function(t) {\n return r.Xr(t.sequenceNumber);\n })).next((function() {\n return n.Ao.yo(t, (function(t) {\n return r.Xr(t);\n }));\n })).next((function() {\n return r.maxValue;\n }));\n }, \n /**\n * Removes targets with a sequence number equal to or less than the given upper bound, and removes\n * document associations with those targets.\n */\n t.prototype.po = function(t, e, n) {\n return this.Ao.po(t, e, n);\n }, \n /**\n * Removes documents that have a sequence number equal to or less than the upper bound and are not\n * otherwise pinned.\n */\n t.prototype.bo = function(t, e) {\n return this.Ao.bo(t, e);\n }, t.prototype.vo = function(t, e) {\n var n = this;\n return this.params.io === ti.uo ? (T(\"LruGarbageCollector\", \"Garbage collection skipped; disabled\"), \n cr.resolve(Zr)) : this.So(t).next((function(r) {\n return r < n.params.io ? (T(\"LruGarbageCollector\", \"Garbage collection skipped; Cache size \" + r + \" is lower than threshold \" + n.params.io), \n Zr) : n.Do(t, e);\n }));\n }, t.prototype.So = function(t) {\n return this.Ao.So(t);\n }, t.prototype.Do = function(t, e) {\n var n, r, i, o, s, a, c, h = this, f = Date.now();\n return this.Ro(t, this.params.ro).next((function(e) {\n // Cap at the configured max\n return e > h.params.oo ? (T(\"LruGarbageCollector\", \"Capping sequence numbers to collect down to the maximum of \" + h.params.oo + \" from \" + e), \n r = h.params.oo) : r = e, o = Date.now(), h.Vo(t, r);\n })).next((function(r) {\n return n = r, s = Date.now(), h.po(t, n, e);\n })).next((function(e) {\n return i = e, a = Date.now(), h.bo(t, n);\n })).next((function(t) {\n return c = Date.now(), _() <= u.DEBUG && T(\"LruGarbageCollector\", \"LRU Garbage Collection\\n\\tCounted targets in \" + (o - f) + \"ms\\n\\tDetermined least recently used \" + r + \" in \" + (s - o) + \"ms\\n\\tRemoved \" + i + \" targets in \" + (a - s) + \"ms\\n\\tRemoved \" + t + \" documents in \" + (c - a) + \"ms\\nTotal Duration: \" + (c - f) + \"ms\"), \n cr.resolve({\n Zr: !0,\n eo: r,\n no: i,\n so: t\n });\n }));\n }, t;\n}();\n\n/** Implements the steps for LRU garbage collection. */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Encodes a resource path into a IndexedDb-compatible string form.\n */\nfunction ri(t) {\n for (var e = \"\", n = 0; n < t.length; n++) e.length > 0 && (e = oi(e)), e = ii(t.get(n), e);\n return oi(e);\n}\n\n/** Encodes a single segment of a resource path into the given result */ function ii(t, e) {\n for (var n = e, r = t.length, i = 0; i < r; i++) {\n var o = t.charAt(i);\n switch (o) {\n case \"\\0\":\n n += \"\u0001\u0010\";\n break;\n\n case \"\u0001\":\n n += \"\u0001\u0011\";\n break;\n\n default:\n n += o;\n }\n }\n return n;\n}\n\n/** Encodes a path separator into the given result */ function oi(t) {\n return t + \"\u0001\u0001\";\n}\n\n/**\n * Decodes the given IndexedDb-compatible string form of a resource path into\n * a ResourcePath instance. Note that this method is not suitable for use with\n * decoding resource names from the server; those are One Platform format\n * strings.\n */ function ui(t) {\n // Event the empty path must encode as a path of at least length 2. A path\n // with exactly 2 must be the empty path.\n var e = t.length;\n if (x(e >= 2), 2 === e) return x(\"\u0001\" === t.charAt(0) && \"\u0001\" === t.charAt(1)), X.U();\n // Escape characters cannot exist past the second-to-last position in the\n // source value.\n for (var n = e - 2, r = [], i = \"\", o = 0; o < e; ) {\n // The last two characters of a valid encoded path must be a separator, so\n // there must be an end to this segment.\n var u = t.indexOf(\"\u0001\", o);\n switch ((u < 0 || u > n) && S(), t.charAt(u + 1)) {\n case \"\u0001\":\n var s = t.substring(o, u), a = void 0;\n 0 === i.length ? \n // Avoid copying for the common case of a segment that excludes \\0\n // and \\001\n a = s : (a = i += s, i = \"\"), r.push(a);\n break;\n\n case \"\u0010\":\n i += t.substring(o, u), i += \"\\0\";\n break;\n\n case \"\u0011\":\n // The escape character can be used in the output to encode itself.\n i += t.substring(o, u + 1);\n break;\n\n default:\n S();\n }\n o = u + 2;\n }\n return new X(r);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Serializer for values stored in the LocalStore. */ var si = function(t) {\n this.Co = t;\n};\n\n/** Decodes a remote document from storage locally to a Document. */ function ai(t, e) {\n if (e.document) return function(t, e, n) {\n var r = be(t, e.name), i = ye(e.updateTime), o = new bn({\n mapValue: {\n fields: e.fields\n }\n });\n return new Tn(r, i, o, {\n hasCommittedMutations: !!n\n });\n }(t.Co, e.document, !!e.hasCommittedMutations);\n if (e.noDocument) {\n var n = Z.Z(e.noDocument.path), r = pi(e.noDocument.readTime);\n return new Nn(n, r, {\n hasCommittedMutations: !!e.hasCommittedMutations\n });\n }\n if (e.unknownDocument) {\n var i = Z.Z(e.unknownDocument.path), o = pi(e.unknownDocument.version);\n return new An(i, o);\n }\n return S();\n}\n\n/** Encodes a document for storage locally. */ function ci(t, e, n) {\n var r = hi(n), i = e.key.path.F().L();\n if (e instanceof Tn) {\n var o = function(t, e) {\n return {\n name: we(t, e.key),\n fields: e.rn().mapValue.fields,\n updateTime: pe(t, e.version.v())\n };\n }(t.Co, e), u = e.hasCommittedMutations;\n return new qi(\n /* unknownDocument= */ null, \n /* noDocument= */ null, o, u, r, i);\n }\n if (e instanceof Nn) {\n var s = e.key.path.L(), a = li(e.version), c = e.hasCommittedMutations;\n return new qi(\n /* unknownDocument= */ null, new Ui(s, a), \n /* document= */ null, c, r, i);\n }\n if (e instanceof An) {\n var h = e.key.path.L(), f = li(e.version);\n return new qi(new Mi(h, f), \n /* noDocument= */ null, \n /* document= */ null, \n /* hasCommittedMutations= */ !0, r, i);\n }\n return S();\n}\n\nfunction hi(t) {\n var e = t.v();\n return [ e.seconds, e.nanoseconds ];\n}\n\nfunction fi(t) {\n var e = new Q(t[0], t[1]);\n return H.V(e);\n}\n\nfunction li(t) {\n var e = t.v();\n return new Oi(e.seconds, e.nanoseconds);\n}\n\nfunction pi(t) {\n var e = new Q(t.seconds, t.nanoseconds);\n return H.V(e);\n}\n\n/** Encodes a batch of mutations into a DbMutationBatch for local storage. */\n/** Decodes a DbMutationBatch into a MutationBatch */ function di(t, e) {\n var n = (e.baseMutations || []).map((function(e) {\n return De(t.Co, e);\n })), r = e.mutations.map((function(e) {\n return De(t.Co, e);\n })), i = Q.fromMillis(e.localWriteTimeMs);\n return new zr(e.batchId, i, n, r);\n}\n\n/** Decodes a DbTarget into TargetData */ function vi(t) {\n var e, n, r = pi(t.readTime), i = void 0 !== t.lastLimboFreeSnapshotVersion ? pi(t.lastLimboFreeSnapshotVersion) : H.min();\n return void 0 !== t.query.documents ? (x(1 === (n = t.query).documents.length), \n e = Cn(xn(Ee(n.documents[0])))) : e = ke(t.query), new ht(e, t.targetId, 0 /* Listen */ , t.lastListenSequenceNumber, r, i, C.fromBase64String(t.resumeToken))\n /** Encodes TargetData into a DbTarget for storage locally. */;\n}\n\nfunction yi(t, e) {\n var n, r = li(e.nt), i = li(e.lastLimboFreeSnapshotVersion);\n n = st(e.target) ? Se(t.Co, e.target) : xe(t.Co, e.target);\n // We can't store the resumeToken as a ByteString in IndexedDb, so we\n // convert it to a base64 string for storage.\n var o = e.resumeToken.toBase64();\n // lastListenSequenceNumber is always 0 until we do real GC.\n return new ji(e.targetId, ot(e.target), r, o, e.sequenceNumber, i, n);\n}\n\n/**\n * A helper function for figuring out what kind of query has been stored.\n */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** A mutation queue for a specific user, backed by IndexedDB. */ var mi = /** @class */ function() {\n function t(\n /**\n * The normalized userId (e.g. null UID => \"\" userId) used to store /\n * retrieve mutations.\n */\n t, e, n, r) {\n this.userId = t, this.serializer = e, this.Dr = n, this.No = r, \n /**\n * Caches the document keys for pending mutation batches. If the mutation\n * has been removed from IndexedDb, the cached value may continue to\n * be used to retrieve the batch's document keys. To remove a cached value\n * locally, `removeCachedMutationKeys()` should be invoked either directly\n * or through `removeMutationBatches()`.\n *\n * With multi-tab, when the primary client acknowledges or rejects a mutation,\n * this cache is used by secondary clients to invalidate the local\n * view of the documents that were previously affected by the mutation.\n */\n // PORTING NOTE: Multi-tab only.\n this.xo = {}\n /**\n * Creates a new mutation queue for the given user.\n * @param user The user for which to create a mutation queue.\n * @param serializer The serializer to use when persisting to IndexedDb.\n */;\n }\n return t.Fo = function(e, n, r, i) {\n // TODO(mcg): Figure out what constraints there are on userIDs\n // In particular, are there any reserved characters? are empty ids allowed?\n // For the moment store these together in the same mutations table assuming\n // that empty userIDs aren't allowed.\n return x(\"\" !== e.uid), new t(e.Zs() ? e.uid : \"\", n, r, i);\n }, t.prototype.ko = function(t) {\n var e = !0, n = IDBKeyRange.bound([ this.userId, Number.NEGATIVE_INFINITY ], [ this.userId, Number.POSITIVE_INFINITY ]);\n return bi(t).rs({\n index: Ri.userMutationsIndex,\n range: n\n }, (function(t, n, r) {\n e = !1, r.done();\n })).next((function() {\n return e;\n }));\n }, t.prototype.Oo = function(t, e, n, r) {\n var i = this, o = Ii(t), u = bi(t);\n // The IndexedDb implementation in Chrome (and Firefox) does not handle\n // compound indices that include auto-generated keys correctly. To ensure\n // that the index entry is added correctly in all browsers, we perform two\n // writes: The first write is used to retrieve the next auto-generated Batch\n // ID, and the second write populates the index and stores the actual\n // mutation batch.\n // See: https://bugs.chromium.org/p/chromium/issues/detail?id=701972\n // We write an empty object to obtain key\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return u.add({}).next((function(s) {\n x(\"number\" == typeof s);\n for (var a = new zr(s, e, n, r), c = function(t, e, n) {\n var r = n.baseMutations.map((function(e) {\n return Ae(t.Co, e);\n })), i = n.mutations.map((function(e) {\n return Ae(t.Co, e);\n }));\n return new Ri(e, n.batchId, n.ar.toMillis(), r, i);\n }(i.serializer, i.userId, a), h = [], f = new mt((function(t, e) {\n return L(t.B(), e.B());\n })), l = 0, p = r; l < p.length; l++) {\n var d = p[l], v = Ci.key(i.userId, d.key.path, s);\n f = f.add(d.key.path.F()), h.push(u.put(c)), h.push(o.put(v, Ci.PLACEHOLDER));\n }\n return f.forEach((function(e) {\n h.push(i.Dr.Mo(t, e));\n })), t.pr((function() {\n i.xo[s] = a.keys();\n })), cr.kn(h).next((function() {\n return a;\n }));\n }));\n }, t.prototype.$o = function(t, e) {\n var n = this;\n return bi(t).get(e).next((function(t) {\n return t ? (x(t.userId === n.userId), di(n.serializer, t)) : null;\n }));\n }, \n /**\n * Returns the document keys for the mutation batch with the given batchId.\n * For primary clients, this method returns `null` after\n * `removeMutationBatches()` has been called. Secondary clients return a\n * cached result until `removeCachedMutationKeys()` is invoked.\n */\n // PORTING NOTE: Multi-tab only.\n t.prototype.Lo = function(t, e) {\n var n = this;\n return this.xo[e] ? cr.resolve(this.xo[e]) : this.$o(t, e).next((function(t) {\n if (t) {\n var r = t.keys();\n return n.xo[e] = r, r;\n }\n return null;\n }));\n }, t.prototype.Bo = function(t, e) {\n var n = this, r = e + 1, i = IDBKeyRange.lowerBound([ this.userId, r ]), o = null;\n return bi(t).rs({\n index: Ri.userMutationsIndex,\n range: i\n }, (function(t, e, i) {\n e.userId === n.userId && (x(e.batchId >= r), o = di(n.serializer, e)), i.done();\n })).next((function() {\n return o;\n }));\n }, t.prototype.qo = function(t) {\n var e = IDBKeyRange.upperBound([ this.userId, Number.POSITIVE_INFINITY ]), n = -1;\n return bi(t).rs({\n index: Ri.userMutationsIndex,\n range: e,\n reverse: !0\n }, (function(t, e, r) {\n n = e.batchId, r.done();\n })).next((function() {\n return n;\n }));\n }, t.prototype.Uo = function(t) {\n var e = this, n = IDBKeyRange.bound([ this.userId, -1 ], [ this.userId, Number.POSITIVE_INFINITY ]);\n return bi(t).ts(Ri.userMutationsIndex, n).next((function(t) {\n return t.map((function(t) {\n return di(e.serializer, t);\n }));\n }));\n }, t.prototype.Nr = function(t, e) {\n var n = this, r = Ci.prefixForPath(this.userId, e.path), i = IDBKeyRange.lowerBound(r), o = [];\n // Scan the document-mutation index starting with a prefix starting with\n // the given documentKey.\n return Ii(t).rs({\n range: i\n }, (function(r, i, u) {\n var s = r[0], a = r[1], c = r[2], h = ui(a);\n // Only consider rows matching exactly the specific key of\n // interest. Note that because we order by path first, and we\n // order terminators before path separators, we'll encounter all\n // the index rows for documentKey contiguously. In particular, all\n // the rows for documentKey will occur before any rows for\n // documents nested in a subcollection beneath documentKey so we\n // can stop as soon as we hit any such row.\n if (s === n.userId && e.path.isEqual(h)) \n // Look up the mutation batch in the store.\n return bi(t).get(c).next((function(t) {\n if (!t) throw S();\n x(t.userId === n.userId), o.push(di(n.serializer, t));\n }));\n u.done();\n })).next((function() {\n return o;\n }));\n }, t.prototype.$r = function(t, e) {\n var n = this, r = new mt(L), i = [];\n return e.forEach((function(e) {\n var o = Ci.prefixForPath(n.userId, e.path), u = IDBKeyRange.lowerBound(o), s = Ii(t).rs({\n range: u\n }, (function(t, i, o) {\n var u = t[0], s = t[1], a = t[2], c = ui(s);\n // Only consider rows matching exactly the specific key of\n // interest. Note that because we order by path first, and we\n // order terminators before path separators, we'll encounter all\n // the index rows for documentKey contiguously. In particular, all\n // the rows for documentKey will occur before any rows for\n // documents nested in a subcollection beneath documentKey so we\n // can stop as soon as we hit any such row.\n u === n.userId && e.path.isEqual(c) ? r = r.add(a) : o.done();\n }));\n i.push(s);\n })), cr.kn(i).next((function() {\n return n.Ko(t, r);\n }));\n }, t.prototype.Qr = function(t, e) {\n var n = this, r = e.path, i = r.length + 1, o = Ci.prefixForPath(this.userId, r), u = IDBKeyRange.lowerBound(o), s = new mt(L);\n return Ii(t).rs({\n range: u\n }, (function(t, e, o) {\n var u = t[0], a = t[1], c = t[2], h = ui(a);\n u === n.userId && r.M(h) ? \n // Rows with document keys more than one segment longer than the\n // query path can't be matches. For example, a query on 'rooms'\n // can't match the document /rooms/abc/messages/xyx.\n // TODO(mcg): we'll need a different scanner when we implement\n // ancestor queries.\n h.length === i && (s = s.add(c)) : o.done();\n })).next((function() {\n return n.Ko(t, s);\n }));\n }, t.prototype.Ko = function(t, e) {\n var n = this, r = [], i = [];\n // TODO(rockwood): Implement this using iterate.\n return e.forEach((function(e) {\n i.push(bi(t).get(e).next((function(t) {\n if (null === t) throw S();\n x(t.userId === n.userId), r.push(di(n.serializer, t));\n })));\n })), cr.kn(i).next((function() {\n return r;\n }));\n }, t.prototype.Qo = function(t, e) {\n var n = this;\n return wi(t.Wo, this.userId, e).next((function(r) {\n return t.pr((function() {\n n.jo(e.batchId);\n })), cr.forEach(r, (function(e) {\n return n.No.Go(t, e);\n }));\n }));\n }, \n /**\n * Clears the cached keys for a mutation batch. This method should be\n * called by secondary clients after they process mutation updates.\n *\n * Note that this method does not have to be called from primary clients as\n * the corresponding cache entries are cleared when an acknowledged or\n * rejected batch is removed from the mutation queue.\n */\n // PORTING NOTE: Multi-tab only\n t.prototype.jo = function(t) {\n delete this.xo[t];\n }, t.prototype.zo = function(t) {\n var e = this;\n return this.ko(t).next((function(n) {\n if (!n) return cr.resolve();\n // Verify that there are no entries in the documentMutations index if\n // the queue is empty.\n var r = IDBKeyRange.lowerBound(Ci.prefixForUser(e.userId)), i = [];\n return Ii(t).rs({\n range: r\n }, (function(t, n, r) {\n if (t[0] === e.userId) {\n var o = ui(t[1]);\n i.push(o);\n } else r.done();\n })).next((function() {\n x(0 === i.length);\n }));\n }));\n }, t.prototype.Ho = function(t, e) {\n return gi(t, this.userId, e);\n }, \n // PORTING NOTE: Multi-tab only (state is held in memory in other clients).\n /** Returns the mutation queue's metadata from IndexedDb. */\n t.prototype.Jo = function(t) {\n var e = this;\n return Ei(t).get(this.userId).next((function(t) {\n return t || new Vi(e.userId, -1, \n /*lastStreamToken=*/ \"\");\n }));\n }, t;\n}();\n\n/**\n * @return true if the mutation queue for the given user contains a pending\n * mutation for the given key.\n */ function gi(t, e, n) {\n var r = Ci.prefixForPath(e, n.path), i = r[1], o = IDBKeyRange.lowerBound(r), u = !1;\n return Ii(t).rs({\n range: o,\n ss: !0\n }, (function(t, n, r) {\n var o = t[0], s = t[1];\n t[2];\n o === e && s === i && (u = !0), r.done();\n })).next((function() {\n return u;\n }));\n}\n\n/** Returns true if any mutation queue contains the given document. */\n/**\n * Delete a mutation batch and the associated document mutations.\n * @return A PersistencePromise of the document mutations that were removed.\n */ function wi(t, e, n) {\n var r = t.store(Ri.store), i = t.store(Ci.store), o = [], u = IDBKeyRange.only(n.batchId), s = 0, a = r.rs({\n range: u\n }, (function(t, e, n) {\n return s++, n.delete();\n }));\n o.push(a.next((function() {\n x(1 === s);\n })));\n for (var c = [], h = 0, f = n.mutations; h < f.length; h++) {\n var l = f[h], p = Ci.key(e, l.key.path, n.batchId);\n o.push(i.delete(p)), c.push(l.key);\n }\n return cr.kn(o).next((function() {\n return c;\n }));\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the mutations object store.\n */ function bi(t) {\n return ro.Kn(t, Ri.store);\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\n */ function Ii(t) {\n return ro.Kn(t, Ci.store);\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\n */ function Ei(t) {\n return ro.Kn(t, Vi.store);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * The RemoteDocumentCache for IndexedDb. To construct, invoke\n * `newIndexedDbRemoteDocumentCache()`.\n */ var _i = /** @class */ function() {\n /**\n * @param serializer The document serializer.\n * @param indexManager The query indexes that need to be maintained.\n */\n function t(t, e) {\n this.serializer = t, this.Dr = e\n /**\n * Adds the supplied entries to the cache.\n *\n * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\n * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\n */;\n }\n return t.prototype.Ir = function(t, e, n) {\n return Ai(t).put(Di(e), n);\n }, \n /**\n * Removes a document from the cache.\n *\n * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\n * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\n */\n t.prototype.Ar = function(t, e) {\n var n = Ai(t), r = Di(e);\n return n.delete(r);\n }, \n /**\n * Updates the current cache size.\n *\n * Callers to `addEntry()` and `removeEntry()` *must* call this afterwards to update the\n * cache's metadata.\n */\n t.prototype.updateMetadata = function(t, e) {\n var n = this;\n return this.getMetadata(t).next((function(r) {\n return r.byteSize += e, n.Yo(t, r);\n }));\n }, t.prototype.Rr = function(t, e) {\n var n = this;\n return Ai(t).get(Di(e)).next((function(t) {\n return n.Xo(t);\n }));\n }, \n /**\n * Looks up an entry in the cache.\n *\n * @param documentKey The key of the entry to look up.\n * @return The cached MaybeDocument entry and its size, or null if we have nothing cached.\n */\n t.prototype.Zo = function(t, e) {\n var n = this;\n return Ai(t).get(Di(e)).next((function(t) {\n var e = n.Xo(t);\n return e ? {\n ta: e,\n size: Si(t)\n } : null;\n }));\n }, t.prototype.getEntries = function(t, e) {\n var n = this, r = It();\n return this.ea(t, e, (function(t, e) {\n var i = n.Xo(e);\n r = r.ot(t, i);\n })).next((function() {\n return r;\n }));\n }, \n /**\n * Looks up several entries in the cache.\n *\n * @param documentKeys The set of keys entries to look up.\n * @return A map of MaybeDocuments indexed by key (if a document cannot be\n * found, the key will be mapped to null) and a map of sizes indexed by\n * key (zero if the key cannot be found).\n */\n t.prototype.na = function(t, e) {\n var n = this, r = It(), i = new dt(Z.D);\n return this.ea(t, e, (function(t, e) {\n var o = n.Xo(e);\n o ? (r = r.ot(t, o), i = i.ot(t, Si(e))) : (r = r.ot(t, null), i = i.ot(t, 0));\n })).next((function() {\n return {\n sa: r,\n ia: i\n };\n }));\n }, t.prototype.ea = function(t, e, n) {\n if (e.P()) return cr.resolve();\n var r = IDBKeyRange.bound(e.first().path.L(), e.last().path.L()), i = e._t(), o = i.It();\n return Ai(t).rs({\n range: r\n }, (function(t, e, r) {\n // Go through keys not found in cache.\n for (var u = Z.Z(t); o && Z.D(o, u) < 0; ) n(o, null), o = i.It();\n o && o.isEqual(u) && (\n // Key found in cache.\n n(o, e), o = i.At() ? i.It() : null), \n // Skip to the next key (if there is one).\n o ? r.Xn(o.path.L()) : r.done();\n })).next((function() {\n // The rest of the keys are not in the cache. One case where `iterate`\n // above won't go through them is when the cache is empty.\n for (;o; ) n(o, null), o = i.At() ? i.It() : null;\n }));\n }, t.prototype.Lr = function(t, e, n) {\n var r = this, i = _t(), o = e.path.length + 1, u = {};\n if (n.isEqual(H.min())) {\n // Documents are ordered by key, so we can use a prefix scan to narrow\n // down the documents we need to match the query against.\n var s = e.path.L();\n u.range = IDBKeyRange.lowerBound(s);\n } else {\n // Execute an index-free query and filter by read time. This is safe\n // since all document changes to queries that have a\n // lastLimboFreeSnapshotVersion (`sinceReadTime`) have a read time set.\n var a = e.path.L(), c = hi(n);\n u.range = IDBKeyRange.lowerBound([ a, c ], \n /* open= */ !0), u.index = qi.collectionReadTimeIndex;\n }\n return Ai(t).rs(u, (function(t, n, u) {\n // The query is actually returning any path that starts with the query\n // path prefix which may include documents in subcollections. For\n // example, a query on 'rooms' will return rooms/abc/messages/xyx but we\n // shouldn't match it. Fix this by discarding rows with document keys\n // more than one segment longer than the query path.\n if (t.length === o) {\n var s = ai(r.serializer, n);\n e.path.M(s.key.path) ? s instanceof Tn && Bn(e, s) && (i = i.ot(s.key, s)) : u.done();\n }\n })).next((function() {\n return i;\n }));\n }, t.prototype.ra = function(t) {\n return new Ti(this, !!t && t.oa);\n }, t.prototype.aa = function(t) {\n return this.getMetadata(t).next((function(t) {\n return t.byteSize;\n }));\n }, t.prototype.getMetadata = function(t) {\n return Ni(t).get(Fi.key).next((function(t) {\n return x(!!t), t;\n }));\n }, t.prototype.Yo = function(t, e) {\n return Ni(t).put(Fi.key, e);\n }, \n /**\n * Decodes `remoteDoc` and returns the document (or null, if the document\n * corresponds to the format used for sentinel deletes).\n */\n t.prototype.Xo = function(t) {\n if (t) {\n var e = ai(this.serializer, t);\n return e instanceof Nn && e.version.isEqual(H.min()) ? null : e;\n }\n return null;\n }, t;\n}(), Ti = /** @class */ function(e) {\n /**\n * @param documentCache The IndexedDbRemoteDocumentCache to apply the changes to.\n * @param trackRemovals Whether to create sentinel deletes that can be tracked by\n * `getNewDocumentChanges()`.\n */\n function n(t, n) {\n var r = this;\n return (r = e.call(this) || this).ha = t, r.oa = n, \n // A map of document sizes prior to applying the changes in this buffer.\n r.ca = new W((function(t) {\n return t.toString();\n }), (function(t, e) {\n return t.isEqual(e);\n })), r;\n }\n return t(n, e), n.prototype.Vr = function(t) {\n var e = this, n = [], r = 0, i = new mt((function(t, e) {\n return L(t.B(), e.B());\n }));\n return this.wr.forEach((function(o, u) {\n var s = e.ca.get(o);\n if (u) {\n var a = ci(e.ha.serializer, u, e.readTime);\n i = i.add(o.path.F());\n var c = Si(a);\n r += c - s, n.push(e.ha.Ir(t, o, a));\n } else if (r -= s, e.oa) {\n // In order to track removals, we store a \"sentinel delete\" in the\n // RemoteDocumentCache. This entry is represented by a NoDocument\n // with a version of 0 and ignored by `maybeDecodeDocument()` but\n // preserved in `getNewDocumentChanges()`.\n var h = ci(e.ha.serializer, new Nn(o, H.min()), e.readTime);\n n.push(e.ha.Ir(t, o, h));\n } else n.push(e.ha.Ar(t, o));\n })), i.forEach((function(r) {\n n.push(e.ha.Dr.Mo(t, r));\n })), n.push(this.ha.updateMetadata(t, r)), cr.kn(n);\n }, n.prototype.Pr = function(t, e) {\n var n = this;\n // Record the size of everything we load from the cache so we can compute a delta later.\n return this.ha.Zo(t, e).next((function(t) {\n return null === t ? (n.ca.set(e, 0), null) : (n.ca.set(e, t.size), t.ta);\n }));\n }, n.prototype.gr = function(t, e) {\n var n = this;\n // Record the size of everything we load from the cache so we can compute\n // a delta later.\n return this.ha.na(t, e).next((function(t) {\n var e = t.sa;\n // Note: `getAllFromCache` returns two maps instead of a single map from\n // keys to `DocumentSizeEntry`s. This is to allow returning the\n // `NullableMaybeDocumentMap` directly, without a conversion.\n return t.ia.forEach((function(t, e) {\n n.ca.set(t, e);\n })), e;\n }));\n }, n;\n}(Wr);\n\n/**\n * Creates a new IndexedDbRemoteDocumentCache.\n *\n * @param serializer The document serializer.\n * @param indexManager The query indexes that need to be maintained.\n */\n/**\n * Handles the details of adding and updating documents in the IndexedDbRemoteDocumentCache.\n *\n * Unlike the MemoryRemoteDocumentChangeBuffer, the IndexedDb implementation computes the size\n * delta for all submitted changes. This avoids having to re-read all documents from IndexedDb\n * when we apply the changes.\n */ function Ni(t) {\n return ro.Kn(t, Fi.store);\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the remoteDocuments object store.\n */ function Ai(t) {\n return ro.Kn(t, qi.store);\n}\n\nfunction Di(t) {\n return t.path.L();\n}\n\n/**\n * Retrusn an approximate size for the given document.\n */ function Si(t) {\n var e;\n if (t.document) e = t.document; else if (t.unknownDocument) e = t.unknownDocument; else {\n if (!t.noDocument) throw S();\n e = t.noDocument;\n }\n return JSON.stringify(e).length;\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An in-memory implementation of IndexManager.\n */ var xi = /** @class */ function() {\n function t() {\n this.ua = new ki;\n }\n return t.prototype.Mo = function(t, e) {\n return this.ua.add(e), cr.resolve();\n }, t.prototype.Kr = function(t, e) {\n return cr.resolve(this.ua.getEntries(e));\n }, t;\n}(), ki = /** @class */ function() {\n function t() {\n this.index = {};\n }\n // Returns false if the entry already existed.\n return t.prototype.add = function(t) {\n var e = t.O(), n = t.F(), r = this.index[e] || new mt(X.D), i = !r.has(n);\n return this.index[e] = r.add(n), i;\n }, t.prototype.has = function(t) {\n var e = t.O(), n = t.F(), r = this.index[e];\n return r && r.has(n);\n }, t.prototype.getEntries = function(t) {\n return (this.index[t] || new mt(X.D)).L();\n }, t;\n}(), Pi = /** @class */ function() {\n function t(t) {\n this.serializer = t;\n }\n /**\n * Performs database creation and schema upgrades.\n *\n * Note that in production, this method is only ever used to upgrade the schema\n * to SCHEMA_VERSION. Different values of toVersion are only used for testing\n * and local feature development.\n */ return t.prototype.createOrUpgrade = function(t, e, n, r) {\n var i = this;\n x(n < r && n >= 0 && r <= 10);\n var o = new dr(\"createOrUpgrade\", e);\n n < 1 && r >= 1 && (function(t) {\n t.createObjectStore(Li.store);\n }(t), function(t) {\n t.createObjectStore(Vi.store, {\n keyPath: Vi.keyPath\n }), t.createObjectStore(Ri.store, {\n keyPath: Ri.keyPath,\n autoIncrement: !0\n }).createIndex(Ri.userMutationsIndex, Ri.userMutationsKeyPath, {\n unique: !0\n }), t.createObjectStore(Ci.store);\n }(t), Ki(t), function(t) {\n t.createObjectStore(qi.store);\n }(t));\n // Migration 2 to populate the targetGlobal object no longer needed since\n // migration 3 unconditionally clears it.\n var u = cr.resolve();\n return n < 3 && r >= 3 && (\n // Brand new clients don't need to drop and recreate--only clients that\n // potentially have corrupt data.\n 0 !== n && (function(t) {\n t.deleteObjectStore(Gi.store), t.deleteObjectStore(ji.store), t.deleteObjectStore(Bi.store);\n }(t), Ki(t)), u = u.next((function() {\n /**\n * Creates the target global singleton row.\n *\n * @param {IDBTransaction} txn The version upgrade transaction for indexeddb\n */\n return function(t) {\n var e = t.store(Bi.store), n = new Bi(\n /*highestTargetId=*/ 0, \n /*lastListenSequenceNumber=*/ 0, H.min().v(), \n /*targetCount=*/ 0);\n return e.put(Bi.key, n);\n }(o);\n }))), n < 4 && r >= 4 && (0 !== n && (\n // Schema version 3 uses auto-generated keys to generate globally unique\n // mutation batch IDs (this was previously ensured internally by the\n // client). To migrate to the new schema, we have to read all mutations\n // and write them back out. We preserve the existing batch IDs to guarantee\n // consistency with other object stores. Any further mutation batch IDs will\n // be auto-generated.\n u = u.next((function() {\n return function(t, e) {\n return e.store(Ri.store).ts().next((function(n) {\n t.deleteObjectStore(Ri.store), t.createObjectStore(Ri.store, {\n keyPath: Ri.keyPath,\n autoIncrement: !0\n }).createIndex(Ri.userMutationsIndex, Ri.userMutationsKeyPath, {\n unique: !0\n });\n var r = e.store(Ri.store), i = n.map((function(t) {\n return r.put(t);\n }));\n return cr.kn(i);\n }));\n }(t, o);\n }))), u = u.next((function() {\n !function(t) {\n t.createObjectStore(Wi.store, {\n keyPath: Wi.keyPath\n });\n }(t);\n }))), n < 5 && r >= 5 && (u = u.next((function() {\n return i.removeAcknowledgedMutations(o);\n }))), n < 6 && r >= 6 && (u = u.next((function() {\n return function(t) {\n t.createObjectStore(Fi.store);\n }(t), i.addDocumentGlobal(o);\n }))), n < 7 && r >= 7 && (u = u.next((function() {\n return i.ensureSequenceNumbers(o);\n }))), n < 8 && r >= 8 && (u = u.next((function() {\n return i.createCollectionParentIndex(t, o);\n }))), n < 9 && r >= 9 && (u = u.next((function() {\n // Multi-Tab used to manage its own changelog, but this has been moved\n // to the DbRemoteDocument object store itself. Since the previous change\n // log only contained transient data, we can drop its object store.\n !function(t) {\n t.objectStoreNames.contains(\"remoteDocumentChanges\") && t.deleteObjectStore(\"remoteDocumentChanges\");\n }(t), function(t) {\n var e = t.objectStore(qi.store);\n e.createIndex(qi.readTimeIndex, qi.readTimeIndexPath, {\n unique: !1\n }), e.createIndex(qi.collectionReadTimeIndex, qi.collectionReadTimeIndexPath, {\n unique: !1\n });\n }(e);\n }))), n < 10 && r >= 10 && (u = u.next((function() {\n return i.rewriteCanonicalIds(o);\n }))), u;\n }, t.prototype.addDocumentGlobal = function(t) {\n var e = 0;\n return t.store(qi.store).rs((function(t, n) {\n e += Si(n);\n })).next((function() {\n var n = new Fi(e);\n return t.store(Fi.store).put(Fi.key, n);\n }));\n }, t.prototype.removeAcknowledgedMutations = function(t) {\n var e = this, n = t.store(Vi.store), r = t.store(Ri.store);\n return n.ts().next((function(n) {\n return cr.forEach(n, (function(n) {\n var i = IDBKeyRange.bound([ n.userId, -1 ], [ n.userId, n.lastAcknowledgedBatchId ]);\n return r.ts(Ri.userMutationsIndex, i).next((function(r) {\n return cr.forEach(r, (function(r) {\n x(r.userId === n.userId);\n var i = di(e.serializer, r);\n return wi(t, n.userId, i).next((function() {}));\n }));\n }));\n }));\n }));\n }, \n /**\n * Ensures that every document in the remote document cache has a corresponding sentinel row\n * with a sequence number. Missing rows are given the most recently used sequence number.\n */\n t.prototype.ensureSequenceNumbers = function(t) {\n var e = t.store(Gi.store), n = t.store(qi.store);\n return t.store(Bi.store).get(Bi.key).next((function(t) {\n var r = [];\n return n.rs((function(n, i) {\n var o = new X(n), u = function(t) {\n return [ 0, ri(t) ];\n }(o);\n r.push(e.get(u).next((function(n) {\n return n ? cr.resolve() : function(n) {\n return e.put(new Gi(0, ri(n), t.highestListenSequenceNumber));\n }(o);\n })));\n })).next((function() {\n return cr.kn(r);\n }));\n }));\n }, t.prototype.createCollectionParentIndex = function(t, e) {\n // Create the index.\n t.createObjectStore(zi.store, {\n keyPath: zi.keyPath\n });\n var n = e.store(zi.store), r = new ki, i = function(t) {\n if (r.add(t)) {\n var e = t.O(), i = t.F();\n return n.put({\n collectionId: e,\n parent: ri(i)\n });\n }\n };\n // Helper to add an index entry iff we haven't already written it.\n // Index existing remote documents.\n return e.store(qi.store).rs({\n ss: !0\n }, (function(t, e) {\n var n = new X(t);\n return i(n.F());\n })).next((function() {\n return e.store(Ci.store).rs({\n ss: !0\n }, (function(t, e) {\n t[0];\n var n = t[1], r = (t[2], ui(n));\n return i(r.F());\n }));\n }));\n }, t.prototype.rewriteCanonicalIds = function(t) {\n var e = this, n = t.store(ji.store);\n return n.rs((function(t, r) {\n var i = vi(r), o = yi(e.serializer, i);\n return n.put(o);\n }));\n }, t;\n}(), Oi = function(t, e) {\n this.seconds = t, this.nanoseconds = e;\n}, Li = function(t, \n/** Whether to allow shared access from multiple tabs. */\ne, n) {\n this.ownerId = t, this.allowTabSynchronization = e, this.leaseTimestampMs = n;\n};\n\n/**\n * Internal implementation of the collection-parent index exposed by MemoryIndexManager.\n * Also used for in-memory caching by IndexedDbIndexManager and initial index population\n * in indexeddb_schema.ts\n */\n/**\n * Name of the IndexedDb object store.\n *\n * Note that the name 'owner' is chosen to ensure backwards compatibility with\n * older clients that only supported single locked access to the persistence\n * layer.\n */\nLi.store = \"owner\", \n/**\n * The key string used for the single object that exists in the\n * DbPrimaryClient store.\n */\nLi.key = \"owner\";\n\nvar Vi = function(\n/**\n * The normalized user ID to which this queue belongs.\n */\nt, \n/**\n * An identifier for the highest numbered batch that has been acknowledged\n * by the server. All MutationBatches in this queue with batchIds less\n * than or equal to this value are considered to have been acknowledged by\n * the server.\n *\n * NOTE: this is deprecated and no longer used by the code.\n */\ne, \n/**\n * A stream token that was previously sent by the server.\n *\n * See StreamingWriteRequest in datastore.proto for more details about\n * usage.\n *\n * After sending this token, earlier tokens may not be used anymore so\n * only a single stream token is retained.\n *\n * NOTE: this is deprecated and no longer used by the code.\n */\nn) {\n this.userId = t, this.lastAcknowledgedBatchId = e, this.lastStreamToken = n;\n};\n\n/** Name of the IndexedDb object store. */ Vi.store = \"mutationQueues\", \n/** Keys are automatically assigned via the userId property. */\nVi.keyPath = \"userId\";\n\n/**\n * An object to be stored in the 'mutations' store in IndexedDb.\n *\n * Represents a batch of user-level mutations intended to be sent to the server\n * in a single write. Each user-level batch gets a separate DbMutationBatch\n * with a new batchId.\n */\nvar Ri = function(\n/**\n * The normalized user ID to which this batch belongs.\n */\nt, \n/**\n * An identifier for this batch, allocated using an auto-generated key.\n */\ne, \n/**\n * The local write time of the batch, stored as milliseconds since the\n * epoch.\n */\nn, \n/**\n * A list of \"mutations\" that represent a partial base state from when this\n * write batch was initially created. During local application of the write\n * batch, these baseMutations are applied prior to the real writes in order\n * to override certain document fields from the remote document cache. This\n * is necessary in the case of non-idempotent writes (e.g. `increment()`\n * transforms) to make sure that the local view of the modified documents\n * doesn't flicker if the remote document cache receives the result of the\n * non-idempotent write before the write is removed from the queue.\n *\n * These mutations are never sent to the backend.\n */\nr, \n/**\n * A list of mutations to apply. All mutations will be applied atomically.\n *\n * Mutations are serialized via toMutation().\n */\ni) {\n this.userId = t, this.batchId = e, this.localWriteTimeMs = n, this.baseMutations = r, \n this.mutations = i;\n};\n\n/** Name of the IndexedDb object store. */ Ri.store = \"mutations\", \n/** Keys are automatically assigned via the userId, batchId properties. */\nRi.keyPath = \"batchId\", \n/** The index name for lookup of mutations by user. */\nRi.userMutationsIndex = \"userMutationsIndex\", \n/** The user mutations index is keyed by [userId, batchId] pairs. */\nRi.userMutationsKeyPath = [ \"userId\", \"batchId\" ];\n\nvar Ci = /** @class */ function() {\n function t() {}\n /**\n * Creates a [userId] key for use in the DbDocumentMutations index to iterate\n * over all of a user's document mutations.\n */ return t.prefixForUser = function(t) {\n return [ t ];\n }, \n /**\n * Creates a [userId, encodedPath] key for use in the DbDocumentMutations\n * index to iterate over all at document mutations for a given path or lower.\n */\n t.prefixForPath = function(t, e) {\n return [ t, ri(e) ];\n }, \n /**\n * Creates a full index key of [userId, encodedPath, batchId] for inserting\n * and deleting into the DbDocumentMutations index.\n */\n t.key = function(t, e, n) {\n return [ t, ri(e), n ];\n }, t;\n}();\n\nCi.store = \"documentMutations\", \n/**\n * Because we store all the useful information for this store in the key,\n * there is no useful information to store as the value. The raw (unencoded)\n * path cannot be stored because IndexedDb doesn't store prototype\n * information.\n */\nCi.PLACEHOLDER = new Ci;\n\nvar Ui = function(t, e) {\n this.path = t, this.readTime = e;\n}, Mi = function(t, e) {\n this.path = t, this.version = e;\n}, qi = \n// TODO: We are currently storing full document keys almost three times\n// (once as part of the primary key, once - partly - as `parentPath` and once\n// inside the encoded documents). During our next migration, we should\n// rewrite the primary key as parentPath + document ID which would allow us\n// to drop one value.\nfunction(\n/**\n * Set to an instance of DbUnknownDocument if the data for a document is\n * not known, but it is known that a document exists at the specified\n * version (e.g. it had a successful update applied to it)\n */\nt, \n/**\n * Set to an instance of a DbNoDocument if it is known that no document\n * exists.\n */\ne, \n/**\n * Set to an instance of a Document if there's a cached version of the\n * document.\n */\nn, \n/**\n * Documents that were written to the remote document store based on\n * a write acknowledgment are marked with `hasCommittedMutations`. These\n * documents are potentially inconsistent with the backend's copy and use\n * the write's commit version as their document version.\n */\nr, \n/**\n * When the document was read from the backend. Undefined for data written\n * prior to schema version 9.\n */\ni, \n/**\n * The path of the collection this document is part of. Undefined for data\n * written prior to schema version 9.\n */\no) {\n this.unknownDocument = t, this.noDocument = e, this.document = n, this.hasCommittedMutations = r, \n this.readTime = i, this.parentPath = o;\n};\n\n/**\n * Represents a document that is known to exist but whose data is unknown.\n * Stored in IndexedDb as part of a DbRemoteDocument object.\n */ qi.store = \"remoteDocuments\", \n/**\n * An index that provides access to all entries sorted by read time (which\n * corresponds to the last modification time of each row).\n *\n * This index is used to provide a changelog for Multi-Tab.\n */\nqi.readTimeIndex = \"readTimeIndex\", qi.readTimeIndexPath = \"readTime\", \n/**\n * An index that provides access to documents in a collection sorted by read\n * time.\n *\n * This index is used to allow the RemoteDocumentCache to fetch newly changed\n * documents in a collection.\n */\nqi.collectionReadTimeIndex = \"collectionReadTimeIndex\", qi.collectionReadTimeIndexPath = [ \"parentPath\", \"readTime\" ];\n\n/**\n * Contains a single entry that has metadata about the remote document cache.\n */\nvar Fi = \n/**\n * @param byteSize Approximately the total size in bytes of all the documents in the document\n * cache.\n */\nfunction(t) {\n this.byteSize = t;\n};\n\nFi.store = \"remoteDocumentGlobal\", Fi.key = \"remoteDocumentGlobalKey\";\n\nvar ji = function(\n/**\n * An auto-generated sequential numeric identifier for the query.\n *\n * Queries are stored using their canonicalId as the key, but these\n * canonicalIds can be quite long so we additionally assign a unique\n * queryId which can be used by referenced data structures (e.g.\n * indexes) to minimize the on-disk cost.\n */\nt, \n/**\n * The canonical string representing this query. This is not unique.\n */\ne, \n/**\n * The last readTime received from the Watch Service for this query.\n *\n * This is the same value as TargetChange.read_time in the protos.\n */\nn, \n/**\n * An opaque, server-assigned token that allows watching a query to be\n * resumed after disconnecting without retransmitting all the data\n * that matches the query. The resume token essentially identifies a\n * point in time from which the server should resume sending results.\n *\n * This is related to the snapshotVersion in that the resumeToken\n * effectively also encodes that value, but the resumeToken is opaque\n * and sometimes encodes additional information.\n *\n * A consequence of this is that the resumeToken should be used when\n * asking the server to reason about where this client is in the watch\n * stream, but the client should use the snapshotVersion for its own\n * purposes.\n *\n * This is the same value as TargetChange.resume_token in the protos.\n */\nr, \n/**\n * A sequence number representing the last time this query was\n * listened to, used for garbage collection purposes.\n *\n * Conventionally this would be a timestamp value, but device-local\n * clocks are unreliable and they must be able to create new listens\n * even while disconnected. Instead this should be a monotonically\n * increasing number that's incremented on each listen call.\n *\n * This is different from the queryId since the queryId is an\n * immutable identifier assigned to the Query on first use while\n * lastListenSequenceNumber is updated every time the query is\n * listened to.\n */\ni, \n/**\n * Denotes the maximum snapshot version at which the associated query view\n * contained no limbo documents. Undefined for data written prior to\n * schema version 9.\n */\no, \n/**\n * The query for this target.\n *\n * Because canonical ids are not unique we must store the actual query. We\n * use the proto to have an object we can persist without having to\n * duplicate translation logic to and from a `Query` object.\n */\nu) {\n this.targetId = t, this.canonicalId = e, this.readTime = n, this.resumeToken = r, \n this.lastListenSequenceNumber = i, this.lastLimboFreeSnapshotVersion = o, this.query = u;\n};\n\nji.store = \"targets\", \n/** Keys are automatically assigned via the targetId property. */\nji.keyPath = \"targetId\", \n/** The name of the queryTargets index. */\nji.queryTargetsIndexName = \"queryTargetsIndex\", \n/**\n * The index of all canonicalIds to the targets that they match. This is not\n * a unique mapping because canonicalId does not promise a unique name for all\n * possible queries, so we append the targetId to make the mapping unique.\n */\nji.queryTargetsKeyPath = [ \"canonicalId\", \"targetId\" ];\n\n/**\n * An object representing an association between a target and a document, or a\n * sentinel row marking the last sequence number at which a document was used.\n * Each document cached must have a corresponding sentinel row before lru\n * garbage collection is enabled.\n *\n * The target associations and sentinel rows are co-located so that orphaned\n * documents and their sequence numbers can be identified efficiently via a scan\n * of this store.\n */\nvar Gi = function(\n/**\n * The targetId identifying a target or 0 for a sentinel row.\n */\nt, \n/**\n * The path to the document, as encoded in the key.\n */\ne, \n/**\n * If this is a sentinel row, this should be the sequence number of the last\n * time the document specified by `path` was used. Otherwise, it should be\n * `undefined`.\n */\nn) {\n this.targetId = t, this.path = e, this.sequenceNumber = n;\n};\n\n/** Name of the IndexedDb object store. */ Gi.store = \"targetDocuments\", \n/** Keys are automatically assigned via the targetId, path properties. */\nGi.keyPath = [ \"targetId\", \"path\" ], \n/** The index name for the reverse index. */\nGi.documentTargetsIndex = \"documentTargetsIndex\", \n/** We also need to create the reverse index for these properties. */\nGi.documentTargetsKeyPath = [ \"path\", \"targetId\" ];\n\n/**\n * A record of global state tracked across all Targets, tracked separately\n * to avoid the need for extra indexes.\n *\n * This should be kept in-sync with the proto used in the iOS client.\n */\nvar Bi = function(\n/**\n * The highest numbered target id across all targets.\n *\n * See DbTarget.targetId.\n */\nt, \n/**\n * The highest numbered lastListenSequenceNumber across all targets.\n *\n * See DbTarget.lastListenSequenceNumber.\n */\ne, \n/**\n * A global snapshot version representing the last consistent snapshot we\n * received from the backend. This is monotonically increasing and any\n * snapshots received from the backend prior to this version (e.g. for\n * targets resumed with a resumeToken) should be suppressed (buffered)\n * until the backend has caught up to this snapshot version again. This\n * prevents our cache from ever going backwards in time.\n */\nn, \n/**\n * The number of targets persisted.\n */\nr) {\n this.highestTargetId = t, this.highestListenSequenceNumber = e, this.lastRemoteSnapshotVersion = n, \n this.targetCount = r;\n};\n\n/**\n * The key string used for the single object that exists in the\n * DbTargetGlobal store.\n */ Bi.key = \"targetGlobalKey\", Bi.store = \"targetGlobal\";\n\n/**\n * An object representing an association between a Collection id (e.g. 'messages')\n * to a parent path (e.g. '/chats/123') that contains it as a (sub)collection.\n * This is used to efficiently find all collections to query when performing\n * a Collection Group query.\n */\nvar zi = function(\n/**\n * The collectionId (e.g. 'messages')\n */\nt, \n/**\n * The path to the parent (either a document location or an empty path for\n * a root-level collection).\n */\ne) {\n this.collectionId = t, this.parent = e;\n};\n\n/** Name of the IndexedDb object store. */ function Ki(t) {\n t.createObjectStore(Gi.store, {\n keyPath: Gi.keyPath\n }).createIndex(Gi.documentTargetsIndex, Gi.documentTargetsKeyPath, {\n unique: !0\n }), \n // NOTE: This is unique only because the TargetId is the suffix.\n t.createObjectStore(ji.store, {\n keyPath: ji.keyPath\n }).createIndex(ji.queryTargetsIndexName, ji.queryTargetsKeyPath, {\n unique: !0\n }), t.createObjectStore(Bi.store);\n}\n\nzi.store = \"collectionParents\", \n/** Keys are automatically assigned via the collectionId, parent properties. */\nzi.keyPath = [ \"collectionId\", \"parent\" ];\n\nvar Wi = function(\n// Note: Previous schema versions included a field\n// \"lastProcessedDocumentChangeId\". Don't use anymore.\n/** The auto-generated client id assigned at client startup. */\nt, \n/** The last time this state was updated. */\ne, \n/** Whether the client's network connection is enabled. */\nn, \n/** Whether this client is running in a foreground tab. */\nr) {\n this.clientId = t, this.updateTimeMs = e, this.networkEnabled = n, this.inForeground = r;\n};\n\n/** Name of the IndexedDb object store. */ Wi.store = \"clientMetadata\", \n/** Keys are automatically assigned via the clientId properties. */\nWi.keyPath = \"clientId\";\n\nvar Qi = r(r(r([ Vi.store, Ri.store, Ci.store, qi.store, ji.store, Li.store, Bi.store, Gi.store ], [ Wi.store ]), [ Fi.store ]), [ zi.store ]), Hi = /** @class */ function() {\n function t() {\n /**\n * An in-memory copy of the index entries we've already written since the SDK\n * launched. Used to avoid re-writing the same entry repeatedly.\n *\n * This is *NOT* a complete cache of what's in persistence and so can never be used to\n * satisfy reads.\n */\n this.la = new ki;\n }\n /**\n * Adds a new entry to the collection parent index.\n *\n * Repeated calls for the same collectionPath should be avoided within a\n * transaction as IndexedDbIndexManager only caches writes once a transaction\n * has been committed.\n */ return t.prototype.Mo = function(t, e) {\n var n = this;\n if (!this.la.has(e)) {\n var r = e.O(), i = e.F();\n t.pr((function() {\n // Add the collection to the in memory cache only if the transaction was\n // successfully committed.\n n.la.add(e);\n }));\n var o = {\n collectionId: r,\n parent: ri(i)\n };\n return Yi(t).put(o);\n }\n return cr.resolve();\n }, t.prototype.Kr = function(t, e) {\n var n = [], r = IDBKeyRange.bound([ e, \"\" ], [ R(e), \"\" ], \n /*lowerOpen=*/ !1, \n /*upperOpen=*/ !0);\n return Yi(t).ts(r).next((function(t) {\n for (var r = 0, i = t; r < i.length; r++) {\n var o = i[r];\n // This collectionId guard shouldn't be necessary (and isn't as long\n // as we're running in a real browser), but there's a bug in\n // indexeddbshim that breaks our range in our tests running in node:\n // https://github.com/axemclion/IndexedDBShim/issues/334\n if (o.collectionId !== e) break;\n n.push(ui(o.parent));\n }\n return n;\n }));\n }, t;\n}();\n\n// V2 is no longer usable (see comment at top of file)\n// Visible for testing\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A persisted implementation of IndexManager.\n */\n/**\n * Helper to get a typed SimpleDbStore for the collectionParents\n * document store.\n */\nfunction Yi(t) {\n return ro.Kn(t, zi.store);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Offset to ensure non-overlapping target ids. */\n/**\n * Generates monotonically increasing target IDs for sending targets to the\n * watch stream.\n *\n * The client constructs two generators, one for the target cache, and one for\n * for the sync engine (to generate limbo documents targets). These\n * generators produce non-overlapping IDs (by using even and odd IDs\n * respectively).\n *\n * By separating the target ID space, the query cache can generate target IDs\n * that persist across client restarts, while sync engine can independently\n * generate in-memory target IDs that are transient and can be reused after a\n * restart.\n */ var Xi = /** @class */ function() {\n function t(t) {\n this._a = t;\n }\n return t.prototype.next = function() {\n return this._a += 2, this._a;\n }, t.fa = function() {\n // The target cache generator must return '2' in its first call to `next()`\n // as there is no differentiation in the protocol layer between an unset\n // number and the number '0'. If we were to sent a target with target ID\n // '0', the backend would consider it unset and replace it with its own ID.\n return new t(0);\n }, t.da = function() {\n // Sync engine assigns target IDs for limbo document detection.\n return new t(-1);\n }, t;\n}(), Ji = /** @class */ function() {\n function t(t, e) {\n this.No = t, this.serializer = e;\n }\n // PORTING NOTE: We don't cache global metadata for the target cache, since\n // some of it (in particular `highestTargetId`) can be modified by secondary\n // tabs. We could perhaps be more granular (and e.g. still cache\n // `lastRemoteSnapshotVersion` in memory) but for simplicity we currently go\n // to IndexedDb whenever we need to read metadata. We can revisit if it turns\n // out to have a meaningful performance impact.\n return t.prototype.wa = function(t) {\n var e = this;\n return this.Ea(t).next((function(n) {\n var r = new Xi(n.highestTargetId);\n return n.highestTargetId = r.next(), e.Ta(t, n).next((function() {\n return n.highestTargetId;\n }));\n }));\n }, t.prototype.Ia = function(t) {\n return this.Ea(t).next((function(t) {\n return H.V(new Q(t.lastRemoteSnapshotVersion.seconds, t.lastRemoteSnapshotVersion.nanoseconds));\n }));\n }, t.prototype.ma = function(t) {\n return this.Ea(t).next((function(t) {\n return t.highestListenSequenceNumber;\n }));\n }, t.prototype.Aa = function(t, e, n) {\n var r = this;\n return this.Ea(t).next((function(i) {\n return i.highestListenSequenceNumber = e, n && (i.lastRemoteSnapshotVersion = n.v()), \n e > i.highestListenSequenceNumber && (i.highestListenSequenceNumber = e), r.Ta(t, i);\n }));\n }, t.prototype.Ra = function(t, e) {\n var n = this;\n return this.Pa(t, e).next((function() {\n return n.Ea(t).next((function(r) {\n return r.targetCount += 1, n.ga(e, r), n.Ta(t, r);\n }));\n }));\n }, t.prototype.Va = function(t, e) {\n return this.Pa(t, e);\n }, t.prototype.ya = function(t, e) {\n var n = this;\n return this.pa(t, e.targetId).next((function() {\n return $i(t).delete(e.targetId);\n })).next((function() {\n return n.Ea(t);\n })).next((function(e) {\n return x(e.targetCount > 0), e.targetCount -= 1, n.Ta(t, e);\n }));\n }, \n /**\n * Drops any targets with sequence number less than or equal to the upper bound, excepting those\n * present in `activeTargetIds`. Document associations for the removed targets are also removed.\n * Returns the number of targets removed.\n */\n t.prototype.po = function(t, e, n) {\n var r = this, i = 0, o = [];\n return $i(t).rs((function(u, s) {\n var a = vi(s);\n a.sequenceNumber <= e && null === n.get(a.targetId) && (i++, o.push(r.ya(t, a)));\n })).next((function() {\n return cr.kn(o);\n })).next((function() {\n return i;\n }));\n }, \n /**\n * Call provided function with each `TargetData` that we have cached.\n */\n t.prototype.Ce = function(t, e) {\n return $i(t).rs((function(t, n) {\n var r = vi(n);\n e(r);\n }));\n }, t.prototype.Ea = function(t) {\n return Zi(t).get(Bi.key).next((function(t) {\n return x(null !== t), t;\n }));\n }, t.prototype.Ta = function(t, e) {\n return Zi(t).put(Bi.key, e);\n }, t.prototype.Pa = function(t, e) {\n return $i(t).put(yi(this.serializer, e));\n }, \n /**\n * In-place updates the provided metadata to account for values in the given\n * TargetData. Saving is done separately. Returns true if there were any\n * changes to the metadata.\n */\n t.prototype.ga = function(t, e) {\n var n = !1;\n return t.targetId > e.highestTargetId && (e.highestTargetId = t.targetId, n = !0), \n t.sequenceNumber > e.highestListenSequenceNumber && (e.highestListenSequenceNumber = t.sequenceNumber, \n n = !0), n;\n }, t.prototype.ba = function(t) {\n return this.Ea(t).next((function(t) {\n return t.targetCount;\n }));\n }, t.prototype.va = function(t, e) {\n // Iterating by the canonicalId may yield more than one result because\n // canonicalId values are not required to be unique per target. This query\n // depends on the queryTargets index to be efficient.\n var n = ot(e), r = IDBKeyRange.bound([ n, Number.NEGATIVE_INFINITY ], [ n, Number.POSITIVE_INFINITY ]), i = null;\n return $i(t).rs({\n range: r,\n index: ji.queryTargetsIndexName\n }, (function(t, n, r) {\n var o = vi(n);\n // After finding a potential match, check that the target is\n // actually equal to the requested target.\n ut(e, o.target) && (i = o, r.done());\n })).next((function() {\n return i;\n }));\n }, t.prototype.Sa = function(t, e, n) {\n var r = this, i = [], o = to(t);\n // PORTING NOTE: The reverse index (documentsTargets) is maintained by\n // IndexedDb.\n return e.forEach((function(e) {\n var u = ri(e.path);\n i.push(o.put(new Gi(n, u))), i.push(r.No.Da(t, n, e));\n })), cr.kn(i);\n }, t.prototype.Ca = function(t, e, n) {\n var r = this, i = to(t);\n // PORTING NOTE: The reverse index (documentsTargets) is maintained by\n // IndexedDb.\n return cr.forEach(e, (function(e) {\n var o = ri(e.path);\n return cr.kn([ i.delete([ n, o ]), r.No.Na(t, n, e) ]);\n }));\n }, t.prototype.pa = function(t, e) {\n var n = to(t), r = IDBKeyRange.bound([ e ], [ e + 1 ], \n /*lowerOpen=*/ !1, \n /*upperOpen=*/ !0);\n return n.delete(r);\n }, t.prototype.xa = function(t, e) {\n var n = IDBKeyRange.bound([ e ], [ e + 1 ], \n /*lowerOpen=*/ !1, \n /*upperOpen=*/ !0), r = to(t), i = At();\n return r.rs({\n range: n,\n ss: !0\n }, (function(t, e, n) {\n var r = ui(t[1]), o = new Z(r);\n i = i.add(o);\n })).next((function() {\n return i;\n }));\n }, t.prototype.Ho = function(t, e) {\n var n = ri(e.path), r = IDBKeyRange.bound([ n ], [ R(n) ], \n /*lowerOpen=*/ !1, \n /*upperOpen=*/ !0), i = 0;\n return to(t).rs({\n index: Gi.documentTargetsIndex,\n ss: !0,\n range: r\n }, (function(t, e, n) {\n var r = t[0];\n // Having a sentinel row for a document does not count as containing that document;\n // For the target cache, containing the document means the document is part of some\n // target.\n t[1];\n 0 !== r && (i++, n.done());\n })).next((function() {\n return i > 0;\n }));\n }, \n /**\n * Looks up a TargetData entry by target ID.\n *\n * @param targetId The target ID of the TargetData entry to look up.\n * @return The cached TargetData entry, or null if the cache has no entry for\n * the target.\n */\n // PORTING NOTE: Multi-tab only.\n t.prototype.Ue = function(t, e) {\n return $i(t).get(e).next((function(t) {\n return t ? vi(t) : null;\n }));\n }, t;\n}();\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Helper to get a typed SimpleDbStore for the queries object store.\n */\nfunction $i(t) {\n return ro.Kn(t, ji.store);\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the target globals object store.\n */ function Zi(t) {\n return ro.Kn(t, Bi.store);\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the document target object store.\n */ function to(t) {\n return ro.Kn(t, Gi.store);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ var eo = \"Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.\", no = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this) || this).Wo = t, r.Fa = n, r;\n }\n return t(n, e), n;\n}(Hr), ro = /** @class */ function() {\n function t(\n /**\n * Whether to synchronize the in-memory state of multiple tabs and share\n * access to local persistence.\n */\n e, n, r, i, o, u, s, a, c, \n /**\n * If set to true, forcefully obtains database access. Existing tabs will\n * no longer be able to access IndexedDB.\n */\n h) {\n if (this.allowTabSynchronization = e, this.persistenceKey = n, this.clientId = r, \n this.fn = o, this.window = u, this.document = s, this.ka = c, this.Oa = h, this.Ma = null, \n this.$a = !1, this.isPrimary = !1, this.networkEnabled = !0, \n /** Our window.unload handler, if registered. */\n this.La = null, this.inForeground = !1, \n /** Our 'visibilitychange' listener if registered. */\n this.Ba = null, \n /** The client metadata refresh task. */\n this.qa = null, \n /** The last time we garbage collected the client metadata object store. */\n this.Ua = Number.NEGATIVE_INFINITY, \n /** A listener to notify on primary state changes. */\n this.Ka = function(t) {\n return Promise.resolve();\n }, !t.Ln()) throw new I(b.UNIMPLEMENTED, \"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.\");\n this.No = new uo(this, i), this.Qa = n + \"main\", this.serializer = new si(a), this.Wa = new hr(this.Qa, 10, new Pi(this.serializer)), \n this.ja = new Ji(this.No, this.serializer), this.Dr = new Hi, this.vr = function(t, e) {\n return new _i(t, e);\n }(this.serializer, this.Dr), this.window && this.window.localStorage ? this.Ga = this.window.localStorage : (this.Ga = null, \n !1 === h && N(\"IndexedDbPersistence\", \"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page.\"));\n }\n return t.Kn = function(t, e) {\n if (t instanceof no) return hr.Kn(t.Wo, e);\n throw S();\n }, \n /**\n * Attempt to start IndexedDb persistence.\n *\n * @return {Promise<void>} Whether persistence was enabled.\n */\n t.prototype.start = function() {\n var t = this;\n // NOTE: This is expected to fail sometimes (in the case of another tab\n // already having the persistence lock), so it's the first thing we should\n // do.\n return this.za().then((function() {\n if (!t.isPrimary && !t.allowTabSynchronization) \n // Fail `start()` if `synchronizeTabs` is disabled and we cannot\n // obtain the primary lease.\n throw new I(b.FAILED_PRECONDITION, eo);\n return t.Ha(), t.Ja(), t.Ya(), t.runTransaction(\"getHighestListenSequenceNumber\", \"readonly\", (function(e) {\n return t.ja.ma(e);\n }));\n })).then((function(e) {\n t.Ma = new Lr(e, t.ka);\n })).then((function() {\n t.$a = !0;\n })).catch((function(e) {\n return t.Wa && t.Wa.close(), Promise.reject(e);\n }));\n }, \n /**\n * Registers a listener that gets called when the primary state of the\n * instance changes. Upon registering, this listener is invoked immediately\n * with the current primary state.\n *\n * PORTING NOTE: This is only used for Web multi-tab.\n */\n t.prototype.Xa = function(t) {\n var r = this;\n return this.Ka = function(i) {\n return e(r, void 0, void 0, (function() {\n return n(this, (function(e) {\n return this.Ii ? [ 2 /*return*/ , t(i) ] : [ 2 /*return*/ ];\n }));\n }));\n }, t(this.isPrimary);\n }, \n /**\n * Registers a listener that gets called when the database receives a\n * version change event indicating that it has deleted.\n *\n * PORTING NOTE: This is only used for Web multi-tab.\n */\n t.prototype.Za = function(t) {\n var r = this;\n this.Wa.jn((function(i) {\n return e(r, void 0, void 0, (function() {\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n return null === i.newVersion ? [ 4 /*yield*/ , t() ] : [ 3 /*break*/ , 2 ];\n\n case 1:\n e.sent(), e.label = 2;\n\n case 2:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }));\n }, \n /**\n * Adjusts the current network state in the client's metadata, potentially\n * affecting the primary lease.\n *\n * PORTING NOTE: This is only used for Web multi-tab.\n */\n t.prototype.th = function(t) {\n var r = this;\n this.networkEnabled !== t && (this.networkEnabled = t, \n // Schedule a primary lease refresh for immediate execution. The eventual\n // lease update will be propagated via `primaryStateListener`.\n this.fn.ws((function() {\n return e(r, void 0, void 0, (function() {\n return n(this, (function(t) {\n switch (t.label) {\n case 0:\n return this.Ii ? [ 4 /*yield*/ , this.za() ] : [ 3 /*break*/ , 2 ];\n\n case 1:\n t.sent(), t.label = 2;\n\n case 2:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n })));\n }, \n /**\n * Updates the client metadata in IndexedDb and attempts to either obtain or\n * extend the primary lease for the local client. Asynchronously notifies the\n * primary state listener if the client either newly obtained or released its\n * primary lease.\n */\n t.prototype.za = function() {\n var t = this;\n return this.runTransaction(\"updateClientMetadataAndTryBecomePrimary\", \"readwrite\", (function(e) {\n return oo(e).put(new Wi(t.clientId, Date.now(), t.networkEnabled, t.inForeground)).next((function() {\n if (t.isPrimary) return t.eh(e).next((function(e) {\n e || (t.isPrimary = !1, t.fn.Cs((function() {\n return t.Ka(!1);\n })));\n }));\n })).next((function() {\n return t.nh(e);\n })).next((function(n) {\n return t.isPrimary && !n ? t.sh(e).next((function() {\n return !1;\n })) : !!n && t.ih(e).next((function() {\n return !0;\n }));\n }));\n })).catch((function(e) {\n if (pr(e)) \n // Proceed with the existing state. Any subsequent access to\n // IndexedDB will verify the lease.\n return T(\"IndexedDbPersistence\", \"Failed to extend owner lease: \", e), t.isPrimary;\n if (!t.allowTabSynchronization) throw e;\n return T(\"IndexedDbPersistence\", \"Releasing owner lease after error during lease refresh\", e), \n /* isPrimary= */ !1;\n })).then((function(e) {\n t.isPrimary !== e && t.fn.Cs((function() {\n return t.Ka(e);\n })), t.isPrimary = e;\n }));\n }, t.prototype.eh = function(t) {\n var e = this;\n return io(t).get(Li.key).next((function(t) {\n return cr.resolve(e.rh(t));\n }));\n }, t.prototype.oh = function(t) {\n return oo(t).delete(this.clientId);\n }, \n /**\n * If the garbage collection threshold has passed, prunes the\n * RemoteDocumentChanges and the ClientMetadata store based on the last update\n * time of all clients.\n */\n t.prototype.ah = function() {\n return e(this, void 0, void 0, (function() {\n var e, r, i, o, u = this;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return !this.isPrimary || this.hh(this.Ua, 18e5) ? [ 3 /*break*/ , 2 ] : (this.Ua = Date.now(), \n [ 4 /*yield*/ , this.runTransaction(\"maybeGarbageCollectMultiClientState\", \"readwrite-primary\", (function(e) {\n var n = t.Kn(e, Wi.store);\n return n.ts().next((function(t) {\n var e = u.uh(t, 18e5), r = t.filter((function(t) {\n return -1 === e.indexOf(t);\n }));\n // Delete metadata for clients that are no longer considered active.\n return cr.forEach(r, (function(t) {\n return n.delete(t.clientId);\n })).next((function() {\n return r;\n }));\n }));\n })).catch((function() {\n return [];\n })) ]);\n\n case 1:\n // Delete potential leftover entries that may continue to mark the\n // inactive clients as zombied in LocalStorage.\n // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for\n // the client atomically, but we can't. So we opt to delete the IndexedDb\n // entries first to avoid potentially reviving a zombied client.\n if (e = n.sent(), this.Ga) for (r = 0, i = e; r < i.length; r++) o = i[r], this.Ga.removeItem(this.lh(o.clientId));\n n.label = 2;\n\n case 2:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }, \n /**\n * Schedules a recurring timer to update the client metadata and to either\n * extend or acquire the primary lease if the client is eligible.\n */\n t.prototype.Ya = function() {\n var t = this;\n this.qa = this.fn.Vn(\"client_metadata_refresh\" /* ClientMetadataRefresh */ , 4e3, (function() {\n return t.za().then((function() {\n return t.ah();\n })).then((function() {\n return t.Ya();\n }));\n }));\n }, \n /** Checks whether `client` is the local client. */ t.prototype.rh = function(t) {\n return !!t && t.ownerId === this.clientId;\n }, \n /**\n * Evaluate the state of all active clients and determine whether the local\n * client is or can act as the holder of the primary lease. Returns whether\n * the client is eligible for the lease, but does not actually acquire it.\n * May return 'false' even if there is no active leaseholder and another\n * (foreground) client should become leaseholder instead.\n */\n t.prototype.nh = function(t) {\n var e = this;\n return this.Oa ? cr.resolve(!0) : io(t).get(Li.key).next((function(n) {\n // A client is eligible for the primary lease if:\n // - its network is enabled and the client's tab is in the foreground.\n // - its network is enabled and no other client's tab is in the\n // foreground.\n // - every clients network is disabled and the client's tab is in the\n // foreground.\n // - every clients network is disabled and no other client's tab is in\n // the foreground.\n // - the `forceOwningTab` setting was passed in.\n if (null !== n && e.hh(n.leaseTimestampMs, 5e3) && !e._h(n.ownerId)) {\n if (e.rh(n) && e.networkEnabled) return !0;\n if (!e.rh(n)) {\n if (!n.allowTabSynchronization) \n // Fail the `canActAsPrimary` check if the current leaseholder has\n // not opted into multi-tab synchronization. If this happens at\n // client startup, we reject the Promise returned by\n // `enablePersistence()` and the user can continue to use Firestore\n // with in-memory persistence.\n // If this fails during a lease refresh, we will instead block the\n // AsyncQueue from executing further operations. Note that this is\n // acceptable since mixing & matching different `synchronizeTabs`\n // settings is not supported.\n // TODO(b/114226234): Remove this check when `synchronizeTabs` can\n // no longer be turned off.\n throw new I(b.FAILED_PRECONDITION, eo);\n return !1;\n }\n }\n return !(!e.networkEnabled || !e.inForeground) || oo(t).ts().next((function(t) {\n return void 0 === e.uh(t, 5e3).find((function(t) {\n if (e.clientId !== t.clientId) {\n var n = !e.networkEnabled && t.networkEnabled, r = !e.inForeground && t.inForeground, i = e.networkEnabled === t.networkEnabled;\n if (n || r && i) return !0;\n }\n return !1;\n }));\n }));\n })).next((function(t) {\n return e.isPrimary !== t && T(\"IndexedDbPersistence\", \"Client \" + (t ? \"is\" : \"is not\") + \" eligible for a primary lease.\"), \n t;\n }));\n }, t.prototype.Di = function() {\n return e(this, void 0, void 0, (function() {\n var t = this;\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n // Use `SimpleDb.runTransaction` directly to avoid failing if another tab\n // has obtained the primary lease.\n // The shutdown() operations are idempotent and can be called even when\n // start() aborted (e.g. because it couldn't acquire the persistence lease).\n return this.$a = !1, this.fh(), this.qa && (this.qa.cancel(), this.qa = null), this.dh(), \n this.wh(), [ 4 /*yield*/ , this.Wa.runTransaction(\"shutdown\", \"readwrite\", [ Li.store, Wi.store ], (function(e) {\n var n = new no(e, Lr.ai);\n return t.sh(n).next((function() {\n return t.oh(n);\n }));\n })) ];\n\n case 1:\n // The shutdown() operations are idempotent and can be called even when\n // start() aborted (e.g. because it couldn't acquire the persistence lease).\n // Use `SimpleDb.runTransaction` directly to avoid failing if another tab\n // has obtained the primary lease.\n return e.sent(), this.Wa.close(), \n // Remove the entry marking the client as zombied from LocalStorage since\n // we successfully deleted its metadata from IndexedDb.\n this.Eh(), [ 2 /*return*/ ];\n }\n }));\n }));\n }, \n /**\n * Returns clients that are not zombied and have an updateTime within the\n * provided threshold.\n */\n t.prototype.uh = function(t, e) {\n var n = this;\n return t.filter((function(t) {\n return n.hh(t.updateTimeMs, e) && !n._h(t.clientId);\n }));\n }, \n /**\n * Returns the IDs of the clients that are currently active. If multi-tab\n * is not supported, returns an array that only contains the local client's\n * ID.\n *\n * PORTING NOTE: This is only used for Web multi-tab.\n */\n t.prototype.pi = function() {\n var t = this;\n return this.runTransaction(\"getActiveClients\", \"readonly\", (function(e) {\n return oo(e).ts().next((function(e) {\n return t.uh(e, 18e5).map((function(t) {\n return t.clientId;\n }));\n }));\n }));\n }, Object.defineProperty(t.prototype, \"Ii\", {\n get: function() {\n return this.$a;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.Th = function(t) {\n return mi.Fo(t, this.serializer, this.Dr, this.No);\n }, t.prototype.Ih = function() {\n return this.ja;\n }, t.prototype.mh = function() {\n return this.vr;\n }, t.prototype.Ah = function() {\n return this.Dr;\n }, t.prototype.runTransaction = function(t, e, n) {\n var r = this;\n T(\"IndexedDbPersistence\", \"Starting transaction:\", t);\n var i, o = \"readonly\" === e ? \"readonly\" : \"readwrite\";\n // Do all transactions as readwrite against all object stores, since we\n // are the only reader/writer.\n return this.Wa.runTransaction(t, o, Qi, (function(o) {\n return i = new no(o, r.Ma ? r.Ma.next() : Lr.ai), \"readwrite-primary\" === e ? r.eh(i).next((function(t) {\n return !!t || r.nh(i);\n })).next((function(e) {\n if (!e) throw N(\"Failed to obtain primary lease for action '\" + t + \"'.\"), r.isPrimary = !1, \n r.fn.Cs((function() {\n return r.Ka(!1);\n })), new I(b.FAILED_PRECONDITION, Qr);\n return n(i);\n })).next((function(t) {\n return r.ih(i).next((function() {\n return t;\n }));\n })) : r.Rh(i).next((function() {\n return n(i);\n }));\n })).then((function(t) {\n return i.br(), t;\n }));\n }, \n /**\n * Verifies that the current tab is the primary leaseholder or alternatively\n * that the leaseholder has opted into multi-tab synchronization.\n */\n // TODO(b/114226234): Remove this check when `synchronizeTabs` can no longer\n // be turned off.\n t.prototype.Rh = function(t) {\n var e = this;\n return io(t).get(Li.key).next((function(t) {\n if (null !== t && e.hh(t.leaseTimestampMs, 5e3) && !e._h(t.ownerId) && !e.rh(t) && !(e.Oa || e.allowTabSynchronization && t.allowTabSynchronization)) throw new I(b.FAILED_PRECONDITION, eo);\n }));\n }, \n /**\n * Obtains or extends the new primary lease for the local client. This\n * method does not verify that the client is eligible for this lease.\n */\n t.prototype.ih = function(t) {\n var e = new Li(this.clientId, this.allowTabSynchronization, Date.now());\n return io(t).put(Li.key, e);\n }, t.Ln = function() {\n return hr.Ln();\n }, \n /** Checks the primary lease and removes it if we are the current primary. */ t.prototype.sh = function(t) {\n var e = this, n = io(t);\n return n.get(Li.key).next((function(t) {\n return e.rh(t) ? (T(\"IndexedDbPersistence\", \"Releasing primary lease.\"), n.delete(Li.key)) : cr.resolve();\n }));\n }, \n /** Verifies that `updateTimeMs` is within `maxAgeMs`. */ t.prototype.hh = function(t, e) {\n var n = Date.now();\n return !(t < n - e || t > n && (N(\"Detected an update time that is in the future: \" + t + \" > \" + n), \n 1));\n }, t.prototype.Ha = function() {\n var t = this;\n null !== this.document && \"function\" == typeof this.document.addEventListener && (this.Ba = function() {\n t.fn.ws((function() {\n return t.inForeground = \"visible\" === t.document.visibilityState, t.za();\n }));\n }, this.document.addEventListener(\"visibilitychange\", this.Ba), this.inForeground = \"visible\" === this.document.visibilityState);\n }, t.prototype.dh = function() {\n this.Ba && (this.document.removeEventListener(\"visibilitychange\", this.Ba), this.Ba = null);\n }, \n /**\n * Attaches a window.unload handler that will synchronously write our\n * clientId to a \"zombie client id\" location in LocalStorage. This can be used\n * by tabs trying to acquire the primary lease to determine that the lease\n * is no longer valid even if the timestamp is recent. This is particularly\n * important for the refresh case (so the tab correctly re-acquires the\n * primary lease). LocalStorage is used for this rather than IndexedDb because\n * it is a synchronous API and so can be used reliably from an unload\n * handler.\n */\n t.prototype.Ja = function() {\n var t, e = this;\n \"function\" == typeof (null === (t = this.window) || void 0 === t ? void 0 : t.addEventListener) && (this.La = function() {\n // Note: In theory, this should be scheduled on the AsyncQueue since it\n // accesses internal state. We execute this code directly during shutdown\n // to make sure it gets a chance to run.\n e.fh(), e.fn.ws((function() {\n return e.Di();\n }));\n }, this.window.addEventListener(\"unload\", this.La));\n }, t.prototype.wh = function() {\n this.La && (this.window.removeEventListener(\"unload\", this.La), this.La = null);\n }, \n /**\n * Returns whether a client is \"zombied\" based on its LocalStorage entry.\n * Clients become zombied when their tab closes without running all of the\n * cleanup logic in `shutdown()`.\n */\n t.prototype._h = function(t) {\n var e;\n try {\n var n = null !== (null === (e = this.Ga) || void 0 === e ? void 0 : e.getItem(this.lh(t)));\n return T(\"IndexedDbPersistence\", \"Client '\" + t + \"' \" + (n ? \"is\" : \"is not\") + \" zombied in LocalStorage\"), \n n;\n } catch (t) {\n // Gracefully handle if LocalStorage isn't working.\n return N(\"IndexedDbPersistence\", \"Failed to get zombied client id.\", t), !1;\n }\n }, \n /**\n * Record client as zombied (a client that had its tab closed). Zombied\n * clients are ignored during primary tab selection.\n */\n t.prototype.fh = function() {\n if (this.Ga) try {\n this.Ga.setItem(this.lh(this.clientId), String(Date.now()));\n } catch (t) {\n // Gracefully handle if LocalStorage isn't available / working.\n N(\"Failed to set zombie client id.\", t);\n }\n }, \n /** Removes the zombied client entry if it exists. */ t.prototype.Eh = function() {\n if (this.Ga) try {\n this.Ga.removeItem(this.lh(this.clientId));\n } catch (t) {\n // Ignore\n }\n }, t.prototype.lh = function(t) {\n return \"firestore_zombie_\" + this.persistenceKey + \"_\" + t;\n }, t;\n}();\n\n/**\n * Oldest acceptable age in milliseconds for client metadata before the client\n * is considered inactive and its associated data is garbage collected.\n */\n/**\n * Helper to get a typed SimpleDbStore for the primary client object store.\n */\nfunction io(t) {\n return ro.Kn(t, Li.store);\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the client metadata object store.\n */ function oo(t) {\n return ro.Kn(t, Wi.store);\n}\n\n/** Provides LRU functionality for IndexedDB persistence. */ var uo = /** @class */ function() {\n function t(t, e) {\n this.db = t, this.wo = new ni(this, e);\n }\n return t.prototype.Po = function(t) {\n var e = this.Ph(t);\n return this.db.Ih().ba(t).next((function(t) {\n return e.next((function(e) {\n return t + e;\n }));\n }));\n }, t.prototype.Ph = function(t) {\n var e = 0;\n return this.yo(t, (function(t) {\n e++;\n })).next((function() {\n return e;\n }));\n }, t.prototype.Ce = function(t, e) {\n return this.db.Ih().Ce(t, e);\n }, t.prototype.yo = function(t, e) {\n return this.gh(t, (function(t, n) {\n return e(n);\n }));\n }, t.prototype.Da = function(t, e, n) {\n return so(t, n);\n }, t.prototype.Na = function(t, e, n) {\n return so(t, n);\n }, t.prototype.po = function(t, e, n) {\n return this.db.Ih().po(t, e, n);\n }, t.prototype.Go = function(t, e) {\n return so(t, e);\n }, \n /**\n * Returns true if anything would prevent this document from being garbage\n * collected, given that the document in question is not present in any\n * targets and has a sequence number less than or equal to the upper bound for\n * the collection run.\n */\n t.prototype.Vh = function(t, e) {\n return function(t, e) {\n var n = !1;\n return Ei(t).os((function(r) {\n return gi(t, r, e).next((function(t) {\n return t && (n = !0), cr.resolve(!t);\n }));\n })).next((function() {\n return n;\n }));\n }(t, e);\n }, t.prototype.bo = function(t, e) {\n var n = this, r = this.db.mh().ra(), i = [], o = 0;\n return this.gh(t, (function(u, s) {\n if (s <= e) {\n var a = n.Vh(t, u).next((function(e) {\n if (!e) \n // Our size accounting requires us to read all documents before\n // removing them.\n return o++, r.Rr(t, u).next((function() {\n return r.Ar(u), to(t).delete([ 0, ri(u.path) ]);\n }));\n }));\n i.push(a);\n }\n })).next((function() {\n return cr.kn(i);\n })).next((function() {\n return r.apply(t);\n })).next((function() {\n return o;\n }));\n }, t.prototype.removeTarget = function(t, e) {\n var n = e.st(t.Fa);\n return this.db.Ih().Va(t, n);\n }, t.prototype.yh = function(t, e) {\n return so(t, e);\n }, \n /**\n * Call provided function for each document in the cache that is 'orphaned'. Orphaned\n * means not a part of any target, so the only entry in the target-document index for\n * that document will be the sentinel row (targetId 0), which will also have the sequence\n * number for the last time the document was accessed.\n */\n t.prototype.gh = function(t, e) {\n var n, r = to(t), i = Lr.ai;\n return r.rs({\n index: Gi.documentTargetsIndex\n }, (function(t, r) {\n var o = t[0], u = (t[1], r.path), s = r.sequenceNumber;\n 0 === o ? (\n // if nextToReport is valid, report it, this is a new key so the\n // last one must not be a member of any targets.\n i !== Lr.ai && e(new Z(ui(n)), i), \n // set nextToReport to be this sequence number. It's the next one we\n // might report, if we don't find any targets for this document.\n // Note that the sequence number must be defined when the targetId\n // is 0.\n i = s, n = u) : \n // set nextToReport to be invalid, we know we don't need to report\n // this one since we found a target for it.\n i = Lr.ai;\n })).next((function() {\n // Since we report sequence numbers after getting to the next key, we\n // need to check if the last key we iterated over was an orphaned\n // document and report it.\n i !== Lr.ai && e(new Z(ui(n)), i);\n }));\n }, t.prototype.So = function(t) {\n return this.db.mh().aa(t);\n }, t;\n}();\n\nfunction so(t, e) {\n return to(t).put(\n /**\n * @return A value suitable for writing a sentinel row in the target-document\n * store.\n */\n function(t, e) {\n return new Gi(0, ri(t.path), e);\n }(e, t.Fa));\n}\n\n/**\n * Generates a string used as a prefix when storing data in IndexedDB and\n * LocalStorage.\n */ function ao(t, e) {\n // Use two different prefix formats:\n // * firestore / persistenceKey / projectID . databaseID / ...\n // * firestore / persistenceKey / projectID / ...\n // projectIDs are DNS-compatible names and cannot contain dots\n // so there's no danger of collisions.\n var n = t.projectId;\n return t.I || (n += \".\" + t.database), \"firestore/\" + e + \"/\" + n + \"/\"\n /**\n * Implements `LocalStore` interface.\n *\n * Note: some field defined in this class might have public access level, but\n * the class is not exported so they are only accessible from this module.\n * This is useful to implement optional features (like bundles) in free\n * functions, such that they are tree-shakeable.\n */;\n}\n\nvar co = /** @class */ function() {\n function t(\n /** Manages our in-memory or durable persistence. */\n t, e, n) {\n this.persistence = t, this.ph = e, \n /**\n * Maps a targetID to data about its target.\n *\n * PORTING NOTE: We are using an immutable data structure on Web to make re-runs\n * of `applyRemoteEvent()` idempotent.\n */\n this.bh = new dt(L), \n /** Maps a target to its targetID. */\n // TODO(wuandy): Evaluate if TargetId can be part of Target.\n this.Sh = new W((function(t) {\n return ot(t);\n }), ut), \n /**\n * The read time of the last entry processed by `getNewDocumentChanges()`.\n *\n * PORTING NOTE: This is only used for multi-tab synchronization.\n */\n this.Dh = H.min(), this.Sr = t.Th(n), this.Ch = t.mh(), this.ja = t.Ih(), this.Nh = new Yr(this.Ch, this.Sr, this.persistence.Ah()), \n this.ph.xh(this.Nh);\n }\n return t.prototype.mo = function(t) {\n var e = this;\n return this.persistence.runTransaction(\"Collect garbage\", \"readwrite-primary\", (function(n) {\n return t.vo(n, e.bh);\n }));\n }, t;\n}();\n\n/**\n * Acknowledges the given batch.\n *\n * On the happy path when a batch is acknowledged, the local store will\n *\n * + remove the batch from the mutation queue;\n * + apply the changes to the remote document cache;\n * + recalculate the latency compensated view implied by those changes (there\n * may be mutations in the queue that affect the documents but haven't been\n * acknowledged yet); and\n * + give the changed documents back the sync engine\n *\n * @returns The resulting (modified) documents.\n */ function ho(t, e) {\n var n = k(t);\n return n.persistence.runTransaction(\"Acknowledge batch\", \"readwrite-primary\", (function(t) {\n var r = e.batch.keys(), i = n.Ch.ra({\n oa: !0\n });\n return function(t, e, n, r) {\n var i = n.batch, o = i.keys(), u = cr.resolve();\n return o.forEach((function(t) {\n u = u.next((function() {\n return r.Rr(e, t);\n })).next((function(e) {\n var o = e, u = n.dr.get(t);\n x(null !== u), (!o || o.version.h(u) < 0) && ((o = i.hr(t, o, n)) && \n // We use the commitVersion as the readTime rather than the\n // document's updateTime since the updateTime is not advanced\n // for updates that do not modify the underlying document.\n r.Ir(o, n._r));\n }));\n })), u.next((function() {\n return t.Sr.Qo(e, i);\n }));\n }(n, t, e, i).next((function() {\n return i.apply(t);\n })).next((function() {\n return n.Sr.zo(t);\n })).next((function() {\n return n.Nh.Or(t, r);\n }));\n }));\n}\n\n/**\n * Removes mutations from the MutationQueue for the specified batch;\n * LocalDocuments will be recalculated.\n *\n * @returns The resulting modified documents.\n */\n/**\n * Returns the last consistent snapshot processed (used by the RemoteStore to\n * determine whether to buffer incoming snapshots from the backend).\n */ function fo(t) {\n var e = k(t);\n return e.persistence.runTransaction(\"Get last remote snapshot version\", \"readonly\", (function(t) {\n return e.ja.Ia(t);\n }));\n}\n\n/**\n * Updates the \"ground-state\" (remote) documents. We assume that the remote\n * event reflects any write batches that have been acknowledged or rejected\n * (i.e. we do not re-apply local mutations to updates from this event).\n *\n * LocalDocuments are re-calculated if there are remaining mutations in the\n * queue.\n */ function lo(t, e) {\n var n = k(t), r = e.nt, i = n.bh;\n return n.persistence.runTransaction(\"Apply remote event\", \"readwrite-primary\", (function(t) {\n var o = n.Ch.ra({\n oa: !0\n });\n // Reset newTargetDataByTargetMap in case this transaction gets re-run.\n i = n.bh;\n var u = [];\n e.zt.forEach((function(e, o) {\n var s = i.get(o);\n if (s) {\n // Only update the remote keys if the target is still active. This\n // ensures that we can persist the updated target data along with\n // the updated assignment.\n u.push(n.ja.Ca(t, e.se, o).next((function() {\n return n.ja.Sa(t, e.ee, o);\n })));\n var a = e.resumeToken;\n // Update the resume token if the change includes one.\n if (a.o() > 0) {\n var c = s.it(a, r).st(t.Fa);\n i = i.ot(o, c), \n // Update the target data if there are target changes (or if\n // sufficient time has passed since the last update).\n /**\n * Returns true if the newTargetData should be persisted during an update of\n * an active target. TargetData should always be persisted when a target is\n * being released and should not call this function.\n *\n * While the target is active, TargetData updates can be omitted when nothing\n * about the target has changed except metadata like the resume token or\n * snapshot version. Occasionally it's worth the extra write to prevent these\n * values from getting too stale after a crash, but this doesn't have to be\n * too frequent.\n */\n function(t, e, n) {\n // Always persist target data if we don't already have a resume token.\n return x(e.resumeToken.o() > 0), 0 === t.resumeToken.o() || (\n // Don't allow resume token changes to be buffered indefinitely. This\n // allows us to be reasonably up-to-date after a crash and avoids needing\n // to loop over all active queries on shutdown. Especially in the browser\n // we may not get time to do anything interesting while the current tab is\n // closing.\n e.nt.p() - t.nt.p() >= 3e8 || n.ee.size + n.ne.size + n.se.size > 0);\n }(s, c, e) && u.push(n.ja.Va(t, c));\n }\n }\n }));\n var s = bt(), a = At();\n // HACK: The only reason we allow a null snapshot version is so that we\n // can synthesize remote events when we get permission denied errors while\n // trying to resolve the state of a locally cached document that is in\n // limbo.\n if (e.Jt.forEach((function(t, e) {\n a = a.add(t);\n })), \n // Each loop iteration only affects its \"own\" doc, so it's safe to get all the remote\n // documents in advance in a single call.\n u.push(o.getEntries(t, a).next((function(i) {\n e.Jt.forEach((function(a, c) {\n var h = i.get(a);\n // Note: The order of the steps below is important, since we want\n // to ensure that rejected limbo resolutions (which fabricate\n // NoDocuments with SnapshotVersion.min()) never add documents to\n // cache.\n c instanceof Nn && c.version.isEqual(H.min()) ? (\n // NoDocuments with SnapshotVersion.min() are used in manufactured\n // events. We remove these documents from cache since we lost\n // access.\n o.Ar(a, r), s = s.ot(a, c)) : null == h || c.version.h(h.version) > 0 || 0 === c.version.h(h.version) && h.hasPendingWrites ? (o.Ir(c, r), \n s = s.ot(a, c)) : T(\"LocalStore\", \"Ignoring outdated watch update for \", a, \". Current version:\", h.version, \" Watch version:\", c.version), \n e.Yt.has(a) && u.push(n.persistence.No.yh(t, a));\n }));\n }))), !r.isEqual(H.min())) {\n var c = n.ja.Ia(t).next((function(e) {\n return n.ja.Aa(t, t.Fa, r);\n }));\n u.push(c);\n }\n return cr.kn(u).next((function() {\n return o.apply(t);\n })).next((function() {\n return n.Nh.Mr(t, s);\n }));\n })).then((function(t) {\n return n.bh = i, t;\n }));\n}\n\n/**\n * Gets the mutation batch after the passed in batchId in the mutation queue\n * or null if empty.\n * @param afterBatchId If provided, the batch to search after.\n * @returns The next mutation or null if there wasn't one.\n */ function po(t, e) {\n var n = k(t);\n return n.persistence.runTransaction(\"Get next mutation batch\", \"readonly\", (function(t) {\n return void 0 === e && (e = -1), n.Sr.Bo(t, e);\n }));\n}\n\n/**\n * Reads the current value of a Document with a given key or null if not\n * found - used for testing.\n */\n/**\n * Assigns the given target an internal ID so that its results can be pinned so\n * they don't get GC'd. A target must be allocated in the local store before\n * the store can be used to manage its view.\n *\n * Allocating an already allocated `Target` will return the existing `TargetData`\n * for that `Target`.\n */ function vo(t, e) {\n var n = k(t);\n return n.persistence.runTransaction(\"Allocate target\", \"readwrite\", (function(t) {\n var r;\n return n.ja.va(t, e).next((function(i) {\n return i ? (\n // This target has been listened to previously, so reuse the\n // previous targetID.\n // TODO(mcg): freshen last accessed date?\n r = i, cr.resolve(r)) : n.ja.wa(t).next((function(i) {\n return r = new ht(e, i, 0 /* Listen */ , t.Fa), n.ja.Ra(t, r).next((function() {\n return r;\n }));\n }));\n }));\n })).then((function(t) {\n // If Multi-Tab is enabled, the existing target data may be newer than\n // the in-memory data\n var r = n.bh.get(t.targetId);\n return (null === r || t.nt.h(r.nt) > 0) && (n.bh = n.bh.ot(t.targetId, t), n.Sh.set(e, t.targetId)), \n t;\n }));\n}\n\n/**\n * Returns the TargetData as seen by the LocalStore, including updates that may\n * have not yet been persisted to the TargetCache.\n */\n// Visible for testing.\n/**\n * Unpins all the documents associated with the given target. If\n * `keepPersistedTargetData` is set to false and Eager GC enabled, the method\n * directly removes the associated target data from the target cache.\n *\n * Releasing a non-existing `Target` is a no-op.\n */\n// PORTING NOTE: `keepPersistedTargetData` is multi-tab only.\nfunction yo(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var e, o, u, s;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = k(t), o = e.bh.get(r), u = i ? \"readwrite\" : \"readwrite-primary\", n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 4, , 5 ]), i ? [ 3 /*break*/ , 3 ] : [ 4 /*yield*/ , e.persistence.runTransaction(\"Release target\", u, (function(t) {\n return e.persistence.No.removeTarget(t, o);\n })) ];\n\n case 2:\n n.sent(), n.label = 3;\n\n case 3:\n return [ 3 /*break*/ , 5 ];\n\n case 4:\n if (!pr(s = n.sent())) throw s;\n // All `releaseTarget` does is record the final metadata state for the\n // target, but we've been recording this periodically during target\n // activity. If we lose this write this could cause a very slight\n // difference in the order of target deletion during GC, but we\n // don't define exact LRU semantics so this is acceptable.\n return T(\"LocalStore\", \"Failed to update sequence numbers for target \" + r + \": \" + s), \n [ 3 /*break*/ , 5 ];\n\n case 5:\n return e.bh = e.bh.remove(r), e.Sh.delete(o.target), [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * Runs the specified query against the local store and returns the results,\n * potentially taking advantage of query data from previous executions (such\n * as the set of remote keys).\n *\n * @param usePreviousResults Whether results from previous executions can\n * be used to optimize this query execution.\n */ function mo(t, e, n) {\n var r = k(t), i = H.min(), o = At();\n return r.persistence.runTransaction(\"Execute query\", \"readonly\", (function(t) {\n return function(t, e, n) {\n var r = k(t), i = r.Sh.get(n);\n return void 0 !== i ? cr.resolve(r.bh.get(i)) : r.ja.va(e, n);\n }(r, t, Cn(e)).next((function(e) {\n if (e) return i = e.lastLimboFreeSnapshotVersion, r.ja.xa(t, e.targetId).next((function(t) {\n o = t;\n }));\n })).next((function() {\n return r.ph.Lr(t, e, n ? i : H.min(), n ? o : At());\n })).next((function(t) {\n return {\n documents: t,\n Fh: o\n };\n }));\n }));\n}\n\n// PORTING NOTE: Multi-Tab only.\nfunction go(t, e) {\n var n = k(t), r = k(n.ja), i = n.bh.get(e);\n return i ? Promise.resolve(i.target) : n.persistence.runTransaction(\"Get target data\", \"readonly\", (function(t) {\n return r.Ue(t, e).next((function(t) {\n return t ? t.target : null;\n }));\n }));\n}\n\n/**\n * Returns the set of documents that have been updated since the last call.\n * If this is the first call, returns the set of changes since client\n * initialization. Further invocations will return document that have changed\n * since the prior call.\n */\n// PORTING NOTE: Multi-Tab only.\nfunction wo(t) {\n var e = k(t);\n return e.persistence.runTransaction(\"Get new document changes\", \"readonly\", (function(t) {\n return function(t, e, n) {\n var r = k(t), i = bt(), o = hi(n), u = Ai(e), s = IDBKeyRange.lowerBound(o, !0);\n return u.rs({\n index: qi.readTimeIndex,\n range: s\n }, (function(t, e) {\n // Unlike `getEntry()` and others, `getNewDocumentChanges()` parses\n // the documents directly since we want to keep sentinel deletes.\n var n = ai(r.serializer, e);\n i = i.ot(n.key, n), o = e.readTime;\n })).next((function() {\n return {\n kh: i,\n readTime: fi(o)\n };\n }));\n }(e.Ch, t, e.Dh);\n })).then((function(t) {\n var n = t.kh, r = t.readTime;\n return e.Dh = r, n;\n }));\n}\n\n/**\n * Reads the newest document change from persistence and moves the internal\n * synchronization marker forward so that calls to `getNewDocumentChanges()`\n * only return changes that happened after client initialization.\n */\n// PORTING NOTE: Multi-Tab only.\nfunction bo(t) {\n return e(this, void 0, void 0, (function() {\n var e;\n return n(this, (function(n) {\n return [ 2 /*return*/ , (e = k(t)).persistence.runTransaction(\"Synchronize last document change read time\", \"readonly\", (function(t) {\n return function(t) {\n var e = Ai(t), n = H.min();\n // If there are no existing entries, we return SnapshotVersion.min().\n return e.rs({\n index: qi.readTimeIndex,\n reverse: !0\n }, (function(t, e, r) {\n e.readTime && (n = fi(e.readTime)), r.done();\n })).next((function() {\n return n;\n }));\n }(t);\n })).then((function(t) {\n e.Dh = t;\n })) ];\n }));\n }));\n}\n\n/**\n * Verifies the error thrown by a LocalStore operation. If a LocalStore\n * operation fails because the primary lease has been taken by another client,\n * we ignore the error (the persistence layer will immediately call\n * `applyPrimaryLease` to propagate the primary state change). All other errors\n * are re-thrown.\n *\n * @param err An error returned by a LocalStore operation.\n * @return A Promise that resolves after we recovered, or the original error.\n */ function Io(t) {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(e) {\n if (t.code !== b.FAILED_PRECONDITION || t.message !== Qr) throw t;\n return T(\"LocalStore\", \"Unexpectedly lost primary lease\"), [ 2 /*return*/ ];\n }));\n }));\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A collection of references to a document from some kind of numbered entity\n * (either a target ID or batch ID). As references are added to or removed from\n * the set corresponding events are emitted to a registered garbage collector.\n *\n * Each reference is represented by a DocumentReference object. Each of them\n * contains enough information to uniquely identify the reference. They are all\n * stored primarily in a set sorted by key. A document is considered garbage if\n * there's no references in that set (this can be efficiently checked thanks to\n * sorting by key).\n *\n * ReferenceSet also keeps a secondary set that contains references sorted by\n * IDs. This one is used to efficiently implement removal of all references by\n * some target ID.\n */ var Eo = /** @class */ function() {\n function t() {\n // A set of outstanding references to a document sorted by key.\n this.Oh = new mt(_o.Mh), \n // A set of outstanding references to a document sorted by target id.\n this.$h = new mt(_o.Lh)\n /** Returns true if the reference set contains no references. */;\n }\n return t.prototype.P = function() {\n return this.Oh.P();\n }, \n /** Adds a reference to the given document key for the given ID. */ t.prototype.Da = function(t, e) {\n var n = new _o(t, e);\n this.Oh = this.Oh.add(n), this.$h = this.$h.add(n);\n }, \n /** Add references to the given document keys for the given ID. */ t.prototype.Bh = function(t, e) {\n var n = this;\n t.forEach((function(t) {\n return n.Da(t, e);\n }));\n }, \n /**\n * Removes a reference to the given document key for the given\n * ID.\n */\n t.prototype.Na = function(t, e) {\n this.qh(new _o(t, e));\n }, t.prototype.Uh = function(t, e) {\n var n = this;\n t.forEach((function(t) {\n return n.Na(t, e);\n }));\n }, \n /**\n * Clears all references with a given ID. Calls removeRef() for each key\n * removed.\n */\n t.prototype.Kh = function(t) {\n var e = this, n = new Z(new X([])), r = new _o(n, t), i = new _o(n, t + 1), o = [];\n return this.$h.xt([ r, i ], (function(t) {\n e.qh(t), o.push(t.key);\n })), o;\n }, t.prototype.Qh = function() {\n var t = this;\n this.Oh.forEach((function(e) {\n return t.qh(e);\n }));\n }, t.prototype.qh = function(t) {\n this.Oh = this.Oh.delete(t), this.$h = this.$h.delete(t);\n }, t.prototype.Wh = function(t) {\n var e = new Z(new X([])), n = new _o(e, t), r = new _o(e, t + 1), i = At();\n return this.$h.xt([ n, r ], (function(t) {\n i = i.add(t.key);\n })), i;\n }, t.prototype.Ho = function(t) {\n var e = new _o(t, 0), n = this.Oh.kt(e);\n return null !== n && t.isEqual(n.key);\n }, t;\n}(), _o = /** @class */ function() {\n function t(t, e) {\n this.key = t, this.jh = e\n /** Compare by key then by ID */;\n }\n return t.Mh = function(t, e) {\n return Z.D(t.key, e.key) || L(t.jh, e.jh);\n }, \n /** Compare by ID then by key */ t.Lh = function(t, e) {\n return L(t.jh, e.jh) || Z.D(t.key, e.key);\n }, t;\n}(), To = function(t, e) {\n this.user = e, this.type = \"OAuth\", this.Gh = {}, \n // Set the headers using Object Literal notation to avoid minification\n this.Gh.Authorization = \"Bearer \" + t;\n}, No = /** @class */ function() {\n function t() {\n /**\n * Stores the listener registered with setChangeListener()\n * This isn't actually necessary since the UID never changes, but we use this\n * to verify the listen contract is adhered to in tests.\n */\n this.zh = null;\n }\n return t.prototype.getToken = function() {\n return Promise.resolve(null);\n }, t.prototype.Hh = function() {}, t.prototype.Jh = function(t) {\n this.zh = t, \n // Fire with initial user.\n t(Or.UNAUTHENTICATED);\n }, t.prototype.Yh = function() {\n this.zh = null;\n }, t;\n}(), Ao = /** @class */ function() {\n function t(t) {\n var e = this;\n /**\n * The auth token listener registered with FirebaseApp, retained here so we\n * can unregister it.\n */ this.Xh = null, \n /** Tracks the current User. */\n this.currentUser = Or.UNAUTHENTICATED, this.Zh = !1, \n /**\n * Counter used to detect if the token changed while a getToken request was\n * outstanding.\n */\n this.tc = 0, \n /** The listener registered with setChangeListener(). */\n this.zh = null, this.forceRefresh = !1, this.Xh = function() {\n e.tc++, e.currentUser = e.ec(), e.Zh = !0, e.zh && e.zh(e.currentUser);\n }, this.tc = 0, this.auth = t.getImmediate({\n optional: !0\n }), this.auth ? this.auth.addAuthTokenListener(this.Xh) : (\n // if auth is not available, invoke tokenListener once with null token\n this.Xh(null), t.get().then((function(t) {\n e.auth = t, e.Xh && \n // tokenListener can be removed by removeChangeListener()\n e.auth.addAuthTokenListener(e.Xh);\n }), (function() {})));\n }\n return t.prototype.getToken = function() {\n var t = this, e = this.tc, n = this.forceRefresh;\n // Take note of the current value of the tokenCounter so that this method\n // can fail (with an ABORTED error) if there is a token change while the\n // request is outstanding.\n return this.forceRefresh = !1, this.auth ? this.auth.getToken(n).then((function(n) {\n // Cancel the request since the token changed while the request was\n // outstanding so the response is potentially for a previous user (which\n // user, we can't be sure).\n return t.tc !== e ? (T(\"FirebaseCredentialsProvider\", \"getToken aborted due to token change.\"), \n t.getToken()) : n ? (x(\"string\" == typeof n.accessToken), new To(n.accessToken, t.currentUser)) : null;\n })) : Promise.resolve(null);\n }, t.prototype.Hh = function() {\n this.forceRefresh = !0;\n }, t.prototype.Jh = function(t) {\n this.zh = t, \n // Fire the initial event\n this.Zh && t(this.currentUser);\n }, t.prototype.Yh = function() {\n this.auth && this.auth.removeAuthTokenListener(this.Xh), this.Xh = null, this.zh = null;\n }, \n // Auth.getUid() can return null even with a user logged in. It is because\n // getUid() is synchronous, but the auth code populating Uid is asynchronous.\n // This method should only be called in the AuthTokenListener callback\n // to guarantee to get the actual user.\n t.prototype.ec = function() {\n var t = this.auth && this.auth.getUid();\n return x(null === t || \"string\" == typeof t), new Or(t);\n }, t;\n}(), Do = /** @class */ function() {\n function t(t, e) {\n this.nc = t, this.sc = e, this.type = \"FirstParty\", this.user = Or.ni;\n }\n return Object.defineProperty(t.prototype, \"Gh\", {\n get: function() {\n var t = {\n \"X-Goog-AuthUser\": this.sc\n }, e = this.nc.auth.getAuthHeaderValueForFirstParty([]);\n // Use array notation to prevent minification\n return e && (t.Authorization = e), t;\n },\n enumerable: !1,\n configurable: !0\n }), t;\n}(), So = /** @class */ function() {\n function t(t, e) {\n this.nc = t, this.sc = e;\n }\n return t.prototype.getToken = function() {\n return Promise.resolve(new Do(this.nc, this.sc));\n }, t.prototype.Jh = function(t) {\n // Fire with initial uid.\n t(Or.ni);\n }, t.prototype.Yh = function() {}, t.prototype.Hh = function() {}, t;\n}(), xo = /** @class */ function() {\n function t(t, e, n, r, i, o) {\n this.fn = t, this.ic = n, this.rc = r, this.oc = i, this.listener = o, this.state = 0 /* Initial */ , \n /**\n * A close count that's incremented every time the stream is closed; used by\n * getCloseGuardedDispatcher() to invalidate callbacks that happen after\n * close.\n */\n this.ac = 0, this.hc = null, this.stream = null, this.Vs = new ar(t, e)\n /**\n * Returns true if start() has been called and no error has occurred. True\n * indicates the stream is open or in the process of opening (which\n * encompasses respecting backoff, getting auth tokens, and starting the\n * actual RPC). Use isOpen() to determine if the stream is open and ready for\n * outbound requests.\n */;\n }\n return t.prototype.cc = function() {\n return 1 /* Starting */ === this.state || 2 /* Open */ === this.state || 4 /* Backoff */ === this.state;\n }, \n /**\n * Returns true if the underlying RPC is open (the onOpen() listener has been\n * called) and the stream is ready for outbound requests.\n */\n t.prototype.uc = function() {\n return 2 /* Open */ === this.state;\n }, \n /**\n * Starts the RPC. Only allowed if isStarted() returns false. The stream is\n * not immediately ready for use: onOpen() will be invoked when the RPC is\n * ready for outbound requests, at which point isOpen() will return true.\n *\n * When start returns, isStarted() will return true.\n */\n t.prototype.start = function() {\n 3 /* Error */ !== this.state ? this.auth() : this.lc();\n }, \n /**\n * Stops the RPC. This call is idempotent and allowed regardless of the\n * current isStarted() state.\n *\n * When stop returns, isStarted() and isOpen() will both return false.\n */\n t.prototype.stop = function() {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(t) {\n switch (t.label) {\n case 0:\n return this.cc() ? [ 4 /*yield*/ , this.close(0 /* Initial */) ] : [ 3 /*break*/ , 2 ];\n\n case 1:\n t.sent(), t.label = 2;\n\n case 2:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }, \n /**\n * After an error the stream will usually back off on the next attempt to\n * start it. If the error warrants an immediate restart of the stream, the\n * sender can use this to indicate that the receiver should not back off.\n *\n * Each error will call the onClose() listener. That function can decide to\n * inhibit backoff if required.\n */\n t.prototype._c = function() {\n this.state = 0 /* Initial */ , this.Vs.reset();\n }, \n /**\n * Marks this stream as idle. If no further actions are performed on the\n * stream for one minute, the stream will automatically close itself and\n * notify the stream's onClose() handler with Status.OK. The stream will then\n * be in a !isStarted() state, requiring the caller to start the stream again\n * before further use.\n *\n * Only streams that are in state 'Open' can be marked idle, as all other\n * states imply pending network operations.\n */\n t.prototype.fc = function() {\n var t = this;\n // Starts the idle time if we are in state 'Open' and are not yet already\n // running a timer (in which case the previous idle timeout still applies).\n this.uc() && null === this.hc && (this.hc = this.fn.Vn(this.ic, 6e4, (function() {\n return t.dc();\n })));\n }, \n /** Sends a message to the underlying stream. */ t.prototype.wc = function(t) {\n this.Ec(), this.stream.send(t);\n }, \n /** Called by the idle timer when the stream should close due to inactivity. */ t.prototype.dc = function() {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(t) {\n return this.uc() ? [ 2 /*return*/ , this.close(0 /* Initial */) ] : [ 2 /*return*/ ];\n }));\n }));\n }, \n /** Marks the stream as active again. */ t.prototype.Ec = function() {\n this.hc && (this.hc.cancel(), this.hc = null);\n }, \n /**\n * Closes the stream and cleans up as necessary:\n *\n * * closes the underlying GRPC stream;\n * * calls the onClose handler with the given 'error';\n * * sets internal stream state to 'finalState';\n * * adjusts the backoff timer based on the error\n *\n * A new stream can be opened by calling start().\n *\n * @param finalState the intended state of the stream after closing.\n * @param error the error the connection was closed with.\n */\n t.prototype.close = function(t, r) {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n // Notify the listener that the stream closed.\n // Cancel any outstanding timers (they're guaranteed not to execute).\n return this.Ec(), this.Vs.cancel(), \n // Invalidates any stream-related callbacks (e.g. from auth or the\n // underlying stream), guaranteeing they won't execute.\n this.ac++, 3 /* Error */ !== t ? \n // If this is an intentional close ensure we don't delay our next connection attempt.\n this.Vs.reset() : r && r.code === b.RESOURCE_EXHAUSTED ? (\n // Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)\n N(r.toString()), N(\"Using maximum backoff delay to prevent overloading the backend.\"), \n this.Vs.Rn()) : r && r.code === b.UNAUTHENTICATED && \n // \"unauthenticated\" error means the token was rejected. Try force refreshing it in case it\n // just expired.\n this.oc.Hh(), \n // Clean up the underlying stream because we are no longer interested in events.\n null !== this.stream && (this.Tc(), this.stream.close(), this.stream = null), \n // This state must be assigned before calling onClose() to allow the callback to\n // inhibit backoff or otherwise manipulate the state in its non-started state.\n this.state = t, [ 4 /*yield*/ , this.listener.Ic(r) ];\n\n case 1:\n // Cancel any outstanding timers (they're guaranteed not to execute).\n // Notify the listener that the stream closed.\n return e.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }, \n /**\n * Can be overridden to perform additional cleanup before the stream is closed.\n * Calling super.tearDown() is not required.\n */\n t.prototype.Tc = function() {}, t.prototype.auth = function() {\n var t = this;\n this.state = 1 /* Starting */;\n var e = this.mc(this.ac), n = this.ac;\n // TODO(mikelehen): Just use dispatchIfNotClosed, but see TODO below.\n this.oc.getToken().then((function(e) {\n // Stream can be stopped while waiting for authentication.\n // TODO(mikelehen): We really should just use dispatchIfNotClosed\n // and let this dispatch onto the queue, but that opened a spec test can\n // of worms that I don't want to deal with in this PR.\n t.ac === n && \n // Normally we'd have to schedule the callback on the AsyncQueue.\n // However, the following calls are safe to be called outside the\n // AsyncQueue since they don't chain asynchronous calls\n t.Ac(e);\n }), (function(n) {\n e((function() {\n var e = new I(b.UNKNOWN, \"Fetching auth token failed: \" + n.message);\n return t.Rc(e);\n }));\n }));\n }, t.prototype.Ac = function(t) {\n var e = this, n = this.mc(this.ac);\n this.stream = this.Pc(t), this.stream.gc((function() {\n n((function() {\n return e.state = 2 /* Open */ , e.listener.gc();\n }));\n })), this.stream.Ic((function(t) {\n n((function() {\n return e.Rc(t);\n }));\n })), this.stream.onMessage((function(t) {\n n((function() {\n return e.onMessage(t);\n }));\n }));\n }, t.prototype.lc = function() {\n var t = this;\n this.state = 4 /* Backoff */ , this.Vs.Pn((function() {\n return e(t, void 0, void 0, (function() {\n return n(this, (function(t) {\n return this.state = 0 /* Initial */ , this.start(), [ 2 /*return*/ ];\n }));\n }));\n }));\n }, \n // Visible for tests\n t.prototype.Rc = function(t) {\n // In theory the stream could close cleanly, however, in our current model\n // we never expect this to happen because if we stop a stream ourselves,\n // this callback will never be called. To prevent cases where we retry\n // without a backoff accidentally, we set the stream to error in all cases.\n return T(\"PersistentStream\", \"close with error: \" + t), this.stream = null, this.close(3 /* Error */ , t);\n }, \n /**\n * Returns a \"dispatcher\" function that dispatches operations onto the\n * AsyncQueue but only runs them if closeCount remains unchanged. This allows\n * us to turn auth / stream callbacks into no-ops if the stream is closed /\n * re-opened, etc.\n */\n t.prototype.mc = function(t) {\n var e = this;\n return function(n) {\n e.fn.ws((function() {\n return e.ac === t ? n() : (T(\"PersistentStream\", \"stream callback skipped by getCloseGuardedDispatcher.\"), \n Promise.resolve());\n }));\n };\n }, t;\n}(), ko = /** @class */ function(e) {\n function n(t, n, r, i, o) {\n var u = this;\n return (u = e.call(this, t, \"listen_stream_connection_backoff\" /* ListenStreamConnectionBackoff */ , \"listen_stream_idle\" /* ListenStreamIdle */ , n, r, o) || this).serializer = i, \n u;\n }\n return t(n, e), n.prototype.Pc = function(t) {\n return this.rc.Vc(\"Listen\", t);\n }, n.prototype.onMessage = function(t) {\n // A successful response means the stream is healthy\n this.Vs.reset();\n var e = function(t, e) {\n var n;\n if (\"targetChange\" in e) {\n e.targetChange;\n // proto3 default value is unset in JSON (undefined), so use 'NO_CHANGE'\n // if unset\n var r = function(t) {\n return \"NO_CHANGE\" === t ? 0 /* NoChange */ : \"ADD\" === t ? 1 /* Added */ : \"REMOVE\" === t ? 2 /* Removed */ : \"CURRENT\" === t ? 3 /* Current */ : \"RESET\" === t ? 4 /* Reset */ : S();\n }(e.targetChange.targetChangeType || \"NO_CHANGE\"), i = e.targetChange.targetIds || [], o = function(t, e) {\n return t.Ke ? (x(void 0 === e || \"string\" == typeof e), C.fromBase64String(e || \"\")) : (x(void 0 === e || e instanceof Uint8Array), \n C.fromUint8Array(e || new Uint8Array));\n }(t, e.targetChange.resumeToken), u = e.targetChange.cause, s = u && function(t) {\n var e = void 0 === t.code ? b.UNKNOWN : pt(t.code);\n return new I(e, t.message || \"\");\n }(u);\n n = new Ct(r, i, o, s || null);\n } else if (\"documentChange\" in e) {\n e.documentChange;\n var a = e.documentChange;\n a.document, a.document.name, a.document.updateTime;\n var c = be(t, a.document.name), h = ye(a.document.updateTime), f = new bn({\n mapValue: {\n fields: a.document.fields\n }\n }), l = new Tn(c, h, f, {}), p = a.targetIds || [], d = a.removedTargetIds || [];\n n = new Vt(p, d, l.key, l);\n } else if (\"documentDelete\" in e) {\n e.documentDelete;\n var v = e.documentDelete;\n v.document;\n var y = be(t, v.document), m = v.readTime ? ye(v.readTime) : H.min(), g = new Nn(y, m), w = v.removedTargetIds || [];\n n = new Vt([], w, g.key, g);\n } else if (\"documentRemove\" in e) {\n e.documentRemove;\n var E = e.documentRemove;\n E.document;\n var _ = be(t, E.document), T = E.removedTargetIds || [];\n n = new Vt([], T, _, null);\n } else {\n if (!(\"filter\" in e)) return S();\n e.filter;\n var N = e.filter;\n N.targetId;\n var A = N.count || 0, D = new ft(A), k = N.targetId;\n n = new Rt(k, D);\n }\n return n;\n }(this.serializer, t), n = function(t) {\n // We have only reached a consistent snapshot for the entire stream if there\n // is a read_time set and it applies to all targets (i.e. the list of\n // targets is empty). The backend is guaranteed to send such responses.\n if (!(\"targetChange\" in t)) return H.min();\n var e = t.targetChange;\n return e.targetIds && e.targetIds.length ? H.min() : e.readTime ? ye(e.readTime) : H.min();\n }(t);\n return this.listener.yc(e, n);\n }, \n /**\n * Registers interest in the results of the given target. If the target\n * includes a resumeToken it will be included in the request. Results that\n * affect the target will be streamed back as WatchChange messages that\n * reference the targetId.\n */\n n.prototype.bc = function(t) {\n var e = {};\n e.database = _e(this.serializer), e.addTarget = function(t, e) {\n var n, r = e.target;\n return (n = st(r) ? {\n documents: Se(t, r)\n } : {\n query: xe(t, r)\n }).targetId = e.targetId, e.resumeToken.o() > 0 && (n.resumeToken = de(t, e.resumeToken)), \n n;\n }(this.serializer, t);\n var n = function(t, e) {\n var n = function(t, e) {\n switch (e) {\n case 0 /* Listen */ :\n return null;\n\n case 1 /* ExistenceFilterMismatch */ :\n return \"existence-filter-mismatch\";\n\n case 2 /* LimboResolution */ :\n return \"limbo-document\";\n\n default:\n return S();\n }\n }(0, e.et);\n return null == n ? null : {\n \"goog-listen-tags\": n\n };\n }(this.serializer, t);\n n && (e.labels = n), this.wc(e);\n }, \n /**\n * Unregisters interest in the results of the target associated with the\n * given targetId.\n */\n n.prototype.vc = function(t) {\n var e = {};\n e.database = _e(this.serializer), e.removeTarget = t, this.wc(e);\n }, n;\n}(xo), Po = /** @class */ function(e) {\n function n(t, n, r, i, o) {\n var u = this;\n return (u = e.call(this, t, \"write_stream_connection_backoff\" /* WriteStreamConnectionBackoff */ , \"write_stream_idle\" /* WriteStreamIdle */ , n, r, o) || this).serializer = i, \n u.Sc = !1, u;\n }\n return t(n, e), Object.defineProperty(n.prototype, \"Dc\", {\n /**\n * Tracks whether or not a handshake has been successfully exchanged and\n * the stream is ready to accept mutations.\n */\n get: function() {\n return this.Sc;\n },\n enumerable: !1,\n configurable: !0\n }), \n // Override of PersistentStream.start\n n.prototype.start = function() {\n this.Sc = !1, this.lastStreamToken = void 0, e.prototype.start.call(this);\n }, n.prototype.Tc = function() {\n this.Sc && this.Cc([]);\n }, n.prototype.Pc = function(t) {\n return this.rc.Vc(\"Write\", t);\n }, n.prototype.onMessage = function(t) {\n if (\n // Always capture the last stream token.\n x(!!t.streamToken), this.lastStreamToken = t.streamToken, this.Sc) {\n // A successful first write response means the stream is healthy,\n // Note, that we could consider a successful handshake healthy, however,\n // the write itself might be causing an error we want to back off from.\n this.Vs.reset();\n var e = function(t, e) {\n return t && t.length > 0 ? (x(void 0 !== e), t.map((function(t) {\n return function(t, e) {\n // NOTE: Deletes don't have an updateTime.\n var n = t.updateTime ? ye(t.updateTime) : ye(e);\n n.isEqual(H.min()) && (\n // The Firestore Emulator currently returns an update time of 0 for\n // deletes of non-existing documents (rather than null). This breaks the\n // test \"get deleted doc while offline with source=cache\" as NoDocuments\n // with version 0 are filtered by IndexedDb's RemoteDocumentCache.\n // TODO(#2149): Remove this when Emulator is fixed\n n = ye(e));\n var r = null;\n return t.transformResults && t.transformResults.length > 0 && (r = t.transformResults), \n new nn(n, r);\n }(t, e);\n }))) : [];\n }(t.writeResults, t.commitTime), n = ye(t.commitTime);\n return this.listener.Nc(n, e);\n }\n // The first response is always the handshake response\n return x(!t.writeResults || 0 === t.writeResults.length), this.Sc = !0, \n this.listener.xc();\n }, \n /**\n * Sends an initial streamToken to the server, performing the handshake\n * required to make the StreamingWrite RPC work. Subsequent\n * calls should wait until onHandshakeComplete was called.\n */\n n.prototype.Fc = function() {\n // TODO(dimond): Support stream resumption. We intentionally do not set the\n // stream token on the handshake, ignoring any stream token we might have.\n var t = {};\n t.database = _e(this.serializer), this.wc(t);\n }, \n /** Sends a group of mutations to the Firestore backend to apply. */ n.prototype.Cc = function(t) {\n var e = this, n = {\n streamToken: this.lastStreamToken,\n writes: t.map((function(t) {\n return Ae(e.serializer, t);\n }))\n };\n this.wc(n);\n }, n;\n}(xo), Oo = /** @class */ function(e) {\n function n(t, n, r) {\n var i = this;\n return (i = e.call(this) || this).credentials = t, i.rc = n, i.serializer = r, i.kc = !1, \n i;\n }\n return t(n, e), n.prototype.Oc = function() {\n if (this.kc) throw new I(b.FAILED_PRECONDITION, \"The client has already been terminated.\");\n }, \n /** Gets an auth token and invokes the provided RPC. */ n.prototype.Mc = function(t, e, n) {\n var r = this;\n return this.Oc(), this.credentials.getToken().then((function(i) {\n return r.rc.Mc(t, e, n, i);\n })).catch((function(t) {\n throw t.code === b.UNAUTHENTICATED && r.credentials.Hh(), t;\n }));\n }, \n /** Gets an auth token and invokes the provided RPC with streamed results. */ n.prototype.$c = function(t, e, n) {\n var r = this;\n return this.Oc(), this.credentials.getToken().then((function(i) {\n return r.rc.$c(t, e, n, i);\n })).catch((function(t) {\n throw t.code === b.UNAUTHENTICATED && r.credentials.Hh(), t;\n }));\n }, n.prototype.terminate = function() {\n this.kc = !1;\n }, n;\n}((function() {})), Lo = /** @class */ function() {\n function t(t, e) {\n this.hs = t, this.di = e, \n /** The current OnlineState. */\n this.state = \"Unknown\" /* Unknown */ , \n /**\n * A count of consecutive failures to open the stream. If it reaches the\n * maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to\n * Offline.\n */\n this.Lc = 0, \n /**\n * A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we\n * transition from OnlineState.Unknown to OnlineState.Offline without waiting\n * for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).\n */\n this.Bc = null, \n /**\n * Whether the client should log a warning message if it fails to connect to\n * the backend (initially true, cleared after a successful stream, or if we've\n * logged the message already).\n */\n this.qc = !0\n /**\n * Called by RemoteStore when a watch stream is started (including on each\n * backoff attempt).\n *\n * If this is the first attempt, it sets the OnlineState to Unknown and starts\n * the onlineStateTimer.\n */;\n }\n return t.prototype.Uc = function() {\n var t = this;\n 0 === this.Lc && (this.Kc(\"Unknown\" /* Unknown */), this.Bc = this.hs.Vn(\"online_state_timeout\" /* OnlineStateTimeout */ , 1e4, (function() {\n return t.Bc = null, t.Qc(\"Backend didn't respond within 10 seconds.\"), t.Kc(\"Offline\" /* Offline */), \n Promise.resolve();\n })));\n }, \n /**\n * Updates our OnlineState as appropriate after the watch stream reports a\n * failure. The first failure moves us to the 'Unknown' state. We then may\n * allow multiple failures (based on MAX_WATCH_STREAM_FAILURES) before we\n * actually transition to the 'Offline' state.\n */\n t.prototype.Wc = function(t) {\n \"Online\" /* Online */ === this.state ? this.Kc(\"Unknown\" /* Unknown */) : (this.Lc++, \n this.Lc >= 1 && (this.jc(), this.Qc(\"Connection failed 1 times. Most recent error: \" + t.toString()), \n this.Kc(\"Offline\" /* Offline */)));\n }, \n /**\n * Explicitly sets the OnlineState to the specified state.\n *\n * Note that this resets our timers / failure counters, etc. used by our\n * Offline heuristics, so must not be used in place of\n * handleWatchStreamStart() and handleWatchStreamFailure().\n */\n t.prototype.set = function(t) {\n this.jc(), this.Lc = 0, \"Online\" /* Online */ === t && (\n // We've connected to watch at least once. Don't warn the developer\n // about being offline going forward.\n this.qc = !1), this.Kc(t);\n }, t.prototype.Kc = function(t) {\n t !== this.state && (this.state = t, this.di(t));\n }, t.prototype.Qc = function(t) {\n var e = \"Could not reach Cloud Firestore backend. \" + t + \"\\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.\";\n this.qc ? (N(e), this.qc = !1) : T(\"OnlineStateTracker\", e);\n }, t.prototype.jc = function() {\n null !== this.Bc && (this.Bc.cancel(), this.Bc = null);\n }, t;\n}(), Vo = function(\n/**\n * The local store, used to fill the write pipeline with outbound mutations.\n */\nt, \n/** The client-side proxy for interacting with the backend. */\nr, i, o, u) {\n var s = this;\n this.Gc = t, this.zc = r, this.hs = i, this.Hc = {}, \n /**\n * A list of up to MAX_PENDING_WRITES writes that we have fetched from the\n * LocalStore via fillWritePipeline() and have or will send to the write\n * stream.\n *\n * Whenever writePipeline.length > 0 the RemoteStore will attempt to start or\n * restart the write stream. When the stream is established the writes in the\n * pipeline will be sent in order.\n *\n * Writes remain in writePipeline until they are acknowledged by the backend\n * and thus will automatically be re-sent if the stream is interrupted /\n * restarted before they're acknowledged.\n *\n * Write responses from the backend are linked to their originating request\n * purely based on order, and so we can just shift() writes from the front of\n * the writePipeline as we receive responses.\n */\n this.Jc = [], \n /**\n * A mapping of watched targets that the client cares about tracking and the\n * user has explicitly called a 'listen' for this target.\n *\n * These targets may or may not have been sent to or acknowledged by the\n * server. On re-establishing the listen stream, these targets should be sent\n * to the server. The targets removed with unlistens are removed eagerly\n * without waiting for confirmation from the listen stream.\n */\n this.Yc = new Map, \n /**\n * A set of reasons for why the RemoteStore may be offline. If empty, the\n * RemoteStore may start its network connections.\n */\n this.Xc = new Set, \n /**\n * Event handlers that get called when the network is disabled or enabled.\n *\n * PORTING NOTE: These functions are used on the Web client to create the\n * underlying streams (to support tree-shakeable streams). On Android and iOS,\n * the streams are created during construction of RemoteStore.\n */\n this.Zc = [], this.tu = u, this.tu.eu((function(t) {\n i.ws((function() {\n return e(s, void 0, void 0, (function() {\n return n(this, (function(t) {\n switch (t.label) {\n case 0:\n return zo(this) ? (T(\"RemoteStore\", \"Restarting streams for network reachability change.\"), \n [ 4 /*yield*/ , function(t) {\n return e(this, void 0, void 0, (function() {\n var e;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return (e = k(t)).Xc.add(4 /* ConnectivityChange */), [ 4 /*yield*/ , Co(e) ];\n\n case 1:\n return n.sent(), e.nu.set(\"Unknown\" /* Unknown */), e.Xc.delete(4 /* ConnectivityChange */), \n [ 4 /*yield*/ , Ro(e) ];\n\n case 2:\n return n.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }(this) ]) : [ 3 /*break*/ , 2 ];\n\n case 1:\n t.sent(), t.label = 2;\n\n case 2:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }));\n })), this.nu = new Lo(i, o);\n};\n\nfunction Ro(t) {\n return e(this, void 0, void 0, (function() {\n var e, r;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n if (!zo(t)) return [ 3 /*break*/ , 4 ];\n e = 0, r = t.Zc, n.label = 1;\n\n case 1:\n return e < r.length ? [ 4 /*yield*/ , (0, r[e])(/* enabled= */ !0) ] : [ 3 /*break*/ , 4 ];\n\n case 2:\n n.sent(), n.label = 3;\n\n case 3:\n return e++, [ 3 /*break*/ , 1 ];\n\n case 4:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * Temporarily disables the network. The network can be re-enabled using\n * enableNetwork().\n */ function Co(t) {\n return e(this, void 0, void 0, (function() {\n var e, r;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = 0, r = t.Zc, n.label = 1;\n\n case 1:\n return e < r.length ? [ 4 /*yield*/ , (0, r[e])(/* enabled= */ !1) ] : [ 3 /*break*/ , 4 ];\n\n case 2:\n n.sent(), n.label = 3;\n\n case 3:\n return e++, [ 3 /*break*/ , 1 ];\n\n case 4:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction Uo(t) {\n return e(this, void 0, void 0, (function() {\n var e;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e = k(t), T(\"RemoteStore\", \"RemoteStore shutting down.\"), e.Xc.add(5 /* Shutdown */), \n [ 4 /*yield*/ , Co(e) ];\n\n case 1:\n return n.sent(), e.tu.Di(), \n // Set the OnlineState to Unknown (rather than Offline) to avoid potentially\n // triggering spurious listener events with cached data, etc.\n e.nu.set(\"Unknown\" /* Unknown */), [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * Starts new listen for the given target. Uses resume token if provided. It\n * is a no-op if the target of given `TargetData` is already being listened to.\n */ function Mo(t, e) {\n var n = k(t);\n n.Yc.has(e.targetId) || (\n // Mark this as something the client is currently listening for.\n n.Yc.set(e.targetId, e), Bo(n) ? \n // The listen will be sent in onWatchStreamOpen\n Go(n) : ou(n).uc() && Fo(n, e));\n}\n\n/**\n * Removes the listen from server. It is a no-op if the given target id is\n * not being listened to.\n */ function qo(t, e) {\n var n = k(t), r = ou(n);\n n.Yc.delete(e), r.uc() && jo(n, e), 0 === n.Yc.size && (r.uc() ? r.fc() : zo(n) && \n // Revert to OnlineState.Unknown if the watch stream is not open and we\n // have no listeners, since without any listens to send we cannot\n // confirm if the stream is healthy and upgrade to OnlineState.Online.\n n.nu.set(\"Unknown\" /* Unknown */));\n}\n\n/**\n * We need to increment the the expected number of pending responses we're due\n * from watch so we wait for the ack to process any messages from this target.\n */ function Fo(t, e) {\n t.su.me(e.targetId), ou(t).bc(e)\n /**\n * We need to increment the expected number of pending responses we're due\n * from watch so we wait for the removal on the server before we process any\n * messages from this target.\n */;\n}\n\nfunction jo(t, e) {\n t.su.me(e), ou(t).vc(e);\n}\n\nfunction Go(t) {\n t.su = new Mt({\n qe: function(e) {\n return t.Hc.qe(e);\n },\n Ue: function(e) {\n return t.Yc.get(e) || null;\n }\n }), ou(t).start(), t.nu.Uc()\n /**\n * Returns whether the watch stream should be started because it's necessary\n * and has not yet been started.\n */;\n}\n\nfunction Bo(t) {\n return zo(t) && !ou(t).cc() && t.Yc.size > 0;\n}\n\nfunction zo(t) {\n return 0 === k(t).Xc.size;\n}\n\nfunction Ko(t) {\n t.su = void 0;\n}\n\nfunction Wo(t) {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(e) {\n return t.Yc.forEach((function(e, n) {\n Fo(t, e);\n })), [ 2 /*return*/ ];\n }));\n }));\n}\n\nfunction Qo(t, r) {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(e) {\n return Ko(t), \n // If we still need the watch stream, retry the connection.\n Bo(t) ? (t.nu.Wc(r), Go(t)) : \n // No need to restart watch stream because there are no active targets.\n // The online state is set to unknown because there is no active attempt\n // at establishing a connection\n t.nu.set(\"Unknown\" /* Unknown */), [ 2 /*return*/ ];\n }));\n }));\n}\n\nfunction Ho(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var o, u, s;\n return n(this, (function(a) {\n switch (a.label) {\n case 0:\n if (t.nu.set(\"Online\" /* Online */), !(r instanceof Ct && 2 /* Removed */ === r.state && r.cause)) \n // Mark the client as online since we got a message from the server\n return [ 3 /*break*/ , 6 ];\n a.label = 1;\n\n case 1:\n return a.trys.push([ 1, 3, , 5 ]), [ 4 /*yield*/ , \n /** Handles an error on a target */\n function(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = r.cause, i = 0, o = r.targetIds, n.label = 1;\n\n case 1:\n return i < o.length ? (u = o[i], t.Yc.has(u) ? [ 4 /*yield*/ , t.Hc.iu(u, e) ] : [ 3 /*break*/ , 3 ]) : [ 3 /*break*/ , 5 ];\n\n case 2:\n n.sent(), t.Yc.delete(u), t.su.removeTarget(u), n.label = 3;\n\n case 3:\n n.label = 4;\n\n case 4:\n return i++, [ 3 /*break*/ , 1 ];\n\n case 5:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }(t, r) ];\n\n case 2:\n return a.sent(), [ 3 /*break*/ , 5 ];\n\n case 3:\n return o = a.sent(), T(\"RemoteStore\", \"Failed to remove targets %s: %s \", r.targetIds.join(\",\"), o), \n [ 4 /*yield*/ , Yo(t, o) ];\n\n case 4:\n return a.sent(), [ 3 /*break*/ , 5 ];\n\n case 5:\n return [ 3 /*break*/ , 13 ];\n\n case 6:\n if (r instanceof Vt ? t.su.be(r) : r instanceof Rt ? t.su.ke(r) : t.su.De(r), i.isEqual(H.min())) return [ 3 /*break*/ , 13 ];\n a.label = 7;\n\n case 7:\n return a.trys.push([ 7, 11, , 13 ]), [ 4 /*yield*/ , fo(t.Gc) ];\n\n case 8:\n return u = a.sent(), i.h(u) >= 0 ? [ 4 /*yield*/ , \n /**\n * Takes a batch of changes from the Datastore, repackages them as a\n * RemoteEvent, and passes that on to the listener, which is typically the\n * SyncEngine.\n */\n function(t, e) {\n var n = t.su.$e(e);\n // Update in-memory resume tokens. LocalStore will update the\n // persistent view of these when applying the completed RemoteEvent.\n return n.zt.forEach((function(n, r) {\n if (n.resumeToken.o() > 0) {\n var i = t.Yc.get(r);\n // A watched target might have been removed already.\n i && t.Yc.set(r, i.it(n.resumeToken, e));\n }\n })), \n // Re-establish listens for the targets that have been invalidated by\n // existence filter mismatches.\n n.Ht.forEach((function(e) {\n var n = t.Yc.get(e);\n if (n) {\n // Clear the resume token for the target, since we're in a known mismatch\n // state.\n t.Yc.set(e, n.it(C.u, n.nt)), \n // Cause a hard reset by unwatching and rewatching immediately, but\n // deliberately don't send a resume token so that we get a full update.\n jo(t, e);\n // Mark the target we send as being on behalf of an existence filter\n // mismatch, but don't actually retain that in listenTargets. This ensures\n // that we flag the first re-listen this way without impacting future\n // listens of this target (that might happen e.g. on reconnect).\n var r = new ht(n.target, e, 1 /* ExistenceFilterMismatch */ , n.sequenceNumber);\n Fo(t, r);\n }\n })), t.Hc.ru(n);\n }(t, i) ] : [ 3 /*break*/ , 10 ];\n\n // We have received a target change with a global snapshot if the snapshot\n // version is not equal to SnapshotVersion.min().\n case 9:\n // We have received a target change with a global snapshot if the snapshot\n // version is not equal to SnapshotVersion.min().\n a.sent(), a.label = 10;\n\n case 10:\n return [ 3 /*break*/ , 13 ];\n\n case 11:\n return T(\"RemoteStore\", \"Failed to raise snapshot:\", s = a.sent()), [ 4 /*yield*/ , Yo(t, s) ];\n\n case 12:\n return a.sent(), [ 3 /*break*/ , 13 ];\n\n case 13:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * Recovery logic for IndexedDB errors that takes the network offline until\n * `op` succeeds. Retries are scheduled with backoff using\n * `enqueueRetryable()`. If `op()` is not provided, IndexedDB access is\n * validated via a generic operation.\n *\n * The returned Promise is resolved once the network is disabled and before\n * any retry attempt.\n */ function Yo(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var o = this;\n return n(this, (function(u) {\n switch (u.label) {\n case 0:\n if (!pr(r)) throw r;\n // Disable network and raise offline snapshots\n return t.Xc.add(1 /* IndexedDbFailed */), [ 4 /*yield*/ , Co(t) ];\n\n case 1:\n // Disable network and raise offline snapshots\n return u.sent(), t.nu.set(\"Offline\" /* Offline */), i || (\n // Use a simple read operation to determine if IndexedDB recovered.\n // Ideally, we would expose a health check directly on SimpleDb, but\n // RemoteStore only has access to persistence through LocalStore.\n i = function() {\n return fo(t.Gc);\n }), \n // Probe IndexedDB periodically and re-enable network\n t.hs.Cs((function() {\n return e(o, void 0, void 0, (function() {\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n return T(\"RemoteStore\", \"Retrying IndexedDB access\"), [ 4 /*yield*/ , i() ];\n\n case 1:\n return e.sent(), t.Xc.delete(1 /* IndexedDbFailed */), [ 4 /*yield*/ , Ro(t) ];\n\n case 2:\n return e.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n })), [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * Executes `op`. If `op` fails, takes the network offline until `op`\n * succeeds. Returns after the first attempt.\n */ function Xo(t, e) {\n return e().catch((function(n) {\n return Yo(t, n, e);\n }));\n}\n\nfunction Jo(t) {\n return e(this, void 0, void 0, (function() {\n var e, r, i, o, u;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = k(t), r = uu(e), i = e.Jc.length > 0 ? e.Jc[e.Jc.length - 1].batchId : -1, n.label = 1;\n\n case 1:\n if (!\n /**\n * Returns true if we can add to the write pipeline (i.e. the network is\n * enabled and the write pipeline is not full).\n */\n function(t) {\n return zo(t) && t.Jc.length < 10;\n }\n /**\n * Queues additional writes to be sent to the write stream, sending them\n * immediately if the write stream is established.\n */ (e)) return [ 3 /*break*/ , 7 ];\n n.label = 2;\n\n case 2:\n return n.trys.push([ 2, 4, , 6 ]), [ 4 /*yield*/ , po(e.Gc, i) ];\n\n case 3:\n return null === (o = n.sent()) ? (0 === e.Jc.length && r.fc(), [ 3 /*break*/ , 7 ]) : (i = o.batchId, \n function(t, e) {\n t.Jc.push(e);\n var n = uu(t);\n n.uc() && n.Dc && n.Cc(e.mutations);\n }(e, o), [ 3 /*break*/ , 6 ]);\n\n case 4:\n return u = n.sent(), [ 4 /*yield*/ , Yo(e, u) ];\n\n case 5:\n return n.sent(), [ 3 /*break*/ , 6 ];\n\n case 6:\n return [ 3 /*break*/ , 1 ];\n\n case 7:\n return $o(e) && Zo(e), [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction $o(t) {\n return zo(t) && !uu(t).cc() && t.Jc.length > 0;\n}\n\nfunction Zo(t) {\n uu(t).start();\n}\n\nfunction tu(t) {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(e) {\n return uu(t).Fc(), [ 2 /*return*/ ];\n }));\n }));\n}\n\nfunction eu(t) {\n return e(this, void 0, void 0, (function() {\n var e, r, i, o;\n return n(this, (function(n) {\n // Send the write pipeline now that the stream is established.\n for (e = uu(t), r = 0, i = t.Jc; r < i.length; r++) o = i[r], e.Cc(o.mutations);\n return [ 2 /*return*/ ];\n }));\n }));\n}\n\nfunction nu(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var e, o;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e = t.Jc.shift(), o = Kr.from(e, r, i), [ 4 /*yield*/ , Xo(t, (function() {\n return t.Hc.ou(o);\n })) ];\n\n case 1:\n // It's possible that with the completion of this mutation another\n // slot has freed up.\n return n.sent(), [ 4 /*yield*/ , Jo(t) ];\n\n case 2:\n // It's possible that with the completion of this mutation another\n // slot has freed up.\n return n.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction ru(t, r) {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(i) {\n switch (i.label) {\n case 0:\n return r && uu(t).Dc ? [ 4 /*yield*/ , function(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return lt(i = r.code) && i !== b.ABORTED ? (e = t.Jc.shift(), \n // In this case it's also unlikely that the server itself is melting\n // down -- this was just a bad request so inhibit backoff on the next\n // restart.\n uu(t)._c(), [ 4 /*yield*/ , Xo(t, (function() {\n return t.Hc.au(e.batchId, r);\n })) ]) : [ 3 /*break*/ , 3 ];\n\n case 1:\n // It's possible that with the completion of this mutation\n // another slot has freed up.\n return n.sent(), [ 4 /*yield*/ , Jo(t) ];\n\n case 2:\n // In this case it's also unlikely that the server itself is melting\n // down -- this was just a bad request so inhibit backoff on the next\n // restart.\n // It's possible that with the completion of this mutation\n // another slot has freed up.\n n.sent(), n.label = 3;\n\n case 3:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }(t, r) ] : [ 3 /*break*/ , 2 ];\n\n // This error affects the actual write.\n case 1:\n // This error affects the actual write.\n i.sent(), i.label = 2;\n\n case 2:\n // If the write stream closed after the write handshake completes, a write\n // operation failed and we fail the pending operation.\n // The write stream might have been started by refilling the write\n // pipeline for failed writes\n return $o(t) && Zo(t), [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * Toggles the network state when the client gains or loses its primary lease.\n */ function iu(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e = k(t), r ? (e.Xc.delete(2 /* IsSecondary */), [ 4 /*yield*/ , Ro(e) ]) : [ 3 /*break*/ , 2 ];\n\n case 1:\n return n.sent(), [ 3 /*break*/ , 5 ];\n\n case 2:\n return (i = r) ? [ 3 /*break*/ , 4 ] : (e.Xc.add(2 /* IsSecondary */), [ 4 /*yield*/ , Co(e) ]);\n\n case 3:\n n.sent(), i = e.nu.set(\"Unknown\" /* Unknown */), n.label = 4;\n\n case 4:\n i, n.label = 5;\n\n case 5:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * If not yet initialized, registers the WatchStream and its network state\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\n * already available.\n *\n * PORTING NOTE: On iOS and Android, the WatchStream gets registered on startup.\n * This is not done on Web to allow it to be tree-shaken.\n */ function ou(t) {\n var r = this;\n return t.hu || (\n // Create stream (but note that it is not started yet).\n t.hu = function(t, e, n) {\n var r = k(t);\n return r.Oc(), new ko(e, r.rc, r.credentials, r.serializer, n);\n }(t.zc, t.hs, {\n gc: Wo.bind(null, t),\n Ic: Qo.bind(null, t),\n yc: Ho.bind(null, t)\n }), t.Zc.push((function(i) {\n return e(r, void 0, void 0, (function() {\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n return i ? (t.hu._c(), Bo(t) ? Go(t) : t.nu.set(\"Unknown\" /* Unknown */), [ 3 /*break*/ , 3 ]) : [ 3 /*break*/ , 1 ];\n\n case 1:\n return [ 4 /*yield*/ , t.hu.stop() ];\n\n case 2:\n e.sent(), Ko(t), e.label = 3;\n\n case 3:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }))), t.hu\n /**\n * If not yet initialized, registers the WriteStream and its network state\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\n * already available.\n *\n * PORTING NOTE: On iOS and Android, the WriteStream gets registered on startup.\n * This is not done on Web to allow it to be tree-shaken.\n */;\n}\n\nfunction uu(t) {\n var r = this;\n return t.cu || (\n // Create stream (but note that it is not started yet).\n t.cu = function(t, e, n) {\n var r = k(t);\n return r.Oc(), new Po(e, r.rc, r.credentials, r.serializer, n);\n }(t.zc, t.hs, {\n gc: tu.bind(null, t),\n Ic: ru.bind(null, t),\n xc: eu.bind(null, t),\n Nc: nu.bind(null, t)\n }), t.Zc.push((function(i) {\n return e(r, void 0, void 0, (function() {\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n return i ? (t.cu._c(), [ 4 /*yield*/ , Jo(t) ]) : [ 3 /*break*/ , 2 ];\n\n case 1:\n // This will start the write stream if necessary.\n return e.sent(), [ 3 /*break*/ , 4 ];\n\n case 2:\n return [ 4 /*yield*/ , t.cu.stop() ];\n\n case 3:\n e.sent(), t.Jc.length > 0 && (T(\"RemoteStore\", \"Stopping write stream with \" + t.Jc.length + \" pending writes\"), \n t.Jc = []), e.label = 4;\n\n case 4:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }))), t.cu\n /**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */;\n}\n\nvar su = function(t) {\n this.key = t;\n}, au = function(t) {\n this.key = t;\n}, cu = /** @class */ function() {\n function t(t, \n /** Documents included in the remote target */\n e) {\n this.query = t, this.uu = e, this.lu = null, \n /**\n * A flag whether the view is current with the backend. A view is considered\n * current after it has seen the current flag from the backend and did not\n * lose consistency within the watch stream (e.g. because of an existence\n * filter mismatch).\n */\n this.te = !1, \n /** Documents in the view but not in the remote target */\n this._u = At(), \n /** Document Keys that have local changes */\n this.Qt = At(), this.fu = zn(t), this.du = new xt(this.fu);\n }\n return Object.defineProperty(t.prototype, \"wu\", {\n /**\n * The set of remote documents that the server has told us belongs to the target associated with\n * this view.\n */\n get: function() {\n return this.uu;\n },\n enumerable: !1,\n configurable: !0\n }), \n /**\n * Iterates over a set of doc changes, applies the query limit, and computes\n * what the new results should be, what the changes were, and whether we may\n * need to go back to the local cache for more results. Does not make any\n * changes to the view.\n * @param docChanges The doc changes to apply to this view.\n * @param previousChanges If this is being called with a refill, then start\n * with this set of docs and changes instead of the current view.\n * @return a new set of docs, changes, and refill flag.\n */\n t.prototype.Eu = function(t, e) {\n var n = this, r = e ? e.Tu : new kt, i = e ? e.du : this.du, o = e ? e.Qt : this.Qt, u = i, s = !1, a = kn(this.query) && i.size === this.query.limit ? i.last() : null, c = Pn(this.query) && i.size === this.query.limit ? i.first() : null;\n // Drop documents out to meet limit/limitToLast requirement.\n if (t.ut((function(t, e) {\n var h = i.get(t), f = e instanceof Tn ? e : null;\n f && (f = Bn(n.query, f) ? f : null);\n var l = !!h && n.Qt.has(h.key), p = !!f && (f.Ye || \n // We only consider committed mutations for documents that were\n // mutated during the lifetime of the view.\n n.Qt.has(f.key) && f.hasCommittedMutations), d = !1;\n // Calculate change\n h && f ? h.data().isEqual(f.data()) ? l !== p && (r.track({\n type: 3 /* Metadata */ ,\n doc: f\n }), d = !0) : n.Iu(h, f) || (r.track({\n type: 2 /* Modified */ ,\n doc: f\n }), d = !0, (a && n.fu(f, a) > 0 || c && n.fu(f, c) < 0) && (\n // This doc moved from inside the limit to outside the limit.\n // That means there may be some other doc in the local cache\n // that should be included instead.\n s = !0)) : !h && f ? (r.track({\n type: 0 /* Added */ ,\n doc: f\n }), d = !0) : h && !f && (r.track({\n type: 1 /* Removed */ ,\n doc: h\n }), d = !0, (a || c) && (\n // A doc was removed from a full limit query. We'll need to\n // requery from the local cache to see if we know about some other\n // doc that should be in the results.\n s = !0)), d && (f ? (u = u.add(f), o = p ? o.add(t) : o.delete(t)) : (u = u.delete(t), \n o = o.delete(t)));\n })), kn(this.query) || Pn(this.query)) for (;u.size > this.query.limit; ) {\n var h = kn(this.query) ? u.last() : u.first();\n u = u.delete(h.key), o = o.delete(h.key), r.track({\n type: 1 /* Removed */ ,\n doc: h\n });\n }\n return {\n du: u,\n Tu: r,\n mu: s,\n Qt: o\n };\n }, t.prototype.Iu = function(t, e) {\n // We suppress the initial change event for documents that were modified as\n // part of a write acknowledgment (e.g. when the value of a server transform\n // is applied) as Watch will send us the same document again.\n // By suppressing the event, we only raise two user visible events (one with\n // `hasPendingWrites` and the final state of the document) instead of three\n // (one with `hasPendingWrites`, the modified document with\n // `hasPendingWrites` and the final state of the document).\n return t.Ye && e.hasCommittedMutations && !e.Ye;\n }, \n /**\n * Updates the view with the given ViewDocumentChanges and optionally updates\n * limbo docs and sync state from the provided target change.\n * @param docChanges The set of changes to make to the view's docs.\n * @param updateLimboDocuments Whether to update limbo documents based on this\n * change.\n * @param targetChange A target change to apply for computing limbo docs and\n * sync state.\n * @return A new ViewChange with the given docs, changes, and sync state.\n */\n // PORTING NOTE: The iOS/Android clients always compute limbo document changes.\n t.prototype.Vr = function(t, e, n) {\n var r = this, i = this.du;\n this.du = t.du, this.Qt = t.Qt;\n // Sort changes based on type and query comparator\n var o = t.Tu.Ut();\n o.sort((function(t, e) {\n return function(t, e) {\n var n = function(t) {\n switch (t) {\n case 0 /* Added */ :\n return 1;\n\n case 2 /* Modified */ :\n case 3 /* Metadata */ :\n // A metadata change is converted to a modified change at the public\n // api layer. Since we sort by document key and then change type,\n // metadata and modified changes must be sorted equivalently.\n return 2;\n\n case 1 /* Removed */ :\n return 0;\n\n default:\n return S();\n }\n };\n return n(t) - n(e);\n }(t.type, e.type) || r.fu(t.doc, e.doc);\n })), this.Au(n);\n var u = e ? this.Ru() : [], s = 0 === this._u.size && this.te ? 1 /* Synced */ : 0 /* Local */ , a = s !== this.lu;\n return this.lu = s, 0 !== o.length || a ? {\n snapshot: new Pt(this.query, t.du, i, o, t.Qt, 0 /* Local */ === s, a, \n /* excludesMetadataChanges= */ !1),\n Pu: u\n } : {\n Pu: u\n };\n // no changes\n }, \n /**\n * Applies an OnlineState change to the view, potentially generating a\n * ViewChange if the view's syncState changes as a result.\n */\n t.prototype.Ks = function(t) {\n return this.te && \"Offline\" /* Offline */ === t ? (\n // If we're offline, set `current` to false and then call applyChanges()\n // to refresh our syncState and generate a ViewChange as appropriate. We\n // are guaranteed to get a new TargetChange that sets `current` back to\n // true once the client is back online.\n this.te = !1, this.Vr({\n du: this.du,\n Tu: new kt,\n Qt: this.Qt,\n mu: !1\n }, \n /* updateLimboDocuments= */ !1)) : {\n Pu: []\n };\n }, \n /**\n * Returns whether the doc for the given key should be in limbo.\n */\n t.prototype.gu = function(t) {\n // If the remote end says it's part of this query, it's not in limbo.\n return !this.uu.has(t) && \n // The local store doesn't think it's a result, so it shouldn't be in limbo.\n !!this.du.has(t) && !this.du.get(t).Ye;\n }, \n /**\n * Updates syncedDocuments, current, and limbo docs based on the given change.\n * Returns the list of changes to which docs are in limbo.\n */\n t.prototype.Au = function(t) {\n var e = this;\n t && (t.ee.forEach((function(t) {\n return e.uu = e.uu.add(t);\n })), t.ne.forEach((function(t) {})), t.se.forEach((function(t) {\n return e.uu = e.uu.delete(t);\n })), this.te = t.te);\n }, t.prototype.Ru = function() {\n var t = this;\n // We can only determine limbo documents when we're in-sync with the server.\n if (!this.te) return [];\n // TODO(klimt): Do this incrementally so that it's not quadratic when\n // updating many documents.\n var e = this._u;\n this._u = At(), this.du.forEach((function(e) {\n t.gu(e.key) && (t._u = t._u.add(e.key));\n }));\n // Diff the new limbo docs with the old limbo docs.\n var n = [];\n return e.forEach((function(e) {\n t._u.has(e) || n.push(new au(e));\n })), this._u.forEach((function(t) {\n e.has(t) || n.push(new su(t));\n })), n;\n }, \n /**\n * Update the in-memory state of the current view with the state read from\n * persistence.\n *\n * We update the query view whenever a client's primary status changes:\n * - When a client transitions from primary to secondary, it can miss\n * LocalStorage updates and its query views may temporarily not be\n * synchronized with the state on disk.\n * - For secondary to primary transitions, the client needs to update the list\n * of `syncedDocuments` since secondary clients update their query views\n * based purely on synthesized RemoteEvents.\n *\n * @param queryResult.documents - The documents that match the query according\n * to the LocalStore.\n * @param queryResult.remoteKeys - The keys of the documents that match the\n * query according to the backend.\n *\n * @return The ViewChange that resulted from this synchronization.\n */\n // PORTING NOTE: Multi-tab only.\n t.prototype.Vu = function(t) {\n this.uu = t.Fh, this._u = At();\n var e = this.Eu(t.documents);\n return this.Vr(e, /*updateLimboDocuments=*/ !0);\n }, \n /**\n * Returns a view snapshot as if this query was just listened to. Contains\n * a document add for every existing document and the `fromCache` and\n * `hasPendingWrites` status of the already established view.\n */\n // PORTING NOTE: Multi-tab only.\n t.prototype.yu = function() {\n return Pt.Gt(this.query, this.du, this.Qt, 0 /* Local */ === this.lu);\n }, t;\n}(), hu = function(\n/**\n * The query itself.\n */\nt, \n/**\n * The target number created by the client that is used in the watch\n * stream to identify this query.\n */\ne, \n/**\n * The view is responsible for computing the final merged truth of what\n * docs are in the query. It gets notified of local and remote changes,\n * and applies the query filters and limits to determine the most correct\n * possible results.\n */\nn) {\n this.query = t, this.targetId = e, this.view = n;\n}, fu = function(t) {\n this.key = t, \n /**\n * Set to true once we've received a document. This is used in\n * getRemoteKeysForTarget() and ultimately used by WatchChangeAggregator to\n * decide whether it needs to manufacture a delete event for the target once\n * the target is CURRENT.\n */\n this.pu = !1;\n}, lu = /** @class */ function() {\n function t(t, e, n, \n // PORTING NOTE: Manages state synchronization in multi-tab environments.\n r, i, o) {\n this.Gc = t, this.bu = e, this.vu = n, this.Su = r, this.currentUser = i, this.Du = o, \n this.Cu = {}, this.Nu = new W((function(t) {\n return jn(t);\n }), Fn), this.xu = new Map, \n /**\n * The keys of documents that are in limbo for which we haven't yet started a\n * limbo resolution query.\n */\n this.Fu = [], \n /**\n * Keeps track of the target ID for each document that is in limbo with an\n * active target.\n */\n this.ku = new dt(Z.D), \n /**\n * Keeps track of the information about an active limbo resolution for each\n * active target ID that was started for the purpose of limbo resolution.\n */\n this.Ou = new Map, this.Mu = new Eo, \n /** Stores user completion handlers, indexed by User and BatchId. */\n this.$u = {}, \n /** Stores user callbacks waiting for all pending writes to be acknowledged. */\n this.Lu = new Map, this.Bu = Xi.da(), this.onlineState = \"Unknown\" /* Unknown */ , \n // The primary state is set to `true` or `false` immediately after Firestore\n // startup. In the interim, a client should only be considered primary if\n // `isPrimary` is true.\n this.qu = void 0;\n }\n return Object.defineProperty(t.prototype, \"Uu\", {\n get: function() {\n return !0 === this.qu;\n },\n enumerable: !1,\n configurable: !0\n }), t;\n}();\n\n/**\n * Initiates the new listen, resolves promise when listen enqueued to the\n * server. All the subsequent view snapshots or errors are sent to the\n * subscribed handlers. Returns the initial snapshot.\n */\nfunction pu(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u, s, a;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e = qu(t), (u = e.Nu.get(r)) ? (\n // PORTING NOTE: With Multi-Tab Web, it is possible that a query view\n // already exists when EventManager calls us for the first time. This\n // happens when the primary tab is already listening to this query on\n // behalf of another tab and the user of the primary also starts listening\n // to the query. EventManager will not have an assigned target ID in this\n // case and calls `listen` to obtain this ID.\n i = u.targetId, e.Su.$i(i), o = u.view.yu(), [ 3 /*break*/ , 4 ]) : [ 3 /*break*/ , 1 ];\n\n case 1:\n return [ 4 /*yield*/ , vo(e.Gc, Cn(r)) ];\n\n case 2:\n return s = n.sent(), a = e.Su.$i(s.targetId), i = s.targetId, [ 4 /*yield*/ , du(e, r, i, \"current\" === a) ];\n\n case 3:\n o = n.sent(), e.Uu && Mo(e.bu, s), n.label = 4;\n\n case 4:\n return [ 2 /*return*/ , o ];\n }\n }));\n }));\n}\n\n/**\n * Registers a view for a previously unknown query and computes its initial\n * snapshot.\n */ function du(t, r, i, o) {\n return e(this, void 0, void 0, (function() {\n var u, s, a, c, h, f;\n return n(this, (function(l) {\n switch (l.label) {\n case 0:\n // PORTING NOTE: On Web only, we inject the code that registers new Limbo\n // targets based on view changes. This allows us to only depend on Limbo\n // changes when user code includes queries.\n return t.Ku = function(r, i, o) {\n return function(t, r, i, o) {\n return e(this, void 0, void 0, (function() {\n var e, u, s;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e = r.view.Eu(i), e.mu ? [ 4 /*yield*/ , mo(t.Gc, r.query, \n /* usePreviousResults= */ !1).then((function(t) {\n var n = t.documents;\n return r.view.Eu(n, e);\n })) ] : [ 3 /*break*/ , 2 ];\n\n case 1:\n // The query has a limit and some docs were removed, so we need\n // to re-run the query against the local store to make sure we\n // didn't lose any good docs that had been past the limit.\n e = n.sent(), n.label = 2;\n\n case 2:\n return u = o && o.zt.get(r.targetId), s = r.view.Vr(e, \n /* updateLimboDocuments= */ t.Uu, u), [ 2 /*return*/ , (Nu(t, r.targetId, s.Pu), \n s.snapshot) ];\n }\n }));\n }));\n }(t, r, i, o);\n }, [ 4 /*yield*/ , mo(t.Gc, r, \n /* usePreviousResults= */ !0) ];\n\n case 1:\n return u = l.sent(), s = new cu(r, u.Fh), a = s.Eu(u.documents), c = Lt.Zt(i, o && \"Offline\" /* Offline */ !== t.onlineState), \n h = s.Vr(a, \n /* updateLimboDocuments= */ t.Uu, c), Nu(t, i, h.Pu), f = new hu(r, i, s), [ 2 /*return*/ , (t.Nu.set(r, f), \n t.xu.has(i) ? t.xu.get(i).push(r) : t.xu.set(i, [ r ]), h.snapshot) ];\n }\n }));\n }));\n}\n\n/** Stops listening to the query. */ function vu(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e = k(t), i = e.Nu.get(r), (o = e.xu.get(i.targetId)).length > 1 ? [ 2 /*return*/ , (e.xu.set(i.targetId, o.filter((function(t) {\n return !Fn(t, r);\n }))), void e.Nu.delete(r)) ] : e.Uu ? (\n // We need to remove the local query target first to allow us to verify\n // whether any other client is still interested in this target.\n e.Su.Bi(i.targetId), e.Su.xi(i.targetId) ? [ 3 /*break*/ , 2 ] : [ 4 /*yield*/ , yo(e.Gc, i.targetId, \n /*keepPersistedTargetData=*/ !1).then((function() {\n e.Su.Ui(i.targetId), qo(e.bu, i.targetId), _u(e, i.targetId);\n })).catch(Io) ]) : [ 3 /*break*/ , 3 ];\n\n case 1:\n n.sent(), n.label = 2;\n\n case 2:\n return [ 3 /*break*/ , 5 ];\n\n case 3:\n return _u(e, i.targetId), [ 4 /*yield*/ , yo(e.Gc, i.targetId, \n /*keepPersistedTargetData=*/ !0) ];\n\n case 4:\n n.sent(), n.label = 5;\n\n case 5:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * Initiates the write of local mutation batch which involves adding the\n * writes to the mutation queue, notifying the remote store about new\n * mutations and raising events for any changes this write caused.\n *\n * The promise returned by this call is resolved when the above steps\n * have completed, *not* when the write was acked by the backend. The\n * userCallback is resolved once the write was acked/rejected by the\n * backend (or failed locally for any other reason).\n */\n/**\n * Applies one remote event to the sync engine, notifying any views of the\n * changes, and releasing any pending mutation batches that would become\n * visible because of the snapshot version the remote event contains.\n */\nfunction yu(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = k(t), n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 4, , 6 ]), [ 4 /*yield*/ , lo(e.Gc, r) ];\n\n case 2:\n return i = n.sent(), \n // Update `receivedDocument` as appropriate for any limbo targets.\n r.zt.forEach((function(t, n) {\n var r = e.Ou.get(n);\n r && (\n // Since this is a limbo resolution lookup, it's for a single document\n // and it could be added, modified, or removed, but not a combination.\n x(t.ee.size + t.ne.size + t.se.size <= 1), t.ee.size > 0 ? r.pu = !0 : t.ne.size > 0 ? x(r.pu) : t.se.size > 0 && (x(r.pu), \n r.pu = !1));\n })), [ 4 /*yield*/ , Su(e, i, r) ];\n\n case 3:\n // Update `receivedDocument` as appropriate for any limbo targets.\n return n.sent(), [ 3 /*break*/ , 6 ];\n\n case 4:\n return [ 4 /*yield*/ , Io(n.sent()) ];\n\n case 5:\n return n.sent(), [ 3 /*break*/ , 6 ];\n\n case 6:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * Applies an OnlineState change to the sync engine and notifies any views of\n * the change.\n */ function mu(t, e, n) {\n var r = k(t);\n // If we are the secondary client, we explicitly ignore the remote store's\n // online state (the local client may go offline, even though the primary\n // tab remains online) and only apply the primary tab's online state from\n // SharedClientState.\n if (r.Uu && 0 /* RemoteStore */ === n || !r.Uu && 1 /* SharedClientState */ === n) {\n var i = [];\n r.Nu.forEach((function(t, n) {\n var r = n.view.Ks(e);\n r.snapshot && i.push(r.snapshot);\n })), function(t, e) {\n var n = k(t);\n n.onlineState = e;\n var r = !1;\n n.Bs.forEach((function(t, n) {\n for (var i = 0, o = n.listeners; i < o.length; i++) {\n // Run global snapshot listeners if a consistent snapshot has been emitted.\n o[i].Ks(e) && (r = !0);\n }\n })), r && kr(n);\n }(r.vu, e), i.length && r.Cu.yc(i), r.onlineState = e, r.Uu && r.Su.ji(e);\n }\n}\n\n/**\n * Rejects the listen for the given targetID. This can be triggered by the\n * backend for any active target.\n *\n * @param syncEngine The sync engine implementation.\n * @param targetId The targetID corresponds to one previously initiated by the\n * user as part of TargetData passed to listen() on RemoteStore.\n * @param err A description of the condition that has forced the rejection.\n * Nearly always this will be an indication that the user is no longer\n * authorized to see the data matching the target.\n */ function gu(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var e, o, u, s, a, c;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n // PORTING NOTE: Multi-tab only.\n return (e = k(t)).Su.Ki(r, \"rejected\", i), o = e.Ou.get(r), (u = o && o.key) ? (s = (s = new dt(Z.D)).ot(u, new Nn(u, H.min())), \n a = At().add(u), c = new Ot(H.min(), \n /* targetChanges= */ new Map, \n /* targetMismatches= */ new mt(L), s, a), [ 4 /*yield*/ , yu(e, c) ]) : [ 3 /*break*/ , 2 ];\n\n case 1:\n return n.sent(), \n // Since this query failed, we won't want to manually unlisten to it.\n // We only remove it from bookkeeping after we successfully applied the\n // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to\n // this query when the RemoteStore restarts the Watch stream, which should\n // re-trigger the target failure.\n e.ku = e.ku.remove(u), e.Ou.delete(r), Du(e), [ 3 /*break*/ , 4 ];\n\n case 2:\n return [ 4 /*yield*/ , yo(e.Gc, r, \n /* keepPersistedTargetData */ !1).then((function() {\n return _u(e, r, i);\n })).catch(Io) ];\n\n case 3:\n n.sent(), n.label = 4;\n\n case 4:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction wu(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = k(t), i = r.batch.batchId, n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 4, , 6 ]), [ 4 /*yield*/ , ho(e.Gc, r) ];\n\n case 2:\n return o = n.sent(), \n // The local store may or may not be able to apply the write result and\n // raise events immediately (depending on whether the watcher is caught\n // up), so we raise user callbacks first so that they consistently happen\n // before listen events.\n Eu(e, i, /*error=*/ null), Iu(e, i), e.Su.Oi(i, \"acknowledged\"), [ 4 /*yield*/ , Su(e, o) ];\n\n case 3:\n // The local store may or may not be able to apply the write result and\n // raise events immediately (depending on whether the watcher is caught\n // up), so we raise user callbacks first so that they consistently happen\n // before listen events.\n return n.sent(), [ 3 /*break*/ , 6 ];\n\n case 4:\n return [ 4 /*yield*/ , Io(n.sent()) ];\n\n case 5:\n return n.sent(), [ 3 /*break*/ , 6 ];\n\n case 6:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction bu(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var e, o;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = k(t), n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 4, , 6 ]), [ 4 /*yield*/ , function(t, e) {\n var n = k(t);\n return n.persistence.runTransaction(\"Reject batch\", \"readwrite-primary\", (function(t) {\n var r;\n return n.Sr.$o(t, e).next((function(e) {\n return x(null !== e), r = e.keys(), n.Sr.Qo(t, e);\n })).next((function() {\n return n.Sr.zo(t);\n })).next((function() {\n return n.Nh.Or(t, r);\n }));\n }));\n }(e.Gc, r) ];\n\n case 2:\n return o = n.sent(), \n // The local store may or may not be able to apply the write result and\n // raise events immediately (depending on whether the watcher is caught up),\n // so we raise user callbacks first so that they consistently happen before\n // listen events.\n Eu(e, r, i), Iu(e, r), e.Su.Oi(r, \"rejected\", i), [ 4 /*yield*/ , Su(e, o) ];\n\n case 3:\n // The local store may or may not be able to apply the write result and\n // raise events immediately (depending on whether the watcher is caught up),\n // so we raise user callbacks first so that they consistently happen before\n // listen events.\n return n.sent(), [ 3 /*break*/ , 6 ];\n\n case 4:\n return [ 4 /*yield*/ , Io(n.sent()) ];\n\n case 5:\n return n.sent(), [ 3 /*break*/ , 6 ];\n\n case 6:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/**\n * Registers a user callback that resolves when all pending mutations at the moment of calling\n * are acknowledged .\n */\n/**\n * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,\n * if there are any.\n */\nfunction Iu(t, e) {\n (t.Lu.get(e) || []).forEach((function(t) {\n t.resolve();\n })), t.Lu.delete(e)\n /** Reject all outstanding callbacks waiting for pending writes to complete. */;\n}\n\nfunction Eu(t, e, n) {\n var r = k(t), i = r.$u[r.currentUser.ti()];\n // NOTE: Mutations restored from persistence won't have callbacks, so it's\n // okay for there to be no callback for this ID.\n if (i) {\n var o = i.get(e);\n o && (n ? o.reject(n) : o.resolve(), i = i.remove(e)), r.$u[r.currentUser.ti()] = i;\n }\n}\n\nfunction _u(t, e, n) {\n void 0 === n && (n = null), t.Su.Bi(e);\n for (var r = 0, i = t.xu.get(e); r < i.length; r++) {\n var o = i[r];\n t.Nu.delete(o), n && t.Cu.Qu(o, n);\n }\n t.xu.delete(e), t.Uu && t.Mu.Kh(e).forEach((function(e) {\n t.Mu.Ho(e) || \n // We removed the last reference for this key\n Tu(t, e);\n }));\n}\n\nfunction Tu(t, e) {\n // It's possible that the target already got removed because the query failed. In that case,\n // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.\n var n = t.ku.get(e);\n null !== n && (qo(t.bu, n), t.ku = t.ku.remove(e), t.Ou.delete(n), Du(t));\n}\n\nfunction Nu(t, e, n) {\n for (var r = 0, i = n; r < i.length; r++) {\n var o = i[r];\n o instanceof su ? (t.Mu.Da(o.key, e), Au(t, o)) : o instanceof au ? (T(\"SyncEngine\", \"Document no longer in limbo: \" + o.key), \n t.Mu.Na(o.key, e), t.Mu.Ho(o.key) || \n // We removed the last reference for this key\n Tu(t, o.key)) : S();\n }\n}\n\nfunction Au(t, e) {\n var n = e.key;\n t.ku.get(n) || (T(\"SyncEngine\", \"New document in limbo: \" + n), t.Fu.push(n), Du(t));\n}\n\n/**\n * Starts listens for documents in limbo that are enqueued for resolution,\n * subject to a maximum number of concurrent resolutions.\n *\n * Without bounding the number of concurrent resolutions, the server can fail\n * with \"resource exhausted\" errors which can lead to pathological client\n * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.\n */ function Du(t) {\n for (;t.Fu.length > 0 && t.ku.size < t.Du; ) {\n var e = t.Fu.shift(), n = t.Bu.next();\n t.Ou.set(n, new fu(e)), t.ku = t.ku.ot(e, n), Mo(t.bu, new ht(Cn(xn(e.path)), n, 2 /* LimboResolution */ , Lr.ai));\n }\n}\n\nfunction Su(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var o, u, s, a;\n return n(this, (function(c) {\n switch (c.label) {\n case 0:\n return o = k(t), u = [], s = [], a = [], o.Nu.P() ? [ 3 /*break*/ , 3 ] : (o.Nu.forEach((function(t, e) {\n a.push(o.Ku(e, r, i).then((function(t) {\n if (t) {\n o.Uu && o.Su.Ki(e.targetId, t.fromCache ? \"not-current\" : \"current\"), u.push(t);\n var n = Xr.zr(e.targetId, t);\n s.push(n);\n }\n })));\n })), [ 4 /*yield*/ , Promise.all(a) ]);\n\n case 1:\n return c.sent(), o.Cu.yc(u), [ 4 /*yield*/ , function(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u, s, a, c, h, f;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = k(t), n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 3, , 4 ]), [ 4 /*yield*/ , e.persistence.runTransaction(\"notifyLocalViewChanges\", \"readwrite\", (function(t) {\n return cr.forEach(r, (function(n) {\n return cr.forEach(n.jr, (function(r) {\n return e.persistence.No.Da(t, n.targetId, r);\n })).next((function() {\n return cr.forEach(n.Gr, (function(r) {\n return e.persistence.No.Na(t, n.targetId, r);\n }));\n }));\n }));\n })) ];\n\n case 2:\n return n.sent(), [ 3 /*break*/ , 4 ];\n\n case 3:\n if (!pr(i = n.sent())) throw i;\n // If `notifyLocalViewChanges` fails, we did not advance the sequence\n // number for the documents that were included in this transaction.\n // This might trigger them to be deleted earlier than they otherwise\n // would have, but it should not invalidate the integrity of the data.\n return T(\"LocalStore\", \"Failed to update sequence numbers: \" + i), \n [ 3 /*break*/ , 4 ];\n\n case 4:\n for (o = 0, u = r; o < u.length; o++) s = u[o], a = s.targetId, s.fromCache || (c = e.bh.get(a), \n h = c.nt, f = c.rt(h), \n // Advance the last limbo free snapshot version\n e.bh = e.bh.ot(a, f));\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }(o.Gc, s) ];\n\n case 2:\n c.sent(), c.label = 3;\n\n case 3:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction xu(t, r) {\n return e(this, void 0, void 0, (function() {\n var i, o;\n return n(this, (function(u) {\n switch (u.label) {\n case 0:\n return (i = k(t)).currentUser.isEqual(r) ? [ 3 /*break*/ , 3 ] : (T(\"SyncEngine\", \"User change. New user:\", r.ti()), \n [ 4 /*yield*/ , \n /**\n * Tells the LocalStore that the currently authenticated user has changed.\n *\n * In response the local store switches the mutation queue to the new user and\n * returns any resulting document changes.\n */\n // PORTING NOTE: Android and iOS only return the documents affected by the\n // change.\n function(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e = k(t), i = e.Sr, o = e.Nh, [ 4 /*yield*/ , e.persistence.runTransaction(\"Handle user change\", \"readonly\", (function(t) {\n // Swap out the mutation queue, grabbing the pending mutation batches\n // before and after.\n var n;\n return e.Sr.Uo(t).next((function(u) {\n return n = u, i = e.persistence.Th(r), \n // Recreate our LocalDocumentsView using the new\n // MutationQueue.\n o = new Yr(e.Ch, i, e.persistence.Ah()), i.Uo(t);\n })).next((function(e) {\n for (var r = [], i = [], u = At(), s = 0, a = n\n // Union the old/new changed keys.\n ; s < a.length; s++) {\n var c = a[s];\n r.push(c.batchId);\n for (var h = 0, f = c.mutations; h < f.length; h++) {\n var l = f[h];\n u = u.add(l.key);\n }\n }\n for (var p = 0, d = e; p < d.length; p++) {\n var v = d[p];\n i.push(v.batchId);\n for (var y = 0, m = v.mutations; y < m.length; y++) {\n var g = m[y];\n u = u.add(g.key);\n }\n }\n // Return the set of all (potentially) changed documents and the list\n // of mutation batch IDs that were affected by change.\n return o.Or(t, u).next((function(t) {\n return {\n Wu: t,\n ju: r,\n Gu: i\n };\n }));\n }));\n })) ];\n\n case 1:\n return u = n.sent(), [ 2 /*return*/ , (e.Sr = i, e.Nh = o, e.ph.xh(e.Nh), u) ];\n }\n }));\n }));\n }(i.Gc, r) ]);\n\n case 1:\n return o = u.sent(), i.currentUser = r, \n // Fails tasks waiting for pending writes requested by previous user.\n function(t, e) {\n t.Lu.forEach((function(t) {\n t.forEach((function(t) {\n t.reject(new I(b.CANCELLED, \"'waitForPendingWrites' promise is rejected due to a user change.\"));\n }));\n })), t.Lu.clear();\n }(i), \n // TODO(b/114226417): Consider calling this only in the primary tab.\n i.Su.Wi(r, o.ju, o.Gu), [ 4 /*yield*/ , Su(i, o.Wu) ];\n\n case 2:\n u.sent(), u.label = 3;\n\n case 3:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction ku(t, e) {\n var n = k(t), r = n.Ou.get(e);\n if (r && r.pu) return At().add(r.key);\n var i = At(), o = n.xu.get(e);\n if (!o) return i;\n for (var u = 0, s = o; u < s.length; u++) {\n var a = s[u], c = n.Nu.get(a);\n i = i.Ot(c.view.wu);\n }\n return i;\n}\n\n/**\n * Reconcile the list of synced documents in an existing view with those\n * from persistence.\n */ function Pu(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return [ 4 /*yield*/ , mo((e = k(t)).Gc, r.query, \n /* usePreviousResults= */ !0) ];\n\n case 1:\n return i = n.sent(), o = r.view.Vu(i), [ 2 /*return*/ , (e.Uu && Nu(e, r.targetId, o.Pu), \n o) ];\n }\n }));\n }));\n}\n\n/** Applies a mutation state to an existing batch. */\n// PORTING NOTE: Multi-Tab only.\nfunction Ou(t, r, i, o) {\n return e(this, void 0, void 0, (function() {\n var e, u;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return [ 4 /*yield*/ , function(t, e) {\n var n = k(t), r = k(n.Sr);\n return n.persistence.runTransaction(\"Lookup mutation documents\", \"readonly\", (function(t) {\n return r.Lo(t, e).next((function(e) {\n return e ? n.Nh.Or(t, e) : cr.resolve(null);\n }));\n }));\n }((e = k(t)).Gc, r) ];\n\n case 1:\n return null === (u = n.sent()) ? [ 3 /*break*/ , 6 ] : \"pending\" !== i ? [ 3 /*break*/ , 3 ] : [ 4 /*yield*/ , Jo(e.bu) ];\n\n case 2:\n // If we are the primary client, we need to send this write to the\n // backend. Secondary clients will ignore these writes since their remote\n // connection is disabled.\n return n.sent(), [ 3 /*break*/ , 4 ];\n\n case 3:\n \"acknowledged\" === i || \"rejected\" === i ? (\n // NOTE: Both these methods are no-ops for batches that originated from\n // other clients.\n Eu(e, r, o || null), Iu(e, r), function(t, e) {\n k(k(t).Sr).jo(e);\n }(e.Gc, r)) : S(), n.label = 4;\n\n case 4:\n return [ 4 /*yield*/ , Su(e, u) ];\n\n case 5:\n return n.sent(), [ 3 /*break*/ , 7 ];\n\n case 6:\n // A throttled tab may not have seen the mutation before it was completed\n // and removed from the mutation queue, in which case we won't have cached\n // the affected documents. In this case we can safely ignore the update\n // since that means we didn't apply the mutation locally at all (if we\n // had, we would have cached the affected documents), and so we will just\n // see any resulting document changes via normal remote document updates\n // as applicable.\n T(\"SyncEngine\", \"Cannot apply mutation batch with id: \" + r), n.label = 7;\n\n case 7:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/** Applies a query target change from a different tab. */\n// PORTING NOTE: Multi-Tab only.\nfunction Lu(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u, s, a, c, h;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return qu(e = k(t)), Fu(e), !0 !== r || !0 === e.qu ? [ 3 /*break*/ , 3 ] : (i = e.Su.Ci(), \n [ 4 /*yield*/ , Vu(e, i.L()) ]);\n\n case 1:\n return o = n.sent(), e.qu = !0, [ 4 /*yield*/ , iu(e.bu, !0) ];\n\n case 2:\n for (n.sent(), u = 0, s = o; u < s.length; u++) a = s[u], Mo(e.bu, a);\n return [ 3 /*break*/ , 7 ];\n\n case 3:\n return !1 !== r || !1 === e.qu ? [ 3 /*break*/ , 7 ] : (c = [], h = Promise.resolve(), \n e.xu.forEach((function(t, n) {\n e.Su.qi(n) ? c.push(n) : h = h.then((function() {\n return _u(e, n), yo(e.Gc, n, \n /*keepPersistedTargetData=*/ !0);\n })), qo(e.bu, n);\n })), [ 4 /*yield*/ , h ]);\n\n case 4:\n return n.sent(), [ 4 /*yield*/ , Vu(e, c) ];\n\n case 5:\n return n.sent(), \n // PORTING NOTE: Multi-Tab only.\n function(t) {\n var e = k(t);\n e.Ou.forEach((function(t, n) {\n qo(e.bu, n);\n })), e.Mu.Qh(), e.Ou = new Map, e.ku = new dt(Z.D);\n }(e), e.qu = !1, [ 4 /*yield*/ , iu(e.bu, !1) ];\n\n case 6:\n n.sent(), n.label = 7;\n\n case 7:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction Vu(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u, s, a, c, h, f, l, p, d, v, y;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = k(t), i = [], o = [], u = 0, s = r, n.label = 1;\n\n case 1:\n return u < s.length ? (a = s[u], c = void 0, (h = e.xu.get(a)) && 0 !== h.length ? [ 4 /*yield*/ , vo(e.Gc, Cn(h[0])) ] : [ 3 /*break*/ , 7 ]) : [ 3 /*break*/ , 13 ];\n\n case 2:\n // For queries that have a local View, we fetch their current state\n // from LocalStore (as the resume token and the snapshot version\n // might have changed) and reconcile their views with the persisted\n // state (the list of syncedDocuments may have gotten out of sync).\n c = n.sent(), f = 0, l = h, n.label = 3;\n\n case 3:\n return f < l.length ? (p = l[f], d = e.Nu.get(p), [ 4 /*yield*/ , Pu(e, d) ]) : [ 3 /*break*/ , 6 ];\n\n case 4:\n (v = n.sent()).snapshot && o.push(v.snapshot), n.label = 5;\n\n case 5:\n return f++, [ 3 /*break*/ , 3 ];\n\n case 6:\n return [ 3 /*break*/ , 11 ];\n\n case 7:\n return [ 4 /*yield*/ , go(e.Gc, a) ];\n\n case 8:\n return y = n.sent(), [ 4 /*yield*/ , vo(e.Gc, y) ];\n\n case 9:\n return c = n.sent(), [ 4 /*yield*/ , du(e, Ru(y), a, \n /*current=*/ !1) ];\n\n case 10:\n n.sent(), n.label = 11;\n\n case 11:\n i.push(c), n.label = 12;\n\n case 12:\n return u++, [ 3 /*break*/ , 1 ];\n\n case 13:\n return [ 2 /*return*/ , (e.Cu.yc(o), i) ];\n }\n }));\n }));\n}\n\n/**\n * Creates a `Query` object from the specified `Target`. There is no way to\n * obtain the original `Query`, so we synthesize a `Query` from the `Target`\n * object.\n *\n * The synthesized result might be different from the original `Query`, but\n * since the synthesized `Query` should return the same results as the\n * original one (only the presentation of results might differ), the potential\n * difference will not cause issues.\n */\n// PORTING NOTE: Multi-Tab only.\nfunction Ru(t) {\n return Sn(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, \"F\" /* First */ , t.startAt, t.endAt);\n}\n\n/** Returns the IDs of the clients that are currently active. */\n// PORTING NOTE: Multi-Tab only.\nfunction Cu(t) {\n var e = k(t);\n return k(k(e.Gc).persistence).pi();\n}\n\n/** Applies a query target change from a different tab. */\n// PORTING NOTE: Multi-Tab only.\nfunction Uu(t, r, i, o) {\n return e(this, void 0, void 0, (function() {\n var e, u, s;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return (e = k(t)).qu ? (\n // If we receive a target state notification via WebStorage, we are\n // either already secondary or another tab has taken the primary lease.\n T(\"SyncEngine\", \"Ignoring unexpected query state notification.\"), [ 3 /*break*/ , 8 ]) : [ 3 /*break*/ , 1 ];\n\n case 1:\n if (!e.xu.has(r)) return [ 3 /*break*/ , 8 ];\n switch (i) {\n case \"current\":\n case \"not-current\":\n return [ 3 /*break*/ , 2 ];\n\n case \"rejected\":\n return [ 3 /*break*/ , 5 ];\n }\n return [ 3 /*break*/ , 7 ];\n\n case 2:\n return [ 4 /*yield*/ , wo(e.Gc) ];\n\n case 3:\n return u = n.sent(), s = Ot.Xt(r, \"current\" === i), [ 4 /*yield*/ , Su(e, u, s) ];\n\n case 4:\n return n.sent(), [ 3 /*break*/ , 8 ];\n\n case 5:\n return [ 4 /*yield*/ , yo(e.Gc, r, \n /* keepPersistedTargetData */ !0) ];\n\n case 6:\n return n.sent(), _u(e, r, o), [ 3 /*break*/ , 8 ];\n\n case 7:\n S(), n.label = 8;\n\n case 8:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\n/** Adds or removes Watch targets for queries from different tabs. */ function Mu(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var e, o, u, s, a, c, h, f, l, p;\n return n(this, (function(d) {\n switch (d.label) {\n case 0:\n if (!(e = qu(t)).qu) return [ 3 /*break*/ , 10 ];\n o = 0, u = r, d.label = 1;\n\n case 1:\n return o < u.length ? (s = u[o], e.xu.has(s) ? (\n // A target might have been added in a previous attempt\n T(\"SyncEngine\", \"Adding an already active target \" + s), [ 3 /*break*/ , 5 ]) : [ 4 /*yield*/ , go(e.Gc, s) ]) : [ 3 /*break*/ , 6 ];\n\n case 2:\n return a = d.sent(), [ 4 /*yield*/ , vo(e.Gc, a) ];\n\n case 3:\n return c = d.sent(), [ 4 /*yield*/ , du(e, Ru(a), c.targetId, \n /*current=*/ !1) ];\n\n case 4:\n d.sent(), Mo(e.bu, c), d.label = 5;\n\n case 5:\n return o++, [ 3 /*break*/ , 1 ];\n\n case 6:\n h = function(t) {\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e.xu.has(t) ? [ 4 /*yield*/ , yo(e.Gc, t, \n /* keepPersistedTargetData */ !1).then((function() {\n qo(e.bu, t), _u(e, t);\n })).catch(Io) ] : [ 3 /*break*/ , 2 ];\n\n // Release queries that are still active.\n case 1:\n // Release queries that are still active.\n n.sent(), n.label = 2;\n\n case 2:\n return [ 2 /*return*/ ];\n }\n }));\n }, f = 0, l = i, d.label = 7;\n\n case 7:\n return f < l.length ? (p = l[f], [ 5 /*yield**/ , h(p) ]) : [ 3 /*break*/ , 10 ];\n\n case 8:\n d.sent(), d.label = 9;\n\n case 9:\n return f++, [ 3 /*break*/ , 7 ];\n\n case 10:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}\n\nfunction qu(t) {\n var e = k(t);\n return e.bu.Hc.ru = yu.bind(null, e), e.bu.Hc.qe = ku.bind(null, e), e.bu.Hc.iu = gu.bind(null, e), \n e.Cu.yc = Sr.bind(null, e.vu), e.Cu.Qu = xr.bind(null, e.vu), e;\n}\n\nfunction Fu(t) {\n var e = k(t);\n return e.bu.Hc.ou = wu.bind(null, e), e.bu.Hc.au = bu.bind(null, e), e;\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// TOOD(b/140938512): Drop SimpleQueryEngine and rename IndexFreeQueryEngine.\n/**\n * A query engine that takes advantage of the target document mapping in the\n * QueryCache. The IndexFreeQueryEngine optimizes query execution by only\n * reading the documents that previously matched a query plus any documents that were\n * edited after the query was last listened to.\n *\n * There are some cases where Index-Free queries are not guaranteed to produce\n * the same results as full collection scans. In these cases, the\n * IndexFreeQueryEngine falls back to full query processing. These cases are:\n *\n * - Limit queries where a document that matched the query previously no longer\n * matches the query.\n *\n * - Limit queries where a document edit may cause the document to sort below\n * another document that is in the local cache.\n *\n * - Queries that have never been CURRENT or free of Limbo documents.\n */ var ju = /** @class */ function() {\n function t() {}\n return t.prototype.xh = function(t) {\n this.zu = t;\n }, t.prototype.Lr = function(t, e, n, r) {\n var i = this;\n // Queries that match all documents don't benefit from using\n // IndexFreeQueries. It is more efficient to scan all documents in a\n // collection, rather than to perform individual lookups.\n return function(t) {\n return 0 === t.filters.length && null === t.limit && null == t.startAt && null == t.endAt && (0 === t.on.length || 1 === t.on.length && t.on[0].field.W());\n }(e) || n.isEqual(H.min()) ? this.Hu(t, e) : this.zu.Or(t, r).next((function(o) {\n var s = i.Ju(e, o);\n return (kn(e) || Pn(e)) && i.mu(e.an, s, r, n) ? i.Hu(t, e) : (_() <= u.DEBUG && T(\"IndexFreeQueryEngine\", \"Re-using previous result from %s to execute query: %s\", n.toString(), Gn(e)), \n i.zu.Lr(t, e, n).next((function(t) {\n // We merge `previousResults` into `updateResults`, since\n // `updateResults` is already a DocumentMap. If a document is\n // contained in both lists, then its contents are the same.\n return s.forEach((function(e) {\n t = t.ot(e.key, e);\n })), t;\n })));\n }));\n // Queries that have never seen a snapshot without limbo free documents\n // should also be run as a full collection scan.\n }, \n /** Applies the query filter and sorting to the provided documents. */ t.prototype.Ju = function(t, e) {\n // Sort the documents and re-apply the query filter since previously\n // matching documents do not necessarily still match the query.\n var n = new mt(zn(t));\n return e.forEach((function(e, r) {\n r instanceof Tn && Bn(t, r) && (n = n.add(r));\n })), n;\n }, \n /**\n * Determines if a limit query needs to be refilled from cache, making it\n * ineligible for index-free execution.\n *\n * @param sortedPreviousResults The documents that matched the query when it\n * was last synchronized, sorted by the query's comparator.\n * @param remoteKeys The document keys that matched the query at the last\n * snapshot.\n * @param limboFreeSnapshotVersion The version of the snapshot when the query\n * was last synchronized.\n */\n t.prototype.mu = function(t, e, n, r) {\n // The query needs to be refilled if a previously matching document no\n // longer matches.\n if (n.size !== e.size) return !0;\n // Limit queries are not eligible for index-free query execution if there is\n // a potential that an older document from cache now sorts before a document\n // that was previously part of the limit. This, however, can only happen if\n // the document at the edge of the limit goes out of limit.\n // If a document that is not the limit boundary sorts differently,\n // the boundary of the limit itself did not change and documents from cache\n // will continue to be \"rejected\" by this boundary. Therefore, we can ignore\n // any modifications that don't affect the last document.\n var i = \"F\" /* First */ === t ? e.last() : e.first();\n return !!i && (i.hasPendingWrites || i.version.h(r) > 0);\n }, t.prototype.Hu = function(t, e) {\n return _() <= u.DEBUG && T(\"IndexFreeQueryEngine\", \"Using full collection scan to execute query:\", Gn(e)), \n this.zu.Lr(t, e, H.min());\n }, t;\n}(), Gu = /** @class */ function() {\n function t(t, e) {\n this.Dr = t, this.No = e, \n /**\n * The set of all mutations that have been sent but not yet been applied to\n * the backend.\n */\n this.Sr = [], \n /** Next value to use when assigning sequential IDs to each mutation batch. */\n this.Yu = 1, \n /** An ordered mapping between documents and the mutations batch IDs. */\n this.Xu = new mt(_o.Mh);\n }\n return t.prototype.ko = function(t) {\n return cr.resolve(0 === this.Sr.length);\n }, t.prototype.Oo = function(t, e, n, r) {\n var i = this.Yu;\n this.Yu++, this.Sr.length > 0 && this.Sr[this.Sr.length - 1];\n var o = new zr(i, e, n, r);\n this.Sr.push(o);\n // Track references by document key and index collection parents.\n for (var u = 0, s = r; u < s.length; u++) {\n var a = s[u];\n this.Xu = this.Xu.add(new _o(a.key, i)), this.Dr.Mo(t, a.key.path.F());\n }\n return cr.resolve(o);\n }, t.prototype.$o = function(t, e) {\n return cr.resolve(this.Zu(e));\n }, t.prototype.Bo = function(t, e) {\n var n = e + 1, r = this.tl(n), i = r < 0 ? 0 : r;\n // The requested batchId may still be out of range so normalize it to the\n // start of the queue.\n return cr.resolve(this.Sr.length > i ? this.Sr[i] : null);\n }, t.prototype.qo = function() {\n return cr.resolve(0 === this.Sr.length ? -1 : this.Yu - 1);\n }, t.prototype.Uo = function(t) {\n return cr.resolve(this.Sr.slice());\n }, t.prototype.Nr = function(t, e) {\n var n = this, r = new _o(e, 0), i = new _o(e, Number.POSITIVE_INFINITY), o = [];\n return this.Xu.xt([ r, i ], (function(t) {\n var e = n.Zu(t.jh);\n o.push(e);\n })), cr.resolve(o);\n }, t.prototype.$r = function(t, e) {\n var n = this, r = new mt(L);\n return e.forEach((function(t) {\n var e = new _o(t, 0), i = new _o(t, Number.POSITIVE_INFINITY);\n n.Xu.xt([ e, i ], (function(t) {\n r = r.add(t.jh);\n }));\n })), cr.resolve(this.el(r));\n }, t.prototype.Qr = function(t, e) {\n // Use the query path as a prefix for testing if a document matches the\n // query.\n var n = e.path, r = n.length + 1, i = n;\n // Construct a document reference for actually scanning the index. Unlike\n // the prefix the document key in this reference must have an even number of\n // segments. The empty segment can be used a suffix of the query path\n // because it precedes all other segments in an ordered traversal.\n Z.X(i) || (i = i.child(\"\"));\n var o = new _o(new Z(i), 0), u = new mt(L);\n // Find unique batchIDs referenced by all documents potentially matching the\n // query.\n return this.Xu.Ft((function(t) {\n var e = t.key.path;\n return !!n.M(e) && (\n // Rows with document keys more than one segment longer than the query\n // path can't be matches. For example, a query on 'rooms' can't match\n // the document /rooms/abc/messages/xyx.\n // TODO(mcg): we'll need a different scanner when we implement\n // ancestor queries.\n e.length === r && (u = u.add(t.jh)), !0);\n }), o), cr.resolve(this.el(u));\n }, t.prototype.el = function(t) {\n var e = this, n = [];\n // Construct an array of matching batches, sorted by batchID to ensure that\n // multiple mutations affecting the same document key are applied in order.\n return t.forEach((function(t) {\n var r = e.Zu(t);\n null !== r && n.push(r);\n })), n;\n }, t.prototype.Qo = function(t, e) {\n var n = this;\n x(0 === this.nl(e.batchId, \"removed\")), this.Sr.shift();\n var r = this.Xu;\n return cr.forEach(e.mutations, (function(i) {\n var o = new _o(i.key, e.batchId);\n return r = r.delete(o), n.No.Go(t, i.key);\n })).next((function() {\n n.Xu = r;\n }));\n }, t.prototype.jo = function(t) {\n // No-op since the memory mutation queue does not maintain a separate cache.\n }, t.prototype.Ho = function(t, e) {\n var n = new _o(e, 0), r = this.Xu.kt(n);\n return cr.resolve(e.isEqual(r && r.key));\n }, t.prototype.zo = function(t) {\n return this.Sr.length, cr.resolve();\n }, \n /**\n * Finds the index of the given batchId in the mutation queue and asserts that\n * the resulting index is within the bounds of the queue.\n *\n * @param batchId The batchId to search for\n * @param action A description of what the caller is doing, phrased in passive\n * form (e.g. \"acknowledged\" in a routine that acknowledges batches).\n */\n t.prototype.nl = function(t, e) {\n return this.tl(t);\n }, \n /**\n * Finds the index of the given batchId in the mutation queue. This operation\n * is O(1).\n *\n * @return The computed index of the batch with the given batchId, based on\n * the state of the queue. Note this index can be negative if the requested\n * batchId has already been remvoed from the queue or past the end of the\n * queue if the batchId is larger than the last added batch.\n */\n t.prototype.tl = function(t) {\n return 0 === this.Sr.length ? 0 : t - this.Sr[0].batchId;\n // Examine the front of the queue to figure out the difference between the\n // batchId and indexes in the array. Note that since the queue is ordered\n // by batchId, if the first batch has a larger batchId then the requested\n // batchId doesn't exist in the queue.\n }, \n /**\n * A version of lookupMutationBatch that doesn't return a promise, this makes\n * other functions that uses this code easier to read and more efficent.\n */\n t.prototype.Zu = function(t) {\n var e = this.tl(t);\n return e < 0 || e >= this.Sr.length ? null : this.Sr[e];\n }, t;\n}(), Bu = /** @class */ function() {\n /**\n * @param sizer Used to assess the size of a document. For eager GC, this is expected to just\n * return 0 to avoid unnecessarily doing the work of calculating the size.\n */\n function t(t, e) {\n this.Dr = t, this.sl = e, \n /** Underlying cache of documents and their read times. */\n this.docs = new dt(Z.D), \n /** Size of all cached documents. */\n this.size = 0\n /**\n * Adds the supplied entry to the cache and updates the cache size as appropriate.\n *\n * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\n * returned by `newChangeBuffer()`.\n */;\n }\n return t.prototype.Ir = function(t, e, n) {\n var r = e.key, i = this.docs.get(r), o = i ? i.size : 0, u = this.sl(e);\n return this.docs = this.docs.ot(r, {\n ta: e,\n size: u,\n readTime: n\n }), this.size += u - o, this.Dr.Mo(t, r.path.F());\n }, \n /**\n * Removes the specified entry from the cache and updates the cache size as appropriate.\n *\n * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\n * returned by `newChangeBuffer()`.\n */\n t.prototype.Ar = function(t) {\n var e = this.docs.get(t);\n e && (this.docs = this.docs.remove(t), this.size -= e.size);\n }, t.prototype.Rr = function(t, e) {\n var n = this.docs.get(e);\n return cr.resolve(n ? n.ta : null);\n }, t.prototype.getEntries = function(t, e) {\n var n = this, r = It();\n return e.forEach((function(t) {\n var e = n.docs.get(t);\n r = r.ot(t, e ? e.ta : null);\n })), cr.resolve(r);\n }, t.prototype.Lr = function(t, e, n) {\n for (var r = _t(), i = new Z(e.path.child(\"\")), o = this.docs.ft(i)\n // Documents are ordered by key, so we can use a prefix scan to narrow down\n // the documents we need to match the query against.\n ; o.At(); ) {\n var u = o.It(), s = u.key, a = u.value, c = a.ta, h = a.readTime;\n if (!e.path.M(s.path)) break;\n h.h(n) <= 0 || c instanceof Tn && Bn(e, c) && (r = r.ot(c.key, c));\n }\n return cr.resolve(r);\n }, t.prototype.il = function(t, e) {\n return cr.forEach(this.docs, (function(t) {\n return e(t);\n }));\n }, t.prototype.ra = function(t) {\n // `trackRemovals` is ignores since the MemoryRemoteDocumentCache keeps\n // a separate changelog and does not need special handling for removals.\n return new zu(this);\n }, t.prototype.aa = function(t) {\n return cr.resolve(this.size);\n }, t;\n}(), zu = /** @class */ function(e) {\n function n(t) {\n var n = this;\n return (n = e.call(this) || this).ha = t, n;\n }\n return t(n, e), n.prototype.Vr = function(t) {\n var e = this, n = [];\n return this.wr.forEach((function(r, i) {\n i ? n.push(e.ha.Ir(t, i, e.readTime)) : e.ha.Ar(r);\n })), cr.kn(n);\n }, n.prototype.Pr = function(t, e) {\n return this.ha.Rr(t, e);\n }, n.prototype.gr = function(t, e) {\n return this.ha.getEntries(t, e);\n }, n;\n}(Wr), Ku = /** @class */ function() {\n function t(t) {\n this.persistence = t, \n /**\n * Maps a target to the data about that target\n */\n this.rl = new W((function(t) {\n return ot(t);\n }), ut), \n /** The last received snapshot version. */\n this.lastRemoteSnapshotVersion = H.min(), \n /** The highest numbered target ID encountered. */\n this.highestTargetId = 0, \n /** The highest sequence number encountered. */\n this.ol = 0, \n /**\n * A ordered bidirectional mapping between documents and the remote target\n * IDs.\n */\n this.al = new Eo, this.targetCount = 0, this.hl = Xi.fa();\n }\n return t.prototype.Ce = function(t, e) {\n return this.rl.forEach((function(t, n) {\n return e(n);\n })), cr.resolve();\n }, t.prototype.Ia = function(t) {\n return cr.resolve(this.lastRemoteSnapshotVersion);\n }, t.prototype.ma = function(t) {\n return cr.resolve(this.ol);\n }, t.prototype.wa = function(t) {\n return this.highestTargetId = this.hl.next(), cr.resolve(this.highestTargetId);\n }, t.prototype.Aa = function(t, e, n) {\n return n && (this.lastRemoteSnapshotVersion = n), e > this.ol && (this.ol = e), \n cr.resolve();\n }, t.prototype.Pa = function(t) {\n this.rl.set(t.target, t);\n var e = t.targetId;\n e > this.highestTargetId && (this.hl = new Xi(e), this.highestTargetId = e), t.sequenceNumber > this.ol && (this.ol = t.sequenceNumber);\n }, t.prototype.Ra = function(t, e) {\n return this.Pa(e), this.targetCount += 1, cr.resolve();\n }, t.prototype.Va = function(t, e) {\n return this.Pa(e), cr.resolve();\n }, t.prototype.ya = function(t, e) {\n return this.rl.delete(e.target), this.al.Kh(e.targetId), this.targetCount -= 1, \n cr.resolve();\n }, t.prototype.po = function(t, e, n) {\n var r = this, i = 0, o = [];\n return this.rl.forEach((function(u, s) {\n s.sequenceNumber <= e && null === n.get(s.targetId) && (r.rl.delete(u), o.push(r.pa(t, s.targetId)), \n i++);\n })), cr.kn(o).next((function() {\n return i;\n }));\n }, t.prototype.ba = function(t) {\n return cr.resolve(this.targetCount);\n }, t.prototype.va = function(t, e) {\n var n = this.rl.get(e) || null;\n return cr.resolve(n);\n }, t.prototype.Sa = function(t, e, n) {\n return this.al.Bh(e, n), cr.resolve();\n }, t.prototype.Ca = function(t, e, n) {\n this.al.Uh(e, n);\n var r = this.persistence.No, i = [];\n return r && e.forEach((function(e) {\n i.push(r.Go(t, e));\n })), cr.kn(i);\n }, t.prototype.pa = function(t, e) {\n return this.al.Kh(e), cr.resolve();\n }, t.prototype.xa = function(t, e) {\n var n = this.al.Wh(e);\n return cr.resolve(n);\n }, t.prototype.Ho = function(t, e) {\n return cr.resolve(this.al.Ho(e));\n }, t;\n}(), Wu = /** @class */ function() {\n /**\n * The constructor accepts a factory for creating a reference delegate. This\n * allows both the delegate and this instance to have strong references to\n * each other without having nullable fields that would then need to be\n * checked or asserted on every access.\n */\n function t(t) {\n var e = this;\n this.cl = {}, this.Ma = new Lr(0), this.$a = !1, this.$a = !0, this.No = t(this), \n this.ja = new Ku(this), this.Dr = new xi, this.vr = function(t, n) {\n return new Bu(t, (function(t) {\n return e.No.ul(t);\n }));\n }(this.Dr);\n }\n return t.prototype.start = function() {\n return Promise.resolve();\n }, t.prototype.Di = function() {\n // No durable state to ensure is closed on shutdown.\n return this.$a = !1, Promise.resolve();\n }, Object.defineProperty(t.prototype, \"Ii\", {\n get: function() {\n return this.$a;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.Za = function() {\n // No op.\n }, t.prototype.th = function() {\n // No op.\n }, t.prototype.Ah = function() {\n return this.Dr;\n }, t.prototype.Th = function(t) {\n var e = this.cl[t.ti()];\n return e || (e = new Gu(this.Dr, this.No), this.cl[t.ti()] = e), e;\n }, t.prototype.Ih = function() {\n return this.ja;\n }, t.prototype.mh = function() {\n return this.vr;\n }, t.prototype.runTransaction = function(t, e, n) {\n var r = this;\n T(\"MemoryPersistence\", \"Starting transaction:\", t);\n var i = new Qu(this.Ma.next());\n return this.No.ll(), n(i).next((function(t) {\n return r.No._l(i).next((function() {\n return t;\n }));\n })).xn().then((function(t) {\n return i.br(), t;\n }));\n }, t.prototype.fl = function(t, e) {\n return cr.On(Object.values(this.cl).map((function(n) {\n return function() {\n return n.Ho(t, e);\n };\n })));\n }, t;\n}(), Qu = /** @class */ function(e) {\n function n(t) {\n var n = this;\n return (n = e.call(this) || this).Fa = t, n;\n }\n return t(n, e), n;\n}(Hr), Hu = /** @class */ function() {\n function t(t) {\n this.persistence = t, \n /** Tracks all documents that are active in Query views. */\n this.dl = new Eo, \n /** The list of documents that are potentially GCed after each transaction. */\n this.wl = null;\n }\n return t.El = function(e) {\n return new t(e);\n }, Object.defineProperty(t.prototype, \"Tl\", {\n get: function() {\n if (this.wl) return this.wl;\n throw S();\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.Da = function(t, e, n) {\n return this.dl.Da(n, e), this.Tl.delete(n.toString()), cr.resolve();\n }, t.prototype.Na = function(t, e, n) {\n return this.dl.Na(n, e), this.Tl.add(n.toString()), cr.resolve();\n }, t.prototype.Go = function(t, e) {\n return this.Tl.add(e.toString()), cr.resolve();\n }, t.prototype.removeTarget = function(t, e) {\n var n = this;\n this.dl.Kh(e.targetId).forEach((function(t) {\n return n.Tl.add(t.toString());\n }));\n var r = this.persistence.Ih();\n return r.xa(t, e.targetId).next((function(t) {\n t.forEach((function(t) {\n return n.Tl.add(t.toString());\n }));\n })).next((function() {\n return r.ya(t, e);\n }));\n }, t.prototype.ll = function() {\n this.wl = new Set;\n }, t.prototype._l = function(t) {\n var e = this, n = this.persistence.mh().ra();\n // Remove newly orphaned documents.\n return cr.forEach(this.Tl, (function(r) {\n var i = Z.H(r);\n return e.Il(t, i).next((function(t) {\n t || n.Ar(i);\n }));\n })).next((function() {\n return e.wl = null, n.apply(t);\n }));\n }, t.prototype.yh = function(t, e) {\n var n = this;\n return this.Il(t, e).next((function(t) {\n t ? n.Tl.delete(e.toString()) : n.Tl.add(e.toString());\n }));\n }, t.prototype.ul = function(t) {\n // For eager GC, we don't care about the document size, there are no size thresholds.\n return 0;\n }, t.prototype.Il = function(t, e) {\n var n = this;\n return cr.On([ function() {\n return cr.resolve(n.dl.Ho(e));\n }, function() {\n return n.persistence.Ih().Ho(t, e);\n }, function() {\n return n.persistence.fl(t, e);\n } ]);\n }, t;\n}(), Yu = /** @class */ function() {\n function t(t) {\n this.ml = t.ml, this.Al = t.Al;\n }\n return t.prototype.gc = function(t) {\n this.Rl = t;\n }, t.prototype.Ic = function(t) {\n this.Pl = t;\n }, t.prototype.onMessage = function(t) {\n this.gl = t;\n }, t.prototype.close = function() {\n this.Al();\n }, t.prototype.send = function(t) {\n this.ml(t);\n }, t.prototype.Vl = function() {\n this.Rl();\n }, t.prototype.yl = function(t) {\n this.Pl(t);\n }, t.prototype.pl = function(t) {\n this.gl(t);\n }, t;\n}(), Xu = {\n BatchGetDocuments: \"batchGet\",\n Commit: \"commit\",\n RunQuery: \"runQuery\"\n}, Ju = /** @class */ function(e) {\n function n(t) {\n var n = this;\n return (n = e.call(this, t) || this).forceLongPolling = t.forceLongPolling, n.T = t.T, \n n;\n }\n /**\n * Base class for all Rest-based connections to the backend (WebChannel and\n * HTTP).\n */\n return t(n, e), n.prototype.Nl = function(t, e, n, r) {\n return new Promise((function(i, o) {\n var u = new d;\n u.listenOnce(v.COMPLETE, (function() {\n try {\n switch (u.getLastErrorCode()) {\n case y.NO_ERROR:\n var e = u.getResponseJson();\n T(\"Connection\", \"XHR received:\", JSON.stringify(e)), i(e);\n break;\n\n case y.TIMEOUT:\n T(\"Connection\", 'RPC \"' + t + '\" timed out'), o(new I(b.DEADLINE_EXCEEDED, \"Request time out\"));\n break;\n\n case y.HTTP_ERROR:\n var n = u.getStatus();\n if (T(\"Connection\", 'RPC \"' + t + '\" failed with status:', n, \"response text:\", u.getResponseText()), \n n > 0) {\n var r = u.getResponseJson().error;\n if (r && r.status && r.message) {\n var s = function(t) {\n var e = t.toLowerCase().replace(\"_\", \"-\");\n return Object.values(b).indexOf(e) >= 0 ? e : b.UNKNOWN;\n }(r.status);\n o(new I(s, r.message));\n } else o(new I(b.UNKNOWN, \"Server responded with status \" + u.getStatus()));\n } else \n // If we received an HTTP_ERROR but there's no status code,\n // it's most probably a connection issue\n o(new I(b.UNAVAILABLE, \"Connection failed.\"));\n break;\n\n default:\n S();\n }\n } finally {\n T(\"Connection\", 'RPC \"' + t + '\" completed.');\n }\n }));\n var s = JSON.stringify(r);\n u.send(e, \"POST\", s, n, 15);\n }));\n }, n.prototype.Vc = function(t, e) {\n var n = [ this.vl, \"/\", \"google.firestore.v1.Firestore\", \"/\", t, \"/channel\" ], r = m(), i = {\n // Required for backend stickiness, routing behavior is based on this\n // parameter.\n httpSessionIdParam: \"gsessionid\",\n initMessageHeaders: {},\n messageUrlParams: {\n // This param is used to improve routing and project isolation by the\n // backend and must be included in every request.\n database: \"projects/\" + this._.projectId + \"/databases/\" + this._.database\n },\n sendRawJson: !0,\n supportsCrossDomainXhr: !0,\n internalChannelParams: {\n // Override the default timeout (randomized between 10-20 seconds) since\n // a large write batch on a slow internet connection may take a long\n // time to send to the backend. Rather than have WebChannel impose a\n // tight timeout which could lead to infinite timeouts and retries, we\n // set it very large (5-10 minutes) and rely on the browser's builtin\n // timeouts to kick in if the request isn't working.\n forwardChannelRequestTimeoutMs: 6e5\n },\n forceLongPolling: this.forceLongPolling,\n detectBufferingProxy: this.T\n };\n this.Cl(i.initMessageHeaders, e), \n // Sending the custom headers we just added to request.initMessageHeaders\n // (Authorization, etc.) will trigger the browser to make a CORS preflight\n // request because the XHR will no longer meet the criteria for a \"simple\"\n // CORS request:\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests\n // Therefore to avoid the CORS preflight request (an extra network\n // roundtrip), we use the httpHeadersOverwriteParam option to specify that\n // the headers should instead be encoded into a special \"$httpHeaders\" query\n // parameter, which is recognized by the webchannel backend. This is\n // formally defined here:\n // https://github.com/google/closure-library/blob/b0e1815b13fb92a46d7c9b3c30de5d6a396a3245/closure/goog/net/rpc/httpcors.js#L32\n // TODO(b/145624756): There is a backend bug where $httpHeaders isn't respected if the request\n // doesn't have an Origin header. So we have to exclude a few browser environments that are\n // known to (sometimes) not include an Origin. See\n // https://github.com/firebase/firebase-js-sdk/issues/1491.\n a() || c() || h() || f() || l() || p() || (i.httpHeadersOverwriteParam = \"$httpHeaders\");\n var o = n.join(\"\");\n T(\"Connection\", \"Creating WebChannel: \" + o, i);\n var u = r.createWebChannel(o, i), s = !1, d = !1, v = new Yu({\n ml: function(t) {\n d ? T(\"Connection\", \"Not sending because WebChannel is closed:\", t) : (s || (T(\"Connection\", \"Opening WebChannel transport.\"), \n u.open(), s = !0), T(\"Connection\", \"WebChannel sending:\", t), u.send(t));\n },\n Al: function() {\n return u.close();\n }\n }), y = function(t, e) {\n // TODO(dimond): closure typing seems broken because WebChannel does\n // not implement goog.events.Listenable\n u.listen(t, (function(t) {\n try {\n e(t);\n } catch (t) {\n setTimeout((function() {\n throw t;\n }), 0);\n }\n }));\n };\n // WebChannel supports sending the first message with the handshake - saving\n // a network round trip. However, it will have to call send in the same\n // JS event loop as open. In order to enforce this, we delay actually\n // opening the WebChannel until send is called. Whether we have called\n // open is tracked with this variable.\n // Closure events are guarded and exceptions are swallowed, so catch any\n // exception and rethrow using a setTimeout so they become visible again.\n // Note that eventually this function could go away if we are confident\n // enough the code is exception free.\n return y(g.EventType.OPEN, (function() {\n d || T(\"Connection\", \"WebChannel transport opened.\");\n })), y(g.EventType.CLOSE, (function() {\n d || (d = !0, T(\"Connection\", \"WebChannel transport closed\"), v.yl());\n })), y(g.EventType.ERROR, (function(t) {\n d || (d = !0, A(\"Connection\", \"WebChannel transport errored:\", t), v.yl(new I(b.UNAVAILABLE, \"The operation could not be completed\")));\n })), y(g.EventType.MESSAGE, (function(t) {\n var e;\n if (!d) {\n var n = t.data[0];\n x(!!n);\n // TODO(b/35143891): There is a bug in One Platform that caused errors\n // (and only errors) to be wrapped in an extra array. To be forward\n // compatible with the bug we need to check either condition. The latter\n // can be removed once the fix has been rolled out.\n // Use any because msgData.error is not typed.\n var r = n, i = r.error || (null === (e = r[0]) || void 0 === e ? void 0 : e.error);\n if (i) {\n T(\"Connection\", \"WebChannel received error:\", i);\n // error.status will be a string like 'OK' or 'NOT_FOUND'.\n var o = i.status, s = function(t) {\n // lookup by string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var e = at[t];\n if (void 0 !== e) return pt(e);\n }(o), a = i.message;\n void 0 === s && (s = b.INTERNAL, a = \"Unknown error status: \" + o + \" with message \" + i.message), \n // Mark closed so no further events are propagated\n d = !0, v.yl(new I(s, a)), u.close();\n } else T(\"Connection\", \"WebChannel received:\", n), v.pl(n);\n }\n })), setTimeout((function() {\n // Technically we could/should wait for the WebChannel opened event,\n // but because we want to send the first message with the WebChannel\n // handshake we pretend the channel opened here (asynchronously), and\n // then delay the actual open until the first message is sent.\n v.Vl();\n }), 0), v;\n }, n;\n}(/** @class */ function() {\n function t(t) {\n this.bl = t, this._ = t._;\n var e = t.ssl ? \"https\" : \"http\";\n this.vl = e + \"://\" + t.host, this.Sl = \"projects/\" + this._.projectId + \"/databases/\" + this._.database + \"/documents\";\n }\n return t.prototype.Mc = function(t, e, n, r) {\n var i = this.Dl(t, e);\n T(\"RestConnection\", \"Sending: \", i, n);\n var o = {};\n return this.Cl(o, r), this.Nl(t, i, o, n).then((function(t) {\n return T(\"RestConnection\", \"Received: \", t), t;\n }), (function(e) {\n throw A(\"RestConnection\", t + \" failed with error: \", e, \"url: \", i, \"request:\", n), \n e;\n }));\n }, t.prototype.$c = function(t, e, n, r) {\n // The REST API automatically aggregates all of the streamed results, so we\n // can just use the normal invoke() method.\n return this.Mc(t, e, n, r);\n }, \n /**\n * Modifies the headers for a request, adding any authorization token if\n * present and any additional headers for the request.\n */\n t.prototype.Cl = function(t, e) {\n if (t[\"X-Goog-Api-Client\"] = \"gl-js/ fire/8.0.0\", \n // Content-Type: text/plain will avoid preflight requests which might\n // mess with CORS and redirects by proxies. If we add custom headers\n // we will need to change this code to potentially use the $httpOverwrite\n // parameter supported by ESF to avoid triggering preflight requests.\n t[\"Content-Type\"] = \"text/plain\", e) for (var n in e.Gh) e.Gh.hasOwnProperty(n) && (t[n] = e.Gh[n]);\n }, t.prototype.Dl = function(t, e) {\n var n = Xu[t];\n return this.vl + \"/v1/\" + e + \":\" + n;\n }, t;\n}()), $u = /** @class */ function() {\n function t() {\n var t = this;\n this.xl = function() {\n return t.Fl();\n }, this.kl = function() {\n return t.Ol();\n }, this.Ml = [], this.$l();\n }\n return t.prototype.eu = function(t) {\n this.Ml.push(t);\n }, t.prototype.Di = function() {\n window.removeEventListener(\"online\", this.xl), window.removeEventListener(\"offline\", this.kl);\n }, t.prototype.$l = function() {\n window.addEventListener(\"online\", this.xl), window.addEventListener(\"offline\", this.kl);\n }, t.prototype.Fl = function() {\n T(\"ConnectivityMonitor\", \"Network connectivity changed: AVAILABLE\");\n for (var t = 0, e = this.Ml; t < e.length; t++) {\n (0, e[t])(0 /* AVAILABLE */);\n }\n }, t.prototype.Ol = function() {\n T(\"ConnectivityMonitor\", \"Network connectivity changed: UNAVAILABLE\");\n for (var t = 0, e = this.Ml; t < e.length; t++) {\n (0, e[t])(1 /* UNAVAILABLE */);\n }\n }, \n // TODO(chenbrian): Consider passing in window either into this component or\n // here for testing via FakeWindow.\n /** Checks that all used attributes of window are available. */\n t.Ln = function() {\n return \"undefined\" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener;\n }, t;\n}(), Zu = /** @class */ function() {\n function t() {}\n return t.prototype.eu = function(t) {\n // No-op.\n }, t.prototype.Di = function() {\n // No-op.\n }, t;\n}();\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Initializes the WebChannelConnection for the browser. */\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction ts(t) {\n return new ce(t, /* useProto3Json= */ !0);\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Provides all components needed for Firestore with in-memory persistence.\n * Uses EagerGC garbage collection.\n */ var es = /** @class */ function() {\n function t() {\n this.synchronizeTabs = !1;\n }\n return t.prototype.initialize = function(t) {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n return this.Su = this.Ll(t), this.persistence = this.Bl(t), [ 4 /*yield*/ , this.persistence.start() ];\n\n case 1:\n return e.sent(), this.ql = this.Ul(t), this.Gc = this.Kl(t), [ 2 /*return*/ ];\n }\n }));\n }));\n }, t.prototype.Ul = function(t) {\n return null;\n }, t.prototype.Kl = function(t) {\n /** Manages our in-memory or durable persistence. */\n return e = this.persistence, n = new ju, r = t.Ql, new co(e, n, r);\n var e, n, r;\n }, t.prototype.Bl = function(t) {\n return new Wu(Hu.El);\n }, t.prototype.Ll = function(t) {\n return new Br;\n }, t.prototype.terminate = function() {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(t) {\n switch (t.label) {\n case 0:\n return this.ql && this.ql.stop(), [ 4 /*yield*/ , this.Su.Di() ];\n\n case 1:\n return t.sent(), [ 4 /*yield*/ , this.persistence.Di() ];\n\n case 2:\n return t.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }, t;\n}(), ns = /** @class */ function(r) {\n function i(t, e, n) {\n var i = this;\n return (i = r.call(this) || this).Wl = t, i.cacheSizeBytes = e, i.forceOwnership = n, \n i.synchronizeTabs = !1, i;\n }\n return t(i, r), i.prototype.initialize = function(t) {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n return [ 4 /*yield*/ , r.prototype.initialize.call(this, t) ];\n\n case 1:\n return e.sent(), [ 4 /*yield*/ , bo(this.Gc) ];\n\n case 2:\n return e.sent(), [ 4 /*yield*/ , this.Wl.initialize(this, t) ];\n\n case 3:\n // Enqueue writes from a previous session\n return e.sent(), [ 4 /*yield*/ , Fu(this.Wl.fi) ];\n\n case 4:\n // Enqueue writes from a previous session\n return e.sent(), [ 4 /*yield*/ , Jo(this.Wl.bu) ];\n\n case 5:\n return e.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }, i.prototype.Ul = function(t) {\n var e = this.persistence.No.wo;\n return new ei(e, t.hs);\n }, i.prototype.Bl = function(t) {\n var e = ao(t.bl._, t.bl.persistenceKey), n = void 0 !== this.cacheSizeBytes ? ti.ao(this.cacheSizeBytes) : ti.fo, r = ts(t.bl._);\n return new ro(this.synchronizeTabs, e, t.clientId, n, t.hs, wr(), br(), r, this.Su, !!this.forceOwnership);\n }, i.prototype.Ll = function(t) {\n return new Br;\n }, i;\n}(es), rs = /** @class */ function(r) {\n function i(t, e) {\n var n = this;\n return (n = r.call(this, t, e, /* forceOwnership= */ !1) || this).Wl = t, n.cacheSizeBytes = e, \n n.synchronizeTabs = !0, n;\n }\n return t(i, r), i.prototype.initialize = function(t) {\n return e(this, void 0, void 0, (function() {\n var i, o = this;\n return n(this, (function(u) {\n switch (u.label) {\n case 0:\n return [ 4 /*yield*/ , r.prototype.initialize.call(this, t) ];\n\n case 1:\n return u.sent(), i = this.Wl.fi, this.Su instanceof Gr ? (this.Su.fi = {\n er: Ou.bind(null, i),\n nr: Uu.bind(null, i),\n sr: Mu.bind(null, i),\n pi: Cu.bind(null, i)\n }, [ 4 /*yield*/ , this.Su.start() ]) : [ 3 /*break*/ , 3 ];\n\n case 2:\n u.sent(), u.label = 3;\n\n case 3:\n // NOTE: This will immediately call the listener, so we make sure to\n // set it after localStore / remoteStore are started.\n return [ 4 /*yield*/ , this.persistence.Xa((function(t) {\n return e(o, void 0, void 0, (function() {\n return n(this, (function(e) {\n switch (e.label) {\n case 0:\n return [ 4 /*yield*/ , Lu(this.Wl.fi, t) ];\n\n case 1:\n return e.sent(), this.ql && (t && !this.ql.Ii ? this.ql.start(this.Gc) : t || this.ql.stop()), \n [ 2 /*return*/ ];\n }\n }));\n }));\n })) ];\n\n case 4:\n // NOTE: This will immediately call the listener, so we make sure to\n // set it after localStore / remoteStore are started.\n return u.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }, i.prototype.Ll = function(t) {\n var e = wr();\n if (!Gr.Ln(e)) throw new I(b.UNIMPLEMENTED, \"IndexedDB persistence is only available on platforms that support LocalStorage.\");\n var n = ao(t.bl._, t.bl.persistenceKey);\n return new Gr(e, t.hs, n, t.clientId, t.Ql);\n }, i;\n}(ns), is = /** @class */ function() {\n function t() {}\n return t.prototype.initialize = function(t, r) {\n return e(this, void 0, void 0, (function() {\n var e = this;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return this.Gc ? [ 3 /*break*/ , 2 ] : (this.Gc = t.Gc, this.Su = t.Su, this.zc = this.jl(r), \n this.bu = this.Gl(r), this.vu = this.zl(r), this.fi = this.Hl(r, \n /* startAsPrimary=*/ !t.synchronizeTabs), this.Su.di = function(t) {\n return mu(e.fi, t, 1 /* SharedClientState */);\n }, this.bu.Hc.Jl = xu.bind(null, this.fi), [ 4 /*yield*/ , iu(this.bu, this.fi.Uu) ]);\n\n case 1:\n n.sent(), n.label = 2;\n\n case 2:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }, t.prototype.zl = function(t) {\n return new Nr;\n }, t.prototype.jl = function(t) {\n var e, n = ts(t.bl._), r = (e = t.bl, new Ju(e));\n /** Return the Platform-specific connectivity monitor. */ return function(t, e, n) {\n return new Oo(t, e, n);\n }(t.credentials, r, n);\n }, t.prototype.Gl = function(t) {\n var e, n, r, i, o, u = this;\n return e = this.Gc, n = this.zc, r = t.hs, i = function(t) {\n return mu(u.fi, t, 0 /* RemoteStore */);\n }, o = $u.Ln() ? new $u : new Zu, new Vo(e, n, r, i, o);\n }, t.prototype.Hl = function(t, e) {\n return function(t, e, n, \n // PORTING NOTE: Manages state synchronization in multi-tab environments.\n r, i, o, u) {\n var s = new lu(t, e, n, r, i, o);\n return u && (s.qu = !0), s;\n }(this.Gc, this.bu, this.vu, this.Su, t.Ql, t.Du, e);\n }, t.prototype.terminate = function() {\n return Uo(this.bu);\n }, t;\n}(), os = /** @class */ function() {\n function t(t) {\n this.observer = t, \n /**\n * When set to true, will not raise future events. Necessary to deal with\n * async detachment of listener.\n */\n this.muted = !1;\n }\n return t.prototype.next = function(t) {\n this.observer.next && this.Yl(this.observer.next, t);\n }, t.prototype.error = function(t) {\n this.observer.error ? this.Yl(this.observer.error, t) : console.error(\"Uncaught Error in snapshot listener:\", t);\n }, t.prototype.Xl = function() {\n this.muted = !0;\n }, t.prototype.Yl = function(t, e) {\n var n = this;\n this.muted || setTimeout((function() {\n n.muted || t(e);\n }), 0);\n }, t;\n}();\n\n/**\n * Provides all components needed for Firestore with IndexedDB persistence.\n */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction us(t, e, n) {\n if (!n) throw new I(b.INVALID_ARGUMENT, \"Function \" + t + \"() cannot be called with an empty \" + e + \".\");\n}\n\nfunction ss(t, e) {\n if (void 0 === e) return {\n merge: !1\n };\n if (void 0 !== e.mergeFields && void 0 !== e.merge) throw new I(b.INVALID_ARGUMENT, \"Invalid options passed to function \" + t + '(): You cannot specify both \"merge\" and \"mergeFields\".');\n return e;\n}\n\n/**\n * Validates that two boolean options are not set at the same time.\n */ function as(t, e, n, r) {\n if (!0 === e && !0 === r) throw new I(b.INVALID_ARGUMENT, t + \" and \" + n + \" cannot be used together.\");\n}\n\n/**\n * Returns true if it's a non-null object without a custom prototype\n * (i.e. excludes Array, Date, etc.).\n */\n/** Returns a string describing the type / value of the provided input. */ function cs(t) {\n if (void 0 === t) return \"undefined\";\n if (null === t) return \"null\";\n if (\"string\" == typeof t) return t.length > 20 && (t = t.substring(0, 20) + \"...\"), \n JSON.stringify(t);\n if (\"number\" == typeof t || \"boolean\" == typeof t) return \"\" + t;\n if (\"object\" == typeof t) {\n if (t instanceof Array) return \"an array\";\n var e = \n /** Hacky method to try to get the constructor name for an object. */\n function(t) {\n if (t.constructor) {\n var e = /function\\s+([^\\s(]+)\\s*\\(/.exec(t.constructor.toString());\n if (e && e.length > 1) return e[1];\n }\n return null;\n }(t);\n return e ? \"a custom \" + e + \" object\" : \"an object\";\n }\n return \"function\" == typeof t ? \"a function\" : S();\n}\n\nfunction hs(t, e) {\n if (e <= 0) throw new I(b.INVALID_ARGUMENT, \"Function \" + t + \"() requires a positive number, but it was: \" + e + \".\");\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// The objects that are a part of this API are exposed to third-parties as\n// compiled javascript so we want to flag our private members with a leading\n// underscore to discourage their use.\n/**\n * A field class base class that is shared by the lite, full and legacy SDK,\n * which supports shared code that deals with FieldPaths.\n */\n// Use underscore prefix to hide this class from our Public API.\n// eslint-disable-next-line @typescript-eslint/naming-convention\nvar fs = function(t) {\n for (var e = 0; e < t.length; ++e) if (0 === t[e].length) throw new I(b.INVALID_ARGUMENT, \"Invalid field name at argument $(i + 1). Field names must not be empty.\");\n this.Zl = new $(t);\n}, ls = /** @class */ function(e) {\n /**\n * Creates a FieldPath from the provided field names. If more than one field\n * name is provided, the path will point to a nested field in a document.\n *\n * @param fieldNames A list of field names.\n */\n function n() {\n for (var t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n];\n return e.call(this, t) || this;\n }\n return t(n, e), n.documentId = function() {\n /**\n * Internal Note: The backend doesn't technically support querying by\n * document ID. Instead it queries by the entire document name (full path\n * included), but in the cases we currently support documentId(), the net\n * effect is the same.\n */\n return new n($.j().B());\n }, n.prototype.isEqual = function(t) {\n return t instanceof n && this.Zl.isEqual(t.Zl);\n }, n;\n}(fs), ps = new RegExp(\"[~\\\\*/\\\\[\\\\]]\"), ds = \n/**\n * @param _methodName The public API endpoint that returns this class.\n */\nfunction(t) {\n this.t_ = t;\n}, vs = /** @class */ function(e) {\n function n() {\n return null !== e && e.apply(this, arguments) || this;\n }\n return t(n, e), n.prototype.e_ = function(t) {\n if (2 /* MergeSet */ !== t.n_) throw 1 /* Update */ === t.n_ ? t.s_(this.t_ + \"() can only appear at the top level of your update data\") : t.s_(this.t_ + \"() cannot be used with set() unless you pass {merge:true}\");\n // No transform to add for a delete, but we need to add it to our\n // fieldMask so it gets deleted.\n return t.Qe.push(t.path), null;\n }, n.prototype.isEqual = function(t) {\n return t instanceof n;\n }, n;\n}(ds);\n\n/**\n * A `FieldPath` refers to a field in a document. The path may consist of a\n * single field name (referring to a top-level field in the document), or a list\n * of field names (referring to a nested field in the document).\n */\n/**\n * Creates a child context for parsing SerializableFieldValues.\n *\n * This is different than calling `ParseContext.contextWith` because it keeps\n * the fieldTransforms and fieldMask separate.\n *\n * The created context has its `dataSource` set to `UserDataSource.Argument`.\n * Although these values are used with writes, any elements in these FieldValues\n * are not considered writes since they cannot contain any FieldValue sentinels,\n * etc.\n *\n * @param fieldValue The sentinel FieldValue for which to create a child\n * context.\n * @param context The parent context.\n * @param arrayElement Whether or not the FieldValue has an array.\n */\nfunction ys(t, e, n) {\n return new Ss({\n n_: 3 /* Argument */ ,\n i_: e.settings.i_,\n methodName: t.t_,\n r_: n\n }, e._, e.serializer, e.ignoreUndefinedProperties);\n}\n\nvar ms = /** @class */ function(e) {\n function n() {\n return null !== e && e.apply(this, arguments) || this;\n }\n return t(n, e), n.prototype.e_ = function(t) {\n return new en(t.path, new We);\n }, n.prototype.isEqual = function(t) {\n return t instanceof n;\n }, n;\n}(ds), gs = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this, t) || this).o_ = n, r;\n }\n return t(n, e), n.prototype.e_ = function(t) {\n var e = ys(this, t, \n /*array=*/ !0), n = this.o_.map((function(t) {\n return Vs(t, e);\n })), r = new Qe(n);\n return new en(t.path, r);\n }, n.prototype.isEqual = function(t) {\n // TODO(mrschmidt): Implement isEquals\n return this === t;\n }, n;\n}(ds), ws = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this, t) || this).o_ = n, r;\n }\n return t(n, e), n.prototype.e_ = function(t) {\n var e = ys(this, t, \n /*array=*/ !0), n = this.o_.map((function(t) {\n return Vs(t, e);\n })), r = new Ye(n);\n return new en(t.path, r);\n }, n.prototype.isEqual = function(t) {\n // TODO(mrschmidt): Implement isEquals\n return this === t;\n }, n;\n}(ds), bs = /** @class */ function(e) {\n function n(t, n) {\n var r = this;\n return (r = e.call(this, t) || this).a_ = n, r;\n }\n return t(n, e), n.prototype.e_ = function(t) {\n var e = new Je(t.serializer, le(t.serializer, this.a_));\n return new en(t.path, e);\n }, n.prototype.isEqual = function(t) {\n // TODO(mrschmidt): Implement isEquals\n return this === t;\n }, n;\n}(ds), Is = /** @class */ function() {\n /**\n * Creates a new immutable `GeoPoint` object with the provided latitude and\n * longitude values.\n * @param latitude The latitude as number between -90 and 90.\n * @param longitude The longitude as number between -180 and 180.\n */\n function t(t, e) {\n if (!isFinite(t) || t < -90 || t > 90) throw new I(b.INVALID_ARGUMENT, \"Latitude must be a number between -90 and 90, but was: \" + t);\n if (!isFinite(e) || e < -180 || e > 180) throw new I(b.INVALID_ARGUMENT, \"Longitude must be a number between -180 and 180, but was: \" + e);\n this.h_ = t, this.c_ = e;\n }\n return Object.defineProperty(t.prototype, \"latitude\", {\n /**\n * The latitude of this `GeoPoint` instance.\n */\n get: function() {\n return this.h_;\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"longitude\", {\n /**\n * The longitude of this `GeoPoint` instance.\n */\n get: function() {\n return this.c_;\n },\n enumerable: !1,\n configurable: !0\n }), \n /**\n * Returns true if this `GeoPoint` is equal to the provided one.\n *\n * @param other The `GeoPoint` to compare against.\n * @return true if this `GeoPoint` is equal to the provided one.\n */\n t.prototype.isEqual = function(t) {\n return this.h_ === t.h_ && this.c_ === t.c_;\n }, t.prototype.toJSON = function() {\n return {\n latitude: this.h_,\n longitude: this.c_\n };\n }, \n /**\n * Actually private to JS consumers of our API, so this function is prefixed\n * with an underscore.\n */\n t.prototype.g = function(t) {\n return L(this.h_, t.h_) || L(this.c_, t.c_);\n }, t;\n}(), Es = function(t) {\n this.u_ = t;\n}, _s = /^__.*__$/, Ts = function(t, e, n) {\n this.l_ = t, this.__ = e, this.f_ = n;\n}, Ns = /** @class */ function() {\n function t(t, e, n) {\n this.data = t, this.Qe = e, this.fieldTransforms = n;\n }\n return t.prototype.d_ = function(t, e) {\n var n = [];\n return null !== this.Qe ? n.push(new pn(t, this.data, this.Qe, e)) : n.push(new ln(t, this.data, e)), \n this.fieldTransforms.length > 0 && n.push(new vn(t, this.fieldTransforms)), n;\n }, t;\n}(), As = /** @class */ function() {\n function t(t, e, n) {\n this.data = t, this.Qe = e, this.fieldTransforms = n;\n }\n return t.prototype.d_ = function(t, e) {\n var n = [ new pn(t, this.data, this.Qe, e) ];\n return this.fieldTransforms.length > 0 && n.push(new vn(t, this.fieldTransforms)), \n n;\n }, t;\n}();\n\nfunction Ds(t) {\n switch (t) {\n case 0 /* Set */ :\n // fall through\n case 2 /* MergeSet */ :\n // fall through\n case 1 /* Update */ :\n return !0;\n\n case 3 /* Argument */ :\n case 4 /* ArrayArgument */ :\n return !1;\n\n default:\n throw S();\n }\n}\n\n/** A \"context\" object passed around while parsing user data. */ var Ss = /** @class */ function() {\n /**\n * Initializes a ParseContext with the given source and path.\n *\n * @param settings The settings for the parser.\n * @param databaseId The database ID of the Firestore instance.\n * @param serializer The serializer to use to generate the Value proto.\n * @param ignoreUndefinedProperties Whether to ignore undefined properties\n * rather than throw.\n * @param fieldTransforms A mutable list of field transforms encountered while\n * parsing the data.\n * @param fieldMask A mutable list of field paths encountered while parsing\n * the data.\n *\n * TODO(b/34871131): We don't support array paths right now, so path can be\n * null to indicate the context represents any location within an array (in\n * which case certain features will not work and errors will be somewhat\n * compromised).\n */\n function t(t, e, n, r, i, o) {\n this.settings = t, this._ = e, this.serializer = n, this.ignoreUndefinedProperties = r, \n // Minor hack: If fieldTransforms is undefined, we assume this is an\n // external call and we need to validate the entire path.\n void 0 === i && this.w_(), this.fieldTransforms = i || [], this.Qe = o || [];\n }\n return Object.defineProperty(t.prototype, \"path\", {\n get: function() {\n return this.settings.path;\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"n_\", {\n get: function() {\n return this.settings.n_;\n },\n enumerable: !1,\n configurable: !0\n }), \n /** Returns a new context with the specified settings overwritten. */ t.prototype.E_ = function(e) {\n return new t(Object.assign(Object.assign({}, this.settings), e), this._, this.serializer, this.ignoreUndefinedProperties, this.fieldTransforms, this.Qe);\n }, t.prototype.T_ = function(t) {\n var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.E_({\n path: n,\n r_: !1\n });\n return r.I_(t), r;\n }, t.prototype.m_ = function(t) {\n var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.E_({\n path: n,\n r_: !1\n });\n return r.w_(), r;\n }, t.prototype.A_ = function(t) {\n // TODO(b/34871131): We don't support array paths right now; so make path\n // undefined.\n return this.E_({\n path: void 0,\n r_: !0\n });\n }, t.prototype.s_ = function(t) {\n return Fs(t, this.settings.methodName, this.settings.R_ || !1, this.path, this.settings.i_);\n }, \n /** Returns 'true' if 'fieldPath' was traversed when creating this context. */ t.prototype.contains = function(t) {\n return void 0 !== this.Qe.find((function(e) {\n return t.M(e);\n })) || void 0 !== this.fieldTransforms.find((function(e) {\n return t.M(e.field);\n }));\n }, t.prototype.w_ = function() {\n // TODO(b/34871131): Remove null check once we have proper paths for fields\n // within arrays.\n if (this.path) for (var t = 0; t < this.path.length; t++) this.I_(this.path.get(t));\n }, t.prototype.I_ = function(t) {\n if (0 === t.length) throw this.s_(\"Document fields must not be empty\");\n if (Ds(this.n_) && _s.test(t)) throw this.s_('Document fields cannot begin and end with \"__\"');\n }, t;\n}(), xs = /** @class */ function() {\n function t(t, e, n) {\n this._ = t, this.ignoreUndefinedProperties = e, this.serializer = n || ts(t)\n /** Creates a new top-level parse context. */;\n }\n return t.prototype.P_ = function(t, e, n, r) {\n return void 0 === r && (r = !1), new Ss({\n n_: t,\n methodName: e,\n i_: n,\n path: $.U(),\n r_: !1,\n R_: r\n }, this._, this.serializer, this.ignoreUndefinedProperties);\n }, t;\n}();\n\n/**\n * Helper for parsing raw user input (provided via the API) into internal model\n * classes.\n */\n/** Parse document data from a set() call. */ function ks(t, e, n, r, i, o) {\n void 0 === o && (o = {});\n var u = t.P_(o.merge || o.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);\n Us(\"Data must be an object, but it was:\", u, r);\n var s, a, c = Rs(r, u);\n if (o.merge) s = new tn(u.Qe), a = u.fieldTransforms; else if (o.mergeFields) {\n for (var h = [], f = 0, l = o.mergeFields; f < l.length; f++) {\n var p = l[f], d = void 0;\n if (p instanceof fs) d = p.Zl; else {\n if (\"string\" != typeof p) throw S();\n d = qs(e, p, n);\n }\n if (!u.contains(d)) throw new I(b.INVALID_ARGUMENT, \"Field '\" + d + \"' is specified in your field mask but missing from your input data.\");\n js(h, d) || h.push(d);\n }\n s = new tn(h), a = u.fieldTransforms.filter((function(t) {\n return s.Je(t.field);\n }));\n } else s = null, a = u.fieldTransforms;\n return new Ns(new bn(c), s, a);\n}\n\n/** Parse update data from an update() call. */ function Ps(t, e, n, r) {\n var i = t.P_(1 /* Update */ , e, n);\n Us(\"Data must be an object, but it was:\", i, r);\n var o = [], u = new In;\n z(r, (function(t, r) {\n var s = qs(e, t, n), a = i.m_(s);\n if (r instanceof vs || r instanceof Es && r.u_ instanceof vs) \n // Add it to the field mask, but don't add anything to updateData.\n o.push(s); else {\n var c = Vs(r, a);\n null != c && (o.push(s), u.set(s, c));\n }\n }));\n var s = new tn(o);\n return new As(u.Xe(), s, i.fieldTransforms);\n}\n\n/** Parse update data from a list of field/value arguments. */ function Os(t, e, n, r, i, o) {\n var u = t.P_(1 /* Update */ , e, n), s = [ Ms(e, r, n) ], a = [ i ];\n if (o.length % 2 != 0) throw new I(b.INVALID_ARGUMENT, \"Function \" + e + \"() needs to be called with an even number of arguments that alternate between field names and values.\");\n for (var c = 0; c < o.length; c += 2) s.push(Ms(e, o[c])), a.push(o[c + 1]);\n // We iterate in reverse order to pick the last value for a field if the\n // user specified the field multiple times.\n for (var h = [], f = new In, l = s.length - 1; l >= 0; --l) if (!js(h, s[l])) {\n var p = s[l], d = a[l], v = u.m_(p);\n if (d instanceof vs || d instanceof Es && d.u_ instanceof vs) \n // Add it to the field mask, but don't add anything to updateData.\n h.push(p); else {\n var y = Vs(d, v);\n null != y && (h.push(p), f.set(p, y));\n }\n }\n var m = new tn(h);\n return new As(f.Xe(), m, u.fieldTransforms);\n}\n\n/**\n * Parse a \"query value\" (e.g. value in a where filter or a value in a cursor\n * bound).\n *\n * @param allowArrays Whether the query value is an array that may directly\n * contain additional arrays (e.g. the operand of an `in` query).\n */ function Ls(t, e, n, r) {\n return void 0 === r && (r = !1), Vs(n, t.P_(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));\n}\n\n/**\n * Parses user data to Protobuf Values.\n *\n * @param input Data to be parsed.\n * @param context A context object representing the current path being parsed,\n * the source of the data being parsed, etc.\n * @return The parsed value, or null if the value was a FieldValue sentinel\n * that should not be included in the resulting parsed data.\n */ function Vs(t, e) {\n if (\n // Unwrap the API type from the Compat SDK. This will return the API type\n // from firestore-exp.\n t instanceof Es && (t = t.u_), Cs(t)) return Us(\"Unsupported field value:\", e, t), \n Rs(t, e);\n if (t instanceof ds) \n // FieldValues usually parse into transforms (except FieldValue.delete())\n // in which case we do not want to include this field in our parsed data\n // (as doing so will overwrite the field directly prior to the transform\n // trying to transform it). So we don't add this location to\n // context.fieldMask and we return null as our parsing result.\n /**\n * \"Parses\" the provided FieldValueImpl, adding any necessary transforms to\n * context.fieldTransforms.\n */\n return function(t, e) {\n // Sentinels are only supported with writes, and not within arrays.\n if (!Ds(e.n_)) throw e.s_(t.t_ + \"() can only be used with update() and set()\");\n if (!e.path) throw e.s_(t.t_ + \"() is not currently supported inside arrays\");\n var n = t.e_(e);\n n && e.fieldTransforms.push(n);\n }(t, e), null;\n if (\n // If context.path is null we are inside an array and we don't support\n // field mask paths more granular than the top-level array.\n e.path && e.Qe.push(e.path), t instanceof Array) {\n // TODO(b/34871131): Include the path containing the array in the error\n // message.\n // In the case of IN queries, the parsed data is an array (representing\n // the set of values to be included for the IN query) that may directly\n // contain additional arrays (each representing an individual field\n // value), so we disable this validation.\n if (e.settings.r_ && 4 /* ArrayArgument */ !== e.n_) throw e.s_(\"Nested arrays are not supported\");\n return function(t, e) {\n for (var n = [], r = 0, i = 0, o = t; i < o.length; i++) {\n var u = Vs(o[i], e.A_(r));\n null == u && (\n // Just include nulls in the array for fields being replaced with a\n // sentinel.\n u = {\n nullValue: \"NULL_VALUE\"\n }), n.push(u), r++;\n }\n return {\n arrayValue: {\n values: n\n }\n };\n }(t, e);\n }\n return function(t, e) {\n if (null === t) return {\n nullValue: \"NULL_VALUE\"\n };\n if (\"number\" == typeof t) return le(e.serializer, t);\n if (\"boolean\" == typeof t) return {\n booleanValue: t\n };\n if (\"string\" == typeof t) return {\n stringValue: t\n };\n if (t instanceof Date) {\n var n = Q.fromDate(t);\n return {\n timestampValue: pe(e.serializer, n)\n };\n }\n if (t instanceof Q) {\n // Firestore backend truncates precision down to microseconds. To ensure\n // offline mode works the same with regards to truncation, perform the\n // truncation immediately without waiting for the backend to do that.\n var r = new Q(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));\n return {\n timestampValue: pe(e.serializer, r)\n };\n }\n if (t instanceof Is) return {\n geoPointValue: {\n latitude: t.latitude,\n longitude: t.longitude\n }\n };\n if (t instanceof U) return {\n bytesValue: de(e.serializer, t.l)\n };\n if (t instanceof Ts) {\n var i = e._, o = t.l_;\n if (!o.isEqual(i)) throw e.s_(\"Document reference is for database \" + o.projectId + \"/\" + o.database + \" but should be for database \" + i.projectId + \"/\" + i.database);\n return {\n referenceValue: me(t.l_ || e._, t.__.path)\n };\n }\n if (void 0 === t && e.ignoreUndefinedProperties) return null;\n throw e.s_(\"Unsupported field value: \" + cs(t));\n }(t, e);\n}\n\nfunction Rs(t, e) {\n var n = {};\n return K(t) ? \n // If we encounter an empty object, we explicitly add it to the update\n // mask to ensure that the server creates a map entry.\n e.path && e.path.length > 0 && e.Qe.push(e.path) : z(t, (function(t, r) {\n var i = Vs(r, e.T_(t));\n null != i && (n[t] = i);\n })), {\n mapValue: {\n fields: n\n }\n };\n}\n\nfunction Cs(t) {\n return !(\"object\" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof Q || t instanceof Is || t instanceof U || t instanceof Ts || t instanceof ds);\n}\n\nfunction Us(t, e, n) {\n if (!Cs(n) || !function(t) {\n return \"object\" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));\n }(n)) {\n var r = cs(n);\n throw \"an object\" === r ? e.s_(t + \" a custom object\") : e.s_(t + \" \" + r);\n }\n}\n\n/**\n * Helper that calls fromDotSeparatedString() but wraps any error thrown.\n */ function Ms(t, e, n) {\n if (e instanceof fs) return e.Zl;\n if (\"string\" == typeof e) return qs(t, e);\n throw Fs(\"Field path arguments must be of type string or FieldPath.\", t, \n /* hasConverter= */ !1, \n /* path= */ void 0, n);\n}\n\n/**\n * Wraps fromDotSeparatedString with an error message about the method that\n * was thrown.\n * @param methodName The publicly visible method name\n * @param path The dot-separated string form of a field path which will be split\n * on dots.\n * @param targetDoc The document against which the field path will be evaluated.\n */ function qs(t, e, n) {\n try {\n return function(t) {\n if (t.search(ps) >= 0) throw new I(b.INVALID_ARGUMENT, \"Invalid field path (\" + t + \"). Paths must not contain '~', '*', '/', '[', or ']'\");\n try {\n return new (ls.bind.apply(ls, r([ void 0 ], t.split(\".\"))));\n } catch (e) {\n throw new I(b.INVALID_ARGUMENT, \"Invalid field path (\" + t + \"). Paths must not be empty, begin with '.', end with '.', or contain '..'\");\n }\n }(e).Zl;\n } catch (e) {\n throw Fs((i = e) instanceof Error ? i.message : i.toString(), t, \n /* hasConverter= */ !1, \n /* path= */ void 0, n);\n }\n /**\n * Extracts the message from a caught exception, which should be an Error object\n * though JS doesn't guarantee that.\n */ var i;\n /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */}\n\nfunction Fs(t, e, n, r, i) {\n var o = r && !r.P(), u = void 0 !== i, s = \"Function \" + e + \"() called with invalid data\";\n n && (s += \" (via `toFirestore()`)\");\n var a = \"\";\n return (o || u) && (a += \" (found\", o && (a += \" in field \" + r), u && (a += \" in document \" + i), \n a += \")\"), new I(b.INVALID_ARGUMENT, (s += \". \") + t + a);\n}\n\nfunction js(t, e) {\n return t.some((function(t) {\n return t.isEqual(e);\n }));\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Internal transaction object responsible for accumulating the mutations to\n * perform and the base versions for any documents read.\n */ var Gs = /** @class */ function() {\n function t(t) {\n this.zc = t, \n // The version of each document that was read during this transaction.\n this.g_ = new Map, this.mutations = [], this.V_ = !1, \n /**\n * A deferred usage error that occurred previously in this transaction that\n * will cause the transaction to fail once it actually commits.\n */\n this.y_ = null, \n /**\n * Set of documents that have been written in the transaction.\n *\n * When there's more than one write to the same key in a transaction, any\n * writes after the first are handled differently.\n */\n this.p_ = new Set;\n }\n return t.prototype.b_ = function(t) {\n return e(this, void 0, void 0, (function() {\n var r, i = this;\n return n(this, (function(o) {\n switch (o.label) {\n case 0:\n if (this.v_(), this.mutations.length > 0) throw new I(b.INVALID_ARGUMENT, \"Firestore transactions require all reads to be executed before all writes.\");\n return [ 4 /*yield*/ , function(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u, s, a;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e = k(t), i = _e(e.serializer) + \"/documents\", o = {\n documents: r.map((function(t) {\n return we(e.serializer, t);\n }))\n }, [ 4 /*yield*/ , e.$c(\"BatchGetDocuments\", i, o) ];\n\n case 1:\n return u = n.sent(), s = new Map, u.forEach((function(t) {\n var n = function(t, e) {\n return \"found\" in e ? function(t, e) {\n x(!!e.found), e.found.name, e.found.updateTime;\n var n = be(t, e.found.name), r = ye(e.found.updateTime), i = new bn({\n mapValue: {\n fields: e.found.fields\n }\n });\n return new Tn(n, r, i, {});\n }(t, e) : \"missing\" in e ? function(t, e) {\n x(!!e.missing), x(!!e.readTime);\n var n = be(t, e.missing), r = ye(e.readTime);\n return new Nn(n, r);\n }(t, e) : S();\n }(e.serializer, t);\n s.set(n.key.toString(), n);\n })), a = [], [ 2 /*return*/ , (r.forEach((function(t) {\n var e = s.get(t.toString());\n x(!!e), a.push(e);\n })), a) ];\n }\n }));\n }));\n }(this.zc, t) ];\n\n case 1:\n return [ 2 /*return*/ , ((r = o.sent()).forEach((function(t) {\n t instanceof Nn || t instanceof Tn ? i.S_(t) : S();\n })), r) ];\n }\n }));\n }));\n }, t.prototype.set = function(t, e) {\n this.write(e.d_(t, this.Ge(t))), this.p_.add(t.toString());\n }, t.prototype.update = function(t, e) {\n try {\n this.write(e.d_(t, this.D_(t)));\n } catch (t) {\n this.y_ = t;\n }\n this.p_.add(t.toString());\n }, t.prototype.delete = function(t) {\n this.write([ new gn(t, this.Ge(t)) ]), this.p_.add(t.toString());\n }, t.prototype.commit = function() {\n return e(this, void 0, void 0, (function() {\n var t, r = this;\n return n(this, (function(i) {\n switch (i.label) {\n case 0:\n if (this.v_(), this.y_) throw this.y_;\n return t = this.g_, \n // For each mutation, note that the doc was written.\n this.mutations.forEach((function(e) {\n t.delete(e.key.toString());\n })), \n // For each document that was read but not written to, we want to perform\n // a `verify` operation.\n t.forEach((function(t, e) {\n var n = Z.H(e);\n r.mutations.push(new wn(n, r.Ge(n)));\n })), [ 4 /*yield*/ , function(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return e = k(t), i = _e(e.serializer) + \"/documents\", o = {\n writes: r.map((function(t) {\n return Ae(e.serializer, t);\n }))\n }, [ 4 /*yield*/ , e.Mc(\"Commit\", i, o) ];\n\n case 1:\n return n.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }(this.zc, this.mutations) ];\n\n case 1:\n // For each mutation, note that the doc was written.\n return i.sent(), this.V_ = !0, [ 2 /*return*/ ];\n }\n }));\n }));\n }, t.prototype.S_ = function(t) {\n var e;\n if (t instanceof Tn) e = t.version; else {\n if (!(t instanceof Nn)) throw S();\n // For deleted docs, we must use baseVersion 0 when we overwrite them.\n e = H.min();\n }\n var n = this.g_.get(t.key.toString());\n if (n) {\n if (!e.isEqual(n)) \n // This transaction will fail no matter what.\n throw new I(b.ABORTED, \"Document version changed between two reads.\");\n } else this.g_.set(t.key.toString(), e);\n }, \n /**\n * Returns the version of this document when it was read in this transaction,\n * as a precondition, or no precondition if it was not read.\n */\n t.prototype.Ge = function(t) {\n var e = this.g_.get(t.toString());\n return !this.p_.has(t.toString()) && e ? rn.updateTime(e) : rn.ze();\n }, \n /**\n * Returns the precondition for a document if the operation is an update.\n */\n t.prototype.D_ = function(t) {\n var e = this.g_.get(t.toString());\n // The first time a document is written, we want to take into account the\n // read time and existence\n if (!this.p_.has(t.toString()) && e) {\n if (e.isEqual(H.min())) \n // The document doesn't exist, so fail the transaction.\n // This has to be validated locally because you can't send a\n // precondition that a document does not exist without changing the\n // semantics of the backend write to be an insert. This is the reverse\n // of what we want, since we want to assert that the document doesn't\n // exist but then send the update and have it fail. Since we can't\n // express that to the backend, we have to validate locally.\n // Note: this can change once we can send separate verify writes in the\n // transaction.\n throw new I(b.INVALID_ARGUMENT, \"Can't update a document that doesn't exist.\");\n // Document exists, base precondition on document update time.\n return rn.updateTime(e);\n }\n // Document was not read, so we just use the preconditions for a blind\n // update.\n return rn.exists(!0);\n }, t.prototype.write = function(t) {\n this.v_(), this.mutations = this.mutations.concat(t);\n }, t.prototype.v_ = function() {}, t;\n}(), Bs = /** @class */ function() {\n function t(t, e, n, r) {\n this.hs = t, this.zc = e, this.updateFunction = n, this.ls = r, this.C_ = 5, this.Vs = new ar(this.hs, \"transaction_retry\" /* TransactionRetry */)\n /** Runs the transaction and sets the result on deferred. */;\n }\n return t.prototype.run = function() {\n this.N_();\n }, t.prototype.N_ = function() {\n var t = this;\n this.Vs.Pn((function() {\n return e(t, void 0, void 0, (function() {\n var t, e, r = this;\n return n(this, (function(n) {\n return t = new Gs(this.zc), (e = this.x_(t)) && e.then((function(e) {\n r.hs.ws((function() {\n return t.commit().then((function() {\n r.ls.resolve(e);\n })).catch((function(t) {\n r.F_(t);\n }));\n }));\n })).catch((function(t) {\n r.F_(t);\n })), [ 2 /*return*/ ];\n }));\n }));\n }));\n }, t.prototype.x_ = function(t) {\n try {\n var e = this.updateFunction(t);\n return !tt(e) && e.catch && e.then ? e : (this.ls.reject(Error(\"Transaction callback must return a Promise\")), \n null);\n } catch (t) {\n // Do not retry errors thrown by user provided updateFunction.\n return this.ls.reject(t), null;\n }\n }, t.prototype.F_ = function(t) {\n var e = this;\n this.C_ > 0 && this.k_(t) ? (this.C_ -= 1, this.hs.ws((function() {\n return e.N_(), Promise.resolve();\n }))) : this.ls.reject(t);\n }, t.prototype.k_ = function(t) {\n if (\"FirebaseError\" === t.name) {\n // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and\n // non-matching document versions with ABORTED. These errors should be retried.\n var e = t.code;\n return \"aborted\" === e || \"failed-precondition\" === e || !lt(e);\n }\n return !1;\n }, t;\n}(), zs = /** @class */ function() {\n function t(t, \n /**\n * Asynchronous queue responsible for all of our internal processing. When\n * we get incoming work from the user (via public API) or the network\n * (incoming GRPC messages), we should always schedule onto this queue.\n * This ensures all of our work is properly serialized (e.g. we don't\n * start processing a new operation while the previous one is waiting for\n * an async I/O to complete).\n */\n e) {\n this.credentials = t, this.hs = e, this.clientId = O.t(), \n // We defer our initialization until we get the current user from\n // setChangeListener(). We block the async queue until we got the initial\n // user and the initialization is completed. This will prevent any scheduled\n // work from happening before initialization is completed.\n // If initializationDone resolved then the FirestoreClient is in a usable\n // state.\n this.O_ = new sr\n /**\n * Starts up the FirestoreClient, returning only whether or not enabling\n * persistence succeeded.\n *\n * The intent here is to \"do the right thing\" as far as users are concerned.\n * Namely, in cases where offline persistence is requested and possible,\n * enable it, but otherwise fall back to persistence disabled. For the most\n * part we expect this to succeed one way or the other so we don't expect our\n * users to actually wait on the firestore.enablePersistence Promise since\n * they generally won't care.\n *\n * Of course some users actually do care about whether or not persistence\n * was successfully enabled, so the Promise returned from this method\n * indicates this outcome.\n *\n * This presents a problem though: even before enablePersistence resolves or\n * rejects, users may have made calls to e.g. firestore.collection() which\n * means that the FirestoreClient in there will be available and will be\n * enqueuing actions on the async queue.\n *\n * Meanwhile any failure of an operation on the async queue causes it to\n * panic and reject any further work, on the premise that unhandled errors\n * are fatal.\n *\n * Consequently the fallback is handled internally here in start, and if the\n * fallback succeeds we signal success to the async queue even though the\n * start() itself signals failure.\n *\n * @param databaseInfo The connection information for the current instance.\n * @param offlineComponentProvider Provider that returns all components\n * required for memory-only or IndexedDB persistence.\n * @param onlineComponentProvider Provider that returns all components\n * required for online support.\n * @returns A deferred result indicating the user-visible result of enabling\n * offline persistence. This method will reject this if IndexedDB fails to\n * start for any reason. If usePersistence is false this is\n * unconditionally resolved.\n */;\n }\n return t.prototype.start = function(t, r, i) {\n var o = this;\n this.M_(), this.bl = t;\n // If usePersistence is true, certain classes of errors while starting are\n // recoverable but only by falling back to persistence disabled.\n // If there's an error in the first case but not in recovery we cannot\n // reject the promise blocking the async queue because this will cause the\n // async queue to panic.\n var u = new sr, s = !1;\n // Return only the result of enabling persistence. Note that this does not\n // need to await the completion of initializationDone because the result of\n // this method should not reflect any other kind of failure to start.\n return this.credentials.Jh((function(t) {\n if (!s) return s = !0, T(\"FirestoreClient\", \"Initializing. user=\", t.uid), o.L_(r, i, t, u).then(o.O_.resolve, o.O_.reject);\n o.hs.Cs((function() {\n return function(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return (e = k(t)).hs.Fs(), T(\"RemoteStore\", \"RemoteStore received new credentials\"), \n i = zo(e), \n // Tear down and re-create our network streams. This will ensure we get a\n // fresh auth token for the new user and re-fill the write pipeline with\n // new mutations from the LocalStore (since mutations are per-user).\n e.Xc.add(3 /* CredentialChange */), [ 4 /*yield*/ , Co(e) ];\n\n case 1:\n return n.sent(), i && \n // Don't set the network status to Unknown if we are offline.\n e.nu.set(\"Unknown\" /* Unknown */), [ 4 /*yield*/ , e.Hc.Jl(r) ];\n\n case 2:\n return n.sent(), e.Xc.delete(3 /* CredentialChange */), [ 4 /*yield*/ , Ro(e) ];\n\n case 3:\n // Tear down and re-create our network streams. This will ensure we get a\n // fresh auth token for the new user and re-fill the write pipeline with\n // new mutations from the LocalStore (since mutations are per-user).\n return n.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }(o.bu, t);\n }));\n })), \n // Block the async queue until initialization is done\n this.hs.ws((function() {\n return o.O_.promise;\n })), u.promise;\n }, \n /** Enables the network connection and requeues all pending operations. */ t.prototype.enableNetwork = function() {\n var t = this;\n return this.M_(), this.hs.enqueue((function() {\n return t.persistence.th(!0), function(t) {\n var e = k(t);\n return e.Xc.delete(0 /* UserDisabled */), Ro(e);\n }(t.bu);\n }));\n }, \n /**\n * Initializes persistent storage, attempting to use IndexedDB if\n * usePersistence is true or memory-only if false.\n *\n * If IndexedDB fails because it's already open in another tab or because the\n * platform can't possibly support our implementation then this method rejects\n * the persistenceResult and falls back on memory-only persistence.\n *\n * @param offlineComponentProvider Provider that returns all components\n * required for memory-only or IndexedDB persistence.\n * @param onlineComponentProvider Provider that returns all components\n * required for online support.\n * @param user The initial user\n * @param persistenceResult A deferred result indicating the user-visible\n * result of enabling offline persistence. This method will reject this if\n * IndexedDB fails to start for any reason. If usePersistence is false\n * this is unconditionally resolved.\n * @returns a Promise indicating whether or not initialization should\n * continue, i.e. that one of the persistence implementations actually\n * succeeded.\n */\n t.prototype.L_ = function(t, r, i, o) {\n return e(this, void 0, void 0, (function() {\n var u, s, a = this;\n return n(this, (function(c) {\n switch (c.label) {\n case 0:\n return c.trys.push([ 0, 3, , 4 ]), u = {\n hs: this.hs,\n bl: this.bl,\n clientId: this.clientId,\n credentials: this.credentials,\n Ql: i,\n Du: 100\n }, [ 4 /*yield*/ , t.initialize(u) ];\n\n case 1:\n return c.sent(), [ 4 /*yield*/ , r.initialize(t, u) ];\n\n case 2:\n return c.sent(), this.persistence = t.persistence, this.Su = t.Su, this.Gc = t.Gc, \n this.ql = t.ql, this.zc = r.zc, this.bu = r.bu, this.fi = r.fi, this.B_ = r.vu, \n this.B_.Us = pu.bind(null, this.fi), this.B_.Ws = vu.bind(null, this.fi), \n // When a user calls clearPersistence() in one client, all other clients\n // need to be terminated to allow the delete to succeed.\n this.persistence.Za((function() {\n return e(a, void 0, void 0, (function() {\n return n(this, (function(t) {\n switch (t.label) {\n case 0:\n return [ 4 /*yield*/ , this.terminate() ];\n\n case 1:\n return t.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n })), o.resolve(), [ 3 /*break*/ , 4 ];\n\n case 3:\n // An unknown failure on the first stage shuts everything down.\n if (s = c.sent(), \n // Regardless of whether or not the retry succeeds, from an user\n // perspective, offline persistence has failed.\n o.reject(s), !\n /**\n * Decides whether the provided error allows us to gracefully disable\n * persistence (as opposed to crashing the client).\n */\n // TODO(schmidt-sebastian): Remove `export` in\n // https://github.com/firebase/firebase-js-sdk/pull/3901\n function(t) {\n return \"FirebaseError\" === t.name ? t.code === b.FAILED_PRECONDITION || t.code === b.UNIMPLEMENTED : !(\"undefined\" != typeof DOMException && t instanceof DOMException) || \n // When the browser is out of quota we could get either quota exceeded\n // or an aborted error depending on whether the error happened during\n // schema migration.\n 22 === t.code || 20 === t.code || \n // Firefox Private Browsing mode disables IndexedDb and returns\n // INVALID_STATE for any usage.\n 11 === t.code;\n }(s)) throw s;\n return [ 2 /*return*/ , (console.warn(\"Error enabling offline persistence. Falling back to persistence disabled: \" + s), \n this.L_(new es, new is, i, o)) ];\n\n case 4:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }, \n /**\n * Checks that the client has not been terminated. Ensures that other methods on\n * this class cannot be called after the client is terminated.\n */\n t.prototype.M_ = function() {\n if (this.hs.ps) throw new I(b.FAILED_PRECONDITION, \"The client has already been terminated.\");\n }, \n /** Disables the network connection. Pending operations will not complete. */ t.prototype.disableNetwork = function() {\n var t = this;\n return this.M_(), this.hs.enqueue((function() {\n return t.persistence.th(!1), function(t) {\n return e(this, void 0, void 0, (function() {\n var e;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return (e = k(t)).Xc.add(0 /* UserDisabled */), [ 4 /*yield*/ , Co(e) ];\n\n case 1:\n return n.sent(), \n // Set the OnlineState to Offline so get()s return from cache, etc.\n e.nu.set(\"Offline\" /* Offline */), [ 2 /*return*/ ];\n }\n }));\n }));\n }(t.bu);\n }));\n }, t.prototype.terminate = function() {\n var t = this;\n this.hs.Ds();\n var r = new sr;\n return this.hs.bs((function() {\n return e(t, void 0, void 0, (function() {\n var t, e;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return n.trys.push([ 0, 4, , 5 ]), \n // PORTING NOTE: LocalStore does not need an explicit shutdown on web.\n this.ql && this.ql.stop(), [ 4 /*yield*/ , Uo(this.bu) ];\n\n case 1:\n return n.sent(), [ 4 /*yield*/ , this.Su.Di() ];\n\n case 2:\n return n.sent(), [ 4 /*yield*/ , this.persistence.Di() ];\n\n case 3:\n // PORTING NOTE: LocalStore does not need an explicit shutdown on web.\n return n.sent(), \n // `removeChangeListener` must be called after shutting down the\n // RemoteStore as it will prevent the RemoteStore from retrieving\n // auth tokens.\n this.credentials.Yh(), r.resolve(), [ 3 /*break*/ , 5 ];\n\n case 4:\n return t = n.sent(), e = _r(t, \"Failed to shutdown persistence\"), r.reject(e), [ 3 /*break*/ , 5 ];\n\n case 5:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n })), r.promise;\n }, \n /**\n * Returns a Promise that resolves when all writes that were pending at the time this\n * method was called received server acknowledgement. An acknowledgement can be either acceptance\n * or rejection.\n */\n t.prototype.waitForPendingWrites = function() {\n var t = this;\n this.M_();\n var r = new sr;\n return this.hs.ws((function() {\n return function(t, r) {\n return e(this, void 0, void 0, (function() {\n var e, i, o, u, s;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n zo((e = k(t)).bu) || T(\"SyncEngine\", \"The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.\"), \n n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 3, , 4 ]), [ 4 /*yield*/ , function(t) {\n var e = k(t);\n return e.persistence.runTransaction(\"Get highest unacknowledged batch id\", \"readonly\", (function(t) {\n return e.Sr.qo(t);\n }));\n }(e.Gc) ];\n\n case 2:\n return -1 === (i = n.sent()) ? [ 2 /*return*/ , void r.resolve() ] : ((o = e.Lu.get(i) || []).push(r), \n e.Lu.set(i, o), [ 3 /*break*/ , 4 ]);\n\n case 3:\n return u = n.sent(), s = _r(u, \"Initialization of waitForPendingWrites() operation failed\"), \n r.reject(s), [ 3 /*break*/ , 4 ];\n\n case 4:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }(t.fi, r);\n })), r.promise;\n }, t.prototype.listen = function(t, e, n) {\n var r = this;\n this.M_();\n var i = new os(n), o = new Pr(t, i, e);\n return this.hs.ws((function() {\n return Ar(r.B_, o);\n })), function() {\n i.Xl(), r.hs.ws((function() {\n return Dr(r.B_, o);\n }));\n };\n }, t.prototype.q_ = function(t) {\n return e(this, void 0, void 0, (function() {\n var r, i = this;\n return n(this, (function(o) {\n switch (o.label) {\n case 0:\n return this.M_(), [ 4 /*yield*/ , this.O_.promise ];\n\n case 1:\n return o.sent(), r = new sr, [ 2 /*return*/ , (this.hs.ws((function() {\n return function(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var e, o, u;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return n.trys.push([ 0, 2, , 3 ]), [ 4 /*yield*/ , function(t, e) {\n var n = k(t);\n return n.persistence.runTransaction(\"read document\", \"readonly\", (function(t) {\n return n.Nh.Cr(t, e);\n }));\n }(t, r) ];\n\n case 1:\n return (e = n.sent()) instanceof Tn ? i.resolve(e) : e instanceof Nn ? i.resolve(null) : i.reject(new I(b.UNAVAILABLE, \"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)\")), \n [ 3 /*break*/ , 3 ];\n\n case 2:\n return o = n.sent(), u = _r(o, \"Failed to get document '\" + r + \" from cache\"), \n i.reject(u), [ 3 /*break*/ , 3 ];\n\n case 3:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }(i.Gc, t, r);\n })), r.promise) ];\n }\n }));\n }));\n }, t.prototype.U_ = function(t, r) {\n return void 0 === r && (r = {}), e(this, void 0, void 0, (function() {\n var e, i = this;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return this.M_(), [ 4 /*yield*/ , this.O_.promise ];\n\n case 1:\n return n.sent(), e = new sr, [ 2 /*return*/ , (this.hs.ws((function() {\n return function(t, e, n, r, i) {\n var o = new os({\n next: function(o) {\n // Remove query first before passing event to user to avoid\n // user actions affecting the now stale query.\n e.ws((function() {\n return Dr(t, u);\n }));\n var s = o.docs.has(n);\n !s && o.fromCache ? \n // TODO(dimond): If we're online and the document doesn't\n // exist then we resolve with a doc.exists set to false. If\n // we're offline however, we reject the Promise in this\n // case. Two options: 1) Cache the negative response from\n // the server so we can deliver that even when you're\n // offline 2) Actually reject the Promise in the online case\n // if the document doesn't exist.\n i.reject(new I(b.UNAVAILABLE, \"Failed to get document because the client is offline.\")) : s && o.fromCache && r && \"server\" === r.source ? i.reject(new I(b.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to \"server\" to retrieve the cached document.)')) : i.resolve(o);\n },\n error: function(t) {\n return i.reject(t);\n }\n }), u = new Pr(xn(n.path), o, {\n includeMetadataChanges: !0,\n Xs: !0\n });\n return Ar(t, u);\n }(i.B_, i.hs, t, r, e);\n })), e.promise) ];\n }\n }));\n }));\n }, t.prototype.K_ = function(t) {\n return e(this, void 0, void 0, (function() {\n var r, i = this;\n return n(this, (function(o) {\n switch (o.label) {\n case 0:\n return this.M_(), [ 4 /*yield*/ , this.O_.promise ];\n\n case 1:\n return o.sent(), r = new sr, [ 2 /*return*/ , (this.hs.ws((function() {\n return function(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var e, o, u, s, a, c;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return n.trys.push([ 0, 2, , 3 ]), [ 4 /*yield*/ , mo(t, r, \n /* usePreviousResults= */ !0) ];\n\n case 1:\n return e = n.sent(), o = new cu(r, e.Fh), u = o.Eu(e.documents), s = o.Vr(u, \n /* updateLimboDocuments= */ !1), i.resolve(s.snapshot), [ 3 /*break*/ , 3 ];\n\n case 2:\n return a = n.sent(), c = _r(a, \"Failed to execute query '\" + r + \" against cache\"), \n i.reject(c), [ 3 /*break*/ , 3 ];\n\n case 3:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }(i.Gc, t, r);\n })), r.promise) ];\n }\n }));\n }));\n }, t.prototype.Q_ = function(t, r) {\n return void 0 === r && (r = {}), e(this, void 0, void 0, (function() {\n var e, i = this;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return this.M_(), [ 4 /*yield*/ , this.O_.promise ];\n\n case 1:\n return n.sent(), e = new sr, [ 2 /*return*/ , (this.hs.ws((function() {\n return function(t, e, n, r, i) {\n var o = new os({\n next: function(n) {\n // Remove query first before passing event to user to avoid\n // user actions affecting the now stale query.\n e.ws((function() {\n return Dr(t, u);\n })), n.fromCache && \"server\" === r.source ? i.reject(new I(b.UNAVAILABLE, 'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to \"server\" to retrieve the cached documents.)')) : i.resolve(n);\n },\n error: function(t) {\n return i.reject(t);\n }\n }), u = new Pr(n, o, {\n includeMetadataChanges: !0,\n Xs: !0\n });\n return Ar(t, u);\n }(i.B_, i.hs, t, r, e);\n })), e.promise) ];\n }\n }));\n }));\n }, t.prototype.write = function(t) {\n var r = this;\n this.M_();\n var i = new sr;\n return this.hs.ws((function() {\n return function(t, r, i) {\n return e(this, void 0, void 0, (function() {\n var e, o, u, s;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n e = Fu(t), n.label = 1;\n\n case 1:\n return n.trys.push([ 1, 5, , 6 ]), [ 4 /*yield*/ , \n /* Accepts locally generated Mutations and commit them to storage. */\n function(t, e) {\n var n, r = k(t), i = Q.now(), o = e.reduce((function(t, e) {\n return t.add(e.key);\n }), At());\n return r.persistence.runTransaction(\"Locally write mutations\", \"readwrite\", (function(t) {\n return r.Nh.Or(t, o).next((function(o) {\n n = o;\n for (\n // For non-idempotent mutations (such as `FieldValue.increment()`),\n // we record the base state in a separate patch mutation. This is\n // later used to guarantee consistent values and prevents flicker\n // even if the backend sends us an update that already includes our\n // transform.\n var u = [], s = 0, a = e; s < a.length; s++) {\n var c = a[s], h = cn(c, n.get(c.key));\n null != h && \n // NOTE: The base state should only be applied if there's some\n // existing document to override, so use a Precondition of\n // exists=true\n u.push(new pn(c.key, h, En(h.proto.mapValue), rn.exists(!0)));\n }\n return r.Sr.Oo(t, i, u, e);\n }));\n })).then((function(t) {\n var e = t.lr(n);\n return {\n batchId: t.batchId,\n wr: e\n };\n }));\n }(e.Gc, r) ];\n\n case 2:\n return o = n.sent(), e.Su.Fi(o.batchId), function(t, e, n) {\n var r = t.$u[t.currentUser.ti()];\n r || (r = new dt(L)), r = r.ot(e, n), t.$u[t.currentUser.ti()] = r;\n }(e, o.batchId, i), [ 4 /*yield*/ , Su(e, o.wr) ];\n\n case 3:\n return n.sent(), [ 4 /*yield*/ , Jo(e.bu) ];\n\n case 4:\n return n.sent(), [ 3 /*break*/ , 6 ];\n\n case 5:\n return u = n.sent(), s = _r(u, \"Failed to persist write\"), i.reject(s), [ 3 /*break*/ , 6 ];\n\n case 6:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n }(r.fi, t, i);\n })), i.promise;\n }, t.prototype._ = function() {\n return this.bl._;\n }, t.prototype.W_ = function(t) {\n var r = this;\n this.M_();\n var i = new os(t);\n return this.hs.ws((function() {\n return e(r, void 0, void 0, (function() {\n return n(this, (function(t) {\n return [ 2 /*return*/ , function(t, e) {\n k(t).qs.add(e), \n // Immediately fire an initial event, indicating all existing listeners\n // are in-sync.\n e.next();\n }(this.B_, i) ];\n }));\n }));\n })), function() {\n i.Xl(), r.hs.ws((function() {\n return e(r, void 0, void 0, (function() {\n return n(this, (function(t) {\n return [ 2 /*return*/ , function(t, e) {\n k(t).qs.delete(e);\n }(this.B_, i) ];\n }));\n }));\n }));\n };\n }, Object.defineProperty(t.prototype, \"j_\", {\n get: function() {\n // Technically, the asyncQueue is still running, but only accepting operations\n // related to termination or supposed to be run after termination. It is effectively\n // terminated to the eyes of users.\n return this.hs.ps;\n },\n enumerable: !1,\n configurable: !0\n }), \n /**\n * Takes an updateFunction in which a set of reads and writes can be performed\n * atomically. In the updateFunction, the client can read and write values\n * using the supplied transaction object. After the updateFunction, all\n * changes will be committed. If a retryable error occurs (ex: some other\n * client has changed any of the data referenced), then the updateFunction\n * will be called again after a backoff. If the updateFunction still fails\n * after all retries, then the transaction will be rejected.\n *\n * The transaction object passed to the updateFunction contains methods for\n * accessing documents and collections. Unlike other datastore access, data\n * accessed with the transaction will not reflect local changes that have not\n * been committed. For this reason, it is required that all reads are\n * performed before any writes. Transactions must be performed while online.\n */\n t.prototype.transaction = function(t) {\n var e = this;\n this.M_();\n var n = new sr;\n return this.hs.ws((function() {\n return new Bs(e.hs, e.zc, t, n).run(), Promise.resolve();\n })), n.promise;\n }, t;\n}();\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * TransactionRunner encapsulates the logic needed to run and retry transactions\n * with backoff.\n */ function Ks(t) {\n /**\n * Returns true if obj is an object and contains at least one of the specified\n * methods.\n */\n return function(t, e) {\n if (\"object\" != typeof t || null === t) return !1;\n for (var n = t, r = 0, i = [ \"next\", \"error\", \"complete\" ]; r < i.length; r++) {\n var o = i[r];\n if (o in n && \"function\" == typeof n[o]) return !0;\n }\n return !1;\n }(t);\n}\n\nvar Ws = /** @class */ function() {\n function t(t, e, n, r) {\n this._ = t, this.G_ = e, this.z_ = n, this.H_ = r;\n }\n return t.prototype.J_ = function(t) {\n switch (Kt(t)) {\n case 0 /* NullValue */ :\n return null;\n\n case 1 /* BooleanValue */ :\n return t.booleanValue;\n\n case 2 /* NumberValue */ :\n return Zt(t.integerValue || t.doubleValue);\n\n case 3 /* TimestampValue */ :\n return this.Y_(t.timestampValue);\n\n case 4 /* ServerTimestampValue */ :\n return this.X_(t);\n\n case 5 /* StringValue */ :\n return t.stringValue;\n\n case 6 /* BlobValue */ :\n return this.H_(te(t.bytesValue));\n\n case 7 /* RefValue */ :\n return this.Z_(t.referenceValue);\n\n case 8 /* GeoPointValue */ :\n return this.tf(t.geoPointValue);\n\n case 9 /* ArrayValue */ :\n return this.ef(t.arrayValue);\n\n case 10 /* ObjectValue */ :\n return this.nf(t.mapValue);\n\n default:\n throw S();\n }\n }, t.prototype.nf = function(t) {\n var e = this, n = {};\n return z(t.fields || {}, (function(t, r) {\n n[t] = e.J_(r);\n })), n;\n }, t.prototype.tf = function(t) {\n return new Is(Zt(t.latitude), Zt(t.longitude));\n }, t.prototype.ef = function(t) {\n var e = this;\n return (t.values || []).map((function(t) {\n return e.J_(t);\n }));\n }, t.prototype.X_ = function(t) {\n switch (this.G_) {\n case \"previous\":\n var e = Gt(t);\n return null == e ? null : this.J_(e);\n\n case \"estimate\":\n return this.Y_(Bt(t));\n\n default:\n return null;\n }\n }, t.prototype.Y_ = function(t) {\n var e = $t(t);\n return new Q(e.seconds, e.nanos);\n }, t.prototype.Z_ = function(t) {\n var e = X.q(t);\n x(je(e));\n var n = new G(e.get(1), e.get(3)), r = new Z(e.N(5));\n return n.isEqual(this._) || \n // TODO(b/64130202): Somehow support foreign references.\n N(\"Document \" + r + \" contains a document reference within a different database (\" + n.projectId + \"/\" + n.database + \") which is not supported. It will be treated as a reference in the current database (\" + this._.projectId + \"/\" + this._.database + \") instead.\"), \n this.z_(r);\n }, t;\n}(), Qs = ti.uo, Hs = /** @class */ function() {\n function t(t) {\n var e;\n if (void 0 === t.host) {\n if (void 0 !== t.ssl) throw new I(b.INVALID_ARGUMENT, \"Can't provide ssl option if host option is not set\");\n this.host = \"firestore.googleapis.com\", this.ssl = !0;\n } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;\n if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties, \n void 0 === t.cacheSizeBytes) this.cacheSizeBytes = ti._o; else {\n if (t.cacheSizeBytes !== Qs && t.cacheSizeBytes < ti.lo) throw new I(b.INVALID_ARGUMENT, \"cacheSizeBytes must be at least \" + ti.lo);\n this.cacheSizeBytes = t.cacheSizeBytes;\n }\n this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling, \n as(\"experimentalForceLongPolling\", t.experimentalForceLongPolling, \"experimentalAutoDetectLongPolling\", t.experimentalAutoDetectLongPolling);\n }\n return t.prototype.isEqual = function(t) {\n return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties;\n }, t;\n}(), Ys = \"You are using the memory-only build of Firestore. Persistence support is only available via the @firebase/firestore bundle or the firebase-firestore.js build.\", Xs = /** @class */ function() {\n function t() {}\n return t.prototype.enableIndexedDbPersistence = function(t, e) {\n throw new I(b.FAILED_PRECONDITION, Ys);\n }, t.prototype.enableMultiTabIndexedDbPersistence = function(t) {\n throw new I(b.FAILED_PRECONDITION, Ys);\n }, t.prototype.clearIndexedDbPersistence = function(t) {\n throw new I(b.FAILED_PRECONDITION, Ys);\n }, t;\n}(), Js = /** @class */ function() {\n function t() {}\n return t.prototype.enableIndexedDbPersistence = function(t, e) {\n var n = new is, r = new ns(n, t.sf().cacheSizeBytes, e);\n return t.if(r, n);\n }, t.prototype.enableMultiTabIndexedDbPersistence = function(t) {\n var e = new is, n = new rs(e, t.sf().cacheSizeBytes);\n return t.if(n, e);\n }, t.prototype.clearIndexedDbPersistence = function(t) {\n var r = this, i = new sr;\n return t.rf.bs((function() {\n return e(r, void 0, void 0, (function() {\n var r;\n return n(this, (function(o) {\n switch (o.label) {\n case 0:\n return o.trys.push([ 0, 2, , 3 ]), [ 4 /*yield*/ , function(t) {\n return e(this, void 0, void 0, (function() {\n var e;\n return n(this, (function(n) {\n switch (n.label) {\n case 0:\n return hr.Ln() ? (e = t + \"main\", [ 4 /*yield*/ , hr.delete(e) ]) : [ 2 /*return*/ , Promise.resolve() ];\n\n case 1:\n return n.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }(ao(t.l_, t.af)) ];\n\n case 1:\n return o.sent(), i.resolve(), [ 3 /*break*/ , 3 ];\n\n case 2:\n return r = o.sent(), i.reject(r), [ 3 /*break*/ , 3 ];\n\n case 3:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n })), i.promise;\n }, t;\n}(), $s = /** @class */ function() {\n // Note: We are using `MemoryPersistenceProvider` as a default\n // ComponentProvider to ensure backwards compatibility with the format\n // expected by the console build.\n function t(r, i, o) {\n var u = this;\n if (void 0 === o && (o = new Xs), this.hf = o, this.cf = null, \n // Public for use in tests.\n // TODO(mikelehen): Use modularized initialization instead.\n this.rf = new Er, this.INTERNAL = {\n delete: function() {\n return e(u, void 0, void 0, (function() {\n return n(this, (function(t) {\n switch (t.label) {\n case 0:\n // The client must be initalized to ensure that all subsequent API usage\n // throws an exception.\n return this.uf(), [ 4 /*yield*/ , this.lf.terminate() ];\n\n case 1:\n // The client must be initalized to ensure that all subsequent API usage\n // throws an exception.\n return t.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n }\n }, \"object\" == typeof r.options) {\n // This is very likely a Firebase app object\n // TODO(b/34177605): Can we somehow use instanceof?\n var s = r;\n this.cf = s, this.l_ = t._f(s), this.af = s.name, this.ff = new Ao(i);\n } else {\n var a = r;\n if (!a.projectId) throw new I(b.INVALID_ARGUMENT, \"Must provide projectId\");\n this.l_ = new G(a.projectId, a.database), \n // Use a default persistenceKey that lines up with FirebaseApp.\n this.af = \"[DEFAULT]\", this.ff = new No;\n }\n this.df = new Hs({});\n }\n return Object.defineProperty(t.prototype, \"wf\", {\n get: function() {\n return this.Ef || (\n // Lazy initialize UserDataReader once the settings are frozen\n this.Ef = new xs(this.l_, this.df.ignoreUndefinedProperties)), this.Ef;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.settings = function(t) {\n t.merge && \n // Remove the property from the settings once the merge is completed\n delete (t = Object.assign(Object.assign({}, this.df), t)).merge;\n var e = new Hs(t);\n if (this.lf && !this.df.isEqual(e)) throw new I(b.FAILED_PRECONDITION, \"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.\");\n this.df = e, void 0 !== e.credentials && (this.ff = function(t) {\n if (!t) return new No;\n switch (t.type) {\n case \"gapi\":\n var e = t.client;\n // Make sure this really is a Gapi client.\n return x(!(\"object\" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)), \n new So(e, t.sessionIndex || \"0\");\n\n case \"provider\":\n return t.client;\n\n default:\n throw new I(b.INVALID_ARGUMENT, \"makeCredentialsProvider failed due to invalid credential type\");\n }\n }(e.credentials));\n }, t.prototype.useEmulator = function(t, e) {\n \"firestore.googleapis.com\" !== this.df.host && A(\"Host has been set in both settings() and useEmulator(), emulator host will be used\"), \n this.settings({\n host: t + \":\" + e,\n ssl: !1,\n merge: !0\n });\n }, t.prototype.enableNetwork = function() {\n return this.uf(), this.lf.enableNetwork();\n }, t.prototype.disableNetwork = function() {\n return this.uf(), this.lf.disableNetwork();\n }, t.prototype.enablePersistence = function(t) {\n if (this.lf) throw new I(b.FAILED_PRECONDITION, \"Firestore has already been started and persistence can no longer be enabled. You can only call enablePersistence() before calling any other methods on a Firestore object.\");\n var e = !1, n = !1;\n return t && as(\"synchronizeTabs\", e = !!t.synchronizeTabs, \"experimentalForceOwningTab\", n = !!t.experimentalForceOwningTab), \n e ? this.hf.enableMultiTabIndexedDbPersistence(this) : this.hf.enableIndexedDbPersistence(this, n);\n }, t.prototype.clearPersistence = function() {\n return e(this, void 0, void 0, (function() {\n return n(this, (function(t) {\n if (void 0 !== this.lf && !this.lf.j_) throw new I(b.FAILED_PRECONDITION, \"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.\");\n return [ 2 /*return*/ , this.hf.clearIndexedDbPersistence(this) ];\n }));\n }));\n }, t.prototype.terminate = function() {\n return this.app._removeServiceInstance(\"firestore\"), this.INTERNAL.delete();\n }, Object.defineProperty(t.prototype, \"Tf\", {\n get: function() {\n return this.uf(), this.lf.j_;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.waitForPendingWrites = function() {\n return this.uf(), this.lf.waitForPendingWrites();\n }, t.prototype.onSnapshotsInSync = function(t) {\n if (this.uf(), Ks(t)) return this.lf.W_(t);\n var e = {\n next: t\n };\n return this.lf.W_(e);\n }, t.prototype.uf = function() {\n return this.lf || \n // Kick off starting the client but don't actually wait for it.\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.if(new es, new is), this.lf;\n }, t.prototype.If = function() {\n return new j(this.l_, this.af, this.df.host, this.df.ssl, this.df.experimentalForceLongPolling, this.df.experimentalAutoDetectLongPolling);\n }, \n // TODO(schmidt-sebastian): Make this private again in\n // https://github.com/firebase/firebase-js-sdk/pull/3901.\n t.prototype.if = function(t, e) {\n var n = this.If();\n return this.lf = new zs(this.ff, this.rf), this.lf.start(n, t, e);\n }, t._f = function(t) {\n if (e = t.options, \"projectId\", !Object.prototype.hasOwnProperty.call(e, \"projectId\")) throw new I(b.INVALID_ARGUMENT, '\"projectId\" not provided in firebase.initializeApp.');\n var e, n = t.options.projectId;\n if (!n || \"string\" != typeof n) throw new I(b.INVALID_ARGUMENT, \"projectId must be a string in FirebaseApp.options\");\n return new G(n);\n }, Object.defineProperty(t.prototype, \"app\", {\n get: function() {\n if (!this.cf) throw new I(b.FAILED_PRECONDITION, \"Firestore was not initialized using the Firebase SDK. 'app' is not available\");\n return this.cf;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.collection = function(t) {\n return us(\"Firestore.collection\", \"path\", t), this.uf(), new fa(X.q(t), this, \n /* converter= */ null);\n }, t.prototype.doc = function(t) {\n return us(\"Firestore.doc\", \"path\", t), this.uf(), ea.mf(X.q(t), this, \n /* converter= */ null);\n }, t.prototype.collectionGroup = function(t) {\n if (us(\"Firestore.collectionGroup\", \"collectionId\", t), t.indexOf(\"/\") >= 0) throw new I(b.INVALID_ARGUMENT, \"Invalid collection ID '\" + t + \"' passed to function Firestore.collectionGroup(). Collection IDs must not contain '/'.\");\n return this.uf(), new ca(\n /**\n * Creates a new Query for a collection group query that matches all documents\n * within the provided collection group.\n */\n function(t) {\n return new Dn(X.U(), t);\n }(t), this, \n /* converter= */ null);\n }, t.prototype.runTransaction = function(t) {\n var e = this;\n return this.uf().transaction((function(n) {\n return t(new Zs(e, n));\n }));\n }, t.prototype.batch = function() {\n return this.uf(), new ta(this);\n }, \n // Visible for testing.\n t.prototype.sf = function() {\n return this.df;\n }, t;\n}(), Zs = /** @class */ function() {\n function t(t, e) {\n this.Af = t, this.Rf = e;\n }\n return t.prototype.get = function(t) {\n var e = this, n = la(\"Transaction.get\", t, this.Af);\n return this.Rf.b_([ n.__ ]).then((function(t) {\n if (!t || 1 !== t.length) return S();\n var r = t[0];\n if (r instanceof Nn) return new ra(e.Af, n.__, null, \n /* fromCache= */ !1, \n /* hasPendingWrites= */ !1, n.f_);\n if (r instanceof Tn) return new ra(e.Af, n.__, r, \n /* fromCache= */ !1, \n /* hasPendingWrites= */ !1, n.f_);\n throw S();\n }));\n }, t.prototype.set = function(t, e, n) {\n var r = la(\"Transaction.set\", t, this.Af);\n n = ss(\"Transaction.set\", n);\n var i = da(r.f_, e, n), o = ks(this.Af.wf, \"Transaction.set\", r.__, i, null !== r.f_, n);\n return this.Rf.set(r.__, o), this;\n }, t.prototype.update = function(t, e, n) {\n for (var r, i, o = [], u = 3; u < arguments.length; u++) o[u - 3] = arguments[u];\n return \"string\" == typeof e || e instanceof ls ? (r = la(\"Transaction.update\", t, this.Af), \n i = Os(this.Af.wf, \"Transaction.update\", r.__, e, n, o)) : (r = la(\"Transaction.update\", t, this.Af), \n i = Ps(this.Af.wf, \"Transaction.update\", r.__, e)), this.Rf.update(r.__, i), this;\n }, t.prototype.delete = function(t) {\n var e = la(\"Transaction.delete\", t, this.Af);\n return this.Rf.delete(e.__), this;\n }, t;\n}(), ta = /** @class */ function() {\n function t(t) {\n this.Af = t, this.Pf = [], this.gf = !1;\n }\n return t.prototype.set = function(t, e, n) {\n this.Vf();\n var r = la(\"WriteBatch.set\", t, this.Af);\n n = ss(\"WriteBatch.set\", n);\n var i = da(r.f_, e, n), o = ks(this.Af.wf, \"WriteBatch.set\", r.__, i, null !== r.f_, n);\n return this.Pf = this.Pf.concat(o.d_(r.__, rn.ze())), this;\n }, t.prototype.update = function(t, e, n) {\n for (var r, i, o = [], u = 3; u < arguments.length; u++) o[u - 3] = arguments[u];\n return this.Vf(), \"string\" == typeof e || e instanceof ls ? (r = la(\"WriteBatch.update\", t, this.Af), \n i = Os(this.Af.wf, \"WriteBatch.update\", r.__, e, n, o)) : (r = la(\"WriteBatch.update\", t, this.Af), \n i = Ps(this.Af.wf, \"WriteBatch.update\", r.__, e)), this.Pf = this.Pf.concat(i.d_(r.__, rn.exists(!0))), \n this;\n }, t.prototype.delete = function(t) {\n this.Vf();\n var e = la(\"WriteBatch.delete\", t, this.Af);\n return this.Pf = this.Pf.concat(new gn(e.__, rn.ze())), this;\n }, t.prototype.commit = function() {\n return this.Vf(), this.gf = !0, this.Pf.length > 0 ? this.Af.uf().write(this.Pf) : Promise.resolve();\n }, t.prototype.Vf = function() {\n if (this.gf) throw new I(b.FAILED_PRECONDITION, \"A write batch can no longer be used after commit() has been called.\");\n }, t;\n}(), ea = /** @class */ function(e) {\n function n(t, n, r) {\n var i = this;\n return (i = e.call(this, n.l_, t, r) || this).__ = t, i.firestore = n, i.f_ = r, \n i.lf = i.firestore.uf(), i;\n }\n return t(n, e), n.mf = function(t, e, r) {\n if (t.length % 2 != 0) throw new I(b.INVALID_ARGUMENT, \"Invalid document reference. Document references must have an even number of segments, but \" + t.B() + \" has \" + t.length);\n return new n(new Z(t), e, r);\n }, Object.defineProperty(n.prototype, \"id\", {\n get: function() {\n return this.__.path.O();\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(n.prototype, \"parent\", {\n get: function() {\n return new fa(this.__.path.F(), this.firestore, this.f_);\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(n.prototype, \"path\", {\n get: function() {\n return this.__.path.B();\n },\n enumerable: !1,\n configurable: !0\n }), n.prototype.collection = function(t) {\n if (us(\"DocumentReference.collection\", \"path\", t), !t) throw new I(b.INVALID_ARGUMENT, \"Must provide a non-empty collection name to collection()\");\n var e = X.q(t);\n return new fa(this.__.path.child(e), this.firestore, \n /* converter= */ null);\n }, n.prototype.isEqual = function(t) {\n return t instanceof n && this.firestore === t.firestore && this.__.isEqual(t.__) && this.f_ === t.f_;\n }, n.prototype.set = function(t, e) {\n e = ss(\"DocumentReference.set\", e);\n var n = da(this.f_, t, e), r = ks(this.firestore.wf, \"DocumentReference.set\", this.__, n, null !== this.f_, e);\n return this.lf.write(r.d_(this.__, rn.ze()));\n }, n.prototype.update = function(t, e) {\n for (var n, r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i];\n return n = \"string\" == typeof t || t instanceof ls ? Os(this.firestore.wf, \"DocumentReference.update\", this.__, t, e, r) : Ps(this.firestore.wf, \"DocumentReference.update\", this.__, t), \n this.lf.write(n.d_(this.__, rn.exists(!0)));\n }, n.prototype.delete = function() {\n return this.lf.write([ new gn(this.__, rn.ze()) ]);\n }, n.prototype.onSnapshot = function() {\n for (var t, e, n, r = this, i = [], o = 0; o < arguments.length; o++) i[o] = arguments[o];\n var u = {\n includeMetadataChanges: !1\n }, s = 0;\n \"object\" != typeof i[s] || Ks(i[s]) || (u = i[s], s++);\n var a = {\n includeMetadataChanges: u.includeMetadataChanges\n };\n if (Ks(i[s])) {\n var c = i[s];\n i[s] = null === (t = c.next) || void 0 === t ? void 0 : t.bind(c), i[s + 1] = null === (e = c.error) || void 0 === e ? void 0 : e.bind(c), \n i[s + 2] = null === (n = c.complete) || void 0 === n ? void 0 : n.bind(c);\n }\n var h = {\n next: function(t) {\n i[s] && i[s](r.yf(t));\n },\n error: i[s + 1],\n complete: i[s + 2]\n };\n return this.lf.listen(xn(this.__.path), a, h);\n }, n.prototype.get = function(t) {\n var e = this, n = this.firestore.uf();\n return t && \"cache\" === t.source ? n.q_(this.__).then((function(t) {\n return new ra(e.firestore, e.__, t, \n /*fromCache=*/ !0, t instanceof Tn && t.Ye, e.f_);\n })) : n.U_(this.__, t).then((function(t) {\n return e.yf(t);\n }));\n }, n.prototype.withConverter = function(t) {\n return new n(this.__, this.firestore, t);\n }, \n /**\n * Converts a ViewSnapshot that contains the current document to a\n * DocumentSnapshot.\n */\n n.prototype.yf = function(t) {\n var e = t.docs.get(this.__);\n return new ra(this.firestore, this.__, e, t.fromCache, t.hasPendingWrites, this.f_);\n }, n;\n}(Ts), na = /** @class */ function() {\n function t(t, e) {\n this.hasPendingWrites = t, this.fromCache = e\n /**\n * Returns true if this `SnapshotMetadata` is equal to the provided one.\n *\n * @param other The `SnapshotMetadata` to compare against.\n * @return true if this `SnapshotMetadata` is equal to the provided one.\n */;\n }\n return t.prototype.isEqual = function(t) {\n return this.hasPendingWrites === t.hasPendingWrites && this.fromCache === t.fromCache;\n }, t;\n}(), ra = /** @class */ function() {\n function t(t, e, n, r, i, o) {\n this.Af = t, this.__ = e, this.pf = n, this.bf = r, this.vf = i, this.f_ = o;\n }\n return t.prototype.data = function(t) {\n var e = this;\n if (void 0 === t && (t = {}), this.pf) {\n // We only want to use the converter and create a new DocumentSnapshot\n // if a converter has been provided.\n if (this.f_) {\n var n = new ia(this.Af, this.__, this.pf, this.bf, this.vf, \n /* converter= */ null);\n return this.f_.fromFirestore(n, t);\n }\n return new Ws(this.Af.l_, t.serverTimestamps || \"none\", (function(t) {\n return new ea(t, e.Af, /* converter= */ null);\n }), (function(t) {\n return new F(t);\n })).J_(this.pf.rn());\n }\n }, t.prototype.get = function(t, e) {\n var n = this;\n if (void 0 === e && (e = {}), this.pf) {\n var r = this.pf.data().field(Ms(\"DocumentSnapshot.get\", t, this.__));\n if (null !== r) return new Ws(this.Af.l_, e.serverTimestamps || \"none\", (function(t) {\n return new ea(t, n.Af, n.f_);\n }), (function(t) {\n return new F(t);\n })).J_(r);\n }\n }, Object.defineProperty(t.prototype, \"id\", {\n get: function() {\n return this.__.path.O();\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"ref\", {\n get: function() {\n return new ea(this.__, this.Af, this.f_);\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"exists\", {\n get: function() {\n return null !== this.pf;\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"metadata\", {\n get: function() {\n return new na(this.vf, this.bf);\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.isEqual = function(e) {\n return e instanceof t && this.Af === e.Af && this.bf === e.bf && this.__.isEqual(e.__) && (null === this.pf ? null === e.pf : this.pf.isEqual(e.pf)) && this.f_ === e.f_;\n }, t;\n}(), ia = /** @class */ function(e) {\n function n() {\n return null !== e && e.apply(this, arguments) || this;\n }\n return t(n, e), n.prototype.data = function(t) {\n return e.prototype.data.call(this, t);\n }, n;\n}(ra);\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// settings() defaults:\n/**\n * Create a Bound from a query and a document.\n *\n * Note that the Bound will always include the key of the document\n * and so only the provided document will compare equal to the returned\n * position.\n *\n * Will throw if the document does not contain all fields of the order by\n * of the query or if any of the fields in the order by are an uncommitted\n * server timestamp.\n */\n/**\n * Parses the given documentIdValue into a ReferenceValue, throwing\n * appropriate errors if the value is anything other than a DocumentReference\n * or String, or if the string is malformed.\n */\nfunction oa(t, e, n) {\n if (\"string\" == typeof n) {\n if (\"\" === n) throw new I(b.INVALID_ARGUMENT, \"Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.\");\n if (!Vn(e) && -1 !== n.indexOf(\"/\")) throw new I(b.INVALID_ARGUMENT, \"Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '\" + n + \"' contains a '/' character.\");\n var r = e.path.child(X.q(n));\n if (!Z.X(r)) throw new I(b.INVALID_ARGUMENT, \"Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '\" + r + \"' is not because it has an odd number of segments (\" + r.length + \").\");\n return ee(t, new Z(r));\n }\n if (n instanceof Ts) return ee(t, n.__);\n throw new I(b.INVALID_ARGUMENT, \"Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: \" + cs(n) + \".\");\n}\n\n/**\n * Validates that the value passed into a disjunctive filter satisfies all\n * array requirements.\n */ function ua(t, e) {\n if (!Array.isArray(t) || 0 === t.length) throw new I(b.INVALID_ARGUMENT, \"Invalid Query. A non-empty array is required for '\" + e.toString() + \"' filters.\");\n if (t.length > 10) throw new I(b.INVALID_ARGUMENT, \"Invalid Query. '\" + e.toString() + \"' filters support a maximum of 10 elements in the value array.\");\n}\n\nfunction sa(t, e, n) {\n if (!n.isEqual(e)) throw new I(b.INVALID_ARGUMENT, \"Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '\" + e.toString() + \"' and so you must also use '\" + e.toString() + \"' as your first orderBy(), but your first orderBy() is on field '\" + n.toString() + \"' instead.\");\n}\n\nfunction aa(t) {\n if (Pn(t) && 0 === t.on.length) throw new I(b.UNIMPLEMENTED, \"limitToLast() queries require specifying at least one orderBy() clause\");\n}\n\nvar ca = /** @class */ function() {\n function t(t, e, n) {\n this.Sf = t, this.firestore = e, this.f_ = n;\n }\n return t.prototype.where = function(e, n, r) {\n var i = Ms(\"Query.where\", e), o = function(t, e, n, r, i, o, u) {\n var s;\n if (i.W()) {\n if (\"array-contains\" /* ARRAY_CONTAINS */ === o || \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ === o) throw new I(b.INVALID_ARGUMENT, \"Invalid Query. You can't perform '\" + o + \"' queries on FieldPath.documentId().\");\n if (\"in\" /* IN */ === o || \"not-in\" /* NOT_IN */ === o) {\n ua(u, o);\n for (var a = [], c = 0, h = u; c < h.length; c++) {\n var f = h[c];\n a.push(oa(r, t, f));\n }\n s = {\n arrayValue: {\n values: a\n }\n };\n } else s = oa(r, t, u);\n } else \"in\" /* IN */ !== o && \"not-in\" /* NOT_IN */ !== o && \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ !== o || ua(u, o), \n s = Ls(n, e, u, \n /* allowArrays= */ \"in\" /* IN */ === o || \"not-in\" /* NOT_IN */ === o);\n var l = Kn.create(i, o, s);\n return function(t, e) {\n if (e.un()) {\n var n = Ln(t);\n if (null !== n && !n.isEqual(e.field)) throw new I(b.INVALID_ARGUMENT, \"Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on '\" + n.toString() + \"' and '\" + e.field.toString() + \"'\");\n var r = On(t);\n null !== r && sa(0, e.field, r);\n }\n var i = function(t, e) {\n for (var n = 0, r = t.filters; n < r.length; n++) {\n var i = r[n];\n if (e.indexOf(i.op) >= 0) return i.op;\n }\n return null;\n }(t, \n /**\n * Given an operator, returns the set of operators that cannot be used with it.\n *\n * Operators in a query must adhere to the following set of rules:\n * 1. Only one array operator is allowed.\n * 2. Only one disjunctive operator is allowed.\n * 3. NOT_EQUAL cannot be used with another NOT_EQUAL operator.\n * 4. NOT_IN cannot be used with array, disjunctive, or NOT_EQUAL operators.\n *\n * Array operators: ARRAY_CONTAINS, ARRAY_CONTAINS_ANY\n * Disjunctive operators: IN, ARRAY_CONTAINS_ANY, NOT_IN\n */\n function(t) {\n switch (t) {\n case \"!=\" /* NOT_EQUAL */ :\n return [ \"!=\" /* NOT_EQUAL */ , \"not-in\" /* NOT_IN */ ];\n\n case \"array-contains\" /* ARRAY_CONTAINS */ :\n return [ \"array-contains\" /* ARRAY_CONTAINS */ , \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , \"not-in\" /* NOT_IN */ ];\n\n case \"in\" /* IN */ :\n return [ \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , \"in\" /* IN */ , \"not-in\" /* NOT_IN */ ];\n\n case \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ :\n return [ \"array-contains\" /* ARRAY_CONTAINS */ , \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , \"in\" /* IN */ , \"not-in\" /* NOT_IN */ ];\n\n case \"not-in\" /* NOT_IN */ :\n return [ \"array-contains\" /* ARRAY_CONTAINS */ , \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , \"in\" /* IN */ , \"not-in\" /* NOT_IN */ , \"!=\" /* NOT_EQUAL */ ];\n\n default:\n return [];\n }\n }(e.op));\n if (null !== i) \n // Special case when it's a duplicate op to give a slightly clearer error message.\n throw i === e.op ? new I(b.INVALID_ARGUMENT, \"Invalid query. You cannot use more than one '\" + e.op.toString() + \"' filter.\") : new I(b.INVALID_ARGUMENT, \"Invalid query. You cannot use '\" + e.op.toString() + \"' filters with '\" + i.toString() + \"' filters.\");\n }(t, l), l;\n }(this.Sf, \"Query.where\", this.firestore.wf, this.firestore.l_, i, n, r);\n return new t(function(t, e) {\n var n = t.filters.concat([ e ]);\n return new Dn(t.path, t.collectionGroup, t.on.slice(), n, t.limit, t.an, t.startAt, t.endAt);\n }(this.Sf, o), this.firestore, this.f_);\n }, t.prototype.orderBy = function(e, n) {\n var r;\n if (void 0 === n || \"asc\" === n) r = \"asc\" /* ASCENDING */; else {\n if (\"desc\" !== n) throw new I(b.INVALID_ARGUMENT, \"Function Query.orderBy() has unknown direction '\" + n + \"', expected 'asc' or 'desc'.\");\n r = \"desc\" /* DESCENDING */;\n }\n var i = Ms(\"Query.orderBy\", e), o = function(t, e, n) {\n if (null !== t.startAt) throw new I(b.INVALID_ARGUMENT, \"Invalid query. You must not call startAt() or startAfter() before calling orderBy().\");\n if (null !== t.endAt) throw new I(b.INVALID_ARGUMENT, \"Invalid query. You must not call endAt() or endBefore() before calling orderBy().\");\n var r = new ir(e, n);\n return function(t, e) {\n if (null === On(t)) {\n // This is the first order by. It must match any inequality.\n var n = Ln(t);\n null !== n && sa(0, n, e.field);\n }\n }(t, r), r;\n }(this.Sf, i, r);\n return new t(function(t, e) {\n // TODO(dimond): validate that orderBy does not list the same key twice.\n var n = t.on.concat([ e ]);\n return new Dn(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.an, t.startAt, t.endAt);\n }(this.Sf, o), this.firestore, this.f_);\n }, t.prototype.limit = function(e) {\n return hs(\"Query.limit\", e), new t(Un(this.Sf, e, \"F\" /* First */), this.firestore, this.f_);\n }, t.prototype.limitToLast = function(e) {\n return hs(\"Query.limitToLast\", e), new t(Un(this.Sf, e, \"L\" /* Last */), this.firestore, this.f_);\n }, t.prototype.startAt = function(e) {\n for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];\n var i = this.Df(\"Query.startAt\", e, n, \n /*before=*/ !0);\n return new t(Mn(this.Sf, i), this.firestore, this.f_);\n }, t.prototype.startAfter = function(e) {\n for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];\n var i = this.Df(\"Query.startAfter\", e, n, \n /*before=*/ !1);\n return new t(Mn(this.Sf, i), this.firestore, this.f_);\n }, t.prototype.endBefore = function(e) {\n for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];\n var i = this.Df(\"Query.endBefore\", e, n, \n /*before=*/ !0);\n return new t(qn(this.Sf, i), this.firestore, this.f_);\n }, t.prototype.endAt = function(e) {\n for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];\n var i = this.Df(\"Query.endAt\", e, n, \n /*before=*/ !1);\n return new t(qn(this.Sf, i), this.firestore, this.f_);\n }, t.prototype.isEqual = function(e) {\n return e instanceof t && this.firestore === e.firestore && Fn(this.Sf, e.Sf) && this.f_ === e.f_;\n }, t.prototype.withConverter = function(e) {\n return new t(this.Sf, this.firestore, e);\n }, \n /** Helper function to create a bound from a document or fields */ t.prototype.Df = function(t, e, n, r) {\n if (e instanceof ra) return function(t, e, n, r, i) {\n if (!r) throw new I(b.NOT_FOUND, \"Can't use a DocumentSnapshot that doesn't exist for \" + n + \"().\");\n // Because people expect to continue/end a query at the exact document\n // provided, we need to use the implicit sort order rather than the explicit\n // sort order, because it's guaranteed to contain the document key. That way\n // the position becomes unambiguous and the query continues/ends exactly at\n // the provided document. Without the key (by using the explicit sort\n // orders), multiple documents could match the position, yielding duplicate\n // results.\n for (var o = [], u = 0, s = Rn(t); u < s.length; u++) {\n var a = s[u];\n if (a.field.W()) o.push(ee(e, r.key)); else {\n var c = r.field(a.field);\n if (jt(c)) throw new I(b.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field \"' + a.field + '\" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');\n if (null === c) {\n var h = a.field.B();\n throw new I(b.INVALID_ARGUMENT, \"Invalid query. You are trying to start or end a query using a document for which the field '\" + h + \"' (used as the orderBy) does not exist.\");\n }\n o.push(c);\n }\n }\n return new tr(o, i);\n }(this.Sf, this.firestore.l_, t, e.pf, r);\n var i = [ e ].concat(n);\n return function(t, e, n, r, i, o) {\n // Use explicit order by's because it has to match the query the user made\n var u = t.on;\n if (i.length > u.length) throw new I(b.INVALID_ARGUMENT, \"Too many arguments provided to \" + r + \"(). The number of arguments must be less than or equal to the number of orderBy() clauses\");\n for (var s = [], a = 0; a < i.length; a++) {\n var c = i[a];\n if (u[a].field.W()) {\n if (\"string\" != typeof c) throw new I(b.INVALID_ARGUMENT, \"Invalid query. Expected a string for document ID in \" + r + \"(), but got a \" + typeof c);\n if (!Vn(t) && -1 !== c.indexOf(\"/\")) throw new I(b.INVALID_ARGUMENT, \"Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to \" + r + \"() must be a plain document ID, but '\" + c + \"' contains a slash.\");\n var h = t.path.child(X.q(c));\n if (!Z.X(h)) throw new I(b.INVALID_ARGUMENT, \"Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to \" + r + \"() must result in a valid document path, but '\" + h + \"' is not because it contains an odd number of segments.\");\n var f = new Z(h);\n s.push(ee(e, f));\n } else {\n var l = Ls(n, r, c);\n s.push(l);\n }\n }\n return new tr(s, o);\n }(this.Sf, this.firestore.l_, this.firestore.wf, t, i, r);\n }, t.prototype.onSnapshot = function() {\n for (var t, e, n, r = this, i = [], o = 0; o < arguments.length; o++) i[o] = arguments[o];\n var u = {}, s = 0;\n if (\"object\" != typeof i[s] || Ks(i[s]) || (u = i[s], s++), Ks(i[s])) {\n var a = i[s];\n i[s] = null === (t = a.next) || void 0 === t ? void 0 : t.bind(a), i[s + 1] = null === (e = a.error) || void 0 === e ? void 0 : e.bind(a), \n i[s + 2] = null === (n = a.complete) || void 0 === n ? void 0 : n.bind(a);\n }\n var c = {\n next: function(t) {\n i[s] && i[s](new ha(r.firestore, r.Sf, t, r.f_));\n },\n error: i[s + 1],\n complete: i[s + 2]\n };\n return aa(this.Sf), this.firestore.uf().listen(this.Sf, u, c);\n }, t.prototype.get = function(t) {\n var e = this;\n aa(this.Sf);\n var n = this.firestore.uf();\n return (t && \"cache\" === t.source ? n.K_(this.Sf) : n.Q_(this.Sf, t)).then((function(t) {\n return new ha(e.firestore, e.Sf, t, e.f_);\n }));\n }, t;\n}(), ha = /** @class */ function() {\n function t(t, e, n, r) {\n this.Af = t, this.Cf = e, this.Nf = n, this.f_ = r, this.xf = null, this.Ff = null, \n this.metadata = new na(n.hasPendingWrites, n.fromCache);\n }\n return Object.defineProperty(t.prototype, \"docs\", {\n get: function() {\n var t = [];\n return this.forEach((function(e) {\n return t.push(e);\n })), t;\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"empty\", {\n get: function() {\n return this.Nf.docs.P();\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(t.prototype, \"size\", {\n get: function() {\n return this.Nf.docs.size;\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.forEach = function(t, e) {\n var n = this;\n this.Nf.docs.forEach((function(r) {\n t.call(e, n.kf(r, n.metadata.fromCache, n.Nf.Qt.has(r.key)));\n }));\n }, Object.defineProperty(t.prototype, \"query\", {\n get: function() {\n return new ca(this.Cf, this.Af, this.f_);\n },\n enumerable: !1,\n configurable: !0\n }), t.prototype.docChanges = function(t) {\n var e = !(!t || !t.includeMetadataChanges);\n if (e && this.Nf.jt) throw new I(b.INVALID_ARGUMENT, \"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().\");\n return this.xf && this.Ff === e || (this.xf = \n /**\n * Calculates the array of DocumentChanges for a given ViewSnapshot.\n *\n * Exported for testing.\n *\n * @param snapshot The ViewSnapshot that represents the expected state.\n * @param includeMetadataChanges Whether to include metadata changes.\n * @param converter A factory function that returns a QueryDocumentSnapshot.\n * @return An object that matches the DocumentChange API.\n */\n function(t, e, n) {\n if (t.Kt.P()) {\n // Special case the first snapshot because index calculation is easy and\n // fast\n var r = 0;\n return t.docChanges.map((function(e) {\n var i = n(e.doc, t.fromCache, t.Qt.has(e.doc.key));\n return e.doc, {\n type: \"added\",\n doc: i,\n oldIndex: -1,\n newIndex: r++\n };\n }));\n }\n // A DocumentSet that is updated incrementally as changes are applied to use\n // to lookup the index of a document.\n var i = t.Kt;\n return t.docChanges.filter((function(t) {\n return e || 3 /* Metadata */ !== t.type;\n })).map((function(e) {\n var r = n(e.doc, t.fromCache, t.Qt.has(e.doc.key)), o = -1, u = -1;\n return 0 /* Added */ !== e.type && (o = i.indexOf(e.doc.key), i = i.delete(e.doc.key)), \n 1 /* Removed */ !== e.type && (u = (i = i.add(e.doc)).indexOf(e.doc.key)), {\n type: pa(e.type),\n doc: r,\n oldIndex: o,\n newIndex: u\n };\n }));\n }(this.Nf, e, this.kf.bind(this)), this.Ff = e), this.xf;\n }, \n /** Check the equality. The call can be very expensive. */ t.prototype.isEqual = function(e) {\n return e instanceof t && this.Af === e.Af && Fn(this.Cf, e.Cf) && this.Nf.isEqual(e.Nf) && this.f_ === e.f_;\n }, t.prototype.kf = function(t, e, n) {\n return new ia(this.Af, t.key, t, e, n, this.f_);\n }, t;\n}(), fa = /** @class */ function(e) {\n function n(t, n, r) {\n var i = this;\n if ((i = e.call(this, xn(t), n, r) || this).Of = t, t.length % 2 != 1) throw new I(b.INVALID_ARGUMENT, \"Invalid collection reference. Collection references must have an odd number of segments, but \" + t.B() + \" has \" + t.length);\n return i;\n }\n return t(n, e), Object.defineProperty(n.prototype, \"id\", {\n get: function() {\n return this.Sf.path.O();\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(n.prototype, \"parent\", {\n get: function() {\n var t = this.Sf.path.F();\n return t.P() ? null : new ea(new Z(t), this.firestore, \n /* converter= */ null);\n },\n enumerable: !1,\n configurable: !0\n }), Object.defineProperty(n.prototype, \"path\", {\n get: function() {\n return this.Sf.path.B();\n },\n enumerable: !1,\n configurable: !0\n }), n.prototype.doc = function(t) {\n // We allow omission of 'pathString' but explicitly prohibit passing in both\n // 'undefined' and 'null'.\n 0 === arguments.length && (t = O.t()), us(\"CollectionReference.doc\", \"path\", t);\n var e = X.q(t);\n return ea.mf(this.Sf.path.child(e), this.firestore, this.f_);\n }, n.prototype.add = function(t) {\n var e = this.f_ ? this.f_.toFirestore(t) : t, n = this.doc();\n // Call set() with the converted value directly to avoid calling toFirestore() a second time.\n return new ea(n.__, this.firestore, null).set(e).then((function() {\n return n;\n }));\n }, n.prototype.withConverter = function(t) {\n return new n(this.Of, this.firestore, t);\n }, n;\n}(ca);\n\nfunction la(t, e, n) {\n var r = function(t, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n e) {\n if (!(t instanceof e)) {\n if (e.name === t.constructor.name) throw new I(b.INVALID_ARGUMENT, \"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?\");\n var n = cs(t);\n throw new I(b.INVALID_ARGUMENT, \"Expected type '\" + e.name + \"', but it was: \" + n);\n }\n return t;\n }(e, ea);\n if (r.firestore !== n) throw new I(b.INVALID_ARGUMENT, \"Provided document reference is from a different Firestore instance.\");\n return r;\n}\n\nfunction pa(t) {\n switch (t) {\n case 0 /* Added */ :\n return \"added\";\n\n case 2 /* Modified */ :\n case 3 /* Metadata */ :\n return \"modified\";\n\n case 1 /* Removed */ :\n return \"removed\";\n\n default:\n return S();\n }\n}\n\n/**\n * Converts custom model object of type T into DocumentData by applying the\n * converter if it exists.\n *\n * This function is used when converting user objects to DocumentData\n * because we want to provide the user with a more specific error message if\n * their set() or fails due to invalid data originating from a toFirestore()\n * call.\n */ function da(t, e, n) {\n // Cast to `any` in order to satisfy the union type constraint on\n // toFirestore().\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e;\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ var va = /** @class */ function(e) {\n function n() {\n return null !== e && e.apply(this, arguments) || this;\n }\n return t(n, e), n.serverTimestamp = function() {\n var t = new ms(\"serverTimestamp\");\n return t.t_ = \"FieldValue.serverTimestamp\", new n(t);\n }, n.delete = function() {\n var t = new vs(\"deleteField\");\n return t.t_ = \"FieldValue.delete\", new n(t);\n }, n.arrayUnion = function() {\n for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];\n var r = \n /**\n * Returns a special value that can be used with {@link setDoc()} or {@link\n * updateDoc()} that tells the server to union the given elements with any array\n * value that already exists on the server. Each specified element that doesn't\n * already exist in the array will be added to the end. If the field being\n * modified is not already an array it will be overwritten with an array\n * containing exactly the specified elements.\n *\n * @param elements The elements to union into the array.\n * @return The `FieldValue` sentinel for use in a call to `setDoc()` or\n * `updateDoc()`.\n */\n function() {\n for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];\n // NOTE: We don't actually parse the data until it's used in set() or\n // update() since we'd need the Firestore instance to do this.\n return new gs(\"arrayUnion\", t);\n }.apply(void 0, t);\n return r.t_ = \"FieldValue.arrayUnion\", new n(r);\n }, n.arrayRemove = function() {\n for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];\n var r = function() {\n for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];\n // NOTE: We don't actually parse the data until it's used in set() or\n // update() since we'd need the Firestore instance to do this.\n return new ws(\"arrayRemove\", t);\n }.apply(void 0, t);\n return r.t_ = \"FieldValue.arrayRemove\", new n(r);\n }, n.increment = function(t) {\n var e = function(t) {\n return new bs(\"increment\", t);\n }(t);\n return e.t_ = \"FieldValue.increment\", new n(e);\n }, n.prototype.isEqual = function(t) {\n return this.u_.isEqual(t.u_);\n }, n;\n}(Es), ya = {\n Firestore: $s,\n GeoPoint: Is,\n Timestamp: Q,\n Blob: F,\n Transaction: Zs,\n WriteBatch: ta,\n DocumentReference: ea,\n DocumentSnapshot: ra,\n Query: ca,\n QueryDocumentSnapshot: ia,\n QuerySnapshot: ha,\n CollectionReference: fa,\n FieldPath: ls,\n FieldValue: va,\n setLogLevel: function(t) {\n var e;\n e = t, E.setLogLevel(e);\n },\n CACHE_SIZE_UNLIMITED: Qs\n};\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Configures Firestore as part of the Firebase SDK by calling registerService.\n *\n * @param firebase The FirebaseNamespace to register Firestore with\n * @param firestoreFactory A factory function that returns a new Firestore\n * instance.\n */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Registers the main Firestore build with the components framework.\n * Persistence can be enabled via `firebase.firestore().enablePersistence()`.\n */\nfunction ma(t) {\n !function(t, e) {\n t.INTERNAL.registerComponent(new w(\"firestore\", (function(t) {\n return function(t, e) {\n return new $s(t, e, new Js);\n }(t.getProvider(\"app\").getImmediate(), t.getProvider(\"auth-internal\"));\n }), \"PUBLIC\" /* PUBLIC */).setServiceProps(Object.assign({}, ya)));\n }(t), t.registerVersion(\"@firebase/firestore\", \"2.0.0\");\n}\n\nma(i);\n\nexport { ma as __PRIVATE_registerFirestore };\n//# sourceMappingURL=index.esm.js.map\n","import firebase from '@firebase/app';\nimport { __extends, __awaiter, __generator } from 'tslib';\nimport { Component } from '@firebase/component';\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Standard error codes for different ways a request can fail, as defined by:\r\n * https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto\r\n *\r\n * This map is used primarily to convert from a backend error code string to\r\n * a client SDK error code string, and make sure it's in the supported set.\r\n */\r\nvar errorCodeMap = {\r\n OK: 'ok',\r\n CANCELLED: 'cancelled',\r\n UNKNOWN: 'unknown',\r\n INVALID_ARGUMENT: 'invalid-argument',\r\n DEADLINE_EXCEEDED: 'deadline-exceeded',\r\n NOT_FOUND: 'not-found',\r\n ALREADY_EXISTS: 'already-exists',\r\n PERMISSION_DENIED: 'permission-denied',\r\n UNAUTHENTICATED: 'unauthenticated',\r\n RESOURCE_EXHAUSTED: 'resource-exhausted',\r\n FAILED_PRECONDITION: 'failed-precondition',\r\n ABORTED: 'aborted',\r\n OUT_OF_RANGE: 'out-of-range',\r\n UNIMPLEMENTED: 'unimplemented',\r\n INTERNAL: 'internal',\r\n UNAVAILABLE: 'unavailable',\r\n DATA_LOSS: 'data-loss'\r\n};\r\n/**\r\n * An explicit error that can be thrown from a handler to send an error to the\r\n * client that called the function.\r\n */\r\nvar HttpsErrorImpl = /** @class */ (function (_super) {\r\n __extends(HttpsErrorImpl, _super);\r\n function HttpsErrorImpl(code, message, details) {\r\n var _this = _super.call(this, message) || this;\r\n // This is a workaround for a bug in TypeScript when extending Error:\r\n // tslint:disable-next-line\r\n // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\r\n Object.setPrototypeOf(_this, HttpsErrorImpl.prototype);\r\n _this.code = code;\r\n _this.details = details;\r\n return _this;\r\n }\r\n return HttpsErrorImpl;\r\n}(Error));\r\n/**\r\n * Takes an HTTP status code and returns the corresponding ErrorCode.\r\n * This is the standard HTTP status code -> error mapping defined in:\r\n * https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto\r\n *\r\n * @param status An HTTP status code.\r\n * @return The corresponding ErrorCode, or ErrorCode.UNKNOWN if none.\r\n */\r\nfunction codeForHTTPStatus(status) {\r\n // Make sure any successful status is OK.\r\n if (status >= 200 && status < 300) {\r\n return 'ok';\r\n }\r\n switch (status) {\r\n case 0:\r\n // This can happen if the server returns 500.\r\n return 'internal';\r\n case 400:\r\n return 'invalid-argument';\r\n case 401:\r\n return 'unauthenticated';\r\n case 403:\r\n return 'permission-denied';\r\n case 404:\r\n return 'not-found';\r\n case 409:\r\n return 'aborted';\r\n case 429:\r\n return 'resource-exhausted';\r\n case 499:\r\n return 'cancelled';\r\n case 500:\r\n return 'internal';\r\n case 501:\r\n return 'unimplemented';\r\n case 503:\r\n return 'unavailable';\r\n case 504:\r\n return 'deadline-exceeded';\r\n }\r\n return 'unknown';\r\n}\r\n/**\r\n * Takes an HTTP response and returns the corresponding Error, if any.\r\n */\r\nfunction _errorForResponse(status, bodyJSON, serializer) {\r\n var code = codeForHTTPStatus(status);\r\n // Start with reasonable defaults from the status code.\r\n var description = code;\r\n var details = undefined;\r\n // Then look through the body for explicit details.\r\n try {\r\n var errorJSON = bodyJSON && bodyJSON.error;\r\n if (errorJSON) {\r\n var status_1 = errorJSON.status;\r\n if (typeof status_1 === 'string') {\r\n if (!errorCodeMap[status_1]) {\r\n // They must've included an unknown error code in the body.\r\n return new HttpsErrorImpl('internal', 'internal');\r\n }\r\n code = errorCodeMap[status_1];\r\n // TODO(klimt): Add better default descriptions for error enums.\r\n // The default description needs to be updated for the new code.\r\n description = status_1;\r\n }\r\n var message = errorJSON.message;\r\n if (typeof message === 'string') {\r\n description = message;\r\n }\r\n details = errorJSON.details;\r\n if (details !== undefined) {\r\n details = serializer.decode(details);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // If we couldn't parse explicit error data, that's fine.\r\n }\r\n if (code === 'ok') {\r\n // Technically, there's an edge case where a developer could explicitly\r\n // return an error code of OK, and we will treat it as success, but that\r\n // seems reasonable.\r\n return null;\r\n }\r\n return new HttpsErrorImpl(code, description, details);\r\n}\n\n/**\r\n * Helper class to get metadata that should be included with a function call.\r\n */\r\nvar ContextProvider = /** @class */ (function () {\r\n function ContextProvider(authProvider, messagingProvider) {\r\n var _this = this;\r\n this.auth = null;\r\n this.messaging = null;\r\n this.auth = authProvider.getImmediate({ optional: true });\r\n this.messaging = messagingProvider.getImmediate({\r\n optional: true\r\n });\r\n if (!this.auth) {\r\n authProvider.get().then(function (auth) { return (_this.auth = auth); }, function () {\r\n /* get() never rejects */\r\n });\r\n }\r\n if (!this.messaging) {\r\n messagingProvider.get().then(function (messaging) { return (_this.messaging = messaging); }, function () {\r\n /* get() never rejects */\r\n });\r\n }\r\n }\r\n ContextProvider.prototype.getAuthToken = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var token, e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!this.auth) {\r\n return [2 /*return*/, undefined];\r\n }\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, this.auth.getToken()];\r\n case 2:\r\n token = _a.sent();\r\n if (!token) {\r\n return [2 /*return*/, undefined];\r\n }\r\n return [2 /*return*/, token.accessToken];\r\n case 3:\r\n e_1 = _a.sent();\r\n // If there's any error when trying to get the auth token, leave it off.\r\n return [2 /*return*/, undefined];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n ContextProvider.prototype.getInstanceIdToken = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n if (!this.messaging ||\r\n !('Notification' in self) ||\r\n Notification.permission !== 'granted') {\r\n return [2 /*return*/, undefined];\r\n }\r\n try {\r\n return [2 /*return*/, this.messaging.getToken()];\r\n }\r\n catch (e) {\r\n // We don't warn on this, because it usually means messaging isn't set up.\r\n // console.warn('Failed to retrieve instance id token.', e);\r\n // If there's any error when trying to get the token, leave it off.\r\n return [2 /*return*/, undefined];\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n ContextProvider.prototype.getContext = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var authToken, instanceIdToken;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.getAuthToken()];\r\n case 1:\r\n authToken = _a.sent();\r\n return [4 /*yield*/, this.getInstanceIdToken()];\r\n case 2:\r\n instanceIdToken = _a.sent();\r\n return [2 /*return*/, { authToken: authToken, instanceIdToken: instanceIdToken }];\r\n }\r\n });\r\n });\r\n };\r\n return ContextProvider;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar LONG_TYPE = 'type.googleapis.com/google.protobuf.Int64Value';\r\nvar UNSIGNED_LONG_TYPE = 'type.googleapis.com/google.protobuf.UInt64Value';\r\nfunction mapValues(\r\n// { [k: string]: unknown } is no longer a wildcard assignment target after typescript 3.5\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\no, f) {\r\n var result = {};\r\n for (var key in o) {\r\n if (o.hasOwnProperty(key)) {\r\n result[key] = f(o[key]);\r\n }\r\n }\r\n return result;\r\n}\r\nvar Serializer = /** @class */ (function () {\r\n function Serializer() {\r\n }\r\n // Takes data and encodes it in a JSON-friendly way, such that types such as\r\n // Date are preserved.\r\n Serializer.prototype.encode = function (data) {\r\n var _this = this;\r\n if (data == null) {\r\n return null;\r\n }\r\n if (data instanceof Number) {\r\n data = data.valueOf();\r\n }\r\n if (typeof data === 'number' && isFinite(data)) {\r\n // Any number in JS is safe to put directly in JSON and parse as a double\r\n // without any loss of precision.\r\n return data;\r\n }\r\n if (data === true || data === false) {\r\n return data;\r\n }\r\n if (Object.prototype.toString.call(data) === '[object String]') {\r\n return data;\r\n }\r\n if (Array.isArray(data)) {\r\n return data.map(function (x) { return _this.encode(x); });\r\n }\r\n if (typeof data === 'function' || typeof data === 'object') {\r\n return mapValues(data, function (x) { return _this.encode(x); });\r\n }\r\n // If we got this far, the data is not encodable.\r\n throw new Error('Data cannot be encoded in JSON: ' + data);\r\n };\r\n // Takes data that's been encoded in a JSON-friendly form and returns a form\r\n // with richer datatypes, such as Dates, etc.\r\n Serializer.prototype.decode = function (json) {\r\n var _this = this;\r\n if (json == null) {\r\n return json;\r\n }\r\n if (json['@type']) {\r\n switch (json['@type']) {\r\n case LONG_TYPE:\r\n // Fall through and handle this the same as unsigned.\r\n case UNSIGNED_LONG_TYPE: {\r\n // Technically, this could work return a valid number for malformed\r\n // data if there was a number followed by garbage. But it's just not\r\n // worth all the extra code to detect that case.\r\n var value = Number(json['value']);\r\n if (isNaN(value)) {\r\n throw new Error('Data cannot be decoded from JSON: ' + json);\r\n }\r\n return value;\r\n }\r\n default: {\r\n throw new Error('Data cannot be decoded from JSON: ' + json);\r\n }\r\n }\r\n }\r\n if (Array.isArray(json)) {\r\n return json.map(function (x) { return _this.decode(x); });\r\n }\r\n if (typeof json === 'function' || typeof json === 'object') {\r\n return mapValues(json, function (x) { return _this.decode(x); });\r\n }\r\n // Anything else is safe to return.\r\n return json;\r\n };\r\n return Serializer;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns a Promise that will be rejected after the given duration.\r\n * The error will be of type HttpsErrorImpl.\r\n *\r\n * @param millis Number of milliseconds to wait before rejecting.\r\n */\r\nfunction failAfter(millis) {\r\n var timer;\r\n var promise = new Promise(function (_, reject) {\r\n timer = setTimeout(function () {\r\n reject(new HttpsErrorImpl('deadline-exceeded', 'deadline-exceeded'));\r\n }, millis);\r\n });\r\n return {\r\n timer: timer,\r\n promise: promise\r\n };\r\n}\r\n/**\r\n * The main class for the Firebase Functions SDK.\r\n */\r\nvar Service = /** @class */ (function () {\r\n /**\r\n * Creates a new Functions service for the given app and (optional) region or custom domain.\r\n * @param app_ The FirebaseApp to use.\r\n * @param regionOrCustomDomain_ one of:\r\n * a) A region to call functions from, such as us-central1\r\n * b) A custom domain to use as a functions prefix, such as https://mydomain.com\r\n */\r\n function Service(app_, authProvider, messagingProvider, regionOrCustomDomain_, fetchImpl) {\r\n var _this = this;\r\n if (regionOrCustomDomain_ === void 0) { regionOrCustomDomain_ = 'us-central1'; }\r\n this.app_ = app_;\r\n this.fetchImpl = fetchImpl;\r\n this.serializer = new Serializer();\r\n this.emulatorOrigin = null;\r\n this.INTERNAL = {\r\n delete: function () {\r\n return Promise.resolve(_this.deleteService());\r\n }\r\n };\r\n this.contextProvider = new ContextProvider(authProvider, messagingProvider);\r\n // Cancels all ongoing requests when resolved.\r\n this.cancelAllRequests = new Promise(function (resolve) {\r\n _this.deleteService = function () {\r\n return resolve();\r\n };\r\n });\r\n // Resolve the region or custom domain overload by attempting to parse it.\r\n try {\r\n var url = new URL(regionOrCustomDomain_);\r\n this.customDomain = url.origin;\r\n this.region = 'us-central1';\r\n }\r\n catch (e) {\r\n this.customDomain = null;\r\n this.region = regionOrCustomDomain_;\r\n }\r\n }\r\n Object.defineProperty(Service.prototype, \"app\", {\r\n get: function () {\r\n return this.app_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns the URL for a callable with the given name.\r\n * @param name The name of the callable.\r\n */\r\n Service.prototype._url = function (name) {\r\n var projectId = this.app_.options.projectId;\r\n if (this.emulatorOrigin !== null) {\r\n var origin_1 = this.emulatorOrigin;\r\n return origin_1 + \"/\" + projectId + \"/\" + this.region + \"/\" + name;\r\n }\r\n if (this.customDomain !== null) {\r\n return this.customDomain + \"/\" + name;\r\n }\r\n return \"https://\" + this.region + \"-\" + projectId + \".cloudfunctions.net/\" + name;\r\n };\r\n /**\r\n * Modify this instance to communicate with the Cloud Functions emulator.\r\n *\r\n * Note: this must be called before this instance has been used to do any operations.\r\n *\r\n * @param host The emulator host (ex: localhost)\r\n * @param port The emulator port (ex: 5001)\r\n */\r\n Service.prototype.useEmulator = function (host, port) {\r\n this.emulatorOrigin = \"http://\" + host + \":\" + port;\r\n };\r\n /**\r\n * Changes this instance to point to a Cloud Functions emulator running\r\n * locally. See https://firebase.google.com/docs/functions/local-emulator\r\n *\r\n * @deprecated Prefer the useEmulator(host, port) method.\r\n * @param origin The origin of the local emulator, such as\r\n * \"http://localhost:5005\".\r\n */\r\n Service.prototype.useFunctionsEmulator = function (origin) {\r\n this.emulatorOrigin = origin;\r\n };\r\n /**\r\n * Returns a reference to the callable https trigger with the given name.\r\n * @param name The name of the trigger.\r\n */\r\n Service.prototype.httpsCallable = function (name, options) {\r\n var _this = this;\r\n return function (data) {\r\n return _this.call(name, data, options || {});\r\n };\r\n };\r\n /**\r\n * Does an HTTP POST and returns the completed response.\r\n * @param url The url to post to.\r\n * @param body The JSON body of the post.\r\n * @param headers The HTTP headers to include in the request.\r\n * @return A Promise that will succeed when the request finishes.\r\n */\r\n Service.prototype.postJSON = function (url, body, headers) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var response, e_1, json, e_2;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n headers['Content-Type'] = 'application/json';\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, this.fetchImpl(url, {\r\n method: 'POST',\r\n body: JSON.stringify(body),\r\n headers: headers\r\n })];\r\n case 2:\r\n response = _a.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n e_1 = _a.sent();\r\n // This could be an unhandled error on the backend, or it could be a\r\n // network error. There's no way to know, since an unhandled error on the\r\n // backend will fail to set the proper CORS header, and thus will be\r\n // treated as a network error by fetch.\r\n return [2 /*return*/, {\r\n status: 0,\r\n json: null\r\n }];\r\n case 4:\r\n json = null;\r\n _a.label = 5;\r\n case 5:\r\n _a.trys.push([5, 7, , 8]);\r\n return [4 /*yield*/, response.json()];\r\n case 6:\r\n json = _a.sent();\r\n return [3 /*break*/, 8];\r\n case 7:\r\n e_2 = _a.sent();\r\n return [3 /*break*/, 8];\r\n case 8: return [2 /*return*/, {\r\n status: response.status,\r\n json: json\r\n }];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Calls a callable function asynchronously and returns the result.\r\n * @param name The name of the callable trigger.\r\n * @param data The data to pass as params to the function.s\r\n */\r\n Service.prototype.call = function (name, data, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var url, body, headers, context, timeout, _a, timer, failAfterPromise, response, error, responseData, decodedData;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n url = this._url(name);\r\n // Encode any special types, such as dates, in the input data.\r\n data = this.serializer.encode(data);\r\n body = { data: data };\r\n headers = {};\r\n return [4 /*yield*/, this.contextProvider.getContext()];\r\n case 1:\r\n context = _b.sent();\r\n if (context.authToken) {\r\n headers['Authorization'] = 'Bearer ' + context.authToken;\r\n }\r\n if (context.instanceIdToken) {\r\n headers['Firebase-Instance-ID-Token'] = context.instanceIdToken;\r\n }\r\n timeout = options.timeout || 70000;\r\n _a = failAfter(timeout), timer = _a.timer, failAfterPromise = _a.promise;\r\n return [4 /*yield*/, Promise.race([\r\n clearTimeoutWrapper(timer, this.postJSON(url, body, headers)),\r\n failAfterPromise,\r\n clearTimeoutWrapper(timer, this.cancelAllRequests)\r\n ])];\r\n case 2:\r\n response = _b.sent();\r\n // If service was deleted, interrupted response throws an error.\r\n if (!response) {\r\n throw new HttpsErrorImpl('cancelled', 'Firebase Functions instance was deleted.');\r\n }\r\n error = _errorForResponse(response.status, response.json, this.serializer);\r\n if (error) {\r\n throw error;\r\n }\r\n if (!response.json) {\r\n throw new HttpsErrorImpl('internal', 'Response is not valid JSON object.');\r\n }\r\n responseData = response.json.data;\r\n // TODO(klimt): For right now, allow \"result\" instead of \"data\", for\r\n // backwards compatibility.\r\n if (typeof responseData === 'undefined') {\r\n responseData = response.json.result;\r\n }\r\n if (typeof responseData === 'undefined') {\r\n // Consider the response malformed.\r\n throw new HttpsErrorImpl('internal', 'Response is missing data field.');\r\n }\r\n decodedData = this.serializer.decode(responseData);\r\n return [2 /*return*/, { data: decodedData }];\r\n }\r\n });\r\n });\r\n };\r\n return Service;\r\n}());\r\nfunction clearTimeoutWrapper(timer, promise) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var result;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, promise];\r\n case 1:\r\n result = _a.sent();\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n clearTimeout(timer);\r\n return [2 /*return*/, result];\r\n }\r\n });\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Type constant for Firebase Functions.\r\n */\r\nvar FUNCTIONS_TYPE = 'functions';\r\nfunction registerFunctions(instance, fetchImpl) {\r\n var namespaceExports = {\r\n // no-inline\r\n Functions: Service\r\n };\r\n function factory(container, regionOrCustomDomain) {\r\n // Dependencies\r\n var app = container.getProvider('app').getImmediate();\r\n var authProvider = container.getProvider('auth-internal');\r\n var messagingProvider = container.getProvider('messaging');\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return new Service(app, authProvider, messagingProvider, regionOrCustomDomain, fetchImpl);\r\n }\r\n instance.INTERNAL.registerComponent(new Component(FUNCTIONS_TYPE, factory, \"PUBLIC\" /* PUBLIC */)\r\n .setServiceProps(namespaceExports)\r\n .setMultipleInstances(true));\r\n}\n\nvar name = \"@firebase/functions\";\nvar version = \"0.6.0\";\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nregisterFunctions(firebase, fetch.bind(self));\r\nfirebase.registerVersion(name, version);\n//# sourceMappingURL=index.esm.js.map\n","import firebase from '@firebase/app';\nimport { Component } from '@firebase/component';\nimport { __awaiter, __generator, __spread, __values, __assign } from 'tslib';\nimport { ErrorFactory, FirebaseError } from '@firebase/util';\nimport { openDb } from 'idb';\n\nvar name = \"@firebase/installations\";\nvar version = \"0.4.18\";\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar PENDING_TIMEOUT_MS = 10000;\r\nvar PACKAGE_VERSION = \"w:\" + version;\r\nvar INTERNAL_AUTH_VERSION = 'FIS_v2';\r\nvar INSTALLATIONS_API_URL = 'https://firebaseinstallations.googleapis.com/v1';\r\nvar TOKEN_EXPIRATION_BUFFER = 60 * 60 * 1000; // One hour\r\nvar SERVICE = 'installations';\r\nvar SERVICE_NAME = 'Installations';\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar _a;\r\nvar ERROR_DESCRIPTION_MAP = (_a = {},\r\n _a[\"missing-app-config-values\" /* MISSING_APP_CONFIG_VALUES */] = 'Missing App configuration value: \"{$valueName}\"',\r\n _a[\"not-registered\" /* NOT_REGISTERED */] = 'Firebase Installation is not registered.',\r\n _a[\"installation-not-found\" /* INSTALLATION_NOT_FOUND */] = 'Firebase Installation not found.',\r\n _a[\"request-failed\" /* REQUEST_FAILED */] = '{$requestName} request failed with error \"{$serverCode} {$serverStatus}: {$serverMessage}\"',\r\n _a[\"app-offline\" /* APP_OFFLINE */] = 'Could not process request. Application offline.',\r\n _a[\"delete-pending-registration\" /* DELETE_PENDING_REGISTRATION */] = \"Can't delete installation while there is a pending registration request.\",\r\n _a);\r\nvar ERROR_FACTORY = new ErrorFactory(SERVICE, SERVICE_NAME, ERROR_DESCRIPTION_MAP);\r\n/** Returns true if error is a FirebaseError that is based on an error from the server. */\r\nfunction isServerError(error) {\r\n return (error instanceof FirebaseError &&\r\n error.code.includes(\"request-failed\" /* REQUEST_FAILED */));\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction getInstallationsEndpoint(_a) {\r\n var projectId = _a.projectId;\r\n return INSTALLATIONS_API_URL + \"/projects/\" + projectId + \"/installations\";\r\n}\r\nfunction extractAuthTokenInfoFromResponse(response) {\r\n return {\r\n token: response.token,\r\n requestStatus: 2 /* COMPLETED */,\r\n expiresIn: getExpiresInFromResponseExpiresIn(response.expiresIn),\r\n creationTime: Date.now()\r\n };\r\n}\r\nfunction getErrorFromResponse(requestName, response) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var responseJson, errorData;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, response.json()];\r\n case 1:\r\n responseJson = _a.sent();\r\n errorData = responseJson.error;\r\n return [2 /*return*/, ERROR_FACTORY.create(\"request-failed\" /* REQUEST_FAILED */, {\r\n requestName: requestName,\r\n serverCode: errorData.code,\r\n serverMessage: errorData.message,\r\n serverStatus: errorData.status\r\n })];\r\n }\r\n });\r\n });\r\n}\r\nfunction getHeaders(_a) {\r\n var apiKey = _a.apiKey;\r\n return new Headers({\r\n 'Content-Type': 'application/json',\r\n Accept: 'application/json',\r\n 'x-goog-api-key': apiKey\r\n });\r\n}\r\nfunction getHeadersWithAuth(appConfig, _a) {\r\n var refreshToken = _a.refreshToken;\r\n var headers = getHeaders(appConfig);\r\n headers.append('Authorization', getAuthorizationHeader(refreshToken));\r\n return headers;\r\n}\r\n/**\r\n * Calls the passed in fetch wrapper and returns the response.\r\n * If the returned response has a status of 5xx, re-runs the function once and\r\n * returns the response.\r\n */\r\nfunction retryIfServerError(fn) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var result;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, fn()];\r\n case 1:\r\n result = _a.sent();\r\n if (result.status >= 500 && result.status < 600) {\r\n // Internal Server Error. Retry request.\r\n return [2 /*return*/, fn()];\r\n }\r\n return [2 /*return*/, result];\r\n }\r\n });\r\n });\r\n}\r\nfunction getExpiresInFromResponseExpiresIn(responseExpiresIn) {\r\n // This works because the server will never respond with fractions of a second.\r\n return Number(responseExpiresIn.replace('s', '000'));\r\n}\r\nfunction getAuthorizationHeader(refreshToken) {\r\n return INTERNAL_AUTH_VERSION + \" \" + refreshToken;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction createInstallationRequest(appConfig, _a) {\r\n var fid = _a.fid;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var endpoint, headers, body, request, response, responseValue, registeredInstallationEntry;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n endpoint = getInstallationsEndpoint(appConfig);\r\n headers = getHeaders(appConfig);\r\n body = {\r\n fid: fid,\r\n authVersion: INTERNAL_AUTH_VERSION,\r\n appId: appConfig.appId,\r\n sdkVersion: PACKAGE_VERSION\r\n };\r\n request = {\r\n method: 'POST',\r\n headers: headers,\r\n body: JSON.stringify(body)\r\n };\r\n return [4 /*yield*/, retryIfServerError(function () { return fetch(endpoint, request); })];\r\n case 1:\r\n response = _b.sent();\r\n if (!response.ok) return [3 /*break*/, 3];\r\n return [4 /*yield*/, response.json()];\r\n case 2:\r\n responseValue = _b.sent();\r\n registeredInstallationEntry = {\r\n fid: responseValue.fid || fid,\r\n registrationStatus: 2 /* COMPLETED */,\r\n refreshToken: responseValue.refreshToken,\r\n authToken: extractAuthTokenInfoFromResponse(responseValue.authToken)\r\n };\r\n return [2 /*return*/, registeredInstallationEntry];\r\n case 3: return [4 /*yield*/, getErrorFromResponse('Create Installation', response)];\r\n case 4: throw _b.sent();\r\n }\r\n });\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Returns a promise that resolves after given time passes. */\r\nfunction sleep(ms) {\r\n return new Promise(function (resolve) {\r\n setTimeout(resolve, ms);\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction bufferToBase64UrlSafe(array) {\r\n var b64 = btoa(String.fromCharCode.apply(String, __spread(array)));\r\n return b64.replace(/\\+/g, '-').replace(/\\//g, '_');\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar VALID_FID_PATTERN = /^[cdef][\\w-]{21}$/;\r\nvar INVALID_FID = '';\r\n/**\r\n * Generates a new FID using random values from Web Crypto API.\r\n * Returns an empty string if FID generation fails for any reason.\r\n */\r\nfunction generateFid() {\r\n try {\r\n // A valid FID has exactly 22 base64 characters, which is 132 bits, or 16.5\r\n // bytes. our implementation generates a 17 byte array instead.\r\n var fidByteArray = new Uint8Array(17);\r\n var crypto_1 = self.crypto || self.msCrypto;\r\n crypto_1.getRandomValues(fidByteArray);\r\n // Replace the first 4 random bits with the constant FID header of 0b0111.\r\n fidByteArray[0] = 112 + (fidByteArray[0] % 16);\r\n var fid = encode(fidByteArray);\r\n return VALID_FID_PATTERN.test(fid) ? fid : INVALID_FID;\r\n }\r\n catch (_a) {\r\n // FID generation errored\r\n return INVALID_FID;\r\n }\r\n}\r\n/** Converts a FID Uint8Array to a base64 string representation. */\r\nfunction encode(fidByteArray) {\r\n var b64String = bufferToBase64UrlSafe(fidByteArray);\r\n // Remove the 23rd character that was added because of the extra 4 bits at the\r\n // end of our 17 byte array, and the '=' padding.\r\n return b64String.substr(0, 22);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Returns a string key that can be used to identify the app. */\r\nfunction getKey(appConfig) {\r\n return appConfig.appName + \"!\" + appConfig.appId;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar fidChangeCallbacks = new Map();\r\n/**\r\n * Calls the onIdChange callbacks with the new FID value, and broadcasts the\r\n * change to other tabs.\r\n */\r\nfunction fidChanged(appConfig, fid) {\r\n var key = getKey(appConfig);\r\n callFidChangeCallbacks(key, fid);\r\n broadcastFidChange(key, fid);\r\n}\r\nfunction addCallback(appConfig, callback) {\r\n // Open the broadcast channel if it's not already open,\r\n // to be able to listen to change events from other tabs.\r\n getBroadcastChannel();\r\n var key = getKey(appConfig);\r\n var callbackSet = fidChangeCallbacks.get(key);\r\n if (!callbackSet) {\r\n callbackSet = new Set();\r\n fidChangeCallbacks.set(key, callbackSet);\r\n }\r\n callbackSet.add(callback);\r\n}\r\nfunction removeCallback(appConfig, callback) {\r\n var key = getKey(appConfig);\r\n var callbackSet = fidChangeCallbacks.get(key);\r\n if (!callbackSet) {\r\n return;\r\n }\r\n callbackSet.delete(callback);\r\n if (callbackSet.size === 0) {\r\n fidChangeCallbacks.delete(key);\r\n }\r\n // Close broadcast channel if there are no more callbacks.\r\n closeBroadcastChannel();\r\n}\r\nfunction callFidChangeCallbacks(key, fid) {\r\n var e_1, _a;\r\n var callbacks = fidChangeCallbacks.get(key);\r\n if (!callbacks) {\r\n return;\r\n }\r\n try {\r\n for (var callbacks_1 = __values(callbacks), callbacks_1_1 = callbacks_1.next(); !callbacks_1_1.done; callbacks_1_1 = callbacks_1.next()) {\r\n var callback = callbacks_1_1.value;\r\n callback(fid);\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (callbacks_1_1 && !callbacks_1_1.done && (_a = callbacks_1.return)) _a.call(callbacks_1);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n}\r\nfunction broadcastFidChange(key, fid) {\r\n var channel = getBroadcastChannel();\r\n if (channel) {\r\n channel.postMessage({ key: key, fid: fid });\r\n }\r\n closeBroadcastChannel();\r\n}\r\nvar broadcastChannel = null;\r\n/** Opens and returns a BroadcastChannel if it is supported by the browser. */\r\nfunction getBroadcastChannel() {\r\n if (!broadcastChannel && 'BroadcastChannel' in self) {\r\n broadcastChannel = new BroadcastChannel('[Firebase] FID Change');\r\n broadcastChannel.onmessage = function (e) {\r\n callFidChangeCallbacks(e.data.key, e.data.fid);\r\n };\r\n }\r\n return broadcastChannel;\r\n}\r\nfunction closeBroadcastChannel() {\r\n if (fidChangeCallbacks.size === 0 && broadcastChannel) {\r\n broadcastChannel.close();\r\n broadcastChannel = null;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DATABASE_NAME = 'firebase-installations-database';\r\nvar DATABASE_VERSION = 1;\r\nvar OBJECT_STORE_NAME = 'firebase-installations-store';\r\nvar dbPromise = null;\r\nfunction getDbPromise() {\r\n if (!dbPromise) {\r\n dbPromise = openDb(DATABASE_NAME, DATABASE_VERSION, function (upgradeDB) {\r\n // We don't use 'break' in this switch statement, the fall-through\r\n // behavior is what we want, because if there are multiple versions between\r\n // the old version and the current version, we want ALL the migrations\r\n // that correspond to those versions to run, not only the last one.\r\n // eslint-disable-next-line default-case\r\n switch (upgradeDB.oldVersion) {\r\n case 0:\r\n upgradeDB.createObjectStore(OBJECT_STORE_NAME);\r\n }\r\n });\r\n }\r\n return dbPromise;\r\n}\r\n/** Assigns or overwrites the record for the given key with the given value. */\r\nfunction set(appConfig, value) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var key, db, tx, objectStore, oldValue;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n key = getKey(appConfig);\r\n return [4 /*yield*/, getDbPromise()];\r\n case 1:\r\n db = _a.sent();\r\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\r\n objectStore = tx.objectStore(OBJECT_STORE_NAME);\r\n return [4 /*yield*/, objectStore.get(key)];\r\n case 2:\r\n oldValue = _a.sent();\r\n return [4 /*yield*/, objectStore.put(value, key)];\r\n case 3:\r\n _a.sent();\r\n return [4 /*yield*/, tx.complete];\r\n case 4:\r\n _a.sent();\r\n if (!oldValue || oldValue.fid !== value.fid) {\r\n fidChanged(appConfig, value.fid);\r\n }\r\n return [2 /*return*/, value];\r\n }\r\n });\r\n });\r\n}\r\n/** Removes record(s) from the objectStore that match the given key. */\r\nfunction remove(appConfig) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var key, db, tx;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n key = getKey(appConfig);\r\n return [4 /*yield*/, getDbPromise()];\r\n case 1:\r\n db = _a.sent();\r\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\r\n return [4 /*yield*/, tx.objectStore(OBJECT_STORE_NAME).delete(key)];\r\n case 2:\r\n _a.sent();\r\n return [4 /*yield*/, tx.complete];\r\n case 3:\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Atomically updates a record with the result of updateFn, which gets\r\n * called with the current value. If newValue is undefined, the record is\r\n * deleted instead.\r\n * @return Updated value\r\n */\r\nfunction update(appConfig, updateFn) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var key, db, tx, store, oldValue, newValue;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n key = getKey(appConfig);\r\n return [4 /*yield*/, getDbPromise()];\r\n case 1:\r\n db = _a.sent();\r\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\r\n store = tx.objectStore(OBJECT_STORE_NAME);\r\n return [4 /*yield*/, store.get(key)];\r\n case 2:\r\n oldValue = _a.sent();\r\n newValue = updateFn(oldValue);\r\n if (!(newValue === undefined)) return [3 /*break*/, 4];\r\n return [4 /*yield*/, store.delete(key)];\r\n case 3:\r\n _a.sent();\r\n return [3 /*break*/, 6];\r\n case 4: return [4 /*yield*/, store.put(newValue, key)];\r\n case 5:\r\n _a.sent();\r\n _a.label = 6;\r\n case 6: return [4 /*yield*/, tx.complete];\r\n case 7:\r\n _a.sent();\r\n if (newValue && (!oldValue || oldValue.fid !== newValue.fid)) {\r\n fidChanged(appConfig, newValue.fid);\r\n }\r\n return [2 /*return*/, newValue];\r\n }\r\n });\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Updates and returns the InstallationEntry from the database.\r\n * Also triggers a registration request if it is necessary and possible.\r\n */\r\nfunction getInstallationEntry(appConfig) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var registrationPromise, installationEntry;\r\n var _a;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, update(appConfig, function (oldEntry) {\r\n var installationEntry = updateOrCreateInstallationEntry(oldEntry);\r\n var entryWithPromise = triggerRegistrationIfNecessary(appConfig, installationEntry);\r\n registrationPromise = entryWithPromise.registrationPromise;\r\n return entryWithPromise.installationEntry;\r\n })];\r\n case 1:\r\n installationEntry = _b.sent();\r\n if (!(installationEntry.fid === INVALID_FID)) return [3 /*break*/, 3];\r\n _a = {};\r\n return [4 /*yield*/, registrationPromise];\r\n case 2: \r\n // FID generation failed. Waiting for the FID from the server.\r\n return [2 /*return*/, (_a.installationEntry = _b.sent(), _a)];\r\n case 3: return [2 /*return*/, {\r\n installationEntry: installationEntry,\r\n registrationPromise: registrationPromise\r\n }];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Creates a new Installation Entry if one does not exist.\r\n * Also clears timed out pending requests.\r\n */\r\nfunction updateOrCreateInstallationEntry(oldEntry) {\r\n var entry = oldEntry || {\r\n fid: generateFid(),\r\n registrationStatus: 0 /* NOT_STARTED */\r\n };\r\n return clearTimedOutRequest(entry);\r\n}\r\n/**\r\n * If the Firebase Installation is not registered yet, this will trigger the\r\n * registration and return an InProgressInstallationEntry.\r\n *\r\n * If registrationPromise does not exist, the installationEntry is guaranteed\r\n * to be registered.\r\n */\r\nfunction triggerRegistrationIfNecessary(appConfig, installationEntry) {\r\n if (installationEntry.registrationStatus === 0 /* NOT_STARTED */) {\r\n if (!navigator.onLine) {\r\n // Registration required but app is offline.\r\n var registrationPromiseWithError = Promise.reject(ERROR_FACTORY.create(\"app-offline\" /* APP_OFFLINE */));\r\n return {\r\n installationEntry: installationEntry,\r\n registrationPromise: registrationPromiseWithError\r\n };\r\n }\r\n // Try registering. Change status to IN_PROGRESS.\r\n var inProgressEntry = {\r\n fid: installationEntry.fid,\r\n registrationStatus: 1 /* IN_PROGRESS */,\r\n registrationTime: Date.now()\r\n };\r\n var registrationPromise = registerInstallation(appConfig, inProgressEntry);\r\n return { installationEntry: inProgressEntry, registrationPromise: registrationPromise };\r\n }\r\n else if (installationEntry.registrationStatus === 1 /* IN_PROGRESS */) {\r\n return {\r\n installationEntry: installationEntry,\r\n registrationPromise: waitUntilFidRegistration(appConfig)\r\n };\r\n }\r\n else {\r\n return { installationEntry: installationEntry };\r\n }\r\n}\r\n/** This will be executed only once for each new Firebase Installation. */\r\nfunction registerInstallation(appConfig, installationEntry) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var registeredInstallationEntry, e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 2, , 7]);\r\n return [4 /*yield*/, createInstallationRequest(appConfig, installationEntry)];\r\n case 1:\r\n registeredInstallationEntry = _a.sent();\r\n return [2 /*return*/, set(appConfig, registeredInstallationEntry)];\r\n case 2:\r\n e_1 = _a.sent();\r\n if (!(isServerError(e_1) && e_1.customData.serverCode === 409)) return [3 /*break*/, 4];\r\n // Server returned a \"FID can not be used\" error.\r\n // Generate a new ID next time.\r\n return [4 /*yield*/, remove(appConfig)];\r\n case 3:\r\n // Server returned a \"FID can not be used\" error.\r\n // Generate a new ID next time.\r\n _a.sent();\r\n return [3 /*break*/, 6];\r\n case 4: \r\n // Registration failed. Set FID as not registered.\r\n return [4 /*yield*/, set(appConfig, {\r\n fid: installationEntry.fid,\r\n registrationStatus: 0 /* NOT_STARTED */\r\n })];\r\n case 5:\r\n // Registration failed. Set FID as not registered.\r\n _a.sent();\r\n _a.label = 6;\r\n case 6: throw e_1;\r\n case 7: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/** Call if FID registration is pending in another request. */\r\nfunction waitUntilFidRegistration(appConfig) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var entry, _a, installationEntry, registrationPromise;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, updateInstallationRequest(appConfig)];\r\n case 1:\r\n entry = _b.sent();\r\n _b.label = 2;\r\n case 2:\r\n if (!(entry.registrationStatus === 1 /* IN_PROGRESS */)) return [3 /*break*/, 5];\r\n // createInstallation request still in progress.\r\n return [4 /*yield*/, sleep(100)];\r\n case 3:\r\n // createInstallation request still in progress.\r\n _b.sent();\r\n return [4 /*yield*/, updateInstallationRequest(appConfig)];\r\n case 4:\r\n entry = _b.sent();\r\n return [3 /*break*/, 2];\r\n case 5:\r\n if (!(entry.registrationStatus === 0 /* NOT_STARTED */)) return [3 /*break*/, 7];\r\n return [4 /*yield*/, getInstallationEntry(appConfig)];\r\n case 6:\r\n _a = _b.sent(), installationEntry = _a.installationEntry, registrationPromise = _a.registrationPromise;\r\n if (registrationPromise) {\r\n return [2 /*return*/, registrationPromise];\r\n }\r\n else {\r\n // if there is no registrationPromise, entry is registered.\r\n return [2 /*return*/, installationEntry];\r\n }\r\n case 7: return [2 /*return*/, entry];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Called only if there is a CreateInstallation request in progress.\r\n *\r\n * Updates the InstallationEntry in the DB based on the status of the\r\n * CreateInstallation request.\r\n *\r\n * Returns the updated InstallationEntry.\r\n */\r\nfunction updateInstallationRequest(appConfig) {\r\n return update(appConfig, function (oldEntry) {\r\n if (!oldEntry) {\r\n throw ERROR_FACTORY.create(\"installation-not-found\" /* INSTALLATION_NOT_FOUND */);\r\n }\r\n return clearTimedOutRequest(oldEntry);\r\n });\r\n}\r\nfunction clearTimedOutRequest(entry) {\r\n if (hasInstallationRequestTimedOut(entry)) {\r\n return {\r\n fid: entry.fid,\r\n registrationStatus: 0 /* NOT_STARTED */\r\n };\r\n }\r\n return entry;\r\n}\r\nfunction hasInstallationRequestTimedOut(installationEntry) {\r\n return (installationEntry.registrationStatus === 1 /* IN_PROGRESS */ &&\r\n installationEntry.registrationTime + PENDING_TIMEOUT_MS < Date.now());\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction generateAuthTokenRequest(_a, installationEntry) {\r\n var appConfig = _a.appConfig, platformLoggerProvider = _a.platformLoggerProvider;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var endpoint, headers, platformLogger, body, request, response, responseValue, completedAuthToken;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n endpoint = getGenerateAuthTokenEndpoint(appConfig, installationEntry);\r\n headers = getHeadersWithAuth(appConfig, installationEntry);\r\n platformLogger = platformLoggerProvider.getImmediate({\r\n optional: true\r\n });\r\n if (platformLogger) {\r\n headers.append('x-firebase-client', platformLogger.getPlatformInfoString());\r\n }\r\n body = {\r\n installation: {\r\n sdkVersion: PACKAGE_VERSION\r\n }\r\n };\r\n request = {\r\n method: 'POST',\r\n headers: headers,\r\n body: JSON.stringify(body)\r\n };\r\n return [4 /*yield*/, retryIfServerError(function () { return fetch(endpoint, request); })];\r\n case 1:\r\n response = _b.sent();\r\n if (!response.ok) return [3 /*break*/, 3];\r\n return [4 /*yield*/, response.json()];\r\n case 2:\r\n responseValue = _b.sent();\r\n completedAuthToken = extractAuthTokenInfoFromResponse(responseValue);\r\n return [2 /*return*/, completedAuthToken];\r\n case 3: return [4 /*yield*/, getErrorFromResponse('Generate Auth Token', response)];\r\n case 4: throw _b.sent();\r\n }\r\n });\r\n });\r\n}\r\nfunction getGenerateAuthTokenEndpoint(appConfig, _a) {\r\n var fid = _a.fid;\r\n return getInstallationsEndpoint(appConfig) + \"/\" + fid + \"/authTokens:generate\";\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns a valid authentication token for the installation. Generates a new\r\n * token if one doesn't exist, is expired or about to expire.\r\n *\r\n * Should only be called if the Firebase Installation is registered.\r\n */\r\nfunction refreshAuthToken(dependencies, forceRefresh) {\r\n if (forceRefresh === void 0) { forceRefresh = false; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var tokenPromise, entry, authToken, _a;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, update(dependencies.appConfig, function (oldEntry) {\r\n if (!isEntryRegistered(oldEntry)) {\r\n throw ERROR_FACTORY.create(\"not-registered\" /* NOT_REGISTERED */);\r\n }\r\n var oldAuthToken = oldEntry.authToken;\r\n if (!forceRefresh && isAuthTokenValid(oldAuthToken)) {\r\n // There is a valid token in the DB.\r\n return oldEntry;\r\n }\r\n else if (oldAuthToken.requestStatus === 1 /* IN_PROGRESS */) {\r\n // There already is a token request in progress.\r\n tokenPromise = waitUntilAuthTokenRequest(dependencies, forceRefresh);\r\n return oldEntry;\r\n }\r\n else {\r\n // No token or token expired.\r\n if (!navigator.onLine) {\r\n throw ERROR_FACTORY.create(\"app-offline\" /* APP_OFFLINE */);\r\n }\r\n var inProgressEntry = makeAuthTokenRequestInProgressEntry(oldEntry);\r\n tokenPromise = fetchAuthTokenFromServer(dependencies, inProgressEntry);\r\n return inProgressEntry;\r\n }\r\n })];\r\n case 1:\r\n entry = _b.sent();\r\n if (!tokenPromise) return [3 /*break*/, 3];\r\n return [4 /*yield*/, tokenPromise];\r\n case 2:\r\n _a = _b.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n _a = entry.authToken;\r\n _b.label = 4;\r\n case 4:\r\n authToken = _a;\r\n return [2 /*return*/, authToken];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Call only if FID is registered and Auth Token request is in progress.\r\n *\r\n * Waits until the current pending request finishes. If the request times out,\r\n * tries once in this thread as well.\r\n */\r\nfunction waitUntilAuthTokenRequest(dependencies, forceRefresh) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var entry, authToken;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, updateAuthTokenRequest(dependencies.appConfig)];\r\n case 1:\r\n entry = _a.sent();\r\n _a.label = 2;\r\n case 2:\r\n if (!(entry.authToken.requestStatus === 1 /* IN_PROGRESS */)) return [3 /*break*/, 5];\r\n // generateAuthToken still in progress.\r\n return [4 /*yield*/, sleep(100)];\r\n case 3:\r\n // generateAuthToken still in progress.\r\n _a.sent();\r\n return [4 /*yield*/, updateAuthTokenRequest(dependencies.appConfig)];\r\n case 4:\r\n entry = _a.sent();\r\n return [3 /*break*/, 2];\r\n case 5:\r\n authToken = entry.authToken;\r\n if (authToken.requestStatus === 0 /* NOT_STARTED */) {\r\n // The request timed out or failed in a different call. Try again.\r\n return [2 /*return*/, refreshAuthToken(dependencies, forceRefresh)];\r\n }\r\n else {\r\n return [2 /*return*/, authToken];\r\n }\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Called only if there is a GenerateAuthToken request in progress.\r\n *\r\n * Updates the InstallationEntry in the DB based on the status of the\r\n * GenerateAuthToken request.\r\n *\r\n * Returns the updated InstallationEntry.\r\n */\r\nfunction updateAuthTokenRequest(appConfig) {\r\n return update(appConfig, function (oldEntry) {\r\n if (!isEntryRegistered(oldEntry)) {\r\n throw ERROR_FACTORY.create(\"not-registered\" /* NOT_REGISTERED */);\r\n }\r\n var oldAuthToken = oldEntry.authToken;\r\n if (hasAuthTokenRequestTimedOut(oldAuthToken)) {\r\n return __assign(__assign({}, oldEntry), { authToken: { requestStatus: 0 /* NOT_STARTED */ } });\r\n }\r\n return oldEntry;\r\n });\r\n}\r\nfunction fetchAuthTokenFromServer(dependencies, installationEntry) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var authToken, updatedInstallationEntry, e_1, updatedInstallationEntry;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 3, , 8]);\r\n return [4 /*yield*/, generateAuthTokenRequest(dependencies, installationEntry)];\r\n case 1:\r\n authToken = _a.sent();\r\n updatedInstallationEntry = __assign(__assign({}, installationEntry), { authToken: authToken });\r\n return [4 /*yield*/, set(dependencies.appConfig, updatedInstallationEntry)];\r\n case 2:\r\n _a.sent();\r\n return [2 /*return*/, authToken];\r\n case 3:\r\n e_1 = _a.sent();\r\n if (!(isServerError(e_1) &&\r\n (e_1.customData.serverCode === 401 || e_1.customData.serverCode === 404))) return [3 /*break*/, 5];\r\n // Server returned a \"FID not found\" or a \"Invalid authentication\" error.\r\n // Generate a new ID next time.\r\n return [4 /*yield*/, remove(dependencies.appConfig)];\r\n case 4:\r\n // Server returned a \"FID not found\" or a \"Invalid authentication\" error.\r\n // Generate a new ID next time.\r\n _a.sent();\r\n return [3 /*break*/, 7];\r\n case 5:\r\n updatedInstallationEntry = __assign(__assign({}, installationEntry), { authToken: { requestStatus: 0 /* NOT_STARTED */ } });\r\n return [4 /*yield*/, set(dependencies.appConfig, updatedInstallationEntry)];\r\n case 6:\r\n _a.sent();\r\n _a.label = 7;\r\n case 7: throw e_1;\r\n case 8: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\nfunction isEntryRegistered(installationEntry) {\r\n return (installationEntry !== undefined &&\r\n installationEntry.registrationStatus === 2 /* COMPLETED */);\r\n}\r\nfunction isAuthTokenValid(authToken) {\r\n return (authToken.requestStatus === 2 /* COMPLETED */ &&\r\n !isAuthTokenExpired(authToken));\r\n}\r\nfunction isAuthTokenExpired(authToken) {\r\n var now = Date.now();\r\n return (now < authToken.creationTime ||\r\n authToken.creationTime + authToken.expiresIn < now + TOKEN_EXPIRATION_BUFFER);\r\n}\r\n/** Returns an updated InstallationEntry with an InProgressAuthToken. */\r\nfunction makeAuthTokenRequestInProgressEntry(oldEntry) {\r\n var inProgressAuthToken = {\r\n requestStatus: 1 /* IN_PROGRESS */,\r\n requestTime: Date.now()\r\n };\r\n return __assign(__assign({}, oldEntry), { authToken: inProgressAuthToken });\r\n}\r\nfunction hasAuthTokenRequestTimedOut(authToken) {\r\n return (authToken.requestStatus === 1 /* IN_PROGRESS */ &&\r\n authToken.requestTime + PENDING_TIMEOUT_MS < Date.now());\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction getId(dependencies) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _a, installationEntry, registrationPromise;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, getInstallationEntry(dependencies.appConfig)];\r\n case 1:\r\n _a = _b.sent(), installationEntry = _a.installationEntry, registrationPromise = _a.registrationPromise;\r\n if (registrationPromise) {\r\n registrationPromise.catch(console.error);\r\n }\r\n else {\r\n // If the installation is already registered, update the authentication\r\n // token if needed.\r\n refreshAuthToken(dependencies).catch(console.error);\r\n }\r\n return [2 /*return*/, installationEntry.fid];\r\n }\r\n });\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction getToken(dependencies, forceRefresh) {\r\n if (forceRefresh === void 0) { forceRefresh = false; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var authToken;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, completeInstallationRegistration(dependencies.appConfig)];\r\n case 1:\r\n _a.sent();\r\n return [4 /*yield*/, refreshAuthToken(dependencies, forceRefresh)];\r\n case 2:\r\n authToken = _a.sent();\r\n return [2 /*return*/, authToken.token];\r\n }\r\n });\r\n });\r\n}\r\nfunction completeInstallationRegistration(appConfig) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var registrationPromise;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, getInstallationEntry(appConfig)];\r\n case 1:\r\n registrationPromise = (_a.sent()).registrationPromise;\r\n if (!registrationPromise) return [3 /*break*/, 3];\r\n // A createInstallation request is in progress. Wait until it finishes.\r\n return [4 /*yield*/, registrationPromise];\r\n case 2:\r\n // A createInstallation request is in progress. Wait until it finishes.\r\n _a.sent();\r\n _a.label = 3;\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction deleteInstallationRequest(appConfig, installationEntry) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var endpoint, headers, request, response;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n endpoint = getDeleteEndpoint(appConfig, installationEntry);\r\n headers = getHeadersWithAuth(appConfig, installationEntry);\r\n request = {\r\n method: 'DELETE',\r\n headers: headers\r\n };\r\n return [4 /*yield*/, retryIfServerError(function () { return fetch(endpoint, request); })];\r\n case 1:\r\n response = _a.sent();\r\n if (!!response.ok) return [3 /*break*/, 3];\r\n return [4 /*yield*/, getErrorFromResponse('Delete Installation', response)];\r\n case 2: throw _a.sent();\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\nfunction getDeleteEndpoint(appConfig, _a) {\r\n var fid = _a.fid;\r\n return getInstallationsEndpoint(appConfig) + \"/\" + fid;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction deleteInstallation(dependencies) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var appConfig, entry;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n appConfig = dependencies.appConfig;\r\n return [4 /*yield*/, update(appConfig, function (oldEntry) {\r\n if (oldEntry && oldEntry.registrationStatus === 0 /* NOT_STARTED */) {\r\n // Delete the unregistered entry without sending a deleteInstallation request.\r\n return undefined;\r\n }\r\n return oldEntry;\r\n })];\r\n case 1:\r\n entry = _a.sent();\r\n if (!entry) return [3 /*break*/, 6];\r\n if (!(entry.registrationStatus === 1 /* IN_PROGRESS */)) return [3 /*break*/, 2];\r\n // Can't delete while trying to register.\r\n throw ERROR_FACTORY.create(\"delete-pending-registration\" /* DELETE_PENDING_REGISTRATION */);\r\n case 2:\r\n if (!(entry.registrationStatus === 2 /* COMPLETED */)) return [3 /*break*/, 6];\r\n if (!!navigator.onLine) return [3 /*break*/, 3];\r\n throw ERROR_FACTORY.create(\"app-offline\" /* APP_OFFLINE */);\r\n case 3: return [4 /*yield*/, deleteInstallationRequest(appConfig, entry)];\r\n case 4:\r\n _a.sent();\r\n return [4 /*yield*/, remove(appConfig)];\r\n case 5:\r\n _a.sent();\r\n _a.label = 6;\r\n case 6: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Sets a new callback that will get called when Installation ID changes.\r\n * Returns an unsubscribe function that will remove the callback when called.\r\n */\r\nfunction onIdChange(_a, callback) {\r\n var appConfig = _a.appConfig;\r\n addCallback(appConfig, callback);\r\n return function () {\r\n removeCallback(appConfig, callback);\r\n };\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction extractAppConfig(app) {\r\n var e_1, _a;\r\n if (!app || !app.options) {\r\n throw getMissingValueError('App Configuration');\r\n }\r\n if (!app.name) {\r\n throw getMissingValueError('App Name');\r\n }\r\n // Required app config keys\r\n var configKeys = [\r\n 'projectId',\r\n 'apiKey',\r\n 'appId'\r\n ];\r\n try {\r\n for (var configKeys_1 = __values(configKeys), configKeys_1_1 = configKeys_1.next(); !configKeys_1_1.done; configKeys_1_1 = configKeys_1.next()) {\r\n var keyName = configKeys_1_1.value;\r\n if (!app.options[keyName]) {\r\n throw getMissingValueError(keyName);\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (configKeys_1_1 && !configKeys_1_1.done && (_a = configKeys_1.return)) _a.call(configKeys_1);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n return {\r\n appName: app.name,\r\n projectId: app.options.projectId,\r\n apiKey: app.options.apiKey,\r\n appId: app.options.appId\r\n };\r\n}\r\nfunction getMissingValueError(valueName) {\r\n return ERROR_FACTORY.create(\"missing-app-config-values\" /* MISSING_APP_CONFIG_VALUES */, {\r\n valueName: valueName\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction registerInstallations(instance) {\r\n var installationsName = 'installations';\r\n instance.INTERNAL.registerComponent(new Component(installationsName, function (container) {\r\n var app = container.getProvider('app').getImmediate();\r\n // Throws if app isn't configured properly.\r\n var appConfig = extractAppConfig(app);\r\n var platformLoggerProvider = container.getProvider('platform-logger');\r\n var dependencies = {\r\n appConfig: appConfig,\r\n platformLoggerProvider: platformLoggerProvider\r\n };\r\n var installations = {\r\n app: app,\r\n getId: function () { return getId(dependencies); },\r\n getToken: function (forceRefresh) {\r\n return getToken(dependencies, forceRefresh);\r\n },\r\n delete: function () { return deleteInstallation(dependencies); },\r\n onIdChange: function (callback) {\r\n return onIdChange(dependencies, callback);\r\n }\r\n };\r\n return installations;\r\n }, \"PUBLIC\" /* PUBLIC */));\r\n instance.registerVersion(name, version);\r\n}\r\nregisterInstallations(firebase);\n\nexport { registerInstallations };\n//# sourceMappingURL=index.esm.js.map\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n\r\nfunction __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar _a;\r\n/**\r\n * A container for all of the Logger instances\r\n */\r\nvar instances = [];\r\n/**\r\n * The JS SDK supports 5 log levels and also allows a user the ability to\r\n * silence the logs altogether.\r\n *\r\n * The order is a follows:\r\n * DEBUG < VERBOSE < INFO < WARN < ERROR\r\n *\r\n * All of the log types above the current log level will be captured (i.e. if\r\n * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and\r\n * `VERBOSE` logs will not)\r\n */\r\nvar LogLevel;\r\n(function (LogLevel) {\r\n LogLevel[LogLevel[\"DEBUG\"] = 0] = \"DEBUG\";\r\n LogLevel[LogLevel[\"VERBOSE\"] = 1] = \"VERBOSE\";\r\n LogLevel[LogLevel[\"INFO\"] = 2] = \"INFO\";\r\n LogLevel[LogLevel[\"WARN\"] = 3] = \"WARN\";\r\n LogLevel[LogLevel[\"ERROR\"] = 4] = \"ERROR\";\r\n LogLevel[LogLevel[\"SILENT\"] = 5] = \"SILENT\";\r\n})(LogLevel || (LogLevel = {}));\r\nvar levelStringToEnum = {\r\n 'debug': LogLevel.DEBUG,\r\n 'verbose': LogLevel.VERBOSE,\r\n 'info': LogLevel.INFO,\r\n 'warn': LogLevel.WARN,\r\n 'error': LogLevel.ERROR,\r\n 'silent': LogLevel.SILENT\r\n};\r\n/**\r\n * The default log level\r\n */\r\nvar defaultLogLevel = LogLevel.INFO;\r\n/**\r\n * By default, `console.debug` is not displayed in the developer console (in\r\n * chrome). To avoid forcing users to have to opt-in to these logs twice\r\n * (i.e. once for firebase, and once in the console), we are sending `DEBUG`\r\n * logs to the `console.log` function.\r\n */\r\nvar ConsoleMethod = (_a = {},\r\n _a[LogLevel.DEBUG] = 'log',\r\n _a[LogLevel.VERBOSE] = 'log',\r\n _a[LogLevel.INFO] = 'info',\r\n _a[LogLevel.WARN] = 'warn',\r\n _a[LogLevel.ERROR] = 'error',\r\n _a);\r\n/**\r\n * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR\r\n * messages on to their corresponding console counterparts (if the log method\r\n * is supported by the current log level)\r\n */\r\nvar defaultLogHandler = function (instance, logType) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n if (logType < instance.logLevel) {\r\n return;\r\n }\r\n var now = new Date().toISOString();\r\n var method = ConsoleMethod[logType];\r\n if (method) {\r\n console[method].apply(console, __spreadArrays([\"[\" + now + \"] \" + instance.name + \":\"], args));\r\n }\r\n else {\r\n throw new Error(\"Attempted to log a message with an invalid logType (value: \" + logType + \")\");\r\n }\r\n};\r\nvar Logger = /** @class */ (function () {\r\n /**\r\n * Gives you an instance of a Logger to capture messages according to\r\n * Firebase's logging scheme.\r\n *\r\n * @param name The name that the logs will be associated with\r\n */\r\n function Logger(name) {\r\n this.name = name;\r\n /**\r\n * The log level of the given Logger instance.\r\n */\r\n this._logLevel = defaultLogLevel;\r\n /**\r\n * The main (internal) log handler for the Logger instance.\r\n * Can be set to a new function in internal package code but not by user.\r\n */\r\n this._logHandler = defaultLogHandler;\r\n /**\r\n * The optional, additional, user-defined log handler for the Logger instance.\r\n */\r\n this._userLogHandler = null;\r\n /**\r\n * Capture the current instance for later use\r\n */\r\n instances.push(this);\r\n }\r\n Object.defineProperty(Logger.prototype, \"logLevel\", {\r\n get: function () {\r\n return this._logLevel;\r\n },\r\n set: function (val) {\r\n if (!(val in LogLevel)) {\r\n throw new TypeError(\"Invalid value \\\"\" + val + \"\\\" assigned to `logLevel`\");\r\n }\r\n this._logLevel = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Workaround for setter/getter having to be the same type.\r\n Logger.prototype.setLogLevel = function (val) {\r\n this._logLevel = typeof val === 'string' ? levelStringToEnum[val] : val;\r\n };\r\n Object.defineProperty(Logger.prototype, \"logHandler\", {\r\n get: function () {\r\n return this._logHandler;\r\n },\r\n set: function (val) {\r\n if (typeof val !== 'function') {\r\n throw new TypeError('Value assigned to `logHandler` must be a function');\r\n }\r\n this._logHandler = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Logger.prototype, \"userLogHandler\", {\r\n get: function () {\r\n return this._userLogHandler;\r\n },\r\n set: function (val) {\r\n this._userLogHandler = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * The functions below are all based on the `console` interface\r\n */\r\n Logger.prototype.debug = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._userLogHandler && this._userLogHandler.apply(this, __spreadArrays([this, LogLevel.DEBUG], args));\r\n this._logHandler.apply(this, __spreadArrays([this, LogLevel.DEBUG], args));\r\n };\r\n Logger.prototype.log = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._userLogHandler && this._userLogHandler.apply(this, __spreadArrays([this, LogLevel.VERBOSE], args));\r\n this._logHandler.apply(this, __spreadArrays([this, LogLevel.VERBOSE], args));\r\n };\r\n Logger.prototype.info = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._userLogHandler && this._userLogHandler.apply(this, __spreadArrays([this, LogLevel.INFO], args));\r\n this._logHandler.apply(this, __spreadArrays([this, LogLevel.INFO], args));\r\n };\r\n Logger.prototype.warn = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._userLogHandler && this._userLogHandler.apply(this, __spreadArrays([this, LogLevel.WARN], args));\r\n this._logHandler.apply(this, __spreadArrays([this, LogLevel.WARN], args));\r\n };\r\n Logger.prototype.error = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._userLogHandler && this._userLogHandler.apply(this, __spreadArrays([this, LogLevel.ERROR], args));\r\n this._logHandler.apply(this, __spreadArrays([this, LogLevel.ERROR], args));\r\n };\r\n return Logger;\r\n}());\r\nfunction setLogLevel(level) {\r\n instances.forEach(function (inst) {\r\n inst.setLogLevel(level);\r\n });\r\n}\r\nfunction setUserLogHandler(logCallback, options) {\r\n var _loop_1 = function (instance) {\r\n var customLogLevel = null;\r\n if (options && options.level) {\r\n customLogLevel = levelStringToEnum[options.level];\r\n }\r\n if (logCallback === null) {\r\n instance.userLogHandler = null;\r\n }\r\n else {\r\n instance.userLogHandler = function (instance, level) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n var message = args\r\n .map(function (arg) {\r\n if (arg == null) {\r\n return null;\r\n }\r\n else if (typeof arg === 'string') {\r\n return arg;\r\n }\r\n else if (typeof arg === 'number' || typeof arg === 'boolean') {\r\n return arg.toString();\r\n }\r\n else if (arg instanceof Error) {\r\n return arg.message;\r\n }\r\n else {\r\n try {\r\n return JSON.stringify(arg);\r\n }\r\n catch (ignored) {\r\n return null;\r\n }\r\n }\r\n })\r\n .filter(function (arg) { return arg; })\r\n .join(' ');\r\n if (level >= (customLogLevel !== null && customLogLevel !== void 0 ? customLogLevel : instance.logLevel)) {\r\n logCallback({\r\n level: LogLevel[level].toLowerCase(),\r\n message: message,\r\n args: args,\r\n type: instance.name\r\n });\r\n }\r\n };\r\n }\r\n };\r\n for (var _i = 0, instances_1 = instances; _i < instances_1.length; _i++) {\r\n var instance = instances_1[_i];\r\n _loop_1(instance);\r\n }\r\n}\n\nexport { LogLevel, Logger, setLogLevel, setUserLogHandler };\n//# sourceMappingURL=index.esm.js.map\n","import '@firebase/installations';\nimport { Component } from '@firebase/component';\nimport { ErrorFactory } from '@firebase/util';\nimport { __spread, __awaiter, __generator, __assign, __values } from 'tslib';\nimport { deleteDb, openDb } from 'idb';\nimport firebase from '@firebase/app';\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar _a;\r\nvar ERROR_MAP = (_a = {},\r\n _a[\"missing-app-config-values\" /* MISSING_APP_CONFIG_VALUES */] = 'Missing App configuration value: \"{$valueName}\"',\r\n _a[\"only-available-in-window\" /* AVAILABLE_IN_WINDOW */] = 'This method is available in a Window context.',\r\n _a[\"only-available-in-sw\" /* AVAILABLE_IN_SW */] = 'This method is available in a service worker context.',\r\n _a[\"permission-default\" /* PERMISSION_DEFAULT */] = 'The notification permission was not granted and dismissed instead.',\r\n _a[\"permission-blocked\" /* PERMISSION_BLOCKED */] = 'The notification permission was not granted and blocked instead.',\r\n _a[\"unsupported-browser\" /* UNSUPPORTED_BROWSER */] = \"This browser doesn't support the API's required to use the firebase SDK.\",\r\n _a[\"failed-service-worker-registration\" /* FAILED_DEFAULT_REGISTRATION */] = 'We are unable to register the default service worker. {$browserErrorMessage}',\r\n _a[\"token-subscribe-failed\" /* TOKEN_SUBSCRIBE_FAILED */] = 'A problem occurred while subscribing the user to FCM: {$errorInfo}',\r\n _a[\"token-subscribe-no-token\" /* TOKEN_SUBSCRIBE_NO_TOKEN */] = 'FCM returned no token when subscribing the user to push.',\r\n _a[\"token-unsubscribe-failed\" /* TOKEN_UNSUBSCRIBE_FAILED */] = 'A problem occurred while unsubscribing the ' +\r\n 'user from FCM: {$errorInfo}',\r\n _a[\"token-update-failed\" /* TOKEN_UPDATE_FAILED */] = 'A problem occurred while updating the user from FCM: {$errorInfo}',\r\n _a[\"token-update-no-token\" /* TOKEN_UPDATE_NO_TOKEN */] = 'FCM returned no token when updating the user to push.',\r\n _a[\"use-sw-after-get-token\" /* USE_SW_AFTER_GET_TOKEN */] = 'The useServiceWorker() method may only be called once and must be ' +\r\n 'called before calling getToken() to ensure your service worker is used.',\r\n _a[\"invalid-sw-registration\" /* INVALID_SW_REGISTRATION */] = 'The input to useServiceWorker() must be a ServiceWorkerRegistration.',\r\n _a[\"invalid-bg-handler\" /* INVALID_BG_HANDLER */] = 'The input to setBackgroundMessageHandler() must be a function.',\r\n _a[\"invalid-vapid-key\" /* INVALID_VAPID_KEY */] = 'The public VAPID key must be a string.',\r\n _a[\"use-vapid-key-after-get-token\" /* USE_VAPID_KEY_AFTER_GET_TOKEN */] = 'The usePublicVapidKey() method may only be called once and must be ' +\r\n 'called before calling getToken() to ensure your VAPID key is used.',\r\n _a);\r\nvar ERROR_FACTORY = new ErrorFactory('messaging', 'Messaging', ERROR_MAP);\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DEFAULT_SW_PATH = '/firebase-messaging-sw.js';\r\nvar DEFAULT_SW_SCOPE = '/firebase-cloud-messaging-push-scope';\r\nvar DEFAULT_VAPID_KEY = 'BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4';\r\nvar ENDPOINT = 'https://fcmregistrations.googleapis.com/v1';\r\n/** Key of FCM Payload in Notification's data field. */\r\nvar FCM_MSG = 'FCM_MSG';\r\nvar CONSOLE_CAMPAIGN_ID = 'google.c.a.c_id';\r\nvar CONSOLE_CAMPAIGN_NAME = 'google.c.a.c_l';\r\nvar CONSOLE_CAMPAIGN_TIME = 'google.c.a.ts';\r\n/** Set to '1' if Analytics is enabled for the campaign */\r\nvar CONSOLE_CAMPAIGN_ANALYTICS_ENABLED = 'google.c.a.e';\r\nvar TAG = 'FirebaseMessaging: ';\n\n/**\r\n * @license\r\n * Copyright 2018 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except\r\n * in compliance with the License. You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software distributed under the License\r\n * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\r\n * or implied. See the License for the specific language governing permissions and limitations under\r\n * the License.\r\n */\r\nvar MessageType;\r\n(function (MessageType) {\r\n MessageType[\"PUSH_RECEIVED\"] = \"push-received\";\r\n MessageType[\"NOTIFICATION_CLICKED\"] = \"notification-clicked\";\r\n})(MessageType || (MessageType = {}));\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction arrayToBase64(array) {\r\n var uint8Array = new Uint8Array(array);\r\n var base64String = btoa(String.fromCharCode.apply(String, __spread(uint8Array)));\r\n return base64String.replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_');\r\n}\r\nfunction base64ToArray(base64String) {\r\n var padding = '='.repeat((4 - (base64String.length % 4)) % 4);\r\n var base64 = (base64String + padding)\r\n .replace(/\\-/g, '+')\r\n .replace(/_/g, '/');\r\n var rawData = atob(base64);\r\n var outputArray = new Uint8Array(rawData.length);\r\n for (var i = 0; i < rawData.length; ++i) {\r\n outputArray[i] = rawData.charCodeAt(i);\r\n }\r\n return outputArray;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar OLD_DB_NAME = 'fcm_token_details_db';\r\n/**\r\n * The last DB version of 'fcm_token_details_db' was 4. This is one higher, so that the upgrade\r\n * callback is called for all versions of the old DB.\r\n */\r\nvar OLD_DB_VERSION = 5;\r\nvar OLD_OBJECT_STORE_NAME = 'fcm_token_object_Store';\r\nfunction migrateOldDatabase(senderId) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var databases, dbNames, tokenDetails, db;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!('databases' in indexedDB)) return [3 /*break*/, 2];\r\n return [4 /*yield*/, indexedDB.databases()];\r\n case 1:\r\n databases = _a.sent();\r\n dbNames = databases.map(function (db) { return db.name; });\r\n if (!dbNames.includes(OLD_DB_NAME)) {\r\n // old DB didn't exist, no need to open.\r\n return [2 /*return*/, null];\r\n }\r\n _a.label = 2;\r\n case 2:\r\n tokenDetails = null;\r\n return [4 /*yield*/, openDb(OLD_DB_NAME, OLD_DB_VERSION, function (db) { return __awaiter(_this, void 0, void 0, function () {\r\n var objectStore, value, oldDetails, oldDetails, oldDetails;\r\n var _a;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n if (db.oldVersion < 2) {\r\n // Database too old, skip migration.\r\n return [2 /*return*/];\r\n }\r\n if (!db.objectStoreNames.contains(OLD_OBJECT_STORE_NAME)) {\r\n // Database did not exist. Nothing to do.\r\n return [2 /*return*/];\r\n }\r\n objectStore = db.transaction.objectStore(OLD_OBJECT_STORE_NAME);\r\n return [4 /*yield*/, objectStore.index('fcmSenderId').get(senderId)];\r\n case 1:\r\n value = _b.sent();\r\n return [4 /*yield*/, objectStore.clear()];\r\n case 2:\r\n _b.sent();\r\n if (!value) {\r\n // No entry in the database, nothing to migrate.\r\n return [2 /*return*/];\r\n }\r\n if (db.oldVersion === 2) {\r\n oldDetails = value;\r\n if (!oldDetails.auth || !oldDetails.p256dh || !oldDetails.endpoint) {\r\n return [2 /*return*/];\r\n }\r\n tokenDetails = {\r\n token: oldDetails.fcmToken,\r\n createTime: (_a = oldDetails.createTime) !== null && _a !== void 0 ? _a : Date.now(),\r\n subscriptionOptions: {\r\n auth: oldDetails.auth,\r\n p256dh: oldDetails.p256dh,\r\n endpoint: oldDetails.endpoint,\r\n swScope: oldDetails.swScope,\r\n vapidKey: typeof oldDetails.vapidKey === 'string'\r\n ? oldDetails.vapidKey\r\n : arrayToBase64(oldDetails.vapidKey)\r\n }\r\n };\r\n }\r\n else if (db.oldVersion === 3) {\r\n oldDetails = value;\r\n tokenDetails = {\r\n token: oldDetails.fcmToken,\r\n createTime: oldDetails.createTime,\r\n subscriptionOptions: {\r\n auth: arrayToBase64(oldDetails.auth),\r\n p256dh: arrayToBase64(oldDetails.p256dh),\r\n endpoint: oldDetails.endpoint,\r\n swScope: oldDetails.swScope,\r\n vapidKey: arrayToBase64(oldDetails.vapidKey)\r\n }\r\n };\r\n }\r\n else if (db.oldVersion === 4) {\r\n oldDetails = value;\r\n tokenDetails = {\r\n token: oldDetails.fcmToken,\r\n createTime: oldDetails.createTime,\r\n subscriptionOptions: {\r\n auth: arrayToBase64(oldDetails.auth),\r\n p256dh: arrayToBase64(oldDetails.p256dh),\r\n endpoint: oldDetails.endpoint,\r\n swScope: oldDetails.swScope,\r\n vapidKey: arrayToBase64(oldDetails.vapidKey)\r\n }\r\n };\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n }); })];\r\n case 3:\r\n db = _a.sent();\r\n db.close();\r\n // Delete all old databases.\r\n return [4 /*yield*/, deleteDb(OLD_DB_NAME)];\r\n case 4:\r\n // Delete all old databases.\r\n _a.sent();\r\n return [4 /*yield*/, deleteDb('fcm_vapid_details_db')];\r\n case 5:\r\n _a.sent();\r\n return [4 /*yield*/, deleteDb('undefined')];\r\n case 6:\r\n _a.sent();\r\n return [2 /*return*/, checkTokenDetails(tokenDetails) ? tokenDetails : null];\r\n }\r\n });\r\n });\r\n}\r\nfunction checkTokenDetails(tokenDetails) {\r\n if (!tokenDetails || !tokenDetails.subscriptionOptions) {\r\n return false;\r\n }\r\n var subscriptionOptions = tokenDetails.subscriptionOptions;\r\n return (typeof tokenDetails.createTime === 'number' &&\r\n tokenDetails.createTime > 0 &&\r\n typeof tokenDetails.token === 'string' &&\r\n tokenDetails.token.length > 0 &&\r\n typeof subscriptionOptions.auth === 'string' &&\r\n subscriptionOptions.auth.length > 0 &&\r\n typeof subscriptionOptions.p256dh === 'string' &&\r\n subscriptionOptions.p256dh.length > 0 &&\r\n typeof subscriptionOptions.endpoint === 'string' &&\r\n subscriptionOptions.endpoint.length > 0 &&\r\n typeof subscriptionOptions.swScope === 'string' &&\r\n subscriptionOptions.swScope.length > 0 &&\r\n typeof subscriptionOptions.vapidKey === 'string' &&\r\n subscriptionOptions.vapidKey.length > 0);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// Exported for tests.\r\nvar DATABASE_NAME = 'firebase-messaging-database';\r\nvar DATABASE_VERSION = 1;\r\nvar OBJECT_STORE_NAME = 'firebase-messaging-store';\r\nvar dbPromise = null;\r\nfunction getDbPromise() {\r\n if (!dbPromise) {\r\n dbPromise = openDb(DATABASE_NAME, DATABASE_VERSION, function (upgradeDb) {\r\n // We don't use 'break' in this switch statement, the fall-through behavior is what we want,\r\n // because if there are multiple versions between the old version and the current version, we\r\n // want ALL the migrations that correspond to those versions to run, not only the last one.\r\n // eslint-disable-next-line default-case\r\n switch (upgradeDb.oldVersion) {\r\n case 0:\r\n upgradeDb.createObjectStore(OBJECT_STORE_NAME);\r\n }\r\n });\r\n }\r\n return dbPromise;\r\n}\r\n/** Gets record(s) from the objectStore that match the given key. */\r\nfunction dbGet(firebaseDependencies) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var key, db, tokenDetails, oldTokenDetails;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n key = getKey(firebaseDependencies);\r\n return [4 /*yield*/, getDbPromise()];\r\n case 1:\r\n db = _a.sent();\r\n return [4 /*yield*/, db\r\n .transaction(OBJECT_STORE_NAME)\r\n .objectStore(OBJECT_STORE_NAME)\r\n .get(key)];\r\n case 2:\r\n tokenDetails = _a.sent();\r\n if (!tokenDetails) return [3 /*break*/, 3];\r\n return [2 /*return*/, tokenDetails];\r\n case 3: return [4 /*yield*/, migrateOldDatabase(firebaseDependencies.appConfig.senderId)];\r\n case 4:\r\n oldTokenDetails = _a.sent();\r\n if (!oldTokenDetails) return [3 /*break*/, 6];\r\n return [4 /*yield*/, dbSet(firebaseDependencies, oldTokenDetails)];\r\n case 5:\r\n _a.sent();\r\n return [2 /*return*/, oldTokenDetails];\r\n case 6: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/** Assigns or overwrites the record for the given key with the given value. */\r\nfunction dbSet(firebaseDependencies, tokenDetails) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var key, db, tx;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n key = getKey(firebaseDependencies);\r\n return [4 /*yield*/, getDbPromise()];\r\n case 1:\r\n db = _a.sent();\r\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\r\n return [4 /*yield*/, tx.objectStore(OBJECT_STORE_NAME).put(tokenDetails, key)];\r\n case 2:\r\n _a.sent();\r\n return [4 /*yield*/, tx.complete];\r\n case 3:\r\n _a.sent();\r\n return [2 /*return*/, tokenDetails];\r\n }\r\n });\r\n });\r\n}\r\n/** Removes record(s) from the objectStore that match the given key. */\r\nfunction dbRemove(firebaseDependencies) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var key, db, tx;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n key = getKey(firebaseDependencies);\r\n return [4 /*yield*/, getDbPromise()];\r\n case 1:\r\n db = _a.sent();\r\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\r\n return [4 /*yield*/, tx.objectStore(OBJECT_STORE_NAME).delete(key)];\r\n case 2:\r\n _a.sent();\r\n return [4 /*yield*/, tx.complete];\r\n case 3:\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\nfunction getKey(_a) {\r\n var appConfig = _a.appConfig;\r\n return appConfig.appId;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction requestGetToken(firebaseDependencies, subscriptionOptions) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var headers, body, subscribeOptions, responseData, response, err_1, message;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, getHeaders(firebaseDependencies)];\r\n case 1:\r\n headers = _a.sent();\r\n body = getBody(subscriptionOptions);\r\n subscribeOptions = {\r\n method: 'POST',\r\n headers: headers,\r\n body: JSON.stringify(body)\r\n };\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 5, , 6]);\r\n return [4 /*yield*/, fetch(getEndpoint(firebaseDependencies.appConfig), subscribeOptions)];\r\n case 3:\r\n response = _a.sent();\r\n return [4 /*yield*/, response.json()];\r\n case 4:\r\n responseData = _a.sent();\r\n return [3 /*break*/, 6];\r\n case 5:\r\n err_1 = _a.sent();\r\n throw ERROR_FACTORY.create(\"token-subscribe-failed\" /* TOKEN_SUBSCRIBE_FAILED */, {\r\n errorInfo: err_1\r\n });\r\n case 6:\r\n if (responseData.error) {\r\n message = responseData.error.message;\r\n throw ERROR_FACTORY.create(\"token-subscribe-failed\" /* TOKEN_SUBSCRIBE_FAILED */, {\r\n errorInfo: message\r\n });\r\n }\r\n if (!responseData.token) {\r\n throw ERROR_FACTORY.create(\"token-subscribe-no-token\" /* TOKEN_SUBSCRIBE_NO_TOKEN */);\r\n }\r\n return [2 /*return*/, responseData.token];\r\n }\r\n });\r\n });\r\n}\r\nfunction requestUpdateToken(firebaseDependencies, tokenDetails) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var headers, body, updateOptions, responseData, response, err_2, message;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, getHeaders(firebaseDependencies)];\r\n case 1:\r\n headers = _a.sent();\r\n body = getBody(tokenDetails.subscriptionOptions);\r\n updateOptions = {\r\n method: 'PATCH',\r\n headers: headers,\r\n body: JSON.stringify(body)\r\n };\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 5, , 6]);\r\n return [4 /*yield*/, fetch(getEndpoint(firebaseDependencies.appConfig) + \"/\" + tokenDetails.token, updateOptions)];\r\n case 3:\r\n response = _a.sent();\r\n return [4 /*yield*/, response.json()];\r\n case 4:\r\n responseData = _a.sent();\r\n return [3 /*break*/, 6];\r\n case 5:\r\n err_2 = _a.sent();\r\n throw ERROR_FACTORY.create(\"token-update-failed\" /* TOKEN_UPDATE_FAILED */, {\r\n errorInfo: err_2\r\n });\r\n case 6:\r\n if (responseData.error) {\r\n message = responseData.error.message;\r\n throw ERROR_FACTORY.create(\"token-update-failed\" /* TOKEN_UPDATE_FAILED */, {\r\n errorInfo: message\r\n });\r\n }\r\n if (!responseData.token) {\r\n throw ERROR_FACTORY.create(\"token-update-no-token\" /* TOKEN_UPDATE_NO_TOKEN */);\r\n }\r\n return [2 /*return*/, responseData.token];\r\n }\r\n });\r\n });\r\n}\r\nfunction requestDeleteToken(firebaseDependencies, token) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var headers, unsubscribeOptions, response, responseData, message, err_3;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, getHeaders(firebaseDependencies)];\r\n case 1:\r\n headers = _a.sent();\r\n unsubscribeOptions = {\r\n method: 'DELETE',\r\n headers: headers\r\n };\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 5, , 6]);\r\n return [4 /*yield*/, fetch(getEndpoint(firebaseDependencies.appConfig) + \"/\" + token, unsubscribeOptions)];\r\n case 3:\r\n response = _a.sent();\r\n return [4 /*yield*/, response.json()];\r\n case 4:\r\n responseData = _a.sent();\r\n if (responseData.error) {\r\n message = responseData.error.message;\r\n throw ERROR_FACTORY.create(\"token-unsubscribe-failed\" /* TOKEN_UNSUBSCRIBE_FAILED */, {\r\n errorInfo: message\r\n });\r\n }\r\n return [3 /*break*/, 6];\r\n case 5:\r\n err_3 = _a.sent();\r\n throw ERROR_FACTORY.create(\"token-unsubscribe-failed\" /* TOKEN_UNSUBSCRIBE_FAILED */, {\r\n errorInfo: err_3\r\n });\r\n case 6: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\nfunction getEndpoint(_a) {\r\n var projectId = _a.projectId;\r\n return ENDPOINT + \"/projects/\" + projectId + \"/registrations\";\r\n}\r\nfunction getHeaders(_a) {\r\n var appConfig = _a.appConfig, installations = _a.installations;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var authToken;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, installations.getToken()];\r\n case 1:\r\n authToken = _b.sent();\r\n return [2 /*return*/, new Headers({\r\n 'Content-Type': 'application/json',\r\n Accept: 'application/json',\r\n 'x-goog-api-key': appConfig.apiKey,\r\n 'x-goog-firebase-installations-auth': \"FIS \" + authToken\r\n })];\r\n }\r\n });\r\n });\r\n}\r\nfunction getBody(_a) {\r\n var p256dh = _a.p256dh, auth = _a.auth, endpoint = _a.endpoint, vapidKey = _a.vapidKey;\r\n var body = {\r\n web: {\r\n endpoint: endpoint,\r\n auth: auth,\r\n p256dh: p256dh\r\n }\r\n };\r\n if (vapidKey !== DEFAULT_VAPID_KEY) {\r\n body.web.applicationPubKey = vapidKey;\r\n }\r\n return body;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** UpdateRegistration will be called once every week. */\r\nvar TOKEN_EXPIRATION_MS = 7 * 24 * 60 * 60 * 1000; // 7 days\r\nfunction getToken(firebaseDependencies, swRegistration, vapidKey) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var pushSubscription, tokenDetails, subscriptionOptions, e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (Notification.permission !== 'granted') {\r\n throw ERROR_FACTORY.create(\"permission-blocked\" /* PERMISSION_BLOCKED */);\r\n }\r\n return [4 /*yield*/, getPushSubscription(swRegistration, vapidKey)];\r\n case 1:\r\n pushSubscription = _a.sent();\r\n return [4 /*yield*/, dbGet(firebaseDependencies)];\r\n case 2:\r\n tokenDetails = _a.sent();\r\n subscriptionOptions = {\r\n vapidKey: vapidKey,\r\n swScope: swRegistration.scope,\r\n endpoint: pushSubscription.endpoint,\r\n auth: arrayToBase64(pushSubscription.getKey('auth')),\r\n p256dh: arrayToBase64(pushSubscription.getKey('p256dh'))\r\n };\r\n if (!!tokenDetails) return [3 /*break*/, 3];\r\n // No token, get a new one.\r\n return [2 /*return*/, getNewToken(firebaseDependencies, subscriptionOptions)];\r\n case 3:\r\n if (!!isTokenValid(tokenDetails.subscriptionOptions, subscriptionOptions)) return [3 /*break*/, 8];\r\n _a.label = 4;\r\n case 4:\r\n _a.trys.push([4, 6, , 7]);\r\n return [4 /*yield*/, requestDeleteToken(firebaseDependencies, tokenDetails.token)];\r\n case 5:\r\n _a.sent();\r\n return [3 /*break*/, 7];\r\n case 6:\r\n e_1 = _a.sent();\r\n // Suppress errors because of #2364\r\n console.warn(e_1);\r\n return [3 /*break*/, 7];\r\n case 7: return [2 /*return*/, getNewToken(firebaseDependencies, subscriptionOptions)];\r\n case 8:\r\n if (Date.now() >= tokenDetails.createTime + TOKEN_EXPIRATION_MS) {\r\n // Weekly token refresh\r\n return [2 /*return*/, updateToken({\r\n token: tokenDetails.token,\r\n createTime: Date.now(),\r\n subscriptionOptions: subscriptionOptions\r\n }, firebaseDependencies, swRegistration)];\r\n }\r\n else {\r\n // Valid token, nothing to do.\r\n return [2 /*return*/, tokenDetails.token];\r\n }\r\n case 9: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * This method deletes the token from the database, unsubscribes the token from FCM, and unregisters\r\n * the push subscription if it exists.\r\n */\r\nfunction deleteToken(firebaseDependencies, swRegistration) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var tokenDetails, pushSubscription;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, dbGet(firebaseDependencies)];\r\n case 1:\r\n tokenDetails = _a.sent();\r\n if (!tokenDetails) return [3 /*break*/, 4];\r\n return [4 /*yield*/, requestDeleteToken(firebaseDependencies, tokenDetails.token)];\r\n case 2:\r\n _a.sent();\r\n return [4 /*yield*/, dbRemove(firebaseDependencies)];\r\n case 3:\r\n _a.sent();\r\n _a.label = 4;\r\n case 4: return [4 /*yield*/, swRegistration.pushManager.getSubscription()];\r\n case 5:\r\n pushSubscription = _a.sent();\r\n if (pushSubscription) {\r\n return [2 /*return*/, pushSubscription.unsubscribe()];\r\n }\r\n // If there's no SW, consider it a success.\r\n return [2 /*return*/, true];\r\n }\r\n });\r\n });\r\n}\r\nfunction updateToken(tokenDetails, firebaseDependencies, swRegistration) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var updatedToken, updatedTokenDetails, e_2;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 3, , 5]);\r\n return [4 /*yield*/, requestUpdateToken(firebaseDependencies, tokenDetails)];\r\n case 1:\r\n updatedToken = _a.sent();\r\n updatedTokenDetails = __assign(__assign({}, tokenDetails), { token: updatedToken, createTime: Date.now() });\r\n return [4 /*yield*/, dbSet(firebaseDependencies, updatedTokenDetails)];\r\n case 2:\r\n _a.sent();\r\n return [2 /*return*/, updatedToken];\r\n case 3:\r\n e_2 = _a.sent();\r\n return [4 /*yield*/, deleteToken(firebaseDependencies, swRegistration)];\r\n case 4:\r\n _a.sent();\r\n throw e_2;\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\nfunction getNewToken(firebaseDependencies, subscriptionOptions) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var token, tokenDetails;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, requestGetToken(firebaseDependencies, subscriptionOptions)];\r\n case 1:\r\n token = _a.sent();\r\n tokenDetails = {\r\n token: token,\r\n createTime: Date.now(),\r\n subscriptionOptions: subscriptionOptions\r\n };\r\n return [4 /*yield*/, dbSet(firebaseDependencies, tokenDetails)];\r\n case 2:\r\n _a.sent();\r\n return [2 /*return*/, tokenDetails.token];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Gets a PushSubscription for the current user.\r\n */\r\nfunction getPushSubscription(swRegistration, vapidKey) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var subscription;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, swRegistration.pushManager.getSubscription()];\r\n case 1:\r\n subscription = _a.sent();\r\n if (subscription) {\r\n return [2 /*return*/, subscription];\r\n }\r\n return [2 /*return*/, swRegistration.pushManager.subscribe({\r\n userVisibleOnly: true,\r\n // Chrome <= 75 doesn't support base64-encoded VAPID key. For backward compatibility, VAPID key\r\n // submitted to pushManager#subscribe must be of type Uint8Array.\r\n applicationServerKey: base64ToArray(vapidKey)\r\n })];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Checks if the saved tokenDetails object matches the configuration provided.\r\n */\r\nfunction isTokenValid(dbOptions, currentOptions) {\r\n var isVapidKeyEqual = currentOptions.vapidKey === dbOptions.vapidKey;\r\n var isEndpointEqual = currentOptions.endpoint === dbOptions.endpoint;\r\n var isAuthEqual = currentOptions.auth === dbOptions.auth;\r\n var isP256dhEqual = currentOptions.p256dh === dbOptions.p256dh;\r\n return isVapidKeyEqual && isEndpointEqual && isAuthEqual && isP256dhEqual;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction externalizePayload(internalPayload) {\r\n var payload = {\r\n from: internalPayload.from,\r\n // eslint-disable-next-line camelcase\r\n collapseKey: internalPayload.collapse_key\r\n };\r\n propagateNotificationPayload(payload, internalPayload);\r\n propagateDataPayload(payload, internalPayload);\r\n propagateFcmOptions(payload, internalPayload);\r\n return payload;\r\n}\r\nfunction propagateNotificationPayload(payload, messagePayloadInternal) {\r\n if (!messagePayloadInternal.notification) {\r\n return;\r\n }\r\n payload.notification = {};\r\n var title = messagePayloadInternal.notification.title;\r\n if (!!title) {\r\n payload.notification.title = title;\r\n }\r\n var body = messagePayloadInternal.notification.body;\r\n if (!!body) {\r\n payload.notification.body = body;\r\n }\r\n var image = messagePayloadInternal.notification.image;\r\n if (!!image) {\r\n payload.notification.image = image;\r\n }\r\n}\r\nfunction propagateDataPayload(payload, messagePayloadInternal) {\r\n if (!messagePayloadInternal.data) {\r\n return;\r\n }\r\n payload.data = messagePayloadInternal.data;\r\n}\r\nfunction propagateFcmOptions(payload, messagePayloadInternal) {\r\n if (!messagePayloadInternal.fcmOptions) {\r\n return;\r\n }\r\n payload.fcmOptions = {};\r\n var link = messagePayloadInternal.fcmOptions.link;\r\n if (!!link) {\r\n payload.fcmOptions.link = link;\r\n }\r\n // eslint-disable-next-line camelcase\r\n var analyticsLabel = messagePayloadInternal.fcmOptions.analytics_label;\r\n if (!!analyticsLabel) {\r\n payload.fcmOptions.analyticsLabel = analyticsLabel;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction isConsoleMessage(data) {\r\n // This message has a campaign ID, meaning it was sent using the Firebase Console.\r\n return typeof data === 'object' && !!data && CONSOLE_CAMPAIGN_ID in data;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Returns a promise that resolves after given time passes. */\r\nfunction sleep(ms) {\r\n return new Promise(function (resolve) {\r\n setTimeout(resolve, ms);\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar SwController = /** @class */ (function () {\r\n function SwController(firebaseDependencies) {\r\n var _this = this;\r\n this.firebaseDependencies = firebaseDependencies;\r\n // A boolean flag to determine wether an app is using onBackgroundMessage or\r\n // setBackgroundMessageHandler. onBackgroundMessage will receive a MessagePayload regardless of if\r\n // a notification is displayed. Whereas, setBackgroundMessageHandler will swallow the\r\n // MessagePayload if a NotificationPayload is included.\r\n this.isOnBackgroundMessageUsed = null;\r\n this.vapidKey = null;\r\n this.bgMessageHandler = null;\r\n self.addEventListener('push', function (e) {\r\n e.waitUntil(_this.onPush(e));\r\n });\r\n self.addEventListener('pushsubscriptionchange', function (e) {\r\n e.waitUntil(_this.onSubChange(e));\r\n });\r\n self.addEventListener('notificationclick', function (e) {\r\n e.waitUntil(_this.onNotificationClick(e));\r\n });\r\n }\r\n Object.defineProperty(SwController.prototype, \"app\", {\r\n get: function () {\r\n return this.firebaseDependencies.app;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * @deprecated. Use onBackgroundMessage(nextOrObserver: NextFn<object> | Observer<object>):\r\n * Unsubscribe instead.\r\n *\r\n * Calling setBackgroundMessageHandler will opt in to some specific behaviors.\r\n *\r\n * 1.) If a notification doesn't need to be shown due to a window already being visible, then push\r\n * messages will be sent to the page. 2.) If a notification needs to be shown, and the message\r\n * contains no notification data this method will be called and the promise it returns will be\r\n * passed to event.waitUntil. If you do not set this callback then all push messages will let and\r\n * the developer can handle them in a their own 'push' event callback\r\n *\r\n * @param callback The callback to be called when a push message is received and a notification\r\n * must be shown. The callback will be given the data from the push message.\r\n */\r\n SwController.prototype.setBackgroundMessageHandler = function (callback) {\r\n this.isOnBackgroundMessageUsed = false;\r\n if (!callback || typeof callback !== 'function') {\r\n throw ERROR_FACTORY.create(\"invalid-bg-handler\" /* INVALID_BG_HANDLER */);\r\n }\r\n this.bgMessageHandler = callback;\r\n };\r\n SwController.prototype.onBackgroundMessage = function (nextOrObserver) {\r\n var _this = this;\r\n this.isOnBackgroundMessageUsed = true;\r\n this.bgMessageHandler = nextOrObserver;\r\n return function () {\r\n _this.bgMessageHandler = null;\r\n };\r\n };\r\n // TODO: Remove getToken from SW Controller. Calling this from an old SW can cause all kinds of\r\n // trouble.\r\n SwController.prototype.getToken = function () {\r\n var _a, _b;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var tokenDetails;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n if (!!this.vapidKey) return [3 /*break*/, 2];\r\n return [4 /*yield*/, dbGet(this.firebaseDependencies)];\r\n case 1:\r\n tokenDetails = _c.sent();\r\n this.vapidKey = (_b = (_a = tokenDetails === null || tokenDetails === void 0 ? void 0 : tokenDetails.subscriptionOptions) === null || _a === void 0 ? void 0 : _a.vapidKey) !== null && _b !== void 0 ? _b : DEFAULT_VAPID_KEY;\r\n _c.label = 2;\r\n case 2: return [2 /*return*/, getToken(this.firebaseDependencies, self.registration, this.vapidKey)];\r\n }\r\n });\r\n });\r\n };\r\n // TODO: Remove deleteToken from SW Controller. Calling this from an old SW can cause all kinds of\r\n // trouble.\r\n SwController.prototype.deleteToken = function () {\r\n return deleteToken(this.firebaseDependencies, self.registration);\r\n };\r\n SwController.prototype.requestPermission = function () {\r\n throw ERROR_FACTORY.create(\"only-available-in-window\" /* AVAILABLE_IN_WINDOW */);\r\n };\r\n // TODO: Remove this together with getToken from SW Controller.\r\n SwController.prototype.usePublicVapidKey = function (vapidKey) {\r\n if (this.vapidKey !== null) {\r\n throw ERROR_FACTORY.create(\"use-vapid-key-after-get-token\" /* USE_VAPID_KEY_AFTER_GET_TOKEN */);\r\n }\r\n if (typeof vapidKey !== 'string' || vapidKey.length === 0) {\r\n throw ERROR_FACTORY.create(\"invalid-vapid-key\" /* INVALID_VAPID_KEY */);\r\n }\r\n this.vapidKey = vapidKey;\r\n };\r\n SwController.prototype.useServiceWorker = function () {\r\n throw ERROR_FACTORY.create(\"only-available-in-window\" /* AVAILABLE_IN_WINDOW */);\r\n };\r\n SwController.prototype.onMessage = function () {\r\n throw ERROR_FACTORY.create(\"only-available-in-window\" /* AVAILABLE_IN_WINDOW */);\r\n };\r\n SwController.prototype.onTokenRefresh = function () {\r\n throw ERROR_FACTORY.create(\"only-available-in-window\" /* AVAILABLE_IN_WINDOW */);\r\n };\r\n /**\r\n * A handler for push events that shows notifications based on the content of the payload.\r\n *\r\n * The payload must be a JSON-encoded Object with a `notification` key. The value of the\r\n * `notification` property will be used as the NotificationOptions object passed to\r\n * showNotification. Additionally, the `title` property of the notification object will be used as\r\n * the title.\r\n *\r\n * If there is no notification data in the payload then no notification will be shown.\r\n */\r\n SwController.prototype.onPush = function (event) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var internalPayload, clientList, isNotificationShown, payload;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n internalPayload = getMessagePayloadInternal(event);\r\n if (!internalPayload) {\r\n console.debug(TAG +\r\n 'failed to get parsed MessagePayload from the PushEvent. Skip handling the push.');\r\n return [2 /*return*/];\r\n }\r\n return [4 /*yield*/, getClientList()];\r\n case 1:\r\n clientList = _a.sent();\r\n if (hasVisibleClients(clientList)) {\r\n return [2 /*return*/, sendMessagePayloadInternalToWindows(clientList, internalPayload)];\r\n }\r\n isNotificationShown = false;\r\n if (!!!internalPayload.notification) return [3 /*break*/, 3];\r\n return [4 /*yield*/, showNotification(wrapInternalPayload(internalPayload))];\r\n case 2:\r\n _a.sent();\r\n isNotificationShown = true;\r\n _a.label = 3;\r\n case 3:\r\n // MessagePayload is only passed to `onBackgroundMessage`. Skip passing MessagePayload for\r\n // the legacy `setBackgroundMessageHandler` to preserve the SDK behaviors.\r\n if (isNotificationShown === true &&\r\n this.isOnBackgroundMessageUsed === false) {\r\n return [2 /*return*/];\r\n }\r\n if (!!this.bgMessageHandler) {\r\n payload = externalizePayload(internalPayload);\r\n if (typeof this.bgMessageHandler === 'function') {\r\n this.bgMessageHandler(payload);\r\n }\r\n else {\r\n this.bgMessageHandler.next(payload);\r\n }\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n SwController.prototype.onSubChange = function (event) {\r\n var _a, _b;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var newSubscription, tokenDetails;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n newSubscription = event.newSubscription;\r\n if (!!newSubscription) return [3 /*break*/, 2];\r\n // Subscription revoked, delete token\r\n return [4 /*yield*/, deleteToken(this.firebaseDependencies, self.registration)];\r\n case 1:\r\n // Subscription revoked, delete token\r\n _c.sent();\r\n return [2 /*return*/];\r\n case 2: return [4 /*yield*/, dbGet(this.firebaseDependencies)];\r\n case 3:\r\n tokenDetails = _c.sent();\r\n return [4 /*yield*/, deleteToken(this.firebaseDependencies, self.registration)];\r\n case 4:\r\n _c.sent();\r\n return [4 /*yield*/, getToken(this.firebaseDependencies, self.registration, (_b = (_a = tokenDetails === null || tokenDetails === void 0 ? void 0 : tokenDetails.subscriptionOptions) === null || _a === void 0 ? void 0 : _a.vapidKey) !== null && _b !== void 0 ? _b : DEFAULT_VAPID_KEY)];\r\n case 5:\r\n _c.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n SwController.prototype.onNotificationClick = function (event) {\r\n var _a, _b;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var internalPayload, link, url, originUrl, client;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n internalPayload = (_b = (_a = event.notification) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b[FCM_MSG];\r\n if (!internalPayload) {\r\n return [2 /*return*/];\r\n }\r\n else if (event.action) {\r\n // User clicked on an action button. This will allow developers to act on action button clicks\r\n // by using a custom onNotificationClick listener that they define.\r\n return [2 /*return*/];\r\n }\r\n // Prevent other listeners from receiving the event\r\n event.stopImmediatePropagation();\r\n event.notification.close();\r\n link = getLink(internalPayload);\r\n if (!link) {\r\n return [2 /*return*/];\r\n }\r\n url = new URL(link, self.location.href);\r\n originUrl = new URL(self.location.origin);\r\n if (url.host !== originUrl.host) {\r\n return [2 /*return*/];\r\n }\r\n return [4 /*yield*/, getWindowClient(url)];\r\n case 1:\r\n client = _c.sent();\r\n if (!!client) return [3 /*break*/, 4];\r\n return [4 /*yield*/, self.clients.openWindow(link)];\r\n case 2:\r\n client = _c.sent();\r\n // Wait three seconds for the client to initialize and set up the message handler so that it\r\n // can receive the message.\r\n return [4 /*yield*/, sleep(3000)];\r\n case 3:\r\n // Wait three seconds for the client to initialize and set up the message handler so that it\r\n // can receive the message.\r\n _c.sent();\r\n return [3 /*break*/, 6];\r\n case 4: return [4 /*yield*/, client.focus()];\r\n case 5:\r\n client = _c.sent();\r\n _c.label = 6;\r\n case 6:\r\n if (!client) {\r\n // Window Client will not be returned if it's for a third party origin.\r\n return [2 /*return*/];\r\n }\r\n internalPayload.messageType = MessageType.NOTIFICATION_CLICKED;\r\n internalPayload.isFirebaseMessaging = true;\r\n return [2 /*return*/, client.postMessage(internalPayload)];\r\n }\r\n });\r\n });\r\n };\r\n return SwController;\r\n}());\r\nfunction wrapInternalPayload(internalPayload) {\r\n var _a;\r\n var wrappedInternalPayload = __assign({}, internalPayload.notification);\r\n // Put the message payload under FCM_MSG name so we can identify the notification as being an FCM\r\n // notification vs a notification from somewhere else (i.e. normal web push or developer generated\r\n // notification).\r\n wrappedInternalPayload.data = (_a = {},\r\n _a[FCM_MSG] = internalPayload,\r\n _a);\r\n return wrappedInternalPayload;\r\n}\r\nfunction getMessagePayloadInternal(_a) {\r\n var data = _a.data;\r\n if (!data) {\r\n return null;\r\n }\r\n try {\r\n return data.json();\r\n }\r\n catch (err) {\r\n // Not JSON so not an FCM message.\r\n return null;\r\n }\r\n}\r\n/**\r\n * @param url The URL to look for when focusing a client.\r\n * @return Returns an existing window client or a newly opened WindowClient.\r\n */\r\nfunction getWindowClient(url) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var clientList, clientList_1, clientList_1_1, client, clientUrl;\r\n var e_1, _a;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, getClientList()];\r\n case 1:\r\n clientList = _b.sent();\r\n try {\r\n for (clientList_1 = __values(clientList), clientList_1_1 = clientList_1.next(); !clientList_1_1.done; clientList_1_1 = clientList_1.next()) {\r\n client = clientList_1_1.value;\r\n clientUrl = new URL(client.url, self.location.href);\r\n if (url.host === clientUrl.host) {\r\n return [2 /*return*/, client];\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (clientList_1_1 && !clientList_1_1.done && (_a = clientList_1.return)) _a.call(clientList_1);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n return [2 /*return*/, null];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * @returns If there is currently a visible WindowClient, this method will resolve to true,\r\n * otherwise false.\r\n */\r\nfunction hasVisibleClients(clientList) {\r\n return clientList.some(function (client) {\r\n return client.visibilityState === 'visible' &&\r\n // Ignore chrome-extension clients as that matches the background pages of extensions, which\r\n // are always considered visible for some reason.\r\n !client.url.startsWith('chrome-extension://');\r\n });\r\n}\r\nfunction sendMessagePayloadInternalToWindows(clientList, internalPayload) {\r\n var e_2, _a;\r\n internalPayload.isFirebaseMessaging = true;\r\n internalPayload.messageType = MessageType.PUSH_RECEIVED;\r\n try {\r\n for (var clientList_2 = __values(clientList), clientList_2_1 = clientList_2.next(); !clientList_2_1.done; clientList_2_1 = clientList_2.next()) {\r\n var client = clientList_2_1.value;\r\n client.postMessage(internalPayload);\r\n }\r\n }\r\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\r\n finally {\r\n try {\r\n if (clientList_2_1 && !clientList_2_1.done && (_a = clientList_2.return)) _a.call(clientList_2);\r\n }\r\n finally { if (e_2) throw e_2.error; }\r\n }\r\n}\r\nfunction getClientList() {\r\n return self.clients.matchAll({\r\n type: 'window',\r\n includeUncontrolled: true\r\n // TS doesn't know that \"type: 'window'\" means it'll return WindowClient[]\r\n });\r\n}\r\nfunction showNotification(notificationPayloadInternal) {\r\n var _a;\r\n // Note: Firefox does not support the maxActions property.\r\n // https://developer.mozilla.org/en-US/docs/Web/API/notification/maxActions\r\n var actions = notificationPayloadInternal.actions;\r\n var maxActions = Notification.maxActions;\r\n if (actions && maxActions && actions.length > maxActions) {\r\n console.warn(\"This browser only supports \" + maxActions + \" actions. The remaining actions will not be displayed.\");\r\n }\r\n return self.registration.showNotification((_a = \r\n /* title= */ notificationPayloadInternal.title) !== null && _a !== void 0 ? _a : '', notificationPayloadInternal);\r\n}\r\nfunction getLink(payload) {\r\n var _a, _b, _c;\r\n // eslint-disable-next-line camelcase\r\n var link = (_b = (_a = payload.fcmOptions) === null || _a === void 0 ? void 0 : _a.link) !== null && _b !== void 0 ? _b : (_c = payload.notification) === null || _c === void 0 ? void 0 : _c.click_action;\r\n if (link) {\r\n return link;\r\n }\r\n if (isConsoleMessage(payload.data)) {\r\n // Notification created in the Firebase Console. Redirect to origin.\r\n return self.location.origin;\r\n }\r\n else {\r\n return null;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar WindowController = /** @class */ (function () {\r\n function WindowController(firebaseDependencies) {\r\n var _this = this;\r\n this.firebaseDependencies = firebaseDependencies;\r\n this.vapidKey = null;\r\n this.onMessageCallback = null;\r\n navigator.serviceWorker.addEventListener('message', function (e) {\r\n return _this.messageEventListener(e);\r\n });\r\n }\r\n Object.defineProperty(WindowController.prototype, \"app\", {\r\n get: function () {\r\n return this.firebaseDependencies.app;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n WindowController.prototype.messageEventListener = function (event) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var internalPayload, dataPayload;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n internalPayload = event.data;\r\n if (!internalPayload.isFirebaseMessaging) {\r\n return [2 /*return*/];\r\n }\r\n // onMessageCallback is either a function or observer/subscriber.\r\n // TODO: in the modularization release, have onMessage handle type MessagePayload as supposed to\r\n // the legacy payload where some fields are in snake cases.\r\n if (this.onMessageCallback &&\r\n internalPayload.messageType === MessageType.PUSH_RECEIVED) {\r\n if (typeof this.onMessageCallback === 'function') {\r\n this.onMessageCallback(stripInternalFields(Object.assign({}, internalPayload)));\r\n }\r\n else {\r\n this.onMessageCallback.next(Object.assign({}, internalPayload));\r\n }\r\n }\r\n dataPayload = internalPayload.data;\r\n if (!(isConsoleMessage(dataPayload) &&\r\n dataPayload[CONSOLE_CAMPAIGN_ANALYTICS_ENABLED] === '1')) return [3 /*break*/, 2];\r\n return [4 /*yield*/, this.logEvent(internalPayload.messageType, dataPayload)];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n WindowController.prototype.getVapidKey = function () {\r\n return this.vapidKey;\r\n };\r\n WindowController.prototype.getSwReg = function () {\r\n return this.swRegistration;\r\n };\r\n WindowController.prototype.getToken = function (options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!(Notification.permission === 'default')) return [3 /*break*/, 2];\r\n return [4 /*yield*/, Notification.requestPermission()];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2:\r\n if (Notification.permission !== 'granted') {\r\n throw ERROR_FACTORY.create(\"permission-blocked\" /* PERMISSION_BLOCKED */);\r\n }\r\n return [4 /*yield*/, this.updateVapidKey(options === null || options === void 0 ? void 0 : options.vapidKey)];\r\n case 3:\r\n _a.sent();\r\n return [4 /*yield*/, this.updateSwReg(options === null || options === void 0 ? void 0 : options.serviceWorkerRegistration)];\r\n case 4:\r\n _a.sent();\r\n return [2 /*return*/, getToken(this.firebaseDependencies, this.swRegistration, this.vapidKey)];\r\n }\r\n });\r\n });\r\n };\r\n WindowController.prototype.updateVapidKey = function (vapidKey) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n if (!!vapidKey) {\r\n this.vapidKey = vapidKey;\r\n }\r\n else if (!this.vapidKey) {\r\n this.vapidKey = DEFAULT_VAPID_KEY;\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n WindowController.prototype.updateSwReg = function (swRegistration) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!(!swRegistration && !this.swRegistration)) return [3 /*break*/, 2];\r\n return [4 /*yield*/, this.registerDefaultSw()];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2:\r\n if (!swRegistration && !!this.swRegistration) {\r\n return [2 /*return*/];\r\n }\r\n if (!(swRegistration instanceof ServiceWorkerRegistration)) {\r\n throw ERROR_FACTORY.create(\"invalid-sw-registration\" /* INVALID_SW_REGISTRATION */);\r\n }\r\n this.swRegistration = swRegistration;\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n WindowController.prototype.registerDefaultSw = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _a, e_1;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n _b.trys.push([0, 2, , 3]);\r\n _a = this;\r\n return [4 /*yield*/, navigator.serviceWorker.register(DEFAULT_SW_PATH, {\r\n scope: DEFAULT_SW_SCOPE\r\n })];\r\n case 1:\r\n _a.swRegistration = _b.sent();\r\n // The timing when browser updates sw when sw has an update is unreliable by my experiment. It\r\n // leads to version conflict when the SDK upgrades to a newer version in the main page, but sw\r\n // is stuck with the old version. For example,\r\n // https://github.com/firebase/firebase-js-sdk/issues/2590 The following line reliably updates\r\n // sw if there was an update.\r\n this.swRegistration.update().catch(function () {\r\n /* it is non blocking and we don't care if it failed */\r\n });\r\n return [3 /*break*/, 3];\r\n case 2:\r\n e_1 = _b.sent();\r\n throw ERROR_FACTORY.create(\"failed-service-worker-registration\" /* FAILED_DEFAULT_REGISTRATION */, {\r\n browserErrorMessage: e_1.message\r\n });\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n WindowController.prototype.deleteToken = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!!this.swRegistration) return [3 /*break*/, 2];\r\n return [4 /*yield*/, this.registerDefaultSw()];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2: return [2 /*return*/, deleteToken(this.firebaseDependencies, this.swRegistration)];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Request permission if it is not currently granted.\r\n *\r\n * @return Resolves if the permission was granted, rejects otherwise.\r\n *\r\n * @deprecated Use Notification.requestPermission() instead.\r\n * https://developer.mozilla.org/en-US/docs/Web/API/Notification/requestPermission\r\n */\r\n WindowController.prototype.requestPermission = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var permissionResult;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (Notification.permission === 'granted') {\r\n return [2 /*return*/];\r\n }\r\n return [4 /*yield*/, Notification.requestPermission()];\r\n case 1:\r\n permissionResult = _a.sent();\r\n if (permissionResult === 'granted') {\r\n return [2 /*return*/];\r\n }\r\n else if (permissionResult === 'denied') {\r\n throw ERROR_FACTORY.create(\"permission-blocked\" /* PERMISSION_BLOCKED */);\r\n }\r\n else {\r\n throw ERROR_FACTORY.create(\"permission-default\" /* PERMISSION_DEFAULT */);\r\n }\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * @deprecated. Use getToken(options?: {vapidKey?: string; serviceWorkerRegistration?:\r\n * ServiceWorkerRegistration;}): Promise<string> instead.\r\n */\r\n WindowController.prototype.usePublicVapidKey = function (vapidKey) {\r\n if (this.vapidKey !== null) {\r\n throw ERROR_FACTORY.create(\"use-vapid-key-after-get-token\" /* USE_VAPID_KEY_AFTER_GET_TOKEN */);\r\n }\r\n if (typeof vapidKey !== 'string' || vapidKey.length === 0) {\r\n throw ERROR_FACTORY.create(\"invalid-vapid-key\" /* INVALID_VAPID_KEY */);\r\n }\r\n this.vapidKey = vapidKey;\r\n };\r\n /**\r\n * @deprecated. Use getToken(options?: {vapidKey?: string; serviceWorkerRegistration?:\r\n * ServiceWorkerRegistration;}): Promise<string> instead.\r\n */\r\n WindowController.prototype.useServiceWorker = function (swRegistration) {\r\n if (!(swRegistration instanceof ServiceWorkerRegistration)) {\r\n throw ERROR_FACTORY.create(\"invalid-sw-registration\" /* INVALID_SW_REGISTRATION */);\r\n }\r\n if (this.swRegistration) {\r\n throw ERROR_FACTORY.create(\"use-sw-after-get-token\" /* USE_SW_AFTER_GET_TOKEN */);\r\n }\r\n this.swRegistration = swRegistration;\r\n };\r\n /**\r\n * @param nextOrObserver An observer object or a function triggered on message.\r\n *\r\n * @return The unsubscribe function for the observer.\r\n */\r\n WindowController.prototype.onMessage = function (nextOrObserver) {\r\n var _this = this;\r\n this.onMessageCallback = nextOrObserver;\r\n return function () {\r\n _this.onMessageCallback = null;\r\n };\r\n };\r\n WindowController.prototype.setBackgroundMessageHandler = function () {\r\n throw ERROR_FACTORY.create(\"only-available-in-sw\" /* AVAILABLE_IN_SW */);\r\n };\r\n WindowController.prototype.onBackgroundMessage = function () {\r\n throw ERROR_FACTORY.create(\"only-available-in-sw\" /* AVAILABLE_IN_SW */);\r\n };\r\n /**\r\n * @deprecated No-op. It was initially designed with token rotation requests from server in mind.\r\n * However, the plan to implement such feature was abandoned.\r\n */\r\n WindowController.prototype.onTokenRefresh = function () {\r\n return function () { };\r\n };\r\n WindowController.prototype.logEvent = function (messageType, data) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var eventType, analytics;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n eventType = getEventType(messageType);\r\n return [4 /*yield*/, this.firebaseDependencies.analyticsProvider.get()];\r\n case 1:\r\n analytics = _a.sent();\r\n analytics.logEvent(eventType, {\r\n /* eslint-disable camelcase */\r\n message_id: data[CONSOLE_CAMPAIGN_ID],\r\n message_name: data[CONSOLE_CAMPAIGN_NAME],\r\n message_time: data[CONSOLE_CAMPAIGN_TIME],\r\n message_device_time: Math.floor(Date.now() / 1000)\r\n /* eslint-enable camelcase */\r\n });\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n return WindowController;\r\n}());\r\nfunction getEventType(messageType) {\r\n switch (messageType) {\r\n case MessageType.NOTIFICATION_CLICKED:\r\n return 'notification_open';\r\n case MessageType.PUSH_RECEIVED:\r\n return 'notification_foreground';\r\n default:\r\n throw new Error();\r\n }\r\n}\r\nfunction stripInternalFields(internalPayload) {\r\n delete internalPayload.messageType;\r\n delete internalPayload.isFirebaseMessaging;\r\n return internalPayload;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction extractAppConfig(app) {\r\n var e_1, _a;\r\n if (!app || !app.options) {\r\n throw getMissingValueError('App Configuration Object');\r\n }\r\n if (!app.name) {\r\n throw getMissingValueError('App Name');\r\n }\r\n // Required app config keys\r\n var configKeys = [\r\n 'projectId',\r\n 'apiKey',\r\n 'appId',\r\n 'messagingSenderId'\r\n ];\r\n var options = app.options;\r\n try {\r\n for (var configKeys_1 = __values(configKeys), configKeys_1_1 = configKeys_1.next(); !configKeys_1_1.done; configKeys_1_1 = configKeys_1.next()) {\r\n var keyName = configKeys_1_1.value;\r\n if (!options[keyName]) {\r\n throw getMissingValueError(keyName);\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (configKeys_1_1 && !configKeys_1_1.done && (_a = configKeys_1.return)) _a.call(configKeys_1);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n return {\r\n appName: app.name,\r\n projectId: options.projectId,\r\n apiKey: options.apiKey,\r\n appId: options.appId,\r\n senderId: options.messagingSenderId\r\n };\r\n}\r\nfunction getMissingValueError(valueName) {\r\n return ERROR_FACTORY.create(\"missing-app-config-values\" /* MISSING_APP_CONFIG_VALUES */, {\r\n valueName: valueName\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar MESSAGING_NAME = 'messaging';\r\nfunction factoryMethod(container) {\r\n // Dependencies.\r\n var app = container.getProvider('app').getImmediate();\r\n var appConfig = extractAppConfig(app);\r\n var installations = container.getProvider('installations').getImmediate();\r\n var analyticsProvider = container.getProvider('analytics-internal');\r\n var firebaseDependencies = {\r\n app: app,\r\n appConfig: appConfig,\r\n installations: installations,\r\n analyticsProvider: analyticsProvider\r\n };\r\n if (!isSupported()) {\r\n throw ERROR_FACTORY.create(\"unsupported-browser\" /* UNSUPPORTED_BROWSER */);\r\n }\r\n if (self && 'ServiceWorkerGlobalScope' in self) {\r\n // Running in ServiceWorker context\r\n return new SwController(firebaseDependencies);\r\n }\r\n else {\r\n // Assume we are in the window context.\r\n return new WindowController(firebaseDependencies);\r\n }\r\n}\r\nvar NAMESPACE_EXPORTS = {\r\n isSupported: isSupported\r\n};\r\nfirebase.INTERNAL.registerComponent(new Component(MESSAGING_NAME, factoryMethod, \"PUBLIC\" /* PUBLIC */).setServiceProps(NAMESPACE_EXPORTS));\r\nfunction isSupported() {\r\n if (self && 'ServiceWorkerGlobalScope' in self) {\r\n // Running in ServiceWorker context\r\n return isSWControllerSupported();\r\n }\r\n else {\r\n // Assume we are in the window context.\r\n return isWindowControllerSupported();\r\n }\r\n}\r\n/**\r\n * Checks to see if the required APIs exist.\r\n */\r\nfunction isWindowControllerSupported() {\r\n return ('indexedDB' in window &&\r\n indexedDB !== null &&\r\n navigator.cookieEnabled &&\r\n 'serviceWorker' in navigator &&\r\n 'PushManager' in window &&\r\n 'Notification' in window &&\r\n 'fetch' in window &&\r\n ServiceWorkerRegistration.prototype.hasOwnProperty('showNotification') &&\r\n PushSubscription.prototype.hasOwnProperty('getKey'));\r\n}\r\n/**\r\n * Checks to see if the required APIs exist within SW Context.\r\n */\r\nfunction isSWControllerSupported() {\r\n return ('indexedDB' in self &&\r\n indexedDB !== null &&\r\n 'PushManager' in self &&\r\n 'Notification' in self &&\r\n ServiceWorkerRegistration.prototype.hasOwnProperty('showNotification') &&\r\n PushSubscription.prototype.hasOwnProperty('getKey'));\r\n}\n//# sourceMappingURL=index.esm.js.map\n","import firebase from '@firebase/app';\nimport '@firebase/installations';\nimport { __spreadArrays, __assign } from 'tslib';\nimport { ErrorFactory, isIndexedDBAvailable, validateIndexedDBOpenable } from '@firebase/util';\nimport { Logger, LogLevel } from '@firebase/logger';\nimport { Component } from '@firebase/component';\n\nvar name = \"@firebase/performance\";\nvar version = \"0.4.3\";\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar SDK_VERSION = version;\r\n/** The prefix for start User Timing marks used for creating Traces. */\r\nvar TRACE_START_MARK_PREFIX = 'FB-PERF-TRACE-START';\r\n/** The prefix for stop User Timing marks used for creating Traces. */\r\nvar TRACE_STOP_MARK_PREFIX = 'FB-PERF-TRACE-STOP';\r\n/** The prefix for User Timing measure used for creating Traces. */\r\nvar TRACE_MEASURE_PREFIX = 'FB-PERF-TRACE-MEASURE';\r\n/** The prefix for out of the box page load Trace name. */\r\nvar OOB_TRACE_PAGE_LOAD_PREFIX = '_wt_';\r\nvar FIRST_PAINT_COUNTER_NAME = '_fp';\r\nvar FIRST_CONTENTFUL_PAINT_COUNTER_NAME = '_fcp';\r\nvar FIRST_INPUT_DELAY_COUNTER_NAME = '_fid';\r\nvar CONFIG_LOCAL_STORAGE_KEY = '@firebase/performance/config';\r\nvar CONFIG_EXPIRY_LOCAL_STORAGE_KEY = '@firebase/performance/configexpire';\r\nvar SERVICE = 'performance';\r\nvar SERVICE_NAME = 'Performance';\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar _a;\r\nvar ERROR_DESCRIPTION_MAP = (_a = {},\r\n _a[\"trace started\" /* TRACE_STARTED_BEFORE */] = 'Trace {$traceName} was started before.',\r\n _a[\"trace stopped\" /* TRACE_STOPPED_BEFORE */] = 'Trace {$traceName} is not running.',\r\n _a[\"nonpositive trace startTime\" /* NONPOSITIVE_TRACE_START_TIME */] = 'Trace {$traceName} startTime should be positive.',\r\n _a[\"nonpositive trace duration\" /* NONPOSITIVE_TRACE_DURATION */] = 'Trace {$traceName} duration should be positive.',\r\n _a[\"no window\" /* NO_WINDOW */] = 'Window is not available.',\r\n _a[\"no app id\" /* NO_APP_ID */] = 'App id is not available.',\r\n _a[\"no project id\" /* NO_PROJECT_ID */] = 'Project id is not available.',\r\n _a[\"no api key\" /* NO_API_KEY */] = 'Api key is not available.',\r\n _a[\"invalid cc log\" /* INVALID_CC_LOG */] = 'Attempted to queue invalid cc event',\r\n _a[\"FB not default\" /* FB_NOT_DEFAULT */] = 'Performance can only start when Firebase app instance is the default one.',\r\n _a[\"RC response not ok\" /* RC_NOT_OK */] = 'RC response is not ok',\r\n _a[\"invalid attribute name\" /* INVALID_ATTRIBUTE_NAME */] = 'Attribute name {$attributeName} is invalid.',\r\n _a[\"invalid attribute value\" /* INVALID_ATTRIBUTE_VALUE */] = 'Attribute value {$attributeValue} is invalid.',\r\n _a[\"invalid custom metric name\" /* INVALID_CUSTOM_METRIC_NAME */] = 'Custom metric name {$customMetricName} is invalid',\r\n _a[\"invalid String merger input\" /* INVALID_STRING_MERGER_PARAMETER */] = 'Input for String merger is invalid, contact support team to resolve.',\r\n _a);\r\nvar ERROR_FACTORY = new ErrorFactory(SERVICE, SERVICE_NAME, ERROR_DESCRIPTION_MAP);\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar consoleLogger = new Logger(SERVICE_NAME);\r\nconsoleLogger.logLevel = LogLevel.INFO;\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar apiInstance;\r\nvar windowInstance;\r\n/**\r\n * This class holds a reference to various browser related objects injected by\r\n * set methods.\r\n */\r\nvar Api = /** @class */ (function () {\r\n function Api(window) {\r\n this.window = window;\r\n if (!window) {\r\n throw ERROR_FACTORY.create(\"no window\" /* NO_WINDOW */);\r\n }\r\n this.performance = window.performance;\r\n this.PerformanceObserver = window.PerformanceObserver;\r\n this.windowLocation = window.location;\r\n this.navigator = window.navigator;\r\n this.document = window.document;\r\n if (this.navigator && this.navigator.cookieEnabled) {\r\n // If user blocks cookies on the browser, accessing localStorage will\r\n // throw an exception.\r\n this.localStorage = window.localStorage;\r\n }\r\n if (window.perfMetrics && window.perfMetrics.onFirstInputDelay) {\r\n this.onFirstInputDelay = window.perfMetrics.onFirstInputDelay;\r\n }\r\n }\r\n Api.prototype.getUrl = function () {\r\n // Do not capture the string query part of url.\r\n return this.windowLocation.href.split('?')[0];\r\n };\r\n Api.prototype.mark = function (name) {\r\n if (!this.performance || !this.performance.mark) {\r\n return;\r\n }\r\n this.performance.mark(name);\r\n };\r\n Api.prototype.measure = function (measureName, mark1, mark2) {\r\n if (!this.performance || !this.performance.measure) {\r\n return;\r\n }\r\n this.performance.measure(measureName, mark1, mark2);\r\n };\r\n Api.prototype.getEntriesByType = function (type) {\r\n if (!this.performance || !this.performance.getEntriesByType) {\r\n return [];\r\n }\r\n return this.performance.getEntriesByType(type);\r\n };\r\n Api.prototype.getEntriesByName = function (name) {\r\n if (!this.performance || !this.performance.getEntriesByName) {\r\n return [];\r\n }\r\n return this.performance.getEntriesByName(name);\r\n };\r\n Api.prototype.getTimeOrigin = function () {\r\n // Polyfill the time origin with performance.timing.navigationStart.\r\n return (this.performance &&\r\n (this.performance.timeOrigin || this.performance.timing.navigationStart));\r\n };\r\n Api.prototype.requiredApisAvailable = function () {\r\n if (!fetch ||\r\n !Promise ||\r\n !this.navigator ||\r\n !this.navigator.cookieEnabled) {\r\n consoleLogger.info('Firebase Performance cannot start if browser does not support fetch and Promise or cookie is disabled.');\r\n return false;\r\n }\r\n if (!isIndexedDBAvailable()) {\r\n consoleLogger.info('IndexedDB is not supported by current browswer');\r\n return false;\r\n }\r\n return true;\r\n };\r\n Api.prototype.setupObserver = function (entryType, callback) {\r\n if (!this.PerformanceObserver) {\r\n return;\r\n }\r\n var observer = new this.PerformanceObserver(function (list) {\r\n for (var _i = 0, _a = list.getEntries(); _i < _a.length; _i++) {\r\n var entry = _a[_i];\r\n // `entry` is a PerformanceEntry instance.\r\n callback(entry);\r\n }\r\n });\r\n // Start observing the entry types you care about.\r\n observer.observe({ entryTypes: [entryType] });\r\n };\r\n Api.getInstance = function () {\r\n if (apiInstance === undefined) {\r\n apiInstance = new Api(windowInstance);\r\n }\r\n return apiInstance;\r\n };\r\n return Api;\r\n}());\r\nfunction setupApi(window) {\r\n windowInstance = window;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction mergeStrings(part1, part2) {\r\n var sizeDiff = part1.length - part2.length;\r\n if (sizeDiff < 0 || sizeDiff > 1) {\r\n throw ERROR_FACTORY.create(\"invalid String merger input\" /* INVALID_STRING_MERGER_PARAMETER */);\r\n }\r\n var resultArray = [];\r\n for (var i = 0; i < part1.length; i++) {\r\n resultArray.push(part1.charAt(i));\r\n if (part2.length > i) {\r\n resultArray.push(part2.charAt(i));\r\n }\r\n }\r\n return resultArray.join('');\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar settingsServiceInstance;\r\nvar SettingsService = /** @class */ (function () {\r\n function SettingsService() {\r\n // The variable which controls logging of automatic traces and HTTP/S network monitoring.\r\n this.instrumentationEnabled = true;\r\n // The variable which controls logging of custom traces.\r\n this.dataCollectionEnabled = true;\r\n // Configuration flags set through remote config.\r\n this.loggingEnabled = false;\r\n // Sampling rate between 0 and 1.\r\n this.tracesSamplingRate = 1;\r\n this.networkRequestsSamplingRate = 1;\r\n // Address of logging service.\r\n this.logEndPointUrl = 'https://firebaselogging.googleapis.com/v0cc/log?format=json_proto';\r\n // Performance event transport endpoint URL which should be compatible with proto3.\r\n // New Address for transport service, not configurable via Remote Config.\r\n this.flTransportEndpointUrl = mergeStrings('hts/frbslgigp.ogepscmv/ieo/eaylg', 'tp:/ieaeogn-agolai.o/1frlglgc/o');\r\n this.transportKey = mergeStrings('AzSC8r6ReiGqFMyfvgow', 'Iayx0u-XT3vksVM-pIV');\r\n // Source type for performance event logs.\r\n this.logSource = 462;\r\n // Flags which control per session logging of traces and network requests.\r\n this.logTraceAfterSampling = false;\r\n this.logNetworkAfterSampling = false;\r\n // TTL of config retrieved from remote config in hours.\r\n this.configTimeToLive = 12;\r\n }\r\n SettingsService.prototype.getAppId = function () {\r\n var appId = this.firebaseAppInstance &&\r\n this.firebaseAppInstance.options &&\r\n this.firebaseAppInstance.options.appId;\r\n if (!appId) {\r\n throw ERROR_FACTORY.create(\"no app id\" /* NO_APP_ID */);\r\n }\r\n return appId;\r\n };\r\n SettingsService.prototype.getProjectId = function () {\r\n var projectId = this.firebaseAppInstance &&\r\n this.firebaseAppInstance.options &&\r\n this.firebaseAppInstance.options.projectId;\r\n if (!projectId) {\r\n throw ERROR_FACTORY.create(\"no project id\" /* NO_PROJECT_ID */);\r\n }\r\n return projectId;\r\n };\r\n SettingsService.prototype.getApiKey = function () {\r\n var apiKey = this.firebaseAppInstance &&\r\n this.firebaseAppInstance.options &&\r\n this.firebaseAppInstance.options.apiKey;\r\n if (!apiKey) {\r\n throw ERROR_FACTORY.create(\"no api key\" /* NO_API_KEY */);\r\n }\r\n return apiKey;\r\n };\r\n SettingsService.prototype.getFlTransportFullUrl = function () {\r\n return this.flTransportEndpointUrl.concat('?key=', this.transportKey);\r\n };\r\n SettingsService.getInstance = function () {\r\n if (settingsServiceInstance === undefined) {\r\n settingsServiceInstance = new SettingsService();\r\n }\r\n return settingsServiceInstance;\r\n };\r\n return SettingsService;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar iid;\r\nfunction getIidPromise() {\r\n var iidPromise = SettingsService.getInstance().installationsService.getId();\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n iidPromise.then(function (iidVal) {\r\n iid = iidVal;\r\n });\r\n return iidPromise;\r\n}\r\n// This method should be used after the iid is retrieved by getIidPromise method.\r\nfunction getIid() {\r\n return iid;\r\n}\r\nfunction getAuthTokenPromise() {\r\n var authTokenPromise = SettingsService.getInstance().installationsService.getToken();\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n authTokenPromise.then(function (authTokenVal) {\r\n });\r\n return authTokenPromise;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar VisibilityState;\r\n(function (VisibilityState) {\r\n VisibilityState[VisibilityState[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\r\n VisibilityState[VisibilityState[\"VISIBLE\"] = 1] = \"VISIBLE\";\r\n VisibilityState[VisibilityState[\"HIDDEN\"] = 2] = \"HIDDEN\";\r\n})(VisibilityState || (VisibilityState = {}));\r\nvar RESERVED_ATTRIBUTE_PREFIXES = ['firebase_', 'google_', 'ga_'];\r\nvar ATTRIBUTE_FORMAT_REGEX = new RegExp('^[a-zA-Z]\\\\w*$');\r\nvar MAX_ATTRIBUTE_NAME_LENGTH = 40;\r\nvar MAX_ATTRIBUTE_VALUE_LENGTH = 100;\r\nfunction getServiceWorkerStatus() {\r\n var navigator = Api.getInstance().navigator;\r\n if ('serviceWorker' in navigator) {\r\n if (navigator.serviceWorker.controller) {\r\n return 2 /* CONTROLLED */;\r\n }\r\n else {\r\n return 3 /* UNCONTROLLED */;\r\n }\r\n }\r\n else {\r\n return 1 /* UNSUPPORTED */;\r\n }\r\n}\r\nfunction getVisibilityState() {\r\n var document = Api.getInstance().document;\r\n var visibilityState = document.visibilityState;\r\n switch (visibilityState) {\r\n case 'visible':\r\n return VisibilityState.VISIBLE;\r\n case 'hidden':\r\n return VisibilityState.HIDDEN;\r\n default:\r\n return VisibilityState.UNKNOWN;\r\n }\r\n}\r\nfunction getEffectiveConnectionType() {\r\n var navigator = Api.getInstance().navigator;\r\n var navigatorConnection = navigator.connection;\r\n var effectiveType = navigatorConnection && navigatorConnection.effectiveType;\r\n switch (effectiveType) {\r\n case 'slow-2g':\r\n return 1 /* CONNECTION_SLOW_2G */;\r\n case '2g':\r\n return 2 /* CONNECTION_2G */;\r\n case '3g':\r\n return 3 /* CONNECTION_3G */;\r\n case '4g':\r\n return 4 /* CONNECTION_4G */;\r\n default:\r\n return 0 /* UNKNOWN */;\r\n }\r\n}\r\nfunction isValidCustomAttributeName(name) {\r\n if (name.length === 0 || name.length > MAX_ATTRIBUTE_NAME_LENGTH) {\r\n return false;\r\n }\r\n var matchesReservedPrefix = RESERVED_ATTRIBUTE_PREFIXES.some(function (prefix) {\r\n return name.startsWith(prefix);\r\n });\r\n return !matchesReservedPrefix && !!name.match(ATTRIBUTE_FORMAT_REGEX);\r\n}\r\nfunction isValidCustomAttributeValue(value) {\r\n return value.length !== 0 && value.length <= MAX_ATTRIBUTE_VALUE_LENGTH;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar REMOTE_CONFIG_SDK_VERSION = '0.0.1';\r\n// These values will be used if the remote config object is successfully\r\n// retrieved, but the template does not have these fields.\r\nvar DEFAULT_CONFIGS = {\r\n loggingEnabled: true\r\n};\r\nvar FIS_AUTH_PREFIX = 'FIREBASE_INSTALLATIONS_AUTH';\r\nfunction getConfig(iid) {\r\n var config = getStoredConfig();\r\n if (config) {\r\n processConfig(config);\r\n return Promise.resolve();\r\n }\r\n return getRemoteConfig(iid)\r\n .then(processConfig)\r\n .then(function (config) { return storeConfig(config); }, \r\n /** Do nothing for error, use defaults set in settings service. */\r\n function () { });\r\n}\r\nfunction getStoredConfig() {\r\n var localStorage = Api.getInstance().localStorage;\r\n if (!localStorage) {\r\n return;\r\n }\r\n var expiryString = localStorage.getItem(CONFIG_EXPIRY_LOCAL_STORAGE_KEY);\r\n if (!expiryString || !configValid(expiryString)) {\r\n return;\r\n }\r\n var configStringified = localStorage.getItem(CONFIG_LOCAL_STORAGE_KEY);\r\n if (!configStringified) {\r\n return;\r\n }\r\n try {\r\n var configResponse = JSON.parse(configStringified);\r\n return configResponse;\r\n }\r\n catch (_a) {\r\n return;\r\n }\r\n}\r\nfunction storeConfig(config) {\r\n var localStorage = Api.getInstance().localStorage;\r\n if (!config || !localStorage) {\r\n return;\r\n }\r\n localStorage.setItem(CONFIG_LOCAL_STORAGE_KEY, JSON.stringify(config));\r\n localStorage.setItem(CONFIG_EXPIRY_LOCAL_STORAGE_KEY, String(Date.now() +\r\n SettingsService.getInstance().configTimeToLive * 60 * 60 * 1000));\r\n}\r\nvar COULD_NOT_GET_CONFIG_MSG = 'Could not fetch config, will use default configs';\r\nfunction getRemoteConfig(iid) {\r\n // Perf needs auth token only to retrieve remote config.\r\n return getAuthTokenPromise()\r\n .then(function (authToken) {\r\n var projectId = SettingsService.getInstance().getProjectId();\r\n var configEndPoint = \"https://firebaseremoteconfig.googleapis.com/v1/projects/\" + projectId + \"/namespaces/fireperf:fetch?key=\" + SettingsService.getInstance().getApiKey();\r\n var request = new Request(configEndPoint, {\r\n method: 'POST',\r\n headers: { Authorization: FIS_AUTH_PREFIX + \" \" + authToken },\r\n /* eslint-disable camelcase */\r\n body: JSON.stringify({\r\n app_instance_id: iid,\r\n app_instance_id_token: authToken,\r\n app_id: SettingsService.getInstance().getAppId(),\r\n app_version: SDK_VERSION,\r\n sdk_version: REMOTE_CONFIG_SDK_VERSION\r\n })\r\n /* eslint-enable camelcase */\r\n });\r\n return fetch(request).then(function (response) {\r\n if (response.ok) {\r\n return response.json();\r\n }\r\n // In case response is not ok. This will be caught by catch.\r\n throw ERROR_FACTORY.create(\"RC response not ok\" /* RC_NOT_OK */);\r\n });\r\n })\r\n .catch(function () {\r\n consoleLogger.info(COULD_NOT_GET_CONFIG_MSG);\r\n return undefined;\r\n });\r\n}\r\n/**\r\n * Processes config coming either from calling RC or from local storage.\r\n * This method only runs if call is successful or config in storage\r\n * is valid.\r\n */\r\nfunction processConfig(config) {\r\n if (!config) {\r\n return config;\r\n }\r\n var settingsServiceInstance = SettingsService.getInstance();\r\n var entries = config.entries || {};\r\n if (entries.fpr_enabled !== undefined) {\r\n // TODO: Change the assignment of loggingEnabled once the received type is\r\n // known.\r\n settingsServiceInstance.loggingEnabled =\r\n String(entries.fpr_enabled) === 'true';\r\n }\r\n else {\r\n // Config retrieved successfully, but there is no fpr_enabled in template.\r\n // Use secondary configs value.\r\n settingsServiceInstance.loggingEnabled = DEFAULT_CONFIGS.loggingEnabled;\r\n }\r\n if (entries.fpr_log_source) {\r\n settingsServiceInstance.logSource = Number(entries.fpr_log_source);\r\n }\r\n if (entries.fpr_log_endpoint_url) {\r\n settingsServiceInstance.logEndPointUrl = entries.fpr_log_endpoint_url;\r\n }\r\n // Key from Remote Config has to be non-empty string, otherwsie use local value.\r\n if (entries.fpr_log_transport_key) {\r\n settingsServiceInstance.transportKey = entries.fpr_log_transport_key;\r\n }\r\n if (entries.fpr_vc_network_request_sampling_rate !== undefined) {\r\n settingsServiceInstance.networkRequestsSamplingRate = Number(entries.fpr_vc_network_request_sampling_rate);\r\n }\r\n if (entries.fpr_vc_trace_sampling_rate !== undefined) {\r\n settingsServiceInstance.tracesSamplingRate = Number(entries.fpr_vc_trace_sampling_rate);\r\n }\r\n // Set the per session trace and network logging flags.\r\n settingsServiceInstance.logTraceAfterSampling = shouldLogAfterSampling(settingsServiceInstance.tracesSamplingRate);\r\n settingsServiceInstance.logNetworkAfterSampling = shouldLogAfterSampling(settingsServiceInstance.networkRequestsSamplingRate);\r\n return config;\r\n}\r\nfunction configValid(expiry) {\r\n return Number(expiry) > Date.now();\r\n}\r\nfunction shouldLogAfterSampling(samplingRate) {\r\n return Math.random() <= samplingRate;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar initializationStatus = 1 /* notInitialized */;\r\nvar initializationPromise;\r\nfunction getInitializationPromise() {\r\n initializationStatus = 2 /* initializationPending */;\r\n initializationPromise = initializationPromise || initializePerf();\r\n return initializationPromise;\r\n}\r\nfunction isPerfInitialized() {\r\n return initializationStatus === 3 /* initialized */;\r\n}\r\nfunction initializePerf() {\r\n return getDocumentReadyComplete()\r\n .then(function () { return getIidPromise(); })\r\n .then(function (iid) { return getConfig(iid); })\r\n .then(function () { return changeInitializationStatus(); }, function () { return changeInitializationStatus(); });\r\n}\r\n/**\r\n * Returns a promise which resolves whenever the document readystate is complete or\r\n * immediately if it is called after page load complete.\r\n */\r\nfunction getDocumentReadyComplete() {\r\n var document = Api.getInstance().document;\r\n return new Promise(function (resolve) {\r\n if (document && document.readyState !== 'complete') {\r\n var handler_1 = function () {\r\n if (document.readyState === 'complete') {\r\n document.removeEventListener('readystatechange', handler_1);\r\n resolve();\r\n }\r\n };\r\n document.addEventListener('readystatechange', handler_1);\r\n }\r\n else {\r\n resolve();\r\n }\r\n });\r\n}\r\nfunction changeInitializationStatus() {\r\n initializationStatus = 3 /* initialized */;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DEFAULT_SEND_INTERVAL_MS = 10 * 1000;\r\nvar INITIAL_SEND_TIME_DELAY_MS = 5.5 * 1000;\r\n// If end point does not work, the call will be tried for these many times.\r\nvar DEFAULT_REMAINING_TRIES = 3;\r\nvar remainingTries = DEFAULT_REMAINING_TRIES;\r\n/* eslint-enable camelcase */\r\nvar queue = [];\r\nvar isTransportSetup = false;\r\nfunction setupTransportService() {\r\n if (!isTransportSetup) {\r\n processQueue(INITIAL_SEND_TIME_DELAY_MS);\r\n isTransportSetup = true;\r\n }\r\n}\r\nfunction processQueue(timeOffset) {\r\n setTimeout(function () {\r\n // If there is no remainingTries left, stop retrying.\r\n if (remainingTries === 0) {\r\n return;\r\n }\r\n // If there are no events to process, wait for DEFAULT_SEND_INTERVAL_MS and try again.\r\n if (!queue.length) {\r\n return processQueue(DEFAULT_SEND_INTERVAL_MS);\r\n }\r\n dispatchQueueEvents();\r\n }, timeOffset);\r\n}\r\nfunction dispatchQueueEvents() {\r\n // Capture a snapshot of the queue and empty the \"official queue\".\r\n var staged = __spreadArrays(queue);\r\n queue = [];\r\n /* eslint-disable camelcase */\r\n // We will pass the JSON serialized event to the backend.\r\n var log_event = staged.map(function (evt) { return ({\r\n source_extension_json_proto3: evt.message,\r\n event_time_ms: String(evt.eventTime)\r\n }); });\r\n var data = {\r\n request_time_ms: String(Date.now()),\r\n client_info: {\r\n client_type: 1,\r\n js_client_info: {}\r\n },\r\n log_source: SettingsService.getInstance().logSource,\r\n log_event: log_event\r\n };\r\n /* eslint-enable camelcase */\r\n sendEventsToFl(data, staged).catch(function () {\r\n // If the request fails for some reason, add the events that were attempted\r\n // back to the primary queue to retry later.\r\n queue = __spreadArrays(staged, queue);\r\n remainingTries--;\r\n consoleLogger.info(\"Tries left: \" + remainingTries + \".\");\r\n processQueue(DEFAULT_SEND_INTERVAL_MS);\r\n });\r\n}\r\nfunction sendEventsToFl(data, staged) {\r\n return postToFlEndpoint(data)\r\n .then(function (res) {\r\n if (!res.ok) {\r\n consoleLogger.info('Call to Firebase backend failed.');\r\n }\r\n return res.json();\r\n })\r\n .then(function (res) {\r\n // Find the next call wait time from the response.\r\n var transportWait = Number(res.nextRequestWaitMillis);\r\n var requestOffset = DEFAULT_SEND_INTERVAL_MS;\r\n if (!isNaN(transportWait)) {\r\n requestOffset = Math.max(transportWait, requestOffset);\r\n }\r\n // Delete request if response include RESPONSE_ACTION_UNKNOWN or DELETE_REQUEST action.\r\n // Otherwise, retry request using normal scheduling if response include RETRY_REQUEST_LATER.\r\n var logResponseDetails = res.logResponseDetails;\r\n if (Array.isArray(logResponseDetails) &&\r\n logResponseDetails.length > 0 &&\r\n logResponseDetails[0].responseAction === 'RETRY_REQUEST_LATER') {\r\n queue = __spreadArrays(staged, queue);\r\n consoleLogger.info(\"Retry transport request later.\");\r\n }\r\n remainingTries = DEFAULT_REMAINING_TRIES;\r\n // Schedule the next process.\r\n processQueue(requestOffset);\r\n });\r\n}\r\nfunction postToFlEndpoint(data) {\r\n var flTransportFullUrl = SettingsService.getInstance().getFlTransportFullUrl();\r\n return fetch(flTransportFullUrl, {\r\n method: 'POST',\r\n body: JSON.stringify(data)\r\n });\r\n}\r\nfunction addToQueue(evt) {\r\n if (!evt.eventTime || !evt.message) {\r\n throw ERROR_FACTORY.create(\"invalid cc log\" /* INVALID_CC_LOG */);\r\n }\r\n // Add the new event to the queue.\r\n queue = __spreadArrays(queue, [evt]);\r\n}\r\n/** Log handler for cc service to send the performance logs to the server. */\r\nfunction transportHandler(\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nserializer) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var message = serializer.apply(void 0, args);\r\n addToQueue({\r\n message: message,\r\n eventTime: Date.now()\r\n });\r\n };\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/* eslint-enble camelcase */\r\nvar logger;\r\n// This method is not called before initialization.\r\nfunction sendLog(resource, resourceType) {\r\n if (!logger) {\r\n logger = transportHandler(serializer);\r\n }\r\n logger(resource, resourceType);\r\n}\r\nfunction logTrace(trace) {\r\n var settingsService = SettingsService.getInstance();\r\n // Do not log if trace is auto generated and instrumentation is disabled.\r\n if (!settingsService.instrumentationEnabled && trace.isAuto) {\r\n return;\r\n }\r\n // Do not log if trace is custom and data collection is disabled.\r\n if (!settingsService.dataCollectionEnabled && !trace.isAuto) {\r\n return;\r\n }\r\n // Do not log if required apis are not available.\r\n if (!Api.getInstance().requiredApisAvailable()) {\r\n return;\r\n }\r\n // Only log the page load auto traces if page is visible.\r\n if (trace.isAuto && getVisibilityState() !== VisibilityState.VISIBLE) {\r\n return;\r\n }\r\n if (isPerfInitialized()) {\r\n sendTraceLog(trace);\r\n }\r\n else {\r\n // Custom traces can be used before the initialization but logging\r\n // should wait until after.\r\n getInitializationPromise().then(function () { return sendTraceLog(trace); }, function () { return sendTraceLog(trace); });\r\n }\r\n}\r\nfunction sendTraceLog(trace) {\r\n if (!getIid()) {\r\n return;\r\n }\r\n var settingsService = SettingsService.getInstance();\r\n if (!settingsService.loggingEnabled ||\r\n !settingsService.logTraceAfterSampling) {\r\n return;\r\n }\r\n setTimeout(function () { return sendLog(trace, 1 /* Trace */); }, 0);\r\n}\r\nfunction logNetworkRequest(networkRequest) {\r\n var settingsService = SettingsService.getInstance();\r\n // Do not log network requests if instrumentation is disabled.\r\n if (!settingsService.instrumentationEnabled) {\r\n return;\r\n }\r\n // Do not log the js sdk's call to transport service domain to avoid unnecessary cycle.\r\n // Need to blacklist both old and new endpoints to avoid migration gap.\r\n var networkRequestUrl = networkRequest.url;\r\n // Blacklist old log endpoint and new transport endpoint.\r\n // Because Performance SDK doesn't instrument requests sent from SDK itself.\r\n var logEndpointUrl = settingsService.logEndPointUrl.split('?')[0];\r\n var flEndpointUrl = settingsService.flTransportEndpointUrl.split('?')[0];\r\n if (networkRequestUrl === logEndpointUrl ||\r\n networkRequestUrl === flEndpointUrl) {\r\n return;\r\n }\r\n if (!settingsService.loggingEnabled ||\r\n !settingsService.logNetworkAfterSampling) {\r\n return;\r\n }\r\n setTimeout(function () { return sendLog(networkRequest, 0 /* NetworkRequest */); }, 0);\r\n}\r\nfunction serializer(resource, resourceType) {\r\n if (resourceType === 0 /* NetworkRequest */) {\r\n return serializeNetworkRequest(resource);\r\n }\r\n return serializeTrace(resource);\r\n}\r\nfunction serializeNetworkRequest(networkRequest) {\r\n var networkRequestMetric = {\r\n url: networkRequest.url,\r\n http_method: networkRequest.httpMethod || 0,\r\n http_response_code: 200,\r\n response_payload_bytes: networkRequest.responsePayloadBytes,\r\n client_start_time_us: networkRequest.startTimeUs,\r\n time_to_response_initiated_us: networkRequest.timeToResponseInitiatedUs,\r\n time_to_response_completed_us: networkRequest.timeToResponseCompletedUs\r\n };\r\n var perfMetric = {\r\n application_info: getApplicationInfo(),\r\n network_request_metric: networkRequestMetric\r\n };\r\n return JSON.stringify(perfMetric);\r\n}\r\nfunction serializeTrace(trace) {\r\n var traceMetric = {\r\n name: trace.name,\r\n is_auto: trace.isAuto,\r\n client_start_time_us: trace.startTimeUs,\r\n duration_us: trace.durationUs\r\n };\r\n if (Object.keys(trace.counters).length !== 0) {\r\n traceMetric.counters = trace.counters;\r\n }\r\n var customAttributes = trace.getAttributes();\r\n if (Object.keys(customAttributes).length !== 0) {\r\n traceMetric.custom_attributes = customAttributes;\r\n }\r\n var perfMetric = {\r\n application_info: getApplicationInfo(),\r\n trace_metric: traceMetric\r\n };\r\n return JSON.stringify(perfMetric);\r\n}\r\nfunction getApplicationInfo() {\r\n return {\r\n google_app_id: SettingsService.getInstance().getAppId(),\r\n app_instance_id: getIid(),\r\n web_app_info: {\r\n sdk_version: SDK_VERSION,\r\n page_url: Api.getInstance().getUrl(),\r\n service_worker_status: getServiceWorkerStatus(),\r\n visibility_state: getVisibilityState(),\r\n effective_connection_type: getEffectiveConnectionType()\r\n },\r\n application_process_state: 0\r\n };\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar MAX_METRIC_NAME_LENGTH = 100;\r\nvar RESERVED_AUTO_PREFIX = '_';\r\nvar oobMetrics = [\r\n FIRST_PAINT_COUNTER_NAME,\r\n FIRST_CONTENTFUL_PAINT_COUNTER_NAME,\r\n FIRST_INPUT_DELAY_COUNTER_NAME\r\n];\r\n/**\r\n * Returns true if the metric is custom and does not start with reserved prefix, or if\r\n * the metric is one of out of the box page load trace metrics.\r\n */\r\nfunction isValidMetricName(name, traceName) {\r\n if (name.length === 0 || name.length > MAX_METRIC_NAME_LENGTH) {\r\n return false;\r\n }\r\n return ((traceName &&\r\n traceName.startsWith(OOB_TRACE_PAGE_LOAD_PREFIX) &&\r\n oobMetrics.indexOf(name) > -1) ||\r\n !name.startsWith(RESERVED_AUTO_PREFIX));\r\n}\r\n/**\r\n * Converts the provided value to an integer value to be used in case of a metric.\r\n * @param providedValue Provided number value of the metric that needs to be converted to an integer.\r\n *\r\n * @returns Converted integer number to be set for the metric.\r\n */\r\nfunction convertMetricValueToInteger(providedValue) {\r\n var valueAsInteger = Math.floor(providedValue);\r\n if (valueAsInteger < providedValue) {\r\n consoleLogger.info(\"Metric value should be an Integer, setting the value as : \" + valueAsInteger + \".\");\r\n }\r\n return valueAsInteger;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar Trace = /** @class */ (function () {\r\n /**\r\n * @param name The name of the trace.\r\n * @param isAuto If the trace is auto-instrumented.\r\n * @param traceMeasureName The name of the measure marker in user timing specification. This field\r\n * is only set when the trace is built for logging when the user directly uses the user timing\r\n * api (performance.mark and performance.measure).\r\n */\r\n function Trace(name, isAuto, traceMeasureName) {\r\n if (isAuto === void 0) { isAuto = false; }\r\n this.name = name;\r\n this.isAuto = isAuto;\r\n this.state = 1 /* UNINITIALIZED */;\r\n this.customAttributes = {};\r\n this.counters = {};\r\n this.api = Api.getInstance();\r\n this.randomId = Math.floor(Math.random() * 1000000);\r\n if (!this.isAuto) {\r\n this.traceStartMark = TRACE_START_MARK_PREFIX + \"-\" + this.randomId + \"-\" + this.name;\r\n this.traceStopMark = TRACE_STOP_MARK_PREFIX + \"-\" + this.randomId + \"-\" + this.name;\r\n this.traceMeasure =\r\n traceMeasureName ||\r\n TRACE_MEASURE_PREFIX + \"-\" + this.randomId + \"-\" + this.name;\r\n if (traceMeasureName) {\r\n // For the case of direct user timing traces, no start stop will happen. The measure object\r\n // is already available.\r\n this.calculateTraceMetrics();\r\n }\r\n }\r\n }\r\n /**\r\n * Starts a trace. The measurement of the duration starts at this point.\r\n */\r\n Trace.prototype.start = function () {\r\n if (this.state !== 1 /* UNINITIALIZED */) {\r\n throw ERROR_FACTORY.create(\"trace started\" /* TRACE_STARTED_BEFORE */, {\r\n traceName: this.name\r\n });\r\n }\r\n this.api.mark(this.traceStartMark);\r\n this.state = 2 /* RUNNING */;\r\n };\r\n /**\r\n * Stops the trace. The measurement of the duration of the trace stops at this point and trace\r\n * is logged.\r\n */\r\n Trace.prototype.stop = function () {\r\n if (this.state !== 2 /* RUNNING */) {\r\n throw ERROR_FACTORY.create(\"trace stopped\" /* TRACE_STOPPED_BEFORE */, {\r\n traceName: this.name\r\n });\r\n }\r\n this.state = 3 /* TERMINATED */;\r\n this.api.mark(this.traceStopMark);\r\n this.api.measure(this.traceMeasure, this.traceStartMark, this.traceStopMark);\r\n this.calculateTraceMetrics();\r\n logTrace(this);\r\n };\r\n /**\r\n * Records a trace with predetermined values. If this method is used a trace is created and logged\r\n * directly. No need to use start and stop methods.\r\n * @param startTime Trace start time since epoch in millisec\r\n * @param duration The duraction of the trace in millisec\r\n * @param options An object which can optionally hold maps of custom metrics and custom attributes\r\n */\r\n Trace.prototype.record = function (startTime, duration, options) {\r\n if (startTime <= 0) {\r\n throw ERROR_FACTORY.create(\"nonpositive trace startTime\" /* NONPOSITIVE_TRACE_START_TIME */, {\r\n traceName: this.name\r\n });\r\n }\r\n if (duration <= 0) {\r\n throw ERROR_FACTORY.create(\"nonpositive trace duration\" /* NONPOSITIVE_TRACE_DURATION */, {\r\n traceName: this.name\r\n });\r\n }\r\n this.durationUs = Math.floor(duration * 1000);\r\n this.startTimeUs = Math.floor(startTime * 1000);\r\n if (options && options.attributes) {\r\n this.customAttributes = __assign({}, options.attributes);\r\n }\r\n if (options && options.metrics) {\r\n for (var _i = 0, _a = Object.keys(options.metrics); _i < _a.length; _i++) {\r\n var metric = _a[_i];\r\n if (!isNaN(Number(options.metrics[metric]))) {\r\n this.counters[metric] = Number(Math.floor(options.metrics[metric]));\r\n }\r\n }\r\n }\r\n logTrace(this);\r\n };\r\n /**\r\n * Increments a custom metric by a certain number or 1 if number not specified. Will create a new\r\n * custom metric if one with the given name does not exist. The value will be floored down to an\r\n * integer.\r\n * @param counter Name of the custom metric\r\n * @param numAsInteger Increment by value\r\n */\r\n Trace.prototype.incrementMetric = function (counter, numAsInteger) {\r\n if (numAsInteger === void 0) { numAsInteger = 1; }\r\n if (this.counters[counter] === undefined) {\r\n this.putMetric(counter, numAsInteger);\r\n }\r\n else {\r\n this.putMetric(counter, this.counters[counter] + numAsInteger);\r\n }\r\n };\r\n /**\r\n * Sets a custom metric to a specified value. Will create a new custom metric if one with the\r\n * given name does not exist. The value will be floored down to an integer.\r\n * @param counter Name of the custom metric\r\n * @param numAsInteger Set custom metric to this value\r\n */\r\n Trace.prototype.putMetric = function (counter, numAsInteger) {\r\n if (isValidMetricName(counter, this.name)) {\r\n this.counters[counter] = convertMetricValueToInteger(numAsInteger);\r\n }\r\n else {\r\n throw ERROR_FACTORY.create(\"invalid custom metric name\" /* INVALID_CUSTOM_METRIC_NAME */, {\r\n customMetricName: counter\r\n });\r\n }\r\n };\r\n /**\r\n * Returns the value of the custom metric by that name. If a custom metric with that name does\r\n * not exist will return zero.\r\n * @param counter\r\n */\r\n Trace.prototype.getMetric = function (counter) {\r\n return this.counters[counter] || 0;\r\n };\r\n /**\r\n * Sets a custom attribute of a trace to a certain value.\r\n * @param attr\r\n * @param value\r\n */\r\n Trace.prototype.putAttribute = function (attr, value) {\r\n var isValidName = isValidCustomAttributeName(attr);\r\n var isValidValue = isValidCustomAttributeValue(value);\r\n if (isValidName && isValidValue) {\r\n this.customAttributes[attr] = value;\r\n return;\r\n }\r\n // Throw appropriate error when the attribute name or value is invalid.\r\n if (!isValidName) {\r\n throw ERROR_FACTORY.create(\"invalid attribute name\" /* INVALID_ATTRIBUTE_NAME */, {\r\n attributeName: attr\r\n });\r\n }\r\n if (!isValidValue) {\r\n throw ERROR_FACTORY.create(\"invalid attribute value\" /* INVALID_ATTRIBUTE_VALUE */, {\r\n attributeValue: value\r\n });\r\n }\r\n };\r\n /**\r\n * Retrieves the value a custom attribute of a trace is set to.\r\n * @param attr\r\n */\r\n Trace.prototype.getAttribute = function (attr) {\r\n return this.customAttributes[attr];\r\n };\r\n Trace.prototype.removeAttribute = function (attr) {\r\n if (this.customAttributes[attr] === undefined) {\r\n return;\r\n }\r\n delete this.customAttributes[attr];\r\n };\r\n Trace.prototype.getAttributes = function () {\r\n return __assign({}, this.customAttributes);\r\n };\r\n Trace.prototype.setStartTime = function (startTime) {\r\n this.startTimeUs = startTime;\r\n };\r\n Trace.prototype.setDuration = function (duration) {\r\n this.durationUs = duration;\r\n };\r\n /**\r\n * Calculates and assigns the duration and start time of the trace using the measure performance\r\n * entry.\r\n */\r\n Trace.prototype.calculateTraceMetrics = function () {\r\n var perfMeasureEntries = this.api.getEntriesByName(this.traceMeasure);\r\n var perfMeasureEntry = perfMeasureEntries && perfMeasureEntries[0];\r\n if (perfMeasureEntry) {\r\n this.durationUs = Math.floor(perfMeasureEntry.duration * 1000);\r\n this.startTimeUs = Math.floor((perfMeasureEntry.startTime + this.api.getTimeOrigin()) * 1000);\r\n }\r\n };\r\n /**\r\n * @param navigationTimings A single element array which contains the navigationTIming object of\r\n * the page load\r\n * @param paintTimings A array which contains paintTiming object of the page load\r\n * @param firstInputDelay First input delay in millisec\r\n */\r\n Trace.createOobTrace = function (navigationTimings, paintTimings, firstInputDelay) {\r\n var route = Api.getInstance().getUrl();\r\n if (!route) {\r\n return;\r\n }\r\n var trace = new Trace(OOB_TRACE_PAGE_LOAD_PREFIX + route, true);\r\n var timeOriginUs = Math.floor(Api.getInstance().getTimeOrigin() * 1000);\r\n trace.setStartTime(timeOriginUs);\r\n // navigationTimings includes only one element.\r\n if (navigationTimings && navigationTimings[0]) {\r\n trace.setDuration(Math.floor(navigationTimings[0].duration * 1000));\r\n trace.putMetric('domInteractive', Math.floor(navigationTimings[0].domInteractive * 1000));\r\n trace.putMetric('domContentLoadedEventEnd', Math.floor(navigationTimings[0].domContentLoadedEventEnd * 1000));\r\n trace.putMetric('loadEventEnd', Math.floor(navigationTimings[0].loadEventEnd * 1000));\r\n }\r\n var FIRST_PAINT = 'first-paint';\r\n var FIRST_CONTENTFUL_PAINT = 'first-contentful-paint';\r\n if (paintTimings) {\r\n var firstPaint = paintTimings.find(function (paintObject) { return paintObject.name === FIRST_PAINT; });\r\n if (firstPaint && firstPaint.startTime) {\r\n trace.putMetric(FIRST_PAINT_COUNTER_NAME, Math.floor(firstPaint.startTime * 1000));\r\n }\r\n var firstContentfulPaint = paintTimings.find(function (paintObject) { return paintObject.name === FIRST_CONTENTFUL_PAINT; });\r\n if (firstContentfulPaint && firstContentfulPaint.startTime) {\r\n trace.putMetric(FIRST_CONTENTFUL_PAINT_COUNTER_NAME, Math.floor(firstContentfulPaint.startTime * 1000));\r\n }\r\n if (firstInputDelay) {\r\n trace.putMetric(FIRST_INPUT_DELAY_COUNTER_NAME, Math.floor(firstInputDelay * 1000));\r\n }\r\n }\r\n logTrace(trace);\r\n };\r\n Trace.createUserTimingTrace = function (measureName) {\r\n var trace = new Trace(measureName, false, measureName);\r\n logTrace(trace);\r\n };\r\n return Trace;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction createNetworkRequestEntry(entry) {\r\n var performanceEntry = entry;\r\n if (!performanceEntry || performanceEntry.responseStart === undefined) {\r\n return;\r\n }\r\n var timeOrigin = Api.getInstance().getTimeOrigin();\r\n var startTimeUs = Math.floor((performanceEntry.startTime + timeOrigin) * 1000);\r\n var timeToResponseInitiatedUs = performanceEntry.responseStart\r\n ? Math.floor((performanceEntry.responseStart - performanceEntry.startTime) * 1000)\r\n : undefined;\r\n var timeToResponseCompletedUs = Math.floor((performanceEntry.responseEnd - performanceEntry.startTime) * 1000);\r\n // Remove the query params from logged network request url.\r\n var url = performanceEntry.name && performanceEntry.name.split('?')[0];\r\n var networkRequest = {\r\n url: url,\r\n responsePayloadBytes: performanceEntry.transferSize,\r\n startTimeUs: startTimeUs,\r\n timeToResponseInitiatedUs: timeToResponseInitiatedUs,\r\n timeToResponseCompletedUs: timeToResponseCompletedUs\r\n };\r\n logNetworkRequest(networkRequest);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar FID_WAIT_TIME_MS = 5000;\r\nfunction setupOobResources() {\r\n // Do not initialize unless iid is available.\r\n if (!getIid()) {\r\n return;\r\n }\r\n // The load event might not have fired yet, and that means performance navigation timing\r\n // object has a duration of 0. The setup should run after all current tasks in js queue.\r\n setTimeout(function () { return setupOobTraces(); }, 0);\r\n setTimeout(function () { return setupNetworkRequests(); }, 0);\r\n setTimeout(function () { return setupUserTimingTraces(); }, 0);\r\n}\r\nfunction setupNetworkRequests() {\r\n var api = Api.getInstance();\r\n var resources = api.getEntriesByType('resource');\r\n for (var _i = 0, resources_1 = resources; _i < resources_1.length; _i++) {\r\n var resource = resources_1[_i];\r\n createNetworkRequestEntry(resource);\r\n }\r\n api.setupObserver('resource', createNetworkRequestEntry);\r\n}\r\nfunction setupOobTraces() {\r\n var api = Api.getInstance();\r\n var navigationTimings = api.getEntriesByType('navigation');\r\n var paintTimings = api.getEntriesByType('paint');\r\n // If First Input Desly polyfill is added to the page, report the fid value.\r\n // https://github.com/GoogleChromeLabs/first-input-delay\r\n if (api.onFirstInputDelay) {\r\n // If the fid call back is not called for certain time, continue without it.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n var timeoutId_1 = setTimeout(function () {\r\n Trace.createOobTrace(navigationTimings, paintTimings);\r\n timeoutId_1 = undefined;\r\n }, FID_WAIT_TIME_MS);\r\n api.onFirstInputDelay(function (fid) {\r\n if (timeoutId_1) {\r\n clearTimeout(timeoutId_1);\r\n Trace.createOobTrace(navigationTimings, paintTimings, fid);\r\n }\r\n });\r\n }\r\n else {\r\n Trace.createOobTrace(navigationTimings, paintTimings);\r\n }\r\n}\r\nfunction setupUserTimingTraces() {\r\n var api = Api.getInstance();\r\n // Run through the measure performance entries collected up to this point.\r\n var measures = api.getEntriesByType('measure');\r\n for (var _i = 0, measures_1 = measures; _i < measures_1.length; _i++) {\r\n var measure = measures_1[_i];\r\n createUserTimingTrace(measure);\r\n }\r\n // Setup an observer to capture the measures from this point on.\r\n api.setupObserver('measure', createUserTimingTrace);\r\n}\r\nfunction createUserTimingTrace(measure) {\r\n var measureName = measure.name;\r\n // Do not create a trace, if the user timing marks and measures are created by the sdk itself.\r\n if (measureName.substring(0, TRACE_MEASURE_PREFIX.length) ===\r\n TRACE_MEASURE_PREFIX) {\r\n return;\r\n }\r\n Trace.createUserTimingTrace(measureName);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar PerformanceController = /** @class */ (function () {\r\n function PerformanceController(app) {\r\n this.app = app;\r\n if (Api.getInstance().requiredApisAvailable()) {\r\n validateIndexedDBOpenable()\r\n .then(function (isAvailable) {\r\n if (isAvailable) {\r\n setupTransportService();\r\n getInitializationPromise().then(setupOobResources, setupOobResources);\r\n }\r\n })\r\n .catch(function (error) {\r\n consoleLogger.info(\"Environment doesn't support IndexedDB: \" + error);\r\n });\r\n }\r\n }\r\n PerformanceController.prototype.trace = function (name) {\r\n return new Trace(name);\r\n };\r\n Object.defineProperty(PerformanceController.prototype, \"instrumentationEnabled\", {\r\n get: function () {\r\n return SettingsService.getInstance().instrumentationEnabled;\r\n },\r\n set: function (val) {\r\n SettingsService.getInstance().instrumentationEnabled = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(PerformanceController.prototype, \"dataCollectionEnabled\", {\r\n get: function () {\r\n return SettingsService.getInstance().dataCollectionEnabled;\r\n },\r\n set: function (val) {\r\n SettingsService.getInstance().dataCollectionEnabled = val;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return PerformanceController;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DEFAULT_ENTRY_NAME = '[DEFAULT]';\r\nfunction registerPerformance(instance) {\r\n var factoryMethod = function (app, installations) {\r\n if (app.name !== DEFAULT_ENTRY_NAME) {\r\n throw ERROR_FACTORY.create(\"FB not default\" /* FB_NOT_DEFAULT */);\r\n }\r\n if (typeof window === 'undefined') {\r\n throw ERROR_FACTORY.create(\"no window\" /* NO_WINDOW */);\r\n }\r\n setupApi(window);\r\n SettingsService.getInstance().firebaseAppInstance = app;\r\n SettingsService.getInstance().installationsService = installations;\r\n return new PerformanceController(app);\r\n };\r\n // Register performance with firebase-app.\r\n instance.INTERNAL.registerComponent(new Component('performance', function (container) {\r\n /* Dependencies */\r\n // getImmediate for FirebaseApp will always succeed\r\n var app = container.getProvider('app').getImmediate();\r\n // The following call will always succeed because perf has `import '@firebase/installations'`\r\n var installations = container\r\n .getProvider('installations')\r\n .getImmediate();\r\n return factoryMethod(app, installations);\r\n }, \"PUBLIC\" /* PUBLIC */));\r\n instance.registerVersion(name, version);\r\n}\r\nregisterPerformance(firebase);\n\nexport { registerPerformance };\n//# sourceMappingURL=index.esm.js.map\n","import firebase from '@firebase/app';\nimport '@firebase/installations';\nimport { __awaiter, __generator, __assign } from 'tslib';\nimport { ErrorFactory, FirebaseError, calculateBackoffMillis } from '@firebase/util';\nimport { LogLevel, Logger } from '@firebase/logger';\nimport { Component } from '@firebase/component';\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Implements the {@link RemoteConfigClient} abstraction with success response caching.\r\n *\r\n * <p>Comparable to the browser's Cache API for responses, but the Cache API requires a Service\r\n * Worker, which requires HTTPS, which would significantly complicate SDK installation. Also, the\r\n * Cache API doesn't support matching entries by time.\r\n */\r\nvar CachingClient = /** @class */ (function () {\r\n function CachingClient(client, storage, storageCache, logger) {\r\n this.client = client;\r\n this.storage = storage;\r\n this.storageCache = storageCache;\r\n this.logger = logger;\r\n }\r\n /**\r\n * Returns true if the age of the cached fetched configs is less than or equal to\r\n * {@link Settings#minimumFetchIntervalInSeconds}.\r\n *\r\n * <p>This is comparable to passing `headers = { 'Cache-Control': max-age <maxAge> }` to the\r\n * native Fetch API.\r\n *\r\n * <p>Visible for testing.\r\n */\r\n CachingClient.prototype.isCachedDataFresh = function (cacheMaxAgeMillis, lastSuccessfulFetchTimestampMillis) {\r\n // Cache can only be fresh if it's populated.\r\n if (!lastSuccessfulFetchTimestampMillis) {\r\n this.logger.debug('Config fetch cache check. Cache unpopulated.');\r\n return false;\r\n }\r\n // Calculates age of cache entry.\r\n var cacheAgeMillis = Date.now() - lastSuccessfulFetchTimestampMillis;\r\n var isCachedDataFresh = cacheAgeMillis <= cacheMaxAgeMillis;\r\n this.logger.debug('Config fetch cache check.' +\r\n (\" Cache age millis: \" + cacheAgeMillis + \".\") +\r\n (\" Cache max age millis (minimumFetchIntervalMillis setting): \" + cacheMaxAgeMillis + \".\") +\r\n (\" Is cache hit: \" + isCachedDataFresh + \".\"));\r\n return isCachedDataFresh;\r\n };\r\n CachingClient.prototype.fetch = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _a, lastSuccessfulFetchTimestampMillis, lastSuccessfulFetchResponse, response, storageOperations;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, Promise.all([\r\n this.storage.getLastSuccessfulFetchTimestampMillis(),\r\n this.storage.getLastSuccessfulFetchResponse()\r\n ])];\r\n case 1:\r\n _a = _b.sent(), lastSuccessfulFetchTimestampMillis = _a[0], lastSuccessfulFetchResponse = _a[1];\r\n // Exits early on cache hit.\r\n if (lastSuccessfulFetchResponse &&\r\n this.isCachedDataFresh(request.cacheMaxAgeMillis, lastSuccessfulFetchTimestampMillis)) {\r\n return [2 /*return*/, lastSuccessfulFetchResponse];\r\n }\r\n // Deviates from pure decorator by not honoring a passed ETag since we don't have a public API\r\n // that allows the caller to pass an ETag.\r\n request.eTag =\r\n lastSuccessfulFetchResponse && lastSuccessfulFetchResponse.eTag;\r\n return [4 /*yield*/, this.client.fetch(request)];\r\n case 2:\r\n response = _b.sent();\r\n storageOperations = [\r\n // Uses write-through cache for consistency with synchronous public API.\r\n this.storageCache.setLastSuccessfulFetchTimestampMillis(Date.now())\r\n ];\r\n if (response.status === 200) {\r\n // Caches response only if it has changed, ie non-304 responses.\r\n storageOperations.push(this.storage.setLastSuccessfulFetchResponse(response));\r\n }\r\n return [4 /*yield*/, Promise.all(storageOperations)];\r\n case 3:\r\n _b.sent();\r\n return [2 /*return*/, response];\r\n }\r\n });\r\n });\r\n };\r\n return CachingClient;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar _a;\r\nvar ERROR_DESCRIPTION_MAP = (_a = {},\r\n _a[\"registration-window\" /* REGISTRATION_WINDOW */] = 'Undefined window object. This SDK only supports usage in a browser environment.',\r\n _a[\"registration-project-id\" /* REGISTRATION_PROJECT_ID */] = 'Undefined project identifier. Check Firebase app initialization.',\r\n _a[\"registration-api-key\" /* REGISTRATION_API_KEY */] = 'Undefined API key. Check Firebase app initialization.',\r\n _a[\"registration-app-id\" /* REGISTRATION_APP_ID */] = 'Undefined app identifier. Check Firebase app initialization.',\r\n _a[\"storage-open\" /* STORAGE_OPEN */] = 'Error thrown when opening storage. Original error: {$originalErrorMessage}.',\r\n _a[\"storage-get\" /* STORAGE_GET */] = 'Error thrown when reading from storage. Original error: {$originalErrorMessage}.',\r\n _a[\"storage-set\" /* STORAGE_SET */] = 'Error thrown when writing to storage. Original error: {$originalErrorMessage}.',\r\n _a[\"storage-delete\" /* STORAGE_DELETE */] = 'Error thrown when deleting from storage. Original error: {$originalErrorMessage}.',\r\n _a[\"fetch-client-network\" /* FETCH_NETWORK */] = 'Fetch client failed to connect to a network. Check Internet connection.' +\r\n ' Original error: {$originalErrorMessage}.',\r\n _a[\"fetch-timeout\" /* FETCH_TIMEOUT */] = 'The config fetch request timed out. ' +\r\n ' Configure timeout using \"fetchTimeoutMillis\" SDK setting.',\r\n _a[\"fetch-throttle\" /* FETCH_THROTTLE */] = 'The config fetch request timed out while in an exponential backoff state.' +\r\n ' Configure timeout using \"fetchTimeoutMillis\" SDK setting.' +\r\n ' Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.',\r\n _a[\"fetch-client-parse\" /* FETCH_PARSE */] = 'Fetch client could not parse response.' +\r\n ' Original error: {$originalErrorMessage}.',\r\n _a[\"fetch-status\" /* FETCH_STATUS */] = 'Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.',\r\n _a);\r\nvar ERROR_FACTORY = new ErrorFactory('remoteconfig' /* service */, 'Remote Config' /* service name */, ERROR_DESCRIPTION_MAP);\r\n// Note how this is like typeof/instanceof, but for ErrorCode.\r\nfunction hasErrorCode(e, errorCode) {\r\n return e instanceof FirebaseError && e.code.indexOf(errorCode) !== -1;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Attempts to get the most accurate browser language setting.\r\n *\r\n * <p>Adapted from getUserLanguage in packages/auth/src/utils.js for TypeScript.\r\n *\r\n * <p>Defers default language specification to server logic for consistency.\r\n *\r\n * @param navigatorLanguage Enables tests to override read-only {@link NavigatorLanguage}.\r\n */\r\nfunction getUserLanguage(navigatorLanguage) {\r\n if (navigatorLanguage === void 0) { navigatorLanguage = navigator; }\r\n return (\r\n // Most reliable, but only supported in Chrome/Firefox.\r\n (navigatorLanguage.languages && navigatorLanguage.languages[0]) ||\r\n // Supported in most browsers, but returns the language of the browser\r\n // UI, not the language set in browser settings.\r\n navigatorLanguage.language\r\n // Polyfill otherwise.\r\n );\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Implements the Client abstraction for the Remote Config REST API.\r\n */\r\nvar RestClient = /** @class */ (function () {\r\n function RestClient(firebaseInstallations, sdkVersion, namespace, projectId, apiKey, appId) {\r\n this.firebaseInstallations = firebaseInstallations;\r\n this.sdkVersion = sdkVersion;\r\n this.namespace = namespace;\r\n this.projectId = projectId;\r\n this.apiKey = apiKey;\r\n this.appId = appId;\r\n }\r\n /**\r\n * Fetches from the Remote Config REST API.\r\n *\r\n * @throws a {@link ErrorCode.FETCH_NETWORK} error if {@link GlobalFetch#fetch} can't\r\n * connect to the network.\r\n * @throws a {@link ErrorCode.FETCH_PARSE} error if {@link Response#json} can't parse the\r\n * fetch response.\r\n * @throws a {@link ErrorCode.FETCH_STATUS} error if the service returns an HTTP error status.\r\n */\r\n RestClient.prototype.fetch = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _a, installationId, installationToken, urlBase, url, headers, requestBody, options, fetchPromise, timeoutPromise, response, originalError_1, errorCode, status, responseEtag, config, state, responseBody, originalError_2;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, Promise.all([\r\n this.firebaseInstallations.getId(),\r\n this.firebaseInstallations.getToken()\r\n ])];\r\n case 1:\r\n _a = _b.sent(), installationId = _a[0], installationToken = _a[1];\r\n urlBase = window.FIREBASE_REMOTE_CONFIG_URL_BASE ||\r\n 'https://firebaseremoteconfig.googleapis.com';\r\n url = urlBase + \"/v1/projects/\" + this.projectId + \"/namespaces/\" + this.namespace + \":fetch?key=\" + this.apiKey;\r\n headers = {\r\n 'Content-Type': 'application/json',\r\n 'Content-Encoding': 'gzip',\r\n // Deviates from pure decorator by not passing max-age header since we don't currently have\r\n // service behavior using that header.\r\n 'If-None-Match': request.eTag || '*'\r\n };\r\n requestBody = {\r\n /* eslint-disable camelcase */\r\n sdk_version: this.sdkVersion,\r\n app_instance_id: installationId,\r\n app_instance_id_token: installationToken,\r\n app_id: this.appId,\r\n language_code: getUserLanguage()\r\n /* eslint-enable camelcase */\r\n };\r\n options = {\r\n method: 'POST',\r\n headers: headers,\r\n body: JSON.stringify(requestBody)\r\n };\r\n fetchPromise = fetch(url, options);\r\n timeoutPromise = new Promise(function (_resolve, reject) {\r\n // Maps async event listener to Promise API.\r\n request.signal.addEventListener(function () {\r\n // Emulates https://heycam.github.io/webidl/#aborterror\r\n var error = new Error('The operation was aborted.');\r\n error.name = 'AbortError';\r\n reject(error);\r\n });\r\n });\r\n _b.label = 2;\r\n case 2:\r\n _b.trys.push([2, 5, , 6]);\r\n return [4 /*yield*/, Promise.race([fetchPromise, timeoutPromise])];\r\n case 3:\r\n _b.sent();\r\n return [4 /*yield*/, fetchPromise];\r\n case 4:\r\n response = _b.sent();\r\n return [3 /*break*/, 6];\r\n case 5:\r\n originalError_1 = _b.sent();\r\n errorCode = \"fetch-client-network\" /* FETCH_NETWORK */;\r\n if (originalError_1.name === 'AbortError') {\r\n errorCode = \"fetch-timeout\" /* FETCH_TIMEOUT */;\r\n }\r\n throw ERROR_FACTORY.create(errorCode, {\r\n originalErrorMessage: originalError_1.message\r\n });\r\n case 6:\r\n status = response.status;\r\n responseEtag = response.headers.get('ETag') || undefined;\r\n if (!(response.status === 200)) return [3 /*break*/, 11];\r\n responseBody = void 0;\r\n _b.label = 7;\r\n case 7:\r\n _b.trys.push([7, 9, , 10]);\r\n return [4 /*yield*/, response.json()];\r\n case 8:\r\n responseBody = _b.sent();\r\n return [3 /*break*/, 10];\r\n case 9:\r\n originalError_2 = _b.sent();\r\n throw ERROR_FACTORY.create(\"fetch-client-parse\" /* FETCH_PARSE */, {\r\n originalErrorMessage: originalError_2.message\r\n });\r\n case 10:\r\n config = responseBody['entries'];\r\n state = responseBody['state'];\r\n _b.label = 11;\r\n case 11:\r\n // Normalizes based on legacy state.\r\n if (state === 'INSTANCE_STATE_UNSPECIFIED') {\r\n status = 500;\r\n }\r\n else if (state === 'NO_CHANGE') {\r\n status = 304;\r\n }\r\n else if (state === 'NO_TEMPLATE' || state === 'EMPTY_CONFIG') {\r\n // These cases can be fixed remotely, so normalize to safe value.\r\n config = {};\r\n }\r\n // Normalize to exception-based control flow for non-success cases.\r\n // Encapsulates HTTP specifics in this class as much as possible. Status is still the best for\r\n // differentiating success states (200 from 304; the state body param is undefined in a\r\n // standard 304).\r\n if (status !== 304 && status !== 200) {\r\n throw ERROR_FACTORY.create(\"fetch-status\" /* FETCH_STATUS */, {\r\n httpStatus: status\r\n });\r\n }\r\n return [2 /*return*/, { status: status, eTag: responseEtag, config: config }];\r\n }\r\n });\r\n });\r\n };\r\n return RestClient;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Shims a minimal AbortSignal.\r\n *\r\n * <p>AbortController's AbortSignal conveniently decouples fetch timeout logic from other aspects\r\n * of networking, such as retries. Firebase doesn't use AbortController enough to justify a\r\n * polyfill recommendation, like we do with the Fetch API, but this minimal shim can easily be\r\n * swapped out if/when we do.\r\n */\r\nvar RemoteConfigAbortSignal = /** @class */ (function () {\r\n function RemoteConfigAbortSignal() {\r\n this.listeners = [];\r\n }\r\n RemoteConfigAbortSignal.prototype.addEventListener = function (listener) {\r\n this.listeners.push(listener);\r\n };\r\n RemoteConfigAbortSignal.prototype.abort = function () {\r\n this.listeners.forEach(function (listener) { return listener(); });\r\n };\r\n return RemoteConfigAbortSignal;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DEFAULT_VALUE_FOR_BOOLEAN = false;\r\nvar DEFAULT_VALUE_FOR_STRING = '';\r\nvar DEFAULT_VALUE_FOR_NUMBER = 0;\r\nvar BOOLEAN_TRUTHY_VALUES = ['1', 'true', 't', 'yes', 'y', 'on'];\r\nvar Value = /** @class */ (function () {\r\n function Value(_source, _value) {\r\n if (_value === void 0) { _value = DEFAULT_VALUE_FOR_STRING; }\r\n this._source = _source;\r\n this._value = _value;\r\n }\r\n Value.prototype.asString = function () {\r\n return this._value;\r\n };\r\n Value.prototype.asBoolean = function () {\r\n if (this._source === 'static') {\r\n return DEFAULT_VALUE_FOR_BOOLEAN;\r\n }\r\n return BOOLEAN_TRUTHY_VALUES.indexOf(this._value.toLowerCase()) >= 0;\r\n };\r\n Value.prototype.asNumber = function () {\r\n if (this._source === 'static') {\r\n return DEFAULT_VALUE_FOR_NUMBER;\r\n }\r\n var num = Number(this._value);\r\n if (isNaN(num)) {\r\n num = DEFAULT_VALUE_FOR_NUMBER;\r\n }\r\n return num;\r\n };\r\n Value.prototype.getSource = function () {\r\n return this._source;\r\n };\r\n return Value;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DEFAULT_FETCH_TIMEOUT_MILLIS = 60 * 1000; // One minute\r\nvar DEFAULT_CACHE_MAX_AGE_MILLIS = 12 * 60 * 60 * 1000; // Twelve hours.\r\n/**\r\n * Encapsulates business logic mapping network and storage dependencies to the public SDK API.\r\n *\r\n * See {@link https://github.com/FirebasePrivate/firebase-js-sdk/blob/master/packages/firebase/index.d.ts|interface documentation} for method descriptions.\r\n */\r\nvar RemoteConfig = /** @class */ (function () {\r\n function RemoteConfig(\r\n // Required by FirebaseServiceFactory interface.\r\n app, \r\n // JS doesn't support private yet\r\n // (https://github.com/tc39/proposal-class-fields#private-fields), so we hint using an\r\n // underscore prefix.\r\n _client, _storageCache, _storage, _logger) {\r\n this.app = app;\r\n this._client = _client;\r\n this._storageCache = _storageCache;\r\n this._storage = _storage;\r\n this._logger = _logger;\r\n // Tracks completion of initialization promise.\r\n this._isInitializationComplete = false;\r\n this.settings = {\r\n fetchTimeoutMillis: DEFAULT_FETCH_TIMEOUT_MILLIS,\r\n minimumFetchIntervalMillis: DEFAULT_CACHE_MAX_AGE_MILLIS\r\n };\r\n this.defaultConfig = {};\r\n }\r\n // Based on packages/firestore/src/util/log.ts but not static because we need per-instance levels\r\n // to differentiate 2p and 3p use-cases.\r\n RemoteConfig.prototype.setLogLevel = function (logLevel) {\r\n switch (logLevel) {\r\n case 'debug':\r\n this._logger.logLevel = LogLevel.DEBUG;\r\n break;\r\n case 'silent':\r\n this._logger.logLevel = LogLevel.SILENT;\r\n break;\r\n default:\r\n this._logger.logLevel = LogLevel.ERROR;\r\n }\r\n };\r\n Object.defineProperty(RemoteConfig.prototype, \"fetchTimeMillis\", {\r\n get: function () {\r\n return this._storageCache.getLastSuccessfulFetchTimestampMillis() || -1;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(RemoteConfig.prototype, \"lastFetchStatus\", {\r\n get: function () {\r\n return this._storageCache.getLastFetchStatus() || 'no-fetch-yet';\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n RemoteConfig.prototype.activate = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _a, lastSuccessfulFetchResponse, activeConfigEtag;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, Promise.all([\r\n this._storage.getLastSuccessfulFetchResponse(),\r\n this._storage.getActiveConfigEtag()\r\n ])];\r\n case 1:\r\n _a = _b.sent(), lastSuccessfulFetchResponse = _a[0], activeConfigEtag = _a[1];\r\n if (!lastSuccessfulFetchResponse ||\r\n !lastSuccessfulFetchResponse.config ||\r\n !lastSuccessfulFetchResponse.eTag ||\r\n lastSuccessfulFetchResponse.eTag === activeConfigEtag) {\r\n // Either there is no successful fetched config, or is the same as current active\r\n // config.\r\n return [2 /*return*/, false];\r\n }\r\n return [4 /*yield*/, Promise.all([\r\n this._storageCache.setActiveConfig(lastSuccessfulFetchResponse.config),\r\n this._storage.setActiveConfigEtag(lastSuccessfulFetchResponse.eTag)\r\n ])];\r\n case 2:\r\n _b.sent();\r\n return [2 /*return*/, true];\r\n }\r\n });\r\n });\r\n };\r\n RemoteConfig.prototype.ensureInitialized = function () {\r\n var _this = this;\r\n if (!this._initializePromise) {\r\n this._initializePromise = this._storageCache\r\n .loadFromStorage()\r\n .then(function () {\r\n _this._isInitializationComplete = true;\r\n });\r\n }\r\n return this._initializePromise;\r\n };\r\n /**\r\n * @throws a {@link ErrorCode.FETCH_CLIENT_TIMEOUT} if the request takes longer than\r\n * {@link Settings.fetchTimeoutInSeconds} or\r\n * {@link DEFAULT_FETCH_TIMEOUT_SECONDS}.\r\n */\r\n RemoteConfig.prototype.fetch = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var abortSignal, e_1, lastFetchStatus;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n abortSignal = new RemoteConfigAbortSignal();\r\n setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n // Note a very low delay, eg < 10ms, can elapse before listeners are initialized.\r\n abortSignal.abort();\r\n return [2 /*return*/];\r\n });\r\n }); }, this.settings.fetchTimeoutMillis);\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 4, , 6]);\r\n return [4 /*yield*/, this._client.fetch({\r\n cacheMaxAgeMillis: this.settings.minimumFetchIntervalMillis,\r\n signal: abortSignal\r\n })];\r\n case 2:\r\n _a.sent();\r\n return [4 /*yield*/, this._storageCache.setLastFetchStatus('success')];\r\n case 3:\r\n _a.sent();\r\n return [3 /*break*/, 6];\r\n case 4:\r\n e_1 = _a.sent();\r\n lastFetchStatus = hasErrorCode(e_1, \"fetch-throttle\" /* FETCH_THROTTLE */)\r\n ? 'throttle'\r\n : 'failure';\r\n return [4 /*yield*/, this._storageCache.setLastFetchStatus(lastFetchStatus)];\r\n case 5:\r\n _a.sent();\r\n throw e_1;\r\n case 6: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n RemoteConfig.prototype.fetchAndActivate = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.fetch()];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/, this.activate()];\r\n }\r\n });\r\n });\r\n };\r\n RemoteConfig.prototype.getAll = function () {\r\n var _this = this;\r\n return getAllKeys(this._storageCache.getActiveConfig(), this.defaultConfig).reduce(function (allConfigs, key) {\r\n allConfigs[key] = _this.getValue(key);\r\n return allConfigs;\r\n }, {});\r\n };\r\n RemoteConfig.prototype.getBoolean = function (key) {\r\n return this.getValue(key).asBoolean();\r\n };\r\n RemoteConfig.prototype.getNumber = function (key) {\r\n return this.getValue(key).asNumber();\r\n };\r\n RemoteConfig.prototype.getString = function (key) {\r\n return this.getValue(key).asString();\r\n };\r\n RemoteConfig.prototype.getValue = function (key) {\r\n if (!this._isInitializationComplete) {\r\n this._logger.debug(\"A value was requested for key \\\"\" + key + \"\\\" before SDK initialization completed.\" +\r\n ' Await on ensureInitialized if the intent was to get a previously activated value.');\r\n }\r\n var activeConfig = this._storageCache.getActiveConfig();\r\n if (activeConfig && activeConfig[key] !== undefined) {\r\n return new Value('remote', activeConfig[key]);\r\n }\r\n else if (this.defaultConfig && this.defaultConfig[key] !== undefined) {\r\n return new Value('default', String(this.defaultConfig[key]));\r\n }\r\n this._logger.debug(\"Returning static value for key \\\"\" + key + \"\\\".\" +\r\n ' Define a default or remote value if this is unintentional.');\r\n return new Value('static');\r\n };\r\n return RemoteConfig;\r\n}());\r\n/**\r\n * Dedupes and returns an array of all the keys of the received objects.\r\n */\r\nfunction getAllKeys(obj1, obj2) {\r\n if (obj1 === void 0) { obj1 = {}; }\r\n if (obj2 === void 0) { obj2 = {}; }\r\n return Object.keys(__assign(__assign({}, obj1), obj2));\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Converts an error event associated with a {@link IDBRequest} to a {@link FirebaseError}.\r\n */\r\nfunction toFirebaseError(event, errorCode) {\r\n var originalError = event.target.error || undefined;\r\n return ERROR_FACTORY.create(errorCode, {\r\n originalErrorMessage: originalError && originalError.message\r\n });\r\n}\r\n/**\r\n * A general-purpose store keyed by app + namespace + {@link\r\n * ProjectNamespaceKeyFieldValue}.\r\n *\r\n * <p>The Remote Config SDK can be used with multiple app installations, and each app can interact\r\n * with multiple namespaces, so this store uses app (ID + name) and namespace as common parent keys\r\n * for a set of key-value pairs. See {@link Storage#createCompositeKey}.\r\n *\r\n * <p>Visible for testing.\r\n */\r\nvar APP_NAMESPACE_STORE = 'app_namespace_store';\r\nvar DB_NAME = 'firebase_remote_config';\r\nvar DB_VERSION = 1;\r\n// Visible for testing.\r\nfunction openDatabase() {\r\n return new Promise(function (resolve, reject) {\r\n var request = indexedDB.open(DB_NAME, DB_VERSION);\r\n request.onerror = function (event) {\r\n reject(toFirebaseError(event, \"storage-open\" /* STORAGE_OPEN */));\r\n };\r\n request.onsuccess = function (event) {\r\n resolve(event.target.result);\r\n };\r\n request.onupgradeneeded = function (event) {\r\n var db = event.target.result;\r\n // We don't use 'break' in this switch statement, the fall-through\r\n // behavior is what we want, because if there are multiple versions between\r\n // the old version and the current version, we want ALL the migrations\r\n // that correspond to those versions to run, not only the last one.\r\n // eslint-disable-next-line default-case\r\n switch (event.oldVersion) {\r\n case 0:\r\n db.createObjectStore(APP_NAMESPACE_STORE, {\r\n keyPath: 'compositeKey'\r\n });\r\n }\r\n };\r\n });\r\n}\r\n/**\r\n * Abstracts data persistence.\r\n */\r\nvar Storage = /** @class */ (function () {\r\n /**\r\n * @param appId enables storage segmentation by app (ID + name).\r\n * @param appName enables storage segmentation by app (ID + name).\r\n * @param namespace enables storage segmentation by namespace.\r\n */\r\n function Storage(appId, appName, namespace, openDbPromise) {\r\n if (openDbPromise === void 0) { openDbPromise = openDatabase(); }\r\n this.appId = appId;\r\n this.appName = appName;\r\n this.namespace = namespace;\r\n this.openDbPromise = openDbPromise;\r\n }\r\n Storage.prototype.getLastFetchStatus = function () {\r\n return this.get('last_fetch_status');\r\n };\r\n Storage.prototype.setLastFetchStatus = function (status) {\r\n return this.set('last_fetch_status', status);\r\n };\r\n // This is comparable to a cache entry timestamp. If we need to expire other data, we could\r\n // consider adding timestamp to all storage records and an optional max age arg to getters.\r\n Storage.prototype.getLastSuccessfulFetchTimestampMillis = function () {\r\n return this.get('last_successful_fetch_timestamp_millis');\r\n };\r\n Storage.prototype.setLastSuccessfulFetchTimestampMillis = function (timestamp) {\r\n return this.set('last_successful_fetch_timestamp_millis', timestamp);\r\n };\r\n Storage.prototype.getLastSuccessfulFetchResponse = function () {\r\n return this.get('last_successful_fetch_response');\r\n };\r\n Storage.prototype.setLastSuccessfulFetchResponse = function (response) {\r\n return this.set('last_successful_fetch_response', response);\r\n };\r\n Storage.prototype.getActiveConfig = function () {\r\n return this.get('active_config');\r\n };\r\n Storage.prototype.setActiveConfig = function (config) {\r\n return this.set('active_config', config);\r\n };\r\n Storage.prototype.getActiveConfigEtag = function () {\r\n return this.get('active_config_etag');\r\n };\r\n Storage.prototype.setActiveConfigEtag = function (etag) {\r\n return this.set('active_config_etag', etag);\r\n };\r\n Storage.prototype.getThrottleMetadata = function () {\r\n return this.get('throttle_metadata');\r\n };\r\n Storage.prototype.setThrottleMetadata = function (metadata) {\r\n return this.set('throttle_metadata', metadata);\r\n };\r\n Storage.prototype.deleteThrottleMetadata = function () {\r\n return this.delete('throttle_metadata');\r\n };\r\n Storage.prototype.get = function (key) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var db;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.openDbPromise];\r\n case 1:\r\n db = _a.sent();\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n var transaction = db.transaction([APP_NAMESPACE_STORE], 'readonly');\r\n var objectStore = transaction.objectStore(APP_NAMESPACE_STORE);\r\n var compositeKey = _this.createCompositeKey(key);\r\n try {\r\n var request = objectStore.get(compositeKey);\r\n request.onerror = function (event) {\r\n reject(toFirebaseError(event, \"storage-get\" /* STORAGE_GET */));\r\n };\r\n request.onsuccess = function (event) {\r\n var result = event.target.result;\r\n if (result) {\r\n resolve(result.value);\r\n }\r\n else {\r\n resolve(undefined);\r\n }\r\n };\r\n }\r\n catch (e) {\r\n reject(ERROR_FACTORY.create(\"storage-get\" /* STORAGE_GET */, {\r\n originalErrorMessage: e && e.message\r\n }));\r\n }\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n Storage.prototype.set = function (key, value) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var db;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.openDbPromise];\r\n case 1:\r\n db = _a.sent();\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n var transaction = db.transaction([APP_NAMESPACE_STORE], 'readwrite');\r\n var objectStore = transaction.objectStore(APP_NAMESPACE_STORE);\r\n var compositeKey = _this.createCompositeKey(key);\r\n try {\r\n var request = objectStore.put({\r\n compositeKey: compositeKey,\r\n value: value\r\n });\r\n request.onerror = function (event) {\r\n reject(toFirebaseError(event, \"storage-set\" /* STORAGE_SET */));\r\n };\r\n request.onsuccess = function () {\r\n resolve();\r\n };\r\n }\r\n catch (e) {\r\n reject(ERROR_FACTORY.create(\"storage-set\" /* STORAGE_SET */, {\r\n originalErrorMessage: e && e.message\r\n }));\r\n }\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n Storage.prototype.delete = function (key) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var db;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.openDbPromise];\r\n case 1:\r\n db = _a.sent();\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n var transaction = db.transaction([APP_NAMESPACE_STORE], 'readwrite');\r\n var objectStore = transaction.objectStore(APP_NAMESPACE_STORE);\r\n var compositeKey = _this.createCompositeKey(key);\r\n try {\r\n var request = objectStore.delete(compositeKey);\r\n request.onerror = function (event) {\r\n reject(toFirebaseError(event, \"storage-delete\" /* STORAGE_DELETE */));\r\n };\r\n request.onsuccess = function () {\r\n resolve();\r\n };\r\n }\r\n catch (e) {\r\n reject(ERROR_FACTORY.create(\"storage-delete\" /* STORAGE_DELETE */, {\r\n originalErrorMessage: e && e.message\r\n }));\r\n }\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n // Facilitates composite key functionality (which is unsupported in IE).\r\n Storage.prototype.createCompositeKey = function (key) {\r\n return [this.appId, this.appName, this.namespace, key].join();\r\n };\r\n return Storage;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A memory cache layer over storage to support the SDK's synchronous read requirements.\r\n */\r\nvar StorageCache = /** @class */ (function () {\r\n function StorageCache(storage) {\r\n this.storage = storage;\r\n }\r\n /**\r\n * Memory-only getters\r\n */\r\n StorageCache.prototype.getLastFetchStatus = function () {\r\n return this.lastFetchStatus;\r\n };\r\n StorageCache.prototype.getLastSuccessfulFetchTimestampMillis = function () {\r\n return this.lastSuccessfulFetchTimestampMillis;\r\n };\r\n StorageCache.prototype.getActiveConfig = function () {\r\n return this.activeConfig;\r\n };\r\n /**\r\n * Read-ahead getter\r\n */\r\n StorageCache.prototype.loadFromStorage = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var lastFetchStatusPromise, lastSuccessfulFetchTimestampMillisPromise, activeConfigPromise, lastFetchStatus, lastSuccessfulFetchTimestampMillis, activeConfig;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n lastFetchStatusPromise = this.storage.getLastFetchStatus();\r\n lastSuccessfulFetchTimestampMillisPromise = this.storage.getLastSuccessfulFetchTimestampMillis();\r\n activeConfigPromise = this.storage.getActiveConfig();\r\n return [4 /*yield*/, lastFetchStatusPromise];\r\n case 1:\r\n lastFetchStatus = _a.sent();\r\n if (lastFetchStatus) {\r\n this.lastFetchStatus = lastFetchStatus;\r\n }\r\n return [4 /*yield*/, lastSuccessfulFetchTimestampMillisPromise];\r\n case 2:\r\n lastSuccessfulFetchTimestampMillis = _a.sent();\r\n if (lastSuccessfulFetchTimestampMillis) {\r\n this.lastSuccessfulFetchTimestampMillis = lastSuccessfulFetchTimestampMillis;\r\n }\r\n return [4 /*yield*/, activeConfigPromise];\r\n case 3:\r\n activeConfig = _a.sent();\r\n if (activeConfig) {\r\n this.activeConfig = activeConfig;\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Write-through setters\r\n */\r\n StorageCache.prototype.setLastFetchStatus = function (status) {\r\n this.lastFetchStatus = status;\r\n return this.storage.setLastFetchStatus(status);\r\n };\r\n StorageCache.prototype.setLastSuccessfulFetchTimestampMillis = function (timestampMillis) {\r\n this.lastSuccessfulFetchTimestampMillis = timestampMillis;\r\n return this.storage.setLastSuccessfulFetchTimestampMillis(timestampMillis);\r\n };\r\n StorageCache.prototype.setActiveConfig = function (activeConfig) {\r\n this.activeConfig = activeConfig;\r\n return this.storage.setActiveConfig(activeConfig);\r\n };\r\n return StorageCache;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Supports waiting on a backoff by:\r\n *\r\n * <ul>\r\n * <li>Promisifying setTimeout, so we can set a timeout in our Promise chain</li>\r\n * <li>Listening on a signal bus for abort events, just like the Fetch API</li>\r\n * <li>Failing in the same way the Fetch API fails, so timing out a live request and a throttled\r\n * request appear the same.</li>\r\n * </ul>\r\n *\r\n * <p>Visible for testing.\r\n */\r\nfunction setAbortableTimeout(signal, throttleEndTimeMillis) {\r\n return new Promise(function (resolve, reject) {\r\n // Derives backoff from given end time, normalizing negative numbers to zero.\r\n var backoffMillis = Math.max(throttleEndTimeMillis - Date.now(), 0);\r\n var timeout = setTimeout(resolve, backoffMillis);\r\n // Adds listener, rather than sets onabort, because signal is a shared object.\r\n signal.addEventListener(function () {\r\n clearTimeout(timeout);\r\n // If the request completes before this timeout, the rejection has no effect.\r\n reject(ERROR_FACTORY.create(\"fetch-throttle\" /* FETCH_THROTTLE */, {\r\n throttleEndTimeMillis: throttleEndTimeMillis\r\n }));\r\n });\r\n });\r\n}\r\n/**\r\n * Returns true if the {@link Error} indicates a fetch request may succeed later.\r\n */\r\nfunction isRetriableError(e) {\r\n if (!(e instanceof FirebaseError) || !e.customData) {\r\n return false;\r\n }\r\n // Uses string index defined by ErrorData, which FirebaseError implements.\r\n var httpStatus = Number(e.customData['httpStatus']);\r\n return (httpStatus === 429 ||\r\n httpStatus === 500 ||\r\n httpStatus === 503 ||\r\n httpStatus === 504);\r\n}\r\n/**\r\n * Decorates a Client with retry logic.\r\n *\r\n * <p>Comparable to CachingClient, but uses backoff logic instead of cache max age and doesn't cache\r\n * responses (because the SDK has no use for error responses).\r\n */\r\nvar RetryingClient = /** @class */ (function () {\r\n function RetryingClient(client, storage) {\r\n this.client = client;\r\n this.storage = storage;\r\n }\r\n RetryingClient.prototype.fetch = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var throttleMetadata;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.storage.getThrottleMetadata()];\r\n case 1:\r\n throttleMetadata = (_a.sent()) || {\r\n backoffCount: 0,\r\n throttleEndTimeMillis: Date.now()\r\n };\r\n return [2 /*return*/, this.attemptFetch(request, throttleMetadata)];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * A recursive helper for attempting a fetch request repeatedly.\r\n *\r\n * @throws any non-retriable errors.\r\n */\r\n RetryingClient.prototype.attemptFetch = function (request, _a) {\r\n var throttleEndTimeMillis = _a.throttleEndTimeMillis, backoffCount = _a.backoffCount;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var response, e_1, throttleMetadata;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: \r\n // Starts with a (potentially zero) timeout to support resumption from stored state.\r\n // Ensures the throttle end time is honored if the last attempt timed out.\r\n // Note the SDK will never make a request if the fetch timeout expires at this point.\r\n return [4 /*yield*/, setAbortableTimeout(request.signal, throttleEndTimeMillis)];\r\n case 1:\r\n // Starts with a (potentially zero) timeout to support resumption from stored state.\r\n // Ensures the throttle end time is honored if the last attempt timed out.\r\n // Note the SDK will never make a request if the fetch timeout expires at this point.\r\n _b.sent();\r\n _b.label = 2;\r\n case 2:\r\n _b.trys.push([2, 5, , 7]);\r\n return [4 /*yield*/, this.client.fetch(request)];\r\n case 3:\r\n response = _b.sent();\r\n // Note the SDK only clears throttle state if response is success or non-retriable.\r\n return [4 /*yield*/, this.storage.deleteThrottleMetadata()];\r\n case 4:\r\n // Note the SDK only clears throttle state if response is success or non-retriable.\r\n _b.sent();\r\n return [2 /*return*/, response];\r\n case 5:\r\n e_1 = _b.sent();\r\n if (!isRetriableError(e_1)) {\r\n throw e_1;\r\n }\r\n throttleMetadata = {\r\n throttleEndTimeMillis: Date.now() + calculateBackoffMillis(backoffCount),\r\n backoffCount: backoffCount + 1\r\n };\r\n // Persists state.\r\n return [4 /*yield*/, this.storage.setThrottleMetadata(throttleMetadata)];\r\n case 6:\r\n // Persists state.\r\n _b.sent();\r\n return [2 /*return*/, this.attemptFetch(request, throttleMetadata)];\r\n case 7: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n return RetryingClient;\r\n}());\n\nvar name = \"@firebase/remote-config\";\nvar version = \"0.1.29\";\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction registerRemoteConfig(firebaseInstance) {\r\n firebaseInstance.INTERNAL.registerComponent(new Component('remoteConfig', remoteConfigFactory, \"PUBLIC\" /* PUBLIC */).setMultipleInstances(true));\r\n firebaseInstance.registerVersion(name, version);\r\n function remoteConfigFactory(container, namespace) {\r\n /* Dependencies */\r\n // getImmediate for FirebaseApp will always succeed\r\n var app = container.getProvider('app').getImmediate();\r\n // The following call will always succeed because rc has `import '@firebase/installations'`\r\n var installations = container.getProvider('installations').getImmediate();\r\n // Guards against the SDK being used in non-browser environments.\r\n if (typeof window === 'undefined') {\r\n throw ERROR_FACTORY.create(\"registration-window\" /* REGISTRATION_WINDOW */);\r\n }\r\n // Normalizes optional inputs.\r\n var _a = app.options, projectId = _a.projectId, apiKey = _a.apiKey, appId = _a.appId;\r\n if (!projectId) {\r\n throw ERROR_FACTORY.create(\"registration-project-id\" /* REGISTRATION_PROJECT_ID */);\r\n }\r\n if (!apiKey) {\r\n throw ERROR_FACTORY.create(\"registration-api-key\" /* REGISTRATION_API_KEY */);\r\n }\r\n if (!appId) {\r\n throw ERROR_FACTORY.create(\"registration-app-id\" /* REGISTRATION_APP_ID */);\r\n }\r\n namespace = namespace || 'firebase';\r\n var storage = new Storage(appId, app.name, namespace);\r\n var storageCache = new StorageCache(storage);\r\n var logger = new Logger(name);\r\n // Sets ERROR as the default log level.\r\n // See RemoteConfig#setLogLevel for corresponding normalization to ERROR log level.\r\n logger.logLevel = LogLevel.ERROR;\r\n var restClient = new RestClient(installations, \r\n // Uses the JS SDK version, by which the RC package version can be deduced, if necessary.\r\n firebaseInstance.SDK_VERSION, namespace, projectId, apiKey, appId);\r\n var retryingClient = new RetryingClient(restClient, storage);\r\n var cachingClient = new CachingClient(retryingClient, storage, storageCache, logger);\r\n var remoteConfigInstance = new RemoteConfig(app, cachingClient, storageCache, storage, logger);\r\n // Starts warming cache.\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n remoteConfigInstance.ensureInitialized();\r\n return remoteConfigInstance;\r\n }\r\n}\r\nregisterRemoteConfig(firebase);\n\nexport { registerRemoteConfig };\n//# sourceMappingURL=index.esm.js.map\n","import firebase from '@firebase/app';\nimport { __extends, __awaiter, __generator, __spreadArrays } from 'tslib';\nimport { FirebaseError } from '@firebase/util';\nimport { Component } from '@firebase/component';\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @fileoverview Constants used in the Firebase Storage library.\r\n */\r\n/**\r\n * Domain name for firebase storage.\r\n */\r\nvar DEFAULT_HOST = 'firebasestorage.googleapis.com';\r\n/**\r\n * The key in Firebase config json for the storage bucket.\r\n */\r\nvar CONFIG_STORAGE_BUCKET_KEY = 'storageBucket';\r\n/**\r\n * 2 minutes\r\n *\r\n * The timeout for all operations except upload.\r\n */\r\nvar DEFAULT_MAX_OPERATION_RETRY_TIME = 2 * 60 * 1000;\r\n/**\r\n * 10 minutes\r\n *\r\n * The timeout for upload.\r\n */\r\nvar DEFAULT_MAX_UPLOAD_RETRY_TIME = 10 * 60 * 1000;\n\nvar FirebaseStorageError = /** @class */ (function (_super) {\r\n __extends(FirebaseStorageError, _super);\r\n function FirebaseStorageError(code, message) {\r\n var _this = _super.call(this, prependCode(code), 'Firebase Storage: ' + message) || this;\r\n _this.customData = { serverResponse: null };\r\n // Without this, `instanceof FirebaseStorageError`, in tests for example,\r\n // returns false.\r\n Object.setPrototypeOf(_this, FirebaseStorageError.prototype);\r\n return _this;\r\n }\r\n FirebaseStorageError.prototype.codeEquals = function (code) {\r\n return prependCode(code) === this.code;\r\n };\r\n Object.defineProperty(FirebaseStorageError.prototype, \"message\", {\r\n get: function () {\r\n if (this.customData.serverResponse) {\r\n return this.message + '\\n' + this.customData.serverResponse;\r\n }\r\n else {\r\n return this.message;\r\n }\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(FirebaseStorageError.prototype, \"serverResponse\", {\r\n get: function () {\r\n return this.customData.serverResponse;\r\n },\r\n set: function (serverResponse) {\r\n this.customData.serverResponse = serverResponse;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return FirebaseStorageError;\r\n}(FirebaseError));\r\nvar Code = {\r\n // Shared between all platforms\r\n UNKNOWN: 'unknown',\r\n OBJECT_NOT_FOUND: 'object-not-found',\r\n BUCKET_NOT_FOUND: 'bucket-not-found',\r\n PROJECT_NOT_FOUND: 'project-not-found',\r\n QUOTA_EXCEEDED: 'quota-exceeded',\r\n UNAUTHENTICATED: 'unauthenticated',\r\n UNAUTHORIZED: 'unauthorized',\r\n RETRY_LIMIT_EXCEEDED: 'retry-limit-exceeded',\r\n INVALID_CHECKSUM: 'invalid-checksum',\r\n CANCELED: 'canceled',\r\n // JS specific\r\n INVALID_EVENT_NAME: 'invalid-event-name',\r\n INVALID_URL: 'invalid-url',\r\n INVALID_DEFAULT_BUCKET: 'invalid-default-bucket',\r\n NO_DEFAULT_BUCKET: 'no-default-bucket',\r\n CANNOT_SLICE_BLOB: 'cannot-slice-blob',\r\n SERVER_FILE_WRONG_SIZE: 'server-file-wrong-size',\r\n NO_DOWNLOAD_URL: 'no-download-url',\r\n INVALID_ARGUMENT: 'invalid-argument',\r\n INVALID_ARGUMENT_COUNT: 'invalid-argument-count',\r\n APP_DELETED: 'app-deleted',\r\n INVALID_ROOT_OPERATION: 'invalid-root-operation',\r\n INVALID_FORMAT: 'invalid-format',\r\n INTERNAL_ERROR: 'internal-error'\r\n};\r\nfunction prependCode(code) {\r\n return 'storage/' + code;\r\n}\r\nfunction unknown() {\r\n var message = 'An unknown error occurred, please check the error payload for ' +\r\n 'server response.';\r\n return new FirebaseStorageError(Code.UNKNOWN, message);\r\n}\r\nfunction objectNotFound(path) {\r\n return new FirebaseStorageError(Code.OBJECT_NOT_FOUND, \"Object '\" + path + \"' does not exist.\");\r\n}\r\nfunction quotaExceeded(bucket) {\r\n return new FirebaseStorageError(Code.QUOTA_EXCEEDED, \"Quota for bucket '\" +\r\n bucket +\r\n \"' exceeded, please view quota on \" +\r\n 'https://firebase.google.com/pricing/.');\r\n}\r\nfunction unauthenticated() {\r\n var message = 'User is not authenticated, please authenticate using Firebase ' +\r\n 'Authentication and try again.';\r\n return new FirebaseStorageError(Code.UNAUTHENTICATED, message);\r\n}\r\nfunction unauthorized(path) {\r\n return new FirebaseStorageError(Code.UNAUTHORIZED, \"User does not have permission to access '\" + path + \"'.\");\r\n}\r\nfunction retryLimitExceeded() {\r\n return new FirebaseStorageError(Code.RETRY_LIMIT_EXCEEDED, 'Max retry time for operation exceeded, please try again.');\r\n}\r\nfunction canceled() {\r\n return new FirebaseStorageError(Code.CANCELED, 'User canceled the upload/download.');\r\n}\r\nfunction invalidUrl(url) {\r\n return new FirebaseStorageError(Code.INVALID_URL, \"Invalid URL '\" + url + \"'.\");\r\n}\r\nfunction invalidDefaultBucket(bucket) {\r\n return new FirebaseStorageError(Code.INVALID_DEFAULT_BUCKET, \"Invalid default bucket '\" + bucket + \"'.\");\r\n}\r\nfunction cannotSliceBlob() {\r\n return new FirebaseStorageError(Code.CANNOT_SLICE_BLOB, 'Cannot slice blob for upload. Please retry the upload.');\r\n}\r\nfunction serverFileWrongSize() {\r\n return new FirebaseStorageError(Code.SERVER_FILE_WRONG_SIZE, 'Server recorded incorrect upload file size, please retry the upload.');\r\n}\r\nfunction noDownloadURL() {\r\n return new FirebaseStorageError(Code.NO_DOWNLOAD_URL, 'The given file does not have any download URLs.');\r\n}\r\nfunction appDeleted() {\r\n return new FirebaseStorageError(Code.APP_DELETED, 'The Firebase app was deleted.');\r\n}\r\n/**\r\n * @param name The name of the operation that was invalid.\r\n */\r\nfunction invalidRootOperation(name) {\r\n return new FirebaseStorageError(Code.INVALID_ROOT_OPERATION, \"The operation '\" +\r\n name +\r\n \"' cannot be performed on a root reference, create a non-root \" +\r\n \"reference using child, such as .child('file.png').\");\r\n}\r\n/**\r\n * @param format The format that was not valid.\r\n * @param message A message describing the format violation.\r\n */\r\nfunction invalidFormat(format, message) {\r\n return new FirebaseStorageError(Code.INVALID_FORMAT, \"String does not match format '\" + format + \"': \" + message);\r\n}\r\n/**\r\n * @param message A message describing the internal error.\r\n */\r\nfunction internalError(message) {\r\n throw new FirebaseStorageError(Code.INTERNAL_ERROR, 'Internal error: ' + message);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar StringFormat = {\r\n RAW: 'raw',\r\n BASE64: 'base64',\r\n BASE64URL: 'base64url',\r\n DATA_URL: 'data_url'\r\n};\r\n/**\r\n * @struct\r\n */\r\nvar StringData = /** @class */ (function () {\r\n function StringData(data, contentType) {\r\n this.data = data;\r\n this.contentType = contentType || null;\r\n }\r\n return StringData;\r\n}());\r\nfunction dataFromString(format, stringData) {\r\n switch (format) {\r\n case StringFormat.RAW:\r\n return new StringData(utf8Bytes_(stringData));\r\n case StringFormat.BASE64:\r\n case StringFormat.BASE64URL:\r\n return new StringData(base64Bytes_(format, stringData));\r\n case StringFormat.DATA_URL:\r\n return new StringData(dataURLBytes_(stringData), dataURLContentType_(stringData));\r\n // do nothing\r\n }\r\n // assert(false);\r\n throw unknown();\r\n}\r\nfunction utf8Bytes_(value) {\r\n var b = [];\r\n for (var i = 0; i < value.length; i++) {\r\n var c = value.charCodeAt(i);\r\n if (c <= 127) {\r\n b.push(c);\r\n }\r\n else {\r\n if (c <= 2047) {\r\n b.push(192 | (c >> 6), 128 | (c & 63));\r\n }\r\n else {\r\n if ((c & 64512) === 55296) {\r\n // The start of a surrogate pair.\r\n var valid = i < value.length - 1 && (value.charCodeAt(i + 1) & 64512) === 56320;\r\n if (!valid) {\r\n // The second surrogate wasn't there.\r\n b.push(239, 191, 189);\r\n }\r\n else {\r\n var hi = c;\r\n var lo = value.charCodeAt(++i);\r\n c = 65536 | ((hi & 1023) << 10) | (lo & 1023);\r\n b.push(240 | (c >> 18), 128 | ((c >> 12) & 63), 128 | ((c >> 6) & 63), 128 | (c & 63));\r\n }\r\n }\r\n else {\r\n if ((c & 64512) === 56320) {\r\n // Invalid low surrogate.\r\n b.push(239, 191, 189);\r\n }\r\n else {\r\n b.push(224 | (c >> 12), 128 | ((c >> 6) & 63), 128 | (c & 63));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return new Uint8Array(b);\r\n}\r\nfunction percentEncodedBytes_(value) {\r\n var decoded;\r\n try {\r\n decoded = decodeURIComponent(value);\r\n }\r\n catch (e) {\r\n throw invalidFormat(StringFormat.DATA_URL, 'Malformed data URL.');\r\n }\r\n return utf8Bytes_(decoded);\r\n}\r\nfunction base64Bytes_(format, value) {\r\n switch (format) {\r\n case StringFormat.BASE64: {\r\n var hasMinus = value.indexOf('-') !== -1;\r\n var hasUnder = value.indexOf('_') !== -1;\r\n if (hasMinus || hasUnder) {\r\n var invalidChar = hasMinus ? '-' : '_';\r\n throw invalidFormat(format, \"Invalid character '\" +\r\n invalidChar +\r\n \"' found: is it base64url encoded?\");\r\n }\r\n break;\r\n }\r\n case StringFormat.BASE64URL: {\r\n var hasPlus = value.indexOf('+') !== -1;\r\n var hasSlash = value.indexOf('/') !== -1;\r\n if (hasPlus || hasSlash) {\r\n var invalidChar = hasPlus ? '+' : '/';\r\n throw invalidFormat(format, \"Invalid character '\" + invalidChar + \"' found: is it base64 encoded?\");\r\n }\r\n value = value.replace(/-/g, '+').replace(/_/g, '/');\r\n break;\r\n }\r\n // do nothing\r\n }\r\n var bytes;\r\n try {\r\n bytes = atob(value);\r\n }\r\n catch (e) {\r\n throw invalidFormat(format, 'Invalid character found');\r\n }\r\n var array = new Uint8Array(bytes.length);\r\n for (var i = 0; i < bytes.length; i++) {\r\n array[i] = bytes.charCodeAt(i);\r\n }\r\n return array;\r\n}\r\n/**\r\n * @struct\r\n */\r\nvar DataURLParts = /** @class */ (function () {\r\n function DataURLParts(dataURL) {\r\n this.base64 = false;\r\n this.contentType = null;\r\n var matches = dataURL.match(/^data:([^,]+)?,/);\r\n if (matches === null) {\r\n throw invalidFormat(StringFormat.DATA_URL, \"Must be formatted 'data:[<mediatype>][;base64],<data>\");\r\n }\r\n var middle = matches[1] || null;\r\n if (middle != null) {\r\n this.base64 = endsWith(middle, ';base64');\r\n this.contentType = this.base64\r\n ? middle.substring(0, middle.length - ';base64'.length)\r\n : middle;\r\n }\r\n this.rest = dataURL.substring(dataURL.indexOf(',') + 1);\r\n }\r\n return DataURLParts;\r\n}());\r\nfunction dataURLBytes_(dataUrl) {\r\n var parts = new DataURLParts(dataUrl);\r\n if (parts.base64) {\r\n return base64Bytes_(StringFormat.BASE64, parts.rest);\r\n }\r\n else {\r\n return percentEncodedBytes_(parts.rest);\r\n }\r\n}\r\nfunction dataURLContentType_(dataUrl) {\r\n var parts = new DataURLParts(dataUrl);\r\n return parts.contentType;\r\n}\r\nfunction endsWith(s, end) {\r\n var longEnough = s.length >= end.length;\r\n if (!longEnough) {\r\n return false;\r\n }\r\n return s.substring(s.length - end.length) === end;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar TaskEvent = {\r\n /** Triggered whenever the task changes or progress is updated. */\r\n STATE_CHANGED: 'state_changed'\r\n};\r\nvar InternalTaskState = {\r\n RUNNING: 'running',\r\n PAUSING: 'pausing',\r\n PAUSED: 'paused',\r\n SUCCESS: 'success',\r\n CANCELING: 'canceling',\r\n CANCELED: 'canceled',\r\n ERROR: 'error'\r\n};\r\nvar TaskState = {\r\n /** The task is currently transferring data. */\r\n RUNNING: 'running',\r\n /** The task was paused by the user. */\r\n PAUSED: 'paused',\r\n /** The task completed successfully. */\r\n SUCCESS: 'success',\r\n /** The task was canceled. */\r\n CANCELED: 'canceled',\r\n /** The task failed with an error. */\r\n ERROR: 'error'\r\n};\r\nfunction taskStateFromInternalTaskState(state) {\r\n switch (state) {\r\n case InternalTaskState.RUNNING:\r\n case InternalTaskState.PAUSING:\r\n case InternalTaskState.CANCELING:\r\n return TaskState.RUNNING;\r\n case InternalTaskState.PAUSED:\r\n return TaskState.PAUSED;\r\n case InternalTaskState.SUCCESS:\r\n return TaskState.SUCCESS;\r\n case InternalTaskState.CANCELED:\r\n return TaskState.CANCELED;\r\n case InternalTaskState.ERROR:\r\n return TaskState.ERROR;\r\n default:\r\n // TODO(andysoto): assert(false);\r\n return TaskState.ERROR;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @return False if the object is undefined or null, true otherwise.\r\n */\r\nfunction isDef(p) {\r\n return p != null;\r\n}\r\nfunction isJustDef(p) {\r\n return p !== void 0;\r\n}\r\n// eslint-disable-next-line @typescript-eslint/ban-types\r\nfunction isFunction(p) {\r\n return typeof p === 'function';\r\n}\r\nfunction isNonArrayObject(p) {\r\n return typeof p === 'object' && !Array.isArray(p);\r\n}\r\nfunction isString(p) {\r\n return typeof p === 'string' || p instanceof String;\r\n}\r\nfunction isNativeBlob(p) {\r\n return isNativeBlobDefined() && p instanceof Blob;\r\n}\r\nfunction isNativeBlobDefined() {\r\n return typeof Blob !== 'undefined';\r\n}\r\nfunction validateNumber(argument, minValue, maxValue, value) {\r\n if (value < minValue) {\r\n throw new FirebaseStorageError(Code.INVALID_ARGUMENT, \"Invalid value for '\" + argument + \"'. Expected \" + minValue + \" or greater.\");\r\n }\r\n if (value > maxValue) {\r\n throw new FirebaseStorageError(Code.INVALID_ARGUMENT, \"Invalid value for '\" + argument + \"'. Expected \" + maxValue + \" or less.\");\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @enum{number}\r\n */\r\nvar ErrorCode;\r\n(function (ErrorCode) {\r\n ErrorCode[ErrorCode[\"NO_ERROR\"] = 0] = \"NO_ERROR\";\r\n ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 1] = \"NETWORK_ERROR\";\r\n ErrorCode[ErrorCode[\"ABORT\"] = 2] = \"ABORT\";\r\n})(ErrorCode || (ErrorCode = {}));\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * We use this instead of goog.net.XhrIo because goog.net.XhrIo is hyuuuuge and\r\n * doesn't work in React Native on Android.\r\n */\r\nvar NetworkXhrIo = /** @class */ (function () {\r\n function NetworkXhrIo() {\r\n var _this = this;\r\n this.sent_ = false;\r\n this.xhr_ = new XMLHttpRequest();\r\n this.errorCode_ = ErrorCode.NO_ERROR;\r\n this.sendPromise_ = new Promise(function (resolve) {\r\n _this.xhr_.addEventListener('abort', function () {\r\n _this.errorCode_ = ErrorCode.ABORT;\r\n resolve(_this);\r\n });\r\n _this.xhr_.addEventListener('error', function () {\r\n _this.errorCode_ = ErrorCode.NETWORK_ERROR;\r\n resolve(_this);\r\n });\r\n _this.xhr_.addEventListener('load', function () {\r\n resolve(_this);\r\n });\r\n });\r\n }\r\n /**\r\n * @override\r\n */\r\n NetworkXhrIo.prototype.send = function (url, method, body, headers) {\r\n if (this.sent_) {\r\n throw internalError('cannot .send() more than once');\r\n }\r\n this.sent_ = true;\r\n this.xhr_.open(method, url, true);\r\n if (isDef(headers)) {\r\n for (var key in headers) {\r\n if (headers.hasOwnProperty(key)) {\r\n this.xhr_.setRequestHeader(key, headers[key].toString());\r\n }\r\n }\r\n }\r\n if (isDef(body)) {\r\n this.xhr_.send(body);\r\n }\r\n else {\r\n this.xhr_.send();\r\n }\r\n return this.sendPromise_;\r\n };\r\n /**\r\n * @override\r\n */\r\n NetworkXhrIo.prototype.getErrorCode = function () {\r\n if (!this.sent_) {\r\n throw internalError('cannot .getErrorCode() before sending');\r\n }\r\n return this.errorCode_;\r\n };\r\n /**\r\n * @override\r\n */\r\n NetworkXhrIo.prototype.getStatus = function () {\r\n if (!this.sent_) {\r\n throw internalError('cannot .getStatus() before sending');\r\n }\r\n try {\r\n return this.xhr_.status;\r\n }\r\n catch (e) {\r\n return -1;\r\n }\r\n };\r\n /**\r\n * @override\r\n */\r\n NetworkXhrIo.prototype.getResponseText = function () {\r\n if (!this.sent_) {\r\n throw internalError('cannot .getResponseText() before sending');\r\n }\r\n return this.xhr_.responseText;\r\n };\r\n /**\r\n * Aborts the request.\r\n * @override\r\n */\r\n NetworkXhrIo.prototype.abort = function () {\r\n this.xhr_.abort();\r\n };\r\n /**\r\n * @override\r\n */\r\n NetworkXhrIo.prototype.getResponseHeader = function (header) {\r\n return this.xhr_.getResponseHeader(header);\r\n };\r\n /**\r\n * @override\r\n */\r\n NetworkXhrIo.prototype.addUploadProgressListener = function (listener) {\r\n if (isDef(this.xhr_.upload)) {\r\n this.xhr_.upload.addEventListener('progress', listener);\r\n }\r\n };\r\n /**\r\n * @override\r\n */\r\n NetworkXhrIo.prototype.removeUploadProgressListener = function (listener) {\r\n if (isDef(this.xhr_.upload)) {\r\n this.xhr_.upload.removeEventListener('progress', listener);\r\n }\r\n };\r\n return NetworkXhrIo;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Factory-like class for creating XhrIo instances.\r\n */\r\nvar XhrIoPool = /** @class */ (function () {\r\n function XhrIoPool() {\r\n }\r\n XhrIoPool.prototype.createXhrIo = function () {\r\n return new NetworkXhrIo();\r\n };\r\n return XhrIoPool;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction getBlobBuilder() {\r\n if (typeof BlobBuilder !== 'undefined') {\r\n return BlobBuilder;\r\n }\r\n else if (typeof WebKitBlobBuilder !== 'undefined') {\r\n return WebKitBlobBuilder;\r\n }\r\n else {\r\n return undefined;\r\n }\r\n}\r\n/**\r\n * Concatenates one or more values together and converts them to a Blob.\r\n *\r\n * @param args The values that will make up the resulting blob.\r\n * @return The blob.\r\n */\r\nfunction getBlob() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var BlobBuilder = getBlobBuilder();\r\n if (BlobBuilder !== undefined) {\r\n var bb = new BlobBuilder();\r\n for (var i = 0; i < args.length; i++) {\r\n bb.append(args[i]);\r\n }\r\n return bb.getBlob();\r\n }\r\n else {\r\n if (isNativeBlobDefined()) {\r\n return new Blob(args);\r\n }\r\n else {\r\n throw Error(\"This browser doesn't seem to support creating Blobs\");\r\n }\r\n }\r\n}\r\n/**\r\n * Slices the blob. The returned blob contains data from the start byte\r\n * (inclusive) till the end byte (exclusive). Negative indices cannot be used.\r\n *\r\n * @param blob The blob to be sliced.\r\n * @param start Index of the starting byte.\r\n * @param end Index of the ending byte.\r\n * @return The blob slice or null if not supported.\r\n */\r\nfunction sliceBlob(blob, start, end) {\r\n if (blob.webkitSlice) {\r\n return blob.webkitSlice(start, end);\r\n }\r\n else if (blob.mozSlice) {\r\n return blob.mozSlice(start, end);\r\n }\r\n else if (blob.slice) {\r\n return blob.slice(start, end);\r\n }\r\n return null;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @param opt_elideCopy If true, doesn't copy mutable input data\r\n * (e.g. Uint8Arrays). Pass true only if you know the objects will not be\r\n * modified after this blob's construction.\r\n */\r\nvar FbsBlob = /** @class */ (function () {\r\n function FbsBlob(data, elideCopy) {\r\n var size = 0;\r\n var blobType = '';\r\n if (isNativeBlob(data)) {\r\n this.data_ = data;\r\n size = data.size;\r\n blobType = data.type;\r\n }\r\n else if (data instanceof ArrayBuffer) {\r\n if (elideCopy) {\r\n this.data_ = new Uint8Array(data);\r\n }\r\n else {\r\n this.data_ = new Uint8Array(data.byteLength);\r\n this.data_.set(new Uint8Array(data));\r\n }\r\n size = this.data_.length;\r\n }\r\n else if (data instanceof Uint8Array) {\r\n if (elideCopy) {\r\n this.data_ = data;\r\n }\r\n else {\r\n this.data_ = new Uint8Array(data.length);\r\n this.data_.set(data);\r\n }\r\n size = data.length;\r\n }\r\n this.size_ = size;\r\n this.type_ = blobType;\r\n }\r\n FbsBlob.prototype.size = function () {\r\n return this.size_;\r\n };\r\n FbsBlob.prototype.type = function () {\r\n return this.type_;\r\n };\r\n FbsBlob.prototype.slice = function (startByte, endByte) {\r\n if (isNativeBlob(this.data_)) {\r\n var realBlob = this.data_;\r\n var sliced = sliceBlob(realBlob, startByte, endByte);\r\n if (sliced === null) {\r\n return null;\r\n }\r\n return new FbsBlob(sliced);\r\n }\r\n else {\r\n var slice = new Uint8Array(this.data_.buffer, startByte, endByte - startByte);\r\n return new FbsBlob(slice, true);\r\n }\r\n };\r\n FbsBlob.getBlob = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (isNativeBlobDefined()) {\r\n var blobby = args.map(function (val) {\r\n if (val instanceof FbsBlob) {\r\n return val.data_;\r\n }\r\n else {\r\n return val;\r\n }\r\n });\r\n return new FbsBlob(getBlob.apply(null, blobby));\r\n }\r\n else {\r\n var uint8Arrays = args.map(function (val) {\r\n if (isString(val)) {\r\n return dataFromString(StringFormat.RAW, val).data;\r\n }\r\n else {\r\n // Blobs don't exist, so this has to be a Uint8Array.\r\n return val.data_;\r\n }\r\n });\r\n var finalLength_1 = 0;\r\n uint8Arrays.forEach(function (array) {\r\n finalLength_1 += array.byteLength;\r\n });\r\n var merged_1 = new Uint8Array(finalLength_1);\r\n var index_1 = 0;\r\n uint8Arrays.forEach(function (array) {\r\n for (var i = 0; i < array.length; i++) {\r\n merged_1[index_1++] = array[i];\r\n }\r\n });\r\n return new FbsBlob(merged_1, true);\r\n }\r\n };\r\n FbsBlob.prototype.uploadData = function () {\r\n return this.data_;\r\n };\r\n return FbsBlob;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @struct\r\n */\r\nvar Location = /** @class */ (function () {\r\n function Location(bucket, path) {\r\n this.bucket = bucket;\r\n this.path_ = path;\r\n }\r\n Object.defineProperty(Location.prototype, \"path\", {\r\n get: function () {\r\n return this.path_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Location.prototype, \"isRoot\", {\r\n get: function () {\r\n return this.path.length === 0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Location.prototype.fullServerUrl = function () {\r\n var encode = encodeURIComponent;\r\n return '/b/' + encode(this.bucket) + '/o/' + encode(this.path);\r\n };\r\n Location.prototype.bucketOnlyServerUrl = function () {\r\n var encode = encodeURIComponent;\r\n return '/b/' + encode(this.bucket) + '/o';\r\n };\r\n Location.makeFromBucketSpec = function (bucketString) {\r\n var bucketLocation;\r\n try {\r\n bucketLocation = Location.makeFromUrl(bucketString);\r\n }\r\n catch (e) {\r\n // Not valid URL, use as-is. This lets you put bare bucket names in\r\n // config.\r\n return new Location(bucketString, '');\r\n }\r\n if (bucketLocation.path === '') {\r\n return bucketLocation;\r\n }\r\n else {\r\n throw invalidDefaultBucket(bucketString);\r\n }\r\n };\r\n Location.makeFromUrl = function (url) {\r\n var location = null;\r\n var bucketDomain = '([A-Za-z0-9.\\\\-_]+)';\r\n function gsModify(loc) {\r\n if (loc.path.charAt(loc.path.length - 1) === '/') {\r\n loc.path_ = loc.path_.slice(0, -1);\r\n }\r\n }\r\n var gsPath = '(/(.*))?$';\r\n var gsRegex = new RegExp('^gs://' + bucketDomain + gsPath, 'i');\r\n var gsIndices = { bucket: 1, path: 3 };\r\n function httpModify(loc) {\r\n loc.path_ = decodeURIComponent(loc.path);\r\n }\r\n var version = 'v[A-Za-z0-9_]+';\r\n var firebaseStorageHost = DEFAULT_HOST.replace(/[.]/g, '\\\\.');\r\n var firebaseStoragePath = '(/([^?#]*).*)?$';\r\n var firebaseStorageRegExp = new RegExp(\"^https?://\" + firebaseStorageHost + \"/\" + version + \"/b/\" + bucketDomain + \"/o\" + firebaseStoragePath, 'i');\r\n var firebaseStorageIndices = { bucket: 1, path: 3 };\r\n var cloudStorageHost = '(?:storage.googleapis.com|storage.cloud.google.com)';\r\n var cloudStoragePath = '([^?#]*)';\r\n var cloudStorageRegExp = new RegExp(\"^https?://\" + cloudStorageHost + \"/\" + bucketDomain + \"/\" + cloudStoragePath, 'i');\r\n var cloudStorageIndices = { bucket: 1, path: 2 };\r\n var groups = [\r\n { regex: gsRegex, indices: gsIndices, postModify: gsModify },\r\n {\r\n regex: firebaseStorageRegExp,\r\n indices: firebaseStorageIndices,\r\n postModify: httpModify\r\n },\r\n {\r\n regex: cloudStorageRegExp,\r\n indices: cloudStorageIndices,\r\n postModify: httpModify\r\n }\r\n ];\r\n for (var i = 0; i < groups.length; i++) {\r\n var group = groups[i];\r\n var captures = group.regex.exec(url);\r\n if (captures) {\r\n var bucketValue = captures[group.indices.bucket];\r\n var pathValue = captures[group.indices.path];\r\n if (!pathValue) {\r\n pathValue = '';\r\n }\r\n location = new Location(bucketValue, pathValue);\r\n group.postModify(location);\r\n break;\r\n }\r\n }\r\n if (location == null) {\r\n throw invalidUrl(url);\r\n }\r\n return location;\r\n };\r\n return Location;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns the Object resulting from parsing the given JSON, or null if the\r\n * given string does not represent a JSON object.\r\n */\r\nfunction jsonObjectOrNull(s) {\r\n var obj;\r\n try {\r\n obj = JSON.parse(s);\r\n }\r\n catch (e) {\r\n return null;\r\n }\r\n if (isNonArrayObject(obj)) {\r\n return obj;\r\n }\r\n else {\r\n return null;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @fileoverview Contains helper methods for manipulating paths.\r\n */\r\n/**\r\n * @return Null if the path is already at the root.\r\n */\r\nfunction parent(path) {\r\n if (path.length === 0) {\r\n return null;\r\n }\r\n var index = path.lastIndexOf('/');\r\n if (index === -1) {\r\n return '';\r\n }\r\n var newPath = path.slice(0, index);\r\n return newPath;\r\n}\r\nfunction child(path, childPath) {\r\n var canonicalChildPath = childPath\r\n .split('/')\r\n .filter(function (component) { return component.length > 0; })\r\n .join('/');\r\n if (path.length === 0) {\r\n return canonicalChildPath;\r\n }\r\n else {\r\n return path + '/' + canonicalChildPath;\r\n }\r\n}\r\n/**\r\n * Returns the last component of a path.\r\n * '/foo/bar' -> 'bar'\r\n * '/foo/bar/baz/' -> 'baz/'\r\n * '/a' -> 'a'\r\n */\r\nfunction lastComponent(path) {\r\n var index = path.lastIndexOf('/', path.length - 2);\r\n if (index === -1) {\r\n return path;\r\n }\r\n else {\r\n return path.slice(index + 1);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction makeUrl(urlPart) {\r\n return \"https://\" + DEFAULT_HOST + \"/v0\" + urlPart;\r\n}\r\nfunction makeQueryString(params) {\r\n var encode = encodeURIComponent;\r\n var queryPart = '?';\r\n for (var key in params) {\r\n if (params.hasOwnProperty(key)) {\r\n // @ts-ignore TODO: remove once typescript is upgraded to 3.5.x\r\n var nextPart = encode(key) + '=' + encode(params[key]);\r\n queryPart = queryPart + nextPart + '&';\r\n }\r\n }\r\n // Chop off the extra '&' or '?' on the end\r\n queryPart = queryPart.slice(0, -1);\r\n return queryPart;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction noXform_(metadata, value) {\r\n return value;\r\n}\r\n/**\r\n * @struct\r\n */\r\nvar Mapping = /** @class */ (function () {\r\n function Mapping(server, local, writable, xform) {\r\n this.server = server;\r\n this.local = local || server;\r\n this.writable = !!writable;\r\n this.xform = xform || noXform_;\r\n }\r\n return Mapping;\r\n}());\r\nvar mappings_ = null;\r\nfunction xformPath(fullPath) {\r\n if (!isString(fullPath) || fullPath.length < 2) {\r\n return fullPath;\r\n }\r\n else {\r\n return lastComponent(fullPath);\r\n }\r\n}\r\nfunction getMappings() {\r\n if (mappings_) {\r\n return mappings_;\r\n }\r\n var mappings = [];\r\n mappings.push(new Mapping('bucket'));\r\n mappings.push(new Mapping('generation'));\r\n mappings.push(new Mapping('metageneration'));\r\n mappings.push(new Mapping('name', 'fullPath', true));\r\n function mappingsXformPath(_metadata, fullPath) {\r\n return xformPath(fullPath);\r\n }\r\n var nameMapping = new Mapping('name');\r\n nameMapping.xform = mappingsXformPath;\r\n mappings.push(nameMapping);\r\n /**\r\n * Coerces the second param to a number, if it is defined.\r\n */\r\n function xformSize(_metadata, size) {\r\n if (isDef(size)) {\r\n return Number(size);\r\n }\r\n else {\r\n return size;\r\n }\r\n }\r\n var sizeMapping = new Mapping('size');\r\n sizeMapping.xform = xformSize;\r\n mappings.push(sizeMapping);\r\n mappings.push(new Mapping('timeCreated'));\r\n mappings.push(new Mapping('updated'));\r\n mappings.push(new Mapping('md5Hash', null, true));\r\n mappings.push(new Mapping('cacheControl', null, true));\r\n mappings.push(new Mapping('contentDisposition', null, true));\r\n mappings.push(new Mapping('contentEncoding', null, true));\r\n mappings.push(new Mapping('contentLanguage', null, true));\r\n mappings.push(new Mapping('contentType', null, true));\r\n mappings.push(new Mapping('metadata', 'customMetadata', true));\r\n mappings_ = mappings;\r\n return mappings_;\r\n}\r\nfunction addRef(metadata, service) {\r\n function generateRef() {\r\n var bucket = metadata['bucket'];\r\n var path = metadata['fullPath'];\r\n var loc = new Location(bucket, path);\r\n return service.makeStorageReference(loc);\r\n }\r\n Object.defineProperty(metadata, 'ref', { get: generateRef });\r\n}\r\nfunction fromResource(service, resource, mappings) {\r\n var metadata = {};\r\n metadata['type'] = 'file';\r\n var len = mappings.length;\r\n for (var i = 0; i < len; i++) {\r\n var mapping = mappings[i];\r\n metadata[mapping.local] = mapping.xform(metadata, resource[mapping.server]);\r\n }\r\n addRef(metadata, service);\r\n return metadata;\r\n}\r\nfunction fromResourceString(service, resourceString, mappings) {\r\n var obj = jsonObjectOrNull(resourceString);\r\n if (obj === null) {\r\n return null;\r\n }\r\n var resource = obj;\r\n return fromResource(service, resource, mappings);\r\n}\r\nfunction downloadUrlFromResourceString(metadata, resourceString) {\r\n var obj = jsonObjectOrNull(resourceString);\r\n if (obj === null) {\r\n return null;\r\n }\r\n if (!isString(obj['downloadTokens'])) {\r\n // This can happen if objects are uploaded through GCS and retrieved\r\n // through list, so we don't want to throw an Error.\r\n return null;\r\n }\r\n var tokens = obj['downloadTokens'];\r\n if (tokens.length === 0) {\r\n return null;\r\n }\r\n var encode = encodeURIComponent;\r\n var tokensList = tokens.split(',');\r\n var urls = tokensList.map(function (token) {\r\n var bucket = metadata['bucket'];\r\n var path = metadata['fullPath'];\r\n var urlPart = '/b/' + encode(bucket) + '/o/' + encode(path);\r\n var base = makeUrl(urlPart);\r\n var queryString = makeQueryString({\r\n alt: 'media',\r\n token: token\r\n });\r\n return base + queryString;\r\n });\r\n return urls[0];\r\n}\r\nfunction toResourceString(metadata, mappings) {\r\n var resource = {};\r\n var len = mappings.length;\r\n for (var i = 0; i < len; i++) {\r\n var mapping = mappings[i];\r\n if (mapping.writable) {\r\n resource[mapping.server] = metadata[mapping.local];\r\n }\r\n }\r\n return JSON.stringify(resource);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar PREFIXES_KEY = 'prefixes';\r\nvar ITEMS_KEY = 'items';\r\nfunction fromBackendResponse(service, bucket, resource) {\r\n var listResult = {\r\n prefixes: [],\r\n items: [],\r\n nextPageToken: resource['nextPageToken']\r\n };\r\n if (resource[PREFIXES_KEY]) {\r\n for (var _i = 0, _a = resource[PREFIXES_KEY]; _i < _a.length; _i++) {\r\n var path = _a[_i];\r\n var pathWithoutTrailingSlash = path.replace(/\\/$/, '');\r\n var reference = service.makeStorageReference(new Location(bucket, pathWithoutTrailingSlash));\r\n listResult.prefixes.push(reference);\r\n }\r\n }\r\n if (resource[ITEMS_KEY]) {\r\n for (var _b = 0, _c = resource[ITEMS_KEY]; _b < _c.length; _b++) {\r\n var item = _c[_b];\r\n var reference = service.makeStorageReference(new Location(bucket, item['name']));\r\n listResult.items.push(reference);\r\n }\r\n }\r\n return listResult;\r\n}\r\nfunction fromResponseString(service, bucket, resourceString) {\r\n var obj = jsonObjectOrNull(resourceString);\r\n if (obj === null) {\r\n return null;\r\n }\r\n var resource = obj;\r\n return fromBackendResponse(service, bucket, resource);\r\n}\n\nvar RequestInfo = /** @class */ (function () {\r\n function RequestInfo(url, method, \r\n /**\r\n * Returns the value with which to resolve the request's promise. Only called\r\n * if the request is successful. Throw from this function to reject the\r\n * returned Request's promise with the thrown error.\r\n * Note: The XhrIo passed to this function may be reused after this callback\r\n * returns. Do not keep a reference to it in any way.\r\n */\r\n handler, timeout) {\r\n this.url = url;\r\n this.method = method;\r\n this.handler = handler;\r\n this.timeout = timeout;\r\n this.urlParams = {};\r\n this.headers = {};\r\n this.body = null;\r\n this.errorHandler = null;\r\n /**\r\n * Called with the current number of bytes uploaded and total size (-1 if not\r\n * computable) of the request body (i.e. used to report upload progress).\r\n */\r\n this.progressCallback = null;\r\n this.successCodes = [200];\r\n this.additionalRetryCodes = [];\r\n }\r\n return RequestInfo;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Throws the UNKNOWN FirebaseStorageError if cndn is false.\r\n */\r\nfunction handlerCheck(cndn) {\r\n if (!cndn) {\r\n throw unknown();\r\n }\r\n}\r\nfunction metadataHandler(service, mappings) {\r\n function handler(xhr, text) {\r\n var metadata = fromResourceString(service, text, mappings);\r\n handlerCheck(metadata !== null);\r\n return metadata;\r\n }\r\n return handler;\r\n}\r\nfunction listHandler(service, bucket) {\r\n function handler(xhr, text) {\r\n var listResult = fromResponseString(service, bucket, text);\r\n handlerCheck(listResult !== null);\r\n return listResult;\r\n }\r\n return handler;\r\n}\r\nfunction downloadUrlHandler(service, mappings) {\r\n function handler(xhr, text) {\r\n var metadata = fromResourceString(service, text, mappings);\r\n handlerCheck(metadata !== null);\r\n return downloadUrlFromResourceString(metadata, text);\r\n }\r\n return handler;\r\n}\r\nfunction sharedErrorHandler(location) {\r\n function errorHandler(xhr, err) {\r\n var newErr;\r\n if (xhr.getStatus() === 401) {\r\n newErr = unauthenticated();\r\n }\r\n else {\r\n if (xhr.getStatus() === 402) {\r\n newErr = quotaExceeded(location.bucket);\r\n }\r\n else {\r\n if (xhr.getStatus() === 403) {\r\n newErr = unauthorized(location.path);\r\n }\r\n else {\r\n newErr = err;\r\n }\r\n }\r\n }\r\n newErr.serverResponse = err.serverResponse;\r\n return newErr;\r\n }\r\n return errorHandler;\r\n}\r\nfunction objectErrorHandler(location) {\r\n var shared = sharedErrorHandler(location);\r\n function errorHandler(xhr, err) {\r\n var newErr = shared(xhr, err);\r\n if (xhr.getStatus() === 404) {\r\n newErr = objectNotFound(location.path);\r\n }\r\n newErr.serverResponse = err.serverResponse;\r\n return newErr;\r\n }\r\n return errorHandler;\r\n}\r\nfunction getMetadata(service, location, mappings) {\r\n var urlPart = location.fullServerUrl();\r\n var url = makeUrl(urlPart);\r\n var method = 'GET';\r\n var timeout = service.maxOperationRetryTime;\r\n var requestInfo = new RequestInfo(url, method, metadataHandler(service, mappings), timeout);\r\n requestInfo.errorHandler = objectErrorHandler(location);\r\n return requestInfo;\r\n}\r\nfunction list(service, location, delimiter, pageToken, maxResults) {\r\n var urlParams = {};\r\n if (location.isRoot) {\r\n urlParams['prefix'] = '';\r\n }\r\n else {\r\n urlParams['prefix'] = location.path + '/';\r\n }\r\n if (delimiter && delimiter.length > 0) {\r\n urlParams['delimiter'] = delimiter;\r\n }\r\n if (pageToken) {\r\n urlParams['pageToken'] = pageToken;\r\n }\r\n if (maxResults) {\r\n urlParams['maxResults'] = maxResults;\r\n }\r\n var urlPart = location.bucketOnlyServerUrl();\r\n var url = makeUrl(urlPart);\r\n var method = 'GET';\r\n var timeout = service.maxOperationRetryTime;\r\n var requestInfo = new RequestInfo(url, method, listHandler(service, location.bucket), timeout);\r\n requestInfo.urlParams = urlParams;\r\n requestInfo.errorHandler = sharedErrorHandler(location);\r\n return requestInfo;\r\n}\r\nfunction getDownloadUrl(service, location, mappings) {\r\n var urlPart = location.fullServerUrl();\r\n var url = makeUrl(urlPart);\r\n var method = 'GET';\r\n var timeout = service.maxOperationRetryTime;\r\n var requestInfo = new RequestInfo(url, method, downloadUrlHandler(service, mappings), timeout);\r\n requestInfo.errorHandler = objectErrorHandler(location);\r\n return requestInfo;\r\n}\r\nfunction updateMetadata(service, location, metadata, mappings) {\r\n var urlPart = location.fullServerUrl();\r\n var url = makeUrl(urlPart);\r\n var method = 'PATCH';\r\n var body = toResourceString(metadata, mappings);\r\n var headers = { 'Content-Type': 'application/json; charset=utf-8' };\r\n var timeout = service.maxOperationRetryTime;\r\n var requestInfo = new RequestInfo(url, method, metadataHandler(service, mappings), timeout);\r\n requestInfo.headers = headers;\r\n requestInfo.body = body;\r\n requestInfo.errorHandler = objectErrorHandler(location);\r\n return requestInfo;\r\n}\r\nfunction deleteObject(service, location) {\r\n var urlPart = location.fullServerUrl();\r\n var url = makeUrl(urlPart);\r\n var method = 'DELETE';\r\n var timeout = service.maxOperationRetryTime;\r\n function handler(_xhr, _text) { }\r\n var requestInfo = new RequestInfo(url, method, handler, timeout);\r\n requestInfo.successCodes = [200, 204];\r\n requestInfo.errorHandler = objectErrorHandler(location);\r\n return requestInfo;\r\n}\r\nfunction determineContentType_(metadata, blob) {\r\n return ((metadata && metadata['contentType']) ||\r\n (blob && blob.type()) ||\r\n 'application/octet-stream');\r\n}\r\nfunction metadataForUpload_(location, blob, metadata) {\r\n var metadataClone = Object.assign({}, metadata);\r\n metadataClone['fullPath'] = location.path;\r\n metadataClone['size'] = blob.size();\r\n if (!metadataClone['contentType']) {\r\n metadataClone['contentType'] = determineContentType_(null, blob);\r\n }\r\n return metadataClone;\r\n}\r\nfunction multipartUpload(service, location, mappings, blob, metadata) {\r\n var urlPart = location.bucketOnlyServerUrl();\r\n var headers = {\r\n 'X-Goog-Upload-Protocol': 'multipart'\r\n };\r\n function genBoundary() {\r\n var str = '';\r\n for (var i = 0; i < 2; i++) {\r\n str = str + Math.random().toString().slice(2);\r\n }\r\n return str;\r\n }\r\n var boundary = genBoundary();\r\n headers['Content-Type'] = 'multipart/related; boundary=' + boundary;\r\n var metadata_ = metadataForUpload_(location, blob, metadata);\r\n var metadataString = toResourceString(metadata_, mappings);\r\n var preBlobPart = '--' +\r\n boundary +\r\n '\\r\\n' +\r\n 'Content-Type: application/json; charset=utf-8\\r\\n\\r\\n' +\r\n metadataString +\r\n '\\r\\n--' +\r\n boundary +\r\n '\\r\\n' +\r\n 'Content-Type: ' +\r\n metadata_['contentType'] +\r\n '\\r\\n\\r\\n';\r\n var postBlobPart = '\\r\\n--' + boundary + '--';\r\n var body = FbsBlob.getBlob(preBlobPart, blob, postBlobPart);\r\n if (body === null) {\r\n throw cannotSliceBlob();\r\n }\r\n var urlParams = { name: metadata_['fullPath'] };\r\n var url = makeUrl(urlPart);\r\n var method = 'POST';\r\n var timeout = service.maxUploadRetryTime;\r\n var requestInfo = new RequestInfo(url, method, metadataHandler(service, mappings), timeout);\r\n requestInfo.urlParams = urlParams;\r\n requestInfo.headers = headers;\r\n requestInfo.body = body.uploadData();\r\n requestInfo.errorHandler = sharedErrorHandler(location);\r\n return requestInfo;\r\n}\r\n/**\r\n * @param current The number of bytes that have been uploaded so far.\r\n * @param total The total number of bytes in the upload.\r\n * @param opt_finalized True if the server has finished the upload.\r\n * @param opt_metadata The upload metadata, should\r\n * only be passed if opt_finalized is true.\r\n * @struct\r\n */\r\nvar ResumableUploadStatus = /** @class */ (function () {\r\n function ResumableUploadStatus(current, total, finalized, metadata) {\r\n this.current = current;\r\n this.total = total;\r\n this.finalized = !!finalized;\r\n this.metadata = metadata || null;\r\n }\r\n return ResumableUploadStatus;\r\n}());\r\nfunction checkResumeHeader_(xhr, allowed) {\r\n var status = null;\r\n try {\r\n status = xhr.getResponseHeader('X-Goog-Upload-Status');\r\n }\r\n catch (e) {\r\n handlerCheck(false);\r\n }\r\n var allowedStatus = allowed || ['active'];\r\n handlerCheck(!!status && allowedStatus.indexOf(status) !== -1);\r\n return status;\r\n}\r\nfunction createResumableUpload(service, location, mappings, blob, metadata) {\r\n var urlPart = location.bucketOnlyServerUrl();\r\n var metadataForUpload = metadataForUpload_(location, blob, metadata);\r\n var urlParams = { name: metadataForUpload['fullPath'] };\r\n var url = makeUrl(urlPart);\r\n var method = 'POST';\r\n var headers = {\r\n 'X-Goog-Upload-Protocol': 'resumable',\r\n 'X-Goog-Upload-Command': 'start',\r\n 'X-Goog-Upload-Header-Content-Length': blob.size(),\r\n 'X-Goog-Upload-Header-Content-Type': metadataForUpload['contentType'],\r\n 'Content-Type': 'application/json; charset=utf-8'\r\n };\r\n var body = toResourceString(metadataForUpload, mappings);\r\n var timeout = service.maxUploadRetryTime;\r\n function handler(xhr) {\r\n checkResumeHeader_(xhr);\r\n var url;\r\n try {\r\n url = xhr.getResponseHeader('X-Goog-Upload-URL');\r\n }\r\n catch (e) {\r\n handlerCheck(false);\r\n }\r\n handlerCheck(isString(url));\r\n return url;\r\n }\r\n var requestInfo = new RequestInfo(url, method, handler, timeout);\r\n requestInfo.urlParams = urlParams;\r\n requestInfo.headers = headers;\r\n requestInfo.body = body;\r\n requestInfo.errorHandler = sharedErrorHandler(location);\r\n return requestInfo;\r\n}\r\n/**\r\n * @param url From a call to fbs.requests.createResumableUpload.\r\n */\r\nfunction getResumableUploadStatus(service, location, url, blob) {\r\n var headers = { 'X-Goog-Upload-Command': 'query' };\r\n function handler(xhr) {\r\n var status = checkResumeHeader_(xhr, ['active', 'final']);\r\n var sizeString = null;\r\n try {\r\n sizeString = xhr.getResponseHeader('X-Goog-Upload-Size-Received');\r\n }\r\n catch (e) {\r\n handlerCheck(false);\r\n }\r\n if (!sizeString) {\r\n // null or empty string\r\n handlerCheck(false);\r\n }\r\n var size = Number(sizeString);\r\n handlerCheck(!isNaN(size));\r\n return new ResumableUploadStatus(size, blob.size(), status === 'final');\r\n }\r\n var method = 'POST';\r\n var timeout = service.maxUploadRetryTime;\r\n var requestInfo = new RequestInfo(url, method, handler, timeout);\r\n requestInfo.headers = headers;\r\n requestInfo.errorHandler = sharedErrorHandler(location);\r\n return requestInfo;\r\n}\r\n/**\r\n * Any uploads via the resumable upload API must transfer a number of bytes\r\n * that is a multiple of this number.\r\n */\r\nvar resumableUploadChunkSize = 256 * 1024;\r\n/**\r\n * @param url From a call to fbs.requests.createResumableUpload.\r\n * @param chunkSize Number of bytes to upload.\r\n * @param status The previous status.\r\n * If not passed or null, we start from the beginning.\r\n * @throws fbs.Error If the upload is already complete, the passed in status\r\n * has a final size inconsistent with the blob, or the blob cannot be sliced\r\n * for upload.\r\n */\r\nfunction continueResumableUpload(location, service, url, blob, chunkSize, mappings, status, progressCallback) {\r\n // TODO(andysoto): standardize on internal asserts\r\n // assert(!(opt_status && opt_status.finalized));\r\n var status_ = new ResumableUploadStatus(0, 0);\r\n if (status) {\r\n status_.current = status.current;\r\n status_.total = status.total;\r\n }\r\n else {\r\n status_.current = 0;\r\n status_.total = blob.size();\r\n }\r\n if (blob.size() !== status_.total) {\r\n throw serverFileWrongSize();\r\n }\r\n var bytesLeft = status_.total - status_.current;\r\n var bytesToUpload = bytesLeft;\r\n if (chunkSize > 0) {\r\n bytesToUpload = Math.min(bytesToUpload, chunkSize);\r\n }\r\n var startByte = status_.current;\r\n var endByte = startByte + bytesToUpload;\r\n var uploadCommand = bytesToUpload === bytesLeft ? 'upload, finalize' : 'upload';\r\n var headers = {\r\n 'X-Goog-Upload-Command': uploadCommand,\r\n 'X-Goog-Upload-Offset': status_.current\r\n };\r\n var body = blob.slice(startByte, endByte);\r\n if (body === null) {\r\n throw cannotSliceBlob();\r\n }\r\n function handler(xhr, text) {\r\n // TODO(andysoto): Verify the MD5 of each uploaded range:\r\n // the 'x-range-md5' header comes back with status code 308 responses.\r\n // We'll only be able to bail out though, because you can't re-upload a\r\n // range that you previously uploaded.\r\n var uploadStatus = checkResumeHeader_(xhr, ['active', 'final']);\r\n var newCurrent = status_.current + bytesToUpload;\r\n var size = blob.size();\r\n var metadata;\r\n if (uploadStatus === 'final') {\r\n metadata = metadataHandler(service, mappings)(xhr, text);\r\n }\r\n else {\r\n metadata = null;\r\n }\r\n return new ResumableUploadStatus(newCurrent, size, uploadStatus === 'final', metadata);\r\n }\r\n var method = 'POST';\r\n var timeout = service.maxUploadRetryTime;\r\n var requestInfo = new RequestInfo(url, method, handler, timeout);\r\n requestInfo.headers = headers;\r\n requestInfo.body = body.uploadData();\r\n requestInfo.progressCallback = progressCallback || null;\r\n requestInfo.errorHandler = sharedErrorHandler(location);\r\n return requestInfo;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @struct\r\n */\r\nvar Observer = /** @class */ (function () {\r\n function Observer(nextOrObserver, error, complete) {\r\n var asFunctions = isFunction(nextOrObserver) ||\r\n isDef(error) ||\r\n isDef(complete);\r\n if (asFunctions) {\r\n this.next = nextOrObserver;\r\n this.error = error || null;\r\n this.complete = complete || null;\r\n }\r\n else {\r\n var observer = nextOrObserver;\r\n this.next = observer.next || null;\r\n this.error = observer.error || null;\r\n this.complete = observer.complete || null;\r\n }\r\n }\r\n return Observer;\r\n}());\n\nvar UploadTaskSnapshot = /** @class */ (function () {\r\n function UploadTaskSnapshot(bytesTransferred, totalBytes, state, metadata, task, ref) {\r\n this.bytesTransferred = bytesTransferred;\r\n this.totalBytes = totalBytes;\r\n this.state = state;\r\n this.metadata = metadata;\r\n this.task = task;\r\n this.ref = ref;\r\n }\r\n return UploadTaskSnapshot;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns a function that invokes f with its arguments asynchronously as a\r\n * microtask, i.e. as soon as possible after the current script returns back\r\n * into browser code.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/ban-types\r\nfunction async(f) {\r\n return function () {\r\n var argsToForward = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n argsToForward[_i] = arguments[_i];\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n Promise.resolve().then(function () { return f.apply(void 0, argsToForward); });\r\n };\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Represents a blob being uploaded. Can be used to pause/resume/cancel the\r\n * upload and manage callbacks for various events.\r\n */\r\nvar UploadTask = /** @class */ (function () {\r\n /**\r\n * @param ref The firebaseStorage.Reference object this task came\r\n * from, untyped to avoid cyclic dependencies.\r\n * @param blob The blob to upload.\r\n */\r\n function UploadTask(ref, service, location, mappings, blob, metadata) {\r\n var _this = this;\r\n if (metadata === void 0) { metadata = null; }\r\n this.transferred_ = 0;\r\n this.needToFetchStatus_ = false;\r\n this.needToFetchMetadata_ = false;\r\n this.observers_ = [];\r\n this.error_ = null;\r\n this.uploadUrl_ = null;\r\n this.request_ = null;\r\n this.chunkMultiplier_ = 1;\r\n this.resolve_ = null;\r\n this.reject_ = null;\r\n this.ref_ = ref;\r\n this.service_ = service;\r\n this.location_ = location;\r\n this.blob_ = blob;\r\n this.metadata_ = metadata;\r\n this.mappings_ = mappings;\r\n this.resumable_ = this.shouldDoResumable_(this.blob_);\r\n this.state_ = InternalTaskState.RUNNING;\r\n this.errorHandler_ = function (error) {\r\n _this.request_ = null;\r\n _this.chunkMultiplier_ = 1;\r\n if (error.codeEquals(Code.CANCELED)) {\r\n _this.needToFetchStatus_ = true;\r\n _this.completeTransitions_();\r\n }\r\n else {\r\n _this.error_ = error;\r\n _this.transition_(InternalTaskState.ERROR);\r\n }\r\n };\r\n this.metadataErrorHandler_ = function (error) {\r\n _this.request_ = null;\r\n if (error.codeEquals(Code.CANCELED)) {\r\n _this.completeTransitions_();\r\n }\r\n else {\r\n _this.error_ = error;\r\n _this.transition_(InternalTaskState.ERROR);\r\n }\r\n };\r\n this.promise_ = new Promise(function (resolve, reject) {\r\n _this.resolve_ = resolve;\r\n _this.reject_ = reject;\r\n _this.start_();\r\n });\r\n // Prevent uncaught rejections on the internal promise from bubbling out\r\n // to the top level with a dummy handler.\r\n this.promise_.then(null, function () { });\r\n }\r\n UploadTask.prototype.makeProgressCallback_ = function () {\r\n var _this = this;\r\n var sizeBefore = this.transferred_;\r\n return function (loaded) { return _this.updateProgress_(sizeBefore + loaded); };\r\n };\r\n UploadTask.prototype.shouldDoResumable_ = function (blob) {\r\n return blob.size() > 256 * 1024;\r\n };\r\n UploadTask.prototype.start_ = function () {\r\n if (this.state_ !== InternalTaskState.RUNNING) {\r\n // This can happen if someone pauses us in a resume callback, for example.\r\n return;\r\n }\r\n if (this.request_ !== null) {\r\n return;\r\n }\r\n if (this.resumable_) {\r\n if (this.uploadUrl_ === null) {\r\n this.createResumable_();\r\n }\r\n else {\r\n if (this.needToFetchStatus_) {\r\n this.fetchStatus_();\r\n }\r\n else {\r\n if (this.needToFetchMetadata_) {\r\n // Happens if we miss the metadata on upload completion.\r\n this.fetchMetadata_();\r\n }\r\n else {\r\n this.continueUpload_();\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n this.oneShotUpload_();\r\n }\r\n };\r\n UploadTask.prototype.resolveToken_ = function (callback) {\r\n var _this = this;\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.service_.getAuthToken().then(function (authToken) {\r\n switch (_this.state_) {\r\n case InternalTaskState.RUNNING:\r\n callback(authToken);\r\n break;\r\n case InternalTaskState.CANCELING:\r\n _this.transition_(InternalTaskState.CANCELED);\r\n break;\r\n case InternalTaskState.PAUSING:\r\n _this.transition_(InternalTaskState.PAUSED);\r\n break;\r\n }\r\n });\r\n };\r\n // TODO(andysoto): assert false\r\n UploadTask.prototype.createResumable_ = function () {\r\n var _this = this;\r\n this.resolveToken_(function (authToken) {\r\n var requestInfo = createResumableUpload(_this.service_, _this.location_, _this.mappings_, _this.blob_, _this.metadata_);\r\n var createRequest = _this.service_.makeRequest(requestInfo, authToken);\r\n _this.request_ = createRequest;\r\n createRequest.getPromise().then(function (url) {\r\n _this.request_ = null;\r\n _this.uploadUrl_ = url;\r\n _this.needToFetchStatus_ = false;\r\n _this.completeTransitions_();\r\n }, _this.errorHandler_);\r\n });\r\n };\r\n UploadTask.prototype.fetchStatus_ = function () {\r\n var _this = this;\r\n // TODO(andysoto): assert(this.uploadUrl_ !== null);\r\n var url = this.uploadUrl_;\r\n this.resolveToken_(function (authToken) {\r\n var requestInfo = getResumableUploadStatus(_this.service_, _this.location_, url, _this.blob_);\r\n var statusRequest = _this.service_.makeRequest(requestInfo, authToken);\r\n _this.request_ = statusRequest;\r\n statusRequest.getPromise().then(function (status) {\r\n status = status;\r\n _this.request_ = null;\r\n _this.updateProgress_(status.current);\r\n _this.needToFetchStatus_ = false;\r\n if (status.finalized) {\r\n _this.needToFetchMetadata_ = true;\r\n }\r\n _this.completeTransitions_();\r\n }, _this.errorHandler_);\r\n });\r\n };\r\n UploadTask.prototype.continueUpload_ = function () {\r\n var _this = this;\r\n var chunkSize = resumableUploadChunkSize * this.chunkMultiplier_;\r\n var status = new ResumableUploadStatus(this.transferred_, this.blob_.size());\r\n // TODO(andysoto): assert(this.uploadUrl_ !== null);\r\n var url = this.uploadUrl_;\r\n this.resolveToken_(function (authToken) {\r\n var requestInfo;\r\n try {\r\n requestInfo = continueResumableUpload(_this.location_, _this.service_, url, _this.blob_, chunkSize, _this.mappings_, status, _this.makeProgressCallback_());\r\n }\r\n catch (e) {\r\n _this.error_ = e;\r\n _this.transition_(InternalTaskState.ERROR);\r\n return;\r\n }\r\n var uploadRequest = _this.service_.makeRequest(requestInfo, authToken);\r\n _this.request_ = uploadRequest;\r\n uploadRequest\r\n .getPromise()\r\n .then(function (newStatus) {\r\n _this.increaseMultiplier_();\r\n _this.request_ = null;\r\n _this.updateProgress_(newStatus.current);\r\n if (newStatus.finalized) {\r\n _this.metadata_ = newStatus.metadata;\r\n _this.transition_(InternalTaskState.SUCCESS);\r\n }\r\n else {\r\n _this.completeTransitions_();\r\n }\r\n }, _this.errorHandler_);\r\n });\r\n };\r\n UploadTask.prototype.increaseMultiplier_ = function () {\r\n var currentSize = resumableUploadChunkSize * this.chunkMultiplier_;\r\n // Max chunk size is 32M.\r\n if (currentSize < 32 * 1024 * 1024) {\r\n this.chunkMultiplier_ *= 2;\r\n }\r\n };\r\n UploadTask.prototype.fetchMetadata_ = function () {\r\n var _this = this;\r\n this.resolveToken_(function (authToken) {\r\n var requestInfo = getMetadata(_this.service_, _this.location_, _this.mappings_);\r\n var metadataRequest = _this.service_.makeRequest(requestInfo, authToken);\r\n _this.request_ = metadataRequest;\r\n metadataRequest.getPromise().then(function (metadata) {\r\n _this.request_ = null;\r\n _this.metadata_ = metadata;\r\n _this.transition_(InternalTaskState.SUCCESS);\r\n }, _this.metadataErrorHandler_);\r\n });\r\n };\r\n UploadTask.prototype.oneShotUpload_ = function () {\r\n var _this = this;\r\n this.resolveToken_(function (authToken) {\r\n var requestInfo = multipartUpload(_this.service_, _this.location_, _this.mappings_, _this.blob_, _this.metadata_);\r\n var multipartRequest = _this.service_.makeRequest(requestInfo, authToken);\r\n _this.request_ = multipartRequest;\r\n multipartRequest.getPromise().then(function (metadata) {\r\n _this.request_ = null;\r\n _this.metadata_ = metadata;\r\n _this.updateProgress_(_this.blob_.size());\r\n _this.transition_(InternalTaskState.SUCCESS);\r\n }, _this.errorHandler_);\r\n });\r\n };\r\n UploadTask.prototype.updateProgress_ = function (transferred) {\r\n var old = this.transferred_;\r\n this.transferred_ = transferred;\r\n // A progress update can make the \"transferred\" value smaller (e.g. a\r\n // partial upload not completed by server, after which the \"transferred\"\r\n // value may reset to the value at the beginning of the request).\r\n if (this.transferred_ !== old) {\r\n this.notifyObservers_();\r\n }\r\n };\r\n UploadTask.prototype.transition_ = function (state) {\r\n if (this.state_ === state) {\r\n return;\r\n }\r\n switch (state) {\r\n case InternalTaskState.CANCELING:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.RUNNING ||\r\n // this.state_ === InternalTaskState.PAUSING);\r\n this.state_ = state;\r\n if (this.request_ !== null) {\r\n this.request_.cancel();\r\n }\r\n break;\r\n case InternalTaskState.PAUSING:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.RUNNING);\r\n this.state_ = state;\r\n if (this.request_ !== null) {\r\n this.request_.cancel();\r\n }\r\n break;\r\n case InternalTaskState.RUNNING:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.PAUSED ||\r\n // this.state_ === InternalTaskState.PAUSING);\r\n var wasPaused = this.state_ === InternalTaskState.PAUSED;\r\n this.state_ = state;\r\n if (wasPaused) {\r\n this.notifyObservers_();\r\n this.start_();\r\n }\r\n break;\r\n case InternalTaskState.PAUSED:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.PAUSING);\r\n this.state_ = state;\r\n this.notifyObservers_();\r\n break;\r\n case InternalTaskState.CANCELED:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.PAUSED ||\r\n // this.state_ === InternalTaskState.CANCELING);\r\n this.error_ = canceled();\r\n this.state_ = state;\r\n this.notifyObservers_();\r\n break;\r\n case InternalTaskState.ERROR:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.RUNNING ||\r\n // this.state_ === InternalTaskState.PAUSING ||\r\n // this.state_ === InternalTaskState.CANCELING);\r\n this.state_ = state;\r\n this.notifyObservers_();\r\n break;\r\n case InternalTaskState.SUCCESS:\r\n // TODO(andysoto):\r\n // assert(this.state_ === InternalTaskState.RUNNING ||\r\n // this.state_ === InternalTaskState.PAUSING ||\r\n // this.state_ === InternalTaskState.CANCELING);\r\n this.state_ = state;\r\n this.notifyObservers_();\r\n break;\r\n }\r\n };\r\n UploadTask.prototype.completeTransitions_ = function () {\r\n switch (this.state_) {\r\n case InternalTaskState.PAUSING:\r\n this.transition_(InternalTaskState.PAUSED);\r\n break;\r\n case InternalTaskState.CANCELING:\r\n this.transition_(InternalTaskState.CANCELED);\r\n break;\r\n case InternalTaskState.RUNNING:\r\n this.start_();\r\n break;\r\n }\r\n };\r\n Object.defineProperty(UploadTask.prototype, \"snapshot\", {\r\n get: function () {\r\n var externalState = taskStateFromInternalTaskState(this.state_);\r\n return new UploadTaskSnapshot(this.transferred_, this.blob_.size(), externalState, this.metadata_, this, this.ref_);\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Adds a callback for an event.\r\n * @param type The type of event to listen for.\r\n */\r\n UploadTask.prototype.on = function (type, nextOrObserver, error, completed) {\r\n var _this = this;\r\n var observer = new Observer(nextOrObserver, error, completed);\r\n this.addObserver_(observer);\r\n return function () {\r\n _this.removeObserver_(observer);\r\n };\r\n };\r\n /**\r\n * This object behaves like a Promise, and resolves with its snapshot data\r\n * when the upload completes.\r\n * @param onFulfilled The fulfillment callback. Promise chaining works as normal.\r\n * @param onRejected The rejection callback.\r\n */\r\n UploadTask.prototype.then = function (onFulfilled, onRejected) {\r\n // These casts are needed so that TypeScript can infer the types of the\r\n // resulting Promise.\r\n return this.promise_.then(onFulfilled, onRejected);\r\n };\r\n /**\r\n * Equivalent to calling `then(null, onRejected)`.\r\n */\r\n UploadTask.prototype.catch = function (onRejected) {\r\n return this.then(null, onRejected);\r\n };\r\n /**\r\n * Adds the given observer.\r\n */\r\n UploadTask.prototype.addObserver_ = function (observer) {\r\n this.observers_.push(observer);\r\n this.notifyObserver_(observer);\r\n };\r\n /**\r\n * Removes the given observer.\r\n */\r\n UploadTask.prototype.removeObserver_ = function (observer) {\r\n var i = this.observers_.indexOf(observer);\r\n if (i !== -1) {\r\n this.observers_.splice(i, 1);\r\n }\r\n };\r\n UploadTask.prototype.notifyObservers_ = function () {\r\n var _this = this;\r\n this.finishPromise_();\r\n var observers = this.observers_.slice();\r\n observers.forEach(function (observer) {\r\n _this.notifyObserver_(observer);\r\n });\r\n };\r\n UploadTask.prototype.finishPromise_ = function () {\r\n if (this.resolve_ !== null) {\r\n var triggered = true;\r\n switch (taskStateFromInternalTaskState(this.state_)) {\r\n case TaskState.SUCCESS:\r\n async(this.resolve_.bind(null, this.snapshot))();\r\n break;\r\n case TaskState.CANCELED:\r\n case TaskState.ERROR:\r\n var toCall = this.reject_;\r\n async(toCall.bind(null, this.error_))();\r\n break;\r\n default:\r\n triggered = false;\r\n break;\r\n }\r\n if (triggered) {\r\n this.resolve_ = null;\r\n this.reject_ = null;\r\n }\r\n }\r\n };\r\n UploadTask.prototype.notifyObserver_ = function (observer) {\r\n var externalState = taskStateFromInternalTaskState(this.state_);\r\n switch (externalState) {\r\n case TaskState.RUNNING:\r\n case TaskState.PAUSED:\r\n if (observer.next) {\r\n async(observer.next.bind(observer, this.snapshot))();\r\n }\r\n break;\r\n case TaskState.SUCCESS:\r\n if (observer.complete) {\r\n async(observer.complete.bind(observer))();\r\n }\r\n break;\r\n case TaskState.CANCELED:\r\n case TaskState.ERROR:\r\n if (observer.error) {\r\n async(observer.error.bind(observer, this.error_))();\r\n }\r\n break;\r\n default:\r\n // TODO(andysoto): assert(false);\r\n if (observer.error) {\r\n async(observer.error.bind(observer, this.error_))();\r\n }\r\n }\r\n };\r\n /**\r\n * Resumes a paused task. Has no effect on a currently running or failed task.\r\n * @return True if the operation took effect, false if ignored.\r\n */\r\n UploadTask.prototype.resume = function () {\r\n var valid = this.state_ === InternalTaskState.PAUSED ||\r\n this.state_ === InternalTaskState.PAUSING;\r\n if (valid) {\r\n this.transition_(InternalTaskState.RUNNING);\r\n }\r\n return valid;\r\n };\r\n /**\r\n * Pauses a currently running task. Has no effect on a paused or failed task.\r\n * @return True if the operation took effect, false if ignored.\r\n */\r\n UploadTask.prototype.pause = function () {\r\n var valid = this.state_ === InternalTaskState.RUNNING;\r\n if (valid) {\r\n this.transition_(InternalTaskState.PAUSING);\r\n }\r\n return valid;\r\n };\r\n /**\r\n * Cancels a currently running or paused task. Has no effect on a complete or\r\n * failed task.\r\n * @return True if the operation took effect, false if ignored.\r\n */\r\n UploadTask.prototype.cancel = function () {\r\n var valid = this.state_ === InternalTaskState.RUNNING ||\r\n this.state_ === InternalTaskState.PAUSING;\r\n if (valid) {\r\n this.transition_(InternalTaskState.CANCELING);\r\n }\r\n return valid;\r\n };\r\n return UploadTask;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Provides methods to interact with a bucket in the Firebase Storage service.\r\n * @param location An fbs.location, or the URL at\r\n * which to base this object, in one of the following forms:\r\n * gs://<bucket>/<object-path>\r\n * http[s]://firebasestorage.googleapis.com/\r\n * <api-version>/b/<bucket>/o/<object-path>\r\n * Any query or fragment strings will be ignored in the http[s]\r\n * format. If no value is passed, the storage object will use a URL based on\r\n * the project ID of the base firebase.App instance.\r\n */\r\nvar Reference = /** @class */ (function () {\r\n function Reference(service, location) {\r\n this.service = service;\r\n if (location instanceof Location) {\r\n this.location = location;\r\n }\r\n else {\r\n this.location = Location.makeFromUrl(location);\r\n }\r\n }\r\n /**\r\n * @return The URL for the bucket and path this object references,\r\n * in the form gs://<bucket>/<object-path>\r\n * @override\r\n */\r\n Reference.prototype.toString = function () {\r\n return 'gs://' + this.location.bucket + '/' + this.location.path;\r\n };\r\n Reference.prototype.newRef = function (service, location) {\r\n return new Reference(service, location);\r\n };\r\n Reference.prototype.mappings = function () {\r\n return getMappings();\r\n };\r\n /**\r\n * @return A reference to the object obtained by\r\n * appending childPath, removing any duplicate, beginning, or trailing\r\n * slashes.\r\n */\r\n Reference.prototype.child = function (childPath) {\r\n var newPath = child(this.location.path, childPath);\r\n var location = new Location(this.location.bucket, newPath);\r\n return this.newRef(this.service, location);\r\n };\r\n Object.defineProperty(Reference.prototype, \"parent\", {\r\n /**\r\n * @return A reference to the parent of the\r\n * current object, or null if the current object is the root.\r\n */\r\n get: function () {\r\n var newPath = parent(this.location.path);\r\n if (newPath === null) {\r\n return null;\r\n }\r\n var location = new Location(this.location.bucket, newPath);\r\n return this.newRef(this.service, location);\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Reference.prototype, \"root\", {\r\n /**\r\n * @return An reference to the root of this\r\n * object's bucket.\r\n */\r\n get: function () {\r\n var location = new Location(this.location.bucket, '');\r\n return this.newRef(this.service, location);\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Reference.prototype, \"bucket\", {\r\n get: function () {\r\n return this.location.bucket;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Reference.prototype, \"fullPath\", {\r\n get: function () {\r\n return this.location.path;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Reference.prototype, \"name\", {\r\n get: function () {\r\n return lastComponent(this.location.path);\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Reference.prototype, \"storage\", {\r\n get: function () {\r\n return this.service;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Uploads a blob to this object's location.\r\n * @param data The blob to upload.\r\n * @return An UploadTask that lets you control and\r\n * observe the upload.\r\n */\r\n Reference.prototype.put = function (data, metadata) {\r\n if (metadata === void 0) { metadata = null; }\r\n this.throwIfRoot_('put');\r\n return new UploadTask(this, this.service, this.location, this.mappings(), new FbsBlob(data), metadata);\r\n };\r\n /**\r\n * Uploads a string to this object's location.\r\n * @param value The string to upload.\r\n * @param format The format of the string to upload.\r\n * @return An UploadTask that lets you control and\r\n * observe the upload.\r\n */\r\n Reference.prototype.putString = function (value, format, metadata) {\r\n if (format === void 0) { format = StringFormat.RAW; }\r\n this.throwIfRoot_('putString');\r\n var data = dataFromString(format, value);\r\n var metadataClone = Object.assign({}, metadata);\r\n if (!isDef(metadataClone['contentType']) &&\r\n isDef(data.contentType)) {\r\n metadataClone['contentType'] = data.contentType;\r\n }\r\n return new UploadTask(this, this.service, this.location, this.mappings(), new FbsBlob(data.data, true), metadataClone);\r\n };\r\n /**\r\n * Deletes the object at this location.\r\n * @return A promise that resolves if the deletion succeeds.\r\n */\r\n Reference.prototype.delete = function () {\r\n var _this = this;\r\n this.throwIfRoot_('delete');\r\n return this.service.getAuthToken().then(function (authToken) {\r\n var requestInfo = deleteObject(_this.service, _this.location);\r\n return _this.service.makeRequest(requestInfo, authToken).getPromise();\r\n });\r\n };\r\n /**\r\n * List all items (files) and prefixes (folders) under this storage reference.\r\n *\r\n * This is a helper method for calling list() repeatedly until there are\r\n * no more results. The default pagination size is 1000.\r\n *\r\n * Note: The results may not be consistent if objects are changed while this\r\n * operation is running.\r\n *\r\n * Warning: listAll may potentially consume too many resources if there are\r\n * too many results.\r\n *\r\n * @return A Promise that resolves with all the items and prefixes under\r\n * the current storage reference. `prefixes` contains references to\r\n * sub-directories and `items` contains references to objects in this\r\n * folder. `nextPageToken` is never returned.\r\n */\r\n Reference.prototype.listAll = function () {\r\n var accumulator = {\r\n prefixes: [],\r\n items: []\r\n };\r\n return this.listAllHelper(accumulator).then(function () { return accumulator; });\r\n };\r\n Reference.prototype.listAllHelper = function (accumulator, pageToken) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var opt, nextPage;\r\n var _a, _b;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n opt = {\r\n // maxResults is 1000 by default.\r\n pageToken: pageToken\r\n };\r\n return [4 /*yield*/, this.list(opt)];\r\n case 1:\r\n nextPage = _c.sent();\r\n (_a = accumulator.prefixes).push.apply(_a, nextPage.prefixes);\r\n (_b = accumulator.items).push.apply(_b, nextPage.items);\r\n if (!(nextPage.nextPageToken != null)) return [3 /*break*/, 3];\r\n return [4 /*yield*/, this.listAllHelper(accumulator, nextPage.nextPageToken)];\r\n case 2:\r\n _c.sent();\r\n _c.label = 3;\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * List items (files) and prefixes (folders) under this storage reference.\r\n *\r\n * List API is only available for Firebase Rules Version 2.\r\n *\r\n * GCS is a key-blob store. Firebase Storage imposes the semantic of '/'\r\n * delimited folder structure.\r\n * Refer to GCS's List API if you want to learn more.\r\n *\r\n * To adhere to Firebase Rules's Semantics, Firebase Storage does not\r\n * support objects whose paths end with \"/\" or contain two consecutive\r\n * \"/\"s. Firebase Storage List API will filter these unsupported objects.\r\n * list() may fail if there are too many unsupported objects in the bucket.\r\n *\r\n * @param options See ListOptions for details.\r\n * @return A Promise that resolves with the items and prefixes.\r\n * `prefixes` contains references to sub-folders and `items`\r\n * contains references to objects in this folder. `nextPageToken`\r\n * can be used to get the rest of the results.\r\n */\r\n Reference.prototype.list = function (options) {\r\n var _this = this;\r\n var op = options || {};\r\n if (typeof op.maxResults === 'number') {\r\n validateNumber('options.maxResults', \r\n /* minValue= */ 1, \r\n /* maxValue= */ 1000, op.maxResults);\r\n }\r\n return this.service.getAuthToken().then(function (authToken) {\r\n var requestInfo = list(_this.service, _this.location, \r\n /*delimiter= */ '/', op.pageToken, op.maxResults);\r\n return _this.service.makeRequest(requestInfo, authToken).getPromise();\r\n });\r\n };\r\n /**\r\n * A promise that resolves with the metadata for this object. If this\r\n * object doesn't exist or metadata cannot be retreived, the promise is\r\n * rejected.\r\n */\r\n Reference.prototype.getMetadata = function () {\r\n var _this = this;\r\n this.throwIfRoot_('getMetadata');\r\n return this.service.getAuthToken().then(function (authToken) {\r\n var requestInfo = getMetadata(_this.service, _this.location, _this.mappings());\r\n return _this.service.makeRequest(requestInfo, authToken).getPromise();\r\n });\r\n };\r\n /**\r\n * Updates the metadata for this object.\r\n * @param metadata The new metadata for the object.\r\n * Only values that have been explicitly set will be changed. Explicitly\r\n * setting a value to null will remove the metadata.\r\n * @return A promise that resolves\r\n * with the new metadata for this object.\r\n * @see firebaseStorage.Reference.prototype.getMetadata\r\n */\r\n Reference.prototype.updateMetadata = function (metadata) {\r\n var _this = this;\r\n this.throwIfRoot_('updateMetadata');\r\n return this.service.getAuthToken().then(function (authToken) {\r\n var requestInfo = updateMetadata(_this.service, _this.location, metadata, _this.mappings());\r\n return _this.service.makeRequest(requestInfo, authToken).getPromise();\r\n });\r\n };\r\n /**\r\n * @return A promise that resolves with the download\r\n * URL for this object.\r\n */\r\n Reference.prototype.getDownloadURL = function () {\r\n var _this = this;\r\n this.throwIfRoot_('getDownloadURL');\r\n return this.service.getAuthToken().then(function (authToken) {\r\n var requestInfo = getDownloadUrl(_this.service, _this.location, _this.mappings());\r\n return _this.service\r\n .makeRequest(requestInfo, authToken)\r\n .getPromise()\r\n .then(function (url) {\r\n if (url === null) {\r\n throw noDownloadURL();\r\n }\r\n return url;\r\n });\r\n });\r\n };\r\n Reference.prototype.throwIfRoot_ = function (name) {\r\n if (this.location.path === '') {\r\n throw invalidRootOperation(name);\r\n }\r\n };\r\n return Reference;\r\n}());\n\n/**\r\n * A request whose promise always fails.\r\n * @struct\r\n * @template T\r\n */\r\nvar FailRequest = /** @class */ (function () {\r\n function FailRequest(error) {\r\n this.promise_ = Promise.reject(error);\r\n }\r\n /** @inheritDoc */\r\n FailRequest.prototype.getPromise = function () {\r\n return this.promise_;\r\n };\r\n /** @inheritDoc */\r\n FailRequest.prototype.cancel = function (_appDelete) {\r\n };\r\n return FailRequest;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @param f May be invoked\r\n * before the function returns.\r\n * @param callback Get all the arguments passed to the function\r\n * passed to f, including the initial boolean.\r\n */\r\nfunction start(f, \r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\ncallback, timeout) {\r\n // TODO(andysoto): make this code cleaner (probably refactor into an actual\r\n // type instead of a bunch of functions with state shared in the closure)\r\n var waitSeconds = 1;\r\n // Would type this as \"number\" but that doesn't work for Node so ¯\\_(ツ)_/¯\r\n // TODO: find a way to exclude Node type definition for storage because storage only works in browser\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n var timeoutId = null;\r\n var hitTimeout = false;\r\n var cancelState = 0;\r\n function canceled() {\r\n return cancelState === 2;\r\n }\r\n var triggeredCallback = false;\r\n // TODO: This disable can be removed and the 'ignoreRestArgs' option added to\r\n // the no-explicit-any rule when ESlint releases it.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n function triggerCallback() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (!triggeredCallback) {\r\n triggeredCallback = true;\r\n callback.apply(null, args);\r\n }\r\n }\r\n function callWithDelay(millis) {\r\n timeoutId = setTimeout(function () {\r\n timeoutId = null;\r\n f(handler, canceled());\r\n }, millis);\r\n }\r\n // TODO: This disable can be removed and the 'ignoreRestArgs' option added to\r\n // the no-explicit-any rule when ESlint releases it.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n function handler(success) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n if (triggeredCallback) {\r\n return;\r\n }\r\n if (success) {\r\n triggerCallback.call.apply(triggerCallback, __spreadArrays([null, success], args));\r\n return;\r\n }\r\n var mustStop = canceled() || hitTimeout;\r\n if (mustStop) {\r\n triggerCallback.call.apply(triggerCallback, __spreadArrays([null, success], args));\r\n return;\r\n }\r\n if (waitSeconds < 64) {\r\n /* TODO(andysoto): don't back off so quickly if we know we're offline. */\r\n waitSeconds *= 2;\r\n }\r\n var waitMillis;\r\n if (cancelState === 1) {\r\n cancelState = 2;\r\n waitMillis = 0;\r\n }\r\n else {\r\n waitMillis = (waitSeconds + Math.random()) * 1000;\r\n }\r\n callWithDelay(waitMillis);\r\n }\r\n var stopped = false;\r\n function stop(wasTimeout) {\r\n if (stopped) {\r\n return;\r\n }\r\n stopped = true;\r\n if (triggeredCallback) {\r\n return;\r\n }\r\n if (timeoutId !== null) {\r\n if (!wasTimeout) {\r\n cancelState = 2;\r\n }\r\n clearTimeout(timeoutId);\r\n callWithDelay(0);\r\n }\r\n else {\r\n if (!wasTimeout) {\r\n cancelState = 1;\r\n }\r\n }\r\n }\r\n callWithDelay(0);\r\n setTimeout(function () {\r\n hitTimeout = true;\r\n stop(true);\r\n }, timeout);\r\n return stop;\r\n}\r\n/**\r\n * Stops the retry loop from repeating.\r\n * If the function is currently \"in between\" retries, it is invoked immediately\r\n * with the second parameter as \"true\". Otherwise, it will be invoked once more\r\n * after the current invocation finishes iff the current invocation would have\r\n * triggered another retry.\r\n */\r\nfunction stop(id) {\r\n id(false);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @struct\r\n * @template T\r\n */\r\nvar NetworkRequest = /** @class */ (function () {\r\n function NetworkRequest(url, method, headers, body, successCodes, additionalRetryCodes, callback, errorCallback, timeout, progressCallback, pool) {\r\n var _this = this;\r\n this.pendingXhr_ = null;\r\n this.backoffId_ = null;\r\n this.canceled_ = false;\r\n this.appDelete_ = false;\r\n this.url_ = url;\r\n this.method_ = method;\r\n this.headers_ = headers;\r\n this.body_ = body;\r\n this.successCodes_ = successCodes.slice();\r\n this.additionalRetryCodes_ = additionalRetryCodes.slice();\r\n this.callback_ = callback;\r\n this.errorCallback_ = errorCallback;\r\n this.progressCallback_ = progressCallback;\r\n this.timeout_ = timeout;\r\n this.pool_ = pool;\r\n this.promise_ = new Promise(function (resolve, reject) {\r\n _this.resolve_ = resolve;\r\n _this.reject_ = reject;\r\n _this.start_();\r\n });\r\n }\r\n /**\r\n * Actually starts the retry loop.\r\n */\r\n NetworkRequest.prototype.start_ = function () {\r\n var self = this;\r\n function doTheRequest(backoffCallback, canceled) {\r\n if (canceled) {\r\n backoffCallback(false, new RequestEndStatus(false, null, true));\r\n return;\r\n }\r\n var xhr = self.pool_.createXhrIo();\r\n self.pendingXhr_ = xhr;\r\n function progressListener(progressEvent) {\r\n var loaded = progressEvent.loaded;\r\n var total = progressEvent.lengthComputable ? progressEvent.total : -1;\r\n if (self.progressCallback_ !== null) {\r\n self.progressCallback_(loaded, total);\r\n }\r\n }\r\n if (self.progressCallback_ !== null) {\r\n xhr.addUploadProgressListener(progressListener);\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n xhr\r\n .send(self.url_, self.method_, self.body_, self.headers_)\r\n .then(function (xhr) {\r\n if (self.progressCallback_ !== null) {\r\n xhr.removeUploadProgressListener(progressListener);\r\n }\r\n self.pendingXhr_ = null;\r\n xhr = xhr;\r\n var hitServer = xhr.getErrorCode() === ErrorCode.NO_ERROR;\r\n var status = xhr.getStatus();\r\n if (!hitServer || self.isRetryStatusCode_(status)) {\r\n var wasCanceled = xhr.getErrorCode() === ErrorCode.ABORT;\r\n backoffCallback(false, new RequestEndStatus(false, null, wasCanceled));\r\n return;\r\n }\r\n var successCode = self.successCodes_.indexOf(status) !== -1;\r\n backoffCallback(true, new RequestEndStatus(successCode, xhr));\r\n });\r\n }\r\n /**\r\n * @param requestWentThrough True if the request eventually went\r\n * through, false if it hit the retry limit or was canceled.\r\n */\r\n function backoffDone(requestWentThrough, status) {\r\n var resolve = self.resolve_;\r\n var reject = self.reject_;\r\n var xhr = status.xhr;\r\n if (status.wasSuccessCode) {\r\n try {\r\n var result = self.callback_(xhr, xhr.getResponseText());\r\n if (isJustDef(result)) {\r\n resolve(result);\r\n }\r\n else {\r\n resolve();\r\n }\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n }\r\n else {\r\n if (xhr !== null) {\r\n var err = unknown();\r\n err.serverResponse = xhr.getResponseText();\r\n if (self.errorCallback_) {\r\n reject(self.errorCallback_(xhr, err));\r\n }\r\n else {\r\n reject(err);\r\n }\r\n }\r\n else {\r\n if (status.canceled) {\r\n var err = self.appDelete_ ? appDeleted() : canceled();\r\n reject(err);\r\n }\r\n else {\r\n var err = retryLimitExceeded();\r\n reject(err);\r\n }\r\n }\r\n }\r\n }\r\n if (this.canceled_) {\r\n backoffDone(false, new RequestEndStatus(false, null, true));\r\n }\r\n else {\r\n this.backoffId_ = start(doTheRequest, backoffDone, this.timeout_);\r\n }\r\n };\r\n /** @inheritDoc */\r\n NetworkRequest.prototype.getPromise = function () {\r\n return this.promise_;\r\n };\r\n /** @inheritDoc */\r\n NetworkRequest.prototype.cancel = function (appDelete) {\r\n this.canceled_ = true;\r\n this.appDelete_ = appDelete || false;\r\n if (this.backoffId_ !== null) {\r\n stop(this.backoffId_);\r\n }\r\n if (this.pendingXhr_ !== null) {\r\n this.pendingXhr_.abort();\r\n }\r\n };\r\n NetworkRequest.prototype.isRetryStatusCode_ = function (status) {\r\n // The codes for which to retry came from this page:\r\n // https://cloud.google.com/storage/docs/exponential-backoff\r\n var isFiveHundredCode = status >= 500 && status < 600;\r\n var extraRetryCodes = [\r\n // Request Timeout: web server didn't receive full request in time.\r\n 408,\r\n // Too Many Requests: you're getting rate-limited, basically.\r\n 429\r\n ];\r\n var isExtraRetryCode = extraRetryCodes.indexOf(status) !== -1;\r\n var isRequestSpecificRetryCode = this.additionalRetryCodes_.indexOf(status) !== -1;\r\n return isFiveHundredCode || isExtraRetryCode || isRequestSpecificRetryCode;\r\n };\r\n return NetworkRequest;\r\n}());\r\n/**\r\n * A collection of information about the result of a network request.\r\n * @param opt_canceled Defaults to false.\r\n * @struct\r\n */\r\nvar RequestEndStatus = /** @class */ (function () {\r\n function RequestEndStatus(wasSuccessCode, xhr, canceled) {\r\n this.wasSuccessCode = wasSuccessCode;\r\n this.xhr = xhr;\r\n this.canceled = !!canceled;\r\n }\r\n return RequestEndStatus;\r\n}());\r\nfunction addAuthHeader_(headers, authToken) {\r\n if (authToken !== null && authToken.length > 0) {\r\n headers['Authorization'] = 'Firebase ' + authToken;\r\n }\r\n}\r\nfunction addVersionHeader_(headers) {\r\n var version = typeof firebase !== 'undefined' ? firebase.SDK_VERSION : 'AppManager';\r\n headers['X-Firebase-Storage-Version'] = 'webjs/' + version;\r\n}\r\nfunction addGmpidHeader_(headers, appId) {\r\n if (appId) {\r\n headers['X-Firebase-GMPID'] = appId;\r\n }\r\n}\r\n/**\r\n * @template T\r\n */\r\nfunction makeRequest(requestInfo, appId, authToken, pool) {\r\n var queryPart = makeQueryString(requestInfo.urlParams);\r\n var url = requestInfo.url + queryPart;\r\n var headers = Object.assign({}, requestInfo.headers);\r\n addGmpidHeader_(headers, appId);\r\n addAuthHeader_(headers, authToken);\r\n addVersionHeader_(headers);\r\n return new NetworkRequest(url, requestInfo.method, headers, requestInfo.body, requestInfo.successCodes, requestInfo.additionalRetryCodes, requestInfo.handler, requestInfo.errorHandler, requestInfo.timeout, requestInfo.progressCallback, pool);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A service that provides firebaseStorage.Reference instances.\r\n * @param opt_url gs:// url to a custom Storage Bucket\r\n *\r\n * @struct\r\n */\r\nvar StorageService = /** @class */ (function () {\r\n function StorageService(app, authProvider, pool, url) {\r\n var _a;\r\n this.bucket_ = null;\r\n this.appId_ = null;\r\n this.deleted_ = false;\r\n this.app_ = app;\r\n this.authProvider_ = authProvider;\r\n this.maxOperationRetryTime_ = DEFAULT_MAX_OPERATION_RETRY_TIME;\r\n this.maxUploadRetryTime_ = DEFAULT_MAX_UPLOAD_RETRY_TIME;\r\n this.requests_ = new Set();\r\n this.pool_ = pool;\r\n if (url != null) {\r\n this.bucket_ = Location.makeFromBucketSpec(url);\r\n }\r\n else {\r\n this.bucket_ = StorageService.extractBucket_((_a = this.app_) === null || _a === void 0 ? void 0 : _a.options);\r\n }\r\n this.internals_ = new ServiceInternals(this);\r\n }\r\n StorageService.extractBucket_ = function (config) {\r\n var bucketString = config === null || config === void 0 ? void 0 : config[CONFIG_STORAGE_BUCKET_KEY];\r\n if (bucketString == null) {\r\n return null;\r\n }\r\n return Location.makeFromBucketSpec(bucketString);\r\n };\r\n StorageService.prototype.getAuthToken = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var auth, tokenData;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n auth = this.authProvider_.getImmediate({ optional: true });\r\n if (!auth) return [3 /*break*/, 2];\r\n return [4 /*yield*/, auth.getToken()];\r\n case 1:\r\n tokenData = _a.sent();\r\n if (tokenData !== null) {\r\n return [2 /*return*/, tokenData.accessToken];\r\n }\r\n _a.label = 2;\r\n case 2: return [2 /*return*/, null];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Stop running requests and prevent more from being created.\r\n */\r\n StorageService.prototype.deleteApp = function () {\r\n this.deleted_ = true;\r\n this.app_ = null;\r\n this.requests_.forEach(function (request) { return request.cancel(); });\r\n this.requests_.clear();\r\n };\r\n /**\r\n * Returns a new firebaseStorage.Reference object referencing this StorageService\r\n * at the given Location.\r\n * @param loc The Location.\r\n * @return A firebaseStorage.Reference.\r\n */\r\n StorageService.prototype.makeStorageReference = function (loc) {\r\n return new Reference(this, loc);\r\n };\r\n StorageService.prototype.makeRequest = function (requestInfo, authToken) {\r\n var _this = this;\r\n if (!this.deleted_) {\r\n var request_1 = makeRequest(requestInfo, this.appId_, authToken, this.pool_);\r\n this.requests_.add(request_1);\r\n // Request removes itself from set when complete.\r\n request_1.getPromise().then(function () { return _this.requests_.delete(request_1); }, function () { return _this.requests_.delete(request_1); });\r\n return request_1;\r\n }\r\n else {\r\n return new FailRequest(appDeleted());\r\n }\r\n };\r\n /**\r\n * Returns a firebaseStorage.Reference for the given path in the default\r\n * bucket.\r\n */\r\n StorageService.prototype.ref = function (path) {\r\n if (/^[A-Za-z]+:\\/\\//.test(path)) {\r\n throw new FirebaseStorageError(Code.INVALID_ARGUMENT, 'Expected child path but got a URL, use refFromURL instead.');\r\n }\r\n if (this.bucket_ == null) {\r\n throw new Error('No Storage Bucket defined in Firebase Options.');\r\n }\r\n var ref = new Reference(this, this.bucket_);\r\n if (path != null) {\r\n return ref.child(path);\r\n }\r\n else {\r\n return ref;\r\n }\r\n };\r\n /**\r\n * Returns a firebaseStorage.Reference object for the given absolute URL,\r\n * which must be a gs:// or http[s]:// URL.\r\n */\r\n StorageService.prototype.refFromURL = function (url) {\r\n if (!/^[A-Za-z]+:\\/\\//.test(url)) {\r\n throw new FirebaseStorageError(Code.INVALID_ARGUMENT, 'Expected full URL but got a child path, use ref instead.');\r\n }\r\n try {\r\n Location.makeFromUrl(url);\r\n }\r\n catch (e) {\r\n throw new FirebaseStorageError(Code.INVALID_ARGUMENT, 'Expected valid full URL but got an invalid one.');\r\n }\r\n return new Reference(this, url);\r\n };\r\n Object.defineProperty(StorageService.prototype, \"maxUploadRetryTime\", {\r\n get: function () {\r\n return this.maxUploadRetryTime_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n StorageService.prototype.setMaxUploadRetryTime = function (time) {\r\n validateNumber('time', \r\n /* minValue=*/ 0, \r\n /* maxValue= */ Number.POSITIVE_INFINITY, time);\r\n this.maxUploadRetryTime_ = time;\r\n };\r\n Object.defineProperty(StorageService.prototype, \"maxOperationRetryTime\", {\r\n get: function () {\r\n return this.maxOperationRetryTime_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n StorageService.prototype.setMaxOperationRetryTime = function (time) {\r\n validateNumber('time', \r\n /* minValue=*/ 0, \r\n /* maxValue= */ Number.POSITIVE_INFINITY, time);\r\n this.maxOperationRetryTime_ = time;\r\n };\r\n Object.defineProperty(StorageService.prototype, \"app\", {\r\n get: function () {\r\n return this.app_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(StorageService.prototype, \"INTERNAL\", {\r\n get: function () {\r\n return this.internals_;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return StorageService;\r\n}());\r\n/**\r\n * @struct\r\n */\r\nvar ServiceInternals = /** @class */ (function () {\r\n function ServiceInternals(service) {\r\n this.service_ = service;\r\n }\r\n /**\r\n * Called when the associated app is deleted.\r\n */\r\n ServiceInternals.prototype.delete = function () {\r\n this.service_.deleteApp();\r\n return Promise.resolve();\r\n };\r\n return ServiceInternals;\r\n}());\n\nvar name = \"@firebase/storage\";\nvar version = \"0.4.0\";\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Type constant for Firebase Storage.\r\n */\r\nvar STORAGE_TYPE = 'storage';\r\nfunction factory(container, url) {\r\n // Dependencies\r\n var app = container.getProvider('app').getImmediate();\r\n var authProvider = container.getProvider('auth-internal');\r\n return new StorageService(app, authProvider, new XhrIoPool(), url);\r\n}\r\nfunction registerStorage(instance) {\r\n var namespaceExports = {\r\n // no-inline\r\n TaskState: TaskState,\r\n TaskEvent: TaskEvent,\r\n StringFormat: StringFormat,\r\n Storage: StorageService,\r\n Reference: Reference\r\n };\r\n instance.INTERNAL.registerComponent(new Component(STORAGE_TYPE, factory, \"PUBLIC\" /* PUBLIC */)\r\n .setServiceProps(namespaceExports)\r\n .setMultipleInstances(true));\r\n instance.registerVersion(name, version);\r\n}\r\nregisterStorage(firebase);\n\nexport { registerStorage };\n//# sourceMappingURL=index.esm.js.map\n","import { __extends } from 'tslib';\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @fileoverview Firebase constants. Some of these (@defines) can be overridden at compile-time.\r\n */\r\nvar CONSTANTS = {\r\n /**\r\n * @define {boolean} Whether this is the client Node.js SDK.\r\n */\r\n NODE_CLIENT: false,\r\n /**\r\n * @define {boolean} Whether this is the Admin Node.js SDK.\r\n */\r\n NODE_ADMIN: false,\r\n /**\r\n * Firebase SDK Version\r\n */\r\n SDK_VERSION: '${JSCORE_VERSION}'\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Throws an error if the provided assertion is falsy\r\n */\r\nvar assert = function (assertion, message) {\r\n if (!assertion) {\r\n throw assertionError(message);\r\n }\r\n};\r\n/**\r\n * Returns an Error object suitable for throwing.\r\n */\r\nvar assertionError = function (message) {\r\n return new Error('Firebase Database (' +\r\n CONSTANTS.SDK_VERSION +\r\n ') INTERNAL ASSERT FAILED: ' +\r\n message);\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar stringToByteArray = function (str) {\r\n // TODO(user): Use native implementations if/when available\r\n var out = [];\r\n var p = 0;\r\n for (var i = 0; i < str.length; i++) {\r\n var c = str.charCodeAt(i);\r\n if (c < 128) {\r\n out[p++] = c;\r\n }\r\n else if (c < 2048) {\r\n out[p++] = (c >> 6) | 192;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n else if ((c & 0xfc00) === 0xd800 &&\r\n i + 1 < str.length &&\r\n (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\r\n // Surrogate Pair\r\n c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);\r\n out[p++] = (c >> 18) | 240;\r\n out[p++] = ((c >> 12) & 63) | 128;\r\n out[p++] = ((c >> 6) & 63) | 128;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n else {\r\n out[p++] = (c >> 12) | 224;\r\n out[p++] = ((c >> 6) & 63) | 128;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n }\r\n return out;\r\n};\r\n/**\r\n * Turns an array of numbers into the string given by the concatenation of the\r\n * characters to which the numbers correspond.\r\n * @param bytes Array of numbers representing characters.\r\n * @return Stringification of the array.\r\n */\r\nvar byteArrayToString = function (bytes) {\r\n // TODO(user): Use native implementations if/when available\r\n var out = [];\r\n var pos = 0, c = 0;\r\n while (pos < bytes.length) {\r\n var c1 = bytes[pos++];\r\n if (c1 < 128) {\r\n out[c++] = String.fromCharCode(c1);\r\n }\r\n else if (c1 > 191 && c1 < 224) {\r\n var c2 = bytes[pos++];\r\n out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\r\n }\r\n else if (c1 > 239 && c1 < 365) {\r\n // Surrogate Pair\r\n var c2 = bytes[pos++];\r\n var c3 = bytes[pos++];\r\n var c4 = bytes[pos++];\r\n var u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -\r\n 0x10000;\r\n out[c++] = String.fromCharCode(0xd800 + (u >> 10));\r\n out[c++] = String.fromCharCode(0xdc00 + (u & 1023));\r\n }\r\n else {\r\n var c2 = bytes[pos++];\r\n var c3 = bytes[pos++];\r\n out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\r\n }\r\n }\r\n return out.join('');\r\n};\r\n// We define it as an object literal instead of a class because a class compiled down to es5 can't\r\n// be treeshaked. https://github.com/rollup/rollup/issues/1691\r\n// Static lookup maps, lazily populated by init_()\r\nvar base64 = {\r\n /**\r\n * Maps bytes to characters.\r\n */\r\n byteToCharMap_: null,\r\n /**\r\n * Maps characters to bytes.\r\n */\r\n charToByteMap_: null,\r\n /**\r\n * Maps bytes to websafe characters.\r\n * @private\r\n */\r\n byteToCharMapWebSafe_: null,\r\n /**\r\n * Maps websafe characters to bytes.\r\n * @private\r\n */\r\n charToByteMapWebSafe_: null,\r\n /**\r\n * Our default alphabet, shared between\r\n * ENCODED_VALS and ENCODED_VALS_WEBSAFE\r\n */\r\n ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789',\r\n /**\r\n * Our default alphabet. Value 64 (=) is special; it means \"nothing.\"\r\n */\r\n get ENCODED_VALS() {\r\n return this.ENCODED_VALS_BASE + '+/=';\r\n },\r\n /**\r\n * Our websafe alphabet.\r\n */\r\n get ENCODED_VALS_WEBSAFE() {\r\n return this.ENCODED_VALS_BASE + '-_.';\r\n },\r\n /**\r\n * Whether this browser supports the atob and btoa functions. This extension\r\n * started at Mozilla but is now implemented by many browsers. We use the\r\n * ASSUME_* variables to avoid pulling in the full useragent detection library\r\n * but still allowing the standard per-browser compilations.\r\n *\r\n */\r\n HAS_NATIVE_SUPPORT: typeof atob === 'function',\r\n /**\r\n * Base64-encode an array of bytes.\r\n *\r\n * @param input An array of bytes (numbers with\r\n * value in [0, 255]) to encode.\r\n * @param webSafe Boolean indicating we should use the\r\n * alternative alphabet.\r\n * @return The base64 encoded string.\r\n */\r\n encodeByteArray: function (input, webSafe) {\r\n if (!Array.isArray(input)) {\r\n throw Error('encodeByteArray takes an array as a parameter');\r\n }\r\n this.init_();\r\n var byteToCharMap = webSafe\r\n ? this.byteToCharMapWebSafe_\r\n : this.byteToCharMap_;\r\n var output = [];\r\n for (var i = 0; i < input.length; i += 3) {\r\n var byte1 = input[i];\r\n var haveByte2 = i + 1 < input.length;\r\n var byte2 = haveByte2 ? input[i + 1] : 0;\r\n var haveByte3 = i + 2 < input.length;\r\n var byte3 = haveByte3 ? input[i + 2] : 0;\r\n var outByte1 = byte1 >> 2;\r\n var outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4);\r\n var outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6);\r\n var outByte4 = byte3 & 0x3f;\r\n if (!haveByte3) {\r\n outByte4 = 64;\r\n if (!haveByte2) {\r\n outByte3 = 64;\r\n }\r\n }\r\n output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]);\r\n }\r\n return output.join('');\r\n },\r\n /**\r\n * Base64-encode a string.\r\n *\r\n * @param input A string to encode.\r\n * @param webSafe If true, we should use the\r\n * alternative alphabet.\r\n * @return The base64 encoded string.\r\n */\r\n encodeString: function (input, webSafe) {\r\n // Shortcut for Mozilla browsers that implement\r\n // a native base64 encoder in the form of \"btoa/atob\"\r\n if (this.HAS_NATIVE_SUPPORT && !webSafe) {\r\n return btoa(input);\r\n }\r\n return this.encodeByteArray(stringToByteArray(input), webSafe);\r\n },\r\n /**\r\n * Base64-decode a string.\r\n *\r\n * @param input to decode.\r\n * @param webSafe True if we should use the\r\n * alternative alphabet.\r\n * @return string representing the decoded value.\r\n */\r\n decodeString: function (input, webSafe) {\r\n // Shortcut for Mozilla browsers that implement\r\n // a native base64 encoder in the form of \"btoa/atob\"\r\n if (this.HAS_NATIVE_SUPPORT && !webSafe) {\r\n return atob(input);\r\n }\r\n return byteArrayToString(this.decodeStringToByteArray(input, webSafe));\r\n },\r\n /**\r\n * Base64-decode a string.\r\n *\r\n * In base-64 decoding, groups of four characters are converted into three\r\n * bytes. If the encoder did not apply padding, the input length may not\r\n * be a multiple of 4.\r\n *\r\n * In this case, the last group will have fewer than 4 characters, and\r\n * padding will be inferred. If the group has one or two characters, it decodes\r\n * to one byte. If the group has three characters, it decodes to two bytes.\r\n *\r\n * @param input Input to decode.\r\n * @param webSafe True if we should use the web-safe alphabet.\r\n * @return bytes representing the decoded value.\r\n */\r\n decodeStringToByteArray: function (input, webSafe) {\r\n this.init_();\r\n var charToByteMap = webSafe\r\n ? this.charToByteMapWebSafe_\r\n : this.charToByteMap_;\r\n var output = [];\r\n for (var i = 0; i < input.length;) {\r\n var byte1 = charToByteMap[input.charAt(i++)];\r\n var haveByte2 = i < input.length;\r\n var byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;\r\n ++i;\r\n var haveByte3 = i < input.length;\r\n var byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;\r\n ++i;\r\n var haveByte4 = i < input.length;\r\n var byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;\r\n ++i;\r\n if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {\r\n throw Error();\r\n }\r\n var outByte1 = (byte1 << 2) | (byte2 >> 4);\r\n output.push(outByte1);\r\n if (byte3 !== 64) {\r\n var outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);\r\n output.push(outByte2);\r\n if (byte4 !== 64) {\r\n var outByte3 = ((byte3 << 6) & 0xc0) | byte4;\r\n output.push(outByte3);\r\n }\r\n }\r\n }\r\n return output;\r\n },\r\n /**\r\n * Lazy static initialization function. Called before\r\n * accessing any of the static map variables.\r\n * @private\r\n */\r\n init_: function () {\r\n if (!this.byteToCharMap_) {\r\n this.byteToCharMap_ = {};\r\n this.charToByteMap_ = {};\r\n this.byteToCharMapWebSafe_ = {};\r\n this.charToByteMapWebSafe_ = {};\r\n // We want quick mappings back and forth, so we precompute two maps.\r\n for (var i = 0; i < this.ENCODED_VALS.length; i++) {\r\n this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);\r\n this.charToByteMap_[this.byteToCharMap_[i]] = i;\r\n this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);\r\n this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;\r\n // Be forgiving when decoding and correctly decode both encodings.\r\n if (i >= this.ENCODED_VALS_BASE.length) {\r\n this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;\r\n this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;\r\n }\r\n }\r\n }\r\n }\r\n};\r\n/**\r\n * URL-safe base64 encoding\r\n */\r\nvar base64Encode = function (str) {\r\n var utf8Bytes = stringToByteArray(str);\r\n return base64.encodeByteArray(utf8Bytes, true);\r\n};\r\n/**\r\n * URL-safe base64 decoding\r\n *\r\n * NOTE: DO NOT use the global atob() function - it does NOT support the\r\n * base64Url variant encoding.\r\n *\r\n * @param str To be decoded\r\n * @return Decoded result, if possible\r\n */\r\nvar base64Decode = function (str) {\r\n try {\r\n return base64.decodeString(str, true);\r\n }\r\n catch (e) {\r\n console.error('base64Decode failed: ', e);\r\n }\r\n return null;\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Do a deep-copy of basic JavaScript Objects or Arrays.\r\n */\r\nfunction deepCopy(value) {\r\n return deepExtend(undefined, value);\r\n}\r\n/**\r\n * Copy properties from source to target (recursively allows extension\r\n * of Objects and Arrays). Scalar values in the target are over-written.\r\n * If target is undefined, an object of the appropriate type will be created\r\n * (and returned).\r\n *\r\n * We recursively copy all child properties of plain Objects in the source- so\r\n * that namespace- like dictionaries are merged.\r\n *\r\n * Note that the target can be a function, in which case the properties in\r\n * the source Object are copied onto it as static properties of the Function.\r\n */\r\nfunction deepExtend(target, source) {\r\n if (!(source instanceof Object)) {\r\n return source;\r\n }\r\n switch (source.constructor) {\r\n case Date:\r\n // Treat Dates like scalars; if the target date object had any child\r\n // properties - they will be lost!\r\n var dateValue = source;\r\n return new Date(dateValue.getTime());\r\n case Object:\r\n if (target === undefined) {\r\n target = {};\r\n }\r\n break;\r\n case Array:\r\n // Always copy the array source and overwrite the target.\r\n target = [];\r\n break;\r\n default:\r\n // Not a plain Object - treat it as a scalar.\r\n return source;\r\n }\r\n for (var prop in source) {\r\n if (!source.hasOwnProperty(prop)) {\r\n continue;\r\n }\r\n target[prop] = deepExtend(target[prop], source[prop]);\r\n }\r\n return target;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar Deferred = /** @class */ (function () {\r\n function Deferred() {\r\n var _this = this;\r\n this.reject = function () { };\r\n this.resolve = function () { };\r\n this.promise = new Promise(function (resolve, reject) {\r\n _this.resolve = resolve;\r\n _this.reject = reject;\r\n });\r\n }\r\n /**\r\n * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around\r\n * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback\r\n * and returns a node-style callback which will resolve or reject the Deferred's promise.\r\n */\r\n Deferred.prototype.wrapCallback = function (callback) {\r\n var _this = this;\r\n return function (error, value) {\r\n if (error) {\r\n _this.reject(error);\r\n }\r\n else {\r\n _this.resolve(value);\r\n }\r\n if (typeof callback === 'function') {\r\n // Attaching noop handler just in case developer wasn't expecting\r\n // promises\r\n _this.promise.catch(function () { });\r\n // Some of our callbacks don't expect a value and our own tests\r\n // assert that the parameter length is 1\r\n if (callback.length === 1) {\r\n callback(error);\r\n }\r\n else {\r\n callback(error, value);\r\n }\r\n }\r\n };\r\n };\r\n return Deferred;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns navigator.userAgent string or '' if it's not defined.\r\n * @return user agent string\r\n */\r\nfunction getUA() {\r\n if (typeof navigator !== 'undefined' &&\r\n typeof navigator['userAgent'] === 'string') {\r\n return navigator['userAgent'];\r\n }\r\n else {\r\n return '';\r\n }\r\n}\r\n/**\r\n * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.\r\n *\r\n * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap\r\n * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally\r\n * wait for a callback.\r\n */\r\nfunction isMobileCordova() {\r\n return (typeof window !== 'undefined' &&\r\n // @ts-ignore Setting up an broadly applicable index signature for Window\r\n // just to deal with this case would probably be a bad idea.\r\n !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&\r\n /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA()));\r\n}\r\n/**\r\n * Detect Node.js.\r\n *\r\n * @return true if Node.js environment is detected.\r\n */\r\n// Node detection logic from: https://github.com/iliakan/detect-node/\r\nfunction isNode() {\r\n try {\r\n return (Object.prototype.toString.call(global.process) === '[object process]');\r\n }\r\n catch (e) {\r\n return false;\r\n }\r\n}\r\n/**\r\n * Detect Browser Environment\r\n */\r\nfunction isBrowser() {\r\n return typeof self === 'object' && self.self === self;\r\n}\r\nfunction isBrowserExtension() {\r\n var runtime = typeof chrome === 'object'\r\n ? chrome.runtime\r\n : typeof browser === 'object'\r\n ? browser.runtime\r\n : undefined;\r\n return typeof runtime === 'object' && runtime.id !== undefined;\r\n}\r\n/**\r\n * Detect React Native.\r\n *\r\n * @return true if ReactNative environment is detected.\r\n */\r\nfunction isReactNative() {\r\n return (typeof navigator === 'object' && navigator['product'] === 'ReactNative');\r\n}\r\n/** Detects Electron apps. */\r\nfunction isElectron() {\r\n return getUA().indexOf('Electron/') >= 0;\r\n}\r\n/** Detects Internet Explorer. */\r\nfunction isIE() {\r\n var ua = getUA();\r\n return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;\r\n}\r\n/** Detects Universal Windows Platform apps. */\r\nfunction isUWP() {\r\n return getUA().indexOf('MSAppHost/') >= 0;\r\n}\r\n/**\r\n * Detect whether the current SDK build is the Node version.\r\n *\r\n * @return true if it's the Node SDK build.\r\n */\r\nfunction isNodeSdk() {\r\n return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;\r\n}\r\n/** Returns true if we are running in Safari. */\r\nfunction isSafari() {\r\n return (!isNode() &&\r\n navigator.userAgent.includes('Safari') &&\r\n !navigator.userAgent.includes('Chrome'));\r\n}\r\n/**\r\n * This method checks if indexedDB is supported by current browser/service worker context\r\n * @return true if indexedDB is supported by current browser/service worker context\r\n */\r\nfunction isIndexedDBAvailable() {\r\n return 'indexedDB' in self && indexedDB != null;\r\n}\r\n/**\r\n * This method validates browser context for indexedDB by opening a dummy indexedDB database and reject\r\n * if errors occur during the database open operation.\r\n */\r\nfunction validateIndexedDBOpenable() {\r\n return new Promise(function (resolve, reject) {\r\n try {\r\n var preExist_1 = true;\r\n var DB_CHECK_NAME_1 = 'validate-browser-context-for-indexeddb-analytics-module';\r\n var request_1 = window.indexedDB.open(DB_CHECK_NAME_1);\r\n request_1.onsuccess = function () {\r\n request_1.result.close();\r\n // delete database only when it doesn't pre-exist\r\n if (!preExist_1) {\r\n window.indexedDB.deleteDatabase(DB_CHECK_NAME_1);\r\n }\r\n resolve(true);\r\n };\r\n request_1.onupgradeneeded = function () {\r\n preExist_1 = false;\r\n };\r\n request_1.onerror = function () {\r\n var _a;\r\n reject(((_a = request_1.error) === null || _a === void 0 ? void 0 : _a.message) || '');\r\n };\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n}\r\n/**\r\n *\r\n * This method checks whether cookie is enabled within current browser\r\n * @return true if cookie is enabled within current browser\r\n */\r\nfunction areCookiesEnabled() {\r\n if (!navigator || !navigator.cookieEnabled) {\r\n return false;\r\n }\r\n return true;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar ERROR_NAME = 'FirebaseError';\r\n// Based on code from:\r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types\r\nvar FirebaseError = /** @class */ (function (_super) {\r\n __extends(FirebaseError, _super);\r\n function FirebaseError(code, message, customData) {\r\n var _this = _super.call(this, message) || this;\r\n _this.code = code;\r\n _this.customData = customData;\r\n _this.name = ERROR_NAME;\r\n // Fix For ES5\r\n // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\r\n Object.setPrototypeOf(_this, FirebaseError.prototype);\r\n // Maintains proper stack trace for where our error was thrown.\r\n // Only available on V8.\r\n if (Error.captureStackTrace) {\r\n Error.captureStackTrace(_this, ErrorFactory.prototype.create);\r\n }\r\n return _this;\r\n }\r\n return FirebaseError;\r\n}(Error));\r\nvar ErrorFactory = /** @class */ (function () {\r\n function ErrorFactory(service, serviceName, errors) {\r\n this.service = service;\r\n this.serviceName = serviceName;\r\n this.errors = errors;\r\n }\r\n ErrorFactory.prototype.create = function (code) {\r\n var data = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n data[_i - 1] = arguments[_i];\r\n }\r\n var customData = data[0] || {};\r\n var fullCode = this.service + \"/\" + code;\r\n var template = this.errors[code];\r\n var message = template ? replaceTemplate(template, customData) : 'Error';\r\n // Service Name: Error message (service/code).\r\n var fullMessage = this.serviceName + \": \" + message + \" (\" + fullCode + \").\";\r\n var error = new FirebaseError(fullCode, fullMessage, customData);\r\n return error;\r\n };\r\n return ErrorFactory;\r\n}());\r\nfunction replaceTemplate(template, data) {\r\n return template.replace(PATTERN, function (_, key) {\r\n var value = data[key];\r\n return value != null ? String(value) : \"<\" + key + \"?>\";\r\n });\r\n}\r\nvar PATTERN = /\\{\\$([^}]+)}/g;\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Evaluates a JSON string into a javascript object.\r\n *\r\n * @param {string} str A string containing JSON.\r\n * @return {*} The javascript object representing the specified JSON.\r\n */\r\nfunction jsonEval(str) {\r\n return JSON.parse(str);\r\n}\r\n/**\r\n * Returns JSON representing a javascript object.\r\n * @param {*} data Javascript object to be stringified.\r\n * @return {string} The JSON contents of the object.\r\n */\r\nfunction stringify(data) {\r\n return JSON.stringify(data);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Decodes a Firebase auth. token into constituent parts.\r\n *\r\n * Notes:\r\n * - May return with invalid / incomplete claims if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n */\r\nvar decode = function (token) {\r\n var header = {}, claims = {}, data = {}, signature = '';\r\n try {\r\n var parts = token.split('.');\r\n header = jsonEval(base64Decode(parts[0]) || '');\r\n claims = jsonEval(base64Decode(parts[1]) || '');\r\n signature = parts[2];\r\n data = claims['d'] || {};\r\n delete claims['d'];\r\n }\r\n catch (e) { }\r\n return {\r\n header: header,\r\n claims: claims,\r\n data: data,\r\n signature: signature\r\n };\r\n};\r\n/**\r\n * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the\r\n * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.\r\n *\r\n * Notes:\r\n * - May return a false negative if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n */\r\nvar isValidTimestamp = function (token) {\r\n var claims = decode(token).claims;\r\n var now = Math.floor(new Date().getTime() / 1000);\r\n var validSince = 0, validUntil = 0;\r\n if (typeof claims === 'object') {\r\n if (claims.hasOwnProperty('nbf')) {\r\n validSince = claims['nbf'];\r\n }\r\n else if (claims.hasOwnProperty('iat')) {\r\n validSince = claims['iat'];\r\n }\r\n if (claims.hasOwnProperty('exp')) {\r\n validUntil = claims['exp'];\r\n }\r\n else {\r\n // token will expire after 24h by default\r\n validUntil = validSince + 86400;\r\n }\r\n }\r\n return (!!now &&\r\n !!validSince &&\r\n !!validUntil &&\r\n now >= validSince &&\r\n now <= validUntil);\r\n};\r\n/**\r\n * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.\r\n *\r\n * Notes:\r\n * - May return null if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n */\r\nvar issuedAtTime = function (token) {\r\n var claims = decode(token).claims;\r\n if (typeof claims === 'object' && claims.hasOwnProperty('iat')) {\r\n return claims['iat'];\r\n }\r\n return null;\r\n};\r\n/**\r\n * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.\r\n *\r\n * Notes:\r\n * - May return a false negative if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n */\r\nvar isValidFormat = function (token) {\r\n var decoded = decode(token), claims = decoded.claims;\r\n return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat');\r\n};\r\n/**\r\n * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.\r\n *\r\n * Notes:\r\n * - May return a false negative if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n */\r\nvar isAdmin = function (token) {\r\n var claims = decode(token).claims;\r\n return typeof claims === 'object' && claims['admin'] === true;\r\n};\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction contains(obj, key) {\r\n return Object.prototype.hasOwnProperty.call(obj, key);\r\n}\r\nfunction safeGet(obj, key) {\r\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n return obj[key];\r\n }\r\n else {\r\n return undefined;\r\n }\r\n}\r\nfunction isEmpty(obj) {\r\n for (var key in obj) {\r\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\nfunction map(obj, fn, contextObj) {\r\n var res = {};\r\n for (var key in obj) {\r\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n res[key] = fn.call(contextObj, obj[key], key, obj);\r\n }\r\n }\r\n return res;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a\r\n * params object (e.g. {arg: 'val', arg2: 'val2'})\r\n * Note: You must prepend it with ? when adding it to a URL.\r\n */\r\nfunction querystring(querystringParams) {\r\n var params = [];\r\n var _loop_1 = function (key, value) {\r\n if (Array.isArray(value)) {\r\n value.forEach(function (arrayVal) {\r\n params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal));\r\n });\r\n }\r\n else {\r\n params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\r\n }\r\n };\r\n for (var _i = 0, _a = Object.entries(querystringParams); _i < _a.length; _i++) {\r\n var _b = _a[_i], key = _b[0], value = _b[1];\r\n _loop_1(key, value);\r\n }\r\n return params.length ? '&' + params.join('&') : '';\r\n}\r\n/**\r\n * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object\r\n * (e.g. {arg: 'val', arg2: 'val2'})\r\n */\r\nfunction querystringDecode(querystring) {\r\n var obj = {};\r\n var tokens = querystring.replace(/^\\?/, '').split('&');\r\n tokens.forEach(function (token) {\r\n if (token) {\r\n var key = token.split('=');\r\n obj[key[0]] = key[1];\r\n }\r\n });\r\n return obj;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @fileoverview SHA-1 cryptographic hash.\r\n * Variable names follow the notation in FIPS PUB 180-3:\r\n * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.\r\n *\r\n * Usage:\r\n * var sha1 = new sha1();\r\n * sha1.update(bytes);\r\n * var hash = sha1.digest();\r\n *\r\n * Performance:\r\n * Chrome 23: ~400 Mbit/s\r\n * Firefox 16: ~250 Mbit/s\r\n *\r\n */\r\n/**\r\n * SHA-1 cryptographic hash constructor.\r\n *\r\n * The properties declared here are discussed in the above algorithm document.\r\n * @constructor\r\n * @final\r\n * @struct\r\n */\r\nvar Sha1 = /** @class */ (function () {\r\n function Sha1() {\r\n /**\r\n * Holds the previous values of accumulated variables a-e in the compress_\r\n * function.\r\n * @private\r\n */\r\n this.chain_ = [];\r\n /**\r\n * A buffer holding the partially computed hash result.\r\n * @private\r\n */\r\n this.buf_ = [];\r\n /**\r\n * An array of 80 bytes, each a part of the message to be hashed. Referred to\r\n * as the message schedule in the docs.\r\n * @private\r\n */\r\n this.W_ = [];\r\n /**\r\n * Contains data needed to pad messages less than 64 bytes.\r\n * @private\r\n */\r\n this.pad_ = [];\r\n /**\r\n * @private {number}\r\n */\r\n this.inbuf_ = 0;\r\n /**\r\n * @private {number}\r\n */\r\n this.total_ = 0;\r\n this.blockSize = 512 / 8;\r\n this.pad_[0] = 128;\r\n for (var i = 1; i < this.blockSize; ++i) {\r\n this.pad_[i] = 0;\r\n }\r\n this.reset();\r\n }\r\n Sha1.prototype.reset = function () {\r\n this.chain_[0] = 0x67452301;\r\n this.chain_[1] = 0xefcdab89;\r\n this.chain_[2] = 0x98badcfe;\r\n this.chain_[3] = 0x10325476;\r\n this.chain_[4] = 0xc3d2e1f0;\r\n this.inbuf_ = 0;\r\n this.total_ = 0;\r\n };\r\n /**\r\n * Internal compress helper function.\r\n * @param buf Block to compress.\r\n * @param offset Offset of the block in the buffer.\r\n * @private\r\n */\r\n Sha1.prototype.compress_ = function (buf, offset) {\r\n if (!offset) {\r\n offset = 0;\r\n }\r\n var W = this.W_;\r\n // get 16 big endian words\r\n if (typeof buf === 'string') {\r\n for (var i = 0; i < 16; i++) {\r\n // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS\r\n // have a bug that turns the post-increment ++ operator into pre-increment\r\n // during JIT compilation. We have code that depends heavily on SHA-1 for\r\n // correctness and which is affected by this bug, so I've removed all uses\r\n // of post-increment ++ in which the result value is used. We can revert\r\n // this change once the Safari bug\r\n // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and\r\n // most clients have been updated.\r\n W[i] =\r\n (buf.charCodeAt(offset) << 24) |\r\n (buf.charCodeAt(offset + 1) << 16) |\r\n (buf.charCodeAt(offset + 2) << 8) |\r\n buf.charCodeAt(offset + 3);\r\n offset += 4;\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < 16; i++) {\r\n W[i] =\r\n (buf[offset] << 24) |\r\n (buf[offset + 1] << 16) |\r\n (buf[offset + 2] << 8) |\r\n buf[offset + 3];\r\n offset += 4;\r\n }\r\n }\r\n // expand to 80 words\r\n for (var i = 16; i < 80; i++) {\r\n var t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\r\n W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;\r\n }\r\n var a = this.chain_[0];\r\n var b = this.chain_[1];\r\n var c = this.chain_[2];\r\n var d = this.chain_[3];\r\n var e = this.chain_[4];\r\n var f, k;\r\n // TODO(user): Try to unroll this loop to speed up the computation.\r\n for (var i = 0; i < 80; i++) {\r\n if (i < 40) {\r\n if (i < 20) {\r\n f = d ^ (b & (c ^ d));\r\n k = 0x5a827999;\r\n }\r\n else {\r\n f = b ^ c ^ d;\r\n k = 0x6ed9eba1;\r\n }\r\n }\r\n else {\r\n if (i < 60) {\r\n f = (b & c) | (d & (b | c));\r\n k = 0x8f1bbcdc;\r\n }\r\n else {\r\n f = b ^ c ^ d;\r\n k = 0xca62c1d6;\r\n }\r\n }\r\n var t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;\r\n e = d;\r\n d = c;\r\n c = ((b << 30) | (b >>> 2)) & 0xffffffff;\r\n b = a;\r\n a = t;\r\n }\r\n this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;\r\n this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;\r\n this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;\r\n this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;\r\n this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;\r\n };\r\n Sha1.prototype.update = function (bytes, length) {\r\n // TODO(johnlenz): tighten the function signature and remove this check\r\n if (bytes == null) {\r\n return;\r\n }\r\n if (length === undefined) {\r\n length = bytes.length;\r\n }\r\n var lengthMinusBlock = length - this.blockSize;\r\n var n = 0;\r\n // Using local instead of member variables gives ~5% speedup on Firefox 16.\r\n var buf = this.buf_;\r\n var inbuf = this.inbuf_;\r\n // The outer while loop should execute at most twice.\r\n while (n < length) {\r\n // When we have no data in the block to top up, we can directly process the\r\n // input buffer (assuming it contains sufficient data). This gives ~25%\r\n // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that\r\n // the data is provided in large chunks (or in multiples of 64 bytes).\r\n if (inbuf === 0) {\r\n while (n <= lengthMinusBlock) {\r\n this.compress_(bytes, n);\r\n n += this.blockSize;\r\n }\r\n }\r\n if (typeof bytes === 'string') {\r\n while (n < length) {\r\n buf[inbuf] = bytes.charCodeAt(n);\r\n ++inbuf;\r\n ++n;\r\n if (inbuf === this.blockSize) {\r\n this.compress_(buf);\r\n inbuf = 0;\r\n // Jump to the outer loop so we use the full-block optimization.\r\n break;\r\n }\r\n }\r\n }\r\n else {\r\n while (n < length) {\r\n buf[inbuf] = bytes[n];\r\n ++inbuf;\r\n ++n;\r\n if (inbuf === this.blockSize) {\r\n this.compress_(buf);\r\n inbuf = 0;\r\n // Jump to the outer loop so we use the full-block optimization.\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n this.inbuf_ = inbuf;\r\n this.total_ += length;\r\n };\r\n /** @override */\r\n Sha1.prototype.digest = function () {\r\n var digest = [];\r\n var totalBits = this.total_ * 8;\r\n // Add pad 0x80 0x00*.\r\n if (this.inbuf_ < 56) {\r\n this.update(this.pad_, 56 - this.inbuf_);\r\n }\r\n else {\r\n this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));\r\n }\r\n // Add # bits.\r\n for (var i = this.blockSize - 1; i >= 56; i--) {\r\n this.buf_[i] = totalBits & 255;\r\n totalBits /= 256; // Don't use bit-shifting here!\r\n }\r\n this.compress_(this.buf_);\r\n var n = 0;\r\n for (var i = 0; i < 5; i++) {\r\n for (var j = 24; j >= 0; j -= 8) {\r\n digest[n] = (this.chain_[i] >> j) & 255;\r\n ++n;\r\n }\r\n }\r\n return digest;\r\n };\r\n return Sha1;\r\n}());\n\n/**\r\n * Helper to make a Subscribe function (just like Promise helps make a\r\n * Thenable).\r\n *\r\n * @param executor Function which can make calls to a single Observer\r\n * as a proxy.\r\n * @param onNoObservers Callback when count of Observers goes to zero.\r\n */\r\nfunction createSubscribe(executor, onNoObservers) {\r\n var proxy = new ObserverProxy(executor, onNoObservers);\r\n return proxy.subscribe.bind(proxy);\r\n}\r\n/**\r\n * Implement fan-out for any number of Observers attached via a subscribe\r\n * function.\r\n */\r\nvar ObserverProxy = /** @class */ (function () {\r\n /**\r\n * @param executor Function which can make calls to a single Observer\r\n * as a proxy.\r\n * @param onNoObservers Callback when count of Observers goes to zero.\r\n */\r\n function ObserverProxy(executor, onNoObservers) {\r\n var _this = this;\r\n this.observers = [];\r\n this.unsubscribes = [];\r\n this.observerCount = 0;\r\n // Micro-task scheduling by calling task.then().\r\n this.task = Promise.resolve();\r\n this.finalized = false;\r\n this.onNoObservers = onNoObservers;\r\n // Call the executor asynchronously so subscribers that are called\r\n // synchronously after the creation of the subscribe function\r\n // can still receive the very first value generated in the executor.\r\n this.task\r\n .then(function () {\r\n executor(_this);\r\n })\r\n .catch(function (e) {\r\n _this.error(e);\r\n });\r\n }\r\n ObserverProxy.prototype.next = function (value) {\r\n this.forEachObserver(function (observer) {\r\n observer.next(value);\r\n });\r\n };\r\n ObserverProxy.prototype.error = function (error) {\r\n this.forEachObserver(function (observer) {\r\n observer.error(error);\r\n });\r\n this.close(error);\r\n };\r\n ObserverProxy.prototype.complete = function () {\r\n this.forEachObserver(function (observer) {\r\n observer.complete();\r\n });\r\n this.close();\r\n };\r\n /**\r\n * Subscribe function that can be used to add an Observer to the fan-out list.\r\n *\r\n * - We require that no event is sent to a subscriber sychronously to their\r\n * call to subscribe().\r\n */\r\n ObserverProxy.prototype.subscribe = function (nextOrObserver, error, complete) {\r\n var _this = this;\r\n var observer;\r\n if (nextOrObserver === undefined &&\r\n error === undefined &&\r\n complete === undefined) {\r\n throw new Error('Missing Observer.');\r\n }\r\n // Assemble an Observer object when passed as callback functions.\r\n if (implementsAnyMethods(nextOrObserver, [\r\n 'next',\r\n 'error',\r\n 'complete'\r\n ])) {\r\n observer = nextOrObserver;\r\n }\r\n else {\r\n observer = {\r\n next: nextOrObserver,\r\n error: error,\r\n complete: complete\r\n };\r\n }\r\n if (observer.next === undefined) {\r\n observer.next = noop;\r\n }\r\n if (observer.error === undefined) {\r\n observer.error = noop;\r\n }\r\n if (observer.complete === undefined) {\r\n observer.complete = noop;\r\n }\r\n var unsub = this.unsubscribeOne.bind(this, this.observers.length);\r\n // Attempt to subscribe to a terminated Observable - we\r\n // just respond to the Observer with the final error or complete\r\n // event.\r\n if (this.finalized) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.task.then(function () {\r\n try {\r\n if (_this.finalError) {\r\n observer.error(_this.finalError);\r\n }\r\n else {\r\n observer.complete();\r\n }\r\n }\r\n catch (e) {\r\n // nothing\r\n }\r\n return;\r\n });\r\n }\r\n this.observers.push(observer);\r\n return unsub;\r\n };\r\n // Unsubscribe is synchronous - we guarantee that no events are sent to\r\n // any unsubscribed Observer.\r\n ObserverProxy.prototype.unsubscribeOne = function (i) {\r\n if (this.observers === undefined || this.observers[i] === undefined) {\r\n return;\r\n }\r\n delete this.observers[i];\r\n this.observerCount -= 1;\r\n if (this.observerCount === 0 && this.onNoObservers !== undefined) {\r\n this.onNoObservers(this);\r\n }\r\n };\r\n ObserverProxy.prototype.forEachObserver = function (fn) {\r\n if (this.finalized) {\r\n // Already closed by previous event....just eat the additional values.\r\n return;\r\n }\r\n // Since sendOne calls asynchronously - there is no chance that\r\n // this.observers will become undefined.\r\n for (var i = 0; i < this.observers.length; i++) {\r\n this.sendOne(i, fn);\r\n }\r\n };\r\n // Call the Observer via one of it's callback function. We are careful to\r\n // confirm that the observe has not been unsubscribed since this asynchronous\r\n // function had been queued.\r\n ObserverProxy.prototype.sendOne = function (i, fn) {\r\n var _this = this;\r\n // Execute the callback asynchronously\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.task.then(function () {\r\n if (_this.observers !== undefined && _this.observers[i] !== undefined) {\r\n try {\r\n fn(_this.observers[i]);\r\n }\r\n catch (e) {\r\n // Ignore exceptions raised in Observers or missing methods of an\r\n // Observer.\r\n // Log error to console. b/31404806\r\n if (typeof console !== 'undefined' && console.error) {\r\n console.error(e);\r\n }\r\n }\r\n }\r\n });\r\n };\r\n ObserverProxy.prototype.close = function (err) {\r\n var _this = this;\r\n if (this.finalized) {\r\n return;\r\n }\r\n this.finalized = true;\r\n if (err !== undefined) {\r\n this.finalError = err;\r\n }\r\n // Proxy is no longer needed - garbage collect references\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.task.then(function () {\r\n _this.observers = undefined;\r\n _this.onNoObservers = undefined;\r\n });\r\n };\r\n return ObserverProxy;\r\n}());\r\n/** Turn synchronous function into one called asynchronously. */\r\n// eslint-disable-next-line @typescript-eslint/ban-types\r\nfunction async(fn, onError) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n Promise.resolve(true)\r\n .then(function () {\r\n fn.apply(void 0, args);\r\n })\r\n .catch(function (error) {\r\n if (onError) {\r\n onError(error);\r\n }\r\n });\r\n };\r\n}\r\n/**\r\n * Return true if the object passed in implements any of the named methods.\r\n */\r\nfunction implementsAnyMethods(obj, methods) {\r\n if (typeof obj !== 'object' || obj === null) {\r\n return false;\r\n }\r\n for (var _i = 0, methods_1 = methods; _i < methods_1.length; _i++) {\r\n var method = methods_1[_i];\r\n if (method in obj && typeof obj[method] === 'function') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction noop() {\r\n // do nothing\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Check to make sure the appropriate number of arguments are provided for a public function.\r\n * Throws an error if it fails.\r\n *\r\n * @param fnName The function name\r\n * @param minCount The minimum number of arguments to allow for the function call\r\n * @param maxCount The maximum number of argument to allow for the function call\r\n * @param argCount The actual number of arguments provided.\r\n */\r\nvar validateArgCount = function (fnName, minCount, maxCount, argCount) {\r\n var argError;\r\n if (argCount < minCount) {\r\n argError = 'at least ' + minCount;\r\n }\r\n else if (argCount > maxCount) {\r\n argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount;\r\n }\r\n if (argError) {\r\n var error = fnName +\r\n ' failed: Was called with ' +\r\n argCount +\r\n (argCount === 1 ? ' argument.' : ' arguments.') +\r\n ' Expects ' +\r\n argError +\r\n '.';\r\n throw new Error(error);\r\n }\r\n};\r\n/**\r\n * Generates a string to prefix an error message about failed argument validation\r\n *\r\n * @param fnName The function name\r\n * @param argumentNumber The index of the argument\r\n * @param optional Whether or not the argument is optional\r\n * @return The prefix to add to the error thrown for validation.\r\n */\r\nfunction errorPrefix(fnName, argumentNumber, optional) {\r\n var argName = '';\r\n switch (argumentNumber) {\r\n case 1:\r\n argName = optional ? 'first' : 'First';\r\n break;\r\n case 2:\r\n argName = optional ? 'second' : 'Second';\r\n break;\r\n case 3:\r\n argName = optional ? 'third' : 'Third';\r\n break;\r\n case 4:\r\n argName = optional ? 'fourth' : 'Fourth';\r\n break;\r\n default:\r\n throw new Error('errorPrefix called with argumentNumber > 4. Need to update it?');\r\n }\r\n var error = fnName + ' failed: ';\r\n error += argName + ' argument ';\r\n return error;\r\n}\r\n/**\r\n * @param fnName\r\n * @param argumentNumber\r\n * @param namespace\r\n * @param optional\r\n */\r\nfunction validateNamespace(fnName, argumentNumber, namespace, optional) {\r\n if (optional && !namespace) {\r\n return;\r\n }\r\n if (typeof namespace !== 'string') {\r\n //TODO: I should do more validation here. We only allow certain chars in namespaces.\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) +\r\n 'must be a valid firebase namespace.');\r\n }\r\n}\r\nfunction validateCallback(fnName, argumentNumber, \r\n// eslint-disable-next-line @typescript-eslint/ban-types\r\ncallback, optional) {\r\n if (optional && !callback) {\r\n return;\r\n }\r\n if (typeof callback !== 'function') {\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) +\r\n 'must be a valid function.');\r\n }\r\n}\r\nfunction validateContextObject(fnName, argumentNumber, context, optional) {\r\n if (optional && !context) {\r\n return;\r\n }\r\n if (typeof context !== 'object' || context === null) {\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) +\r\n 'must be a valid context object.');\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they\r\n// automatically replaced '\\r\\n' with '\\n', and they didn't handle surrogate pairs,\r\n// so it's been modified.\r\n// Note that not all Unicode characters appear as single characters in JavaScript strings.\r\n// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters\r\n// use 2 characters in Javascript. All 4-byte UTF-8 characters begin with a first\r\n// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate\r\n// pair).\r\n// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3\r\n/**\r\n * @param {string} str\r\n * @return {Array}\r\n */\r\nvar stringToByteArray$1 = function (str) {\r\n var out = [];\r\n var p = 0;\r\n for (var i = 0; i < str.length; i++) {\r\n var c = str.charCodeAt(i);\r\n // Is this the lead surrogate in a surrogate pair?\r\n if (c >= 0xd800 && c <= 0xdbff) {\r\n var high = c - 0xd800; // the high 10 bits.\r\n i++;\r\n assert(i < str.length, 'Surrogate pair missing trail surrogate.');\r\n var low = str.charCodeAt(i) - 0xdc00; // the low 10 bits.\r\n c = 0x10000 + (high << 10) + low;\r\n }\r\n if (c < 128) {\r\n out[p++] = c;\r\n }\r\n else if (c < 2048) {\r\n out[p++] = (c >> 6) | 192;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n else if (c < 65536) {\r\n out[p++] = (c >> 12) | 224;\r\n out[p++] = ((c >> 6) & 63) | 128;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n else {\r\n out[p++] = (c >> 18) | 240;\r\n out[p++] = ((c >> 12) & 63) | 128;\r\n out[p++] = ((c >> 6) & 63) | 128;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n }\r\n return out;\r\n};\r\n/**\r\n * Calculate length without actually converting; useful for doing cheaper validation.\r\n * @param {string} str\r\n * @return {number}\r\n */\r\nvar stringLength = function (str) {\r\n var p = 0;\r\n for (var i = 0; i < str.length; i++) {\r\n var c = str.charCodeAt(i);\r\n if (c < 128) {\r\n p++;\r\n }\r\n else if (c < 2048) {\r\n p += 2;\r\n }\r\n else if (c >= 0xd800 && c <= 0xdbff) {\r\n // Lead surrogate of a surrogate pair. The pair together will take 4 bytes to represent.\r\n p += 4;\r\n i++; // skip trail surrogate.\r\n }\r\n else {\r\n p += 3;\r\n }\r\n }\r\n return p;\r\n};\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * The amount of milliseconds to exponentially increase.\r\n */\r\nvar DEFAULT_INTERVAL_MILLIS = 1000;\r\n/**\r\n * The factor to backoff by.\r\n * Should be a number greater than 1.\r\n */\r\nvar DEFAULT_BACKOFF_FACTOR = 2;\r\n/**\r\n * The maximum milliseconds to increase to.\r\n *\r\n * <p>Visible for testing\r\n */\r\nvar MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android.\r\n/**\r\n * The percentage of backoff time to randomize by.\r\n * See\r\n * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic\r\n * for context.\r\n *\r\n * <p>Visible for testing\r\n */\r\nvar RANDOM_FACTOR = 0.5;\r\n/**\r\n * Based on the backoff method from\r\n * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js.\r\n * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around.\r\n */\r\nfunction calculateBackoffMillis(backoffCount, intervalMillis, backoffFactor) {\r\n if (intervalMillis === void 0) { intervalMillis = DEFAULT_INTERVAL_MILLIS; }\r\n if (backoffFactor === void 0) { backoffFactor = DEFAULT_BACKOFF_FACTOR; }\r\n // Calculates an exponentially increasing value.\r\n // Deviation: calculates value from count and a constant interval, so we only need to save value\r\n // and count to restore state.\r\n var currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount);\r\n // A random \"fuzz\" to avoid waves of retries.\r\n // Deviation: randomFactor is required.\r\n var randomWait = Math.round(\r\n // A fraction of the backoff value to add/subtract.\r\n // Deviation: changes multiplication order to improve readability.\r\n RANDOM_FACTOR *\r\n currBaseValue *\r\n // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines\r\n // if we add or subtract.\r\n (Math.random() - 0.5) *\r\n 2);\r\n // Limits backoff to max to avoid effectively permanent backoff.\r\n return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Provide English ordinal letters after a number\r\n */\r\nfunction ordinal(i) {\r\n if (!Number.isFinite(i)) {\r\n return \"\" + i;\r\n }\r\n return i + indicator(i);\r\n}\r\nfunction indicator(i) {\r\n i = Math.abs(i);\r\n var cent = i % 100;\r\n if (cent >= 10 && cent <= 20) {\r\n return 'th';\r\n }\r\n var dec = i % 10;\r\n if (dec === 1) {\r\n return 'st';\r\n }\r\n if (dec === 2) {\r\n return 'nd';\r\n }\r\n if (dec === 3) {\r\n return 'rd';\r\n }\r\n return 'th';\r\n}\n\nexport { CONSTANTS, Deferred, ErrorFactory, FirebaseError, MAX_VALUE_MILLIS, RANDOM_FACTOR, Sha1, areCookiesEnabled, assert, assertionError, async, base64, base64Decode, base64Encode, calculateBackoffMillis, contains, createSubscribe, decode, deepCopy, deepExtend, errorPrefix, getUA, isAdmin, isBrowser, isBrowserExtension, isElectron, isEmpty, isIE, isIndexedDBAvailable, isMobileCordova, isNode, isNodeSdk, isReactNative, isSafari, isUWP, isValidFormat, isValidTimestamp, issuedAtTime, jsonEval, map, ordinal, querystring, querystringDecode, safeGet, stringLength, stringToByteArray$1 as stringToByteArray, stringify, validateArgCount, validateCallback, validateContextObject, validateIndexedDBOpenable, validateNamespace };\n//# sourceMappingURL=index.esm.js.map\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nfunction __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\n\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nvar g, goog = goog || {}, k = commonjsGlobal || self;\r\nfunction aa() { }\r\nfunction ba(a) { var b = typeof a; return \"object\" != b ? b : a ? Array.isArray(a) ? \"array\" : b : \"null\"; }\r\nfunction ca(a) { var b = ba(a); return \"array\" == b || \"object\" == b && \"number\" == typeof a.length; }\r\nfunction n(a) { var b = typeof a; return \"object\" == b && null != a || \"function\" == b; }\r\nfunction da(a) { return Object.prototype.hasOwnProperty.call(a, ea) && a[ea] || (a[ea] = ++fa); }\r\nvar ea = \"closure_uid_\" + (1E9 * Math.random() >>> 0), fa = 0;\r\nfunction ha(a, b, c) { return a.call.apply(a.bind, arguments); }\r\nfunction ja(a, b, c) { if (!a)\r\n throw Error(); if (2 < arguments.length) {\r\n var d = Array.prototype.slice.call(arguments, 2);\r\n return function () { var e = Array.prototype.slice.call(arguments); Array.prototype.unshift.apply(e, d); return a.apply(b, e); };\r\n} return function () { return a.apply(b, arguments); }; }\r\nfunction p(a, b, c) { Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf(\"native code\") ? p = ha : p = ja; return p.apply(null, arguments); }\r\nfunction ka(a, b) { var c = Array.prototype.slice.call(arguments, 1); return function () { var d = c.slice(); d.push.apply(d, arguments); return a.apply(this, d); }; }\r\nvar q = Date.now;\r\nfunction r(a, b) { function c() { } c.prototype = b.prototype; a.S = b.prototype; a.prototype = new c; a.prototype.constructor = a; }\r\nfunction u() { this.j = this.j; this.i = this.i; }\r\nvar la = 0;\r\nu.prototype.j = !1;\r\nu.prototype.ja = function () { if (!this.j && (this.j = !0, this.G(), 0 != la)) {\r\n var a = da(this);\r\n} };\r\nu.prototype.G = function () { if (this.i)\r\n for (; this.i.length;)\r\n this.i.shift()(); };\r\nvar na = Array.prototype.indexOf ? function (a, b) { return Array.prototype.indexOf.call(a, b, void 0); } : function (a, b) { if (\"string\" === typeof a)\r\n return \"string\" !== typeof b || 1 != b.length ? -1 : a.indexOf(b, 0); for (var c = 0; c < a.length; c++)\r\n if (c in a && a[c] === b)\r\n return c; return -1; }, oa = Array.prototype.forEach ? function (a, b, c) { Array.prototype.forEach.call(a, b, c); } : function (a, b, c) { for (var d = a.length, e = \"string\" === typeof a ? a.split(\"\") : a, f = 0; f < d; f++)\r\n f in e && b.call(c, e[f], f, a); };\r\nfunction pa(a) { a: {\r\n var b = qa;\r\n for (var c = a.length, d = \"string\" === typeof a ? a.split(\"\") : a, e = 0; e < c; e++)\r\n if (e in d && b.call(void 0, d[e], e, a)) {\r\n b = e;\r\n break a;\r\n }\r\n b = -1;\r\n} return 0 > b ? null : \"string\" === typeof a ? a.charAt(b) : a[b]; }\r\nfunction ra(a) { return Array.prototype.concat.apply([], arguments); }\r\nfunction sa(a) { var b = a.length; if (0 < b) {\r\n for (var c = Array(b), d = 0; d < b; d++)\r\n c[d] = a[d];\r\n return c;\r\n} return []; }\r\nfunction ta(a) { return /^[\\s\\xa0]*$/.test(a); }\r\nvar ua = String.prototype.trim ? function (a) { return a.trim(); } : function (a) { return /^[\\s\\xa0]*([\\s\\S]*?)[\\s\\xa0]*$/.exec(a)[1]; };\r\nfunction v(a, b) { return -1 != a.indexOf(b); }\r\nfunction xa(a, b) { return a < b ? -1 : a > b ? 1 : 0; }\r\nvar w;\r\na: {\r\n var ya = k.navigator;\r\n if (ya) {\r\n var za = ya.userAgent;\r\n if (za) {\r\n w = za;\r\n break a;\r\n }\r\n }\r\n w = \"\";\r\n}\r\nfunction Aa(a, b, c) { for (var d in a)\r\n b.call(c, a[d], d, a); }\r\nfunction Ba(a) { var b = {}; for (var c in a)\r\n b[c] = a[c]; return b; }\r\nvar Ca = \"constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf\".split(\" \");\r\nfunction Da(a, b) { var c, d; for (var e = 1; e < arguments.length; e++) {\r\n d = arguments[e];\r\n for (c in d)\r\n a[c] = d[c];\r\n for (var f = 0; f < Ca.length; f++)\r\n c = Ca[f], Object.prototype.hasOwnProperty.call(d, c) && (a[c] = d[c]);\r\n} }\r\nfunction Ea(a) { Ea[\" \"](a); return a; }\r\nEa[\" \"] = aa;\r\nfunction Fa(a, b) { var c = Ga; return Object.prototype.hasOwnProperty.call(c, a) ? c[a] : c[a] = b(a); }\r\nvar Ha = v(w, \"Opera\"), x = v(w, \"Trident\") || v(w, \"MSIE\"), Ia = v(w, \"Edge\"), Ja = Ia || x, Ka = v(w, \"Gecko\") && !(v(w.toLowerCase(), \"webkit\") && !v(w, \"Edge\")) && !(v(w, \"Trident\") || v(w, \"MSIE\")) && !v(w, \"Edge\"), La = v(w.toLowerCase(), \"webkit\") && !v(w, \"Edge\");\r\nfunction Ma() { var a = k.document; return a ? a.documentMode : void 0; }\r\nvar Na;\r\na: {\r\n var Oa = \"\", Pa = function () { var a = w; if (Ka)\r\n return /rv:([^\\);]+)(\\)|;)/.exec(a); if (Ia)\r\n return /Edge\\/([\\d\\.]+)/.exec(a); if (x)\r\n return /\\b(?:MSIE|rv)[: ]([^\\);]+)(\\)|;)/.exec(a); if (La)\r\n return /WebKit\\/(\\S+)/.exec(a); if (Ha)\r\n return /(?:Version)[ \\/]?(\\S+)/.exec(a); }();\r\n Pa && (Oa = Pa ? Pa[1] : \"\");\r\n if (x) {\r\n var Qa = Ma();\r\n if (null != Qa && Qa > parseFloat(Oa)) {\r\n Na = String(Qa);\r\n break a;\r\n }\r\n }\r\n Na = Oa;\r\n}\r\nvar Ga = {};\r\nfunction Ra(a) { return Fa(a, function () { {\r\n var b = 0;\r\n var e = ua(String(Na)).split(\".\"), f = ua(String(a)).split(\".\"), h = Math.max(e.length, f.length);\r\n for (var m = 0; 0 == b && m < h; m++) {\r\n var c = e[m] || \"\", d = f[m] || \"\";\r\n do {\r\n c = /(\\d*)(\\D*)(.*)/.exec(c) || [\"\", \"\", \"\", \"\"];\r\n d = /(\\d*)(\\D*)(.*)/.exec(d) || [\"\", \"\", \"\", \"\"];\r\n if (0 == c[0].length && 0 == d[0].length)\r\n break;\r\n b = xa(0 == c[1].length ? 0 : parseInt(c[1], 10), 0 == d[1].length ? 0 : parseInt(d[1], 10)) || xa(0 == c[2].length, 0 == d[2].length) || xa(c[2], d[2]);\r\n c = c[3];\r\n d = d[3];\r\n } while (0 == b);\r\n }\r\n} return 0 <= b; }); }\r\nvar Sa;\r\nif (k.document && x) {\r\n var Ta = Ma();\r\n Sa = Ta ? Ta : parseInt(Na, 10) || void 0;\r\n}\r\nelse\r\n Sa = void 0;\r\nvar Ua = Sa;\r\nvar Va = !x || 9 <= Number(Ua), Wa = x && !Ra(\"9\"), Xa = function () { if (!k.addEventListener || !Object.defineProperty)\r\n return !1; var a = !1, b = Object.defineProperty({}, \"passive\", { get: function () { a = !0; } }); try {\r\n k.addEventListener(\"test\", aa, b), k.removeEventListener(\"test\", aa, b);\r\n}\r\ncatch (c) { } return a; }();\r\nfunction y(a, b) { this.type = a; this.a = this.target = b; this.defaultPrevented = !1; }\r\ny.prototype.b = function () { this.defaultPrevented = !0; };\r\nfunction A(a, b) {\r\n y.call(this, a ? a.type : \"\");\r\n this.relatedTarget = this.a = this.target = null;\r\n this.button = this.screenY = this.screenX = this.clientY = this.clientX = 0;\r\n this.key = \"\";\r\n this.metaKey = this.shiftKey = this.altKey = this.ctrlKey = !1;\r\n this.pointerId = 0;\r\n this.pointerType = \"\";\r\n this.c = null;\r\n if (a) {\r\n var c = this.type = a.type, d = a.changedTouches && a.changedTouches.length ? a.changedTouches[0] : null;\r\n this.target = a.target || a.srcElement;\r\n this.a = b;\r\n if (b = a.relatedTarget) {\r\n if (Ka) {\r\n a: {\r\n try {\r\n Ea(b.nodeName);\r\n var e = !0;\r\n break a;\r\n }\r\n catch (f) { }\r\n e = !1;\r\n }\r\n e || (b = null);\r\n }\r\n }\r\n else\r\n \"mouseover\" ==\r\n c ? b = a.fromElement : \"mouseout\" == c && (b = a.toElement);\r\n this.relatedTarget = b;\r\n d ? (this.clientX = void 0 !== d.clientX ? d.clientX : d.pageX, this.clientY = void 0 !== d.clientY ? d.clientY : d.pageY, this.screenX = d.screenX || 0, this.screenY = d.screenY || 0) : (this.clientX = void 0 !== a.clientX ? a.clientX : a.pageX, this.clientY = void 0 !== a.clientY ? a.clientY : a.pageY, this.screenX = a.screenX || 0, this.screenY = a.screenY || 0);\r\n this.button = a.button;\r\n this.key = a.key || \"\";\r\n this.ctrlKey = a.ctrlKey;\r\n this.altKey = a.altKey;\r\n this.shiftKey = a.shiftKey;\r\n this.metaKey =\r\n a.metaKey;\r\n this.pointerId = a.pointerId || 0;\r\n this.pointerType = \"string\" === typeof a.pointerType ? a.pointerType : Ya[a.pointerType] || \"\";\r\n this.c = a;\r\n a.defaultPrevented && this.b();\r\n }\r\n}\r\nr(A, y);\r\nvar Ya = { 2: \"touch\", 3: \"pen\", 4: \"mouse\" };\r\nA.prototype.b = function () { A.S.b.call(this); var a = this.c; if (a.preventDefault)\r\n a.preventDefault();\r\nelse if (a.returnValue = !1, Wa)\r\n try {\r\n if (a.ctrlKey || 112 <= a.keyCode && 123 >= a.keyCode)\r\n a.keyCode = -1;\r\n }\r\n catch (b) { } };\r\nvar C = \"closure_listenable_\" + (1E6 * Math.random() | 0), Za = 0;\r\nfunction $a(a, b, c, d, e) { this.listener = a; this.proxy = null; this.src = b; this.type = c; this.capture = !!d; this.ca = e; this.key = ++Za; this.Y = this.Z = !1; }\r\nfunction ab(a) { a.Y = !0; a.listener = null; a.proxy = null; a.src = null; a.ca = null; }\r\nfunction bb(a) { this.src = a; this.a = {}; this.b = 0; }\r\nbb.prototype.add = function (a, b, c, d, e) { var f = a.toString(); a = this.a[f]; a || (a = this.a[f] = [], this.b++); var h = cb(a, b, d, e); -1 < h ? (b = a[h], c || (b.Z = !1)) : (b = new $a(b, this.src, f, !!d, e), b.Z = c, a.push(b)); return b; };\r\nfunction db(a, b) { var c = b.type; if (c in a.a) {\r\n var d = a.a[c], e = na(d, b), f;\r\n (f = 0 <= e) && Array.prototype.splice.call(d, e, 1);\r\n f && (ab(b), 0 == a.a[c].length && (delete a.a[c], a.b--));\r\n} }\r\nfunction cb(a, b, c, d) { for (var e = 0; e < a.length; ++e) {\r\n var f = a[e];\r\n if (!f.Y && f.listener == b && f.capture == !!c && f.ca == d)\r\n return e;\r\n} return -1; }\r\nvar eb = \"closure_lm_\" + (1E6 * Math.random() | 0), fb = {};\r\nfunction hb(a, b, c, d, e) { if (d && d.once)\r\n return ib(a, b, c, d, e); if (Array.isArray(b)) {\r\n for (var f = 0; f < b.length; f++)\r\n hb(a, b[f], c, d, e);\r\n return null;\r\n} c = jb(c); return a && a[C] ? a.va(b, c, n(d) ? !!d.capture : !!d, e) : kb(a, b, c, !1, d, e); }\r\nfunction kb(a, b, c, d, e, f) {\r\n if (!b)\r\n throw Error(\"Invalid event type\");\r\n var h = n(e) ? !!e.capture : !!e;\r\n if (h && !Va)\r\n return null;\r\n var m = lb(a);\r\n m || (a[eb] = m = new bb(a));\r\n c = m.add(b, c, d, h, f);\r\n if (c.proxy)\r\n return c;\r\n d = mb();\r\n c.proxy = d;\r\n d.src = a;\r\n d.listener = c;\r\n if (a.addEventListener)\r\n Xa || (e = h), void 0 === e && (e = !1), a.addEventListener(b.toString(), d, e);\r\n else if (a.attachEvent)\r\n a.attachEvent(nb(b.toString()), d);\r\n else if (a.addListener && a.removeListener)\r\n a.addListener(d);\r\n else\r\n throw Error(\"addEventListener and attachEvent are unavailable.\");\r\n return c;\r\n}\r\nfunction mb() { var a = ob, b = Va ? function (c) { return a.call(b.src, b.listener, c); } : function (c) { c = a.call(b.src, b.listener, c); if (!c)\r\n return c; }; return b; }\r\nfunction ib(a, b, c, d, e) { if (Array.isArray(b)) {\r\n for (var f = 0; f < b.length; f++)\r\n ib(a, b[f], c, d, e);\r\n return null;\r\n} c = jb(c); return a && a[C] ? a.wa(b, c, n(d) ? !!d.capture : !!d, e) : kb(a, b, c, !0, d, e); }\r\nfunction pb(a, b, c, d, e) { if (Array.isArray(b))\r\n for (var f = 0; f < b.length; f++)\r\n pb(a, b[f], c, d, e);\r\nelse\r\n (d = n(d) ? !!d.capture : !!d, c = jb(c), a && a[C]) ? (a = a.c, b = String(b).toString(), b in a.a && (f = a.a[b], c = cb(f, c, d, e), -1 < c && (ab(f[c]), Array.prototype.splice.call(f, c, 1), 0 == f.length && (delete a.a[b], a.b--)))) : a && (a = lb(a)) && (b = a.a[b.toString()], a = -1, b && (a = cb(b, c, d, e)), (c = -1 < a ? b[a] : null) && rb(c)); }\r\nfunction rb(a) { if (\"number\" !== typeof a && a && !a.Y) {\r\n var b = a.src;\r\n if (b && b[C])\r\n db(b.c, a);\r\n else {\r\n var c = a.type, d = a.proxy;\r\n b.removeEventListener ? b.removeEventListener(c, d, a.capture) : b.detachEvent ? b.detachEvent(nb(c), d) : b.addListener && b.removeListener && b.removeListener(d);\r\n (c = lb(b)) ? (db(c, a), 0 == c.b && (c.src = null, b[eb] = null)) : ab(a);\r\n }\r\n} }\r\nfunction nb(a) { return a in fb ? fb[a] : fb[a] = \"on\" + a; }\r\nfunction sb(a, b) { var c = a.listener, d = a.ca || a.src; a.Z && rb(a); return c.call(d, b); }\r\nfunction ob(a, b) { if (a.Y)\r\n return !0; if (!Va) {\r\n if (!b)\r\n a: {\r\n b = [\"window\", \"event\"];\r\n for (var c = k, d = 0; d < b.length; d++)\r\n if (c = c[b[d]], null == c) {\r\n b = null;\r\n break a;\r\n }\r\n b = c;\r\n }\r\n b = new A(b, this);\r\n return sb(a, b);\r\n} return sb(a, new A(b, this)); }\r\nfunction lb(a) { a = a[eb]; return a instanceof bb ? a : null; }\r\nvar tb = \"__closure_events_fn_\" + (1E9 * Math.random() >>> 0);\r\nfunction jb(a) { if (\"function\" == ba(a))\r\n return a; a[tb] || (a[tb] = function (b) { return a.handleEvent(b); }); return a[tb]; }\r\nfunction D() { u.call(this); this.c = new bb(this); this.J = this; this.C = null; }\r\nr(D, u);\r\nD.prototype[C] = !0;\r\ng = D.prototype;\r\ng.addEventListener = function (a, b, c, d) { hb(this, a, b, c, d); };\r\ng.removeEventListener = function (a, b, c, d) { pb(this, a, b, c, d); };\r\ng.dispatchEvent = function (a) { var b, c = this.C; if (c)\r\n for (b = []; c; c = c.C)\r\n b.push(c); c = this.J; var d = a.type || a; if (\"string\" === typeof a)\r\n a = new y(a, c);\r\nelse if (a instanceof y)\r\n a.target = a.target || c;\r\nelse {\r\n var e = a;\r\n a = new y(d, c);\r\n Da(a, e);\r\n} e = !0; if (b)\r\n for (var f = b.length - 1; 0 <= f; f--) {\r\n var h = a.a = b[f];\r\n e = ub(h, d, !0, a) && e;\r\n } h = a.a = c; e = ub(h, d, !0, a) && e; e = ub(h, d, !1, a) && e; if (b)\r\n for (f = 0; f < b.length; f++)\r\n h = a.a = b[f], e = ub(h, d, !1, a) && e; return e; };\r\ng.G = function () { D.S.G.call(this); if (this.c) {\r\n var a = this.c, c;\r\n for (c in a.a) {\r\n for (var d = a.a[c], e = 0; e < d.length; e++)\r\n ab(d[e]);\r\n delete a.a[c];\r\n a.b--;\r\n }\r\n} this.C = null; };\r\ng.va = function (a, b, c, d) { return this.c.add(String(a), b, !1, c, d); };\r\ng.wa = function (a, b, c, d) { return this.c.add(String(a), b, !0, c, d); };\r\nfunction ub(a, b, c, d) { b = a.c.a[String(b)]; if (!b)\r\n return !0; b = b.concat(); for (var e = !0, f = 0; f < b.length; ++f) {\r\n var h = b[f];\r\n if (h && !h.Y && h.capture == c) {\r\n var m = h.listener, l = h.ca || h.src;\r\n h.Z && db(a.c, h);\r\n e = !1 !== m.call(l, d) && e;\r\n }\r\n} return e && !d.defaultPrevented; }\r\nvar vb = k.JSON.stringify;\r\nfunction wb() { this.b = this.a = null; }\r\nvar yb = new /** @class */ (function () {\r\n function class_1(a, b, c) {\r\n this.f = c;\r\n this.c = a;\r\n this.g = b;\r\n this.b = 0;\r\n this.a = null;\r\n }\r\n class_1.prototype.get = function () { var a; 0 < this.b ? (this.b--, a = this.a, this.a = a.next, a.next = null) : a = this.c(); return a; };\r\n return class_1;\r\n}())(function () { return new xb; }, function (a) { a.reset(); }, 100);\r\nwb.prototype.add = function (a, b) { var c = yb.get(); c.set(a, b); this.b ? this.b.next = c : this.a = c; this.b = c; };\r\nfunction zb() { var a = Ab, b = null; a.a && (b = a.a, a.a = a.a.next, a.a || (a.b = null), b.next = null); return b; }\r\nfunction xb() { this.next = this.b = this.a = null; }\r\nxb.prototype.set = function (a, b) { this.a = a; this.b = b; this.next = null; };\r\nxb.prototype.reset = function () { this.next = this.b = this.a = null; };\r\nfunction Bb(a) { k.setTimeout(function () { throw a; }, 0); }\r\nfunction Cb(a, b) { Db || Eb(); Fb || (Db(), Fb = !0); Ab.add(a, b); }\r\nvar Db;\r\nfunction Eb() { var a = k.Promise.resolve(void 0); Db = function () { a.then(Gb); }; }\r\nvar Fb = !1, Ab = new wb;\r\nfunction Gb() { for (var a; a = zb();) {\r\n try {\r\n a.a.call(a.b);\r\n }\r\n catch (c) {\r\n Bb(c);\r\n }\r\n var b = yb;\r\n b.g(a);\r\n b.b < b.f && (b.b++, a.next = b.a, b.a = a);\r\n} Fb = !1; }\r\nfunction Hb(a, b) { D.call(this); this.b = a || 1; this.a = b || k; this.f = p(this.Ya, this); this.g = q(); }\r\nr(Hb, D);\r\ng = Hb.prototype;\r\ng.aa = !1;\r\ng.M = null;\r\ng.Ya = function () { if (this.aa) {\r\n var a = q() - this.g;\r\n 0 < a && a < .8 * this.b ? this.M = this.a.setTimeout(this.f, this.b - a) : (this.M && (this.a.clearTimeout(this.M), this.M = null), this.dispatchEvent(\"tick\"), this.aa && (Ib(this), this.start()));\r\n} };\r\ng.start = function () { this.aa = !0; this.M || (this.M = this.a.setTimeout(this.f, this.b), this.g = q()); };\r\nfunction Ib(a) { a.aa = !1; a.M && (a.a.clearTimeout(a.M), a.M = null); }\r\ng.G = function () { Hb.S.G.call(this); Ib(this); delete this.a; };\r\nfunction Jb(a, b, c) { if (\"function\" == ba(a))\r\n c && (a = p(a, c));\r\nelse if (a && \"function\" == typeof a.handleEvent)\r\n a = p(a.handleEvent, a);\r\nelse\r\n throw Error(\"Invalid listener argument\"); return 2147483647 < Number(b) ? -1 : k.setTimeout(a, b || 0); }\r\nfunction Kb(a) { a.a = Jb(function () { a.a = null; a.c && (a.c = !1, Kb(a)); }, a.h); var b = a.b; a.b = null; a.g.apply(null, b); }\r\nvar Lb = /** @class */ (function (_super) {\r\n __extends(Lb, _super);\r\n function Lb(a, b, c) {\r\n var _this = _super.call(this) || this;\r\n _this.g = null != c ? a.bind(c) : a;\r\n _this.h = b;\r\n _this.b = null;\r\n _this.c = !1;\r\n _this.a = null;\r\n return _this;\r\n }\r\n Lb.prototype.f = function (a) { this.b = arguments; this.a ? this.c = !0 : Kb(this); };\r\n Lb.prototype.G = function () { _super.prototype.G.call(this); this.a && (k.clearTimeout(this.a), this.a = null, this.c = !1, this.b = null); };\r\n return Lb;\r\n}(u));\r\nfunction E(a) { u.call(this); this.b = a; this.a = {}; }\r\nr(E, u);\r\nvar Mb = [];\r\nfunction Nb(a, b, c, d) { Array.isArray(c) || (c && (Mb[0] = c.toString()), c = Mb); for (var e = 0; e < c.length; e++) {\r\n var f = hb(b, c[e], d || a.handleEvent, !1, a.b || a);\r\n if (!f)\r\n break;\r\n a.a[f.key] = f;\r\n} }\r\nfunction Ob(a) { Aa(a.a, function (b, c) { this.a.hasOwnProperty(c) && rb(b); }, a); a.a = {}; }\r\nE.prototype.G = function () { E.S.G.call(this); Ob(this); };\r\nE.prototype.handleEvent = function () { throw Error(\"EventHandler.handleEvent not implemented\"); };\r\nfunction Pb() { this.a = !0; }\r\nfunction Qb(a, b, c, d, e, f) { a.info(function () { if (a.a)\r\n if (f) {\r\n var h = \"\";\r\n for (var m = f.split(\"&\"), l = 0; l < m.length; l++) {\r\n var t = m[l].split(\"=\");\r\n if (1 < t.length) {\r\n var B = t[0];\r\n t = t[1];\r\n var z = B.split(\"_\");\r\n h = 2 <= z.length && \"type\" == z[1] ? h + (B + \"=\" + t + \"&\") : h + (B + \"=redacted&\");\r\n }\r\n }\r\n }\r\n else\r\n h = null;\r\nelse\r\n h = f; return \"XMLHTTP REQ (\" + d + \") [attempt \" + e + \"]: \" + b + \"\\n\" + c + \"\\n\" + h; }); }\r\nfunction Rb(a, b, c, d, e, f, h) { a.info(function () { return \"XMLHTTP RESP (\" + d + \") [ attempt \" + e + \"]: \" + b + \"\\n\" + c + \"\\n\" + f + \" \" + h; }); }\r\nfunction F(a, b, c, d) { a.info(function () { return \"XMLHTTP TEXT (\" + b + \"): \" + Sb(a, c) + (d ? \" \" + d : \"\"); }); }\r\nfunction Tb(a, b) { a.info(function () { return \"TIMEOUT: \" + b; }); }\r\nPb.prototype.info = function () { };\r\nfunction Sb(a, b) { if (!a.a)\r\n return b; if (!b)\r\n return null; try {\r\n var c = JSON.parse(b);\r\n if (c)\r\n for (a = 0; a < c.length; a++)\r\n if (Array.isArray(c[a])) {\r\n var d = c[a];\r\n if (!(2 > d.length)) {\r\n var e = d[1];\r\n if (Array.isArray(e) && !(1 > e.length)) {\r\n var f = e[0];\r\n if (\"noop\" != f && \"stop\" != f && \"close\" != f)\r\n for (var h = 1; h < e.length; h++)\r\n e[h] = \"\";\r\n }\r\n }\r\n }\r\n return vb(c);\r\n}\r\ncatch (m) {\r\n return b;\r\n} }\r\nvar Ub = null;\r\nfunction Vb() { return Ub = Ub || new D; }\r\nfunction Wb(a) { y.call(this, \"serverreachability\", a); }\r\nr(Wb, y);\r\nfunction G(a) { var b = Vb(); b.dispatchEvent(new Wb(b, a)); }\r\nfunction Xb(a) { y.call(this, \"statevent\", a); }\r\nr(Xb, y);\r\nfunction H(a) { var b = Vb(); b.dispatchEvent(new Xb(b, a)); }\r\nfunction Yb(a) { y.call(this, \"timingevent\", a); }\r\nr(Yb, y);\r\nfunction I(a, b) { if (\"function\" != ba(a))\r\n throw Error(\"Fn must not be null and must be a function\"); return k.setTimeout(function () { a(); }, b); }\r\nvar Zb = { NO_ERROR: 0, Za: 1, gb: 2, fb: 3, bb: 4, eb: 5, hb: 6, Da: 7, TIMEOUT: 8, kb: 9 };\r\nvar $b = { ab: \"complete\", ob: \"success\", Ea: \"error\", Da: \"abort\", mb: \"ready\", nb: \"readystatechange\", TIMEOUT: \"timeout\", ib: \"incrementaldata\", lb: \"progress\", cb: \"downloadprogress\", pb: \"uploadprogress\" };\r\nfunction ac() { }\r\nac.prototype.a = null;\r\nfunction bc(a) { var b; (b = a.a) || (b = a.a = {}); return b; }\r\nfunction cc() { }\r\nvar J = { OPEN: \"a\", $a: \"b\", Ea: \"c\", jb: \"d\" };\r\nfunction dc() { y.call(this, \"d\"); }\r\nr(dc, y);\r\nfunction ec() { y.call(this, \"c\"); }\r\nr(ec, y);\r\nvar fc;\r\nfunction gc() { }\r\nr(gc, ac);\r\nfc = new gc;\r\nfunction K(a, b, c, d) { this.g = a; this.c = b; this.f = c; this.T = d || 1; this.J = new E(this); this.P = hc; a = Ja ? 125 : void 0; this.R = new Hb(a); this.B = null; this.b = !1; this.j = this.l = this.i = this.H = this.u = this.U = this.o = null; this.s = []; this.a = null; this.D = 0; this.h = this.m = null; this.N = -1; this.A = !1; this.O = 0; this.F = null; this.W = this.C = this.V = this.I = !1; }\r\nvar hc = 45E3, ic = {}, jc = {};\r\ng = K.prototype;\r\ng.setTimeout = function (a) { this.P = a; };\r\nfunction kc(a, b, c) { a.H = 1; a.i = lc(L(b)); a.j = c; a.I = !0; mc(a, null); }\r\nfunction mc(a, b) { a.u = q(); M(a); a.l = L(a.i); var c = a.l, d = a.T; Array.isArray(d) || (d = [String(d)]); nc(c.b, \"t\", d); a.D = 0; a.a = oc(a.g, a.g.C ? b : null); 0 < a.O && (a.F = new Lb(p(a.Ca, a, a.a), a.O)); Nb(a.J, a.a, \"readystatechange\", a.Wa); b = a.B ? Ba(a.B) : {}; a.j ? (a.m || (a.m = \"POST\"), b[\"Content-Type\"] = \"application/x-www-form-urlencoded\", a.a.ba(a.l, a.m, a.j, b)) : (a.m = \"GET\", a.a.ba(a.l, a.m, null, b)); G(1); Qb(a.c, a.m, a.l, a.f, a.T, a.j); }\r\ng.Wa = function (a) { a = a.target; var b = this.F; b && 3 == N(a) ? b.f() : this.Ca(a); };\r\ng.Ca = function (a) {\r\n try {\r\n if (a == this.a)\r\n a: {\r\n var b = N(this.a), c = this.a.ua(), d = this.a.X();\r\n if (!(3 > b || 3 == b && !Ja && !this.a.$())) {\r\n this.A || 4 != b || 7 == c || (8 == c || 0 >= d ? G(3) : G(2));\r\n pc(this);\r\n var e = this.a.X();\r\n this.N = e;\r\n var f = this.a.$();\r\n this.b = 200 == e;\r\n Rb(this.c, this.m, this.l, this.f, this.T, b, e);\r\n if (this.b) {\r\n if (this.V && !this.C) {\r\n b: {\r\n if (this.a) {\r\n var h, m = this.a;\r\n if ((h = m.a ? m.a.getResponseHeader(\"X-HTTP-Initial-Response\") : null) && !ta(h)) {\r\n var l = h;\r\n break b;\r\n }\r\n }\r\n l = null;\r\n }\r\n if (l)\r\n F(this.c, this.f, l, \"Initial handshake response via X-HTTP-Initial-Response\"),\r\n this.C = !0, qc(this, l);\r\n else {\r\n this.b = !1;\r\n this.h = 3;\r\n H(12);\r\n O(this);\r\n rc(this);\r\n break a;\r\n }\r\n }\r\n this.I ? (tc(this, b, f), Ja && this.b && 3 == b && (Nb(this.J, this.R, \"tick\", this.Va), this.R.start())) : (F(this.c, this.f, f, null), qc(this, f));\r\n 4 == b && O(this);\r\n this.b && !this.A && (4 == b ? uc(this.g, this) : (this.b = !1, M(this)));\r\n }\r\n else\r\n 400 == e && 0 < f.indexOf(\"Unknown SID\") ? (this.h = 3, H(12)) : (this.h = 0, H(13)), O(this), rc(this);\r\n }\r\n }\r\n }\r\n catch (t) { }\r\n finally { }\r\n};\r\nfunction tc(a, b, c) { for (var d = !0; !a.A && a.D < c.length;) {\r\n var e = vc(a, c);\r\n if (e == jc) {\r\n 4 == b && (a.h = 4, H(14), d = !1);\r\n F(a.c, a.f, null, \"[Incomplete Response]\");\r\n break;\r\n }\r\n else if (e == ic) {\r\n a.h = 4;\r\n H(15);\r\n F(a.c, a.f, c, \"[Invalid Chunk]\");\r\n d = !1;\r\n break;\r\n }\r\n else\r\n F(a.c, a.f, e, null), qc(a, e);\r\n} 4 == b && 0 == c.length && (a.h = 1, H(16), d = !1); a.b = a.b && d; d ? 0 < c.length && !a.W && (a.W = !0, b = a.g, b.a == a && b.V && !b.F && (b.c.info(\"Great, no buffering proxy detected. Bytes received: \" + c.length), xc(b), b.F = !0)) : (F(a.c, a.f, c, \"[Invalid Chunked Response]\"), O(a), rc(a)); }\r\ng.Va = function () { if (this.a) {\r\n var a = N(this.a), b = this.a.$();\r\n this.D < b.length && (pc(this), tc(this, a, b), this.b && 4 != a && M(this));\r\n} };\r\nfunction vc(a, b) { var c = a.D, d = b.indexOf(\"\\n\", c); if (-1 == d)\r\n return jc; c = Number(b.substring(c, d)); if (isNaN(c))\r\n return ic; d += 1; if (d + c > b.length)\r\n return jc; b = b.substr(d, c); a.D = d + c; return b; }\r\ng.cancel = function () { this.A = !0; O(this); };\r\nfunction M(a) { a.U = q() + a.P; yc(a, a.P); }\r\nfunction yc(a, b) { if (null != a.o)\r\n throw Error(\"WatchDog timer not null\"); a.o = I(p(a.Ua, a), b); }\r\nfunction pc(a) { a.o && (k.clearTimeout(a.o), a.o = null); }\r\ng.Ua = function () { this.o = null; var a = q(); 0 <= a - this.U ? (Tb(this.c, this.l), 2 != this.H && (G(3), H(17)), O(this), this.h = 2, rc(this)) : yc(this, this.U - a); };\r\nfunction rc(a) { 0 == a.g.v || a.A || uc(a.g, a); }\r\nfunction O(a) { pc(a); var b = a.F; b && \"function\" == typeof b.ja && b.ja(); a.F = null; Ib(a.R); Ob(a.J); a.a && (b = a.a, a.a = null, b.abort(), b.ja()); }\r\nfunction qc(a, b) {\r\n try {\r\n var c = a.g;\r\n if (0 != c.v && (c.a == a || zc(c.b, a)))\r\n if (c.I = a.N, !a.C && zc(c.b, a) && 3 == c.v) {\r\n try {\r\n var d = c.ka.a.parse(b);\r\n }\r\n catch (sc) {\r\n d = null;\r\n }\r\n if (Array.isArray(d) && 3 == d.length) {\r\n var e = d;\r\n if (0 == e[0])\r\n a: {\r\n if (!c.j) {\r\n if (c.a)\r\n if (c.a.u + 3E3 < a.u)\r\n Ac(c), Bc(c);\r\n else\r\n break a;\r\n Cc(c);\r\n H(18);\r\n }\r\n }\r\n else\r\n c.oa = e[1], 0 < c.oa - c.P && 37500 > e[2] && c.H && 0 == c.o && !c.m && (c.m = I(p(c.Ra, c), 6E3));\r\n if (1 >= Dc(c.b) && c.ea) {\r\n try {\r\n c.ea();\r\n }\r\n catch (sc) { }\r\n c.ea = void 0;\r\n }\r\n }\r\n else\r\n P(c, 11);\r\n }\r\n else if ((a.C || c.a == a) && Ac(c), !ta(b))\r\n for (b = d = c.ka.a.parse(b), d = 0; d < b.length; d++)\r\n if (e =\r\n b[d], c.P = e[0], e = e[1], 2 == c.v)\r\n if (\"c\" == e[0]) {\r\n c.J = e[1];\r\n c.ga = e[2];\r\n var f = e[3];\r\n null != f && (c.ha = f, c.c.info(\"VER=\" + c.ha));\r\n var h = e[4];\r\n null != h && (c.pa = h, c.c.info(\"SVER=\" + c.pa));\r\n var m = e[5];\r\n if (null != m && \"number\" === typeof m && 0 < m) {\r\n var l = 1.5 * m;\r\n c.D = l;\r\n c.c.info(\"backChannelRequestTimeoutMs_=\" + l);\r\n }\r\n l = c;\r\n var t = a.a;\r\n if (t) {\r\n var B = t.a ? t.a.getResponseHeader(\"X-Client-Wire-Protocol\") : null;\r\n if (B) {\r\n var z = l.b;\r\n !z.a && (v(B, \"spdy\") || v(B, \"quic\") || v(B, \"h2\")) && (z.f = z.g, z.a = new Set, z.b && (Ec(z, z.b), z.b = null));\r\n }\r\n if (l.A) {\r\n var qb = t.a ? t.a.getResponseHeader(\"X-HTTP-Session-Id\") :\r\n null;\r\n qb && (l.na = qb, Q(l.B, l.A, qb));\r\n }\r\n }\r\n c.v = 3;\r\n c.f && c.f.ta();\r\n c.V && (c.N = q() - a.u, c.c.info(\"Handshake RTT: \" + c.N + \"ms\"));\r\n l = c;\r\n var va = a;\r\n l.la = Fc(l, l.C ? l.ga : null, l.fa);\r\n if (va.C) {\r\n Gc(l.b, va);\r\n var wa = va, wc = l.D;\r\n wc && wa.setTimeout(wc);\r\n wa.o && (pc(wa), M(wa));\r\n l.a = va;\r\n }\r\n else\r\n Hc(l);\r\n 0 < c.g.length && Ic(c);\r\n }\r\n else\r\n \"stop\" != e[0] && \"close\" != e[0] || P(c, 7);\r\n else\r\n 3 == c.v && (\"stop\" == e[0] || \"close\" == e[0] ? \"stop\" == e[0] ? P(c, 7) : Jc(c) : \"noop\" != e[0] && c.f && c.f.sa(e), c.o = 0);\r\n G(4);\r\n }\r\n catch (sc) { }\r\n}\r\nfunction Kc(a) { if (a.K && \"function\" == typeof a.K)\r\n return a.K(); if (\"string\" === typeof a)\r\n return a.split(\"\"); if (ca(a)) {\r\n for (var b = [], c = a.length, d = 0; d < c; d++)\r\n b.push(a[d]);\r\n return b;\r\n} b = []; c = 0; for (d in a)\r\n b[c++] = a[d]; return a = b; }\r\nfunction Lc(a, b) { if (a.forEach && \"function\" == typeof a.forEach)\r\n a.forEach(b, void 0);\r\nelse if (ca(a) || \"string\" === typeof a)\r\n oa(a, b, void 0);\r\nelse {\r\n if (a.L && \"function\" == typeof a.L)\r\n var c = a.L();\r\n else if (a.K && \"function\" == typeof a.K)\r\n c = void 0;\r\n else if (ca(a) || \"string\" === typeof a) {\r\n c = [];\r\n for (var d = a.length, e = 0; e < d; e++)\r\n c.push(e);\r\n }\r\n else\r\n for (e in c = [], d = 0, a)\r\n c[d++] = e;\r\n d = Kc(a);\r\n e = d.length;\r\n for (var f = 0; f < e; f++)\r\n b.call(void 0, d[f], c && c[f], a);\r\n} }\r\nfunction R(a, b) { this.b = {}; this.a = []; this.c = 0; var c = arguments.length; if (1 < c) {\r\n if (c % 2)\r\n throw Error(\"Uneven number of arguments\");\r\n for (var d = 0; d < c; d += 2)\r\n this.set(arguments[d], arguments[d + 1]);\r\n}\r\nelse if (a)\r\n if (a instanceof R)\r\n for (c = a.L(), d = 0; d < c.length; d++)\r\n this.set(c[d], a.get(c[d]));\r\n else\r\n for (d in a)\r\n this.set(d, a[d]); }\r\ng = R.prototype;\r\ng.K = function () { Mc(this); for (var a = [], b = 0; b < this.a.length; b++)\r\n a.push(this.b[this.a[b]]); return a; };\r\ng.L = function () { Mc(this); return this.a.concat(); };\r\nfunction Mc(a) { if (a.c != a.a.length) {\r\n for (var b = 0, c = 0; b < a.a.length;) {\r\n var d = a.a[b];\r\n S(a.b, d) && (a.a[c++] = d);\r\n b++;\r\n }\r\n a.a.length = c;\r\n} if (a.c != a.a.length) {\r\n var e = {};\r\n for (c = b = 0; b < a.a.length;)\r\n d = a.a[b], S(e, d) || (a.a[c++] = d, e[d] = 1), b++;\r\n a.a.length = c;\r\n} }\r\ng.get = function (a, b) { return S(this.b, a) ? this.b[a] : b; };\r\ng.set = function (a, b) { S(this.b, a) || (this.c++, this.a.push(a)); this.b[a] = b; };\r\ng.forEach = function (a, b) { for (var c = this.L(), d = 0; d < c.length; d++) {\r\n var e = c[d], f = this.get(e);\r\n a.call(b, f, e, this);\r\n} };\r\nfunction S(a, b) { return Object.prototype.hasOwnProperty.call(a, b); }\r\nvar Nc = /^(?:([^:/?#.]+):)?(?:\\/\\/(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$/;\r\nfunction Oc(a, b) { if (a) {\r\n a = a.split(\"&\");\r\n for (var c = 0; c < a.length; c++) {\r\n var d = a[c].indexOf(\"=\"), e = null;\r\n if (0 <= d) {\r\n var f = a[c].substring(0, d);\r\n e = a[c].substring(d + 1);\r\n }\r\n else\r\n f = a[c];\r\n b(f, e ? decodeURIComponent(e.replace(/\\+/g, \" \")) : \"\");\r\n }\r\n} }\r\nfunction T(a, b) { this.c = this.j = this.f = \"\"; this.h = null; this.i = this.g = \"\"; this.a = !1; if (a instanceof T) {\r\n this.a = void 0 !== b ? b : a.a;\r\n Pc(this, a.f);\r\n this.j = a.j;\r\n Qc(this, a.c);\r\n Rc(this, a.h);\r\n this.g = a.g;\r\n b = a.b;\r\n var c = new U;\r\n c.c = b.c;\r\n b.a && (c.a = new R(b.a), c.b = b.b);\r\n Sc(this, c);\r\n this.i = a.i;\r\n}\r\nelse\r\n a && (c = String(a).match(Nc)) ? (this.a = !!b, Pc(this, c[1] || \"\", !0), this.j = Tc(c[2] || \"\"), Qc(this, c[3] || \"\", !0), Rc(this, c[4]), this.g = Tc(c[5] || \"\", !0), Sc(this, c[6] || \"\", !0), this.i = Tc(c[7] || \"\")) : (this.a = !!b, this.b = new U(null, this.a)); }\r\nT.prototype.toString = function () { var a = [], b = this.f; b && a.push(Uc(b, Vc, !0), \":\"); var c = this.c; if (c || \"file\" == b)\r\n a.push(\"//\"), (b = this.j) && a.push(Uc(b, Vc, !0), \"@\"), a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g, \"%$1\")), c = this.h, null != c && a.push(\":\", String(c)); if (c = this.g)\r\n this.c && \"/\" != c.charAt(0) && a.push(\"/\"), a.push(Uc(c, \"/\" == c.charAt(0) ? Wc : Xc, !0)); (c = this.b.toString()) && a.push(\"?\", c); (c = this.i) && a.push(\"#\", Uc(c, Yc)); return a.join(\"\"); };\r\nfunction L(a) { return new T(a); }\r\nfunction Pc(a, b, c) { a.f = c ? Tc(b, !0) : b; a.f && (a.f = a.f.replace(/:$/, \"\")); }\r\nfunction Qc(a, b, c) { a.c = c ? Tc(b, !0) : b; }\r\nfunction Rc(a, b) { if (b) {\r\n b = Number(b);\r\n if (isNaN(b) || 0 > b)\r\n throw Error(\"Bad port number \" + b);\r\n a.h = b;\r\n}\r\nelse\r\n a.h = null; }\r\nfunction Sc(a, b, c) { b instanceof U ? (a.b = b, Zc(a.b, a.a)) : (c || (b = Uc(b, $c)), a.b = new U(b, a.a)); }\r\nfunction Q(a, b, c) { a.b.set(b, c); }\r\nfunction lc(a) { Q(a, \"zx\", Math.floor(2147483648 * Math.random()).toString(36) + Math.abs(Math.floor(2147483648 * Math.random()) ^ q()).toString(36)); return a; }\r\nfunction ad(a) { return a instanceof T ? L(a) : new T(a, void 0); }\r\nfunction bd(a, b, c, d) { var e = new T(null, void 0); a && Pc(e, a); b && Qc(e, b); c && Rc(e, c); d && (e.g = d); return e; }\r\nfunction Tc(a, b) { return a ? b ? decodeURI(a.replace(/%25/g, \"%2525\")) : decodeURIComponent(a) : \"\"; }\r\nfunction Uc(a, b, c) { return \"string\" === typeof a ? (a = encodeURI(a).replace(b, cd), c && (a = a.replace(/%25([0-9a-fA-F]{2})/g, \"%$1\")), a) : null; }\r\nfunction cd(a) { a = a.charCodeAt(0); return \"%\" + (a >> 4 & 15).toString(16) + (a & 15).toString(16); }\r\nvar Vc = /[#\\/\\?@]/g, Xc = /[#\\?:]/g, Wc = /[#\\?]/g, $c = /[#\\?@]/g, Yc = /#/g;\r\nfunction U(a, b) { this.b = this.a = null; this.c = a || null; this.f = !!b; }\r\nfunction V(a) { a.a || (a.a = new R, a.b = 0, a.c && Oc(a.c, function (b, c) { a.add(decodeURIComponent(b.replace(/\\+/g, \" \")), c); })); }\r\ng = U.prototype;\r\ng.add = function (a, b) { V(this); this.c = null; a = W(this, a); var c = this.a.get(a); c || this.a.set(a, c = []); c.push(b); this.b += 1; return this; };\r\nfunction dd(a, b) { V(a); b = W(a, b); S(a.a.b, b) && (a.c = null, a.b -= a.a.get(b).length, a = a.a, S(a.b, b) && (delete a.b[b], a.c--, a.a.length > 2 * a.c && Mc(a))); }\r\nfunction ed(a, b) { V(a); b = W(a, b); return S(a.a.b, b); }\r\ng.forEach = function (a, b) { V(this); this.a.forEach(function (c, d) { oa(c, function (e) { a.call(b, e, d, this); }, this); }, this); };\r\ng.L = function () { V(this); for (var a = this.a.K(), b = this.a.L(), c = [], d = 0; d < b.length; d++)\r\n for (var e = a[d], f = 0; f < e.length; f++)\r\n c.push(b[d]); return c; };\r\ng.K = function (a) { V(this); var b = []; if (\"string\" === typeof a)\r\n ed(this, a) && (b = ra(b, this.a.get(W(this, a))));\r\nelse {\r\n a = this.a.K();\r\n for (var c = 0; c < a.length; c++)\r\n b = ra(b, a[c]);\r\n} return b; };\r\ng.set = function (a, b) { V(this); this.c = null; a = W(this, a); ed(this, a) && (this.b -= this.a.get(a).length); this.a.set(a, [b]); this.b += 1; return this; };\r\ng.get = function (a, b) { if (!a)\r\n return b; a = this.K(a); return 0 < a.length ? String(a[0]) : b; };\r\nfunction nc(a, b, c) { dd(a, b); 0 < c.length && (a.c = null, a.a.set(W(a, b), sa(c)), a.b += c.length); }\r\ng.toString = function () { if (this.c)\r\n return this.c; if (!this.a)\r\n return \"\"; for (var a = [], b = this.a.L(), c = 0; c < b.length; c++) {\r\n var d = b[c], e = encodeURIComponent(String(d));\r\n d = this.K(d);\r\n for (var f = 0; f < d.length; f++) {\r\n var h = e;\r\n \"\" !== d[f] && (h += \"=\" + encodeURIComponent(String(d[f])));\r\n a.push(h);\r\n }\r\n} return this.c = a.join(\"&\"); };\r\nfunction W(a, b) { b = String(b); a.f && (b = b.toLowerCase()); return b; }\r\nfunction Zc(a, b) { b && !a.f && (V(a), a.c = null, a.a.forEach(function (c, d) { var e = d.toLowerCase(); d != e && (dd(this, d), nc(this, e, c)); }, a)); a.f = b; }\r\nfunction fd(a, b) { this.b = a; this.a = b; }\r\nfunction gd(a) { this.g = a || hd; k.PerformanceNavigationTiming ? (a = k.performance.getEntriesByType(\"navigation\"), a = 0 < a.length && (\"hq\" == a[0].nextHopProtocol || \"h2\" == a[0].nextHopProtocol)) : a = !!(k.ia && k.ia.ya && k.ia.ya() && k.ia.ya().qb); this.f = a ? this.g : 1; this.a = null; 1 < this.f && (this.a = new Set); this.b = null; this.c = []; }\r\nvar hd = 10;\r\nfunction id(a) { return a.b ? !0 : a.a ? a.a.size >= a.f : !1; }\r\nfunction Dc(a) { return a.b ? 1 : a.a ? a.a.size : 0; }\r\nfunction zc(a, b) { return a.b ? a.b == b : a.a ? a.a.has(b) : !1; }\r\nfunction Ec(a, b) { a.a ? a.a.add(b) : a.b = b; }\r\nfunction Gc(a, b) { a.b && a.b == b ? a.b = null : a.a && a.a.has(b) && a.a.delete(b); }\r\ngd.prototype.cancel = function () {\r\n var e_1, _a;\r\n this.c = jd(this);\r\n if (this.b)\r\n this.b.cancel(), this.b = null;\r\n else if (this.a && 0 !== this.a.size) {\r\n try {\r\n for (var _b = __values(this.a.values()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var a = _c.value;\r\n a.cancel();\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n this.a.clear();\r\n }\r\n};\r\nfunction jd(a) {\r\n var e_2, _a;\r\n if (null != a.b)\r\n return a.c.concat(a.b.s);\r\n if (null != a.a && 0 !== a.a.size) {\r\n var b = a.c;\r\n try {\r\n for (var _b = __values(a.a.values()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var c = _c.value;\r\n b = b.concat(c.s);\r\n }\r\n }\r\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_2) throw e_2.error; }\r\n }\r\n return b;\r\n }\r\n return sa(a.c);\r\n}\r\nfunction kd() { }\r\nkd.prototype.stringify = function (a) { return k.JSON.stringify(a, void 0); };\r\nkd.prototype.parse = function (a) { return k.JSON.parse(a, void 0); };\r\nfunction ld() { this.a = new kd; }\r\nfunction md(a, b, c) { var d = c || \"\"; try {\r\n Lc(a, function (e, f) { var h = e; n(e) && (h = vb(e)); b.push(d + f + \"=\" + encodeURIComponent(h)); });\r\n}\r\ncatch (e) {\r\n throw b.push(d + \"type=\" + encodeURIComponent(\"_badmap\")), e;\r\n} }\r\nfunction nd(a, b) { var c = new Pb; if (k.Image) {\r\n var d = new Image;\r\n d.onload = ka(od, c, d, \"TestLoadImage: loaded\", !0, b);\r\n d.onerror = ka(od, c, d, \"TestLoadImage: error\", !1, b);\r\n d.onabort = ka(od, c, d, \"TestLoadImage: abort\", !1, b);\r\n d.ontimeout = ka(od, c, d, \"TestLoadImage: timeout\", !1, b);\r\n k.setTimeout(function () { if (d.ontimeout)\r\n d.ontimeout(); }, 1E4);\r\n d.src = a;\r\n}\r\nelse\r\n b(!1); }\r\nfunction od(a, b, c, d, e) { try {\r\n b.onload = null, b.onerror = null, b.onabort = null, b.ontimeout = null, e(d);\r\n}\r\ncatch (f) { } }\r\nvar pd = k.JSON.parse;\r\nfunction X(a) { D.call(this); this.headers = new R; this.H = a || null; this.b = !1; this.s = this.a = null; this.B = \"\"; this.h = 0; this.f = \"\"; this.g = this.A = this.l = this.u = !1; this.o = 0; this.m = null; this.I = qd; this.D = this.F = !1; }\r\nr(X, D);\r\nvar qd = \"\", rd = /^https?$/i, sd = [\"POST\", \"PUT\"];\r\ng = X.prototype;\r\ng.ba = function (a, b, c, d) {\r\n if (this.a)\r\n throw Error(\"[goog.net.XhrIo] Object is active with another request=\" + this.B + \"; newUri=\" + a);\r\n b = b ? b.toUpperCase() : \"GET\";\r\n this.B = a;\r\n this.f = \"\";\r\n this.h = 0;\r\n this.u = !1;\r\n this.b = !0;\r\n this.a = new XMLHttpRequest;\r\n this.s = this.H ? bc(this.H) : bc(fc);\r\n this.a.onreadystatechange = p(this.za, this);\r\n try {\r\n this.A = !0, this.a.open(b, String(a), !0), this.A = !1;\r\n }\r\n catch (f) {\r\n td(this, f);\r\n return;\r\n }\r\n a = c || \"\";\r\n var e = new R(this.headers);\r\n d && Lc(d, function (f, h) { e.set(h, f); });\r\n d = pa(e.L());\r\n c = k.FormData && a instanceof k.FormData;\r\n !(0 <=\r\n na(sd, b)) || d || c || e.set(\"Content-Type\", \"application/x-www-form-urlencoded;charset=utf-8\");\r\n e.forEach(function (f, h) { this.a.setRequestHeader(h, f); }, this);\r\n this.I && (this.a.responseType = this.I);\r\n \"withCredentials\" in this.a && this.a.withCredentials !== this.F && (this.a.withCredentials = this.F);\r\n try {\r\n ud(this), 0 < this.o && ((this.D = vd(this.a)) ? (this.a.timeout = this.o, this.a.ontimeout = p(this.xa, this)) : this.m = Jb(this.xa, this.o, this)), this.l = !0, this.a.send(a), this.l = !1;\r\n }\r\n catch (f) {\r\n td(this, f);\r\n }\r\n};\r\nfunction vd(a) { return x && Ra(9) && \"number\" === typeof a.timeout && void 0 !== a.ontimeout; }\r\nfunction qa(a) { return \"content-type\" == a.toLowerCase(); }\r\ng.xa = function () { \"undefined\" != typeof goog && this.a && (this.f = \"Timed out after \" + this.o + \"ms, aborting\", this.h = 8, this.dispatchEvent(\"timeout\"), this.abort(8)); };\r\nfunction td(a, b) { a.b = !1; a.a && (a.g = !0, a.a.abort(), a.g = !1); a.f = b; a.h = 5; wd(a); xd(a); }\r\nfunction wd(a) { a.u || (a.u = !0, a.dispatchEvent(\"complete\"), a.dispatchEvent(\"error\")); }\r\ng.abort = function (a) { this.a && this.b && (this.b = !1, this.g = !0, this.a.abort(), this.g = !1, this.h = a || 7, this.dispatchEvent(\"complete\"), this.dispatchEvent(\"abort\"), xd(this)); };\r\ng.G = function () { this.a && (this.b && (this.b = !1, this.g = !0, this.a.abort(), this.g = !1), xd(this, !0)); X.S.G.call(this); };\r\ng.za = function () { this.j || (this.A || this.l || this.g ? yd(this) : this.Ta()); };\r\ng.Ta = function () { yd(this); };\r\nfunction yd(a) {\r\n if (a.b && \"undefined\" != typeof goog && (!a.s[1] || 4 != N(a) || 2 != a.X()))\r\n if (a.l && 4 == N(a))\r\n Jb(a.za, 0, a);\r\n else if (a.dispatchEvent(\"readystatechange\"), 4 == N(a)) {\r\n a.b = !1;\r\n try {\r\n var b = a.X();\r\n a: switch (b) {\r\n case 200:\r\n case 201:\r\n case 202:\r\n case 204:\r\n case 206:\r\n case 304:\r\n case 1223:\r\n var c = !0;\r\n break a;\r\n default: c = !1;\r\n }\r\n var d;\r\n if (!(d = c)) {\r\n var e;\r\n if (e = 0 === b) {\r\n var f = String(a.B).match(Nc)[1] || null;\r\n if (!f && k.self && k.self.location) {\r\n var h = k.self.location.protocol;\r\n f = h.substr(0, h.length - 1);\r\n }\r\n e = !rd.test(f ? f.toLowerCase() : \"\");\r\n }\r\n d = e;\r\n }\r\n if (d)\r\n a.dispatchEvent(\"complete\"),\r\n a.dispatchEvent(\"success\");\r\n else {\r\n a.h = 6;\r\n try {\r\n var m = 2 < N(a) ? a.a.statusText : \"\";\r\n }\r\n catch (l) {\r\n m = \"\";\r\n }\r\n a.f = m + \" [\" + a.X() + \"]\";\r\n wd(a);\r\n }\r\n }\r\n finally {\r\n xd(a);\r\n }\r\n }\r\n}\r\nfunction xd(a, b) { if (a.a) {\r\n ud(a);\r\n var c = a.a, d = a.s[0] ? aa : null;\r\n a.a = null;\r\n a.s = null;\r\n b || a.dispatchEvent(\"ready\");\r\n try {\r\n c.onreadystatechange = d;\r\n }\r\n catch (e) { }\r\n} }\r\nfunction ud(a) { a.a && a.D && (a.a.ontimeout = null); a.m && (k.clearTimeout(a.m), a.m = null); }\r\nfunction N(a) { return a.a ? a.a.readyState : 0; }\r\ng.X = function () { try {\r\n return 2 < N(this) ? this.a.status : -1;\r\n}\r\ncatch (a) {\r\n return -1;\r\n} };\r\ng.$ = function () { try {\r\n return this.a ? this.a.responseText : \"\";\r\n}\r\ncatch (a) {\r\n return \"\";\r\n} };\r\ng.Na = function (a) { if (this.a) {\r\n var b = this.a.responseText;\r\n a && 0 == b.indexOf(a) && (b = b.substring(a.length));\r\n return pd(b);\r\n} };\r\ng.ua = function () { return this.h; };\r\ng.Qa = function () { return \"string\" === typeof this.f ? this.f : String(this.f); };\r\nfunction zd(a) { var b = \"\"; Aa(a, function (c, d) { b += d; b += \":\"; b += c; b += \"\\r\\n\"; }); return b; }\r\nfunction Ad(a, b, c) { a: {\r\n for (d in c) {\r\n var d = !1;\r\n break a;\r\n }\r\n d = !0;\r\n} d || (c = zd(c), \"string\" === typeof a ? (null != c && encodeURIComponent(String(c))) : Q(a, b, c)); }\r\nfunction Bd(a, b, c) { return c && c.internalChannelParams ? c.internalChannelParams[a] || b : b; }\r\nfunction Cd(a) {\r\n this.pa = 0;\r\n this.g = [];\r\n this.c = new Pb;\r\n this.ga = this.la = this.B = this.fa = this.a = this.na = this.A = this.W = this.i = this.O = this.l = null;\r\n this.La = this.R = 0;\r\n this.Ia = Bd(\"failFast\", !1, a);\r\n this.H = this.m = this.j = this.h = this.f = null;\r\n this.T = !0;\r\n this.I = this.oa = this.P = -1;\r\n this.U = this.o = this.u = 0;\r\n this.Fa = Bd(\"baseRetryDelayMs\", 5E3, a);\r\n this.Ma = Bd(\"retryDelaySeedMs\", 1E4, a);\r\n this.Ja = Bd(\"forwardChannelMaxRetries\", 2, a);\r\n this.ma = Bd(\"forwardChannelRequestTimeoutMs\", 2E4, a);\r\n this.Ka = a && a.g || void 0;\r\n this.D = void 0;\r\n this.C = a && a.supportsCrossDomainXhr ||\r\n !1;\r\n this.J = \"\";\r\n this.b = new gd(a && a.concurrentRequestLimit);\r\n this.ka = new ld;\r\n this.da = a && a.fastHandshake || !1;\r\n this.Ga = a && a.b || !1;\r\n a && a.f && (this.c.a = !1);\r\n a && a.forceLongPolling && (this.T = !1);\r\n this.V = !this.da && this.T && a && a.c || !1;\r\n this.ea = void 0;\r\n this.N = 0;\r\n this.F = !1;\r\n this.s = null;\r\n}\r\ng = Cd.prototype;\r\ng.ha = 8;\r\ng.v = 1;\r\nfunction Jc(a) { Dd(a); if (3 == a.v) {\r\n var b = a.R++, c = L(a.B);\r\n Q(c, \"SID\", a.J);\r\n Q(c, \"RID\", b);\r\n Q(c, \"TYPE\", \"terminate\");\r\n Ed(a, c);\r\n b = new K(a, a.c, b, void 0);\r\n b.H = 2;\r\n b.i = lc(L(c));\r\n c = !1;\r\n k.navigator && k.navigator.sendBeacon && (c = k.navigator.sendBeacon(b.i.toString(), \"\"));\r\n !c && k.Image && ((new Image).src = b.i, c = !0);\r\n c || (b.a = oc(b.g, null), b.a.ba(b.i));\r\n b.u = q();\r\n M(b);\r\n} Fd(a); }\r\nfunction Bc(a) { a.a && (xc(a), a.a.cancel(), a.a = null); }\r\nfunction Dd(a) { Bc(a); a.j && (k.clearTimeout(a.j), a.j = null); Ac(a); a.b.cancel(); a.h && (\"number\" === typeof a.h && k.clearTimeout(a.h), a.h = null); }\r\nfunction Gd(a, b) { a.g.push(new fd(a.La++, b)); 3 == a.v && Ic(a); }\r\nfunction Ic(a) { id(a.b) || a.h || (a.h = !0, Cb(a.Ba, a), a.u = 0); }\r\nfunction Hd(a, b) { if (Dc(a.b) >= a.b.f - (a.h ? 1 : 0))\r\n return !1; if (a.h)\r\n return a.g = b.s.concat(a.g), !0; if (1 == a.v || 2 == a.v || a.u >= (a.Ia ? 0 : a.Ja))\r\n return !1; a.h = I(p(a.Ba, a, b), Id(a, a.u)); a.u++; return !0; }\r\ng.Ba = function (a) {\r\n if (this.h)\r\n if (this.h = null, 1 == this.v) {\r\n if (!a) {\r\n this.R = Math.floor(1E5 * Math.random());\r\n a = this.R++;\r\n var b = new K(this, this.c, a, void 0), c = this.l;\r\n this.O && (c ? (c = Ba(c), Da(c, this.O)) : c = this.O);\r\n null === this.i && (b.B = c);\r\n var d;\r\n if (this.da)\r\n a: {\r\n for (var e = d = 0; e < this.g.length; e++) {\r\n b: {\r\n var f = this.g[e];\r\n if (\"__data__\" in f.a && (f = f.a.__data__, \"string\" === typeof f)) {\r\n f = f.length;\r\n break b;\r\n }\r\n f = void 0;\r\n }\r\n if (void 0 === f)\r\n break;\r\n d += f;\r\n if (4096 < d) {\r\n d = e;\r\n break a;\r\n }\r\n if (4096 === d || e === this.g.length - 1) {\r\n d = e + 1;\r\n break a;\r\n }\r\n }\r\n d = 1E3;\r\n }\r\n else\r\n d = 1E3;\r\n d = Jd(this, b, d);\r\n e = L(this.B);\r\n Q(e, \"RID\", a);\r\n Q(e, \"CVER\", 22);\r\n this.A && Q(e, \"X-HTTP-Session-Id\", this.A);\r\n Ed(this, e);\r\n this.i && c && Ad(e, this.i, c);\r\n Ec(this.b, b);\r\n this.Ga && Q(e, \"TYPE\", \"init\");\r\n this.da ? (Q(e, \"$req\", d), Q(e, \"SID\", \"null\"), b.V = !0, kc(b, e, null)) : kc(b, e, d);\r\n this.v = 2;\r\n }\r\n }\r\n else\r\n 3 == this.v && (a ? Kd(this, a) : 0 == this.g.length || id(this.b) || Kd(this));\r\n};\r\nfunction Kd(a, b) { var c; b ? c = b.f : c = a.R++; var d = L(a.B); Q(d, \"SID\", a.J); Q(d, \"RID\", c); Q(d, \"AID\", a.P); Ed(a, d); a.i && a.l && Ad(d, a.i, a.l); c = new K(a, a.c, c, a.u + 1); null === a.i && (c.B = a.l); b && (a.g = b.s.concat(a.g)); b = Jd(a, c, 1E3); c.setTimeout(Math.round(.5 * a.ma) + Math.round(.5 * a.ma * Math.random())); Ec(a.b, c); kc(c, d, b); }\r\nfunction Ed(a, b) { a.f && Lc({}, function (c, d) { Q(b, d, c); }); }\r\nfunction Jd(a, b, c) { c = Math.min(a.g.length, c); var d = a.f ? p(a.f.Ha, a.f, a) : null; a: for (var e = a.g, f = -1;;) {\r\n var h = [\"count=\" + c];\r\n -1 == f ? 0 < c ? (f = e[0].b, h.push(\"ofs=\" + f)) : f = 0 : h.push(\"ofs=\" + f);\r\n for (var m = !0, l = 0; l < c; l++) {\r\n var t = e[l].b, B = e[l].a;\r\n t -= f;\r\n if (0 > t)\r\n f = Math.max(0, e[l].b - 100), m = !1;\r\n else\r\n try {\r\n md(B, h, \"req\" + t + \"_\");\r\n }\r\n catch (z) {\r\n d && d(B);\r\n }\r\n }\r\n if (m) {\r\n d = h.join(\"&\");\r\n break a;\r\n }\r\n} a = a.g.splice(0, c); b.s = a; return d; }\r\nfunction Hc(a) { a.a || a.j || (a.U = 1, Cb(a.Aa, a), a.o = 0); }\r\nfunction Cc(a) { if (a.a || a.j || 3 <= a.o)\r\n return !1; a.U++; a.j = I(p(a.Aa, a), Id(a, a.o)); a.o++; return !0; }\r\ng.Aa = function () { this.j = null; Ld(this); if (this.V && !(this.F || null == this.a || 0 >= this.N)) {\r\n var a = 2 * this.N;\r\n this.c.info(\"BP detection timer enabled: \" + a);\r\n this.s = I(p(this.Sa, this), a);\r\n} };\r\ng.Sa = function () { this.s && (this.s = null, this.c.info(\"BP detection timeout reached.\"), this.c.info(\"Buffering proxy detected and switch to long-polling!\"), this.H = !1, this.F = !0, Bc(this), Ld(this)); };\r\nfunction xc(a) { null != a.s && (k.clearTimeout(a.s), a.s = null); }\r\nfunction Ld(a) { a.a = new K(a, a.c, \"rpc\", a.U); null === a.i && (a.a.B = a.l); a.a.O = 0; var b = L(a.la); Q(b, \"RID\", \"rpc\"); Q(b, \"SID\", a.J); Q(b, \"CI\", a.H ? \"0\" : \"1\"); Q(b, \"AID\", a.P); Ed(a, b); Q(b, \"TYPE\", \"xmlhttp\"); a.i && a.l && Ad(b, a.i, a.l); a.D && a.a.setTimeout(a.D); var c = a.a; a = a.ga; c.H = 1; c.i = lc(L(b)); c.j = null; c.I = !0; mc(c, a); }\r\ng.Ra = function () { null != this.m && (this.m = null, Bc(this), Cc(this), H(19)); };\r\nfunction Ac(a) { null != a.m && (k.clearTimeout(a.m), a.m = null); }\r\nfunction uc(a, b) { var c = null; if (a.a == b) {\r\n Ac(a);\r\n xc(a);\r\n a.a = null;\r\n var d = 2;\r\n}\r\nelse if (zc(a.b, b))\r\n c = b.s, Gc(a.b, b), d = 1;\r\nelse\r\n return; a.I = b.N; if (0 != a.v)\r\n if (b.b)\r\n if (1 == d) {\r\n c = b.j ? b.j.length : 0;\r\n b = q() - b.u;\r\n var e = a.u;\r\n d = Vb();\r\n d.dispatchEvent(new Yb(d, c, b, e));\r\n Ic(a);\r\n }\r\n else\r\n Hc(a);\r\n else if (e = b.h, 3 == e || 0 == e && 0 < a.I || !(1 == d && Hd(a, b) || 2 == d && Cc(a)))\r\n switch (c && 0 < c.length && (b = a.b, b.c = b.c.concat(c)), e) {\r\n case 1:\r\n P(a, 5);\r\n break;\r\n case 4:\r\n P(a, 10);\r\n break;\r\n case 3:\r\n P(a, 6);\r\n break;\r\n default: P(a, 2);\r\n } }\r\nfunction Id(a, b) { var c = a.Fa + Math.floor(Math.random() * a.Ma); a.f || (c *= 2); return c * b; }\r\nfunction P(a, b) { a.c.info(\"Error code \" + b); if (2 == b) {\r\n var c = null;\r\n a.f && (c = null);\r\n var d = p(a.Xa, a);\r\n c || (c = new T(\"//www.google.com/images/cleardot.gif\"), k.location && \"http\" == k.location.protocol || Pc(c, \"https\"), lc(c));\r\n nd(c.toString(), d);\r\n}\r\nelse\r\n H(2); a.v = 0; a.f && a.f.ra(b); Fd(a); Dd(a); }\r\ng.Xa = function (a) { a ? (this.c.info(\"Successfully pinged google.com\"), H(2)) : (this.c.info(\"Failed to ping google.com\"), H(1)); };\r\nfunction Fd(a) { a.v = 0; a.I = -1; if (a.f) {\r\n if (0 != jd(a.b).length || 0 != a.g.length)\r\n a.b.c.length = 0, sa(a.g), a.g.length = 0;\r\n a.f.qa();\r\n} }\r\nfunction Fc(a, b, c) { var d = ad(c); if (\"\" != d.c)\r\n b && Qc(d, b + \".\" + d.c), Rc(d, d.h);\r\nelse {\r\n var e = k.location;\r\n d = bd(e.protocol, b ? b + \".\" + e.hostname : e.hostname, +e.port, c);\r\n} a.W && Aa(a.W, function (f, h) { Q(d, h, f); }); b = a.A; c = a.na; b && c && Q(d, b, c); Q(d, \"VER\", a.ha); Ed(a, d); return d; }\r\nfunction oc(a, b) { if (b && !a.C)\r\n throw Error(\"Can't create secondary domain capable XhrIo object.\"); b = new X(a.Ka); b.F = a.C; return b; }\r\nfunction Md() { }\r\ng = Md.prototype;\r\ng.ta = function () { };\r\ng.sa = function () { };\r\ng.ra = function () { };\r\ng.qa = function () { };\r\ng.Ha = function () { };\r\nfunction Nd() { if (x && !(10 <= Number(Ua)))\r\n throw Error(\"Environmental error: no available transport.\"); }\r\nNd.prototype.a = function (a, b) { return new Y(a, b); };\r\nfunction Y(a, b) {\r\n D.call(this);\r\n this.a = new Cd(b);\r\n this.l = a;\r\n this.b = b && b.messageUrlParams || null;\r\n a = b && b.messageHeaders || null;\r\n b && b.clientProtocolHeaderRequired && (a ? a[\"X-Client-Protocol\"] = \"webchannel\" : a = { \"X-Client-Protocol\": \"webchannel\" });\r\n this.a.l = a;\r\n a = b && b.initMessageHeaders || null;\r\n b && b.messageContentType && (a ? a[\"X-WebChannel-Content-Type\"] = b.messageContentType : a = { \"X-WebChannel-Content-Type\": b.messageContentType });\r\n b && b.a && (a ? a[\"X-WebChannel-Client-Profile\"] = b.a : a = { \"X-WebChannel-Client-Profile\": b.a });\r\n this.a.O =\r\n a;\r\n (a = b && b.httpHeadersOverwriteParam) && !ta(a) && (this.a.i = a);\r\n this.h = b && b.supportsCrossDomainXhr || !1;\r\n this.g = b && b.sendRawJson || !1;\r\n (b = b && b.httpSessionIdParam) && !ta(b) && (this.a.A = b, a = this.b, null !== a && b in a && (a = this.b, b in a && delete a[b]));\r\n this.f = new Z(this);\r\n}\r\nr(Y, D);\r\ng = Y.prototype;\r\ng.addEventListener = function (a, b, c, d) { Y.S.addEventListener.call(this, a, b, c, d); };\r\ng.removeEventListener = function (a, b, c, d) { Y.S.removeEventListener.call(this, a, b, c, d); };\r\ng.Oa = function () { this.a.f = this.f; this.h && (this.a.C = !0); var a = this.a, b = this.l, c = this.b || void 0; H(0); a.fa = b; a.W = c || {}; a.H = a.T; a.B = Fc(a, null, a.fa); Ic(a); };\r\ng.close = function () { Jc(this.a); };\r\ng.Pa = function (a) { if (\"string\" === typeof a) {\r\n var b = {};\r\n b.__data__ = a;\r\n Gd(this.a, b);\r\n}\r\nelse\r\n this.g ? (b = {}, b.__data__ = vb(a), Gd(this.a, b)) : Gd(this.a, a); };\r\ng.G = function () { this.a.f = null; delete this.f; Jc(this.a); delete this.a; Y.S.G.call(this); };\r\nfunction Od(a) { dc.call(this); var b = a.__sm__; if (b) {\r\n a: {\r\n for (var c in b) {\r\n a = c;\r\n break a;\r\n }\r\n a = void 0;\r\n }\r\n (this.c = a) ? (a = this.c, this.data = null !== b && a in b ? b[a] : void 0) : this.data = b;\r\n}\r\nelse\r\n this.data = a; }\r\nr(Od, dc);\r\nfunction Pd() { ec.call(this); this.status = 1; }\r\nr(Pd, ec);\r\nfunction Z(a) { this.a = a; }\r\nr(Z, Md);\r\nZ.prototype.ta = function () { this.a.dispatchEvent(\"a\"); };\r\nZ.prototype.sa = function (a) { this.a.dispatchEvent(new Od(a)); };\r\nZ.prototype.ra = function (a) { this.a.dispatchEvent(new Pd(a)); };\r\nZ.prototype.qa = function () { this.a.dispatchEvent(\"b\"); }; /*\r\n\n Copyright 2017 Google LLC\r\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\n http://www.apache.org/licenses/LICENSE-2.0\r\n\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n*/\r\nNd.prototype.createWebChannel = Nd.prototype.a;\r\nY.prototype.send = Y.prototype.Pa;\r\nY.prototype.open = Y.prototype.Oa;\r\nY.prototype.close = Y.prototype.close;\r\nZb.NO_ERROR = 0;\r\nZb.TIMEOUT = 8;\r\nZb.HTTP_ERROR = 6;\r\n$b.COMPLETE = \"complete\";\r\ncc.EventType = J;\r\nJ.OPEN = \"a\";\r\nJ.CLOSE = \"b\";\r\nJ.ERROR = \"c\";\r\nJ.MESSAGE = \"d\";\r\nD.prototype.listen = D.prototype.va;\r\nX.prototype.listenOnce = X.prototype.wa;\r\nX.prototype.getLastError = X.prototype.Qa;\r\nX.prototype.getLastErrorCode = X.prototype.ua;\r\nX.prototype.getStatus = X.prototype.X;\r\nX.prototype.getResponseJson = X.prototype.Na;\r\nX.prototype.getResponseText = X.prototype.$;\r\nX.prototype.send = X.prototype.ba;\r\nvar createWebChannelTransport = function () { return new Nd; };\r\nvar ErrorCode = Zb;\r\nvar EventType = $b;\r\nvar WebChannel = cc;\r\nvar XhrIo = X;\r\n\r\nvar esm = {\r\n createWebChannelTransport: createWebChannelTransport,\r\n ErrorCode: ErrorCode,\r\n EventType: EventType,\r\n WebChannel: WebChannel,\r\n XhrIo: XhrIo\r\n};\n\nexport default esm;\nexport { ErrorCode, EventType, WebChannel, XhrIo, createWebChannelTransport };\n//# sourceMappingURL=index.esm.js.map\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <http://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return '<Buffer ' + str + '>'\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","\"use strict\";\n\nvar deselectCurrent = require(\"toggle-selection\");\n\nvar clipboardToIE11Formatting = {\n \"text/plain\": \"Text\",\n \"text/html\": \"Url\",\n \"default\": \"Text\"\n}\n\nvar defaultMessage = \"Copy to clipboard: #{key}, Enter\";\n\nfunction format(message) {\n var copyKey = (/mac os x/i.test(navigator.userAgent) ? \"⌘\" : \"Ctrl\") + \"+C\";\n return message.replace(/#{\\s*key\\s*}/g, copyKey);\n}\n\nfunction copy(text, options) {\n var debug,\n message,\n reselectPrevious,\n range,\n selection,\n mark,\n success = false;\n if (!options) {\n options = {};\n }\n debug = options.debug || false;\n try {\n reselectPrevious = deselectCurrent();\n\n range = document.createRange();\n selection = document.getSelection();\n\n mark = document.createElement(\"span\");\n mark.textContent = text;\n // reset user styles for span element\n mark.style.all = \"unset\";\n // prevents scrolling to the end of the page\n mark.style.position = \"fixed\";\n mark.style.top = 0;\n mark.style.clip = \"rect(0, 0, 0, 0)\";\n // used to preserve spaces and line breaks\n mark.style.whiteSpace = \"pre\";\n // do not inherit user-select (it may be `none`)\n mark.style.webkitUserSelect = \"text\";\n mark.style.MozUserSelect = \"text\";\n mark.style.msUserSelect = \"text\";\n mark.style.userSelect = \"text\";\n mark.addEventListener(\"copy\", function(e) {\n e.stopPropagation();\n if (options.format) {\n e.preventDefault();\n if (typeof e.clipboardData === \"undefined\") { // IE 11\n debug && console.warn(\"unable to use e.clipboardData\");\n debug && console.warn(\"trying IE specific stuff\");\n window.clipboardData.clearData();\n var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting[\"default\"]\n window.clipboardData.setData(format, text);\n } else { // all other browsers\n e.clipboardData.clearData();\n e.clipboardData.setData(options.format, text);\n }\n }\n if (options.onCopy) {\n e.preventDefault();\n options.onCopy(e.clipboardData);\n }\n });\n\n document.body.appendChild(mark);\n\n range.selectNodeContents(mark);\n selection.addRange(range);\n\n var successful = document.execCommand(\"copy\");\n if (!successful) {\n throw new Error(\"copy command was unsuccessful\");\n }\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using execCommand: \", err);\n debug && console.warn(\"trying IE specific stuff\");\n try {\n window.clipboardData.setData(options.format || \"text\", text);\n options.onCopy && options.onCopy(window.clipboardData);\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using clipboardData: \", err);\n debug && console.error(\"falling back to prompt\");\n message = format(\"message\" in options ? options.message : defaultMessage);\n window.prompt(message, text);\n }\n } finally {\n if (selection) {\n if (typeof selection.removeRange == \"function\") {\n selection.removeRange(range);\n } else {\n selection.removeAllRanges();\n }\n }\n\n if (mark) {\n document.body.removeChild(mark);\n }\n reselectPrevious();\n }\n\n return success;\n}\n\nmodule.exports = copy;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (useSourceMap) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item, useSourceMap);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join('');\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === 'string') {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, '']];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring\n\n var cssMapping = item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (useSourceMap && typeof btoa === 'function') {\n var sourceMapping = toComment(cssMapping);\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || '').concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n }\n\n return [content].join('\\n');\n} // Adapted from convert-source-map (MIT)\n\n\nfunction toComment(sourceMap) {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n return \"/*# \".concat(data, \" */\");\n}","\"use strict\";var _typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&\"function\"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?\"symbol\":typeof n};module.exports=function(n,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\",\";if(!n||Array.isArray(n)&&!n.length||!Object.keys(n).length)return\"传入数据为空(the download datas is null)\";var r=[];if(\"object\"===(\"undefined\"==typeof n?\"undefined\":_typeof(n))&&Array.isArray(n)){var o=function(){var o=Array.isArray(n[0]);return n.some(function(n){return Array.isArray(n)!==o})?{v:\"传入数据格式不一致(the array element data format is inconsistent)\"}:void(o?r=r.concat(n.map(function(n){return n.join(t)})):!function(){var o=[];if(n.forEach(function(n){return o=o.concat(Object.keys(n))}),o=o.filter(function(n,e,t){return t.indexOf(n)===e}),o.length>0)if(e&&\"object\"===(\"undefined\"==typeof e?\"undefined\":_typeof(e))){var f=o.map(function(n){return e.hasOwnProperty(n)?e[n]:n});r.push(f.join(t))}else r.push(o.join(t));n.map(function(n){return o.map(function(e){return\"undefined\"!=typeof n[e]?n[e]:\"\"})}).forEach(function(n){r.push(n.join(t))})}())}();if(\"object\"===(\"undefined\"==typeof o?\"undefined\":_typeof(o)))return o.v}else{if(\"object\"!==(\"undefined\"==typeof n?\"undefined\":_typeof(n)))return n;for(var f in n)e&&e.hasOwnProperty(f)?r.push(e[f]+\",\"+n[f]):r.push(f+\",\"+n[f])}return r.join(\"\\r\\n\")};","\"use strict\";module.exports=function(){var e={},r=navigator.userAgent.toLowerCase(),a=void 0;return(a=r.match(/msie ([\\d.]+)/))?e.ie=a[1]:(a=r.match(/firefox\\/([\\d.]+)/))?e.firefox=a[1]:(a=r.match(/chrome\\/([\\d.]+)/))?e.chrome=a[1]:(a=r.match(/opera.([\\d.]+)/))?e.opera=a[1]:(a=r.match(/version\\/([\\d.]+).*safari/))?e.safari=a[1]:0,e.ie?{name:\"IE\",version:e.ie}:e.firefox?{name:\"Firefox\",version:e.firefox}:e.chrome?{name:\"Chrome\",version:e.chrome}:e.opera?{name:\"Opera\",version:e.opera}:e.safari?{name:\"Safari\",version:e.safari}:{name:\"\"}};","\"use strict\";var detectionClientType=require(\"./detectionClientType\");module.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"export.csv\";if(!e)return void console.log(\"the file is null\");var n=detectionClientType(),o=\"\\ufeff\",c=\"data:attachment/csv;charset=utf-8,\"+o+encodeURIComponent(e);if(window.Blob&&window.URL&&window.URL.createObjectURL){var a=new Blob([o+e],{type:\"text/csv\"});c=URL.createObjectURL(a)}if(\"IE\"===n.name){var d=window.top.open(\"about:blank\",\"_blank\");return d.document.write(\"sep=,\\r\\n\"+e),d.document.close(),d.document.execCommand(\"SaveAs\",!0,t),void d.close()}if(\"Safari\"===n.name){var i=document.createElement(\"a\");i.id=\"csvDwnLink\",document.body.appendChild(i);var r=o+e,l=\"data:attachment/csv;charset=utf-8,\"+encodeURIComponent(r);return document.getElementById(\"csvDwnLink\").setAttribute(\"href\",l),document.getElementById(\"csvDwnLink\").click(),void document.body.removeChild(i)}if(\"Firefox\"===n.name){var v=document.createElement(\"a\");v.download=t,v.target=\"_blank\",v.href=c;var m=document.createEvent(\"MouseEvents\");return m.initEvent(\"click\",!0,!0),void v.dispatchEvent(m)}var u=document.createElement(\"a\");u.download=t,u.href=c,u.click()};","var creatCSVFile = require('./dist/creatCSVFile');\nvar downloadFile = require('./dist/downloadFile');\nvar detectionClientType = require('./dist/detectionClientType');\n\nfunction downloadCsv(datas, columns, filename) {\n downloadFile(creatCSVFile(datas, columns), filename);\n};\n\ndownloadCsv.creatCsvFile = creatCSVFile;\ndownloadCsv.downloadFile = downloadFile;\ndownloadCsv.detectionClientType = detectionClientType;\n\nmodule.exports = downloadCsv;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function eventListener() {\n if (errorListener !== undefined) {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n var errorListener;\n\n // Adding an error listener is not optional because\n // if an error is thrown on an event emitter we cannot\n // guarantee that the actual event we are waiting will\n // be fired. The result could be a silent way to create\n // memory or file descriptor leaks, which is something\n // we should avoid.\n if (name !== 'error') {\n errorListener = function errorListener(err) {\n emitter.removeListener(name, eventListener);\n reject(err);\n };\n\n emitter.once('error', errorListener);\n }\n\n emitter.once(name, eventListener);\n });\n}\n","import firebase from '@firebase/app';\nexport { default } from '@firebase/app';\nimport '@firebase/auth';\nimport '@firebase/database';\nimport '@firebase/firestore';\nimport '@firebase/functions';\nimport '@firebase/messaging';\nimport '@firebase/storage';\nimport '@firebase/performance';\nimport '@firebase/analytics';\nimport '@firebase/remote-config';\n\nvar name = \"firebase\";\nvar version = \"8.0.0\";\n\n/**\r\n * @license\r\n * Copyright 2018 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfirebase.registerVersion(name, version, 'app');\n\nvar name$1 = \"firebase\";\nvar version$1 = \"8.0.0\";\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconsole.warn(\"\\nIt looks like you're using the development build of the Firebase JS SDK.\\nWhen deploying Firebase apps to production, it is advisable to only import\\nthe individual SDK components you intend to use.\\n\\nFor the module builds, these are available in the following manner\\n(replace <PACKAGE> with the name of a component - i.e. auth, database, etc):\\n\\nCommonJS Modules:\\nconst firebase = require('firebase/app');\\nrequire('firebase/<PACKAGE>');\\n\\nES Modules:\\nimport firebase from 'firebase/app';\\nimport 'firebase/<PACKAGE>';\\n\\nTypescript:\\nimport firebase from 'firebase/app';\\nimport 'firebase/<PACKAGE>';\\n\");\r\nfirebase.registerVersion(name$1, version$1);\n//# sourceMappingURL=index.esm.js.map\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\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;\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","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = global || self, factory(global.idb = {}));\n}(this, function (exports) { 'use strict';\n\n function toArray(arr) {\n return Array.prototype.slice.call(arr);\n }\n\n function promisifyRequest(request) {\n return new Promise(function(resolve, reject) {\n request.onsuccess = function() {\n resolve(request.result);\n };\n\n request.onerror = function() {\n reject(request.error);\n };\n });\n }\n\n function promisifyRequestCall(obj, method, args) {\n var request;\n var p = new Promise(function(resolve, reject) {\n request = obj[method].apply(obj, args);\n promisifyRequest(request).then(resolve, reject);\n });\n\n p.request = request;\n return p;\n }\n\n function promisifyCursorRequestCall(obj, method, args) {\n var p = promisifyRequestCall(obj, method, args);\n return p.then(function(value) {\n if (!value) return;\n return new Cursor(value, p.request);\n });\n }\n\n function proxyProperties(ProxyClass, targetProp, properties) {\n properties.forEach(function(prop) {\n Object.defineProperty(ProxyClass.prototype, prop, {\n get: function() {\n return this[targetProp][prop];\n },\n set: function(val) {\n this[targetProp][prop] = val;\n }\n });\n });\n }\n\n function proxyRequestMethods(ProxyClass, targetProp, Constructor, properties) {\n properties.forEach(function(prop) {\n if (!(prop in Constructor.prototype)) return;\n ProxyClass.prototype[prop] = function() {\n return promisifyRequestCall(this[targetProp], prop, arguments);\n };\n });\n }\n\n function proxyMethods(ProxyClass, targetProp, Constructor, properties) {\n properties.forEach(function(prop) {\n if (!(prop in Constructor.prototype)) return;\n ProxyClass.prototype[prop] = function() {\n return this[targetProp][prop].apply(this[targetProp], arguments);\n };\n });\n }\n\n function proxyCursorRequestMethods(ProxyClass, targetProp, Constructor, properties) {\n properties.forEach(function(prop) {\n if (!(prop in Constructor.prototype)) return;\n ProxyClass.prototype[prop] = function() {\n return promisifyCursorRequestCall(this[targetProp], prop, arguments);\n };\n });\n }\n\n function Index(index) {\n this._index = index;\n }\n\n proxyProperties(Index, '_index', [\n 'name',\n 'keyPath',\n 'multiEntry',\n 'unique'\n ]);\n\n proxyRequestMethods(Index, '_index', IDBIndex, [\n 'get',\n 'getKey',\n 'getAll',\n 'getAllKeys',\n 'count'\n ]);\n\n proxyCursorRequestMethods(Index, '_index', IDBIndex, [\n 'openCursor',\n 'openKeyCursor'\n ]);\n\n function Cursor(cursor, request) {\n this._cursor = cursor;\n this._request = request;\n }\n\n proxyProperties(Cursor, '_cursor', [\n 'direction',\n 'key',\n 'primaryKey',\n 'value'\n ]);\n\n proxyRequestMethods(Cursor, '_cursor', IDBCursor, [\n 'update',\n 'delete'\n ]);\n\n // proxy 'next' methods\n ['advance', 'continue', 'continuePrimaryKey'].forEach(function(methodName) {\n if (!(methodName in IDBCursor.prototype)) return;\n Cursor.prototype[methodName] = function() {\n var cursor = this;\n var args = arguments;\n return Promise.resolve().then(function() {\n cursor._cursor[methodName].apply(cursor._cursor, args);\n return promisifyRequest(cursor._request).then(function(value) {\n if (!value) return;\n return new Cursor(value, cursor._request);\n });\n });\n };\n });\n\n function ObjectStore(store) {\n this._store = store;\n }\n\n ObjectStore.prototype.createIndex = function() {\n return new Index(this._store.createIndex.apply(this._store, arguments));\n };\n\n ObjectStore.prototype.index = function() {\n return new Index(this._store.index.apply(this._store, arguments));\n };\n\n proxyProperties(ObjectStore, '_store', [\n 'name',\n 'keyPath',\n 'indexNames',\n 'autoIncrement'\n ]);\n\n proxyRequestMethods(ObjectStore, '_store', IDBObjectStore, [\n 'put',\n 'add',\n 'delete',\n 'clear',\n 'get',\n 'getAll',\n 'getKey',\n 'getAllKeys',\n 'count'\n ]);\n\n proxyCursorRequestMethods(ObjectStore, '_store', IDBObjectStore, [\n 'openCursor',\n 'openKeyCursor'\n ]);\n\n proxyMethods(ObjectStore, '_store', IDBObjectStore, [\n 'deleteIndex'\n ]);\n\n function Transaction(idbTransaction) {\n this._tx = idbTransaction;\n this.complete = new Promise(function(resolve, reject) {\n idbTransaction.oncomplete = function() {\n resolve();\n };\n idbTransaction.onerror = function() {\n reject(idbTransaction.error);\n };\n idbTransaction.onabort = function() {\n reject(idbTransaction.error);\n };\n });\n }\n\n Transaction.prototype.objectStore = function() {\n return new ObjectStore(this._tx.objectStore.apply(this._tx, arguments));\n };\n\n proxyProperties(Transaction, '_tx', [\n 'objectStoreNames',\n 'mode'\n ]);\n\n proxyMethods(Transaction, '_tx', IDBTransaction, [\n 'abort'\n ]);\n\n function UpgradeDB(db, oldVersion, transaction) {\n this._db = db;\n this.oldVersion = oldVersion;\n this.transaction = new Transaction(transaction);\n }\n\n UpgradeDB.prototype.createObjectStore = function() {\n return new ObjectStore(this._db.createObjectStore.apply(this._db, arguments));\n };\n\n proxyProperties(UpgradeDB, '_db', [\n 'name',\n 'version',\n 'objectStoreNames'\n ]);\n\n proxyMethods(UpgradeDB, '_db', IDBDatabase, [\n 'deleteObjectStore',\n 'close'\n ]);\n\n function DB(db) {\n this._db = db;\n }\n\n DB.prototype.transaction = function() {\n return new Transaction(this._db.transaction.apply(this._db, arguments));\n };\n\n proxyProperties(DB, '_db', [\n 'name',\n 'version',\n 'objectStoreNames'\n ]);\n\n proxyMethods(DB, '_db', IDBDatabase, [\n 'close'\n ]);\n\n // Add cursor iterators\n // TODO: remove this once browsers do the right thing with promises\n ['openCursor', 'openKeyCursor'].forEach(function(funcName) {\n [ObjectStore, Index].forEach(function(Constructor) {\n // Don't create iterateKeyCursor if openKeyCursor doesn't exist.\n if (!(funcName in Constructor.prototype)) return;\n\n Constructor.prototype[funcName.replace('open', 'iterate')] = function() {\n var args = toArray(arguments);\n var callback = args[args.length - 1];\n var nativeObject = this._store || this._index;\n var request = nativeObject[funcName].apply(nativeObject, args.slice(0, -1));\n request.onsuccess = function() {\n callback(request.result);\n };\n };\n });\n });\n\n // polyfill getAll\n [Index, ObjectStore].forEach(function(Constructor) {\n if (Constructor.prototype.getAll) return;\n Constructor.prototype.getAll = function(query, count) {\n var instance = this;\n var items = [];\n\n return new Promise(function(resolve) {\n instance.iterateCursor(query, function(cursor) {\n if (!cursor) {\n resolve(items);\n return;\n }\n items.push(cursor.value);\n\n if (count !== undefined && items.length == count) {\n resolve(items);\n return;\n }\n cursor.continue();\n });\n });\n };\n });\n\n function openDb(name, version, upgradeCallback) {\n var p = promisifyRequestCall(indexedDB, 'open', [name, version]);\n var request = p.request;\n\n if (request) {\n request.onupgradeneeded = function(event) {\n if (upgradeCallback) {\n upgradeCallback(new UpgradeDB(request.result, event.oldVersion, request.transaction));\n }\n };\n }\n\n return p.then(function(db) {\n return new DB(db);\n });\n }\n\n function deleteDb(name) {\n return promisifyRequestCall(indexedDB, 'deleteDatabase', [name]);\n }\n\n exports.openDb = openDb;\n exports.deleteDb = deleteDb;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","/* jshint node:true */\n'use strict';\n\nmodule.exports = require('os').EOL","/* jshint node:true */\n'use strict';\n\n// Escape the textDelimiters contained in the field\n/*(https://tools.ietf.org/html/rfc4180)\n 7. If double-quotes are used to enclose fields, then a double-quote\n appearing inside a field must be escaped by preceding it with\n another double quote.\n For example: \"aaa\",\"b\"\"bb\",\"ccc\"\n*/\n\nmodule.exports = function escapedDelimiters(textDelimiter, rowDelimiter, forceTextDelimiter) { \n let endOfLine = '\\n';\n\n if (typeof textDelimiter !== 'string') {\n throw new TypeError('Invalid param \"textDelimiter\", must be a string.');\n }\n\n if (typeof rowDelimiter !== 'string') {\n throw new TypeError('Invalid param \"rowDelimiter\", must be a string.');\n }\n\n let textDelimiterRegex = new RegExp(\"\\\\\" + textDelimiter, 'g');\n let escapedDelimiter = textDelimiter + textDelimiter;\n\n const enclosingCondition = (textDelimiter === '\"') ? \n (value) => (value.indexOf(rowDelimiter) >= 0 || \n value.indexOf(endOfLine) >= 0 ||\n value.indexOf('\"') >= 0)\n : (value) => (value.indexOf(rowDelimiter) >= 0 || \n value.indexOf(endOfLine) >= 0);\n\n return function(value) {\n if(forceTextDelimiter) value = \"\" + value;\n\n if (!value.replace) return value;\n // Escape the textDelimiters contained in the field\n value = value.replace(textDelimiterRegex, escapedDelimiter);\n \n // Escape the whole field if it contains a rowDelimiter or a linebreak or double quote\n if (forceTextDelimiter || enclosingCondition(value)) {\n value = textDelimiter + value + textDelimiter;\n }\n\n return value;\n };\n};\n","'use strict';\n\nmodule.exports.isFunction = (fn) => {\n var getType = {};\n return fn && getType.toString.call(fn) === '[object Function]';\n};\n\nmodule.exports.isArray = (arr) => Array.isArray(arr);\n\nmodule.exports.isObject = (obj) => obj instanceof Object;\n\nmodule.exports.isString = (str) => typeof str === 'string';\n\nmodule.exports.isNumber = (num) => typeof num === 'number';\n\nmodule.exports.isBoolean = (bool) => typeof bool === 'boolean';\n\nmodule.exports.isDate = (date) => date instanceof Date;\n","const EOL = require('./eol');\nconst helper = require('./helper');\n\nmodule.exports = function joinRows(rows, join) {\n if (!rows || !helper.isArray(rows)) {\n throw new TypeError('Invalid params \"rows\" for joinRows.' +\n ' Must be an array of string.');\n }\n //Merge all rows in a single output with the correct End of Line string\n var r = rows.join(join || EOL || '\\n');\n return r;\n};\n","/* jshint node:true */\n'use strict';\n\nconst Transform = require('stream').Transform;\n\nclass Stream extends Transform {\n\n constructor(parser) {\n super();\n this._parser = parser;\n this._options = parser._options;\n this._headers = this._options.headers || [];\n this._hasHeaders = false;\n this._lastError = null;\n }\n\n _mergeChunk(chunk) {\n let self = this;\n self._extra = self._extra || \"\";\n // Remove starting comma\n if (self._extra.charAt(0) == ',') self._extra = self._extra.substr(1);\n // Append extra to chunk\n chunk = self._extra + chunk.toString();\n // Clear extra memory\n if (self._extra.length > 0) self._extra = \"\";\n return chunk;\n }\n \n _wrapArray(data) {\n if (data.charAt(0) != '[') data = '[' + data;\n if (data.charAt(data.length - 1) != ']') data += ']';\n return data;\n }\n\n _transform(chunk, encoding, done) {\n let self = this;\n let json = null;\n // Append extra data to chunk data\n chunk = this._mergeChunk(chunk); \n if (!chunk) return done(this._lastError);\n // Split chunk in objects\n let parts = chunk.split('}');\n while (json === null && parts.length > 0) {\n try {\n let data = self._wrapArray(parts.join('}'));\n json = JSON.parse(data);\n } catch (ex) {\n this._lastError = ex;\n let extraChunk = parts.pop();\n self._extra = extraChunk + (self._extra || \"\");\n if (parts.length > 0) parts[parts.length - 1] += \"}\";\n }\n } \n if (!json) return done();\n this._parser.parse(json, (err, csvChunk) => {\n if (err) return done(err);\n if (!self.hasHeaders) {\n self.hasHeaders = true;\n self.push(self._parser.headers);\n }\n self.push(self._options.endOfLine + csvChunk);\n done();\n }, true);\n }\n}\n\nmodule.exports = Stream;\n","/* jshint node:true */\n'use strict';\n/**\n * Module dependencies.\n */\n//const _ = require('underscore');\nconst Parser = require('./parser/csv');\nconst Stream = require('./core/stream');\nconst helper = require('./core/helper');\nconst EOL = require('./core/eol');\n\n/**\n * Main function that converts json to csv\n *\n * @param {Object|Array} json\n * @param {Object} [options]\n * @param {Function} callback(err, csv) - Callback function\n * if error, returning error in call back.\n * if csv is created successfully, returning csv output to callback.\n */\nmodule.exports = function() {\n const DEFAULT_OPTIONS = {\n headers: [], // Array\n rename: [], // Array\n headerPathString: '.', // String\n rowDelimiter: ',', // String\n textDelimiter: '\"', // String\n arrayPathString: ';', // String\n undefinedString: '', // String\n endOfLine: EOL || '\\n', // String\n mainPathItem: null, // String\n booleanTrueString: null, // String\n booleanFalseString: null, // String\n includeHeaders: true, // Boolean\n fillGaps: false, // Boolean\n verticalOutput: true, // Boolean\n forceTextDelimiter: false, //Boolean\n };\n // argument parsing\n let json, userOptions, callback;\n if (arguments.length === 3) {\n [json, userOptions, callback] = arguments;\n } else if (arguments.length === 2) {\n let any;\n [json, any] = arguments;\n if (typeof any === 'function') {\n callback = any;\n } else if (typeof any === 'object') {\n userOptions = any;\n }\n } else if (arguments.length === 1) {\n const [any] = arguments;\n if (typeof any === 'object') {\n const defaultKeys = Object.keys(DEFAULT_OPTIONS);\n const objectKeys = Object.keys(any);\n const isOptions = objectKeys.every((key) => defaultKeys.includes(key)); \n if (objectKeys.length > 0 && isOptions) {\n userOptions = any;\n } else {\n json = any;\n }\n } else {\n json = any;\n }\n } else {\n return new Stream(new Parser(DEFAULT_OPTIONS));\n }\n const options = Object.assign({}, DEFAULT_OPTIONS, userOptions);\n const parser = new Parser(options);\n // if no json is provided Stream API will be used\n if (!json) {\n return new Stream(parser);\n }\n // always return an promise\n return new Promise((resolve, reject) => {\n parser.parse(json, (err, result) => {\n if (callback) return callback(err, result);\n if (err) return reject(err);\n if (reject) return resolve(result);\n });\n });\n};\n","/* jshint node:true */\n'use strict';\n\n/**\n * Module dependencies.\n */\nconst joinRows = require('../core/join-rows');\nconst Handler = require('./handler');\nconst helper = require('../core/helper');\n\nclass Parser {\n constructor(options) {\n this._options = options || {};\n this._handler = new Handler(this._options);\n this._headers = this._options.headers || [];\n this._escape = require('../core/escape-delimiters')(\n this._options.textDelimiter,\n this._options.rowDelimiter,\n this._options.forceTextDelimiter\n );\n }\n\n /**\n * Generates a CSV file with optional headers based on the passed JSON,\n * with can be an Object or Array.\n *\n * @param {Object|Array} json\n * @param {Function} done(err,csv) - Callback function\n * if error, returning error in call back.\n * if csv is created successfully, returning csv output to callback.\n */\n parse(json, done, stream) {\n if (helper.isArray(json)) return done(null, this._parseArray(json, stream));\n else if (helper.isObject(json)) return done(null, this._parseObject(json));\n return done(new Error('Unable to parse the JSON object, its not an Array or Object.'));\n }\n\n get headers() {\n let headers = this._headers;\n\n if (this._options.rename && this._options.rename.length > 0)\n headers = headers.map((header) => this._options.rename[this._options.headers.indexOf(header)] || header);\n \n if (this._options.forceTextDelimiter) {\n headers = headers.map((header) => {\n return `${this._options.textDelimiter}${header}${this._options.textDelimiter}`;\n });\n }\n\n if (this._options.mapHeaders)\n headers = headers.map(this._options.mapHeaders);\n\n return headers.join(this._options.rowDelimiter);\n }\n\n _checkRows(rows) {\n let lastRow = null;\n let finalRows = [];\n let fillGaps = (col, index) => col === '' || col === undefined ? lastRow[index] : col;\n for (let row of rows) {\n let missing = this._headers.length - row.length;\n if (missing > 0) row = row.concat(Array(missing).join(\".\").split(\".\"));\n if (lastRow && this._options.fillGaps) row = row.map(fillGaps);\n finalRows.push(row.join(this._options.rowDelimiter));\n lastRow = row;\n }\n return finalRows;\n }\n\n _parseArray(json, stream) {\n let self = this;\n this._headers = this._headers || [];\n let fileRows = [];\n let outputFile;\n let fillRows;\n\n let getHeaderIndex = function(header) {\n var index = self._headers.indexOf(header);\n if (index === -1) {\n self._headers.push(header);\n index = self._headers.indexOf(header);\n }\n return index;\n };\n\n //Generate the csv output\n fillRows = function(result) {\n const rows = [];\n const fillAndPush = (row) => rows.push(row.map(col => col != null ? col : ''));\n // initialize the array with empty strings to handle 'unpopular' headers\n const newRow = () => new Array(self._headers.length).fill(null);\n const emptyRowIndexByHeader = {};\n let currentRow = newRow();\n for (let element of result) {\n let elementHeaderIndex = getHeaderIndex(element.item);\n if (currentRow[elementHeaderIndex] != undefined) {\n fillAndPush(currentRow);\n currentRow = newRow();\n }\n emptyRowIndexByHeader[elementHeaderIndex] = emptyRowIndexByHeader[elementHeaderIndex] || 0;\n // make sure there isnt a empty row for this header\n if (self._options.fillTopRow && emptyRowIndexByHeader[elementHeaderIndex] < rows.length) {\n rows[emptyRowIndexByHeader[elementHeaderIndex]][elementHeaderIndex] = self._escape(element.value);\n emptyRowIndexByHeader[elementHeaderIndex] += 1;\n continue;\n }\n currentRow[elementHeaderIndex] = self._escape(element.value);\n emptyRowIndexByHeader[elementHeaderIndex] += 1;\n }\n // push last row\n if (currentRow.length > 0) {\n fillAndPush(currentRow);\n }\n fileRows = fileRows.concat(self._checkRows(rows));\n };\n for (let item of json) {\n //Call checkType to list all items inside this object\n //Items are returned as a object {item: 'Prop Value, Item Name', value: 'Prop Data Value'}\n let itemResult = self._handler.check(item, self._options.mainPathItem, item, json);\n fillRows(itemResult);\n }\n\n if (!stream && self._options.includeHeaders) {\n //Add the headers to the first line\n fileRows.unshift(this.headers);\n }\n\n return joinRows(fileRows, self._options.endOfLine);\n }\n\n _parseObject(json) {\n let self = this;\n let fileRows = [];\n let parseResult = [];\n let outputFile;\n let fillRows;\n let horizontalRows = [\n [],\n []\n ];\n\n fillRows = function(result) {\n var value = result.value ? result.value.toString() : self._options.undefinedString;\n value = self._escape(value);\n\n //Type header;value\n if (self._options.verticalOutput) {\n var row = [result.item, value];\n fileRows.push(row.join(self._options.rowDelimiter));\n } else {\n horizontalRows[0].push(result.item);\n horizontalRows[1].push(value);\n }\n };\n for (var prop in json) {\n var prefix = \"\";\n if (this._options.mainPathItem)\n prefix = this._options.mainPathItem + this._options.headerPathString;\n parseResult = this._handler.check(json[prop], prefix + prop, prop, json);\n\n parseResult.forEach(fillRows);\n }\n if (!this._options.verticalOutput) {\n fileRows.push(horizontalRows[0].join(this._options.rowDelimiter));\n fileRows.push(horizontalRows[1].join(this._options.rowDelimiter));\n }\n return joinRows(fileRows, this._options.endOfLine);\n }\n}\n\nmodule.exports = Parser;\n","/* jshint node:true */\n'use strict';\n\nconst helper = require('../core/helper');\n\nclass Handler {\n constructor(options) {\n this._options = options;\n\n // an object of {typeName:(value,index,parent)=>any}\n this._options.typeHandlers = this._options.typeHandlers || {};\n }\n\n /**\n * Check if results needing mapping to alternate value\n *\n * @returns [{item, value}] result\n */\n _setHeaders(result, item) {\n let self = this;\n if (!item) return result;\n return result.map(function(element) {\n element.item = element.item ? item + self._options.headerPathString + element.item : item;\n return element;\n });\n }\n\n castValue(element, item, index, parent){\n //cast by matching constructor\n const types = this._options.typeHandlers;\n for (let type in types ) {\n if( isInstanceOfTypeName(element,type) ){\n element = types[type].call(types, element, index, parent);\n break;//first match we move on\n }\n }\n\n return element;\n }\n\n checkComplex(element, item){\n //Check if element is a Date\n if (helper.isDate(element)) {\n return [{\n item: item,\n value: this._options.handleDate(element, item),\n }];\n }\n //Check if element is an Array\n else if (helper.isArray(element)) {\n var resultArray = this._handleArray(element, item);\n return this._setHeaders(resultArray, item);\n }\n //Check if element is a Object\n else if (helper.isObject(element)) {\n var resultObject = this._handleObject(element);\n return this._setHeaders(resultObject, item);\n }\n\n return [{\n item: item,\n value: '',\n }];\n }\n \n /**\n * Check the element type of the element call the correct handle function\n *\n * @param element Element that will be checked\n * @param item Used to make the headers/path breadcrumb\n * @returns [{item, value}] result\n */\n check(element, item, index, parent) {\n element = this.castValue(element, item, index, parent);\n // try simple value by highier performance switch\n switch(typeof element){\n case 'string':\n return [{\n item: item,\n value: this._handleString(element, item),\n }];\n\n case 'number':\n return [{\n item: item,\n value: this._handleNumber(element, item),\n }];\n\n case 'boolean':\n return [{\n item: item,\n value: this._handleBoolean.bind(this)(element, item),\n }];\n }\n\n return this.checkComplex(element, item);\n }\n\n\n /**\n * Handle all Objects\n *\n * @param {Object} obj\n * @returns [{item, value}] result\n */\n _handleObject(obj) {\n var result = [];\n //Look every object props\n for (var prop in obj) {\n var propData = obj[prop];\n //Check the propData type\n var resultCheckType = this.check(propData, prop, prop, obj);\n //Append to results aka merge results aka array-append-array\n result = result.concat(resultCheckType);\n }\n return result;\n }\n \n /**\n * Handle all Arrays, merges arrays with primitive types in a single value\n *\n * @param {Array} array\n * @returns [{item, value}] result\n */\n _handleArray(array) {\n let self = this;\n let result = [];\n var firstElementWithoutItem;\n for (let aIndex=0; aIndex < array.length; ++aIndex) {\n let element = array[aIndex];\n //Check the propData type\n var resultCheckType = self.check(element, null, aIndex, array);\n //Check for results without itens, merge all itens with the first occurrence\n if (resultCheckType.length === 0) continue;\n var firstResult = resultCheckType[0];\n if (!firstResult.item && firstElementWithoutItem !== undefined) {\n firstElementWithoutItem.value += self._options.arrayPathString + firstResult.value;\n continue;\n } else if (resultCheckType.length > 0 && !firstResult.item && firstElementWithoutItem === undefined) {\n firstElementWithoutItem = firstResult;\n }\n //Append to results\n result = result.concat(resultCheckType);\n }\n return result;\n }\n /**\n * Handle all Boolean variables, can be replaced with options.handleBoolean\n *\n * @param {Boolean} boolean\n * @returns {String} result\n */\n _handleBoolean(boolean) {\n var result;\n //Check for booolean options\n if (boolean) {\n result = this._options.booleanTrueString || 'true';\n } else {\n result = this._options.booleanFalseString || 'false';\n }\n return result;\n }\n /**\n * Handle all String variables, can be replaced with options.handleString\n *\n * @param {String} string\n * @returns {String} string\n */\n _handleString(string) {\n return string;\n }\n /**\n * Handle all Number variables, can be replaced with options.handleNumber\n *\n * @param {Number} number\n * @returns {Number} number\n */\n _handleNumber(number) {\n return number;\n }\n /**\n * Handle all Date variables, can be replaced with options.handleDate\n *\n * @param {Date} number\n * @returns {string} result\n */\n _handleDate(date) {\n return date.toLocaleDateString();\n }\n\n}\n\nmodule.exports = Handler;\n\nconst globalScope = typeof(window)===\"undefined\" ? global : window;\nfunction isInstanceOfTypeName(element, typeName){\n if( element instanceof globalScope[typeName] ){\n return true;//Buffer and complex objects\n }\n\n //literals in javascript cannot be checked by instance of\n switch( typeof(element) ){\n case 'string':return typeName===\"String\";\n case 'boolean':return typeName===\"Boolean\";\n case 'number':return typeName===\"Number\";\n }\n\n return false;\n}\n","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","exports.endianness = function () { return 'LE' };\n\nexports.hostname = function () {\n if (typeof location !== 'undefined') {\n return location.hostname\n }\n else return '';\n};\n\nexports.loadavg = function () { return [] };\n\nexports.uptime = function () { return 0 };\n\nexports.freemem = function () {\n return Number.MAX_VALUE;\n};\n\nexports.totalmem = function () {\n return Number.MAX_VALUE;\n};\n\nexports.cpus = function () { return [] };\n\nexports.type = function () { return 'Browser' };\n\nexports.release = function () {\n if (typeof navigator !== 'undefined') {\n return navigator.appVersion;\n }\n return '';\n};\n\nexports.networkInterfaces\n= exports.getNetworkInterfaces\n= function () { return {} };\n\nexports.arch = function () { return 'javascript' };\n\nexports.platform = function () { return 'browser' };\n\nexports.tmpdir = exports.tmpDir = function () {\n return '/tmp';\n};\n\nexports.EOL = '\\n';\n\nexports.homedir = function () {\n\treturn '/'\n};\n","'use strict';\n\nif (typeof process === 'undefined' ||\n !process.version ||\n process.version.indexOf('v0.') === 0 ||\n process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {\n module.exports = { nextTick: nextTick };\n} else {\n module.exports = process\n}\n\nfunction nextTick(fn, arg1, arg2, arg3) {\n if (typeof fn !== 'function') {\n throw new TypeError('\"callback\" argument must be a function');\n }\n var len = arguments.length;\n var args, i;\n switch (len) {\n case 0:\n case 1:\n return process.nextTick(fn);\n case 2:\n return process.nextTick(function afterTickOne() {\n fn.call(null, arg1);\n });\n case 3:\n return process.nextTick(function afterTickTwo() {\n fn.call(null, arg1, arg2);\n });\n case 4:\n return process.nextTick(function afterTickThree() {\n fn.call(null, arg1, arg2, arg3);\n });\n default:\n args = new Array(len - 1);\n i = 0;\n while (i < args.length) {\n args[i++] = arguments[i];\n }\n return process.nextTick(function afterTick() {\n fn.apply(null, args);\n });\n }\n}\n\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// 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}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\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 try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\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\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\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\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\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 if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\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) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\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\n'use strict';\n\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n var has = Function.call.bind(Object.prototype.hasOwnProperty);\n\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\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 * 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 */\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;\n // 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 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(\n (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'\n );\n err.name = 'Invariant Violation';\n throw err;\n }\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n if (error && !(error instanceof Error)) {\n printWarning(\n (componentName || 'React class') + ': type specification of ' +\n location + ' `' + typeSpecName + '` is invalid; the type checker ' +\n 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +\n 'You may have forgotten to pass an argument to the type checker ' +\n 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +\n '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\n var stack = getStack ? getStack() : '';\n\n printWarning(\n 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')\n );\n }\n }\n }\n }\n}\n\n/**\n * Resets warning cache when testing.\n *\n * @private\n */\ncheckPropTypes.resetWarningCache = function() {\n if (process.env.NODE_ENV !== 'production') {\n loggedTypeFailures = {};\n }\n}\n\nmodule.exports = checkPropTypes;\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\n'use strict';\n\nvar ReactIs = require('react-is');\nvar assign = require('object-assign');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\nvar checkPropTypes = require('./checkPropTypes');\n\nvar has = Function.call.bind(Object.prototype.hasOwnProperty);\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\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 function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\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 var ANONYMOUS = '<<anonymous>>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\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\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 /**\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 /*eslint-disable no-self-compare*/\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 function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\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 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(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\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 if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n printWarning(\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\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 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\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\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 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\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n return null;\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 var propValue = props[propName];\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 for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\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 return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\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 return null;\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 return null;\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(\n 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +\n 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'\n );\n } else {\n printWarning('Invalid argument supplied to oneOf, expected an array.');\n }\n }\n return emptyFunctionThatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\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 if (type === 'symbol') {\n return String(value);\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 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 var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (has(propValue, key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\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 if (typeof checker !== 'function') {\n printWarning(\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\n 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'\n );\n return emptyFunctionThatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\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 return null;\n }\n return createChainableTypeChecker(validate);\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 if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (!checker) {\n continue;\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\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 if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from\n // props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (!checker) {\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\n );\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\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 case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\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 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 default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // falsy value can't be a Symbol\n if (!propValue) {\n return false;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\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 if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\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\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\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","/**\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 ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.CopyToClipboard = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _copyToClipboard = _interopRequireDefault(require(\"copy-to-clipboard\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar CopyToClipboard =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inherits(CopyToClipboard, _React$PureComponent);\n\n function CopyToClipboard() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, CopyToClipboard);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(CopyToClipboard)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"onClick\", function (event) {\n var _this$props = _this.props,\n text = _this$props.text,\n onCopy = _this$props.onCopy,\n children = _this$props.children,\n options = _this$props.options;\n\n var elem = _react[\"default\"].Children.only(children);\n\n var result = (0, _copyToClipboard[\"default\"])(text, options);\n\n if (onCopy) {\n onCopy(text, result);\n } // Bypass onClick if it was present\n\n\n if (elem && elem.props && typeof elem.props.onClick === 'function') {\n elem.props.onClick(event);\n }\n });\n\n return _this;\n }\n\n _createClass(CopyToClipboard, [{\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n _text = _this$props2.text,\n _onCopy = _this$props2.onCopy,\n _options = _this$props2.options,\n children = _this$props2.children,\n props = _objectWithoutProperties(_this$props2, [\"text\", \"onCopy\", \"options\", \"children\"]);\n\n var elem = _react[\"default\"].Children.only(children);\n\n return _react[\"default\"].cloneElement(elem, _objectSpread({}, props, {\n onClick: this.onClick\n }));\n }\n }]);\n\n return CopyToClipboard;\n}(_react[\"default\"].PureComponent);\n\nexports.CopyToClipboard = CopyToClipboard;\n\n_defineProperty(CopyToClipboard, \"defaultProps\", {\n onCopy: undefined,\n options: undefined\n});","\"use strict\";\n\nvar _require = require('./Component'),\n CopyToClipboard = _require.CopyToClipboard;\n\nCopyToClipboard.CopyToClipboard = CopyToClipboard;\nmodule.exports = CopyToClipboard;","/** @license React v16.13.1\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\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\nvar _assign = require('object-assign');\nvar Scheduler = require('scheduler');\nvar checkPropTypes = require('prop-types/checkPropTypes');\nvar tracing = require('scheduler/tracing');\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions.\n// Current owner and dispatcher used to share the same ref,\n// but PR #14548 split them out to better support the react-debug-tools package.\n\nif (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {\n ReactSharedInternals.ReactCurrentDispatcher = {\n current: null\n };\n}\n\nif (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {\n ReactSharedInternals.ReactCurrentBatchConfig = {\n suspense: null\n };\n}\n\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\nfunction warn(format) {\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}\nfunction error(format) {\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\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\\n in') === 0;\n\n if (!hasExistingStack) {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n }\n }\n\n var argsWithFormat = args.map(function (item) {\n return '' + 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 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 var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n throw new Error(message);\n } catch (x) {}\n }\n}\n\nif (!React) {\n {\n throw Error( \"ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.\" );\n }\n}\n\nvar invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) {\n var funcArgs = Array.prototype.slice.call(arguments, 3);\n\n try {\n func.apply(context, funcArgs);\n } catch (error) {\n this.onError(error);\n }\n};\n\n{\n // In DEV mode, we swap out invokeGuardedCallback for a special version\n // that plays more nicely with the browser's DevTools. The idea is to preserve\n // \"Pause on exceptions\" behavior. Because React wraps all user-provided\n // functions in invokeGuardedCallback, and the production version of\n // invokeGuardedCallback uses a try-catch, all user exceptions are treated\n // like caught exceptions, and the DevTools won't pause unless the developer\n // takes the extra step of enabling pause on caught exceptions. This is\n // unintuitive, though, because even though React has caught the error, from\n // the developer's perspective, the error is uncaught.\n //\n // To preserve the expected \"Pause on exceptions\" behavior, we don't use a\n // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake\n // DOM node, and call the user-provided callback from inside an event handler\n // for that fake event. If the callback throws, the error is \"captured\" using\n // a global event handler. But because the error happens in a different\n // event loop context, it does not interrupt the normal program flow.\n // Effectively, this gives us try-catch behavior without actually using\n // try-catch. Neat!\n // Check that the browser supports the APIs we need to implement our special\n // DEV version of invokeGuardedCallback\n if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {\n var fakeNode = document.createElement('react');\n\n var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {\n // If document doesn't exist we know for sure we will crash in this method\n // when we call document.createEvent(). However this can cause confusing\n // errors: https://github.com/facebookincubator/create-react-app/issues/3482\n // So we preemptively throw with a better message instead.\n if (!(typeof document !== 'undefined')) {\n {\n throw Error( \"The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.\" );\n }\n }\n\n var evt = document.createEvent('Event'); // Keeps track of whether the user-provided callback threw an error. We\n // set this to true at the beginning, then set it to false right after\n // calling the function. If the function errors, `didError` will never be\n // set to false. This strategy works even if the browser is flaky and\n // fails to call our global error handler, because it doesn't rely on\n // the error event at all.\n\n var didError = true; // Keeps track of the value of window.event so that we can reset it\n // during the callback to let user code access window.event in the\n // browsers that support it.\n\n var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event\n // dispatching: https://github.com/facebook/react/issues/13688\n\n var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); // Create an event handler for our fake event. We will synchronously\n // dispatch our fake event using `dispatchEvent`. Inside the handler, we\n // call the user-provided callback.\n\n var funcArgs = Array.prototype.slice.call(arguments, 3);\n\n function callCallback() {\n // We immediately remove the callback from event listeners so that\n // nested `invokeGuardedCallback` calls do not clash. Otherwise, a\n // nested call would trigger the fake event handlers of any call higher\n // in the stack.\n fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the\n // window.event assignment in both IE <= 10 as they throw an error\n // \"Member not found\" in strict mode, and in Firefox which does not\n // support window.event.\n\n if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {\n window.event = windowEvent;\n }\n\n func.apply(context, funcArgs);\n didError = false;\n } // Create a global error event handler. We use this to capture the value\n // that was thrown. It's possible that this error handler will fire more\n // than once; for example, if non-React code also calls `dispatchEvent`\n // and a handler for that event throws. We should be resilient to most of\n // those cases. Even if our error event handler fires more than once, the\n // last error event is always used. If the callback actually does error,\n // we know that the last error event is the correct one, because it's not\n // possible for anything else to have happened in between our callback\n // erroring and the code that follows the `dispatchEvent` call below. If\n // the callback doesn't error, but the error event was fired, we know to\n // ignore it because `didError` will be false, as described above.\n\n\n var error; // Use this to track whether the error event is ever called.\n\n var didSetError = false;\n var isCrossOriginError = false;\n\n function handleWindowError(event) {\n error = event.error;\n didSetError = true;\n\n if (error === null && event.colno === 0 && event.lineno === 0) {\n isCrossOriginError = true;\n }\n\n if (event.defaultPrevented) {\n // Some other error handler has prevented default.\n // Browsers silence the error report if this happens.\n // We'll remember this to later decide whether to log it or not.\n if (error != null && typeof error === 'object') {\n try {\n error._suppressLogging = true;\n } catch (inner) {// Ignore.\n }\n }\n }\n } // Create a fake event type.\n\n\n var evtType = \"react-\" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers\n\n window.addEventListener('error', handleWindowError);\n fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function\n // errors, it will trigger our global error handler.\n\n evt.initEvent(evtType, false, false);\n fakeNode.dispatchEvent(evt);\n\n if (windowEventDescriptor) {\n Object.defineProperty(window, 'event', windowEventDescriptor);\n }\n\n if (didError) {\n if (!didSetError) {\n // The callback errored, but the error event never fired.\n error = new Error('An error was thrown inside one of your components, but React ' + \"doesn't know what it was. This is likely due to browser \" + 'flakiness. React does its best to preserve the \"Pause on ' + 'exceptions\" behavior of the DevTools, which requires some ' + \"DEV-mode only tricks. It's possible that these don't work in \" + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');\n } else if (isCrossOriginError) {\n error = new Error(\"A cross-origin error was thrown. React doesn't have access to \" + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');\n }\n\n this.onError(error);\n } // Remove our event listeners\n\n\n window.removeEventListener('error', handleWindowError);\n };\n\n invokeGuardedCallbackImpl = invokeGuardedCallbackDev;\n }\n}\n\nvar invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;\n\nvar hasError = false;\nvar caughtError = null; // Used by event system to capture/rethrow the first error.\n\nvar hasRethrowError = false;\nvar rethrowError = null;\nvar reporter = {\n onError: function (error) {\n hasError = true;\n caughtError = error;\n }\n};\n/**\n * Call a function while guarding against errors that happens within it.\n * Returns an error if it throws, otherwise null.\n *\n * In production, this is implemented using a try-catch. The reason we don't\n * use a try-catch directly is so that we can swap out a different\n * implementation in DEV mode.\n *\n * @param {String} name of the guard to use for logging or debugging\n * @param {Function} func The function to invoke\n * @param {*} context The context to use when calling the function\n * @param {...*} args Arguments for function\n */\n\nfunction invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {\n hasError = false;\n caughtError = null;\n invokeGuardedCallbackImpl$1.apply(reporter, arguments);\n}\n/**\n * Same as invokeGuardedCallback, but instead of returning an error, it stores\n * it in a global so it can be rethrown by `rethrowCaughtError` later.\n * TODO: See if caughtError and rethrowError can be unified.\n *\n * @param {String} name of the guard to use for logging or debugging\n * @param {Function} func The function to invoke\n * @param {*} context The context to use when calling the function\n * @param {...*} args Arguments for function\n */\n\nfunction invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {\n invokeGuardedCallback.apply(this, arguments);\n\n if (hasError) {\n var error = clearCaughtError();\n\n if (!hasRethrowError) {\n hasRethrowError = true;\n rethrowError = error;\n }\n }\n}\n/**\n * During execution of guarded functions we will capture the first error which\n * we will rethrow to be handled by the top level error handler.\n */\n\nfunction rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n}\nfunction hasCaughtError() {\n return hasError;\n}\nfunction clearCaughtError() {\n if (hasError) {\n var error = caughtError;\n hasError = false;\n caughtError = null;\n return error;\n } else {\n {\n {\n throw Error( \"clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n }\n}\n\nvar getFiberCurrentPropsFromNode = null;\nvar getInstanceFromNode = null;\nvar getNodeFromInstance = null;\nfunction setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) {\n getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;\n getInstanceFromNode = getInstanceFromNodeImpl;\n getNodeFromInstance = getNodeFromInstanceImpl;\n\n {\n if (!getNodeFromInstance || !getInstanceFromNode) {\n error('EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.');\n }\n }\n}\nvar validateEventDispatches;\n\n{\n validateEventDispatches = function (event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n var listenersIsArr = Array.isArray(dispatchListeners);\n var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;\n var instancesIsArr = Array.isArray(dispatchInstances);\n var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;\n\n if (instancesIsArr !== listenersIsArr || instancesLen !== listenersLen) {\n error('EventPluginUtils: Invalid `event`.');\n }\n };\n}\n/**\n * Dispatch the event to the listener.\n * @param {SyntheticEvent} event SyntheticEvent to handle\n * @param {function} listener Application-level callback\n * @param {*} inst Internal component instance\n */\n\n\nfunction executeDispatch(event, listener, inst) {\n var type = event.type || 'unknown-event';\n event.currentTarget = getNodeFromInstance(inst);\n invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);\n event.currentTarget = null;\n}\n/**\n * Standard/simple iteration through an event's collected dispatches.\n */\n\nfunction executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n}\n\nvar FunctionComponent = 0;\nvar ClassComponent = 1;\nvar IndeterminateComponent = 2; // Before we know whether it is function or class\n\nvar HostRoot = 3; // Root of a host tree. Could be nested inside another node.\n\nvar HostPortal = 4; // A subtree. Could be an entry point to a different renderer.\n\nvar HostComponent = 5;\nvar HostText = 6;\nvar Fragment = 7;\nvar Mode = 8;\nvar ContextConsumer = 9;\nvar ContextProvider = 10;\nvar ForwardRef = 11;\nvar Profiler = 12;\nvar SuspenseComponent = 13;\nvar MemoComponent = 14;\nvar SimpleMemoComponent = 15;\nvar LazyComponent = 16;\nvar IncompleteClassComponent = 17;\nvar DehydratedFragment = 18;\nvar SuspenseListComponent = 19;\nvar FundamentalComponent = 20;\nvar ScopeComponent = 21;\nvar Block = 22;\n\n/**\n * Injectable ordering of event plugins.\n */\nvar eventPluginOrder = null;\n/**\n * Injectable mapping from names to event plugin modules.\n */\n\nvar namesToPlugins = {};\n/**\n * Recomputes the plugin list using the injected plugins and plugin ordering.\n *\n * @private\n */\n\nfunction recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n if (!(pluginIndex > -1)) {\n {\n throw Error( \"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\" );\n }\n }\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n if (!pluginModule.extractEvents) {\n {\n throw Error( \"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\" );\n }\n }\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw Error( \"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\" );\n }\n }\n }\n }\n}\n/**\n * Publishes an event so that it can be dispatched by the supplied plugin.\n *\n * @param {object} dispatchConfig Dispatch configuration for the event.\n * @param {object} PluginModule Plugin publishing the event.\n * @return {boolean} True if the event was successfully published.\n * @private\n */\n\n\nfunction publishEventForPlugin(dispatchConfig, pluginModule, eventName) {\n if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) {\n {\n throw Error( \"EventPluginRegistry: More than one plugin attempted to publish the same event name, `\" + eventName + \"`.\" );\n }\n }\n\n eventNameDispatchConfigs[eventName] = dispatchConfig;\n var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;\n\n if (phasedRegistrationNames) {\n for (var phaseName in phasedRegistrationNames) {\n if (phasedRegistrationNames.hasOwnProperty(phaseName)) {\n var phasedRegistrationName = phasedRegistrationNames[phaseName];\n publishRegistrationName(phasedRegistrationName, pluginModule, eventName);\n }\n }\n\n return true;\n } else if (dispatchConfig.registrationName) {\n publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);\n return true;\n }\n\n return false;\n}\n/**\n * Publishes a registration name that is used to identify dispatched events.\n *\n * @param {string} registrationName Registration name to add.\n * @param {object} PluginModule Plugin publishing the event.\n * @private\n */\n\n\nfunction publishRegistrationName(registrationName, pluginModule, eventName) {\n if (!!registrationNameModules[registrationName]) {\n {\n throw Error( \"EventPluginRegistry: More than one plugin attempted to publish the same registration name, `\" + registrationName + \"`.\" );\n }\n }\n\n registrationNameModules[registrationName] = pluginModule;\n registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;\n\n {\n var lowerCasedName = registrationName.toLowerCase();\n possibleRegistrationNames[lowerCasedName] = registrationName;\n\n if (registrationName === 'onDoubleClick') {\n possibleRegistrationNames.ondblclick = registrationName;\n }\n }\n}\n/**\n * Registers plugins so that they can extract and dispatch events.\n */\n\n/**\n * Ordered list of injected plugins.\n */\n\n\nvar plugins = [];\n/**\n * Mapping from event name to dispatch config\n */\n\nvar eventNameDispatchConfigs = {};\n/**\n * Mapping from registration name to plugin module\n */\n\nvar registrationNameModules = {};\n/**\n * Mapping from registration name to event name\n */\n\nvar registrationNameDependencies = {};\n/**\n * Mapping from lowercase registration names to the properly cased version,\n * used to warn in the case of missing event handlers. Available\n * only in true.\n * @type {Object}\n */\n\nvar possibleRegistrationNames = {} ; // Trust the developer to only use possibleRegistrationNames in true\n\n/**\n * Injects an ordering of plugins (by plugin name). This allows the ordering\n * to be decoupled from injection of the actual plugins so that ordering is\n * always deterministic regardless of packaging, on-the-fly injection, etc.\n *\n * @param {array} InjectedEventPluginOrder\n * @internal\n */\n\nfunction injectEventPluginOrder(injectedEventPluginOrder) {\n if (!!eventPluginOrder) {\n {\n throw Error( \"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.\" );\n }\n } // Clone the ordering so it cannot be dynamically mutated.\n\n\n eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);\n recomputePluginOrdering();\n}\n/**\n * Injects plugins to be used by plugin event system. The plugin names must be\n * in the ordering injected by `injectEventPluginOrder`.\n *\n * Plugins can be injected as part of page initialization or on-the-fly.\n *\n * @param {object} injectedNamesToPlugins Map from names to plugin modules.\n * @internal\n */\n\nfunction injectEventPluginsByName(injectedNamesToPlugins) {\n var isOrderingDirty = false;\n\n for (var pluginName in injectedNamesToPlugins) {\n if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {\n continue;\n }\n\n var pluginModule = injectedNamesToPlugins[pluginName];\n\n if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {\n if (!!namesToPlugins[pluginName]) {\n {\n throw Error( \"EventPluginRegistry: Cannot inject two different event plugins using the same name, `\" + pluginName + \"`.\" );\n }\n }\n\n namesToPlugins[pluginName] = pluginModule;\n isOrderingDirty = true;\n }\n }\n\n if (isOrderingDirty) {\n recomputePluginOrdering();\n }\n}\n\nvar canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');\n\nvar PLUGIN_EVENT_SYSTEM = 1;\nvar IS_REPLAYED = 1 << 5;\nvar IS_FIRST_ANCESTOR = 1 << 6;\n\nvar restoreImpl = null;\nvar restoreTarget = null;\nvar restoreQueue = null;\n\nfunction restoreStateOfTarget(target) {\n // We perform this translation at the end of the event loop so that we\n // always receive the correct fiber here\n var internalInstance = getInstanceFromNode(target);\n\n if (!internalInstance) {\n // Unmounted\n return;\n }\n\n if (!(typeof restoreImpl === 'function')) {\n {\n throw Error( \"setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n var stateNode = internalInstance.stateNode; // Guard against Fiber being unmounted.\n\n if (stateNode) {\n var _props = getFiberCurrentPropsFromNode(stateNode);\n\n restoreImpl(internalInstance.stateNode, internalInstance.type, _props);\n }\n}\n\nfunction setRestoreImplementation(impl) {\n restoreImpl = impl;\n}\nfunction enqueueStateRestore(target) {\n if (restoreTarget) {\n if (restoreQueue) {\n restoreQueue.push(target);\n } else {\n restoreQueue = [target];\n }\n } else {\n restoreTarget = target;\n }\n}\nfunction needsStateRestore() {\n return restoreTarget !== null || restoreQueue !== null;\n}\nfunction restoreStateIfNeeded() {\n if (!restoreTarget) {\n return;\n }\n\n var target = restoreTarget;\n var queuedTargets = restoreQueue;\n restoreTarget = null;\n restoreQueue = null;\n restoreStateOfTarget(target);\n\n if (queuedTargets) {\n for (var i = 0; i < queuedTargets.length; i++) {\n restoreStateOfTarget(queuedTargets[i]);\n }\n }\n}\n\nvar enableProfilerTimer = true; // Trace which interactions trigger each commit.\n\nvar enableDeprecatedFlareAPI = false; // Experimental Host Component support.\n\nvar enableFundamentalAPI = false; // Experimental Scope support.\nvar warnAboutStringRefs = false;\n\n// the renderer. Such as when we're dispatching events or if third party\n// libraries need to call batchedUpdates. Eventually, this API will go away when\n// everything is batched by default. We'll then have a similar API to opt-out of\n// scheduled work and instead do synchronous work.\n// Defaults\n\nvar batchedUpdatesImpl = function (fn, bookkeeping) {\n return fn(bookkeeping);\n};\n\nvar discreteUpdatesImpl = function (fn, a, b, c, d) {\n return fn(a, b, c, d);\n};\n\nvar flushDiscreteUpdatesImpl = function () {};\n\nvar batchedEventUpdatesImpl = batchedUpdatesImpl;\nvar isInsideEventHandler = false;\nvar isBatchingEventUpdates = false;\n\nfunction finishEventHandler() {\n // Here we wait until all updates have propagated, which is important\n // when using controlled components within layers:\n // https://github.com/facebook/react/issues/1698\n // Then we restore state of any controlled component.\n var controlledComponentsHavePendingUpdates = needsStateRestore();\n\n if (controlledComponentsHavePendingUpdates) {\n // If a controlled event was fired, we may need to restore the state of\n // the DOM node back to the controlled value. This is necessary when React\n // bails out of the update without touching the DOM.\n flushDiscreteUpdatesImpl();\n restoreStateIfNeeded();\n }\n}\n\nfunction batchedUpdates(fn, bookkeeping) {\n if (isInsideEventHandler) {\n // If we are currently inside another batch, we need to wait until it\n // fully completes before restoring state.\n return fn(bookkeeping);\n }\n\n isInsideEventHandler = true;\n\n try {\n return batchedUpdatesImpl(fn, bookkeeping);\n } finally {\n isInsideEventHandler = false;\n finishEventHandler();\n }\n}\nfunction batchedEventUpdates(fn, a, b) {\n if (isBatchingEventUpdates) {\n // If we are currently inside another batch, we need to wait until it\n // fully completes before restoring state.\n return fn(a, b);\n }\n\n isBatchingEventUpdates = true;\n\n try {\n return batchedEventUpdatesImpl(fn, a, b);\n } finally {\n isBatchingEventUpdates = false;\n finishEventHandler();\n }\n} // This is for the React Flare event system\nfunction discreteUpdates(fn, a, b, c, d) {\n var prevIsInsideEventHandler = isInsideEventHandler;\n isInsideEventHandler = true;\n\n try {\n return discreteUpdatesImpl(fn, a, b, c, d);\n } finally {\n isInsideEventHandler = prevIsInsideEventHandler;\n\n if (!isInsideEventHandler) {\n finishEventHandler();\n }\n }\n}\nfunction flushDiscreteUpdatesIfNeeded(timeStamp) {\n // event.timeStamp isn't overly reliable due to inconsistencies in\n // how different browsers have historically provided the time stamp.\n // Some browsers provide high-resolution time stamps for all events,\n // some provide low-resolution time stamps for all events. FF < 52\n // even mixes both time stamps together. Some browsers even report\n // negative time stamps or time stamps that are 0 (iOS9) in some cases.\n // Given we are only comparing two time stamps with equality (!==),\n // we are safe from the resolution differences. If the time stamp is 0\n // we bail-out of preventing the flush, which can affect semantics,\n // such as if an earlier flush removes or adds event listeners that\n // are fired in the subsequent flush. However, this is the same\n // behaviour as we had before this change, so the risks are low.\n if (!isInsideEventHandler && (!enableDeprecatedFlareAPI )) {\n flushDiscreteUpdatesImpl();\n }\n}\nfunction setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {\n batchedUpdatesImpl = _batchedUpdatesImpl;\n discreteUpdatesImpl = _discreteUpdatesImpl;\n flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;\n batchedEventUpdatesImpl = _batchedEventUpdatesImpl;\n}\n\nvar DiscreteEvent = 0;\nvar UserBlockingEvent = 1;\nvar ContinuousEvent = 2;\n\n// A reserved attribute.\n// It is handled by React separately and shouldn't be written to the DOM.\nvar RESERVED = 0; // A simple string attribute.\n// Attributes that aren't in the whitelist are presumed to have this type.\n\nvar 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\nvar 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\nvar 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\nvar OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.\n// When falsy, it should be removed.\n\nvar NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.\n// When falsy, it should be removed.\n\nvar POSITIVE_NUMERIC = 6;\n\n/* eslint-disable max-len */\nvar 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\nvar ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + \"\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040\";\nvar ROOT_ATTRIBUTE_NAME = 'data-reactroot';\nvar VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar illegalAttributeNameCache = {};\nvar validatedAttributeNameCache = {};\nfunction 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 {\n error('Invalid attribute name: `%s`', attributeName);\n }\n\n return false;\n}\nfunction shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {\n if (propertyInfo !== null) {\n return propertyInfo.type === RESERVED;\n }\n\n if (isCustomComponentTag) {\n return false;\n }\n\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return true;\n }\n\n return false;\n}\nfunction 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}\nfunction shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {\n if (value === null || typeof value === 'undefined') {\n return true;\n }\n\n if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {\n return true;\n }\n\n if (isCustomComponentTag) {\n return false;\n }\n\n if (propertyInfo !== null) {\n switch (propertyInfo.type) {\n case BOOLEAN:\n return !value;\n\n case OVERLOADED_BOOLEAN:\n return value === false;\n\n case NUMERIC:\n return isNaN(value);\n\n case POSITIVE_NUMERIC:\n return isNaN(value) || value < 1;\n }\n }\n\n return false;\n}\nfunction getPropertyInfo(name) {\n return properties.hasOwnProperty(name) ? properties[name] : null;\n}\n\nfunction PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) {\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} // 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\nvar properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.\n\nvar 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\nreservedProps.forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\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);\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);\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);\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', '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);\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);\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);\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);\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);\n});\nvar CAMELIZE = /[\\-\\:]([a-z])/g;\n\nvar capitalize = function (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 whitelist.\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);\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);\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);\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);\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\nvar xlinkHref = 'xlinkHref';\nproperties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty\n'xlink:href', 'http://www.w3.org/1999/xlink', true);\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);\n});\n\nvar ReactDebugCurrentFrame = null;\n\n{\n ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n} // A javascript: URL can contain leading C0 control or \\u0020 SPACE,\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\nvar 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;\nvar didWarn = false;\n\nfunction sanitizeURL(url) {\n {\n if (!didWarn && isJavaScriptProtocol.test(url)) {\n didWarn = true;\n\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/**\n * Get the value for a property on a node. Only used in DEV for SSR validation.\n * The \"expected\" argument is used as a hint of what the expected value is.\n * Some properties have multiple equivalent values.\n */\nfunction getValueForProperty(node, name, expected, propertyInfo) {\n {\n if (propertyInfo.mustUseProperty) {\n var propertyName = propertyInfo.propertyName;\n return node[propertyName];\n } else {\n if ( propertyInfo.sanitizeURL) {\n // If we haven't fully disabled javascript: URLs, and if\n // the hydration is successful of a javascript: URL, we\n // still want to warn on the client.\n sanitizeURL('' + expected);\n }\n\n var attributeName = propertyInfo.attributeName;\n var stringValue = null;\n\n if (propertyInfo.type === OVERLOADED_BOOLEAN) {\n if (node.hasAttribute(attributeName)) {\n var value = node.getAttribute(attributeName);\n\n if (value === '') {\n return true;\n }\n\n if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n return value;\n }\n\n if (value === '' + expected) {\n return expected;\n }\n\n return value;\n }\n } else if (node.hasAttribute(attributeName)) {\n if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n // We had an attribute but shouldn't have had one, so read it\n // for the error message.\n return node.getAttribute(attributeName);\n }\n\n if (propertyInfo.type === BOOLEAN) {\n // If this was a boolean, it doesn't matter what the value is\n // the fact that we have it is the same as the expected.\n return expected;\n } // Even if this property uses a namespace we use getAttribute\n // because we assume its namespaced name is the same as our config.\n // To use getAttributeNS we need the local name which we don't have\n // in our config atm.\n\n\n stringValue = node.getAttribute(attributeName);\n }\n\n if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n return stringValue === null ? expected : stringValue;\n } else if (stringValue === '' + expected) {\n return expected;\n } else {\n return stringValue;\n }\n }\n }\n}\n/**\n * Get the value for a attribute on a node. Only used in DEV for SSR validation.\n * The third argument is used as a hint of what the expected value is. Some\n * attributes have multiple equivalent values.\n */\n\nfunction getValueForAttribute(node, name, expected) {\n {\n if (!isAttributeNameSafe(name)) {\n return;\n }\n\n if (!node.hasAttribute(name)) {\n return expected === undefined ? undefined : null;\n }\n\n var value = node.getAttribute(name);\n\n if (value === '' + expected) {\n return expected;\n }\n\n return value;\n }\n}\n/**\n * Sets the value for a property on a node.\n *\n * @param {DOMElement} node\n * @param {string} name\n * @param {*} value\n */\n\nfunction setValueForProperty(node, name, value, isCustomComponentTag) {\n var propertyInfo = getPropertyInfo(name);\n\n if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {\n return;\n }\n\n if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {\n value = null;\n } // If the prop isn't in the special list, treat it as a simple attribute.\n\n\n if (isCustomComponentTag || propertyInfo === null) {\n if (isAttributeNameSafe(name)) {\n var _attributeName = name;\n\n if (value === null) {\n node.removeAttribute(_attributeName);\n } else {\n node.setAttribute(_attributeName, '' + value);\n }\n }\n\n return;\n }\n\n var mustUseProperty = propertyInfo.mustUseProperty;\n\n if (mustUseProperty) {\n var propertyName = propertyInfo.propertyName;\n\n if (value === null) {\n var type = propertyInfo.type;\n node[propertyName] = type === BOOLEAN ? false : '';\n } else {\n // Contrary to `setAttribute`, object properties are properly\n // `toString`ed by IE8/9.\n node[propertyName] = value;\n }\n\n return;\n } // The rest are treated as attributes with special cases.\n\n\n var attributeName = propertyInfo.attributeName,\n attributeNamespace = propertyInfo.attributeNamespace;\n\n if (value === null) {\n node.removeAttribute(attributeName);\n } else {\n var _type = propertyInfo.type;\n var attributeValue;\n\n if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {\n // If attribute type is boolean, we know for sure it won't be an execution sink\n // and we won't require Trusted Type here.\n attributeValue = '';\n } else {\n // `setAttribute` with objects becomes only `[object]` in IE8/9,\n // ('' + value) makes it output the correct toString()-value.\n {\n attributeValue = '' + value;\n }\n\n if (propertyInfo.sanitizeURL) {\n sanitizeURL(attributeValue.toString());\n }\n }\n\n if (attributeNamespace) {\n node.setAttributeNS(attributeNamespace, attributeName, attributeValue);\n } else {\n node.setAttribute(attributeName, attributeValue);\n }\n }\n}\n\nvar BEFORE_SLASH_RE = /^(.*)[\\\\\\/]/;\nfunction describeComponentFrame (name, source, ownerName) {\n var sourceInfo = '';\n\n if (source) {\n var path = source.fileName;\n var fileName = path.replace(BEFORE_SLASH_RE, '');\n\n {\n // In DEV, include code for a common special case:\n // prefer \"folder/index.js\" instead of just \"index.js\".\n if (/^index\\./.test(fileName)) {\n var match = path.match(BEFORE_SLASH_RE);\n\n if (match) {\n var pathBeforeSlash = match[1];\n\n if (pathBeforeSlash) {\n var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');\n fileName = folderName + '/' + fileName;\n }\n }\n }\n }\n\n sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';\n } else if (ownerName) {\n sourceInfo = ' (created by ' + ownerName + ')';\n }\n\n return '\\n in ' + (name || 'Unknown') + sourceInfo;\n}\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;\nvar MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction 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\nvar Uninitialized = -1;\nvar Pending = 0;\nvar Resolved = 1;\nvar Rejected = 2;\nfunction refineResolvedLazyComponent(lazyComponent) {\n return lazyComponent._status === Resolved ? lazyComponent._result : null;\n}\nfunction initializeLazyComponentType(lazyComponent) {\n if (lazyComponent._status === Uninitialized) {\n lazyComponent._status = Pending;\n var ctor = lazyComponent._ctor;\n var thenable = ctor();\n lazyComponent._result = thenable;\n thenable.then(function (moduleObject) {\n if (lazyComponent._status === Pending) {\n var defaultExport = moduleObject.default;\n\n {\n if (defaultExport === undefined) {\n error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + \"const MyComponent = lazy(() => import('./MyComponent'))\", moduleObject);\n }\n }\n\n lazyComponent._status = Resolved;\n lazyComponent._result = defaultExport;\n }\n }, function (error) {\n if (lazyComponent._status === Pending) {\n lazyComponent._status = Rejected;\n lazyComponent._result = error;\n }\n });\n }\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var functionName = innerType.displayName || innerType.name || '';\n return outerType.displayName || (functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName);\n}\n\nfunction getComponentName(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 getComponentName(). ' + '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 return 'Context.Consumer';\n\n case REACT_PROVIDER_TYPE:\n return 'Context.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n return getComponentName(type.type);\n\n case REACT_BLOCK_TYPE:\n return getComponentName(type.render);\n\n case REACT_LAZY_TYPE:\n {\n var thenable = type;\n var resolvedThenable = refineResolvedLazyComponent(thenable);\n\n if (resolvedThenable) {\n return getComponentName(resolvedThenable);\n }\n\n break;\n }\n }\n }\n\n return null;\n}\n\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction describeFiber(fiber) {\n switch (fiber.tag) {\n case HostRoot:\n case HostPortal:\n case HostText:\n case Fragment:\n case ContextProvider:\n case ContextConsumer:\n return '';\n\n default:\n var owner = fiber._debugOwner;\n var source = fiber._debugSource;\n var name = getComponentName(fiber.type);\n var ownerName = null;\n\n if (owner) {\n ownerName = getComponentName(owner.type);\n }\n\n return describeComponentFrame(name, source, ownerName);\n }\n}\n\nfunction getStackByFiberInDevAndProd(workInProgress) {\n var info = '';\n var node = workInProgress;\n\n do {\n info += describeFiber(node);\n node = node.return;\n } while (node);\n\n return info;\n}\nvar current = null;\nvar isRendering = false;\nfunction getCurrentFiberOwnerNameInDevOrNull() {\n {\n if (current === null) {\n return null;\n }\n\n var owner = current._debugOwner;\n\n if (owner !== null && typeof owner !== 'undefined') {\n return getComponentName(owner.type);\n }\n }\n\n return null;\n}\nfunction getCurrentFiberStackInDev() {\n {\n if (current === null) {\n return '';\n } // Safe because if current fiber exists, we are reconciling,\n // and it is guaranteed to be the work-in-progress version.\n\n\n return getStackByFiberInDevAndProd(current);\n }\n}\nfunction resetCurrentFiber() {\n {\n ReactDebugCurrentFrame$1.getCurrentStack = null;\n current = null;\n isRendering = false;\n }\n}\nfunction setCurrentFiber(fiber) {\n {\n ReactDebugCurrentFrame$1.getCurrentStack = getCurrentFiberStackInDev;\n current = fiber;\n isRendering = false;\n }\n}\nfunction setIsRendering(rendering) {\n {\n isRendering = rendering;\n }\n}\n\n// Flow does not allow string concatenation of most non-string types. To work\n// around this limitation, we use an opaque type that can only be obtained by\n// passing the value through getToStringValue first.\nfunction toString(value) {\n return '' + value;\n}\nfunction getToStringValue(value) {\n switch (typeof value) {\n case 'boolean':\n case 'number':\n case 'object':\n case 'string':\n case 'undefined':\n return value;\n\n default:\n // function, symbol are assigned as empty strings\n return '';\n }\n}\n\nvar ReactDebugCurrentFrame$2 = null;\nvar ReactControlledValuePropTypes = {\n checkPropTypes: null\n};\n\n{\n ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;\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 var propTypes = {\n value: function (props, propName, componentName) {\n if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) {\n return null;\n }\n\n return new 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 checked: function (props, propName, componentName) {\n if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) {\n return null;\n }\n\n return new 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 * Provide a linked `value` attribute for controlled forms. You should not use\n * this outside of the ReactDOM controlled form components.\n */\n\n ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {\n checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum);\n };\n}\n\nfunction isCheckable(elem) {\n var type = elem.type;\n var nodeName = elem.nodeName;\n return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');\n}\n\nfunction getTracker(node) {\n return node._valueTracker;\n}\n\nfunction detachTracker(node) {\n node._valueTracker = null;\n}\n\nfunction getValueFromNode(node) {\n var value = '';\n\n if (!node) {\n return value;\n }\n\n if (isCheckable(node)) {\n value = node.checked ? 'true' : 'false';\n } else {\n value = node.value;\n }\n\n return value;\n}\n\nfunction trackValueOnNode(node) {\n var valueField = isCheckable(node) ? 'checked' : 'value';\n var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);\n var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail\n // and don't track value will cause over reporting of changes,\n // but it's better then a hard failure\n // (needed for certain tests that spyOn input values and Safari)\n\n if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {\n return;\n }\n\n var get = descriptor.get,\n set = descriptor.set;\n Object.defineProperty(node, valueField, {\n configurable: true,\n get: function () {\n return get.call(this);\n },\n set: function (value) {\n currentValue = '' + value;\n set.call(this, value);\n }\n }); // We could've passed this the first time\n // but it triggers a bug in IE11 and Edge 14/15.\n // Calling defineProperty() again should be equivalent.\n // https://github.com/facebook/react/issues/11768\n\n Object.defineProperty(node, valueField, {\n enumerable: descriptor.enumerable\n });\n var tracker = {\n getValue: function () {\n return currentValue;\n },\n setValue: function (value) {\n currentValue = '' + value;\n },\n stopTracking: function () {\n detachTracker(node);\n delete node[valueField];\n }\n };\n return tracker;\n}\n\nfunction track(node) {\n if (getTracker(node)) {\n return;\n } // TODO: Once it's just Fiber we can move this to node._wrapperState\n\n\n node._valueTracker = trackValueOnNode(node);\n}\nfunction updateValueIfChanged(node) {\n if (!node) {\n return false;\n }\n\n var tracker = getTracker(node); // if there is no tracker at this point it's unlikely\n // that trying again will succeed\n\n if (!tracker) {\n return true;\n }\n\n var lastValue = tracker.getValue();\n var nextValue = getValueFromNode(node);\n\n if (nextValue !== lastValue) {\n tracker.setValue(nextValue);\n return true;\n }\n\n return false;\n}\n\nvar didWarnValueDefaultValue = false;\nvar didWarnCheckedDefaultChecked = false;\nvar didWarnControlledToUncontrolled = false;\nvar didWarnUncontrolledToControlled = false;\n\nfunction isControlled(props) {\n var usesChecked = props.type === 'checkbox' || props.type === 'radio';\n return usesChecked ? props.checked != null : props.value != null;\n}\n/**\n * Implements an <input> host component that allows setting these optional\n * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.\n *\n * If `checked` or `value` are not supplied (or null/undefined), user actions\n * that affect the checked state or value will trigger updates to the element.\n *\n * If they are supplied (and not null/undefined), the rendered element will not\n * trigger updates to the element. Instead, the props must change in order for\n * the rendered element to be updated.\n *\n * The rendered element will be initialized as unchecked (or `defaultChecked`)\n * with an empty value (or `defaultValue`).\n *\n * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html\n */\n\n\nfunction getHostProps(element, props) {\n var node = element;\n var checked = props.checked;\n\n var hostProps = _assign({}, props, {\n defaultChecked: undefined,\n defaultValue: undefined,\n value: undefined,\n checked: checked != null ? checked : node._wrapperState.initialChecked\n });\n\n return hostProps;\n}\nfunction initWrapperState(element, props) {\n {\n ReactControlledValuePropTypes.checkPropTypes('input', props);\n\n if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {\n error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);\n\n didWarnCheckedDefaultChecked = true;\n }\n\n if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {\n error('%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);\n\n didWarnValueDefaultValue = true;\n }\n }\n\n var node = element;\n var defaultValue = props.defaultValue == null ? '' : props.defaultValue;\n node._wrapperState = {\n initialChecked: props.checked != null ? props.checked : props.defaultChecked,\n initialValue: getToStringValue(props.value != null ? props.value : defaultValue),\n controlled: isControlled(props)\n };\n}\nfunction updateChecked(element, props) {\n var node = element;\n var checked = props.checked;\n\n if (checked != null) {\n setValueForProperty(node, 'checked', checked, false);\n }\n}\nfunction updateWrapper(element, props) {\n var node = element;\n\n {\n var controlled = isControlled(props);\n\n if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {\n error('A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);\n\n didWarnUncontrolledToControlled = true;\n }\n\n if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {\n error('A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);\n\n didWarnControlledToUncontrolled = true;\n }\n }\n\n updateChecked(element, props);\n var value = getToStringValue(props.value);\n var type = props.type;\n\n if (value != null) {\n if (type === 'number') {\n if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible.\n // eslint-disable-next-line\n node.value != value) {\n node.value = toString(value);\n }\n } else if (node.value !== toString(value)) {\n node.value = toString(value);\n }\n } else if (type === 'submit' || type === 'reset') {\n // Submit/reset inputs need the attribute removed completely to avoid\n // blank-text buttons.\n node.removeAttribute('value');\n return;\n }\n\n {\n // When syncing the value attribute, the value comes from a cascade of\n // properties:\n // 1. The value React property\n // 2. The defaultValue React property\n // 3. Otherwise there should be no change\n if (props.hasOwnProperty('value')) {\n setDefaultValue(node, props.type, value);\n } else if (props.hasOwnProperty('defaultValue')) {\n setDefaultValue(node, props.type, getToStringValue(props.defaultValue));\n }\n }\n\n {\n // When syncing the checked attribute, it only changes when it needs\n // to be removed, such as transitioning from a checkbox into a text input\n if (props.checked == null && props.defaultChecked != null) {\n node.defaultChecked = !!props.defaultChecked;\n }\n }\n}\nfunction postMountWrapper(element, props, isHydrating) {\n var node = element; // Do not assign value if it is already set. This prevents user text input\n // from being lost during SSR hydration.\n\n if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {\n var type = props.type;\n var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the\n // default value provided by the browser. See: #12872\n\n if (isButton && (props.value === undefined || props.value === null)) {\n return;\n }\n\n var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input\n // from being lost during SSR hydration.\n\n if (!isHydrating) {\n {\n // When syncing the value attribute, the value property should use\n // the wrapperState._initialValue property. This uses:\n //\n // 1. The value React property when present\n // 2. The defaultValue React property when present\n // 3. An empty string\n if (initialValue !== node.value) {\n node.value = initialValue;\n }\n }\n }\n\n {\n // Otherwise, the value attribute is synchronized to the property,\n // so we assign defaultValue to the same thing as the value property\n // assignment step above.\n node.defaultValue = initialValue;\n }\n } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug\n // this is needed to work around a chrome bug where setting defaultChecked\n // will sometimes influence the value of checked (even after detachment).\n // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416\n // We need to temporarily unset name to avoid disrupting radio button groups.\n\n\n var name = node.name;\n\n if (name !== '') {\n node.name = '';\n }\n\n {\n // When syncing the checked attribute, both the checked property and\n // attribute are assigned at the same time using defaultChecked. This uses:\n //\n // 1. The checked React property when present\n // 2. The defaultChecked React property when present\n // 3. Otherwise, false\n node.defaultChecked = !node.defaultChecked;\n node.defaultChecked = !!node._wrapperState.initialChecked;\n }\n\n if (name !== '') {\n node.name = name;\n }\n}\nfunction restoreControlledState(element, props) {\n var node = element;\n updateWrapper(node, props);\n updateNamedCousins(node, props);\n}\n\nfunction updateNamedCousins(rootNode, props) {\n var name = props.name;\n\n if (props.type === 'radio' && name != null) {\n var queryRoot = rootNode;\n\n while (queryRoot.parentNode) {\n queryRoot = queryRoot.parentNode;\n } // If `rootNode.form` was non-null, then we could try `form.elements`,\n // but that sometimes behaves strangely in IE8. We could also try using\n // `form.getElementsByName`, but that will only return direct children\n // and won't include inputs that use the HTML5 `form=` attribute. Since\n // the input might not even be in a form. It might not even be in the\n // document. Let's just use the local `querySelectorAll` to ensure we don't\n // miss anything.\n\n\n var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type=\"radio\"]');\n\n for (var i = 0; i < group.length; i++) {\n var otherNode = group[i];\n\n if (otherNode === rootNode || otherNode.form !== rootNode.form) {\n continue;\n } // This will throw if radio buttons rendered by different copies of React\n // and the same name are rendered into the same form (same as #1939).\n // That's probably okay; we don't support it just as we don't support\n // mixing React radio buttons with non-React ones.\n\n\n var otherProps = getFiberCurrentPropsFromNode$1(otherNode);\n\n if (!otherProps) {\n {\n throw Error( \"ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.\" );\n }\n } // We need update the tracked value on the named cousin since the value\n // was changed but the input saw no event or value set\n\n\n updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that\n // was previously checked to update will cause it to be come re-checked\n // as appropriate.\n\n updateWrapper(otherNode, otherProps);\n }\n }\n} // In Chrome, assigning defaultValue to certain input types triggers input validation.\n// For number inputs, the display value loses trailing decimal points. For email inputs,\n// Chrome raises \"The specified value <x> is not a valid email address\".\n//\n// Here we check to see if the defaultValue has actually changed, avoiding these problems\n// when the user is inputting text\n//\n// https://github.com/facebook/react/issues/7253\n\n\nfunction setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}\n\nvar didWarnSelectedSetOnOption = false;\nvar didWarnInvalidChild = false;\n\nfunction flattenChildren(children) {\n var content = ''; // Flatten children. We'll warn if they are invalid\n // during validateProps() which runs for hydration too.\n // Note that this would throw on non-element objects.\n // Elements are stringified (which is normally irrelevant\n // but matters for <fbt>).\n\n React.Children.forEach(children, function (child) {\n if (child == null) {\n return;\n }\n\n content += child; // Note: we don't warn about invalid children here.\n // Instead, this is done separately below so that\n // it happens during the hydration codepath too.\n });\n return content;\n}\n/**\n * Implements an <option> host component that warns when `selected` is set.\n */\n\n\nfunction validateProps(element, props) {\n {\n // This mirrors the codepath above, but runs for hydration too.\n // Warn about invalid children here so that client and hydration are consistent.\n // TODO: this seems like it could cause a DEV-only throw for hydration\n // if children contains a non-element object. We should try to avoid that.\n if (typeof props.children === 'object' && props.children !== null) {\n React.Children.forEach(props.children, function (child) {\n if (child == null) {\n return;\n }\n\n if (typeof child === 'string' || typeof child === 'number') {\n return;\n }\n\n if (typeof child.type !== 'string') {\n return;\n }\n\n if (!didWarnInvalidChild) {\n didWarnInvalidChild = true;\n\n error('Only strings and numbers are supported as <option> children.');\n }\n });\n } // TODO: Remove support for `selected` in <option>.\n\n\n if (props.selected != null && !didWarnSelectedSetOnOption) {\n error('Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.');\n\n didWarnSelectedSetOnOption = true;\n }\n }\n}\nfunction postMountWrapper$1(element, props) {\n // value=\"\" should make a value attribute (#6219)\n if (props.value != null) {\n element.setAttribute('value', toString(getToStringValue(props.value)));\n }\n}\nfunction getHostProps$1(element, props) {\n var hostProps = _assign({\n children: undefined\n }, props);\n\n var content = flattenChildren(props.children);\n\n if (content) {\n hostProps.children = content;\n }\n\n return hostProps;\n}\n\nvar didWarnValueDefaultValue$1;\n\n{\n didWarnValueDefaultValue$1 = false;\n}\n\nfunction getDeclarationErrorAddendum() {\n var ownerName = getCurrentFiberOwnerNameInDevOrNull();\n\n if (ownerName) {\n return '\\n\\nCheck the render method of `' + ownerName + '`.';\n }\n\n return '';\n}\n\nvar valuePropNames = ['value', 'defaultValue'];\n/**\n * Validation function for `value` and `defaultValue`.\n */\n\nfunction checkSelectPropTypes(props) {\n {\n ReactControlledValuePropTypes.checkPropTypes('select', props);\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n\n if (props[propName] == null) {\n continue;\n }\n\n var isArray = Array.isArray(props[propName]);\n\n if (props.multiple && !isArray) {\n error('The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());\n } else if (!props.multiple && isArray) {\n error('The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());\n }\n }\n }\n}\n\nfunction updateOptions(node, multiple, propValue, setDefaultSelected) {\n var options = node.options;\n\n if (multiple) {\n var selectedValues = propValue;\n var selectedValue = {};\n\n for (var i = 0; i < selectedValues.length; i++) {\n // Prefix to avoid chaos with special keys.\n selectedValue['$' + selectedValues[i]] = true;\n }\n\n for (var _i = 0; _i < options.length; _i++) {\n var selected = selectedValue.hasOwnProperty('$' + options[_i].value);\n\n if (options[_i].selected !== selected) {\n options[_i].selected = selected;\n }\n\n if (selected && setDefaultSelected) {\n options[_i].defaultSelected = true;\n }\n }\n } else {\n // Do not set `select.value` as exact behavior isn't consistent across all\n // browsers for all cases.\n var _selectedValue = toString(getToStringValue(propValue));\n\n var defaultSelected = null;\n\n for (var _i2 = 0; _i2 < options.length; _i2++) {\n if (options[_i2].value === _selectedValue) {\n options[_i2].selected = true;\n\n if (setDefaultSelected) {\n options[_i2].defaultSelected = true;\n }\n\n return;\n }\n\n if (defaultSelected === null && !options[_i2].disabled) {\n defaultSelected = options[_i2];\n }\n }\n\n if (defaultSelected !== null) {\n defaultSelected.selected = true;\n }\n }\n}\n/**\n * Implements a <select> host component that allows optionally setting the\n * props `value` and `defaultValue`. If `multiple` is false, the prop must be a\n * stringable. If `multiple` is true, the prop must be an array of stringables.\n *\n * If `value` is not supplied (or null/undefined), user actions that change the\n * selected option will trigger updates to the rendered options.\n *\n * If it is supplied (and not null/undefined), the rendered options will not\n * update in response to user actions. Instead, the `value` prop must change in\n * order for the rendered options to update.\n *\n * If `defaultValue` is provided, any options with the supplied values will be\n * selected.\n */\n\n\nfunction getHostProps$2(element, props) {\n return _assign({}, props, {\n value: undefined\n });\n}\nfunction initWrapperState$1(element, props) {\n var node = element;\n\n {\n checkSelectPropTypes(props);\n }\n\n node._wrapperState = {\n wasMultiple: !!props.multiple\n };\n\n {\n if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {\n error('Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');\n\n didWarnValueDefaultValue$1 = true;\n }\n }\n}\nfunction postMountWrapper$2(element, props) {\n var node = element;\n node.multiple = !!props.multiple;\n var value = props.value;\n\n if (value != null) {\n updateOptions(node, !!props.multiple, value, false);\n } else if (props.defaultValue != null) {\n updateOptions(node, !!props.multiple, props.defaultValue, true);\n }\n}\nfunction postUpdateWrapper(element, props) {\n var node = element;\n var wasMultiple = node._wrapperState.wasMultiple;\n node._wrapperState.wasMultiple = !!props.multiple;\n var value = props.value;\n\n if (value != null) {\n updateOptions(node, !!props.multiple, value, false);\n } else if (wasMultiple !== !!props.multiple) {\n // For simplicity, reapply `defaultValue` if `multiple` is toggled.\n if (props.defaultValue != null) {\n updateOptions(node, !!props.multiple, props.defaultValue, true);\n } else {\n // Revert the select back to its default unselected state.\n updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);\n }\n }\n}\nfunction restoreControlledState$1(element, props) {\n var node = element;\n var value = props.value;\n\n if (value != null) {\n updateOptions(node, !!props.multiple, value, false);\n }\n}\n\nvar didWarnValDefaultVal = false;\n\n/**\n * Implements a <textarea> host component that allows setting `value`, and\n * `defaultValue`. This differs from the traditional DOM API because value is\n * usually set as PCDATA children.\n *\n * If `value` is not supplied (or null/undefined), user actions that affect the\n * value will trigger updates to the element.\n *\n * If `value` is supplied (and not null/undefined), the rendered element will\n * not trigger updates to the element. Instead, the `value` prop must change in\n * order for the rendered element to be updated.\n *\n * The rendered element will be initialized with an empty value, the prop\n * `defaultValue` if specified, or the children content (deprecated).\n */\nfunction getHostProps$3(element, props) {\n var node = element;\n\n if (!(props.dangerouslySetInnerHTML == null)) {\n {\n throw Error( \"`dangerouslySetInnerHTML` does not make sense on <textarea>.\" );\n }\n } // Always set children to the same thing. In IE9, the selection range will\n // get reset if `textContent` is mutated. We could add a check in setTextContent\n // to only set the value if/when the value differs from the node value (which would\n // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this\n // solution. The value can be a boolean or object so that's why it's forced\n // to be a string.\n\n\n var hostProps = _assign({}, props, {\n value: undefined,\n defaultValue: undefined,\n children: toString(node._wrapperState.initialValue)\n });\n\n return hostProps;\n}\nfunction initWrapperState$2(element, props) {\n var node = element;\n\n {\n ReactControlledValuePropTypes.checkPropTypes('textarea', props);\n\n if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {\n error('%s contains a textarea with both value and defaultValue props. ' + 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component');\n\n didWarnValDefaultVal = true;\n }\n }\n\n var initialValue = props.value; // Only bother fetching default value if we're going to use it\n\n if (initialValue == null) {\n var children = props.children,\n defaultValue = props.defaultValue;\n\n if (children != null) {\n {\n error('Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');\n }\n\n {\n if (!(defaultValue == null)) {\n {\n throw Error( \"If you supply `defaultValue` on a <textarea>, do not pass children.\" );\n }\n }\n\n if (Array.isArray(children)) {\n if (!(children.length <= 1)) {\n {\n throw Error( \"<textarea> can only have at most one child.\" );\n }\n }\n\n children = children[0];\n }\n\n defaultValue = children;\n }\n }\n\n if (defaultValue == null) {\n defaultValue = '';\n }\n\n initialValue = defaultValue;\n }\n\n node._wrapperState = {\n initialValue: getToStringValue(initialValue)\n };\n}\nfunction updateWrapper$1(element, props) {\n var node = element;\n var value = getToStringValue(props.value);\n var defaultValue = getToStringValue(props.defaultValue);\n\n if (value != null) {\n // Cast `value` to a string to ensure the value is set correctly. While\n // browsers typically do this as necessary, jsdom doesn't.\n var newValue = toString(value); // To avoid side effects (such as losing text selection), only set value if changed\n\n if (newValue !== node.value) {\n node.value = newValue;\n }\n\n if (props.defaultValue == null && node.defaultValue !== newValue) {\n node.defaultValue = newValue;\n }\n }\n\n if (defaultValue != null) {\n node.defaultValue = toString(defaultValue);\n }\n}\nfunction postMountWrapper$3(element, props) {\n var node = element; // This is in postMount because we need access to the DOM node, which is not\n // available until after the component has mounted.\n\n var textContent = node.textContent; // Only set node.value if textContent is equal to the expected\n // initial value. In IE10/IE11 there is a bug where the placeholder attribute\n // will populate textContent as well.\n // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/\n\n if (textContent === node._wrapperState.initialValue) {\n if (textContent !== '' && textContent !== null) {\n node.value = textContent;\n }\n }\n}\nfunction restoreControlledState$2(element, props) {\n // DOM component is still mounted; update\n updateWrapper$1(element, props);\n}\n\nvar HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nvar MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\nvar SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nvar Namespaces = {\n html: HTML_NAMESPACE,\n mathml: MATH_NAMESPACE,\n svg: SVG_NAMESPACE\n}; // Assumes there is no parent namespace.\n\nfunction getIntrinsicNamespace(type) {\n switch (type) {\n case 'svg':\n return SVG_NAMESPACE;\n\n case 'math':\n return MATH_NAMESPACE;\n\n default:\n return HTML_NAMESPACE;\n }\n}\nfunction getChildNamespace(parentNamespace, type) {\n if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {\n // No (or default) parent namespace: potential entry point.\n return getIntrinsicNamespace(type);\n }\n\n if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {\n // We're leaving SVG.\n return HTML_NAMESPACE;\n } // By default, pass namespace below.\n\n\n return parentNamespace;\n}\n\n/* globals MSApp */\n\n/**\n * Create a function which has 'unsafe' privileges (required by windows8 apps)\n */\nvar createMicrosoftUnsafeLocalFunction = function (func) {\n if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {\n return function (arg0, arg1, arg2, arg3) {\n MSApp.execUnsafeLocalFunction(function () {\n return func(arg0, arg1, arg2, arg3);\n });\n };\n } else {\n return func;\n }\n};\n\nvar reusableSVGContainer;\n/**\n * Set the innerHTML property of a node\n *\n * @param {DOMElement} node\n * @param {string} html\n * @internal\n */\n\nvar setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {\n if (node.namespaceURI === Namespaces.svg) {\n\n if (!('innerHTML' in node)) {\n // IE does not have innerHTML for SVG nodes, so instead we inject the\n // new markup in a temp node and then move the child nodes across into\n // the target node\n reusableSVGContainer = reusableSVGContainer || document.createElement('div');\n reusableSVGContainer.innerHTML = '<svg>' + html.valueOf().toString() + '</svg>';\n var svgNode = reusableSVGContainer.firstChild;\n\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n\n while (svgNode.firstChild) {\n node.appendChild(svgNode.firstChild);\n }\n\n return;\n }\n }\n\n node.innerHTML = html;\n});\n\n/**\n * HTML nodeType values that represent the type of the node\n */\nvar ELEMENT_NODE = 1;\nvar TEXT_NODE = 3;\nvar COMMENT_NODE = 8;\nvar DOCUMENT_NODE = 9;\nvar DOCUMENT_FRAGMENT_NODE = 11;\n\n/**\n * Set the textContent property of a node. For text updates, it's faster\n * to set the `nodeValue` of the Text node directly instead of using\n * `.textContent` which will remove the existing node and create a new one.\n *\n * @param {DOMElement} node\n * @param {string} text\n * @internal\n */\n\nvar setTextContent = function (node, text) {\n if (text) {\n var firstChild = node.firstChild;\n\n if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {\n firstChild.nodeValue = text;\n return;\n }\n }\n\n node.textContent = text;\n};\n\n// Do not use the below two methods directly!\n// Instead use constants exported from DOMTopLevelEventTypes in ReactDOM.\n// (It is the only module that is allowed to access these methods.)\nfunction unsafeCastStringToDOMTopLevelType(topLevelType) {\n return topLevelType;\n}\nfunction unsafeCastDOMTopLevelTypeToString(topLevelType) {\n return topLevelType;\n}\n\n/**\n * Generate a mapping of standard vendor prefixes using the defined style property and event name.\n *\n * @param {string} styleProp\n * @param {string} eventName\n * @returns {object}\n */\n\nfunction makePrefixMap(styleProp, eventName) {\n var prefixes = {};\n prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();\n prefixes['Webkit' + styleProp] = 'webkit' + eventName;\n prefixes['Moz' + styleProp] = 'moz' + eventName;\n return prefixes;\n}\n/**\n * A list of event names to a configurable list of vendor prefixes.\n */\n\n\nvar vendorPrefixes = {\n animationend: makePrefixMap('Animation', 'AnimationEnd'),\n animationiteration: makePrefixMap('Animation', 'AnimationIteration'),\n animationstart: makePrefixMap('Animation', 'AnimationStart'),\n transitionend: makePrefixMap('Transition', 'TransitionEnd')\n};\n/**\n * Event names that have already been detected and prefixed (if applicable).\n */\n\nvar prefixedEventNames = {};\n/**\n * Element to check for prefixes on.\n */\n\nvar style = {};\n/**\n * Bootstrap if a DOM exists.\n */\n\nif (canUseDOM) {\n style = document.createElement('div').style; // On some platforms, in particular some releases of Android 4.x,\n // the un-prefixed \"animation\" and \"transition\" properties are defined on the\n // style object but the events that fire will still be prefixed, so we need\n // to check if the un-prefixed events are usable, and if not remove them from the map.\n\n if (!('AnimationEvent' in window)) {\n delete vendorPrefixes.animationend.animation;\n delete vendorPrefixes.animationiteration.animation;\n delete vendorPrefixes.animationstart.animation;\n } // Same as above\n\n\n if (!('TransitionEvent' in window)) {\n delete vendorPrefixes.transitionend.transition;\n }\n}\n/**\n * Attempts to determine the correct vendor prefixed event name.\n *\n * @param {string} eventName\n * @returns {string}\n */\n\n\nfunction getVendorPrefixedEventName(eventName) {\n if (prefixedEventNames[eventName]) {\n return prefixedEventNames[eventName];\n } else if (!vendorPrefixes[eventName]) {\n return eventName;\n }\n\n var prefixMap = vendorPrefixes[eventName];\n\n for (var styleProp in prefixMap) {\n if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {\n return prefixedEventNames[eventName] = prefixMap[styleProp];\n }\n }\n\n return eventName;\n}\n\n/**\n * To identify top level events in ReactDOM, we use constants defined by this\n * module. This is the only module that uses the unsafe* methods to express\n * that the constants actually correspond to the browser event names. This lets\n * us save some bundle size by avoiding a top level type -> event name map.\n * The rest of ReactDOM code should import top level types from this file.\n */\n\nvar TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort');\nvar TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend'));\nvar TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration'));\nvar TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart'));\nvar TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur');\nvar TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay');\nvar TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough');\nvar TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel');\nvar TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change');\nvar TOP_CLICK = unsafeCastStringToDOMTopLevelType('click');\nvar TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close');\nvar TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend');\nvar TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart');\nvar TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate');\nvar TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu');\nvar TOP_COPY = unsafeCastStringToDOMTopLevelType('copy');\nvar TOP_CUT = unsafeCastStringToDOMTopLevelType('cut');\nvar TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick');\nvar TOP_AUX_CLICK = unsafeCastStringToDOMTopLevelType('auxclick');\nvar TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag');\nvar TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend');\nvar TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter');\nvar TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit');\nvar TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave');\nvar TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover');\nvar TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart');\nvar TOP_DROP = unsafeCastStringToDOMTopLevelType('drop');\nvar TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange');\nvar TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied');\nvar TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted');\nvar TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended');\nvar TOP_ERROR = unsafeCastStringToDOMTopLevelType('error');\nvar TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus');\nvar TOP_GOT_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('gotpointercapture');\nvar TOP_INPUT = unsafeCastStringToDOMTopLevelType('input');\nvar TOP_INVALID = unsafeCastStringToDOMTopLevelType('invalid');\nvar TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown');\nvar TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress');\nvar TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup');\nvar TOP_LOAD = unsafeCastStringToDOMTopLevelType('load');\nvar TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart');\nvar TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata');\nvar TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata');\nvar TOP_LOST_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('lostpointercapture');\nvar TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown');\nvar TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove');\nvar TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout');\nvar TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover');\nvar TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup');\nvar TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste');\nvar TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause');\nvar TOP_PLAY = unsafeCastStringToDOMTopLevelType('play');\nvar TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing');\nvar TOP_POINTER_CANCEL = unsafeCastStringToDOMTopLevelType('pointercancel');\nvar TOP_POINTER_DOWN = unsafeCastStringToDOMTopLevelType('pointerdown');\nvar TOP_POINTER_MOVE = unsafeCastStringToDOMTopLevelType('pointermove');\nvar TOP_POINTER_OUT = unsafeCastStringToDOMTopLevelType('pointerout');\nvar TOP_POINTER_OVER = unsafeCastStringToDOMTopLevelType('pointerover');\nvar TOP_POINTER_UP = unsafeCastStringToDOMTopLevelType('pointerup');\nvar TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress');\nvar TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange');\nvar TOP_RESET = unsafeCastStringToDOMTopLevelType('reset');\nvar TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll');\nvar TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked');\nvar TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking');\nvar TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange');\nvar TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled');\nvar TOP_SUBMIT = unsafeCastStringToDOMTopLevelType('submit');\nvar TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend');\nvar TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput');\nvar TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate');\nvar TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle');\nvar TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel');\nvar TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend');\nvar TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove');\nvar TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart');\nvar TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend'));\nvar TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange');\nvar TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting');\nvar TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel'); // List of events that need to be individually attached to media elements.\n// Note that events in this list will *not* be listened to at the top level\n// unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`.\n\nvar mediaEventTypes = [TOP_ABORT, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_VOLUME_CHANGE, TOP_WAITING];\nfunction getRawEventName(topLevelType) {\n return unsafeCastDOMTopLevelTypeToString(topLevelType);\n}\n\nvar PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; // prettier-ignore\n\nvar elementListenerMap = new PossiblyWeakMap();\nfunction getListenerMapForElement(element) {\n var listenerMap = elementListenerMap.get(element);\n\n if (listenerMap === undefined) {\n listenerMap = new Map();\n elementListenerMap.set(element, listenerMap);\n }\n\n return listenerMap;\n}\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 */\nfunction get(key) {\n return key._reactInternalFiber;\n}\nfunction has(key) {\n return key._reactInternalFiber !== undefined;\n}\nfunction set(key, value) {\n key._reactInternalFiber = value;\n}\n\n// Don't change these two values. They're used by React Dev Tools.\nvar NoEffect =\n/* */\n0;\nvar PerformedWork =\n/* */\n1; // You can change the rest (and add more).\n\nvar Placement =\n/* */\n2;\nvar Update =\n/* */\n4;\nvar PlacementAndUpdate =\n/* */\n6;\nvar Deletion =\n/* */\n8;\nvar ContentReset =\n/* */\n16;\nvar Callback =\n/* */\n32;\nvar DidCapture =\n/* */\n64;\nvar Ref =\n/* */\n128;\nvar Snapshot =\n/* */\n256;\nvar Passive =\n/* */\n512;\nvar Hydrating =\n/* */\n1024;\nvar HydratingAndUpdate =\n/* */\n1028; // Passive & Update & Callback & Ref & Snapshot\n\nvar LifecycleEffectMask =\n/* */\n932; // Union of all host effects\n\nvar HostEffectMask =\n/* */\n2047;\nvar Incomplete =\n/* */\n2048;\nvar ShouldCapture =\n/* */\n4096;\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nfunction getNearestMountedFiber(fiber) {\n var node = fiber;\n var nearestMounted = fiber;\n\n if (!fiber.alternate) {\n // If there is no alternate, this might be a new tree that isn't inserted\n // yet. If it is, then it will have a pending insertion effect on it.\n var nextNode = node;\n\n do {\n node = nextNode;\n\n if ((node.effectTag & (Placement | Hydrating)) !== NoEffect) {\n // This is an insertion or in-progress hydration. The nearest possible\n // mounted fiber is the parent but we need to continue to figure out\n // if that one is still mounted.\n nearestMounted = node.return;\n }\n\n nextNode = node.return;\n } while (nextNode);\n } else {\n while (node.return) {\n node = node.return;\n }\n }\n\n if (node.tag === HostRoot) {\n // TODO: Check if this was a nested HostRoot when used with\n // renderContainerIntoSubtree.\n return nearestMounted;\n } // If we didn't hit the root, that means that we're in an disconnected tree\n // that has been unmounted.\n\n\n return null;\n}\nfunction getSuspenseInstanceFromFiber(fiber) {\n if (fiber.tag === SuspenseComponent) {\n var suspenseState = fiber.memoizedState;\n\n if (suspenseState === null) {\n var current = fiber.alternate;\n\n if (current !== null) {\n suspenseState = current.memoizedState;\n }\n }\n\n if (suspenseState !== null) {\n return suspenseState.dehydrated;\n }\n }\n\n return null;\n}\nfunction getContainerFromFiber(fiber) {\n return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;\n}\nfunction isFiberMounted(fiber) {\n return getNearestMountedFiber(fiber) === fiber;\n}\nfunction isMounted(component) {\n {\n var owner = ReactCurrentOwner.current;\n\n if (owner !== null && owner.tag === ClassComponent) {\n var ownerFiber = owner;\n var instance = ownerFiber.stateNode;\n\n if (!instance._warnedAboutRefsInRender) {\n error('%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber.type) || 'A component');\n }\n\n instance._warnedAboutRefsInRender = true;\n }\n }\n\n var fiber = get(component);\n\n if (!fiber) {\n return false;\n }\n\n return getNearestMountedFiber(fiber) === fiber;\n}\n\nfunction assertIsMounted(fiber) {\n if (!(getNearestMountedFiber(fiber) === fiber)) {\n {\n throw Error( \"Unable to find node on an unmounted component.\" );\n }\n }\n}\n\nfunction findCurrentFiberUsingSlowPath(fiber) {\n var alternate = fiber.alternate;\n\n if (!alternate) {\n // If there is no alternate, then we only need to check if it is mounted.\n var nearestMounted = getNearestMountedFiber(fiber);\n\n if (!(nearestMounted !== null)) {\n {\n throw Error( \"Unable to find node on an unmounted component.\" );\n }\n }\n\n if (nearestMounted !== fiber) {\n return null;\n }\n\n return fiber;\n } // If we have two possible branches, we'll walk backwards up to the root\n // to see what path the root points to. On the way we may hit one of the\n // special cases and we'll deal with them.\n\n\n var a = fiber;\n var b = alternate;\n\n while (true) {\n var parentA = a.return;\n\n if (parentA === null) {\n // We're at the root.\n break;\n }\n\n var parentB = parentA.alternate;\n\n if (parentB === null) {\n // There is no alternate. This is an unusual case. Currently, it only\n // happens when a Suspense component is hidden. An extra fragment fiber\n // is inserted in between the Suspense fiber and its children. Skip\n // over this extra fragment fiber and proceed to the next parent.\n var nextParent = parentA.return;\n\n if (nextParent !== null) {\n a = b = nextParent;\n continue;\n } // If there's no parent, we're at the root.\n\n\n break;\n } // If both copies of the parent fiber point to the same child, we can\n // assume that the child is current. This happens when we bailout on low\n // priority: the bailed out fiber's child reuses the current child.\n\n\n if (parentA.child === parentB.child) {\n var child = parentA.child;\n\n while (child) {\n if (child === a) {\n // We've determined that A is the current branch.\n assertIsMounted(parentA);\n return fiber;\n }\n\n if (child === b) {\n // We've determined that B is the current branch.\n assertIsMounted(parentA);\n return alternate;\n }\n\n child = child.sibling;\n } // We should never have an alternate for any mounting node. So the only\n // way this could possibly happen is if this was unmounted, if at all.\n\n\n {\n {\n throw Error( \"Unable to find node on an unmounted component.\" );\n }\n }\n }\n\n if (a.return !== b.return) {\n // The return pointer of A and the return pointer of B point to different\n // fibers. We assume that return pointers never criss-cross, so A must\n // belong to the child set of A.return, and B must belong to the child\n // set of B.return.\n a = parentA;\n b = parentB;\n } else {\n // The return pointers point to the same fiber. We'll have to use the\n // default, slow path: scan the child sets of each parent alternate to see\n // which child belongs to which set.\n //\n // Search parent A's child set\n var didFindChild = false;\n var _child = parentA.child;\n\n while (_child) {\n if (_child === a) {\n didFindChild = true;\n a = parentA;\n b = parentB;\n break;\n }\n\n if (_child === b) {\n didFindChild = true;\n b = parentA;\n a = parentB;\n break;\n }\n\n _child = _child.sibling;\n }\n\n if (!didFindChild) {\n // Search parent B's child set\n _child = parentB.child;\n\n while (_child) {\n if (_child === a) {\n didFindChild = true;\n a = parentB;\n b = parentA;\n break;\n }\n\n if (_child === b) {\n didFindChild = true;\n b = parentB;\n a = parentA;\n break;\n }\n\n _child = _child.sibling;\n }\n\n if (!didFindChild) {\n {\n throw Error( \"Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.\" );\n }\n }\n }\n }\n\n if (!(a.alternate === b)) {\n {\n throw Error( \"Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n } // If the root is not a host container, we're in a disconnected tree. I.e.\n // unmounted.\n\n\n if (!(a.tag === HostRoot)) {\n {\n throw Error( \"Unable to find node on an unmounted component.\" );\n }\n }\n\n if (a.stateNode.current === a) {\n // We've determined that A is the current branch.\n return fiber;\n } // Otherwise B has to be current branch.\n\n\n return alternate;\n}\nfunction findCurrentHostFiber(parent) {\n var currentParent = findCurrentFiberUsingSlowPath(parent);\n\n if (!currentParent) {\n return null;\n } // Next we'll drill down this component to find the first HostComponent/Text.\n\n\n var node = currentParent;\n\n while (true) {\n if (node.tag === HostComponent || node.tag === HostText) {\n return node;\n } else if (node.child) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === currentParent) {\n return null;\n }\n\n while (!node.sibling) {\n if (!node.return || node.return === currentParent) {\n return null;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n } // Flow needs the return null here, but ESLint complains about it.\n // eslint-disable-next-line no-unreachable\n\n\n return null;\n}\nfunction findCurrentHostFiberWithNoPortals(parent) {\n var currentParent = findCurrentFiberUsingSlowPath(parent);\n\n if (!currentParent) {\n return null;\n } // Next we'll drill down this component to find the first HostComponent/Text.\n\n\n var node = currentParent;\n\n while (true) {\n if (node.tag === HostComponent || node.tag === HostText || enableFundamentalAPI ) {\n return node;\n } else if (node.child && node.tag !== HostPortal) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === currentParent) {\n return null;\n }\n\n while (!node.sibling) {\n if (!node.return || node.return === currentParent) {\n return null;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n } // Flow needs the return null here, but ESLint complains about it.\n // eslint-disable-next-line no-unreachable\n\n\n return null;\n}\n\n/**\n * Accumulates items that must not be null or undefined into the first one. This\n * is used to conserve memory by avoiding array allocations, and thus sacrifices\n * API cleanness. Since `current` can be null before being passed in and not\n * null after this function, make sure to assign it back to `current`:\n *\n * `a = accumulateInto(a, b);`\n *\n * This API should be sparingly used. Try `accumulate` for something cleaner.\n *\n * @return {*|array<*>} An accumulation of items.\n */\n\nfunction accumulateInto(current, next) {\n if (!(next != null)) {\n {\n throw Error( \"accumulateInto(...): Accumulated items must not be null or undefined.\" );\n }\n }\n\n if (current == null) {\n return next;\n } // Both are not empty. Warning: Never call x.concat(y) when you are not\n // certain that x is an Array (x could be a string with concat method).\n\n\n if (Array.isArray(current)) {\n if (Array.isArray(next)) {\n current.push.apply(current, next);\n return current;\n }\n\n current.push(next);\n return current;\n }\n\n if (Array.isArray(next)) {\n // A bit too dangerous to mutate `next`.\n return [current].concat(next);\n }\n\n return [current, next];\n}\n\n/**\n * @param {array} arr an \"accumulation\" of items which is either an Array or\n * a single item. Useful when paired with the `accumulate` module. This is a\n * simple utility that allows us to reason about a collection of items, but\n * handling the case when there is exactly one item (and we do not need to\n * allocate an array).\n * @param {function} cb Callback invoked with each element or a collection.\n * @param {?} [scope] Scope used as `this` in a callback.\n */\nfunction forEachAccumulated(arr, cb, scope) {\n if (Array.isArray(arr)) {\n arr.forEach(cb, scope);\n } else if (arr) {\n cb.call(scope, arr);\n }\n}\n\n/**\n * Internal queue of events that have accumulated their dispatches and are\n * waiting to have their dispatches executed.\n */\n\nvar eventQueue = null;\n/**\n * Dispatches an event and releases it back into the pool, unless persistent.\n *\n * @param {?object} event Synthetic event to be dispatched.\n * @private\n */\n\nvar executeDispatchesAndRelease = function (event) {\n if (event) {\n executeDispatchesInOrder(event);\n\n if (!event.isPersistent()) {\n event.constructor.release(event);\n }\n }\n};\n\nvar executeDispatchesAndReleaseTopLevel = function (e) {\n return executeDispatchesAndRelease(e);\n};\n\nfunction runEventsInBatch(events) {\n if (events !== null) {\n eventQueue = accumulateInto(eventQueue, events);\n } // Set `eventQueue` to null before processing it so that we can tell if more\n // events get enqueued while processing.\n\n\n var processingEventQueue = eventQueue;\n eventQueue = null;\n\n if (!processingEventQueue) {\n return;\n }\n\n forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);\n\n if (!!eventQueue) {\n {\n throw Error( \"processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.\" );\n }\n } // This would be a good time to rethrow if any of the event handlers threw.\n\n\n rethrowCaughtError();\n}\n\n/**\n * Gets the target node from a native browser event by accounting for\n * inconsistencies in browser DOM APIs.\n *\n * @param {object} nativeEvent Native browser event.\n * @return {DOMEventTarget} Target node.\n */\n\nfunction getEventTarget(nativeEvent) {\n // Fallback to nativeEvent.srcElement for IE9\n // https://github.com/facebook/react/issues/12506\n var target = nativeEvent.target || nativeEvent.srcElement || window; // Normalize SVG <use> element events #4963\n\n if (target.correspondingUseElement) {\n target = target.correspondingUseElement;\n } // Safari may fire events on text nodes (Node.TEXT_NODE is 3).\n // @see http://www.quirksmode.org/js/events_properties.html\n\n\n return target.nodeType === TEXT_NODE ? target.parentNode : target;\n}\n\n/**\n * Checks if an event is supported in the current execution environment.\n *\n * NOTE: This will not work correctly for non-generic events such as `change`,\n * `reset`, `load`, `error`, and `select`.\n *\n * Borrows from Modernizr.\n *\n * @param {string} eventNameSuffix Event name, e.g. \"click\".\n * @return {boolean} True if the event is supported.\n * @internal\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\n\nfunction isEventSupported(eventNameSuffix) {\n if (!canUseDOM) {\n return false;\n }\n\n var eventName = 'on' + eventNameSuffix;\n var isSupported = eventName in document;\n\n if (!isSupported) {\n var element = document.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof element[eventName] === 'function';\n }\n\n return isSupported;\n}\n\n/**\n * Summary of `DOMEventPluginSystem` event handling:\n *\n * - Top-level delegation is used to trap most native browser events. This\n * may only occur in the main thread and is the responsibility of\n * ReactDOMEventListener, which is injected and can therefore support\n * pluggable event sources. This is the only work that occurs in the main\n * thread.\n *\n * - We normalize and de-duplicate events to account for browser quirks. This\n * may be done in the worker thread.\n *\n * - Forward these native events (with the associated top-level type used to\n * trap it) to `EventPluginRegistry`, which in turn will ask plugins if they want\n * to extract any synthetic events.\n *\n * - The `EventPluginRegistry` will then process each event by annotating them with\n * \"dispatches\", a sequence of listeners and IDs that care about that event.\n *\n * - The `EventPluginRegistry` then dispatches the events.\n *\n * Overview of React and the event system:\n *\n * +------------+ .\n * | DOM | .\n * +------------+ .\n * | .\n * v .\n * +------------+ .\n * | ReactEvent | .\n * | Listener | .\n * +------------+ . +-----------+\n * | . +--------+|SimpleEvent|\n * | . | |Plugin |\n * +-----|------+ . v +-----------+\n * | | | . +--------------+ +------------+\n * | +-----------.--->|PluginRegistry| | Event |\n * | | . | | +-----------+ | Propagators|\n * | ReactEvent | . | | |TapEvent | |------------|\n * | Emitter | . | |<---+|Plugin | |other plugin|\n * | | . | | +-----------+ | utilities |\n * | +-----------.--->| | +------------+\n * | | | . +--------------+\n * +-----|------+ . ^ +-----------+\n * | . | |Enter/Leave|\n * + . +-------+|Plugin |\n * +-------------+ . +-----------+\n * | application | .\n * |-------------| .\n * | | .\n * | | .\n * +-------------+ .\n * .\n * React Core . General Purpose Event Plugin System\n */\n\nvar CALLBACK_BOOKKEEPING_POOL_SIZE = 10;\nvar callbackBookkeepingPool = [];\n\nfunction releaseTopLevelCallbackBookKeeping(instance) {\n instance.topLevelType = null;\n instance.nativeEvent = null;\n instance.targetInst = null;\n instance.ancestors.length = 0;\n\n if (callbackBookkeepingPool.length < CALLBACK_BOOKKEEPING_POOL_SIZE) {\n callbackBookkeepingPool.push(instance);\n }\n} // Used to store ancestor hierarchy in top level callback\n\n\nfunction getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags) {\n if (callbackBookkeepingPool.length) {\n var instance = callbackBookkeepingPool.pop();\n instance.topLevelType = topLevelType;\n instance.eventSystemFlags = eventSystemFlags;\n instance.nativeEvent = nativeEvent;\n instance.targetInst = targetInst;\n return instance;\n }\n\n return {\n topLevelType: topLevelType,\n eventSystemFlags: eventSystemFlags,\n nativeEvent: nativeEvent,\n targetInst: targetInst,\n ancestors: []\n };\n}\n/**\n * Find the deepest React component completely containing the root of the\n * passed-in instance (for use when entire React trees are nested within each\n * other). If React trees are not nested, returns null.\n */\n\n\nfunction findRootContainerNode(inst) {\n if (inst.tag === HostRoot) {\n return inst.stateNode.containerInfo;\n } // TODO: It may be a good idea to cache this to prevent unnecessary DOM\n // traversal, but caching is difficult to do correctly without using a\n // mutation observer to listen for all DOM changes.\n\n\n while (inst.return) {\n inst = inst.return;\n }\n\n if (inst.tag !== HostRoot) {\n // This can happen if we're in a detached tree.\n return null;\n }\n\n return inst.stateNode.containerInfo;\n}\n/**\n * Allows registered plugins an opportunity to extract events from top-level\n * native browser events.\n *\n * @return {*} An accumulation of synthetic events.\n * @internal\n */\n\n\nfunction extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n var events = null;\n\n for (var i = 0; i < plugins.length; i++) {\n // Not every plugin in the ordering may be loaded at runtime.\n var possiblePlugin = plugins[i];\n\n if (possiblePlugin) {\n var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);\n\n if (extractedEvents) {\n events = accumulateInto(events, extractedEvents);\n }\n }\n }\n\n return events;\n}\n\nfunction runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);\n runEventsInBatch(events);\n}\n\nfunction handleTopLevel(bookKeeping) {\n var targetInst = bookKeeping.targetInst; // Loop through the hierarchy, in case there's any nested components.\n // It's important that we build the array of ancestors before calling any\n // event handlers, because event handlers can modify the DOM, leading to\n // inconsistencies with ReactMount's node cache. See #1105.\n\n var ancestor = targetInst;\n\n do {\n if (!ancestor) {\n var ancestors = bookKeeping.ancestors;\n ancestors.push(ancestor);\n break;\n }\n\n var root = findRootContainerNode(ancestor);\n\n if (!root) {\n break;\n }\n\n var tag = ancestor.tag;\n\n if (tag === HostComponent || tag === HostText) {\n bookKeeping.ancestors.push(ancestor);\n }\n\n ancestor = getClosestInstanceFromNode(root);\n } while (ancestor);\n\n for (var i = 0; i < bookKeeping.ancestors.length; i++) {\n targetInst = bookKeeping.ancestors[i];\n var eventTarget = getEventTarget(bookKeeping.nativeEvent);\n var topLevelType = bookKeeping.topLevelType;\n var nativeEvent = bookKeeping.nativeEvent;\n var eventSystemFlags = bookKeeping.eventSystemFlags; // If this is the first ancestor, we mark it on the system flags\n\n if (i === 0) {\n eventSystemFlags |= IS_FIRST_ANCESTOR;\n }\n\n runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, eventTarget, eventSystemFlags);\n }\n}\n\nfunction dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst) {\n var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags);\n\n try {\n // Event queue being processed in the same cycle allows\n // `preventDefault`.\n batchedEventUpdates(handleTopLevel, bookKeeping);\n } finally {\n releaseTopLevelCallbackBookKeeping(bookKeeping);\n }\n}\n/**\n * We listen for bubbled touch events on the document object.\n *\n * Firefox v8.01 (and possibly others) exhibited strange behavior when\n * mounting `onmousemove` events at some node that was not the document\n * element. The symptoms were that if your mouse is not moving over something\n * contained within that mount point (for example on the background) the\n * top-level listeners for `onmousemove` won't be called. However, if you\n * register the `mousemove` on the document object, then it will of course\n * catch all `mousemove`s. This along with iOS quirks, justifies restricting\n * top-level listeners to the document object only, at least for these\n * movement types of events and possibly all events.\n *\n * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html\n *\n * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but\n * they bubble to document.\n *\n * @param {string} registrationName Name of listener (e.g. `onClick`).\n * @param {object} mountAt Container where to mount the listener\n */\n\nfunction legacyListenToEvent(registrationName, mountAt) {\n var listenerMap = getListenerMapForElement(mountAt);\n var dependencies = registrationNameDependencies[registrationName];\n\n for (var i = 0; i < dependencies.length; i++) {\n var dependency = dependencies[i];\n legacyListenToTopLevelEvent(dependency, mountAt, listenerMap);\n }\n}\nfunction legacyListenToTopLevelEvent(topLevelType, mountAt, listenerMap) {\n if (!listenerMap.has(topLevelType)) {\n switch (topLevelType) {\n case TOP_SCROLL:\n trapCapturedEvent(TOP_SCROLL, mountAt);\n break;\n\n case TOP_FOCUS:\n case TOP_BLUR:\n trapCapturedEvent(TOP_FOCUS, mountAt);\n trapCapturedEvent(TOP_BLUR, mountAt); // We set the flag for a single dependency later in this function,\n // but this ensures we mark both as attached rather than just one.\n\n listenerMap.set(TOP_BLUR, null);\n listenerMap.set(TOP_FOCUS, null);\n break;\n\n case TOP_CANCEL:\n case TOP_CLOSE:\n if (isEventSupported(getRawEventName(topLevelType))) {\n trapCapturedEvent(topLevelType, mountAt);\n }\n\n break;\n\n case TOP_INVALID:\n case TOP_SUBMIT:\n case TOP_RESET:\n // We listen to them on the target DOM elements.\n // Some of them bubble so we don't want them to fire twice.\n break;\n\n default:\n // By default, listen on the top level to all non-media events.\n // Media events don't bubble so adding the listener wouldn't do anything.\n var isMediaEvent = mediaEventTypes.indexOf(topLevelType) !== -1;\n\n if (!isMediaEvent) {\n trapBubbledEvent(topLevelType, mountAt);\n }\n\n break;\n }\n\n listenerMap.set(topLevelType, null);\n }\n}\nfunction isListeningToAllDependencies(registrationName, mountAt) {\n var listenerMap = getListenerMapForElement(mountAt);\n var dependencies = registrationNameDependencies[registrationName];\n\n for (var i = 0; i < dependencies.length; i++) {\n var dependency = dependencies[i];\n\n if (!listenerMap.has(dependency)) {\n return false;\n }\n }\n\n return true;\n}\n\nvar attemptUserBlockingHydration;\nfunction setAttemptUserBlockingHydration(fn) {\n attemptUserBlockingHydration = fn;\n}\nvar attemptContinuousHydration;\nfunction setAttemptContinuousHydration(fn) {\n attemptContinuousHydration = fn;\n}\nvar attemptHydrationAtCurrentPriority;\nfunction setAttemptHydrationAtCurrentPriority(fn) {\n attemptHydrationAtCurrentPriority = fn;\n} // TODO: Upgrade this definition once we're on a newer version of Flow that\nvar hasScheduledReplayAttempt = false; // The queue of discrete events to be replayed.\n\nvar queuedDiscreteEvents = []; // Indicates if any continuous event targets are non-null for early bailout.\n// if the last target was dehydrated.\n\nvar queuedFocus = null;\nvar queuedDrag = null;\nvar queuedMouse = null; // For pointer events there can be one latest event per pointerId.\n\nvar queuedPointers = new Map();\nvar queuedPointerCaptures = new Map(); // We could consider replaying selectionchange and touchmoves too.\n\nvar queuedExplicitHydrationTargets = [];\nfunction hasQueuedDiscreteEvents() {\n return queuedDiscreteEvents.length > 0;\n}\nvar discreteReplayableEvents = [TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_TOUCH_CANCEL, TOP_TOUCH_END, TOP_TOUCH_START, TOP_AUX_CLICK, TOP_DOUBLE_CLICK, TOP_POINTER_CANCEL, TOP_POINTER_DOWN, TOP_POINTER_UP, TOP_DRAG_END, TOP_DRAG_START, TOP_DROP, TOP_COMPOSITION_END, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_INPUT, TOP_TEXT_INPUT, TOP_CLOSE, TOP_CANCEL, TOP_COPY, TOP_CUT, TOP_PASTE, TOP_CLICK, TOP_CHANGE, TOP_CONTEXT_MENU, TOP_RESET, TOP_SUBMIT];\nvar continuousReplayableEvents = [TOP_FOCUS, TOP_BLUR, TOP_DRAG_ENTER, TOP_DRAG_LEAVE, TOP_MOUSE_OVER, TOP_MOUSE_OUT, TOP_POINTER_OVER, TOP_POINTER_OUT, TOP_GOT_POINTER_CAPTURE, TOP_LOST_POINTER_CAPTURE];\nfunction isReplayableDiscreteEvent(eventType) {\n return discreteReplayableEvents.indexOf(eventType) > -1;\n}\n\nfunction trapReplayableEventForDocument(topLevelType, document, listenerMap) {\n legacyListenToTopLevelEvent(topLevelType, document, listenerMap);\n}\n\nfunction eagerlyTrapReplayableEvents(container, document) {\n var listenerMapForDoc = getListenerMapForElement(document); // Discrete\n\n discreteReplayableEvents.forEach(function (topLevelType) {\n trapReplayableEventForDocument(topLevelType, document, listenerMapForDoc);\n }); // Continuous\n\n continuousReplayableEvents.forEach(function (topLevelType) {\n trapReplayableEventForDocument(topLevelType, document, listenerMapForDoc);\n });\n}\n\nfunction createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {\n return {\n blockedOn: blockedOn,\n topLevelType: topLevelType,\n eventSystemFlags: eventSystemFlags | IS_REPLAYED,\n nativeEvent: nativeEvent,\n container: container\n };\n}\n\nfunction queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {\n var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent);\n queuedDiscreteEvents.push(queuedEvent);\n} // Resets the replaying for this type of continuous event to no event.\n\nfunction clearIfContinuousEvent(topLevelType, nativeEvent) {\n switch (topLevelType) {\n case TOP_FOCUS:\n case TOP_BLUR:\n queuedFocus = null;\n break;\n\n case TOP_DRAG_ENTER:\n case TOP_DRAG_LEAVE:\n queuedDrag = null;\n break;\n\n case TOP_MOUSE_OVER:\n case TOP_MOUSE_OUT:\n queuedMouse = null;\n break;\n\n case TOP_POINTER_OVER:\n case TOP_POINTER_OUT:\n {\n var pointerId = nativeEvent.pointerId;\n queuedPointers.delete(pointerId);\n break;\n }\n\n case TOP_GOT_POINTER_CAPTURE:\n case TOP_LOST_POINTER_CAPTURE:\n {\n var _pointerId = nativeEvent.pointerId;\n queuedPointerCaptures.delete(_pointerId);\n break;\n }\n }\n}\n\nfunction accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {\n if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {\n var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent);\n\n if (blockedOn !== null) {\n var _fiber2 = getInstanceFromNode$1(blockedOn);\n\n if (_fiber2 !== null) {\n // Attempt to increase the priority of this target.\n attemptContinuousHydration(_fiber2);\n }\n }\n\n return queuedEvent;\n } // If we have already queued this exact event, then it's because\n // the different event systems have different DOM event listeners.\n // We can accumulate the flags and store a single event to be\n // replayed.\n\n\n existingQueuedEvent.eventSystemFlags |= eventSystemFlags;\n return existingQueuedEvent;\n}\n\nfunction queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {\n // These set relatedTarget to null because the replayed event will be treated as if we\n // moved from outside the window (no target) onto the target once it hydrates.\n // Instead of mutating we could clone the event.\n switch (topLevelType) {\n case TOP_FOCUS:\n {\n var focusEvent = nativeEvent;\n queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, topLevelType, eventSystemFlags, container, focusEvent);\n return true;\n }\n\n case TOP_DRAG_ENTER:\n {\n var dragEvent = nativeEvent;\n queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, topLevelType, eventSystemFlags, container, dragEvent);\n return true;\n }\n\n case TOP_MOUSE_OVER:\n {\n var mouseEvent = nativeEvent;\n queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, topLevelType, eventSystemFlags, container, mouseEvent);\n return true;\n }\n\n case TOP_POINTER_OVER:\n {\n var pointerEvent = nativeEvent;\n var pointerId = pointerEvent.pointerId;\n queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, topLevelType, eventSystemFlags, container, pointerEvent));\n return true;\n }\n\n case TOP_GOT_POINTER_CAPTURE:\n {\n var _pointerEvent = nativeEvent;\n var _pointerId2 = _pointerEvent.pointerId;\n queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, topLevelType, eventSystemFlags, container, _pointerEvent));\n return true;\n }\n }\n\n return false;\n} // Check if this target is unblocked. Returns true if it's unblocked.\n\nfunction attemptExplicitHydrationTarget(queuedTarget) {\n // TODO: This function shares a lot of logic with attemptToDispatchEvent.\n // Try to unify them. It's a bit tricky since it would require two return\n // values.\n var targetInst = getClosestInstanceFromNode(queuedTarget.target);\n\n if (targetInst !== null) {\n var nearestMounted = getNearestMountedFiber(targetInst);\n\n if (nearestMounted !== null) {\n var tag = nearestMounted.tag;\n\n if (tag === SuspenseComponent) {\n var instance = getSuspenseInstanceFromFiber(nearestMounted);\n\n if (instance !== null) {\n // We're blocked on hydrating this boundary.\n // Increase its priority.\n queuedTarget.blockedOn = instance;\n Scheduler.unstable_runWithPriority(queuedTarget.priority, function () {\n attemptHydrationAtCurrentPriority(nearestMounted);\n });\n return;\n }\n } else if (tag === HostRoot) {\n var root = nearestMounted.stateNode;\n\n if (root.hydrate) {\n queuedTarget.blockedOn = getContainerFromFiber(nearestMounted); // We don't currently have a way to increase the priority of\n // a root other than sync.\n\n return;\n }\n }\n }\n }\n\n queuedTarget.blockedOn = null;\n}\n\nfunction attemptReplayContinuousQueuedEvent(queuedEvent) {\n if (queuedEvent.blockedOn !== null) {\n return false;\n }\n\n var nextBlockedOn = attemptToDispatchEvent(queuedEvent.topLevelType, queuedEvent.eventSystemFlags, queuedEvent.container, queuedEvent.nativeEvent);\n\n if (nextBlockedOn !== null) {\n // We're still blocked. Try again later.\n var _fiber3 = getInstanceFromNode$1(nextBlockedOn);\n\n if (_fiber3 !== null) {\n attemptContinuousHydration(_fiber3);\n }\n\n queuedEvent.blockedOn = nextBlockedOn;\n return false;\n }\n\n return true;\n}\n\nfunction attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {\n if (attemptReplayContinuousQueuedEvent(queuedEvent)) {\n map.delete(key);\n }\n}\n\nfunction replayUnblockedEvents() {\n hasScheduledReplayAttempt = false; // First replay discrete events.\n\n while (queuedDiscreteEvents.length > 0) {\n var nextDiscreteEvent = queuedDiscreteEvents[0];\n\n if (nextDiscreteEvent.blockedOn !== null) {\n // We're still blocked.\n // Increase the priority of this boundary to unblock\n // the next discrete event.\n var _fiber4 = getInstanceFromNode$1(nextDiscreteEvent.blockedOn);\n\n if (_fiber4 !== null) {\n attemptUserBlockingHydration(_fiber4);\n }\n\n break;\n }\n\n var nextBlockedOn = attemptToDispatchEvent(nextDiscreteEvent.topLevelType, nextDiscreteEvent.eventSystemFlags, nextDiscreteEvent.container, nextDiscreteEvent.nativeEvent);\n\n if (nextBlockedOn !== null) {\n // We're still blocked. Try again later.\n nextDiscreteEvent.blockedOn = nextBlockedOn;\n } else {\n // We've successfully replayed the first event. Let's try the next one.\n queuedDiscreteEvents.shift();\n }\n } // Next replay any continuous events.\n\n\n if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {\n queuedFocus = null;\n }\n\n if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {\n queuedDrag = null;\n }\n\n if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {\n queuedMouse = null;\n }\n\n queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);\n queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);\n}\n\nfunction scheduleCallbackIfUnblocked(queuedEvent, unblocked) {\n if (queuedEvent.blockedOn === unblocked) {\n queuedEvent.blockedOn = null;\n\n if (!hasScheduledReplayAttempt) {\n hasScheduledReplayAttempt = true; // Schedule a callback to attempt replaying as many events as are\n // now unblocked. This first might not actually be unblocked yet.\n // We could check it early to avoid scheduling an unnecessary callback.\n\n Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);\n }\n }\n}\n\nfunction retryIfBlockedOn(unblocked) {\n // Mark anything that was blocked on this as no longer blocked\n // and eligible for a replay.\n if (queuedDiscreteEvents.length > 0) {\n scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); // This is a exponential search for each boundary that commits. I think it's\n // worth it because we expect very few discrete events to queue up and once\n // we are actually fully unblocked it will be fast to replay them.\n\n for (var i = 1; i < queuedDiscreteEvents.length; i++) {\n var queuedEvent = queuedDiscreteEvents[i];\n\n if (queuedEvent.blockedOn === unblocked) {\n queuedEvent.blockedOn = null;\n }\n }\n }\n\n if (queuedFocus !== null) {\n scheduleCallbackIfUnblocked(queuedFocus, unblocked);\n }\n\n if (queuedDrag !== null) {\n scheduleCallbackIfUnblocked(queuedDrag, unblocked);\n }\n\n if (queuedMouse !== null) {\n scheduleCallbackIfUnblocked(queuedMouse, unblocked);\n }\n\n var unblock = function (queuedEvent) {\n return scheduleCallbackIfUnblocked(queuedEvent, unblocked);\n };\n\n queuedPointers.forEach(unblock);\n queuedPointerCaptures.forEach(unblock);\n\n for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {\n var queuedTarget = queuedExplicitHydrationTargets[_i];\n\n if (queuedTarget.blockedOn === unblocked) {\n queuedTarget.blockedOn = null;\n }\n }\n\n while (queuedExplicitHydrationTargets.length > 0) {\n var nextExplicitTarget = queuedExplicitHydrationTargets[0];\n\n if (nextExplicitTarget.blockedOn !== null) {\n // We're still blocked.\n break;\n } else {\n attemptExplicitHydrationTarget(nextExplicitTarget);\n\n if (nextExplicitTarget.blockedOn === null) {\n // We're unblocked.\n queuedExplicitHydrationTargets.shift();\n }\n }\n }\n}\n\nfunction addEventBubbleListener(element, eventType, listener) {\n element.addEventListener(eventType, listener, false);\n}\nfunction addEventCaptureListener(element, eventType, listener) {\n element.addEventListener(eventType, listener, true);\n}\n\n// do it in two places, which duplicates logic\n// and increases the bundle size, we do it all\n// here once. If we remove or refactor the\n// SimpleEventPlugin, we should also remove or\n// update the below line.\n\nvar simpleEventPluginEventTypes = {};\nvar topLevelEventsToDispatchConfig = new Map();\nvar eventPriorities = new Map(); // We store most of the events in this module in pairs of two strings so we can re-use\n// the code required to apply the same logic for event prioritization and that of the\n// SimpleEventPlugin. This complicates things slightly, but the aim is to reduce code\n// duplication (for which there would be quite a bit). For the events that are not needed\n// for the SimpleEventPlugin (otherDiscreteEvents) we process them separately as an\n// array of top level events.\n// Lastly, we ignore prettier so we can keep the formatting sane.\n// prettier-ignore\n\nvar discreteEventPairsForSimpleEventPlugin = [TOP_BLUR, 'blur', TOP_CANCEL, 'cancel', TOP_CLICK, 'click', TOP_CLOSE, 'close', TOP_CONTEXT_MENU, 'contextMenu', TOP_COPY, 'copy', TOP_CUT, 'cut', TOP_AUX_CLICK, 'auxClick', TOP_DOUBLE_CLICK, 'doubleClick', TOP_DRAG_END, 'dragEnd', TOP_DRAG_START, 'dragStart', TOP_DROP, 'drop', TOP_FOCUS, 'focus', TOP_INPUT, 'input', TOP_INVALID, 'invalid', TOP_KEY_DOWN, 'keyDown', TOP_KEY_PRESS, 'keyPress', TOP_KEY_UP, 'keyUp', TOP_MOUSE_DOWN, 'mouseDown', TOP_MOUSE_UP, 'mouseUp', TOP_PASTE, 'paste', TOP_PAUSE, 'pause', TOP_PLAY, 'play', TOP_POINTER_CANCEL, 'pointerCancel', TOP_POINTER_DOWN, 'pointerDown', TOP_POINTER_UP, 'pointerUp', TOP_RATE_CHANGE, 'rateChange', TOP_RESET, 'reset', TOP_SEEKED, 'seeked', TOP_SUBMIT, 'submit', TOP_TOUCH_CANCEL, 'touchCancel', TOP_TOUCH_END, 'touchEnd', TOP_TOUCH_START, 'touchStart', TOP_VOLUME_CHANGE, 'volumeChange'];\nvar otherDiscreteEvents = [TOP_CHANGE, TOP_SELECTION_CHANGE, TOP_TEXT_INPUT, TOP_COMPOSITION_START, TOP_COMPOSITION_END, TOP_COMPOSITION_UPDATE]; // prettier-ignore\n\nvar userBlockingPairsForSimpleEventPlugin = [TOP_DRAG, 'drag', TOP_DRAG_ENTER, 'dragEnter', TOP_DRAG_EXIT, 'dragExit', TOP_DRAG_LEAVE, 'dragLeave', TOP_DRAG_OVER, 'dragOver', TOP_MOUSE_MOVE, 'mouseMove', TOP_MOUSE_OUT, 'mouseOut', TOP_MOUSE_OVER, 'mouseOver', TOP_POINTER_MOVE, 'pointerMove', TOP_POINTER_OUT, 'pointerOut', TOP_POINTER_OVER, 'pointerOver', TOP_SCROLL, 'scroll', TOP_TOGGLE, 'toggle', TOP_TOUCH_MOVE, 'touchMove', TOP_WHEEL, 'wheel']; // prettier-ignore\n\nvar continuousPairsForSimpleEventPlugin = [TOP_ABORT, 'abort', TOP_ANIMATION_END, 'animationEnd', TOP_ANIMATION_ITERATION, 'animationIteration', TOP_ANIMATION_START, 'animationStart', TOP_CAN_PLAY, 'canPlay', TOP_CAN_PLAY_THROUGH, 'canPlayThrough', TOP_DURATION_CHANGE, 'durationChange', TOP_EMPTIED, 'emptied', TOP_ENCRYPTED, 'encrypted', TOP_ENDED, 'ended', TOP_ERROR, 'error', TOP_GOT_POINTER_CAPTURE, 'gotPointerCapture', TOP_LOAD, 'load', TOP_LOADED_DATA, 'loadedData', TOP_LOADED_METADATA, 'loadedMetadata', TOP_LOAD_START, 'loadStart', TOP_LOST_POINTER_CAPTURE, 'lostPointerCapture', TOP_PLAYING, 'playing', TOP_PROGRESS, 'progress', TOP_SEEKING, 'seeking', TOP_STALLED, 'stalled', TOP_SUSPEND, 'suspend', TOP_TIME_UPDATE, 'timeUpdate', TOP_TRANSITION_END, 'transitionEnd', TOP_WAITING, 'waiting'];\n/**\n * Turns\n * ['abort', ...]\n * into\n * eventTypes = {\n * 'abort': {\n * phasedRegistrationNames: {\n * bubbled: 'onAbort',\n * captured: 'onAbortCapture',\n * },\n * dependencies: [TOP_ABORT],\n * },\n * ...\n * };\n * topLevelEventsToDispatchConfig = new Map([\n * [TOP_ABORT, { sameConfig }],\n * ]);\n */\n\nfunction processSimpleEventPluginPairsByPriority(eventTypes, priority) {\n // As the event types are in pairs of two, we need to iterate\n // through in twos. The events are in pairs of two to save code\n // and improve init perf of processing this array, as it will\n // result in far fewer object allocations and property accesses\n // if we only use three arrays to process all the categories of\n // instead of tuples.\n for (var i = 0; i < eventTypes.length; i += 2) {\n var topEvent = eventTypes[i];\n var event = eventTypes[i + 1];\n var capitalizedEvent = event[0].toUpperCase() + event.slice(1);\n var onEvent = 'on' + capitalizedEvent;\n var config = {\n phasedRegistrationNames: {\n bubbled: onEvent,\n captured: onEvent + 'Capture'\n },\n dependencies: [topEvent],\n eventPriority: priority\n };\n eventPriorities.set(topEvent, priority);\n topLevelEventsToDispatchConfig.set(topEvent, config);\n simpleEventPluginEventTypes[event] = config;\n }\n}\n\nfunction processTopEventPairsByPriority(eventTypes, priority) {\n for (var i = 0; i < eventTypes.length; i++) {\n eventPriorities.set(eventTypes[i], priority);\n }\n} // SimpleEventPlugin\n\n\nprocessSimpleEventPluginPairsByPriority(discreteEventPairsForSimpleEventPlugin, DiscreteEvent);\nprocessSimpleEventPluginPairsByPriority(userBlockingPairsForSimpleEventPlugin, UserBlockingEvent);\nprocessSimpleEventPluginPairsByPriority(continuousPairsForSimpleEventPlugin, ContinuousEvent); // Not used by SimpleEventPlugin\n\nprocessTopEventPairsByPriority(otherDiscreteEvents, DiscreteEvent);\nfunction getEventPriorityForPluginSystem(topLevelType) {\n var priority = eventPriorities.get(topLevelType); // Default to a ContinuousEvent. Note: we might\n // want to warn if we can't detect the priority\n // for the event.\n\n return priority === undefined ? ContinuousEvent : priority;\n}\n\n// Intentionally not named imports because Rollup would use dynamic dispatch for\nvar UserBlockingPriority = Scheduler.unstable_UserBlockingPriority,\n runWithPriority = Scheduler.unstable_runWithPriority; // TODO: can we stop exporting these?\n\nvar _enabled = true;\nfunction setEnabled(enabled) {\n _enabled = !!enabled;\n}\nfunction isEnabled() {\n return _enabled;\n}\nfunction trapBubbledEvent(topLevelType, element) {\n trapEventForPluginEventSystem(element, topLevelType, false);\n}\nfunction trapCapturedEvent(topLevelType, element) {\n trapEventForPluginEventSystem(element, topLevelType, true);\n}\n\nfunction trapEventForPluginEventSystem(container, topLevelType, capture) {\n var listener;\n\n switch (getEventPriorityForPluginSystem(topLevelType)) {\n case DiscreteEvent:\n listener = dispatchDiscreteEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container);\n break;\n\n case UserBlockingEvent:\n listener = dispatchUserBlockingUpdate.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container);\n break;\n\n case ContinuousEvent:\n default:\n listener = dispatchEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container);\n break;\n }\n\n var rawEventName = getRawEventName(topLevelType);\n\n if (capture) {\n addEventCaptureListener(container, rawEventName, listener);\n } else {\n addEventBubbleListener(container, rawEventName, listener);\n }\n}\n\nfunction dispatchDiscreteEvent(topLevelType, eventSystemFlags, container, nativeEvent) {\n flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp);\n discreteUpdates(dispatchEvent, topLevelType, eventSystemFlags, container, nativeEvent);\n}\n\nfunction dispatchUserBlockingUpdate(topLevelType, eventSystemFlags, container, nativeEvent) {\n runWithPriority(UserBlockingPriority, dispatchEvent.bind(null, topLevelType, eventSystemFlags, container, nativeEvent));\n}\n\nfunction dispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent) {\n if (!_enabled) {\n return;\n }\n\n if (hasQueuedDiscreteEvents() && isReplayableDiscreteEvent(topLevelType)) {\n // If we already have a queue of discrete events, and this is another discrete\n // event, then we can't dispatch it regardless of its target, since they\n // need to dispatch in order.\n queueDiscreteEvent(null, // Flags that we're not actually blocked on anything as far as we know.\n topLevelType, eventSystemFlags, container, nativeEvent);\n return;\n }\n\n var blockedOn = attemptToDispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent);\n\n if (blockedOn === null) {\n // We successfully dispatched this event.\n clearIfContinuousEvent(topLevelType, nativeEvent);\n return;\n }\n\n if (isReplayableDiscreteEvent(topLevelType)) {\n // This this to be replayed later once the target is available.\n queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent);\n return;\n }\n\n if (queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent)) {\n return;\n } // We need to clear only if we didn't queue because\n // queueing is accummulative.\n\n\n clearIfContinuousEvent(topLevelType, nativeEvent); // This is not replayable so we'll invoke it but without a target,\n // in case the event system needs to trace it.\n\n {\n dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, null);\n }\n} // Attempt dispatching an event. Returns a SuspenseInstance or Container if it's blocked.\n\nfunction attemptToDispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent) {\n // TODO: Warn if _enabled is false.\n var nativeEventTarget = getEventTarget(nativeEvent);\n var targetInst = getClosestInstanceFromNode(nativeEventTarget);\n\n if (targetInst !== null) {\n var nearestMounted = getNearestMountedFiber(targetInst);\n\n if (nearestMounted === null) {\n // This tree has been unmounted already. Dispatch without a target.\n targetInst = null;\n } else {\n var tag = nearestMounted.tag;\n\n if (tag === SuspenseComponent) {\n var instance = getSuspenseInstanceFromFiber(nearestMounted);\n\n if (instance !== null) {\n // Queue the event to be replayed later. Abort dispatching since we\n // don't want this event dispatched twice through the event system.\n // TODO: If this is the first discrete event in the queue. Schedule an increased\n // priority for this boundary.\n return instance;\n } // This shouldn't happen, something went wrong but to avoid blocking\n // the whole system, dispatch the event without a target.\n // TODO: Warn.\n\n\n targetInst = null;\n } else if (tag === HostRoot) {\n var root = nearestMounted.stateNode;\n\n if (root.hydrate) {\n // If this happens during a replay something went wrong and it might block\n // the whole system.\n return getContainerFromFiber(nearestMounted);\n }\n\n targetInst = null;\n } else if (nearestMounted !== targetInst) {\n // If we get an event (ex: img onload) before committing that\n // component's mount, ignore it for now (that is, treat it as if it was an\n // event on a non-React tree). We might also consider queueing events and\n // dispatching them after the mount.\n targetInst = null;\n }\n }\n }\n\n {\n dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst);\n } // We're not blocked on anything.\n\n\n return null;\n}\n\n// List derived from Gecko source code:\n// https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js\nvar shorthandToLonghand = {\n animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'],\n background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'],\n backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],\n border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'],\n borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'],\n borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'],\n borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'],\n borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'],\n borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'],\n borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'],\n borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'],\n borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'],\n borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'],\n borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'],\n borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'],\n borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'],\n borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'],\n columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'],\n columns: ['columnCount', 'columnWidth'],\n flex: ['flexBasis', 'flexGrow', 'flexShrink'],\n flexFlow: ['flexDirection', 'flexWrap'],\n font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'],\n fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'],\n gap: ['columnGap', 'rowGap'],\n grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],\n gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'],\n gridColumn: ['gridColumnEnd', 'gridColumnStart'],\n gridColumnGap: ['columnGap'],\n gridGap: ['columnGap', 'rowGap'],\n gridRow: ['gridRowEnd', 'gridRowStart'],\n gridRowGap: ['rowGap'],\n gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],\n listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'],\n margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'],\n marker: ['markerEnd', 'markerMid', 'markerStart'],\n mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'],\n maskPosition: ['maskPositionX', 'maskPositionY'],\n outline: ['outlineColor', 'outlineStyle', 'outlineWidth'],\n overflow: ['overflowX', 'overflowY'],\n padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],\n placeContent: ['alignContent', 'justifyContent'],\n placeItems: ['alignItems', 'justifyItems'],\n placeSelf: ['alignSelf', 'justifySelf'],\n textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'],\n textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'],\n transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'],\n wordWrap: ['overflowWrap']\n};\n\n/**\n * CSS properties which accept numbers but are not in units of \"px\".\n */\nvar isUnitlessNumber = {\n animationIterationCount: 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\nfunction 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\nvar 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\nObject.keys(isUnitlessNumber).forEach(function (prop) {\n prefixes.forEach(function (prefix) {\n isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];\n });\n});\n\n/**\n * Convert a value into the proper css writable value. The style name `name`\n * should be logical (no hyphens), as specified\n * in `CSSProperty.isUnitlessNumber`.\n *\n * @param {string} name CSS property name such as `topMargin`.\n * @param {*} value CSS property value such as `10px`.\n * @return {string} Normalized style value with dimensions applied.\n */\n\nfunction dangerousStyleValue(name, value, isCustomProperty) {\n // Note that we've removed escapeTextForBrowser() calls here since the\n // whole string will be escaped when the attribute is injected into\n // the markup. If you provide unsafe user data here they can inject\n // arbitrary CSS which may be problematic (I couldn't repro this):\n // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet\n // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/\n // This is not an XSS hole but instead a potential CSS injection issue\n // which has lead to a greater discussion about how we're going to\n // trust URLs moving forward. See #2115901\n var isEmpty = value == null || typeof value === 'boolean' || value === '';\n\n if (isEmpty) {\n return '';\n }\n\n if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {\n return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers\n }\n\n return ('' + value).trim();\n}\n\nvar uppercasePattern = /([A-Z])/g;\nvar msPattern = /^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\nfunction hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}\n\nvar warnValidStyle = function () {};\n\n{\n // 'msTransform' is correct, but the other prefixes should be capitalized\n var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;\n var msPattern$1 = /^-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 (string) {\n return string.replace(hyphenPattern, function (_, character) {\n return character.toUpperCase();\n });\n };\n\n var warnHyphenatedStyleName = function (name) {\n if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n return;\n }\n\n warnedStyleNames[name] = true;\n\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$1, 'ms-')));\n };\n\n var warnBadVendoredStyleName = function (name) {\n if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n return;\n }\n\n warnedStyleNames[name] = true;\n\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 (name, value) {\n if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {\n return;\n }\n\n warnedStyleValues[value] = true;\n\n error(\"Style property values shouldn't contain a semicolon. \" + 'Try \"%s: %s\" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));\n };\n\n var warnStyleValueIsNaN = function (name, value) {\n if (warnedForNaNValue) {\n return;\n }\n\n warnedForNaNValue = true;\n\n error('`NaN` is an invalid value for the `%s` css style property.', name);\n };\n\n var warnStyleValueIsInfinity = function (name, value) {\n if (warnedForInfinityValue) {\n return;\n }\n\n warnedForInfinityValue = true;\n\n error('`Infinity` is an invalid value for the `%s` css style property.', name);\n };\n\n warnValidStyle = function (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\nvar warnValidStyle$1 = warnValidStyle;\n\n/**\n * Operations for dealing with CSS properties.\n */\n\n/**\n * This creates a string that is expected to be equivalent to the style\n * attribute generated by server-side rendering. It by-passes warnings and\n * security checks so it's not safe to use this value for anything other than\n * comparison. It is only used in DEV for SSR validation.\n */\n\nfunction createDangerousStringForStyles(styles) {\n {\n var serialized = '';\n var delimiter = '';\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var styleValue = styles[styleName];\n\n if (styleValue != null) {\n var isCustomProperty = styleName.indexOf('--') === 0;\n serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';\n serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n delimiter = ';';\n }\n }\n\n return serialized || null;\n }\n}\n/**\n * Sets the value for multiple styles on a node. If a value is specified as\n * '' (empty string), the corresponding style property will be unset.\n *\n * @param {DOMElement} node\n * @param {object} styles\n */\n\nfunction setValueForStyles(node, styles) {\n var style = node.style;\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var isCustomProperty = styleName.indexOf('--') === 0;\n\n {\n if (!isCustomProperty) {\n warnValidStyle$1(styleName, styles[styleName]);\n }\n }\n\n var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);\n\n if (styleName === 'float') {\n styleName = 'cssFloat';\n }\n\n if (isCustomProperty) {\n style.setProperty(styleName, styleValue);\n } else {\n style[styleName] = styleValue;\n }\n }\n}\n\nfunction isValueEmpty(value) {\n return value == null || typeof value === 'boolean' || value === '';\n}\n/**\n * Given {color: 'red', overflow: 'hidden'} returns {\n * color: 'color',\n * overflowX: 'overflow',\n * overflowY: 'overflow',\n * }. This can be read as \"the overflowY property was set by the overflow\n * shorthand\". That is, the values are the property that each was derived from.\n */\n\n\nfunction expandShorthandMap(styles) {\n var expanded = {};\n\n for (var key in styles) {\n var longhands = shorthandToLonghand[key] || [key];\n\n for (var i = 0; i < longhands.length; i++) {\n expanded[longhands[i]] = key;\n }\n }\n\n return expanded;\n}\n/**\n * When mixing shorthand and longhand property names, we warn during updates if\n * we expect an incorrect result to occur. In particular, we warn for:\n *\n * Updating a shorthand property (longhand gets overwritten):\n * {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'}\n * becomes .style.font = 'baz'\n * Removing a shorthand property (longhand gets lost too):\n * {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'}\n * becomes .style.font = ''\n * Removing a longhand property (should revert to shorthand; doesn't):\n * {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'}\n * becomes .style.fontVariant = ''\n */\n\n\nfunction validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {\n {\n\n if (!nextStyles) {\n return;\n }\n\n var expandedUpdates = expandShorthandMap(styleUpdates);\n var expandedStyles = expandShorthandMap(nextStyles);\n var warnedAbout = {};\n\n for (var key in expandedUpdates) {\n var originalKey = expandedUpdates[key];\n var correctOriginalKey = expandedStyles[key];\n\n if (correctOriginalKey && originalKey !== correctOriginalKey) {\n var warningKey = originalKey + ',' + correctOriginalKey;\n\n if (warnedAbout[warningKey]) {\n continue;\n }\n\n warnedAbout[warningKey] = true;\n\n error('%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + \"avoid this, don't mix shorthand and non-shorthand properties \" + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey);\n }\n }\n }\n}\n\n// For HTML, certain tags should omit their close tag. We keep a whitelist for\n// those special-case tags.\nvar omittedCloseTags = {\n area: true,\n base: true,\n br: true,\n col: true,\n embed: true,\n hr: true,\n img: true,\n input: true,\n keygen: true,\n link: true,\n meta: true,\n param: true,\n source: true,\n track: true,\n wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems.\n\n};\n\n// `omittedCloseTags` except that `menuitem` should still have its closing tag.\n\nvar voidElementTags = _assign({\n menuitem: true\n}, omittedCloseTags);\n\nvar HTML = '__html';\nvar ReactDebugCurrentFrame$3 = null;\n\n{\n ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;\n}\n\nfunction assertValidProps(tag, props) {\n if (!props) {\n return;\n } // Note the use of `==` which checks for null or undefined.\n\n\n if (voidElementTags[tag]) {\n if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {\n {\n throw Error( tag + \" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.\" + ( ReactDebugCurrentFrame$3.getStackAddendum() ) );\n }\n }\n }\n\n if (props.dangerouslySetInnerHTML != null) {\n if (!(props.children == null)) {\n {\n throw Error( \"Can only set one of `children` or `props.dangerouslySetInnerHTML`.\" );\n }\n }\n\n if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) {\n {\n throw Error( \"`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.\" );\n }\n }\n }\n\n {\n if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {\n error('A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.');\n }\n }\n\n if (!(props.style == null || typeof props.style === 'object')) {\n {\n throw Error( \"The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.\" + ( ReactDebugCurrentFrame$3.getStackAddendum() ) );\n }\n }\n}\n\nfunction 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 whitelist 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// When adding attributes to the HTML or SVG whitelist, be sure to\n// also add them to this module to ensure casing and incorrect name\n// warnings.\nvar 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 download: 'download',\n draggable: 'draggable',\n enctype: 'encType',\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 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\nvar ariaProperties = {\n 'aria-current': 0,\n // state\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\nvar warnedProperties = {};\nvar rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar hasOwnProperty$1 = Object.prototype.hasOwnProperty;\n\nfunction validateProperty(tagName, name) {\n {\n if (hasOwnProperty$1.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\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\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\n warnedProperties[name] = true;\n return true;\n }\n }\n }\n\n return true;\n}\n\nfunction 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://fb.me/invalid-aria-prop', unknownPropString, type);\n } else if (invalidProps.length > 1) {\n error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);\n }\n }\n}\n\nfunction validateProperties(type, props) {\n if (isCustomComponent(type, props)) {\n return;\n }\n\n warnInvalidARIAProps(type, props);\n}\n\nvar didWarnValueNull = false;\nfunction 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}\n\nvar validateProperty$1 = function () {};\n\n{\n var warnedProperties$1 = {};\n var _hasOwnProperty = Object.prototype.hasOwnProperty;\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 (tagName, name, value, canUseEventSystem) {\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\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 (canUseEventSystem) {\n if (registrationNameModules.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\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\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\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\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\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\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\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\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\n warnedProperties$1[name] = true;\n return true;\n }\n\n return true;\n };\n}\n\nvar warnUnknownProperties = function (type, props, canUseEventSystem) {\n {\n var unknownProps = [];\n\n for (var key in props) {\n var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);\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://fb.me/react-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://fb.me/react-attribute-behavior', unknownPropString, type);\n }\n }\n};\n\nfunction validateProperties$2(type, props, canUseEventSystem) {\n if (isCustomComponent(type, props)) {\n return;\n }\n\n warnUnknownProperties(type, props, canUseEventSystem);\n}\n\nvar didWarnInvalidHydration = false;\nvar DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';\nvar SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';\nvar SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning';\nvar AUTOFOCUS = 'autoFocus';\nvar CHILDREN = 'children';\nvar STYLE = 'style';\nvar HTML$1 = '__html';\nvar HTML_NAMESPACE$1 = Namespaces.html;\nvar warnedUnknownTags;\nvar suppressHydrationWarning;\nvar validatePropertiesInDevelopment;\nvar warnForTextDifference;\nvar warnForPropDifference;\nvar warnForExtraAttributes;\nvar warnForInvalidEventListener;\nvar canDiffStyleForHydrationWarning;\nvar normalizeMarkupForTextOrAttribute;\nvar normalizeHTML;\n\n{\n warnedUnknownTags = {\n // Chrome is the only major browser not shipping <time>. But as of July\n // 2017 it intends to ship it due to widespread usage. We intentionally\n // *don't* warn for <time> even if it's unrecognized by Chrome because\n // it soon will be, and many apps have been using it anyway.\n time: true,\n // There are working polyfills for <dialog>. Let people use it.\n dialog: true,\n // Electron ships a custom <webview> tag to display external web content in\n // an isolated frame and process.\n // This tag is not present in non Electron environments such as JSDom which\n // is often used for testing purposes.\n // @see https://electronjs.org/docs/api/webview-tag\n webview: true\n };\n\n validatePropertiesInDevelopment = function (type, props) {\n validateProperties(type, props);\n validateProperties$1(type, props);\n validateProperties$2(type, props,\n /* canUseEventSystem */\n true);\n }; // IE 11 parses & normalizes the style attribute as opposed to other\n // browsers. It adds spaces and sorts the properties in some\n // non-alphabetical order. Handling that would require sorting CSS\n // properties in the client & server versions or applying\n // `expectedStyle` to a temporary DOM node to read its `style` attribute\n // normalized. Since it only affects IE, we're skipping style warnings\n // in that browser completely in favor of doing all that work.\n // See https://github.com/facebook/react/issues/11807\n\n\n canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode; // HTML parsing normalizes CR and CRLF to LF.\n // It also can turn \\u0000 into \\uFFFD inside attributes.\n // https://www.w3.org/TR/html5/single-page.html#preprocessing-the-input-stream\n // If we have a mismatch, it might be caused by that.\n // We will still patch up in this case but not fire the warning.\n\n var NORMALIZE_NEWLINES_REGEX = /\\r\\n?/g;\n var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\\u0000|\\uFFFD/g;\n\n normalizeMarkupForTextOrAttribute = function (markup) {\n var markupString = typeof markup === 'string' ? markup : '' + markup;\n return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, '');\n };\n\n warnForTextDifference = function (serverText, clientText) {\n if (didWarnInvalidHydration) {\n return;\n }\n\n var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);\n var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);\n\n if (normalizedServerText === normalizedClientText) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Text content did not match. Server: \"%s\" Client: \"%s\"', normalizedServerText, normalizedClientText);\n };\n\n warnForPropDifference = function (propName, serverValue, clientValue) {\n if (didWarnInvalidHydration) {\n return;\n }\n\n var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);\n var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);\n\n if (normalizedServerValue === normalizedClientValue) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));\n };\n\n warnForExtraAttributes = function (attributeNames) {\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n var names = [];\n attributeNames.forEach(function (name) {\n names.push(name);\n });\n\n error('Extra attributes from the server: %s', names);\n };\n\n warnForInvalidEventListener = function (registrationName, listener) {\n if (listener === false) {\n error('Expected `%s` listener to be a function, instead got `false`.\\n\\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName);\n } else {\n error('Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener);\n }\n }; // Parse the HTML and read it back to normalize the HTML string so that it\n // can be used for comparison.\n\n\n normalizeHTML = function (parent, html) {\n // We could have created a separate document here to avoid\n // re-initializing custom elements if they exist. But this breaks\n // how <noscript> is being handled. So we use the same document.\n // See the discussion in https://github.com/facebook/react/pull/11157.\n var testElement = parent.namespaceURI === HTML_NAMESPACE$1 ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);\n testElement.innerHTML = html;\n return testElement.innerHTML;\n };\n}\n\nfunction ensureListeningTo(rootContainerElement, registrationName) {\n var isDocumentOrFragment = rootContainerElement.nodeType === DOCUMENT_NODE || rootContainerElement.nodeType === DOCUMENT_FRAGMENT_NODE;\n var doc = isDocumentOrFragment ? rootContainerElement : rootContainerElement.ownerDocument;\n legacyListenToEvent(registrationName, doc);\n}\n\nfunction getOwnerDocumentFromRootContainer(rootContainerElement) {\n return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;\n}\n\nfunction noop() {}\n\nfunction trapClickOnNonInteractiveElement(node) {\n // Mobile Safari does not fire properly bubble click events on\n // non-interactive elements, which means delegated click listeners do not\n // fire. The workaround for this bug involves attaching an empty click\n // listener on the target node.\n // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html\n // Just set it using the onclick property so that we don't have to manage any\n // bookkeeping for it. Not sure if we need to clear it when the listener is\n // removed.\n // TODO: Only do this for the relevant Safaris maybe?\n node.onclick = noop;\n}\n\nfunction setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {\n for (var propKey in nextProps) {\n if (!nextProps.hasOwnProperty(propKey)) {\n continue;\n }\n\n var nextProp = nextProps[propKey];\n\n if (propKey === STYLE) {\n {\n if (nextProp) {\n // Freeze the next style object so that we can assume it won't be\n // mutated. We have already warned for this in the past.\n Object.freeze(nextProp);\n }\n } // Relies on `updateStylesByID` not mutating `styleUpdates`.\n\n\n setValueForStyles(domElement, nextProp);\n } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n var nextHtml = nextProp ? nextProp[HTML$1] : undefined;\n\n if (nextHtml != null) {\n setInnerHTML(domElement, nextHtml);\n }\n } else if (propKey === CHILDREN) {\n if (typeof nextProp === 'string') {\n // Avoid setting initial textContent when the text is empty. In IE11 setting\n // textContent on a <textarea> will cause the placeholder to not\n // show within the <textarea> until it has been focused and blurred again.\n // https://github.com/facebook/react/issues/6731#issuecomment-254874553\n var canSetTextContent = tag !== 'textarea' || nextProp !== '';\n\n if (canSetTextContent) {\n setTextContent(domElement, nextProp);\n }\n } else if (typeof nextProp === 'number') {\n setTextContent(domElement, '' + nextProp);\n }\n } else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameModules.hasOwnProperty(propKey)) {\n if (nextProp != null) {\n if ( typeof nextProp !== 'function') {\n warnForInvalidEventListener(propKey, nextProp);\n }\n\n ensureListeningTo(rootContainerElement, propKey);\n }\n } else if (nextProp != null) {\n setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);\n }\n }\n}\n\nfunction updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {\n // TODO: Handle wasCustomComponentTag\n for (var i = 0; i < updatePayload.length; i += 2) {\n var propKey = updatePayload[i];\n var propValue = updatePayload[i + 1];\n\n if (propKey === STYLE) {\n setValueForStyles(domElement, propValue);\n } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n setInnerHTML(domElement, propValue);\n } else if (propKey === CHILDREN) {\n setTextContent(domElement, propValue);\n } else {\n setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);\n }\n }\n}\n\nfunction createElement(type, props, rootContainerElement, parentNamespace) {\n var isCustomComponentTag; // We create tags in the namespace of their parent container, except HTML\n // tags get no namespace.\n\n var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);\n var domElement;\n var namespaceURI = parentNamespace;\n\n if (namespaceURI === HTML_NAMESPACE$1) {\n namespaceURI = getIntrinsicNamespace(type);\n }\n\n if (namespaceURI === HTML_NAMESPACE$1) {\n {\n isCustomComponentTag = isCustomComponent(type, props); // Should this check be gated by parent namespace? Not sure we want to\n // allow <SVG> or <mATH>.\n\n if (!isCustomComponentTag && type !== type.toLowerCase()) {\n error('<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type);\n }\n }\n\n if (type === 'script') {\n // Create the script via .innerHTML so its \"parser-inserted\" flag is\n // set to true and it does not execute\n var div = ownerDocument.createElement('div');\n\n div.innerHTML = '<script><' + '/script>'; // eslint-disable-line\n // This is guaranteed to yield a script element.\n\n var firstChild = div.firstChild;\n domElement = div.removeChild(firstChild);\n } else if (typeof props.is === 'string') {\n // $FlowIssue `createElement` should be updated for Web Components\n domElement = ownerDocument.createElement(type, {\n is: props.is\n });\n } else {\n // Separate else branch instead of using `props.is || undefined` above because of a Firefox bug.\n // See discussion in https://github.com/facebook/react/pull/6896\n // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240\n domElement = ownerDocument.createElement(type); // Normally attributes are assigned in `setInitialDOMProperties`, however the `multiple` and `size`\n // attributes on `select`s needs to be added before `option`s are inserted.\n // This prevents:\n // - a bug where the `select` does not scroll to the correct option because singular\n // `select` elements automatically pick the first item #13222\n // - a bug where the `select` set the first item as selected despite the `size` attribute #14239\n // See https://github.com/facebook/react/issues/13222\n // and https://github.com/facebook/react/issues/14239\n\n if (type === 'select') {\n var node = domElement;\n\n if (props.multiple) {\n node.multiple = true;\n } else if (props.size) {\n // Setting a size greater than 1 causes a select to behave like `multiple=true`, where\n // it is possible that no option is selected.\n //\n // This is only necessary when a select in \"single selection mode\".\n node.size = props.size;\n }\n }\n }\n } else {\n domElement = ownerDocument.createElementNS(namespaceURI, type);\n }\n\n {\n if (namespaceURI === HTML_NAMESPACE$1) {\n if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {\n warnedUnknownTags[type] = true;\n\n error('The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type);\n }\n }\n }\n\n return domElement;\n}\nfunction createTextNode(text, rootContainerElement) {\n return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);\n}\nfunction setInitialProperties(domElement, tag, rawProps, rootContainerElement) {\n var isCustomComponentTag = isCustomComponent(tag, rawProps);\n\n {\n validatePropertiesInDevelopment(tag, rawProps);\n } // TODO: Make sure that we check isMounted before firing any of these events.\n\n\n var props;\n\n switch (tag) {\n case 'iframe':\n case 'object':\n case 'embed':\n trapBubbledEvent(TOP_LOAD, domElement);\n props = rawProps;\n break;\n\n case 'video':\n case 'audio':\n // Create listener for each media event\n for (var i = 0; i < mediaEventTypes.length; i++) {\n trapBubbledEvent(mediaEventTypes[i], domElement);\n }\n\n props = rawProps;\n break;\n\n case 'source':\n trapBubbledEvent(TOP_ERROR, domElement);\n props = rawProps;\n break;\n\n case 'img':\n case 'image':\n case 'link':\n trapBubbledEvent(TOP_ERROR, domElement);\n trapBubbledEvent(TOP_LOAD, domElement);\n props = rawProps;\n break;\n\n case 'form':\n trapBubbledEvent(TOP_RESET, domElement);\n trapBubbledEvent(TOP_SUBMIT, domElement);\n props = rawProps;\n break;\n\n case 'details':\n trapBubbledEvent(TOP_TOGGLE, domElement);\n props = rawProps;\n break;\n\n case 'input':\n initWrapperState(domElement, rawProps);\n props = getHostProps(domElement, rawProps);\n trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening\n // to onChange. Even if there is no listener.\n\n ensureListeningTo(rootContainerElement, 'onChange');\n break;\n\n case 'option':\n validateProps(domElement, rawProps);\n props = getHostProps$1(domElement, rawProps);\n break;\n\n case 'select':\n initWrapperState$1(domElement, rawProps);\n props = getHostProps$2(domElement, rawProps);\n trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening\n // to onChange. Even if there is no listener.\n\n ensureListeningTo(rootContainerElement, 'onChange');\n break;\n\n case 'textarea':\n initWrapperState$2(domElement, rawProps);\n props = getHostProps$3(domElement, rawProps);\n trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening\n // to onChange. Even if there is no listener.\n\n ensureListeningTo(rootContainerElement, 'onChange');\n break;\n\n default:\n props = rawProps;\n }\n\n assertValidProps(tag, props);\n setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);\n\n switch (tag) {\n case 'input':\n // TODO: Make sure we check if this is still unmounted or do any clean\n // up necessary since we never stop tracking anymore.\n track(domElement);\n postMountWrapper(domElement, rawProps, false);\n break;\n\n case 'textarea':\n // TODO: Make sure we check if this is still unmounted or do any clean\n // up necessary since we never stop tracking anymore.\n track(domElement);\n postMountWrapper$3(domElement);\n break;\n\n case 'option':\n postMountWrapper$1(domElement, rawProps);\n break;\n\n case 'select':\n postMountWrapper$2(domElement, rawProps);\n break;\n\n default:\n if (typeof props.onClick === 'function') {\n // TODO: This cast may not be sound for SVG, MathML or custom elements.\n trapClickOnNonInteractiveElement(domElement);\n }\n\n break;\n }\n} // Calculate the diff between the two objects.\n\nfunction diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {\n {\n validatePropertiesInDevelopment(tag, nextRawProps);\n }\n\n var updatePayload = null;\n var lastProps;\n var nextProps;\n\n switch (tag) {\n case 'input':\n lastProps = getHostProps(domElement, lastRawProps);\n nextProps = getHostProps(domElement, nextRawProps);\n updatePayload = [];\n break;\n\n case 'option':\n lastProps = getHostProps$1(domElement, lastRawProps);\n nextProps = getHostProps$1(domElement, nextRawProps);\n updatePayload = [];\n break;\n\n case 'select':\n lastProps = getHostProps$2(domElement, lastRawProps);\n nextProps = getHostProps$2(domElement, nextRawProps);\n updatePayload = [];\n break;\n\n case 'textarea':\n lastProps = getHostProps$3(domElement, lastRawProps);\n nextProps = getHostProps$3(domElement, nextRawProps);\n updatePayload = [];\n break;\n\n default:\n lastProps = lastRawProps;\n nextProps = nextRawProps;\n\n if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') {\n // TODO: This cast may not be sound for SVG, MathML or custom elements.\n trapClickOnNonInteractiveElement(domElement);\n }\n\n break;\n }\n\n assertValidProps(tag, nextProps);\n var propKey;\n var styleName;\n var styleUpdates = null;\n\n for (propKey in lastProps) {\n if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {\n continue;\n }\n\n if (propKey === STYLE) {\n var lastStyle = lastProps[propKey];\n\n for (styleName in lastStyle) {\n if (lastStyle.hasOwnProperty(styleName)) {\n if (!styleUpdates) {\n styleUpdates = {};\n }\n\n styleUpdates[styleName] = '';\n }\n }\n } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) ; else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameModules.hasOwnProperty(propKey)) {\n // This is a special case. If any listener updates we need to ensure\n // that the \"current\" fiber pointer gets updated so we need a commit\n // to update this element.\n if (!updatePayload) {\n updatePayload = [];\n }\n } else {\n // For all other deleted properties we add it to the queue. We use\n // the whitelist in the commit phase instead.\n (updatePayload = updatePayload || []).push(propKey, null);\n }\n }\n\n for (propKey in nextProps) {\n var nextProp = nextProps[propKey];\n var lastProp = lastProps != null ? lastProps[propKey] : undefined;\n\n if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {\n continue;\n }\n\n if (propKey === STYLE) {\n {\n if (nextProp) {\n // Freeze the next style object so that we can assume it won't be\n // mutated. We have already warned for this in the past.\n Object.freeze(nextProp);\n }\n }\n\n if (lastProp) {\n // Unset styles on `lastProp` but not on `nextProp`.\n for (styleName in lastProp) {\n if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {\n if (!styleUpdates) {\n styleUpdates = {};\n }\n\n styleUpdates[styleName] = '';\n }\n } // Update styles that changed since `lastProp`.\n\n\n for (styleName in nextProp) {\n if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {\n if (!styleUpdates) {\n styleUpdates = {};\n }\n\n styleUpdates[styleName] = nextProp[styleName];\n }\n }\n } else {\n // Relies on `updateStylesByID` not mutating `styleUpdates`.\n if (!styleUpdates) {\n if (!updatePayload) {\n updatePayload = [];\n }\n\n updatePayload.push(propKey, styleUpdates);\n }\n\n styleUpdates = nextProp;\n }\n } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n var nextHtml = nextProp ? nextProp[HTML$1] : undefined;\n var lastHtml = lastProp ? lastProp[HTML$1] : undefined;\n\n if (nextHtml != null) {\n if (lastHtml !== nextHtml) {\n (updatePayload = updatePayload || []).push(propKey, nextHtml);\n }\n }\n } else if (propKey === CHILDREN) {\n if (lastProp !== nextProp && (typeof nextProp === 'string' || typeof nextProp === 'number')) {\n (updatePayload = updatePayload || []).push(propKey, '' + nextProp);\n }\n } else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (registrationNameModules.hasOwnProperty(propKey)) {\n if (nextProp != null) {\n // We eagerly listen to this even though we haven't committed yet.\n if ( typeof nextProp !== 'function') {\n warnForInvalidEventListener(propKey, nextProp);\n }\n\n ensureListeningTo(rootContainerElement, propKey);\n }\n\n if (!updatePayload && lastProp !== nextProp) {\n // This is a special case. If any listener updates we need to ensure\n // that the \"current\" props pointer gets updated so we need a commit\n // to update this element.\n updatePayload = [];\n }\n } else {\n // For any other property we always add it to the queue and then we\n // filter it out using the whitelist during the commit.\n (updatePayload = updatePayload || []).push(propKey, nextProp);\n }\n }\n\n if (styleUpdates) {\n {\n validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]);\n }\n\n (updatePayload = updatePayload || []).push(STYLE, styleUpdates);\n }\n\n return updatePayload;\n} // Apply the diff.\n\nfunction updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {\n // Update checked *before* name.\n // In the middle of an update, it is possible to have multiple checked.\n // When a checked radio tries to change name, browser makes another radio's checked false.\n if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {\n updateChecked(domElement, nextRawProps);\n }\n\n var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);\n var isCustomComponentTag = isCustomComponent(tag, nextRawProps); // Apply the diff.\n\n updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag); // TODO: Ensure that an update gets scheduled if any of the special props\n // changed.\n\n switch (tag) {\n case 'input':\n // Update the wrapper around inputs *after* updating props. This has to\n // happen after `updateDOMProperties`. Otherwise HTML5 input validations\n // raise warnings and prevent the new value from being assigned.\n updateWrapper(domElement, nextRawProps);\n break;\n\n case 'textarea':\n updateWrapper$1(domElement, nextRawProps);\n break;\n\n case 'select':\n // <select> value update needs to occur after <option> children\n // reconciliation\n postUpdateWrapper(domElement, nextRawProps);\n break;\n }\n}\n\nfunction getPossibleStandardName(propName) {\n {\n var lowerCasedName = propName.toLowerCase();\n\n if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {\n return null;\n }\n\n return possibleStandardNames[lowerCasedName] || null;\n }\n}\n\nfunction diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement) {\n var isCustomComponentTag;\n var extraAttributeNames;\n\n {\n suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING] === true;\n isCustomComponentTag = isCustomComponent(tag, rawProps);\n validatePropertiesInDevelopment(tag, rawProps);\n } // TODO: Make sure that we check isMounted before firing any of these events.\n\n\n switch (tag) {\n case 'iframe':\n case 'object':\n case 'embed':\n trapBubbledEvent(TOP_LOAD, domElement);\n break;\n\n case 'video':\n case 'audio':\n // Create listener for each media event\n for (var i = 0; i < mediaEventTypes.length; i++) {\n trapBubbledEvent(mediaEventTypes[i], domElement);\n }\n\n break;\n\n case 'source':\n trapBubbledEvent(TOP_ERROR, domElement);\n break;\n\n case 'img':\n case 'image':\n case 'link':\n trapBubbledEvent(TOP_ERROR, domElement);\n trapBubbledEvent(TOP_LOAD, domElement);\n break;\n\n case 'form':\n trapBubbledEvent(TOP_RESET, domElement);\n trapBubbledEvent(TOP_SUBMIT, domElement);\n break;\n\n case 'details':\n trapBubbledEvent(TOP_TOGGLE, domElement);\n break;\n\n case 'input':\n initWrapperState(domElement, rawProps);\n trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening\n // to onChange. Even if there is no listener.\n\n ensureListeningTo(rootContainerElement, 'onChange');\n break;\n\n case 'option':\n validateProps(domElement, rawProps);\n break;\n\n case 'select':\n initWrapperState$1(domElement, rawProps);\n trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening\n // to onChange. Even if there is no listener.\n\n ensureListeningTo(rootContainerElement, 'onChange');\n break;\n\n case 'textarea':\n initWrapperState$2(domElement, rawProps);\n trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening\n // to onChange. Even if there is no listener.\n\n ensureListeningTo(rootContainerElement, 'onChange');\n break;\n }\n\n assertValidProps(tag, rawProps);\n\n {\n extraAttributeNames = new Set();\n var attributes = domElement.attributes;\n\n for (var _i = 0; _i < attributes.length; _i++) {\n var name = attributes[_i].name.toLowerCase();\n\n switch (name) {\n // Built-in SSR attribute is whitelisted\n case 'data-reactroot':\n break;\n // Controlled attributes are not validated\n // TODO: Only ignore them on controlled tags.\n\n case 'value':\n break;\n\n case 'checked':\n break;\n\n case 'selected':\n break;\n\n default:\n // Intentionally use the original name.\n // See discussion in https://github.com/facebook/react/pull/10676.\n extraAttributeNames.add(attributes[_i].name);\n }\n }\n }\n\n var updatePayload = null;\n\n for (var propKey in rawProps) {\n if (!rawProps.hasOwnProperty(propKey)) {\n continue;\n }\n\n var nextProp = rawProps[propKey];\n\n if (propKey === CHILDREN) {\n // For text content children we compare against textContent. This\n // might match additional HTML that is hidden when we read it using\n // textContent. E.g. \"foo\" will match \"f<span>oo</span>\" but that still\n // satisfies our requirement. Our requirement is not to produce perfect\n // HTML and attributes. Ideally we should preserve structure but it's\n // ok not to if the visible content is still enough to indicate what\n // even listeners these nodes might be wired up to.\n // TODO: Warn if there is more than a single textNode as a child.\n // TODO: Should we use domElement.firstChild.nodeValue to compare?\n if (typeof nextProp === 'string') {\n if (domElement.textContent !== nextProp) {\n if ( !suppressHydrationWarning) {\n warnForTextDifference(domElement.textContent, nextProp);\n }\n\n updatePayload = [CHILDREN, nextProp];\n }\n } else if (typeof nextProp === 'number') {\n if (domElement.textContent !== '' + nextProp) {\n if ( !suppressHydrationWarning) {\n warnForTextDifference(domElement.textContent, nextProp);\n }\n\n updatePayload = [CHILDREN, '' + nextProp];\n }\n }\n } else if (registrationNameModules.hasOwnProperty(propKey)) {\n if (nextProp != null) {\n if ( typeof nextProp !== 'function') {\n warnForInvalidEventListener(propKey, nextProp);\n }\n\n ensureListeningTo(rootContainerElement, propKey);\n }\n } else if ( // Convince Flow we've calculated it (it's DEV-only in this method.)\n typeof isCustomComponentTag === 'boolean') {\n // Validate that the properties correspond to their expected values.\n var serverValue = void 0;\n var propertyInfo = getPropertyInfo(propKey);\n\n if (suppressHydrationWarning) ; else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || // Controlled attributes are not validated\n // TODO: Only ignore them on controlled tags.\n propKey === 'value' || propKey === 'checked' || propKey === 'selected') ; else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n var serverHTML = domElement.innerHTML;\n var nextHtml = nextProp ? nextProp[HTML$1] : undefined;\n var expectedHTML = normalizeHTML(domElement, nextHtml != null ? nextHtml : '');\n\n if (expectedHTML !== serverHTML) {\n warnForPropDifference(propKey, serverHTML, expectedHTML);\n }\n } else if (propKey === STYLE) {\n // $FlowFixMe - Should be inferred as not undefined.\n extraAttributeNames.delete(propKey);\n\n if (canDiffStyleForHydrationWarning) {\n var expectedStyle = createDangerousStringForStyles(nextProp);\n serverValue = domElement.getAttribute('style');\n\n if (expectedStyle !== serverValue) {\n warnForPropDifference(propKey, serverValue, expectedStyle);\n }\n }\n } else if (isCustomComponentTag) {\n // $FlowFixMe - Should be inferred as not undefined.\n extraAttributeNames.delete(propKey.toLowerCase());\n serverValue = getValueForAttribute(domElement, propKey, nextProp);\n\n if (nextProp !== serverValue) {\n warnForPropDifference(propKey, serverValue, nextProp);\n }\n } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {\n var isMismatchDueToBadCasing = false;\n\n if (propertyInfo !== null) {\n // $FlowFixMe - Should be inferred as not undefined.\n extraAttributeNames.delete(propertyInfo.attributeName);\n serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);\n } else {\n var ownNamespace = parentNamespace;\n\n if (ownNamespace === HTML_NAMESPACE$1) {\n ownNamespace = getIntrinsicNamespace(tag);\n }\n\n if (ownNamespace === HTML_NAMESPACE$1) {\n // $FlowFixMe - Should be inferred as not undefined.\n extraAttributeNames.delete(propKey.toLowerCase());\n } else {\n var standardName = getPossibleStandardName(propKey);\n\n if (standardName !== null && standardName !== propKey) {\n // If an SVG prop is supplied with bad casing, it will\n // be successfully parsed from HTML, but will produce a mismatch\n // (and would be incorrectly rendered on the client).\n // However, we already warn about bad casing elsewhere.\n // So we'll skip the misleading extra mismatch warning in this case.\n isMismatchDueToBadCasing = true; // $FlowFixMe - Should be inferred as not undefined.\n\n extraAttributeNames.delete(standardName);\n } // $FlowFixMe - Should be inferred as not undefined.\n\n\n extraAttributeNames.delete(propKey);\n }\n\n serverValue = getValueForAttribute(domElement, propKey, nextProp);\n }\n\n if (nextProp !== serverValue && !isMismatchDueToBadCasing) {\n warnForPropDifference(propKey, serverValue, nextProp);\n }\n }\n }\n }\n\n {\n // $FlowFixMe - Should be inferred as not undefined.\n if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {\n // $FlowFixMe - Should be inferred as not undefined.\n warnForExtraAttributes(extraAttributeNames);\n }\n }\n\n switch (tag) {\n case 'input':\n // TODO: Make sure we check if this is still unmounted or do any clean\n // up necessary since we never stop tracking anymore.\n track(domElement);\n postMountWrapper(domElement, rawProps, true);\n break;\n\n case 'textarea':\n // TODO: Make sure we check if this is still unmounted or do any clean\n // up necessary since we never stop tracking anymore.\n track(domElement);\n postMountWrapper$3(domElement);\n break;\n\n case 'select':\n case 'option':\n // For input and textarea we current always set the value property at\n // post mount to force it to diverge from attributes. However, for\n // option and select we don't quite do the same thing and select\n // is not resilient to the DOM state changing so we don't do that here.\n // TODO: Consider not doing this for input and textarea.\n break;\n\n default:\n if (typeof rawProps.onClick === 'function') {\n // TODO: This cast may not be sound for SVG, MathML or custom elements.\n trapClickOnNonInteractiveElement(domElement);\n }\n\n break;\n }\n\n return updatePayload;\n}\nfunction diffHydratedText(textNode, text) {\n var isDifferent = textNode.nodeValue !== text;\n return isDifferent;\n}\nfunction warnForUnmatchedText(textNode, text) {\n {\n warnForTextDifference(textNode.nodeValue, text);\n }\n}\nfunction warnForDeletedHydratableElement(parentNode, child) {\n {\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());\n }\n}\nfunction warnForDeletedHydratableText(parentNode, child) {\n {\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Did not expect server HTML to contain the text node \"%s\" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());\n }\n}\nfunction warnForInsertedHydratedElement(parentNode, tag, props) {\n {\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase());\n }\n}\nfunction warnForInsertedHydratedText(parentNode, text) {\n {\n if (text === '') {\n // We expect to insert empty text nodes since they're not represented in\n // the HTML.\n // TODO: Remove this special case if we can just avoid inserting empty\n // text nodes.\n return;\n }\n\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Expected server HTML to contain a matching text node for \"%s\" in <%s>.', text, parentNode.nodeName.toLowerCase());\n }\n}\nfunction restoreControlledState$3(domElement, tag, props) {\n switch (tag) {\n case 'input':\n restoreControlledState(domElement, props);\n return;\n\n case 'textarea':\n restoreControlledState$2(domElement, props);\n return;\n\n case 'select':\n restoreControlledState$1(domElement, props);\n return;\n }\n}\n\nfunction getActiveElement(doc) {\n doc = doc || (typeof document !== 'undefined' ? document : undefined);\n\n if (typeof doc === 'undefined') {\n return null;\n }\n\n try {\n return doc.activeElement || doc.body;\n } catch (e) {\n return doc.body;\n }\n}\n\n/**\n * Given any node return the first leaf node without children.\n *\n * @param {DOMElement|DOMTextNode} node\n * @return {DOMElement|DOMTextNode}\n */\n\nfunction getLeafNode(node) {\n while (node && node.firstChild) {\n node = node.firstChild;\n }\n\n return node;\n}\n/**\n * Get the next sibling within a container. This will walk up the\n * DOM if a node's siblings have been exhausted.\n *\n * @param {DOMElement|DOMTextNode} node\n * @return {?DOMElement|DOMTextNode}\n */\n\n\nfunction getSiblingNode(node) {\n while (node) {\n if (node.nextSibling) {\n return node.nextSibling;\n }\n\n node = node.parentNode;\n }\n}\n/**\n * Get object describing the nodes which contain characters at offset.\n *\n * @param {DOMElement|DOMTextNode} root\n * @param {number} offset\n * @return {?object}\n */\n\n\nfunction getNodeForCharacterOffset(root, offset) {\n var node = getLeafNode(root);\n var nodeStart = 0;\n var nodeEnd = 0;\n\n while (node) {\n if (node.nodeType === TEXT_NODE) {\n nodeEnd = nodeStart + node.textContent.length;\n\n if (nodeStart <= offset && nodeEnd >= offset) {\n return {\n node: node,\n offset: offset - nodeStart\n };\n }\n\n nodeStart = nodeEnd;\n }\n\n node = getLeafNode(getSiblingNode(node));\n }\n}\n\n/**\n * @param {DOMElement} outerNode\n * @return {?object}\n */\n\nfunction getOffsets(outerNode) {\n var ownerDocument = outerNode.ownerDocument;\n var win = ownerDocument && ownerDocument.defaultView || window;\n var selection = win.getSelection && win.getSelection();\n\n if (!selection || selection.rangeCount === 0) {\n return null;\n }\n\n var anchorNode = selection.anchorNode,\n anchorOffset = selection.anchorOffset,\n focusNode = selection.focusNode,\n focusOffset = selection.focusOffset; // In Firefox, anchorNode and focusNode can be \"anonymous divs\", e.g. the\n // up/down buttons on an <input type=\"number\">. Anonymous divs do not seem to\n // expose properties, triggering a \"Permission denied error\" if any of its\n // properties are accessed. The only seemingly possible way to avoid erroring\n // is to access a property that typically works for non-anonymous divs and\n // catch any error that may otherwise arise. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=208427\n\n try {\n /* eslint-disable no-unused-expressions */\n anchorNode.nodeType;\n focusNode.nodeType;\n /* eslint-enable no-unused-expressions */\n } catch (e) {\n return null;\n }\n\n return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);\n}\n/**\n * Returns {start, end} where `start` is the character/codepoint index of\n * (anchorNode, anchorOffset) within the textContent of `outerNode`, and\n * `end` is the index of (focusNode, focusOffset).\n *\n * Returns null if you pass in garbage input but we should probably just crash.\n *\n * Exported only for testing.\n */\n\nfunction getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {\n var length = 0;\n var start = -1;\n var end = -1;\n var indexWithinAnchor = 0;\n var indexWithinFocus = 0;\n var node = outerNode;\n var parentNode = null;\n\n outer: while (true) {\n var next = null;\n\n while (true) {\n if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {\n start = length + anchorOffset;\n }\n\n if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {\n end = length + focusOffset;\n }\n\n if (node.nodeType === TEXT_NODE) {\n length += node.nodeValue.length;\n }\n\n if ((next = node.firstChild) === null) {\n break;\n } // Moving from `node` to its first child `next`.\n\n\n parentNode = node;\n node = next;\n }\n\n while (true) {\n if (node === outerNode) {\n // If `outerNode` has children, this is always the second time visiting\n // it. If it has no children, this is still the first loop, and the only\n // valid selection is anchorNode and focusNode both equal to this node\n // and both offsets 0, in which case we will have handled above.\n break outer;\n }\n\n if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {\n start = length;\n }\n\n if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {\n end = length;\n }\n\n if ((next = node.nextSibling) !== null) {\n break;\n }\n\n node = parentNode;\n parentNode = node.parentNode;\n } // Moving from `node` to its next sibling `next`.\n\n\n node = next;\n }\n\n if (start === -1 || end === -1) {\n // This should never happen. (Would happen if the anchor/focus nodes aren't\n // actually inside the passed-in node.)\n return null;\n }\n\n return {\n start: start,\n end: end\n };\n}\n/**\n * In modern non-IE browsers, we can support both forward and backward\n * selections.\n *\n * Note: IE10+ supports the Selection object, but it does not support\n * the `extend` method, which means that even in modern IE, it's not possible\n * to programmatically create a backward selection. Thus, for all IE\n * versions, we use the old IE API to create our selections.\n *\n * @param {DOMElement|DOMTextNode} node\n * @param {object} offsets\n */\n\nfunction setOffsets(node, offsets) {\n var doc = node.ownerDocument || document;\n var win = doc && doc.defaultView || window; // Edge fails with \"Object expected\" in some scenarios.\n // (For instance: TinyMCE editor used in a list component that supports pasting to add more,\n // fails when pasting 100+ items)\n\n if (!win.getSelection) {\n return;\n }\n\n var selection = win.getSelection();\n var length = node.textContent.length;\n var start = Math.min(offsets.start, length);\n var end = offsets.end === undefined ? start : Math.min(offsets.end, length); // IE 11 uses modern selection, but doesn't support the extend method.\n // Flip backward selections, so we can set with a single range.\n\n if (!selection.extend && start > end) {\n var temp = end;\n end = start;\n start = temp;\n }\n\n var startMarker = getNodeForCharacterOffset(node, start);\n var endMarker = getNodeForCharacterOffset(node, end);\n\n if (startMarker && endMarker) {\n if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {\n return;\n }\n\n var range = doc.createRange();\n range.setStart(startMarker.node, startMarker.offset);\n selection.removeAllRanges();\n\n if (start > end) {\n selection.addRange(range);\n selection.extend(endMarker.node, endMarker.offset);\n } else {\n range.setEnd(endMarker.node, endMarker.offset);\n selection.addRange(range);\n }\n }\n}\n\nfunction isTextNode(node) {\n return node && node.nodeType === TEXT_NODE;\n}\n\nfunction containsNode(outerNode, innerNode) {\n if (!outerNode || !innerNode) {\n return false;\n } else if (outerNode === innerNode) {\n return true;\n } else if (isTextNode(outerNode)) {\n return false;\n } else if (isTextNode(innerNode)) {\n return containsNode(outerNode, innerNode.parentNode);\n } else if ('contains' in outerNode) {\n return outerNode.contains(innerNode);\n } else if (outerNode.compareDocumentPosition) {\n return !!(outerNode.compareDocumentPosition(innerNode) & 16);\n } else {\n return false;\n }\n}\n\nfunction isInDocument(node) {\n return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);\n}\n\nfunction isSameOriginFrame(iframe) {\n try {\n // Accessing the contentDocument of a HTMLIframeElement can cause the browser\n // to throw, e.g. if it has a cross-origin src attribute.\n // Safari will show an error in the console when the access results in \"Blocked a frame with origin\". e.g:\n // iframe.contentDocument.defaultView;\n // A safety way is to access one of the cross origin properties: Window or Location\n // Which might result in \"SecurityError\" DOM Exception and it is compatible to Safari.\n // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl\n return typeof iframe.contentWindow.location.href === 'string';\n } catch (err) {\n return false;\n }\n}\n\nfunction getActiveElementDeep() {\n var win = window;\n var element = getActiveElement();\n\n while (element instanceof win.HTMLIFrameElement) {\n if (isSameOriginFrame(element)) {\n win = element.contentWindow;\n } else {\n return element;\n }\n\n element = getActiveElement(win.document);\n }\n\n return element;\n}\n/**\n * @ReactInputSelection: React input selection module. Based on Selection.js,\n * but modified to be suitable for react and has a couple of bug fixes (doesn't\n * assume buttons have range selections allowed).\n * Input selection module for React.\n */\n\n/**\n * @hasSelectionCapabilities: we get the element types that support selection\n * from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart`\n * and `selectionEnd` rows.\n */\n\n\nfunction hasSelectionCapabilities(elem) {\n var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true');\n}\nfunction getSelectionInformation() {\n var focusedElem = getActiveElementDeep();\n return {\n // Used by Flare\n activeElementDetached: null,\n focusedElem: focusedElem,\n selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null\n };\n}\n/**\n * @restoreSelection: If any selection information was potentially lost,\n * restore it. This is useful when performing operations that could remove dom\n * nodes and place them back in, resulting in focus being lost.\n */\n\nfunction restoreSelection(priorSelectionInformation) {\n var curFocusedElem = getActiveElementDeep();\n var priorFocusedElem = priorSelectionInformation.focusedElem;\n var priorSelectionRange = priorSelectionInformation.selectionRange;\n\n if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {\n if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {\n setSelection(priorFocusedElem, priorSelectionRange);\n } // Focusing a node can change the scroll position, which is undesirable\n\n\n var ancestors = [];\n var ancestor = priorFocusedElem;\n\n while (ancestor = ancestor.parentNode) {\n if (ancestor.nodeType === ELEMENT_NODE) {\n ancestors.push({\n element: ancestor,\n left: ancestor.scrollLeft,\n top: ancestor.scrollTop\n });\n }\n }\n\n if (typeof priorFocusedElem.focus === 'function') {\n priorFocusedElem.focus();\n }\n\n for (var i = 0; i < ancestors.length; i++) {\n var info = ancestors[i];\n info.element.scrollLeft = info.left;\n info.element.scrollTop = info.top;\n }\n }\n}\n/**\n * @getSelection: Gets the selection bounds of a focused textarea, input or\n * contentEditable node.\n * -@input: Look up selection bounds of this input\n * -@return {start: selectionStart, end: selectionEnd}\n */\n\nfunction getSelection(input) {\n var selection;\n\n if ('selectionStart' in input) {\n // Modern browser with input or textarea.\n selection = {\n start: input.selectionStart,\n end: input.selectionEnd\n };\n } else {\n // Content editable or old IE textarea.\n selection = getOffsets(input);\n }\n\n return selection || {\n start: 0,\n end: 0\n };\n}\n/**\n * @setSelection: Sets the selection bounds of a textarea or input and focuses\n * the input.\n * -@input Set selection bounds of this input or textarea\n * -@offsets Object of same form that is returned from get*\n */\n\nfunction setSelection(input, offsets) {\n var start = offsets.start,\n end = offsets.end;\n\n if (end === undefined) {\n end = start;\n }\n\n if ('selectionStart' in input) {\n input.selectionStart = start;\n input.selectionEnd = Math.min(end, input.value.length);\n } else {\n setOffsets(input, offsets);\n }\n}\n\nvar validateDOMNesting = function () {};\n\nvar updatedAncestorInfo = function () {};\n\n{\n // This validation code was written based on the HTML5 parsing spec:\n // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope\n //\n // Note: this does not catch all invalid nesting, nor does it try to (as it's\n // not clear what practical benefit doing so provides); instead, we warn only\n // for cases where the parser will give a parse tree differing from what React\n // intended. For example, <b><div></div></b> is invalid but we don't warn\n // because it still parses correctly; we do warn for other cases like nested\n // <p> tags where the beginning of the second element implicitly closes the\n // first, causing a confusing mess.\n // https://html.spec.whatwg.org/multipage/syntax.html#special\n var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope\n\n var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template', // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point\n // TODO: Distinguish by namespace here -- for <title>, including it here\n // errs on the side of fewer warnings\n 'foreignObject', 'desc', 'title']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope\n\n var buttonScopeTags = inScopeTags.concat(['button']); // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags\n\n var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];\n var emptyAncestorInfo = {\n current: null,\n formTag: null,\n aTagInScope: null,\n buttonTagInScope: null,\n nobrTagInScope: null,\n pTagInButtonScope: null,\n listItemTagAutoclosing: null,\n dlItemTagAutoclosing: null\n };\n\n updatedAncestorInfo = function (oldInfo, tag) {\n var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);\n\n var info = {\n tag: tag\n };\n\n if (inScopeTags.indexOf(tag) !== -1) {\n ancestorInfo.aTagInScope = null;\n ancestorInfo.buttonTagInScope = null;\n ancestorInfo.nobrTagInScope = null;\n }\n\n if (buttonScopeTags.indexOf(tag) !== -1) {\n ancestorInfo.pTagInButtonScope = null;\n } // See rules for 'li', 'dd', 'dt' start tags in\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody\n\n\n if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {\n ancestorInfo.listItemTagAutoclosing = null;\n ancestorInfo.dlItemTagAutoclosing = null;\n }\n\n ancestorInfo.current = info;\n\n if (tag === 'form') {\n ancestorInfo.formTag = info;\n }\n\n if (tag === 'a') {\n ancestorInfo.aTagInScope = info;\n }\n\n if (tag === 'button') {\n ancestorInfo.buttonTagInScope = info;\n }\n\n if (tag === 'nobr') {\n ancestorInfo.nobrTagInScope = info;\n }\n\n if (tag === 'p') {\n ancestorInfo.pTagInButtonScope = info;\n }\n\n if (tag === 'li') {\n ancestorInfo.listItemTagAutoclosing = info;\n }\n\n if (tag === 'dd' || tag === 'dt') {\n ancestorInfo.dlItemTagAutoclosing = info;\n }\n\n return ancestorInfo;\n };\n /**\n * Returns whether\n */\n\n\n var isTagValidWithParent = function (tag, parentTag) {\n // First, let's check if we're in an unusual parsing mode...\n switch (parentTag) {\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect\n case 'select':\n return tag === 'option' || tag === 'optgroup' || tag === '#text';\n\n case 'optgroup':\n return tag === 'option' || tag === '#text';\n // Strictly speaking, seeing an <option> doesn't mean we're in a <select>\n // but\n\n case 'option':\n return tag === '#text';\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption\n // No special behavior since these rules fall back to \"in body\" mode for\n // all except special table nodes which cause bad parsing behavior anyway.\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr\n\n case 'tr':\n return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody\n\n case 'tbody':\n case 'thead':\n case 'tfoot':\n return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup\n\n case 'colgroup':\n return tag === 'col' || tag === 'template';\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable\n\n case 'table':\n return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead\n\n case 'head':\n return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';\n // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element\n\n case 'html':\n return tag === 'head' || tag === 'body' || tag === 'frameset';\n\n case 'frameset':\n return tag === 'frame';\n\n case '#document':\n return tag === 'html';\n } // Probably in the \"in body\" parsing mode, so we outlaw only tag combos\n // where the parsing rules cause implicit opens or closes to be added.\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody\n\n\n switch (tag) {\n case 'h1':\n case 'h2':\n case 'h3':\n case 'h4':\n case 'h5':\n case 'h6':\n return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';\n\n case 'rp':\n case 'rt':\n return impliedEndTags.indexOf(parentTag) === -1;\n\n case 'body':\n case 'caption':\n case 'col':\n case 'colgroup':\n case 'frameset':\n case 'frame':\n case 'head':\n case 'html':\n case 'tbody':\n case 'td':\n case 'tfoot':\n case 'th':\n case 'thead':\n case 'tr':\n // These tags are only valid with a few parents that have special child\n // parsing rules -- if we're down here, then none of those matched and\n // so we allow it only if we don't know what the parent is, as all other\n // cases are invalid.\n return parentTag == null;\n }\n\n return true;\n };\n /**\n * Returns whether\n */\n\n\n var findInvalidAncestorForTag = function (tag, ancestorInfo) {\n switch (tag) {\n case 'address':\n case 'article':\n case 'aside':\n case 'blockquote':\n case 'center':\n case 'details':\n case 'dialog':\n case 'dir':\n case 'div':\n case 'dl':\n case 'fieldset':\n case 'figcaption':\n case 'figure':\n case 'footer':\n case 'header':\n case 'hgroup':\n case 'main':\n case 'menu':\n case 'nav':\n case 'ol':\n case 'p':\n case 'section':\n case 'summary':\n case 'ul':\n case 'pre':\n case 'listing':\n case 'table':\n case 'hr':\n case 'xmp':\n case 'h1':\n case 'h2':\n case 'h3':\n case 'h4':\n case 'h5':\n case 'h6':\n return ancestorInfo.pTagInButtonScope;\n\n case 'form':\n return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;\n\n case 'li':\n return ancestorInfo.listItemTagAutoclosing;\n\n case 'dd':\n case 'dt':\n return ancestorInfo.dlItemTagAutoclosing;\n\n case 'button':\n return ancestorInfo.buttonTagInScope;\n\n case 'a':\n // Spec says something about storing a list of markers, but it sounds\n // equivalent to this check.\n return ancestorInfo.aTagInScope;\n\n case 'nobr':\n return ancestorInfo.nobrTagInScope;\n }\n\n return null;\n };\n\n var didWarn$1 = {};\n\n validateDOMNesting = function (childTag, childText, ancestorInfo) {\n ancestorInfo = ancestorInfo || emptyAncestorInfo;\n var parentInfo = ancestorInfo.current;\n var parentTag = parentInfo && parentInfo.tag;\n\n if (childText != null) {\n if (childTag != null) {\n error('validateDOMNesting: when childText is passed, childTag should be null');\n }\n\n childTag = '#text';\n }\n\n var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;\n var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);\n var invalidParentOrAncestor = invalidParent || invalidAncestor;\n\n if (!invalidParentOrAncestor) {\n return;\n }\n\n var ancestorTag = invalidParentOrAncestor.tag;\n var addendum = getCurrentFiberStackInDev();\n var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + addendum;\n\n if (didWarn$1[warnKey]) {\n return;\n }\n\n didWarn$1[warnKey] = true;\n var tagDisplayName = childTag;\n var whitespaceInfo = '';\n\n if (childTag === '#text') {\n if (/\\S/.test(childText)) {\n tagDisplayName = 'Text nodes';\n } else {\n tagDisplayName = 'Whitespace text nodes';\n whitespaceInfo = \" Make sure you don't have any extra whitespace between tags on \" + 'each line of your source code.';\n }\n } else {\n tagDisplayName = '<' + childTag + '>';\n }\n\n if (invalidParent) {\n var info = '';\n\n if (ancestorTag === 'table' && childTag === 'tr') {\n info += ' Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by ' + 'the browser.';\n }\n\n error('validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info);\n } else {\n error('validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.', tagDisplayName, ancestorTag);\n }\n };\n}\n\nvar SUPPRESS_HYDRATION_WARNING$1;\n\n{\n SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning';\n}\n\nvar SUSPENSE_START_DATA = '$';\nvar SUSPENSE_END_DATA = '/$';\nvar SUSPENSE_PENDING_START_DATA = '$?';\nvar SUSPENSE_FALLBACK_START_DATA = '$!';\nvar STYLE$1 = 'style';\nvar eventsEnabled = null;\nvar selectionInformation = null;\n\nfunction shouldAutoFocusHostComponent(type, props) {\n switch (type) {\n case 'button':\n case 'input':\n case 'select':\n case 'textarea':\n return !!props.autoFocus;\n }\n\n return false;\n}\nfunction getRootHostContext(rootContainerInstance) {\n var type;\n var namespace;\n var nodeType = rootContainerInstance.nodeType;\n\n switch (nodeType) {\n case DOCUMENT_NODE:\n case DOCUMENT_FRAGMENT_NODE:\n {\n type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment';\n var root = rootContainerInstance.documentElement;\n namespace = root ? root.namespaceURI : getChildNamespace(null, '');\n break;\n }\n\n default:\n {\n var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;\n var ownNamespace = container.namespaceURI || null;\n type = container.tagName;\n namespace = getChildNamespace(ownNamespace, type);\n break;\n }\n }\n\n {\n var validatedTag = type.toLowerCase();\n var ancestorInfo = updatedAncestorInfo(null, validatedTag);\n return {\n namespace: namespace,\n ancestorInfo: ancestorInfo\n };\n }\n}\nfunction getChildHostContext(parentHostContext, type, rootContainerInstance) {\n {\n var parentHostContextDev = parentHostContext;\n var namespace = getChildNamespace(parentHostContextDev.namespace, type);\n var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);\n return {\n namespace: namespace,\n ancestorInfo: ancestorInfo\n };\n }\n}\nfunction getPublicInstance(instance) {\n return instance;\n}\nfunction prepareForCommit(containerInfo) {\n eventsEnabled = isEnabled();\n selectionInformation = getSelectionInformation();\n setEnabled(false);\n}\nfunction resetAfterCommit(containerInfo) {\n restoreSelection(selectionInformation);\n setEnabled(eventsEnabled);\n eventsEnabled = null;\n\n selectionInformation = null;\n}\nfunction createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {\n var parentNamespace;\n\n {\n // TODO: take namespace into account when validating.\n var hostContextDev = hostContext;\n validateDOMNesting(type, null, hostContextDev.ancestorInfo);\n\n if (typeof props.children === 'string' || typeof props.children === 'number') {\n var string = '' + props.children;\n var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);\n validateDOMNesting(null, string, ownAncestorInfo);\n }\n\n parentNamespace = hostContextDev.namespace;\n }\n\n var domElement = createElement(type, props, rootContainerInstance, parentNamespace);\n precacheFiberNode(internalInstanceHandle, domElement);\n updateFiberProps(domElement, props);\n return domElement;\n}\nfunction appendInitialChild(parentInstance, child) {\n parentInstance.appendChild(child);\n}\nfunction finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {\n setInitialProperties(domElement, type, props, rootContainerInstance);\n return shouldAutoFocusHostComponent(type, props);\n}\nfunction prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {\n {\n var hostContextDev = hostContext;\n\n if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {\n var string = '' + newProps.children;\n var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);\n validateDOMNesting(null, string, ownAncestorInfo);\n }\n }\n\n return diffProperties(domElement, type, oldProps, newProps, rootContainerInstance);\n}\nfunction shouldSetTextContent(type, props) {\n return type === 'textarea' || type === 'option' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;\n}\nfunction shouldDeprioritizeSubtree(type, props) {\n return !!props.hidden;\n}\nfunction createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {\n {\n var hostContextDev = hostContext;\n validateDOMNesting(null, text, hostContextDev.ancestorInfo);\n }\n\n var textNode = createTextNode(text, rootContainerInstance);\n precacheFiberNode(internalInstanceHandle, textNode);\n return textNode;\n}\n// if a component just imports ReactDOM (e.g. for findDOMNode).\n// Some environments might not have setTimeout or clearTimeout.\n\nvar scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined;\nvar cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined;\nvar noTimeout = -1; // -------------------\nfunction commitMount(domElement, type, newProps, internalInstanceHandle) {\n // Despite the naming that might imply otherwise, this method only\n // fires if there is an `Update` effect scheduled during mounting.\n // This happens if `finalizeInitialChildren` returns `true` (which it\n // does to implement the `autoFocus` attribute on the client). But\n // there are also other cases when this might happen (such as patching\n // up text content during hydration mismatch). So we'll check this again.\n if (shouldAutoFocusHostComponent(type, newProps)) {\n domElement.focus();\n }\n}\nfunction commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {\n // Update the props handle so that we know which props are the ones with\n // with current event handlers.\n updateFiberProps(domElement, newProps); // Apply the diff to the DOM node.\n\n updateProperties(domElement, updatePayload, type, oldProps, newProps);\n}\nfunction resetTextContent(domElement) {\n setTextContent(domElement, '');\n}\nfunction commitTextUpdate(textInstance, oldText, newText) {\n textInstance.nodeValue = newText;\n}\nfunction appendChild(parentInstance, child) {\n parentInstance.appendChild(child);\n}\nfunction appendChildToContainer(container, child) {\n var parentNode;\n\n if (container.nodeType === COMMENT_NODE) {\n parentNode = container.parentNode;\n parentNode.insertBefore(child, container);\n } else {\n parentNode = container;\n parentNode.appendChild(child);\n } // This container might be used for a portal.\n // If something inside a portal is clicked, that click should bubble\n // through the React tree. However, on Mobile Safari the click would\n // never bubble through the *DOM* tree unless an ancestor with onclick\n // event exists. So we wouldn't see it and dispatch it.\n // This is why we ensure that non React root containers have inline onclick\n // defined.\n // https://github.com/facebook/react/issues/11918\n\n\n var reactRootContainer = container._reactRootContainer;\n\n if ((reactRootContainer === null || reactRootContainer === undefined) && parentNode.onclick === null) {\n // TODO: This cast may not be sound for SVG, MathML or custom elements.\n trapClickOnNonInteractiveElement(parentNode);\n }\n}\nfunction insertBefore(parentInstance, child, beforeChild) {\n parentInstance.insertBefore(child, beforeChild);\n}\nfunction insertInContainerBefore(container, child, beforeChild) {\n if (container.nodeType === COMMENT_NODE) {\n container.parentNode.insertBefore(child, beforeChild);\n } else {\n container.insertBefore(child, beforeChild);\n }\n}\nfunction removeChild(parentInstance, child) {\n parentInstance.removeChild(child);\n}\nfunction removeChildFromContainer(container, child) {\n if (container.nodeType === COMMENT_NODE) {\n container.parentNode.removeChild(child);\n } else {\n container.removeChild(child);\n }\n}\n\nfunction hideInstance(instance) {\n // pass host context to this method?\n\n\n instance = instance;\n var style = instance.style;\n\n if (typeof style.setProperty === 'function') {\n style.setProperty('display', 'none', 'important');\n } else {\n style.display = 'none';\n }\n}\nfunction hideTextInstance(textInstance) {\n textInstance.nodeValue = '';\n}\nfunction unhideInstance(instance, props) {\n instance = instance;\n var styleProp = props[STYLE$1];\n var display = styleProp !== undefined && styleProp !== null && styleProp.hasOwnProperty('display') ? styleProp.display : null;\n instance.style.display = dangerousStyleValue('display', display);\n}\nfunction unhideTextInstance(textInstance, text) {\n textInstance.nodeValue = text;\n} // -------------------\nfunction canHydrateInstance(instance, type, props) {\n if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {\n return null;\n } // This has now been refined to an element node.\n\n\n return instance;\n}\nfunction canHydrateTextInstance(instance, text) {\n if (text === '' || instance.nodeType !== TEXT_NODE) {\n // Empty strings are not parsed by HTML so there won't be a correct match here.\n return null;\n } // This has now been refined to a text node.\n\n\n return instance;\n}\nfunction isSuspenseInstancePending(instance) {\n return instance.data === SUSPENSE_PENDING_START_DATA;\n}\nfunction isSuspenseInstanceFallback(instance) {\n return instance.data === SUSPENSE_FALLBACK_START_DATA;\n}\n\nfunction getNextHydratable(node) {\n // Skip non-hydratable nodes.\n for (; node != null; node = node.nextSibling) {\n var nodeType = node.nodeType;\n\n if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {\n break;\n }\n }\n\n return node;\n}\n\nfunction getNextHydratableSibling(instance) {\n return getNextHydratable(instance.nextSibling);\n}\nfunction getFirstHydratableChild(parentInstance) {\n return getNextHydratable(parentInstance.firstChild);\n}\nfunction hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {\n precacheFiberNode(internalInstanceHandle, instance); // TODO: Possibly defer this until the commit phase where all the events\n // get attached.\n\n updateFiberProps(instance, props);\n var parentNamespace;\n\n {\n var hostContextDev = hostContext;\n parentNamespace = hostContextDev.namespace;\n }\n\n return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance);\n}\nfunction hydrateTextInstance(textInstance, text, internalInstanceHandle) {\n precacheFiberNode(internalInstanceHandle, textInstance);\n return diffHydratedText(textInstance, text);\n}\nfunction getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {\n var node = suspenseInstance.nextSibling; // Skip past all nodes within this suspense boundary.\n // There might be nested nodes so we need to keep track of how\n // deep we are and only break out when we're back on top.\n\n var depth = 0;\n\n while (node) {\n if (node.nodeType === COMMENT_NODE) {\n var data = node.data;\n\n if (data === SUSPENSE_END_DATA) {\n if (depth === 0) {\n return getNextHydratableSibling(node);\n } else {\n depth--;\n }\n } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {\n depth++;\n }\n }\n\n node = node.nextSibling;\n } // TODO: Warn, we didn't find the end comment boundary.\n\n\n return null;\n} // Returns the SuspenseInstance if this node is a direct child of a\n// SuspenseInstance. I.e. if its previous sibling is a Comment with\n// SUSPENSE_x_START_DATA. Otherwise, null.\n\nfunction getParentSuspenseInstance(targetInstance) {\n var node = targetInstance.previousSibling; // Skip past all nodes within this suspense boundary.\n // There might be nested nodes so we need to keep track of how\n // deep we are and only break out when we're back on top.\n\n var depth = 0;\n\n while (node) {\n if (node.nodeType === COMMENT_NODE) {\n var data = node.data;\n\n if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {\n if (depth === 0) {\n return node;\n } else {\n depth--;\n }\n } else if (data === SUSPENSE_END_DATA) {\n depth++;\n }\n }\n\n node = node.previousSibling;\n }\n\n return null;\n}\nfunction commitHydratedContainer(container) {\n // Retry if any event replaying was blocked on this.\n retryIfBlockedOn(container);\n}\nfunction commitHydratedSuspenseInstance(suspenseInstance) {\n // Retry if any event replaying was blocked on this.\n retryIfBlockedOn(suspenseInstance);\n}\nfunction didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {\n {\n warnForUnmatchedText(textInstance, text);\n }\n}\nfunction didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {\n if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n warnForUnmatchedText(textInstance, text);\n }\n}\nfunction didNotHydrateContainerInstance(parentContainer, instance) {\n {\n if (instance.nodeType === ELEMENT_NODE) {\n warnForDeletedHydratableElement(parentContainer, instance);\n } else if (instance.nodeType === COMMENT_NODE) ; else {\n warnForDeletedHydratableText(parentContainer, instance);\n }\n }\n}\nfunction didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {\n if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n if (instance.nodeType === ELEMENT_NODE) {\n warnForDeletedHydratableElement(parentInstance, instance);\n } else if (instance.nodeType === COMMENT_NODE) ; else {\n warnForDeletedHydratableText(parentInstance, instance);\n }\n }\n}\nfunction didNotFindHydratableContainerInstance(parentContainer, type, props) {\n {\n warnForInsertedHydratedElement(parentContainer, type);\n }\n}\nfunction didNotFindHydratableContainerTextInstance(parentContainer, text) {\n {\n warnForInsertedHydratedText(parentContainer, text);\n }\n}\nfunction didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) {\n if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n warnForInsertedHydratedElement(parentInstance, type);\n }\n}\nfunction didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {\n if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n warnForInsertedHydratedText(parentInstance, text);\n }\n}\nfunction didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) {\n if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) ;\n}\n\nvar randomKey = Math.random().toString(36).slice(2);\nvar internalInstanceKey = '__reactInternalInstance$' + randomKey;\nvar internalEventHandlersKey = '__reactEventHandlers$' + randomKey;\nvar internalContainerInstanceKey = '__reactContainere$' + randomKey;\nfunction precacheFiberNode(hostInst, node) {\n node[internalInstanceKey] = hostInst;\n}\nfunction markContainerAsRoot(hostRoot, node) {\n node[internalContainerInstanceKey] = hostRoot;\n}\nfunction unmarkContainerAsRoot(node) {\n node[internalContainerInstanceKey] = null;\n}\nfunction isContainerMarkedAsRoot(node) {\n return !!node[internalContainerInstanceKey];\n} // Given a DOM node, return the closest HostComponent or HostText fiber ancestor.\n// If the target node is part of a hydrated or not yet rendered subtree, then\n// this may also return a SuspenseComponent or HostRoot to indicate that.\n// Conceptually the HostRoot fiber is a child of the Container node. So if you\n// pass the Container node as the targetNode, you will not actually get the\n// HostRoot back. To get to the HostRoot, you need to pass a child of it.\n// The same thing applies to Suspense boundaries.\n\nfunction getClosestInstanceFromNode(targetNode) {\n var targetInst = targetNode[internalInstanceKey];\n\n if (targetInst) {\n // Don't return HostRoot or SuspenseComponent here.\n return targetInst;\n } // If the direct event target isn't a React owned DOM node, we need to look\n // to see if one of its parents is a React owned DOM node.\n\n\n var parentNode = targetNode.parentNode;\n\n while (parentNode) {\n // We'll check if this is a container root that could include\n // React nodes in the future. We need to check this first because\n // if we're a child of a dehydrated container, we need to first\n // find that inner container before moving on to finding the parent\n // instance. Note that we don't check this field on the targetNode\n // itself because the fibers are conceptually between the container\n // node and the first child. It isn't surrounding the container node.\n // If it's not a container, we check if it's an instance.\n targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];\n\n if (targetInst) {\n // Since this wasn't the direct target of the event, we might have\n // stepped past dehydrated DOM nodes to get here. However they could\n // also have been non-React nodes. We need to answer which one.\n // If we the instance doesn't have any children, then there can't be\n // a nested suspense boundary within it. So we can use this as a fast\n // bailout. Most of the time, when people add non-React children to\n // the tree, it is using a ref to a child-less DOM node.\n // Normally we'd only need to check one of the fibers because if it\n // has ever gone from having children to deleting them or vice versa\n // it would have deleted the dehydrated boundary nested inside already.\n // However, since the HostRoot starts out with an alternate it might\n // have one on the alternate so we need to check in case this was a\n // root.\n var alternate = targetInst.alternate;\n\n if (targetInst.child !== null || alternate !== null && alternate.child !== null) {\n // Next we need to figure out if the node that skipped past is\n // nested within a dehydrated boundary and if so, which one.\n var suspenseInstance = getParentSuspenseInstance(targetNode);\n\n while (suspenseInstance !== null) {\n // We found a suspense instance. That means that we haven't\n // hydrated it yet. Even though we leave the comments in the\n // DOM after hydrating, and there are boundaries in the DOM\n // that could already be hydrated, we wouldn't have found them\n // through this pass since if the target is hydrated it would\n // have had an internalInstanceKey on it.\n // Let's get the fiber associated with the SuspenseComponent\n // as the deepest instance.\n var targetSuspenseInst = suspenseInstance[internalInstanceKey];\n\n if (targetSuspenseInst) {\n return targetSuspenseInst;\n } // If we don't find a Fiber on the comment, it might be because\n // we haven't gotten to hydrate it yet. There might still be a\n // parent boundary that hasn't above this one so we need to find\n // the outer most that is known.\n\n\n suspenseInstance = getParentSuspenseInstance(suspenseInstance); // If we don't find one, then that should mean that the parent\n // host component also hasn't hydrated yet. We can return it\n // below since it will bail out on the isMounted check later.\n }\n }\n\n return targetInst;\n }\n\n targetNode = parentNode;\n parentNode = targetNode.parentNode;\n }\n\n return null;\n}\n/**\n * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent\n * instance, or null if the node was not rendered by this React.\n */\n\nfunction getInstanceFromNode$1(node) {\n var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];\n\n if (inst) {\n if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {\n return inst;\n } else {\n return null;\n }\n }\n\n return null;\n}\n/**\n * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding\n * DOM node.\n */\n\nfunction getNodeFromInstance$1(inst) {\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber this, is just the state node right now. We assume it will be\n // a host component or host text.\n return inst.stateNode;\n } // Without this first invariant, passing a non-DOM-component triggers the next\n // invariant for a missing parent, which is super confusing.\n\n\n {\n {\n throw Error( \"getNodeFromInstance: Invalid argument.\" );\n }\n }\n}\nfunction getFiberCurrentPropsFromNode$1(node) {\n return node[internalEventHandlersKey] || null;\n}\nfunction updateFiberProps(node, props) {\n node[internalEventHandlersKey] = props;\n}\n\nfunction getParent(inst) {\n do {\n inst = inst.return; // TODO: If this is a HostRoot we might want to bail out.\n // That is depending on if we want nested subtrees (layers) to bubble\n // events to their parent. We could also go through parentNode on the\n // host node but that wouldn't work for React Native and doesn't let us\n // do the portal feature.\n } while (inst && inst.tag !== HostComponent);\n\n if (inst) {\n return inst;\n }\n\n return null;\n}\n/**\n * Return the lowest common ancestor of A and B, or null if they are in\n * different trees.\n */\n\n\nfunction getLowestCommonAncestor(instA, instB) {\n var depthA = 0;\n\n for (var tempA = instA; tempA; tempA = getParent(tempA)) {\n depthA++;\n }\n\n var depthB = 0;\n\n for (var tempB = instB; tempB; tempB = getParent(tempB)) {\n depthB++;\n } // If A is deeper, crawl up.\n\n\n while (depthA - depthB > 0) {\n instA = getParent(instA);\n depthA--;\n } // If B is deeper, crawl up.\n\n\n while (depthB - depthA > 0) {\n instB = getParent(instB);\n depthB--;\n } // Walk in lockstep until we find a match.\n\n\n var depth = depthA;\n\n while (depth--) {\n if (instA === instB || instA === instB.alternate) {\n return instA;\n }\n\n instA = getParent(instA);\n instB = getParent(instB);\n }\n\n return null;\n}\n/**\n * Simulates the traversal of a two-phase, capture/bubble event dispatch.\n */\n\nfunction traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}\n/**\n * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that\n * should would receive a `mouseEnter` or `mouseLeave` event.\n *\n * Does not invoke the callback on the nearest common ancestor because nothing\n * \"entered\" or \"left\" that element.\n */\n\nfunction traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n\n while (true) {\n if (!from) {\n break;\n }\n\n if (from === common) {\n break;\n }\n\n var alternate = from.alternate;\n\n if (alternate !== null && alternate === common) {\n break;\n }\n\n pathFrom.push(from);\n from = getParent(from);\n }\n\n var pathTo = [];\n\n while (true) {\n if (!to) {\n break;\n }\n\n if (to === common) {\n break;\n }\n\n var _alternate = to.alternate;\n\n if (_alternate !== null && _alternate === common) {\n break;\n }\n\n pathTo.push(to);\n to = getParent(to);\n }\n\n for (var i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], 'bubbled', argFrom);\n }\n\n for (var _i = pathTo.length; _i-- > 0;) {\n fn(pathTo[_i], 'captured', argTo);\n }\n}\n\nfunction isInteractive(tag) {\n return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';\n}\n\nfunction shouldPreventMouseEvent(name, type, props) {\n switch (name) {\n case 'onClick':\n case 'onClickCapture':\n case 'onDoubleClick':\n case 'onDoubleClickCapture':\n case 'onMouseDown':\n case 'onMouseDownCapture':\n case 'onMouseMove':\n case 'onMouseMoveCapture':\n case 'onMouseUp':\n case 'onMouseUpCapture':\n case 'onMouseEnter':\n return !!(props.disabled && isInteractive(type));\n\n default:\n return false;\n }\n}\n/**\n * @param {object} inst The instance, which is the source of events.\n * @param {string} registrationName Name of listener (e.g. `onClick`).\n * @return {?function} The stored callback.\n */\n\n\nfunction getListener(inst, registrationName) {\n var listener; // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not\n // live here; needs to be moved to a better place soon\n\n var stateNode = inst.stateNode;\n\n if (!stateNode) {\n // Work in progress (ex: onload events in incremental mode).\n return null;\n }\n\n var props = getFiberCurrentPropsFromNode(stateNode);\n\n if (!props) {\n // Work in progress.\n return null;\n }\n\n listener = props[registrationName];\n\n if (shouldPreventMouseEvent(registrationName, inst.type, props)) {\n return null;\n }\n\n if (!(!listener || typeof listener === 'function')) {\n {\n throw Error( \"Expected `\" + registrationName + \"` listener to be a function, instead got a value of `\" + typeof listener + \"` type.\" );\n }\n }\n\n return listener;\n}\n\n/**\n * Some event types have a notion of different registration names for different\n * \"phases\" of propagation. This finds listeners by a given phase.\n */\nfunction listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}\n/**\n * A small set of propagation patterns, each of which will accept a small amount\n * of information, and generate a set of \"dispatch ready event objects\" - which\n * are sets of events that have already been annotated with a set of dispatched\n * listener functions/ids. The API is designed this way to discourage these\n * propagation strategies from actually executing the dispatches, since we\n * always want to collect the entire set of dispatches before executing even a\n * single one.\n */\n\n/**\n * Tags a `SyntheticEvent` with dispatched listeners. Creating this function\n * here, allows us to not have to bind or create functions for each event.\n * Mutating the event's members allows us to not have to create a wrapping\n * \"dispatch\" object that pairs the event with the listener.\n */\n\n\nfunction accumulateDirectionalDispatches(inst, phase, event) {\n {\n if (!inst) {\n error('Dispatching inst must not be null');\n }\n }\n\n var listener = listenerAtPhase(inst, event, phase);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n}\n/**\n * Collect dispatches (must be entirely collected before dispatching - see unit\n * tests). Lazily allocate the array to conserve memory. We must loop through\n * each event and perform the traversal for each one. We cannot perform a\n * single traversal for the entire collection of events because each event may\n * have a different target.\n */\n\n\nfunction accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n}\n/**\n * Accumulates without regard to direction, does not look for phased\n * registration names. Same as `accumulateDirectDispatchesSingle` but without\n * requiring that the `dispatchMarker` be the same as the dispatched ID.\n */\n\n\nfunction accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}\n/**\n * Accumulates dispatches on an `SyntheticEvent`, but only for the\n * `dispatchMarker`.\n * @param {SyntheticEvent} event\n */\n\n\nfunction accumulateDirectDispatchesSingle(event) {\n if (event && event.dispatchConfig.registrationName) {\n accumulateDispatches(event._targetInst, null, event);\n }\n}\n\nfunction accumulateTwoPhaseDispatches(events) {\n forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);\n}\nfunction accumulateEnterLeaveDispatches(leave, enter, from, to) {\n traverseEnterLeave(from, to, accumulateDispatches, leave, enter);\n}\nfunction accumulateDirectDispatches(events) {\n forEachAccumulated(events, accumulateDirectDispatchesSingle);\n}\n\n/**\n * These variables store information about text content of a target node,\n * allowing comparison of content before and after a given event.\n *\n * Identify the node where selection currently begins, then observe\n * both its text content and its current position in the DOM. Since the\n * browser may natively replace the target node during composition, we can\n * use its position to find its replacement.\n *\n *\n */\nvar root = null;\nvar startText = null;\nvar fallbackText = null;\nfunction initialize(nativeEventTarget) {\n root = nativeEventTarget;\n startText = getText();\n return true;\n}\nfunction reset() {\n root = null;\n startText = null;\n fallbackText = null;\n}\nfunction getData() {\n if (fallbackText) {\n return fallbackText;\n }\n\n var start;\n var startValue = startText;\n var startLength = startValue.length;\n var end;\n var endValue = getText();\n var endLength = endValue.length;\n\n for (start = 0; start < startLength; start++) {\n if (startValue[start] !== endValue[start]) {\n break;\n }\n }\n\n var minEnd = startLength - start;\n\n for (end = 1; end <= minEnd; end++) {\n if (startValue[startLength - end] !== endValue[endLength - end]) {\n break;\n }\n }\n\n var sliceTail = end > 1 ? 1 - end : undefined;\n fallbackText = endValue.slice(start, sliceTail);\n return fallbackText;\n}\nfunction getText() {\n if ('value' in root) {\n return root.value;\n }\n\n return root.textContent;\n}\n\nvar EVENT_POOL_SIZE = 10;\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar EventInterface = {\n type: null,\n target: null,\n // currentTarget is set when dispatching; no use in copying it here\n currentTarget: function () {\n return null;\n },\n eventPhase: null,\n bubbles: null,\n cancelable: null,\n timeStamp: function (event) {\n return event.timeStamp || Date.now();\n },\n defaultPrevented: null,\n isTrusted: null\n};\n\nfunction functionThatReturnsTrue() {\n return true;\n}\n\nfunction functionThatReturnsFalse() {\n return false;\n}\n/**\n * Synthetic events are dispatched by event plugins, typically in response to a\n * top-level event delegation handler.\n *\n * These systems should generally use pooling to reduce the frequency of garbage\n * collection. The system should check `isPersistent` to determine whether the\n * event should be released into the pool after being dispatched. Users that\n * need a persisted event should invoke `persist`.\n *\n * Synthetic events (and subclasses) implement the DOM Level 3 Events API by\n * normalizing browser quirks. Subclasses do not necessarily have to implement a\n * DOM interface; custom application-specific events can also subclass this.\n *\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {*} targetInst Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @param {DOMEventTarget} nativeEventTarget Target node.\n */\n\n\nfunction SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {\n {\n // these have a getter/setter for warnings\n delete this.nativeEvent;\n delete this.preventDefault;\n delete this.stopPropagation;\n delete this.isDefaultPrevented;\n delete this.isPropagationStopped;\n }\n\n this.dispatchConfig = dispatchConfig;\n this._targetInst = targetInst;\n this.nativeEvent = nativeEvent;\n var Interface = this.constructor.Interface;\n\n for (var propName in Interface) {\n if (!Interface.hasOwnProperty(propName)) {\n continue;\n }\n\n {\n delete this[propName]; // this has a getter/setter for warnings\n }\n\n var normalize = Interface[propName];\n\n if (normalize) {\n this[propName] = normalize(nativeEvent);\n } else {\n if (propName === 'target') {\n this.target = nativeEventTarget;\n } else {\n this[propName] = nativeEvent[propName];\n }\n }\n }\n\n var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;\n\n if (defaultPrevented) {\n this.isDefaultPrevented = functionThatReturnsTrue;\n } else {\n this.isDefaultPrevented = functionThatReturnsFalse;\n }\n\n this.isPropagationStopped = functionThatReturnsFalse;\n return this;\n}\n\n_assign(SyntheticEvent.prototype, {\n preventDefault: function () {\n this.defaultPrevented = true;\n var event = this.nativeEvent;\n\n if (!event) {\n return;\n }\n\n if (event.preventDefault) {\n event.preventDefault();\n } else if (typeof event.returnValue !== 'unknown') {\n event.returnValue = false;\n }\n\n this.isDefaultPrevented = functionThatReturnsTrue;\n },\n stopPropagation: function () {\n var event = this.nativeEvent;\n\n if (!event) {\n return;\n }\n\n if (event.stopPropagation) {\n event.stopPropagation();\n } else if (typeof event.cancelBubble !== 'unknown') {\n // The ChangeEventPlugin registers a \"propertychange\" event for\n // IE. This event does not support bubbling or cancelling, and\n // any references to cancelBubble throw \"Member not found\". A\n // typeof check of \"unknown\" circumvents this issue (and is also\n // IE specific).\n event.cancelBubble = true;\n }\n\n this.isPropagationStopped = functionThatReturnsTrue;\n },\n\n /**\n * We release all dispatched `SyntheticEvent`s after each event loop, adding\n * them back into the pool. This allows a way to hold onto a reference that\n * won't be added back into the pool.\n */\n persist: function () {\n this.isPersistent = functionThatReturnsTrue;\n },\n\n /**\n * Checks if this event should be released back into the pool.\n *\n * @return {boolean} True if this should not be released, false otherwise.\n */\n isPersistent: functionThatReturnsFalse,\n\n /**\n * `PooledClass` looks for `destructor` on each instance it releases.\n */\n destructor: function () {\n var Interface = this.constructor.Interface;\n\n for (var propName in Interface) {\n {\n Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));\n }\n }\n\n this.dispatchConfig = null;\n this._targetInst = null;\n this.nativeEvent = null;\n this.isDefaultPrevented = functionThatReturnsFalse;\n this.isPropagationStopped = functionThatReturnsFalse;\n this._dispatchListeners = null;\n this._dispatchInstances = null;\n\n {\n Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));\n Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse));\n Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse));\n Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {}));\n Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {}));\n }\n }\n});\n\nSyntheticEvent.Interface = EventInterface;\n/**\n * Helper to reduce boilerplate when creating subclasses.\n */\n\nSyntheticEvent.extend = function (Interface) {\n var Super = this;\n\n var E = function () {};\n\n E.prototype = Super.prototype;\n var prototype = new E();\n\n function Class() {\n return Super.apply(this, arguments);\n }\n\n _assign(prototype, Class.prototype);\n\n Class.prototype = prototype;\n Class.prototype.constructor = Class;\n Class.Interface = _assign({}, Super.Interface, Interface);\n Class.extend = Super.extend;\n addEventPoolingTo(Class);\n return Class;\n};\n\naddEventPoolingTo(SyntheticEvent);\n/**\n * Helper to nullify syntheticEvent instance properties when destructing\n *\n * @param {String} propName\n * @param {?object} getVal\n * @return {object} defineProperty object\n */\n\nfunction getPooledWarningPropertyDefinition(propName, getVal) {\n var isFunction = typeof getVal === 'function';\n return {\n configurable: true,\n set: set,\n get: get\n };\n\n function set(val) {\n var action = isFunction ? 'setting the method' : 'setting the property';\n warn(action, 'This is effectively a no-op');\n return val;\n }\n\n function get() {\n var action = isFunction ? 'accessing the method' : 'accessing the property';\n var result = isFunction ? 'This is a no-op function' : 'This is set to null';\n warn(action, result);\n return getVal;\n }\n\n function warn(action, result) {\n {\n error(\"This synthetic event is reused for performance reasons. If you're seeing this, \" + \"you're %s `%s` on a released/nullified synthetic event. %s. \" + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result);\n }\n }\n}\n\nfunction getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {\n var EventConstructor = this;\n\n if (EventConstructor.eventPool.length) {\n var instance = EventConstructor.eventPool.pop();\n EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);\n return instance;\n }\n\n return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);\n}\n\nfunction releasePooledEvent(event) {\n var EventConstructor = this;\n\n if (!(event instanceof EventConstructor)) {\n {\n throw Error( \"Trying to release an event instance into a pool of a different type.\" );\n }\n }\n\n event.destructor();\n\n if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {\n EventConstructor.eventPool.push(event);\n }\n}\n\nfunction addEventPoolingTo(EventConstructor) {\n EventConstructor.eventPool = [];\n EventConstructor.getPooled = getPooledEvent;\n EventConstructor.release = releasePooledEvent;\n}\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents\n */\n\nvar SyntheticCompositionEvent = SyntheticEvent.extend({\n data: null\n});\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105\n * /#events-inputevents\n */\n\nvar SyntheticInputEvent = SyntheticEvent.extend({\n data: null\n});\n\nvar END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space\n\nvar START_KEYCODE = 229;\nvar canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window;\nvar documentMode = null;\n\nif (canUseDOM && 'documentMode' in document) {\n documentMode = document.documentMode;\n} // Webkit offers a very useful `textInput` event that can be used to\n// directly represent `beforeInput`. The IE `textinput` event is not as\n// useful, so we don't use it.\n\n\nvar canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode; // In IE9+, we have access to composition events, but the data supplied\n// by the native compositionend event may be incorrect. Japanese ideographic\n// spaces, for instance (\\u3000) are not recorded correctly.\n\nvar useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);\nvar SPACEBAR_CODE = 32;\nvar SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); // Events and their corresponding property names.\n\nvar eventTypes = {\n beforeInput: {\n phasedRegistrationNames: {\n bubbled: 'onBeforeInput',\n captured: 'onBeforeInputCapture'\n },\n dependencies: [TOP_COMPOSITION_END, TOP_KEY_PRESS, TOP_TEXT_INPUT, TOP_PASTE]\n },\n compositionEnd: {\n phasedRegistrationNames: {\n bubbled: 'onCompositionEnd',\n captured: 'onCompositionEndCapture'\n },\n dependencies: [TOP_BLUR, TOP_COMPOSITION_END, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]\n },\n compositionStart: {\n phasedRegistrationNames: {\n bubbled: 'onCompositionStart',\n captured: 'onCompositionStartCapture'\n },\n dependencies: [TOP_BLUR, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]\n },\n compositionUpdate: {\n phasedRegistrationNames: {\n bubbled: 'onCompositionUpdate',\n captured: 'onCompositionUpdateCapture'\n },\n dependencies: [TOP_BLUR, TOP_COMPOSITION_UPDATE, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]\n }\n}; // Track whether we've ever handled a keypress on the space key.\n\nvar hasSpaceKeypress = false;\n/**\n * Return whether a native keypress event is assumed to be a command.\n * This is required because Firefox fires `keypress` events for key commands\n * (cut, copy, select-all, etc.) even though no character is inserted.\n */\n\nfunction isKeypressCommand(nativeEvent) {\n return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey);\n}\n/**\n * Translate native top level events into event types.\n *\n * @param {string} topLevelType\n * @return {object}\n */\n\n\nfunction getCompositionEventType(topLevelType) {\n switch (topLevelType) {\n case TOP_COMPOSITION_START:\n return eventTypes.compositionStart;\n\n case TOP_COMPOSITION_END:\n return eventTypes.compositionEnd;\n\n case TOP_COMPOSITION_UPDATE:\n return eventTypes.compositionUpdate;\n }\n}\n/**\n * Does our fallback best-guess model think this event signifies that\n * composition has begun?\n *\n * @param {string} topLevelType\n * @param {object} nativeEvent\n * @return {boolean}\n */\n\n\nfunction isFallbackCompositionStart(topLevelType, nativeEvent) {\n return topLevelType === TOP_KEY_DOWN && nativeEvent.keyCode === START_KEYCODE;\n}\n/**\n * Does our fallback mode think that this event is the end of composition?\n *\n * @param {string} topLevelType\n * @param {object} nativeEvent\n * @return {boolean}\n */\n\n\nfunction isFallbackCompositionEnd(topLevelType, nativeEvent) {\n switch (topLevelType) {\n case TOP_KEY_UP:\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case TOP_KEY_DOWN:\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case TOP_KEY_PRESS:\n case TOP_MOUSE_DOWN:\n case TOP_BLUR:\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n}\n/**\n * Google Input Tools provides composition data via a CustomEvent,\n * with the `data` property populated in the `detail` object. If this\n * is available on the event object, use it. If not, this is a plain\n * composition event and we have nothing special to extract.\n *\n * @param {object} nativeEvent\n * @return {?string}\n */\n\n\nfunction getDataFromCustomEvent(nativeEvent) {\n var detail = nativeEvent.detail;\n\n if (typeof detail === 'object' && 'data' in detail) {\n return detail.data;\n }\n\n return null;\n}\n/**\n * Check if a composition event was triggered by Korean IME.\n * Our fallback mode does not work well with IE's Korean IME,\n * so just use native composition events when Korean IME is used.\n * Although CompositionEvent.locale property is deprecated,\n * it is available in IE, where our fallback mode is enabled.\n *\n * @param {object} nativeEvent\n * @return {boolean}\n */\n\n\nfunction isUsingKoreanIME(nativeEvent) {\n return nativeEvent.locale === 'ko';\n} // Track the current IME composition status, if any.\n\n\nvar isComposing = false;\n/**\n * @return {?object} A SyntheticCompositionEvent.\n */\n\nfunction extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n var eventType;\n var fallbackData;\n\n if (canUseCompositionEvent) {\n eventType = getCompositionEventType(topLevelType);\n } else if (!isComposing) {\n if (isFallbackCompositionStart(topLevelType, nativeEvent)) {\n eventType = eventTypes.compositionStart;\n }\n } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {\n eventType = eventTypes.compositionEnd;\n }\n\n if (!eventType) {\n return null;\n }\n\n if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {\n // The current composition is stored statically and must not be\n // overwritten while composition continues.\n if (!isComposing && eventType === eventTypes.compositionStart) {\n isComposing = initialize(nativeEventTarget);\n } else if (eventType === eventTypes.compositionEnd) {\n if (isComposing) {\n fallbackData = getData();\n }\n }\n }\n\n var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);\n\n if (fallbackData) {\n // Inject data generated from fallback path into the synthetic event.\n // This matches the property of native CompositionEventInterface.\n event.data = fallbackData;\n } else {\n var customData = getDataFromCustomEvent(nativeEvent);\n\n if (customData !== null) {\n event.data = customData;\n }\n }\n\n accumulateTwoPhaseDispatches(event);\n return event;\n}\n/**\n * @param {TopLevelType} topLevelType Number from `TopLevelType`.\n * @param {object} nativeEvent Native browser event.\n * @return {?string} The string corresponding to this `beforeInput` event.\n */\n\n\nfunction getNativeBeforeInputChars(topLevelType, nativeEvent) {\n switch (topLevelType) {\n case TOP_COMPOSITION_END:\n return getDataFromCustomEvent(nativeEvent);\n\n case TOP_KEY_PRESS:\n /**\n * If native `textInput` events are available, our goal is to make\n * use of them. However, there is a special case: the spacebar key.\n * In Webkit, preventing default on a spacebar `textInput` event\n * cancels character insertion, but it *also* causes the browser\n * to fall back to its default spacebar behavior of scrolling the\n * page.\n *\n * Tracking at:\n * https://code.google.com/p/chromium/issues/detail?id=355103\n *\n * To avoid this issue, use the keypress event as if no `textInput`\n * event is available.\n */\n var which = nativeEvent.which;\n\n if (which !== SPACEBAR_CODE) {\n return null;\n }\n\n hasSpaceKeypress = true;\n return SPACEBAR_CHAR;\n\n case TOP_TEXT_INPUT:\n // Record the characters to be added to the DOM.\n var chars = nativeEvent.data; // If it's a spacebar character, assume that we have already handled\n // it at the keypress level and bail immediately. Android Chrome\n // doesn't give us keycodes, so we need to ignore it.\n\n if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {\n return null;\n }\n\n return chars;\n\n default:\n // For other native event types, do nothing.\n return null;\n }\n}\n/**\n * For browsers that do not provide the `textInput` event, extract the\n * appropriate string to use for SyntheticInputEvent.\n *\n * @param {number} topLevelType Number from `TopLevelEventTypes`.\n * @param {object} nativeEvent Native browser event.\n * @return {?string} The fallback string for this `beforeInput` event.\n */\n\n\nfunction getFallbackBeforeInputChars(topLevelType, nativeEvent) {\n // If we are currently composing (IME) and using a fallback to do so,\n // try to extract the composed characters from the fallback object.\n // If composition event is available, we extract a string only at\n // compositionevent, otherwise extract it at fallback events.\n if (isComposing) {\n if (topLevelType === TOP_COMPOSITION_END || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {\n var chars = getData();\n reset();\n isComposing = false;\n return chars;\n }\n\n return null;\n }\n\n switch (topLevelType) {\n case TOP_PASTE:\n // If a paste event occurs after a keypress, throw out the input\n // chars. Paste events should not lead to BeforeInput events.\n return null;\n\n case TOP_KEY_PRESS:\n /**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n */\n if (!isKeypressCommand(nativeEvent)) {\n // IE fires the `keypress` event when a user types an emoji via\n // Touch keyboard of Windows. In such a case, the `char` property\n // holds an emoji character like `\\uD83D\\uDE0A`. Because its length\n // is 2, the property `which` does not represent an emoji correctly.\n // In such a case, we directly return the `char` property instead of\n // using `which`.\n if (nativeEvent.char && nativeEvent.char.length > 1) {\n return nativeEvent.char;\n } else if (nativeEvent.which) {\n return String.fromCharCode(nativeEvent.which);\n }\n }\n\n return null;\n\n case TOP_COMPOSITION_END:\n return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;\n\n default:\n return null;\n }\n}\n/**\n * Extract a SyntheticInputEvent for `beforeInput`, based on either native\n * `textInput` or fallback behavior.\n *\n * @return {?object} A SyntheticInputEvent.\n */\n\n\nfunction extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n var chars;\n\n if (canUseTextInputEvent) {\n chars = getNativeBeforeInputChars(topLevelType, nativeEvent);\n } else {\n chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);\n } // If no characters are being inserted, no BeforeInput event should\n // be fired.\n\n\n if (!chars) {\n return null;\n }\n\n var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);\n event.data = chars;\n accumulateTwoPhaseDispatches(event);\n return event;\n}\n/**\n * Create an `onBeforeInput` event to match\n * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.\n *\n * This event plugin is based on the native `textInput` event\n * available in Chrome, Safari, Opera, and IE. This event fires after\n * `onKeyPress` and `onCompositionEnd`, but before `onInput`.\n *\n * `beforeInput` is spec'd but not implemented in any browsers, and\n * the `input` event does not provide any useful information about what has\n * actually been added, contrary to the spec. Thus, `textInput` is the best\n * available event to identify the characters that have actually been inserted\n * into the target node.\n *\n * This plugin is also responsible for emitting `composition` events, thus\n * allowing us to share composition fallback code for both `beforeInput` and\n * `composition` event types.\n */\n\n\nvar BeforeInputEventPlugin = {\n eventTypes: eventTypes,\n extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n var composition = extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);\n var beforeInput = extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);\n\n if (composition === null) {\n return beforeInput;\n }\n\n if (beforeInput === null) {\n return composition;\n }\n\n return [composition, beforeInput];\n }\n};\n\n/**\n * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary\n */\nvar supportedInputTypes = {\n color: true,\n date: true,\n datetime: true,\n 'datetime-local': true,\n email: true,\n month: true,\n number: true,\n password: true,\n range: true,\n search: true,\n tel: true,\n text: true,\n time: true,\n url: true,\n week: true\n};\n\nfunction isTextInputElement(elem) {\n var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n\n if (nodeName === 'input') {\n return !!supportedInputTypes[elem.type];\n }\n\n if (nodeName === 'textarea') {\n return true;\n }\n\n return false;\n}\n\nvar eventTypes$1 = {\n change: {\n phasedRegistrationNames: {\n bubbled: 'onChange',\n captured: 'onChangeCapture'\n },\n dependencies: [TOP_BLUR, TOP_CHANGE, TOP_CLICK, TOP_FOCUS, TOP_INPUT, TOP_KEY_DOWN, TOP_KEY_UP, TOP_SELECTION_CHANGE]\n }\n};\n\nfunction createAndAccumulateChangeEvent(inst, nativeEvent, target) {\n var event = SyntheticEvent.getPooled(eventTypes$1.change, inst, nativeEvent, target);\n event.type = 'change'; // Flag this event loop as needing state restore.\n\n enqueueStateRestore(target);\n accumulateTwoPhaseDispatches(event);\n return event;\n}\n/**\n * For IE shims\n */\n\n\nvar activeElement = null;\nvar activeElementInst = null;\n/**\n * SECTION: handle `change` event\n */\n\nfunction shouldUseChangeEvent(elem) {\n var nodeName = elem.nodeName && elem.nodeName.toLowerCase();\n return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';\n}\n\nfunction manualDispatchChangeEvent(nativeEvent) {\n var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent)); // If change and propertychange bubbled, we'd just bind to it like all the\n // other events and have it go through ReactBrowserEventEmitter. Since it\n // doesn't, we manually listen for the events and so we have to enqueue and\n // process the abstract event manually.\n //\n // Batching is necessary here in order to ensure that all event handlers run\n // before the next rerender (including event handlers attached to ancestor\n // elements instead of directly on the input). Without this, controlled\n // components don't work properly in conjunction with event bubbling because\n // the component is rerendered and the value reverted before all the event\n // handlers can run. See https://github.com/facebook/react/issues/708.\n\n batchedUpdates(runEventInBatch, event);\n}\n\nfunction runEventInBatch(event) {\n runEventsInBatch(event);\n}\n\nfunction getInstIfValueChanged(targetInst) {\n var targetNode = getNodeFromInstance$1(targetInst);\n\n if (updateValueIfChanged(targetNode)) {\n return targetInst;\n }\n}\n\nfunction getTargetInstForChangeEvent(topLevelType, targetInst) {\n if (topLevelType === TOP_CHANGE) {\n return targetInst;\n }\n}\n/**\n * SECTION: handle `input` event\n */\n\n\nvar isInputEventSupported = false;\n\nif (canUseDOM) {\n // IE9 claims to support the input event but fails to trigger it when\n // deleting text, so we ignore its input events.\n isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);\n}\n/**\n * (For IE <=9) Starts tracking propertychange events on the passed-in element\n * and override the value property so that we can distinguish user events from\n * value changes in JS.\n */\n\n\nfunction startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}\n/**\n * (For IE <=9) Removes the event listeners from the currently-tracked element,\n * if any exists.\n */\n\n\nfunction stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}\n/**\n * (For IE <=9) Handles a propertychange event, sending a `change` event if\n * the value of the active element has changed.\n */\n\n\nfunction handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}\n\nfunction handleEventsForInputEventPolyfill(topLevelType, target, targetInst) {\n if (topLevelType === TOP_FOCUS) {\n // In IE9, propertychange fires for most input events but is buggy and\n // doesn't fire when text is deleted, but conveniently, selectionchange\n // appears to fire in all of the remaining cases so we catch those and\n // forward the event if the value has changed\n // In either case, we don't want to call the event handler if the value\n // is changed from JS so we redefine a setter for `.value` that updates\n // our activeElementValue variable, allowing us to ignore those changes\n //\n // stopWatching() should be a noop here but we call it just in case we\n // missed a blur event somehow.\n stopWatchingForValueChange();\n startWatchingForValueChange(target, targetInst);\n } else if (topLevelType === TOP_BLUR) {\n stopWatchingForValueChange();\n }\n} // For IE8 and IE9.\n\n\nfunction getTargetInstForInputEventPolyfill(topLevelType, targetInst) {\n if (topLevelType === TOP_SELECTION_CHANGE || topLevelType === TOP_KEY_UP || topLevelType === TOP_KEY_DOWN) {\n // On the selectionchange event, the target is just document which isn't\n // helpful for us so just check activeElement instead.\n //\n // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire\n // propertychange on the first input event after setting `value` from a\n // script and fires only keydown, keypress, keyup. Catching keyup usually\n // gets it and catching keydown lets us fire an event for the first\n // keystroke if user does a key repeat (it'll be a little delayed: right\n // before the second keystroke). Other input methods (e.g., paste) seem to\n // fire selectionchange normally.\n return getInstIfValueChanged(activeElementInst);\n }\n}\n/**\n * SECTION: handle `click` event\n */\n\n\nfunction shouldUseClickEvent(elem) {\n // Use the `click` event to detect changes to checkbox and radio inputs.\n // This approach works across all browsers, whereas `change` does not fire\n // until `blur` in IE8.\n var nodeName = elem.nodeName;\n return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');\n}\n\nfunction getTargetInstForClickEvent(topLevelType, targetInst) {\n if (topLevelType === TOP_CLICK) {\n return getInstIfValueChanged(targetInst);\n }\n}\n\nfunction getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {\n if (topLevelType === TOP_INPUT || topLevelType === TOP_CHANGE) {\n return getInstIfValueChanged(targetInst);\n }\n}\n\nfunction handleControlledInputBlur(node) {\n var state = node._wrapperState;\n\n if (!state || !state.controlled || node.type !== 'number') {\n return;\n }\n\n {\n // If controlled, assign the value attribute to the current value on blur\n setDefaultValue(node, 'number', node.value);\n }\n}\n/**\n * This plugin creates an `onChange` event that normalizes change events\n * across form elements. This event fires at a time when it's possible to\n * change the element's value without seeing a flicker.\n *\n * Supported elements are:\n * - input (see `isTextInputElement`)\n * - textarea\n * - select\n */\n\n\nvar ChangeEventPlugin = {\n eventTypes: eventTypes$1,\n _isInputEventSupported: isInputEventSupported,\n extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;\n var getTargetInstFunc, handleEventFunc;\n\n if (shouldUseChangeEvent(targetNode)) {\n getTargetInstFunc = getTargetInstForChangeEvent;\n } else if (isTextInputElement(targetNode)) {\n if (isInputEventSupported) {\n getTargetInstFunc = getTargetInstForInputOrChangeEvent;\n } else {\n getTargetInstFunc = getTargetInstForInputEventPolyfill;\n handleEventFunc = handleEventsForInputEventPolyfill;\n }\n } else if (shouldUseClickEvent(targetNode)) {\n getTargetInstFunc = getTargetInstForClickEvent;\n }\n\n if (getTargetInstFunc) {\n var inst = getTargetInstFunc(topLevelType, targetInst);\n\n if (inst) {\n var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget);\n return event;\n }\n }\n\n if (handleEventFunc) {\n handleEventFunc(topLevelType, targetNode, targetInst);\n } // When blurring, set the value attribute for number inputs\n\n\n if (topLevelType === TOP_BLUR) {\n handleControlledInputBlur(targetNode);\n }\n }\n};\n\nvar SyntheticUIEvent = SyntheticEvent.extend({\n view: null,\n detail: null\n});\n\n/**\n * Translation from modifier key to the associated property in the event.\n * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers\n */\nvar modifierKeyToProp = {\n Alt: 'altKey',\n Control: 'ctrlKey',\n Meta: 'metaKey',\n Shift: 'shiftKey'\n}; // Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support\n// getModifierState. If getModifierState is not supported, we map it to a set of\n// modifier keys exposed by the event. In this case, Lock-keys are not supported.\n\nfunction modifierStateGetter(keyArg) {\n var syntheticEvent = this;\n var nativeEvent = syntheticEvent.nativeEvent;\n\n if (nativeEvent.getModifierState) {\n return nativeEvent.getModifierState(keyArg);\n }\n\n var keyProp = modifierKeyToProp[keyArg];\n return keyProp ? !!nativeEvent[keyProp] : false;\n}\n\nfunction getEventModifierState(nativeEvent) {\n return modifierStateGetter;\n}\n\nvar previousScreenX = 0;\nvar previousScreenY = 0; // Use flags to signal movementX/Y has already been set\n\nvar isMovementXSet = false;\nvar isMovementYSet = false;\n/**\n * @interface MouseEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar SyntheticMouseEvent = SyntheticUIEvent.extend({\n screenX: null,\n screenY: null,\n clientX: null,\n clientY: null,\n pageX: null,\n pageY: null,\n ctrlKey: null,\n shiftKey: null,\n altKey: null,\n metaKey: null,\n getModifierState: getEventModifierState,\n button: null,\n buttons: null,\n relatedTarget: function (event) {\n return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);\n },\n movementX: function (event) {\n if ('movementX' in event) {\n return event.movementX;\n }\n\n var screenX = previousScreenX;\n previousScreenX = event.screenX;\n\n if (!isMovementXSet) {\n isMovementXSet = true;\n return 0;\n }\n\n return event.type === 'mousemove' ? event.screenX - screenX : 0;\n },\n movementY: function (event) {\n if ('movementY' in event) {\n return event.movementY;\n }\n\n var screenY = previousScreenY;\n previousScreenY = event.screenY;\n\n if (!isMovementYSet) {\n isMovementYSet = true;\n return 0;\n }\n\n return event.type === 'mousemove' ? event.screenY - screenY : 0;\n }\n});\n\n/**\n * @interface PointerEvent\n * @see http://www.w3.org/TR/pointerevents/\n */\n\nvar SyntheticPointerEvent = SyntheticMouseEvent.extend({\n pointerId: null,\n width: null,\n height: null,\n pressure: null,\n tangentialPressure: null,\n tiltX: null,\n tiltY: null,\n twist: null,\n pointerType: null,\n isPrimary: null\n});\n\nvar eventTypes$2 = {\n mouseEnter: {\n registrationName: 'onMouseEnter',\n dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]\n },\n mouseLeave: {\n registrationName: 'onMouseLeave',\n dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]\n },\n pointerEnter: {\n registrationName: 'onPointerEnter',\n dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]\n },\n pointerLeave: {\n registrationName: 'onPointerLeave',\n dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]\n }\n};\nvar EnterLeaveEventPlugin = {\n eventTypes: eventTypes$2,\n\n /**\n * For almost every interaction we care about, there will be both a top-level\n * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that\n * we do not extract duplicate events. However, moving the mouse into the\n * browser from outside will not fire a `mouseout` event. In this case, we use\n * the `mouseover` top-level event.\n */\n extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n var isOverEvent = topLevelType === TOP_MOUSE_OVER || topLevelType === TOP_POINTER_OVER;\n var isOutEvent = topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_POINTER_OUT;\n\n if (isOverEvent && (eventSystemFlags & IS_REPLAYED) === 0 && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {\n // If this is an over event with a target, then we've already dispatched\n // the event in the out event of the other target. If this is replayed,\n // then it's because we couldn't dispatch against this target previously\n // so we have to do it now instead.\n return null;\n }\n\n if (!isOutEvent && !isOverEvent) {\n // Must not be a mouse or pointer in or out - ignoring.\n return null;\n }\n\n var win;\n\n if (nativeEventTarget.window === nativeEventTarget) {\n // `nativeEventTarget` is probably a window object.\n win = nativeEventTarget;\n } else {\n // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.\n var doc = nativeEventTarget.ownerDocument;\n\n if (doc) {\n win = doc.defaultView || doc.parentWindow;\n } else {\n win = window;\n }\n }\n\n var from;\n var to;\n\n if (isOutEvent) {\n from = targetInst;\n var related = nativeEvent.relatedTarget || nativeEvent.toElement;\n to = related ? getClosestInstanceFromNode(related) : null;\n\n if (to !== null) {\n var nearestMounted = getNearestMountedFiber(to);\n\n if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {\n to = null;\n }\n }\n } else {\n // Moving to a node from outside the window.\n from = null;\n to = targetInst;\n }\n\n if (from === to) {\n // Nothing pertains to our managed components.\n return null;\n }\n\n var eventInterface, leaveEventType, enterEventType, eventTypePrefix;\n\n if (topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_MOUSE_OVER) {\n eventInterface = SyntheticMouseEvent;\n leaveEventType = eventTypes$2.mouseLeave;\n enterEventType = eventTypes$2.mouseEnter;\n eventTypePrefix = 'mouse';\n } else if (topLevelType === TOP_POINTER_OUT || topLevelType === TOP_POINTER_OVER) {\n eventInterface = SyntheticPointerEvent;\n leaveEventType = eventTypes$2.pointerLeave;\n enterEventType = eventTypes$2.pointerEnter;\n eventTypePrefix = 'pointer';\n }\n\n var fromNode = from == null ? win : getNodeFromInstance$1(from);\n var toNode = to == null ? win : getNodeFromInstance$1(to);\n var leave = eventInterface.getPooled(leaveEventType, from, nativeEvent, nativeEventTarget);\n leave.type = eventTypePrefix + 'leave';\n leave.target = fromNode;\n leave.relatedTarget = toNode;\n var enter = eventInterface.getPooled(enterEventType, to, nativeEvent, nativeEventTarget);\n enter.type = eventTypePrefix + 'enter';\n enter.target = toNode;\n enter.relatedTarget = fromNode;\n accumulateEnterLeaveDispatches(leave, enter, from, to); // If we are not processing the first ancestor, then we\n // should not process the same nativeEvent again, as we\n // will have already processed it in the first ancestor.\n\n if ((eventSystemFlags & IS_FIRST_ANCESTOR) === 0) {\n return [leave];\n }\n\n return [leave, enter];\n }\n};\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 */\nfunction 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\nvar objectIs = typeof Object.is === 'function' ? Object.is : is;\n\nvar hasOwnProperty$2 = Object.prototype.hasOwnProperty;\n/**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * Returns true when the values of all keys are strictly equal.\n */\n\nfunction shallowEqual(objA, objB) {\n if (objectIs(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n } // Test for A's keys different from B.\n\n\n for (var i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty$2.call(objB, keysA[i]) || !objectIs(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n}\n\nvar skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11;\nvar eventTypes$3 = {\n select: {\n phasedRegistrationNames: {\n bubbled: 'onSelect',\n captured: 'onSelectCapture'\n },\n dependencies: [TOP_BLUR, TOP_CONTEXT_MENU, TOP_DRAG_END, TOP_FOCUS, TOP_KEY_DOWN, TOP_KEY_UP, TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_SELECTION_CHANGE]\n }\n};\nvar activeElement$1 = null;\nvar activeElementInst$1 = null;\nvar lastSelection = null;\nvar mouseDown = false;\n/**\n * Get an object which is a unique representation of the current selection.\n *\n * The return value will not be consistent across nodes or browsers, but\n * two identical selections on the same node will return identical objects.\n *\n * @param {DOMElement} node\n * @return {object}\n */\n\nfunction getSelection$1(node) {\n if ('selectionStart' in node && hasSelectionCapabilities(node)) {\n return {\n start: node.selectionStart,\n end: node.selectionEnd\n };\n } else {\n var win = node.ownerDocument && node.ownerDocument.defaultView || window;\n var selection = win.getSelection();\n return {\n anchorNode: selection.anchorNode,\n anchorOffset: selection.anchorOffset,\n focusNode: selection.focusNode,\n focusOffset: selection.focusOffset\n };\n }\n}\n/**\n * Get document associated with the event target.\n *\n * @param {object} nativeEventTarget\n * @return {Document}\n */\n\n\nfunction getEventTargetDocument(eventTarget) {\n return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;\n}\n/**\n * Poll selection to see whether it's changed.\n *\n * @param {object} nativeEvent\n * @param {object} nativeEventTarget\n * @return {?SyntheticEvent}\n */\n\n\nfunction constructSelectEvent(nativeEvent, nativeEventTarget) {\n // Ensure we have the right element, and that the user is not dragging a\n // selection (this matches native `select` event behavior). In HTML5, select\n // fires only on input and textarea thus if there's no focused element we\n // won't dispatch.\n var doc = getEventTargetDocument(nativeEventTarget);\n\n if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {\n return null;\n } // Only fire when selection has actually changed.\n\n\n var currentSelection = getSelection$1(activeElement$1);\n\n if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {\n lastSelection = currentSelection;\n var syntheticEvent = SyntheticEvent.getPooled(eventTypes$3.select, activeElementInst$1, nativeEvent, nativeEventTarget);\n syntheticEvent.type = 'select';\n syntheticEvent.target = activeElement$1;\n accumulateTwoPhaseDispatches(syntheticEvent);\n return syntheticEvent;\n }\n\n return null;\n}\n/**\n * This plugin creates an `onSelect` event that normalizes select events\n * across form elements.\n *\n * Supported elements are:\n * - input (see `isTextInputElement`)\n * - textarea\n * - contentEditable\n *\n * This differs from native browser implementations in the following ways:\n * - Fires on contentEditable fields as well as inputs.\n * - Fires for collapsed selection.\n * - Fires after user input.\n */\n\n\nvar SelectEventPlugin = {\n eventTypes: eventTypes$3,\n extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, container) {\n var containerOrDoc = container || getEventTargetDocument(nativeEventTarget); // Track whether all listeners exists for this plugin. If none exist, we do\n // not extract events. See #3639.\n\n if (!containerOrDoc || !isListeningToAllDependencies('onSelect', containerOrDoc)) {\n return null;\n }\n\n var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;\n\n switch (topLevelType) {\n // Track the input node that has focus.\n case TOP_FOCUS:\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n activeElement$1 = targetNode;\n activeElementInst$1 = targetInst;\n lastSelection = null;\n }\n\n break;\n\n case TOP_BLUR:\n activeElement$1 = null;\n activeElementInst$1 = null;\n lastSelection = null;\n break;\n // Don't fire the event while the user is dragging. This matches the\n // semantics of the native select event.\n\n case TOP_MOUSE_DOWN:\n mouseDown = true;\n break;\n\n case TOP_CONTEXT_MENU:\n case TOP_MOUSE_UP:\n case TOP_DRAG_END:\n mouseDown = false;\n return constructSelectEvent(nativeEvent, nativeEventTarget);\n // Chrome and IE fire non-standard event when selection is changed (and\n // sometimes when it hasn't). IE's event fires out of order with respect\n // to key and input events on deletion, so we discard it.\n //\n // Firefox doesn't support selectionchange, so check selection status\n // after each key entry. The selection changes after keydown and before\n // keyup, but we check on keydown as well in the case of holding down a\n // key, when multiple keydown events are fired but only one keyup is.\n // This is also our approach for IE handling, for the reason above.\n\n case TOP_SELECTION_CHANGE:\n if (skipSelectionChangeEvent) {\n break;\n }\n\n // falls through\n\n case TOP_KEY_DOWN:\n case TOP_KEY_UP:\n return constructSelectEvent(nativeEvent, nativeEventTarget);\n }\n\n return null;\n }\n};\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface\n * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent\n */\n\nvar SyntheticAnimationEvent = SyntheticEvent.extend({\n animationName: null,\n elapsedTime: null,\n pseudoElement: null\n});\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/clipboard-apis/\n */\n\nvar SyntheticClipboardEvent = SyntheticEvent.extend({\n clipboardData: function (event) {\n return 'clipboardData' in event ? event.clipboardData : window.clipboardData;\n }\n});\n\n/**\n * @interface FocusEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar SyntheticFocusEvent = SyntheticUIEvent.extend({\n relatedTarget: null\n});\n\n/**\n * `charCode` represents the actual \"character code\" and is safe to use with\n * `String.fromCharCode`. As such, only keys that correspond to printable\n * characters produce a valid `charCode`, the only exception to this is Enter.\n * The Tab-key is considered non-printable and does not have a `charCode`,\n * presumably because it does not produce a tab-character in browsers.\n *\n * @param {object} nativeEvent Native browser event.\n * @return {number} Normalized `charCode` property.\n */\nfunction getEventCharCode(nativeEvent) {\n var charCode;\n var keyCode = nativeEvent.keyCode;\n\n if ('charCode' in nativeEvent) {\n charCode = nativeEvent.charCode; // FF does not set `charCode` for the Enter-key, check against `keyCode`.\n\n if (charCode === 0 && keyCode === 13) {\n charCode = 13;\n }\n } else {\n // IE8 does not implement `charCode`, but `keyCode` has the correct value.\n charCode = keyCode;\n } // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux)\n // report Enter as charCode 10 when ctrl is pressed.\n\n\n if (charCode === 10) {\n charCode = 13;\n } // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.\n // Must not discard the (non-)printable Enter-key.\n\n\n if (charCode >= 32 || charCode === 13) {\n return charCode;\n }\n\n return 0;\n}\n\n/**\n * Normalization of deprecated HTML5 `key` values\n * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names\n */\n\nvar normalizeKey = {\n Esc: 'Escape',\n Spacebar: ' ',\n Left: 'ArrowLeft',\n Up: 'ArrowUp',\n Right: 'ArrowRight',\n Down: 'ArrowDown',\n Del: 'Delete',\n Win: 'OS',\n Menu: 'ContextMenu',\n Apps: 'ContextMenu',\n Scroll: 'ScrollLock',\n MozPrintableKey: 'Unidentified'\n};\n/**\n * Translation from legacy `keyCode` to HTML5 `key`\n * Only special keys supported, all others depend on keyboard layout or browser\n * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names\n */\n\nvar translateToKey = {\n '8': 'Backspace',\n '9': 'Tab',\n '12': 'Clear',\n '13': 'Enter',\n '16': 'Shift',\n '17': 'Control',\n '18': 'Alt',\n '19': 'Pause',\n '20': 'CapsLock',\n '27': 'Escape',\n '32': ' ',\n '33': 'PageUp',\n '34': 'PageDown',\n '35': 'End',\n '36': 'Home',\n '37': 'ArrowLeft',\n '38': 'ArrowUp',\n '39': 'ArrowRight',\n '40': 'ArrowDown',\n '45': 'Insert',\n '46': 'Delete',\n '112': 'F1',\n '113': 'F2',\n '114': 'F3',\n '115': 'F4',\n '116': 'F5',\n '117': 'F6',\n '118': 'F7',\n '119': 'F8',\n '120': 'F9',\n '121': 'F10',\n '122': 'F11',\n '123': 'F12',\n '144': 'NumLock',\n '145': 'ScrollLock',\n '224': 'Meta'\n};\n/**\n * @param {object} nativeEvent Native browser event.\n * @return {string} Normalized `key` property.\n */\n\nfunction getEventKey(nativeEvent) {\n if (nativeEvent.key) {\n // Normalize inconsistent values reported by browsers due to\n // implementations of a working draft specification.\n // FireFox implements `key` but returns `MozPrintableKey` for all\n // printable characters (normalized to `Unidentified`), ignore it.\n var key = normalizeKey[nativeEvent.key] || nativeEvent.key;\n\n if (key !== 'Unidentified') {\n return key;\n }\n } // Browser does not implement `key`, polyfill as much of it as we can.\n\n\n if (nativeEvent.type === 'keypress') {\n var charCode = getEventCharCode(nativeEvent); // The enter-key is technically both printable and non-printable and can\n // thus be captured by `keypress`, no other non-printable key should.\n\n return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);\n }\n\n if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {\n // While user keyboard layout determines the actual meaning of each\n // `keyCode` value, almost all function keys have a universal value.\n return translateToKey[nativeEvent.keyCode] || 'Unidentified';\n }\n\n return '';\n}\n\n/**\n * @interface KeyboardEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar SyntheticKeyboardEvent = SyntheticUIEvent.extend({\n key: getEventKey,\n location: null,\n ctrlKey: null,\n shiftKey: null,\n altKey: null,\n metaKey: null,\n repeat: null,\n locale: null,\n getModifierState: getEventModifierState,\n // Legacy Interface\n charCode: function (event) {\n // `charCode` is the result of a KeyPress event and represents the value of\n // the actual printable character.\n // KeyPress is deprecated, but its replacement is not yet final and not\n // implemented in any major browser. Only KeyPress has charCode.\n if (event.type === 'keypress') {\n return getEventCharCode(event);\n }\n\n return 0;\n },\n keyCode: function (event) {\n // `keyCode` is the result of a KeyDown/Up event and represents the value of\n // physical keyboard key.\n // The actual meaning of the value depends on the users' keyboard layout\n // which cannot be detected. Assuming that it is a US keyboard layout\n // provides a surprisingly accurate mapping for US and European users.\n // Due to this, it is left to the user to implement at this time.\n if (event.type === 'keydown' || event.type === 'keyup') {\n return event.keyCode;\n }\n\n return 0;\n },\n which: function (event) {\n // `which` is an alias for either `keyCode` or `charCode` depending on the\n // type of the event.\n if (event.type === 'keypress') {\n return getEventCharCode(event);\n }\n\n if (event.type === 'keydown' || event.type === 'keyup') {\n return event.keyCode;\n }\n\n return 0;\n }\n});\n\n/**\n * @interface DragEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar SyntheticDragEvent = SyntheticMouseEvent.extend({\n dataTransfer: null\n});\n\n/**\n * @interface TouchEvent\n * @see http://www.w3.org/TR/touch-events/\n */\n\nvar SyntheticTouchEvent = SyntheticUIEvent.extend({\n touches: null,\n targetTouches: null,\n changedTouches: null,\n altKey: null,\n metaKey: null,\n ctrlKey: null,\n shiftKey: null,\n getModifierState: getEventModifierState\n});\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent\n */\n\nvar SyntheticTransitionEvent = SyntheticEvent.extend({\n propertyName: null,\n elapsedTime: null,\n pseudoElement: null\n});\n\n/**\n * @interface WheelEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar SyntheticWheelEvent = SyntheticMouseEvent.extend({\n deltaX: function (event) {\n return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).\n 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;\n },\n deltaY: function (event) {\n return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).\n 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).\n 'wheelDelta' in event ? -event.wheelDelta : 0;\n },\n deltaZ: null,\n // Browsers without \"deltaMode\" is reporting in raw wheel delta where one\n // notch on the scroll is always +/- 120, roughly equivalent to pixels.\n // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or\n // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.\n deltaMode: null\n});\n\nvar knownHTMLTopLevelTypes = [TOP_ABORT, TOP_CANCEL, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_CLOSE, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_INPUT, TOP_INVALID, TOP_LOAD, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_RESET, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUBMIT, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_TOGGLE, TOP_VOLUME_CHANGE, TOP_WAITING];\nvar SimpleEventPlugin = {\n // simpleEventPluginEventTypes gets populated from\n // the DOMEventProperties module.\n eventTypes: simpleEventPluginEventTypes,\n extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n var dispatchConfig = topLevelEventsToDispatchConfig.get(topLevelType);\n\n if (!dispatchConfig) {\n return null;\n }\n\n var EventConstructor;\n\n switch (topLevelType) {\n case TOP_KEY_PRESS:\n // Firefox creates a keypress event for function keys too. This removes\n // the unwanted keypress events. Enter is however both printable and\n // non-printable. One would expect Tab to be as well (but it isn't).\n if (getEventCharCode(nativeEvent) === 0) {\n return null;\n }\n\n /* falls through */\n\n case TOP_KEY_DOWN:\n case TOP_KEY_UP:\n EventConstructor = SyntheticKeyboardEvent;\n break;\n\n case TOP_BLUR:\n case TOP_FOCUS:\n EventConstructor = SyntheticFocusEvent;\n break;\n\n case TOP_CLICK:\n // Firefox creates a click event on right mouse clicks. This removes the\n // unwanted click events.\n if (nativeEvent.button === 2) {\n return null;\n }\n\n /* falls through */\n\n case TOP_AUX_CLICK:\n case TOP_DOUBLE_CLICK:\n case TOP_MOUSE_DOWN:\n case TOP_MOUSE_MOVE:\n case TOP_MOUSE_UP: // TODO: Disabled elements should not respond to mouse events\n\n /* falls through */\n\n case TOP_MOUSE_OUT:\n case TOP_MOUSE_OVER:\n case TOP_CONTEXT_MENU:\n EventConstructor = SyntheticMouseEvent;\n break;\n\n case TOP_DRAG:\n case TOP_DRAG_END:\n case TOP_DRAG_ENTER:\n case TOP_DRAG_EXIT:\n case TOP_DRAG_LEAVE:\n case TOP_DRAG_OVER:\n case TOP_DRAG_START:\n case TOP_DROP:\n EventConstructor = SyntheticDragEvent;\n break;\n\n case TOP_TOUCH_CANCEL:\n case TOP_TOUCH_END:\n case TOP_TOUCH_MOVE:\n case TOP_TOUCH_START:\n EventConstructor = SyntheticTouchEvent;\n break;\n\n case TOP_ANIMATION_END:\n case TOP_ANIMATION_ITERATION:\n case TOP_ANIMATION_START:\n EventConstructor = SyntheticAnimationEvent;\n break;\n\n case TOP_TRANSITION_END:\n EventConstructor = SyntheticTransitionEvent;\n break;\n\n case TOP_SCROLL:\n EventConstructor = SyntheticUIEvent;\n break;\n\n case TOP_WHEEL:\n EventConstructor = SyntheticWheelEvent;\n break;\n\n case TOP_COPY:\n case TOP_CUT:\n case TOP_PASTE:\n EventConstructor = SyntheticClipboardEvent;\n break;\n\n case TOP_GOT_POINTER_CAPTURE:\n case TOP_LOST_POINTER_CAPTURE:\n case TOP_POINTER_CANCEL:\n case TOP_POINTER_DOWN:\n case TOP_POINTER_MOVE:\n case TOP_POINTER_OUT:\n case TOP_POINTER_OVER:\n case TOP_POINTER_UP:\n EventConstructor = SyntheticPointerEvent;\n break;\n\n default:\n {\n if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) {\n error('SimpleEventPlugin: Unhandled event type, `%s`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType);\n }\n } // HTML Events\n // @see http://www.w3.org/TR/html5/index.html#events-0\n\n\n EventConstructor = SyntheticEvent;\n break;\n }\n\n var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);\n accumulateTwoPhaseDispatches(event);\n return event;\n }\n};\n\n/**\n * Specifies a deterministic ordering of `EventPlugin`s. A convenient way to\n * reason about plugins, without having to package every one of them. This\n * is better than having plugins be ordered in the same order that they\n * are injected because that ordering would be influenced by the packaging order.\n * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that\n * preventing default on events is convenient in `SimpleEventPlugin` handlers.\n */\n\nvar DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];\n/**\n * Inject modules for resolving DOM hierarchy and plugin ordering.\n */\n\ninjectEventPluginOrder(DOMEventPluginOrder);\nsetComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromNode$1, getNodeFromInstance$1);\n/**\n * Some important event plugins included by default (without having to require\n * them).\n */\n\ninjectEventPluginsByName({\n SimpleEventPlugin: SimpleEventPlugin,\n EnterLeaveEventPlugin: EnterLeaveEventPlugin,\n ChangeEventPlugin: ChangeEventPlugin,\n SelectEventPlugin: SelectEventPlugin,\n BeforeInputEventPlugin: BeforeInputEventPlugin\n});\n\n// Prefix measurements so that it's possible to filter them.\n// Longer prefixes are hard to read in DevTools.\nvar reactEmoji = \"\\u269B\";\nvar warningEmoji = \"\\u26D4\";\nvar supportsUserTiming = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function'; // Keep track of current fiber so that we know the path to unwind on pause.\n// TODO: this looks the same as nextUnitOfWork in scheduler. Can we unify them?\n\nvar currentFiber = null; // If we're in the middle of user code, which fiber and method is it?\n// Reusing `currentFiber` would be confusing for this because user code fiber\n// can change during commit phase too, but we don't need to unwind it (since\n// lifecycles in the commit phase don't resemble a tree).\n\nvar currentPhase = null;\nvar currentPhaseFiber = null; // Did lifecycle hook schedule an update? This is often a performance problem,\n// so we will keep track of it, and include it in the report.\n// Track commits caused by cascading updates.\n\nvar isCommitting = false;\nvar hasScheduledUpdateInCurrentCommit = false;\nvar hasScheduledUpdateInCurrentPhase = false;\nvar commitCountInCurrentWorkLoop = 0;\nvar effectCountInCurrentCommit = 0;\n// to avoid stretch the commit phase with measurement overhead.\n\nvar labelsInCurrentCommit = new Set();\n\nvar formatMarkName = function (markName) {\n return reactEmoji + \" \" + markName;\n};\n\nvar formatLabel = function (label, warning) {\n var prefix = warning ? warningEmoji + \" \" : reactEmoji + \" \";\n var suffix = warning ? \" Warning: \" + warning : '';\n return \"\" + prefix + label + suffix;\n};\n\nvar beginMark = function (markName) {\n performance.mark(formatMarkName(markName));\n};\n\nvar clearMark = function (markName) {\n performance.clearMarks(formatMarkName(markName));\n};\n\nvar endMark = function (label, markName, warning) {\n var formattedMarkName = formatMarkName(markName);\n var formattedLabel = formatLabel(label, warning);\n\n try {\n performance.measure(formattedLabel, formattedMarkName);\n } catch (err) {} // If previous mark was missing for some reason, this will throw.\n // This could only happen if React crashed in an unexpected place earlier.\n // Don't pile on with more errors.\n // Clear marks immediately to avoid growing buffer.\n\n\n performance.clearMarks(formattedMarkName);\n performance.clearMeasures(formattedLabel);\n};\n\nvar getFiberMarkName = function (label, debugID) {\n return label + \" (#\" + debugID + \")\";\n};\n\nvar getFiberLabel = function (componentName, isMounted, phase) {\n if (phase === null) {\n // These are composite component total time measurements.\n return componentName + \" [\" + (isMounted ? 'update' : 'mount') + \"]\";\n } else {\n // Composite component methods.\n return componentName + \".\" + phase;\n }\n};\n\nvar beginFiberMark = function (fiber, phase) {\n var componentName = getComponentName(fiber.type) || 'Unknown';\n var debugID = fiber._debugID;\n var isMounted = fiber.alternate !== null;\n var label = getFiberLabel(componentName, isMounted, phase);\n\n if (isCommitting && labelsInCurrentCommit.has(label)) {\n // During the commit phase, we don't show duplicate labels because\n // there is a fixed overhead for every measurement, and we don't\n // want to stretch the commit phase beyond necessary.\n return false;\n }\n\n labelsInCurrentCommit.add(label);\n var markName = getFiberMarkName(label, debugID);\n beginMark(markName);\n return true;\n};\n\nvar clearFiberMark = function (fiber, phase) {\n var componentName = getComponentName(fiber.type) || 'Unknown';\n var debugID = fiber._debugID;\n var isMounted = fiber.alternate !== null;\n var label = getFiberLabel(componentName, isMounted, phase);\n var markName = getFiberMarkName(label, debugID);\n clearMark(markName);\n};\n\nvar endFiberMark = function (fiber, phase, warning) {\n var componentName = getComponentName(fiber.type) || 'Unknown';\n var debugID = fiber._debugID;\n var isMounted = fiber.alternate !== null;\n var label = getFiberLabel(componentName, isMounted, phase);\n var markName = getFiberMarkName(label, debugID);\n endMark(label, markName, warning);\n};\n\nvar shouldIgnoreFiber = function (fiber) {\n // Host components should be skipped in the timeline.\n // We could check typeof fiber.type, but does this work with RN?\n switch (fiber.tag) {\n case HostRoot:\n case HostComponent:\n case HostText:\n case HostPortal:\n case Fragment:\n case ContextProvider:\n case ContextConsumer:\n case Mode:\n return true;\n\n default:\n return false;\n }\n};\n\nvar clearPendingPhaseMeasurement = function () {\n if (currentPhase !== null && currentPhaseFiber !== null) {\n clearFiberMark(currentPhaseFiber, currentPhase);\n }\n\n currentPhaseFiber = null;\n currentPhase = null;\n hasScheduledUpdateInCurrentPhase = false;\n};\n\nvar pauseTimers = function () {\n // Stops all currently active measurements so that they can be resumed\n // if we continue in a later deferred loop from the same unit of work.\n var fiber = currentFiber;\n\n while (fiber) {\n if (fiber._debugIsCurrentlyTiming) {\n endFiberMark(fiber, null, null);\n }\n\n fiber = fiber.return;\n }\n};\n\nvar resumeTimersRecursively = function (fiber) {\n if (fiber.return !== null) {\n resumeTimersRecursively(fiber.return);\n }\n\n if (fiber._debugIsCurrentlyTiming) {\n beginFiberMark(fiber, null);\n }\n};\n\nvar resumeTimers = function () {\n // Resumes all measurements that were active during the last deferred loop.\n if (currentFiber !== null) {\n resumeTimersRecursively(currentFiber);\n }\n};\n\nfunction recordEffect() {\n {\n effectCountInCurrentCommit++;\n }\n}\nfunction recordScheduleUpdate() {\n {\n if (isCommitting) {\n hasScheduledUpdateInCurrentCommit = true;\n }\n\n if (currentPhase !== null && currentPhase !== 'componentWillMount' && currentPhase !== 'componentWillReceiveProps') {\n hasScheduledUpdateInCurrentPhase = true;\n }\n }\n}\nfunction startWorkTimer(fiber) {\n {\n if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n return;\n } // If we pause, this is the fiber to unwind from.\n\n\n currentFiber = fiber;\n\n if (!beginFiberMark(fiber, null)) {\n return;\n }\n\n fiber._debugIsCurrentlyTiming = true;\n }\n}\nfunction cancelWorkTimer(fiber) {\n {\n if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n return;\n } // Remember we shouldn't complete measurement for this fiber.\n // Otherwise flamechart will be deep even for small updates.\n\n\n fiber._debugIsCurrentlyTiming = false;\n clearFiberMark(fiber, null);\n }\n}\nfunction stopWorkTimer(fiber) {\n {\n if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n return;\n } // If we pause, its parent is the fiber to unwind from.\n\n\n currentFiber = fiber.return;\n\n if (!fiber._debugIsCurrentlyTiming) {\n return;\n }\n\n fiber._debugIsCurrentlyTiming = false;\n endFiberMark(fiber, null, null);\n }\n}\nfunction stopFailedWorkTimer(fiber) {\n {\n if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n return;\n } // If we pause, its parent is the fiber to unwind from.\n\n\n currentFiber = fiber.return;\n\n if (!fiber._debugIsCurrentlyTiming) {\n return;\n }\n\n fiber._debugIsCurrentlyTiming = false;\n var warning = fiber.tag === SuspenseComponent ? 'Rendering was suspended' : 'An error was thrown inside this error boundary';\n endFiberMark(fiber, null, warning);\n }\n}\nfunction startPhaseTimer(fiber, phase) {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n clearPendingPhaseMeasurement();\n\n if (!beginFiberMark(fiber, phase)) {\n return;\n }\n\n currentPhaseFiber = fiber;\n currentPhase = phase;\n }\n}\nfunction stopPhaseTimer() {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n if (currentPhase !== null && currentPhaseFiber !== null) {\n var warning = hasScheduledUpdateInCurrentPhase ? 'Scheduled a cascading update' : null;\n endFiberMark(currentPhaseFiber, currentPhase, warning);\n }\n\n currentPhase = null;\n currentPhaseFiber = null;\n }\n}\nfunction startWorkLoopTimer(nextUnitOfWork) {\n {\n currentFiber = nextUnitOfWork;\n\n if (!supportsUserTiming) {\n return;\n }\n\n commitCountInCurrentWorkLoop = 0; // This is top level call.\n // Any other measurements are performed within.\n\n beginMark('(React Tree Reconciliation)'); // Resume any measurements that were in progress during the last loop.\n\n resumeTimers();\n }\n}\nfunction stopWorkLoopTimer(interruptedBy, didCompleteRoot) {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n var warning = null;\n\n if (interruptedBy !== null) {\n if (interruptedBy.tag === HostRoot) {\n warning = 'A top-level update interrupted the previous render';\n } else {\n var componentName = getComponentName(interruptedBy.type) || 'Unknown';\n warning = \"An update to \" + componentName + \" interrupted the previous render\";\n }\n } else if (commitCountInCurrentWorkLoop > 1) {\n warning = 'There were cascading updates';\n }\n\n commitCountInCurrentWorkLoop = 0;\n var label = didCompleteRoot ? '(React Tree Reconciliation: Completed Root)' : '(React Tree Reconciliation: Yielded)'; // Pause any measurements until the next loop.\n\n pauseTimers();\n endMark(label, '(React Tree Reconciliation)', warning);\n }\n}\nfunction startCommitTimer() {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n isCommitting = true;\n hasScheduledUpdateInCurrentCommit = false;\n labelsInCurrentCommit.clear();\n beginMark('(Committing Changes)');\n }\n}\nfunction stopCommitTimer() {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n var warning = null;\n\n if (hasScheduledUpdateInCurrentCommit) {\n warning = 'Lifecycle hook scheduled a cascading update';\n } else if (commitCountInCurrentWorkLoop > 0) {\n warning = 'Caused by a cascading update in earlier commit';\n }\n\n hasScheduledUpdateInCurrentCommit = false;\n commitCountInCurrentWorkLoop++;\n isCommitting = false;\n labelsInCurrentCommit.clear();\n endMark('(Committing Changes)', '(Committing Changes)', warning);\n }\n}\nfunction startCommitSnapshotEffectsTimer() {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n effectCountInCurrentCommit = 0;\n beginMark('(Committing Snapshot Effects)');\n }\n}\nfunction stopCommitSnapshotEffectsTimer() {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n var count = effectCountInCurrentCommit;\n effectCountInCurrentCommit = 0;\n endMark(\"(Committing Snapshot Effects: \" + count + \" Total)\", '(Committing Snapshot Effects)', null);\n }\n}\nfunction startCommitHostEffectsTimer() {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n effectCountInCurrentCommit = 0;\n beginMark('(Committing Host Effects)');\n }\n}\nfunction stopCommitHostEffectsTimer() {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n var count = effectCountInCurrentCommit;\n effectCountInCurrentCommit = 0;\n endMark(\"(Committing Host Effects: \" + count + \" Total)\", '(Committing Host Effects)', null);\n }\n}\nfunction startCommitLifeCyclesTimer() {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n effectCountInCurrentCommit = 0;\n beginMark('(Calling Lifecycle Methods)');\n }\n}\nfunction stopCommitLifeCyclesTimer() {\n {\n if (!supportsUserTiming) {\n return;\n }\n\n var count = effectCountInCurrentCommit;\n effectCountInCurrentCommit = 0;\n endMark(\"(Calling Lifecycle Methods: \" + count + \" Total)\", '(Calling Lifecycle Methods)', null);\n }\n}\n\nvar valueStack = [];\nvar fiberStack;\n\n{\n fiberStack = [];\n}\n\nvar index = -1;\n\nfunction createCursor(defaultValue) {\n return {\n current: defaultValue\n };\n}\n\nfunction pop(cursor, fiber) {\n if (index < 0) {\n {\n error('Unexpected pop.');\n }\n\n return;\n }\n\n {\n if (fiber !== fiberStack[index]) {\n error('Unexpected Fiber popped.');\n }\n }\n\n cursor.current = valueStack[index];\n valueStack[index] = null;\n\n {\n fiberStack[index] = null;\n }\n\n index--;\n}\n\nfunction push(cursor, value, fiber) {\n index++;\n valueStack[index] = cursor.current;\n\n {\n fiberStack[index] = fiber;\n }\n\n cursor.current = value;\n}\n\nvar warnedAboutMissingGetChildContext;\n\n{\n warnedAboutMissingGetChildContext = {};\n}\n\nvar emptyContextObject = {};\n\n{\n Object.freeze(emptyContextObject);\n} // A cursor to the current merged context object on the stack.\n\n\nvar contextStackCursor = createCursor(emptyContextObject); // A cursor to a boolean indicating whether the context has changed.\n\nvar didPerformWorkStackCursor = createCursor(false); // Keep track of the previous context object that was on the stack.\n// We use this to get access to the parent context after we have already\n// pushed the next context provider, and now need to merge their contexts.\n\nvar previousContext = emptyContextObject;\n\nfunction getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) {\n {\n if (didPushOwnContextIfProvider && isContextProvider(Component)) {\n // If the fiber is a context provider itself, when we read its context\n // we may have already pushed its own child context on the stack. A context\n // provider should not \"see\" its own child context. Therefore we read the\n // previous (parent) context instead for a context provider.\n return previousContext;\n }\n\n return contextStackCursor.current;\n }\n}\n\nfunction cacheContext(workInProgress, unmaskedContext, maskedContext) {\n {\n var instance = workInProgress.stateNode;\n instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;\n instance.__reactInternalMemoizedMaskedChildContext = maskedContext;\n }\n}\n\nfunction getMaskedContext(workInProgress, unmaskedContext) {\n {\n var type = workInProgress.type;\n var contextTypes = type.contextTypes;\n\n if (!contextTypes) {\n return emptyContextObject;\n } // Avoid recreating masked context unless unmasked context has changed.\n // Failing to do this will result in unnecessary calls to componentWillReceiveProps.\n // This may trigger infinite loops if componentWillReceiveProps calls setState.\n\n\n var instance = workInProgress.stateNode;\n\n if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {\n return instance.__reactInternalMemoizedMaskedChildContext;\n }\n\n var context = {};\n\n for (var key in contextTypes) {\n context[key] = unmaskedContext[key];\n }\n\n {\n var name = getComponentName(type) || 'Unknown';\n checkPropTypes(contextTypes, context, 'context', name, getCurrentFiberStackInDev);\n } // Cache unmasked context so we can avoid recreating masked context unless necessary.\n // Context is created before the class component is instantiated so check for instance.\n\n\n if (instance) {\n cacheContext(workInProgress, unmaskedContext, context);\n }\n\n return context;\n }\n}\n\nfunction hasContextChanged() {\n {\n return didPerformWorkStackCursor.current;\n }\n}\n\nfunction isContextProvider(type) {\n {\n var childContextTypes = type.childContextTypes;\n return childContextTypes !== null && childContextTypes !== undefined;\n }\n}\n\nfunction popContext(fiber) {\n {\n pop(didPerformWorkStackCursor, fiber);\n pop(contextStackCursor, fiber);\n }\n}\n\nfunction popTopLevelContextObject(fiber) {\n {\n pop(didPerformWorkStackCursor, fiber);\n pop(contextStackCursor, fiber);\n }\n}\n\nfunction pushTopLevelContextObject(fiber, context, didChange) {\n {\n if (!(contextStackCursor.current === emptyContextObject)) {\n {\n throw Error( \"Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n push(contextStackCursor, context, fiber);\n push(didPerformWorkStackCursor, didChange, fiber);\n }\n}\n\nfunction processChildContext(fiber, type, parentContext) {\n {\n var instance = fiber.stateNode;\n var childContextTypes = type.childContextTypes; // 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\n if (typeof instance.getChildContext !== 'function') {\n {\n var componentName = getComponentName(type) || 'Unknown';\n\n if (!warnedAboutMissingGetChildContext[componentName]) {\n warnedAboutMissingGetChildContext[componentName] = true;\n\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\n return parentContext;\n }\n\n var childContext;\n startPhaseTimer(fiber, 'getChildContext');\n childContext = instance.getChildContext();\n stopPhaseTimer();\n\n for (var contextKey in childContext) {\n if (!(contextKey in childContextTypes)) {\n {\n throw Error( (getComponentName(type) || 'Unknown') + \".getChildContext(): key \\\"\" + contextKey + \"\\\" is not defined in childContextTypes.\" );\n }\n }\n }\n\n {\n var name = getComponentName(type) || 'Unknown';\n checkPropTypes(childContextTypes, childContext, 'child context', name, // In practice, there is one case in which we won't get a stack. It's when\n // somebody calls unstable_renderSubtreeIntoContainer() and we process\n // context from the parent component instance. The stack will be missing\n // because it's outside of the reconciliation, and so the pointer has not\n // been set. This is rare and doesn't matter. We'll also remove that API.\n getCurrentFiberStackInDev);\n }\n\n return _assign({}, parentContext, {}, childContext);\n }\n}\n\nfunction pushContextProvider(workInProgress) {\n {\n var instance = workInProgress.stateNode; // We push the context as early as possible to ensure stack integrity.\n // If the instance does not exist yet, we will push null at first,\n // and replace it on the stack later when invalidating the context.\n\n var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject; // Remember the parent context so we can merge with it later.\n // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.\n\n previousContext = contextStackCursor.current;\n push(contextStackCursor, memoizedMergedChildContext, workInProgress);\n push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);\n return true;\n }\n}\n\nfunction invalidateContextProvider(workInProgress, type, didChange) {\n {\n var instance = workInProgress.stateNode;\n\n if (!instance) {\n {\n throw Error( \"Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n if (didChange) {\n // Merge parent and own context.\n // Skip this if we're not updating due to sCU.\n // This avoids unnecessarily recomputing memoized values.\n var mergedContext = processChildContext(workInProgress, type, previousContext);\n instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one.\n // It is important to unwind the context in the reverse order.\n\n pop(didPerformWorkStackCursor, workInProgress);\n pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed.\n\n push(contextStackCursor, mergedContext, workInProgress);\n push(didPerformWorkStackCursor, didChange, workInProgress);\n } else {\n pop(didPerformWorkStackCursor, workInProgress);\n push(didPerformWorkStackCursor, didChange, workInProgress);\n }\n }\n}\n\nfunction findCurrentUnmaskedContext(fiber) {\n {\n // Currently this is only used with renderSubtreeIntoContainer; not sure if it\n // makes sense elsewhere\n if (!(isFiberMounted(fiber) && fiber.tag === ClassComponent)) {\n {\n throw Error( \"Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n var node = fiber;\n\n do {\n switch (node.tag) {\n case HostRoot:\n return node.stateNode.context;\n\n case ClassComponent:\n {\n var Component = node.type;\n\n if (isContextProvider(Component)) {\n return node.stateNode.__reactInternalMemoizedMergedChildContext;\n }\n\n break;\n }\n }\n\n node = node.return;\n } while (node !== null);\n\n {\n {\n throw Error( \"Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n }\n}\n\nvar LegacyRoot = 0;\nvar BlockingRoot = 1;\nvar ConcurrentRoot = 2;\n\nvar Scheduler_runWithPriority = Scheduler.unstable_runWithPriority,\n Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback,\n Scheduler_cancelCallback = Scheduler.unstable_cancelCallback,\n Scheduler_shouldYield = Scheduler.unstable_shouldYield,\n Scheduler_requestPaint = Scheduler.unstable_requestPaint,\n Scheduler_now = Scheduler.unstable_now,\n Scheduler_getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel,\n Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority,\n Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority,\n Scheduler_NormalPriority = Scheduler.unstable_NormalPriority,\n Scheduler_LowPriority = Scheduler.unstable_LowPriority,\n Scheduler_IdlePriority = Scheduler.unstable_IdlePriority;\n\n{\n // Provide explicit error message when production+profiling bundle of e.g.\n // react-dom is used with production (non-profiling) bundle of\n // scheduler/tracing\n if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {\n {\n throw Error( \"It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling\" );\n }\n }\n}\n\nvar fakeCallbackNode = {}; // Except for NoPriority, these correspond to Scheduler priorities. We use\n// ascending numbers so we can compare them like numbers. They start at 90 to\n// avoid clashing with Scheduler's priorities.\n\nvar ImmediatePriority = 99;\nvar UserBlockingPriority$1 = 98;\nvar NormalPriority = 97;\nvar LowPriority = 96;\nvar IdlePriority = 95; // NoPriority is the absence of priority. Also React-only.\n\nvar NoPriority = 90;\nvar shouldYield = Scheduler_shouldYield;\nvar requestPaint = // Fall back gracefully if we're running an older version of Scheduler.\nScheduler_requestPaint !== undefined ? Scheduler_requestPaint : function () {};\nvar syncQueue = null;\nvar immediateQueueCallbackNode = null;\nvar isFlushingSyncQueue = false;\nvar initialTimeMs = Scheduler_now(); // If the initial timestamp is reasonably small, use Scheduler's `now` directly.\n// This will be the case for modern browsers that support `performance.now`. In\n// older browsers, Scheduler falls back to `Date.now`, which returns a Unix\n// timestamp. In that case, subtract the module initialization time to simulate\n// the behavior of performance.now and keep our times small enough to fit\n// within 32 bits.\n// TODO: Consider lifting this into Scheduler.\n\nvar now = initialTimeMs < 10000 ? Scheduler_now : function () {\n return Scheduler_now() - initialTimeMs;\n};\nfunction getCurrentPriorityLevel() {\n switch (Scheduler_getCurrentPriorityLevel()) {\n case Scheduler_ImmediatePriority:\n return ImmediatePriority;\n\n case Scheduler_UserBlockingPriority:\n return UserBlockingPriority$1;\n\n case Scheduler_NormalPriority:\n return NormalPriority;\n\n case Scheduler_LowPriority:\n return LowPriority;\n\n case Scheduler_IdlePriority:\n return IdlePriority;\n\n default:\n {\n {\n throw Error( \"Unknown priority level.\" );\n }\n }\n\n }\n}\n\nfunction reactPriorityToSchedulerPriority(reactPriorityLevel) {\n switch (reactPriorityLevel) {\n case ImmediatePriority:\n return Scheduler_ImmediatePriority;\n\n case UserBlockingPriority$1:\n return Scheduler_UserBlockingPriority;\n\n case NormalPriority:\n return Scheduler_NormalPriority;\n\n case LowPriority:\n return Scheduler_LowPriority;\n\n case IdlePriority:\n return Scheduler_IdlePriority;\n\n default:\n {\n {\n throw Error( \"Unknown priority level.\" );\n }\n }\n\n }\n}\n\nfunction runWithPriority$1(reactPriorityLevel, fn) {\n var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);\n return Scheduler_runWithPriority(priorityLevel, fn);\n}\nfunction scheduleCallback(reactPriorityLevel, callback, options) {\n var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);\n return Scheduler_scheduleCallback(priorityLevel, callback, options);\n}\nfunction scheduleSyncCallback(callback) {\n // Push this callback into an internal queue. We'll flush these either in\n // the next tick, or earlier if something calls `flushSyncCallbackQueue`.\n if (syncQueue === null) {\n syncQueue = [callback]; // Flush the queue in the next tick, at the earliest.\n\n immediateQueueCallbackNode = Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueueImpl);\n } else {\n // Push onto existing queue. Don't need to schedule a callback because\n // we already scheduled one when we created the queue.\n syncQueue.push(callback);\n }\n\n return fakeCallbackNode;\n}\nfunction cancelCallback(callbackNode) {\n if (callbackNode !== fakeCallbackNode) {\n Scheduler_cancelCallback(callbackNode);\n }\n}\nfunction flushSyncCallbackQueue() {\n if (immediateQueueCallbackNode !== null) {\n var node = immediateQueueCallbackNode;\n immediateQueueCallbackNode = null;\n Scheduler_cancelCallback(node);\n }\n\n flushSyncCallbackQueueImpl();\n}\n\nfunction flushSyncCallbackQueueImpl() {\n if (!isFlushingSyncQueue && syncQueue !== null) {\n // Prevent re-entrancy.\n isFlushingSyncQueue = true;\n var i = 0;\n\n try {\n var _isSync = true;\n var queue = syncQueue;\n runWithPriority$1(ImmediatePriority, function () {\n for (; i < queue.length; i++) {\n var callback = queue[i];\n\n do {\n callback = callback(_isSync);\n } while (callback !== null);\n }\n });\n syncQueue = null;\n } catch (error) {\n // If something throws, leave the remaining callbacks on the queue.\n if (syncQueue !== null) {\n syncQueue = syncQueue.slice(i + 1);\n } // Resume flushing in the next tick\n\n\n Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueue);\n throw error;\n } finally {\n isFlushingSyncQueue = false;\n }\n }\n}\n\nvar NoMode = 0;\nvar StrictMode = 1; // TODO: Remove BlockingMode and ConcurrentMode by reading from the root\n// tag instead\n\nvar BlockingMode = 2;\nvar ConcurrentMode = 4;\nvar ProfileMode = 8;\n\n// Max 31 bit integer. The max integer size in V8 for 32-bit systems.\n// Math.pow(2, 30) - 1\n// 0b111111111111111111111111111111\nvar MAX_SIGNED_31_BIT_INT = 1073741823;\n\nvar NoWork = 0; // TODO: Think of a better name for Never. The key difference with Idle is that\n// Never work can be committed in an inconsistent state without tearing the UI.\n// The main example is offscreen content, like a hidden subtree. So one possible\n// name is Offscreen. However, it also includes dehydrated Suspense boundaries,\n// which are inconsistent in the sense that they haven't finished yet, but\n// aren't visibly inconsistent because the server rendered HTML matches what the\n// hydrated tree would look like.\n\nvar Never = 1; // Idle is slightly higher priority than Never. It must completely finish in\n// order to be consistent.\n\nvar Idle = 2; // Continuous Hydration is slightly higher than Idle and is used to increase\n// priority of hover targets.\n\nvar ContinuousHydration = 3;\nvar Sync = MAX_SIGNED_31_BIT_INT;\nvar Batched = Sync - 1;\nvar UNIT_SIZE = 10;\nvar MAGIC_NUMBER_OFFSET = Batched - 1; // 1 unit of expiration time represents 10ms.\n\nfunction msToExpirationTime(ms) {\n // Always subtract from the offset so that we don't clash with the magic number for NoWork.\n return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);\n}\nfunction expirationTimeToMs(expirationTime) {\n return (MAGIC_NUMBER_OFFSET - expirationTime) * UNIT_SIZE;\n}\n\nfunction ceiling(num, precision) {\n return ((num / precision | 0) + 1) * precision;\n}\n\nfunction computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) {\n return MAGIC_NUMBER_OFFSET - ceiling(MAGIC_NUMBER_OFFSET - currentTime + expirationInMs / UNIT_SIZE, bucketSizeMs / UNIT_SIZE);\n} // TODO: This corresponds to Scheduler's NormalPriority, not LowPriority. Update\n// the names to reflect.\n\n\nvar LOW_PRIORITY_EXPIRATION = 5000;\nvar LOW_PRIORITY_BATCH_SIZE = 250;\nfunction computeAsyncExpiration(currentTime) {\n return computeExpirationBucket(currentTime, LOW_PRIORITY_EXPIRATION, LOW_PRIORITY_BATCH_SIZE);\n}\nfunction computeSuspenseExpiration(currentTime, timeoutMs) {\n // TODO: Should we warn if timeoutMs is lower than the normal pri expiration time?\n return computeExpirationBucket(currentTime, timeoutMs, LOW_PRIORITY_BATCH_SIZE);\n} // We intentionally set a higher expiration time for interactive updates in\n// dev than in production.\n//\n// If the main thread is being blocked so long that you hit the expiration,\n// it's a problem that could be solved with better scheduling.\n//\n// People will be more likely to notice this and fix it with the long\n// expiration time in development.\n//\n// In production we opt for better UX at the risk of masking scheduling\n// problems, by expiring fast.\n\nvar HIGH_PRIORITY_EXPIRATION = 500 ;\nvar HIGH_PRIORITY_BATCH_SIZE = 100;\nfunction computeInteractiveExpiration(currentTime) {\n return computeExpirationBucket(currentTime, HIGH_PRIORITY_EXPIRATION, HIGH_PRIORITY_BATCH_SIZE);\n}\nfunction inferPriorityFromExpirationTime(currentTime, expirationTime) {\n if (expirationTime === Sync) {\n return ImmediatePriority;\n }\n\n if (expirationTime === Never || expirationTime === Idle) {\n return IdlePriority;\n }\n\n var msUntil = expirationTimeToMs(expirationTime) - expirationTimeToMs(currentTime);\n\n if (msUntil <= 0) {\n return ImmediatePriority;\n }\n\n if (msUntil <= HIGH_PRIORITY_EXPIRATION + HIGH_PRIORITY_BATCH_SIZE) {\n return UserBlockingPriority$1;\n }\n\n if (msUntil <= LOW_PRIORITY_EXPIRATION + LOW_PRIORITY_BATCH_SIZE) {\n return NormalPriority;\n } // TODO: Handle LowPriority\n // Assume anything lower has idle priority\n\n\n return IdlePriority;\n}\n\nvar ReactStrictModeWarnings = {\n recordUnsafeLifecycleWarnings: function (fiber, instance) {},\n flushPendingUnsafeLifecycleWarnings: function () {},\n recordLegacyContextWarning: function (fiber, instance) {},\n flushLegacyContextWarning: function () {},\n discardPendingWarnings: function () {}\n};\n\n{\n var findStrictRoot = function (fiber) {\n var maybeStrictRoot = null;\n var node = fiber;\n\n while (node !== null) {\n if (node.mode & StrictMode) {\n maybeStrictRoot = node;\n }\n\n node = node.return;\n }\n\n return maybeStrictRoot;\n };\n\n var setToSortedString = function (set) {\n var array = [];\n set.forEach(function (value) {\n array.push(value);\n });\n return array.sort().join(', ');\n };\n\n var pendingComponentWillMountWarnings = [];\n var pendingUNSAFE_ComponentWillMountWarnings = [];\n var pendingComponentWillReceivePropsWarnings = [];\n var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];\n var pendingComponentWillUpdateWarnings = [];\n var pendingUNSAFE_ComponentWillUpdateWarnings = []; // Tracks components we have already warned about.\n\n var didWarnAboutUnsafeLifecycles = new Set();\n\n ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) {\n // Dedup strategy: Warn once per component.\n if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {\n return;\n }\n\n if (typeof instance.componentWillMount === 'function' && // Don't warn about react-lifecycles-compat polyfilled components.\n instance.componentWillMount.__suppressDeprecationWarning !== true) {\n pendingComponentWillMountWarnings.push(fiber);\n }\n\n if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillMount === 'function') {\n pendingUNSAFE_ComponentWillMountWarnings.push(fiber);\n }\n\n if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {\n pendingComponentWillReceivePropsWarnings.push(fiber);\n }\n\n if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillReceiveProps === 'function') {\n pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);\n }\n\n if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {\n pendingComponentWillUpdateWarnings.push(fiber);\n }\n\n if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillUpdate === 'function') {\n pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);\n }\n };\n\n ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () {\n // We do an initial pass to gather component names\n var componentWillMountUniqueNames = new Set();\n\n if (pendingComponentWillMountWarnings.length > 0) {\n pendingComponentWillMountWarnings.forEach(function (fiber) {\n componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingComponentWillMountWarnings = [];\n }\n\n var UNSAFE_componentWillMountUniqueNames = new Set();\n\n if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {\n pendingUNSAFE_ComponentWillMountWarnings.forEach(function (fiber) {\n UNSAFE_componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingUNSAFE_ComponentWillMountWarnings = [];\n }\n\n var componentWillReceivePropsUniqueNames = new Set();\n\n if (pendingComponentWillReceivePropsWarnings.length > 0) {\n pendingComponentWillReceivePropsWarnings.forEach(function (fiber) {\n componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingComponentWillReceivePropsWarnings = [];\n }\n\n var UNSAFE_componentWillReceivePropsUniqueNames = new Set();\n\n if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {\n pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function (fiber) {\n UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingUNSAFE_ComponentWillReceivePropsWarnings = [];\n }\n\n var componentWillUpdateUniqueNames = new Set();\n\n if (pendingComponentWillUpdateWarnings.length > 0) {\n pendingComponentWillUpdateWarnings.forEach(function (fiber) {\n componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingComponentWillUpdateWarnings = [];\n }\n\n var UNSAFE_componentWillUpdateUniqueNames = new Set();\n\n if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {\n pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function (fiber) {\n UNSAFE_componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingUNSAFE_ComponentWillUpdateWarnings = [];\n } // Finally, we flush all the warnings\n // UNSAFE_ ones before the deprecated ones, since they'll be 'louder'\n\n\n if (UNSAFE_componentWillMountUniqueNames.size > 0) {\n var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);\n\n error('Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\\n\\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\\n' + '\\nPlease update the following components: %s', sortedNames);\n }\n\n if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {\n var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);\n\n error('Using UNSAFE_componentWillReceiveProps in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\\n\\n' + '* Move data fetching code or side effects to componentDidUpdate.\\n' + \"* If you're updating state whenever props change, \" + 'refactor your code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\\n' + '\\nPlease update the following components: %s', _sortedNames);\n }\n\n if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {\n var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);\n\n error('Using UNSAFE_componentWillUpdate in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\\n\\n' + '* Move data fetching code or side effects to componentDidUpdate.\\n' + '\\nPlease update the following components: %s', _sortedNames2);\n }\n\n if (componentWillMountUniqueNames.size > 0) {\n var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);\n\n warn('componentWillMount has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\\n\\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\\n' + '* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\\n' + '\\nPlease update the following components: %s', _sortedNames3);\n }\n\n if (componentWillReceivePropsUniqueNames.size > 0) {\n var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);\n\n warn('componentWillReceiveProps has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\\n\\n' + '* Move data fetching code or side effects to componentDidUpdate.\\n' + \"* If you're updating state whenever props change, refactor your \" + 'code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\\n' + '* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\\n' + '\\nPlease update the following components: %s', _sortedNames4);\n }\n\n if (componentWillUpdateUniqueNames.size > 0) {\n var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);\n\n warn('componentWillUpdate has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\\n\\n' + '* Move data fetching code or side effects to componentDidUpdate.\\n' + '* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\\n' + '\\nPlease update the following components: %s', _sortedNames5);\n }\n };\n\n var pendingLegacyContextWarning = new Map(); // Tracks components we have already warned about.\n\n var didWarnAboutLegacyContext = new Set();\n\n ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) {\n var strictRoot = findStrictRoot(fiber);\n\n if (strictRoot === null) {\n error('Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.');\n\n return;\n } // Dedup strategy: Warn once per component.\n\n\n if (didWarnAboutLegacyContext.has(fiber.type)) {\n return;\n }\n\n var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);\n\n if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === 'function') {\n if (warningsForRoot === undefined) {\n warningsForRoot = [];\n pendingLegacyContextWarning.set(strictRoot, warningsForRoot);\n }\n\n warningsForRoot.push(fiber);\n }\n };\n\n ReactStrictModeWarnings.flushLegacyContextWarning = function () {\n pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) {\n if (fiberArray.length === 0) {\n return;\n }\n\n var firstFiber = fiberArray[0];\n var uniqueNames = new Set();\n fiberArray.forEach(function (fiber) {\n uniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutLegacyContext.add(fiber.type);\n });\n var sortedNames = setToSortedString(uniqueNames);\n var firstComponentStack = getStackByFiberInDevAndProd(firstFiber);\n\n error('Legacy context API has been detected within a strict-mode tree.' + '\\n\\nThe old API will be supported in all 16.x releases, but applications ' + 'using it should migrate to the new version.' + '\\n\\nPlease update the following components: %s' + '\\n\\nLearn more about this warning here: https://fb.me/react-legacy-context' + '%s', sortedNames, firstComponentStack);\n });\n };\n\n ReactStrictModeWarnings.discardPendingWarnings = function () {\n pendingComponentWillMountWarnings = [];\n pendingUNSAFE_ComponentWillMountWarnings = [];\n pendingComponentWillReceivePropsWarnings = [];\n pendingUNSAFE_ComponentWillReceivePropsWarnings = [];\n pendingComponentWillUpdateWarnings = [];\n pendingUNSAFE_ComponentWillUpdateWarnings = [];\n pendingLegacyContextWarning = new Map();\n };\n}\n\nvar resolveFamily = null; // $FlowFixMe Flow gets confused by a WeakSet feature check below.\n\nvar failedBoundaries = null;\nvar setRefreshHandler = function (handler) {\n {\n resolveFamily = handler;\n }\n};\nfunction resolveFunctionForHotReloading(type) {\n {\n if (resolveFamily === null) {\n // Hot reloading is disabled.\n return type;\n }\n\n var family = resolveFamily(type);\n\n if (family === undefined) {\n return type;\n } // Use the latest known implementation.\n\n\n return family.current;\n }\n}\nfunction resolveClassForHotReloading(type) {\n // No implementation differences.\n return resolveFunctionForHotReloading(type);\n}\nfunction resolveForwardRefForHotReloading(type) {\n {\n if (resolveFamily === null) {\n // Hot reloading is disabled.\n return type;\n }\n\n var family = resolveFamily(type);\n\n if (family === undefined) {\n // Check if we're dealing with a real forwardRef. Don't want to crash early.\n if (type !== null && type !== undefined && typeof type.render === 'function') {\n // ForwardRef is special because its resolved .type is an object,\n // but it's possible that we only have its inner render function in the map.\n // If that inner render function is different, we'll build a new forwardRef type.\n var currentRender = resolveFunctionForHotReloading(type.render);\n\n if (type.render !== currentRender) {\n var syntheticType = {\n $$typeof: REACT_FORWARD_REF_TYPE,\n render: currentRender\n };\n\n if (type.displayName !== undefined) {\n syntheticType.displayName = type.displayName;\n }\n\n return syntheticType;\n }\n }\n\n return type;\n } // Use the latest known implementation.\n\n\n return family.current;\n }\n}\nfunction isCompatibleFamilyForHotReloading(fiber, element) {\n {\n if (resolveFamily === null) {\n // Hot reloading is disabled.\n return false;\n }\n\n var prevType = fiber.elementType;\n var nextType = element.type; // If we got here, we know types aren't === equal.\n\n var needsCompareFamilies = false;\n var $$typeofNextType = typeof nextType === 'object' && nextType !== null ? nextType.$$typeof : null;\n\n switch (fiber.tag) {\n case ClassComponent:\n {\n if (typeof nextType === 'function') {\n needsCompareFamilies = true;\n }\n\n break;\n }\n\n case FunctionComponent:\n {\n if (typeof nextType === 'function') {\n needsCompareFamilies = true;\n } else if ($$typeofNextType === REACT_LAZY_TYPE) {\n // We don't know the inner type yet.\n // We're going to assume that the lazy inner type is stable,\n // and so it is sufficient to avoid reconciling it away.\n // We're not going to unwrap or actually use the new lazy type.\n needsCompareFamilies = true;\n }\n\n break;\n }\n\n case ForwardRef:\n {\n if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {\n needsCompareFamilies = true;\n } else if ($$typeofNextType === REACT_LAZY_TYPE) {\n needsCompareFamilies = true;\n }\n\n break;\n }\n\n case MemoComponent:\n case SimpleMemoComponent:\n {\n if ($$typeofNextType === REACT_MEMO_TYPE) {\n // TODO: if it was but can no longer be simple,\n // we shouldn't set this.\n needsCompareFamilies = true;\n } else if ($$typeofNextType === REACT_LAZY_TYPE) {\n needsCompareFamilies = true;\n }\n\n break;\n }\n\n default:\n return false;\n } // Check if both types have a family and it's the same one.\n\n\n if (needsCompareFamilies) {\n // Note: memo() and forwardRef() we'll compare outer rather than inner type.\n // This means both of them need to be registered to preserve state.\n // If we unwrapped and compared the inner types for wrappers instead,\n // then we would risk falsely saying two separate memo(Foo)\n // calls are equivalent because they wrap the same Foo function.\n var prevFamily = resolveFamily(prevType);\n\n if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) {\n return true;\n }\n }\n\n return false;\n }\n}\nfunction markFailedErrorBoundaryForHotReloading(fiber) {\n {\n if (resolveFamily === null) {\n // Hot reloading is disabled.\n return;\n }\n\n if (typeof WeakSet !== 'function') {\n return;\n }\n\n if (failedBoundaries === null) {\n failedBoundaries = new WeakSet();\n }\n\n failedBoundaries.add(fiber);\n }\n}\nvar scheduleRefresh = function (root, update) {\n {\n if (resolveFamily === null) {\n // Hot reloading is disabled.\n return;\n }\n\n var staleFamilies = update.staleFamilies,\n updatedFamilies = update.updatedFamilies;\n flushPassiveEffects();\n flushSync(function () {\n scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies);\n });\n }\n};\nvar scheduleRoot = function (root, element) {\n {\n if (root.context !== emptyContextObject) {\n // Super edge case: root has a legacy _renderSubtree context\n // but we don't know the parentComponent so we can't pass it.\n // Just ignore. We'll delete this with _renderSubtree code path later.\n return;\n }\n\n flushPassiveEffects();\n syncUpdates(function () {\n updateContainer(element, root, null, null);\n });\n }\n};\n\nfunction scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {\n {\n var alternate = fiber.alternate,\n child = fiber.child,\n sibling = fiber.sibling,\n tag = fiber.tag,\n type = fiber.type;\n var candidateType = null;\n\n switch (tag) {\n case FunctionComponent:\n case SimpleMemoComponent:\n case ClassComponent:\n candidateType = type;\n break;\n\n case ForwardRef:\n candidateType = type.render;\n break;\n }\n\n if (resolveFamily === null) {\n throw new Error('Expected resolveFamily to be set during hot reload.');\n }\n\n var needsRender = false;\n var needsRemount = false;\n\n if (candidateType !== null) {\n var family = resolveFamily(candidateType);\n\n if (family !== undefined) {\n if (staleFamilies.has(family)) {\n needsRemount = true;\n } else if (updatedFamilies.has(family)) {\n if (tag === ClassComponent) {\n needsRemount = true;\n } else {\n needsRender = true;\n }\n }\n }\n }\n\n if (failedBoundaries !== null) {\n if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {\n needsRemount = true;\n }\n }\n\n if (needsRemount) {\n fiber._debugNeedsRemount = true;\n }\n\n if (needsRemount || needsRender) {\n scheduleWork(fiber, Sync);\n }\n\n if (child !== null && !needsRemount) {\n scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);\n }\n\n if (sibling !== null) {\n scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);\n }\n }\n}\n\nvar findHostInstancesForRefresh = function (root, families) {\n {\n var hostInstances = new Set();\n var types = new Set(families.map(function (family) {\n return family.current;\n }));\n findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances);\n return hostInstances;\n }\n};\n\nfunction findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {\n {\n var child = fiber.child,\n sibling = fiber.sibling,\n tag = fiber.tag,\n type = fiber.type;\n var candidateType = null;\n\n switch (tag) {\n case FunctionComponent:\n case SimpleMemoComponent:\n case ClassComponent:\n candidateType = type;\n break;\n\n case ForwardRef:\n candidateType = type.render;\n break;\n }\n\n var didMatch = false;\n\n if (candidateType !== null) {\n if (types.has(candidateType)) {\n didMatch = true;\n }\n }\n\n if (didMatch) {\n // We have a match. This only drills down to the closest host components.\n // There's no need to search deeper because for the purpose of giving\n // visual feedback, \"flashing\" outermost parent rectangles is sufficient.\n findHostInstancesForFiberShallowly(fiber, hostInstances);\n } else {\n // If there's no match, maybe there will be one further down in the child tree.\n if (child !== null) {\n findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);\n }\n }\n\n if (sibling !== null) {\n findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);\n }\n }\n}\n\nfunction findHostInstancesForFiberShallowly(fiber, hostInstances) {\n {\n var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);\n\n if (foundHostInstances) {\n return;\n } // If we didn't find any host children, fallback to closest host parent.\n\n\n var node = fiber;\n\n while (true) {\n switch (node.tag) {\n case HostComponent:\n hostInstances.add(node.stateNode);\n return;\n\n case HostPortal:\n hostInstances.add(node.stateNode.containerInfo);\n return;\n\n case HostRoot:\n hostInstances.add(node.stateNode.containerInfo);\n return;\n }\n\n if (node.return === null) {\n throw new Error('Expected to reach root first.');\n }\n\n node = node.return;\n }\n }\n}\n\nfunction findChildHostInstancesForFiberShallowly(fiber, hostInstances) {\n {\n var node = fiber;\n var foundHostInstances = false;\n\n while (true) {\n if (node.tag === HostComponent) {\n // We got a match.\n foundHostInstances = true;\n hostInstances.add(node.stateNode); // There may still be more, so keep searching.\n } else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === fiber) {\n return foundHostInstances;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === fiber) {\n return foundHostInstances;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n }\n\n return false;\n}\n\nfunction resolveDefaultProps(Component, baseProps) {\n if (Component && Component.defaultProps) {\n // Resolve default props. Taken from ReactElement\n var props = _assign({}, baseProps);\n\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}\nfunction readLazyComponentType(lazyComponent) {\n initializeLazyComponentType(lazyComponent);\n\n if (lazyComponent._status !== Resolved) {\n throw lazyComponent._result;\n }\n\n return lazyComponent._result;\n}\n\nvar valueCursor = createCursor(null);\nvar rendererSigil;\n\n{\n // Use this to detect multiple renderers using the same context\n rendererSigil = {};\n}\n\nvar currentlyRenderingFiber = null;\nvar lastContextDependency = null;\nvar lastContextWithAllBitsObserved = null;\nvar isDisallowedContextReadInDEV = false;\nfunction resetContextDependencies() {\n // This is called right before React yields execution, to ensure `readContext`\n // cannot be called outside the render phase.\n currentlyRenderingFiber = null;\n lastContextDependency = null;\n lastContextWithAllBitsObserved = null;\n\n {\n isDisallowedContextReadInDEV = false;\n }\n}\nfunction enterDisallowedContextReadInDEV() {\n {\n isDisallowedContextReadInDEV = true;\n }\n}\nfunction exitDisallowedContextReadInDEV() {\n {\n isDisallowedContextReadInDEV = false;\n }\n}\nfunction pushProvider(providerFiber, nextValue) {\n var context = providerFiber.type._context;\n\n {\n push(valueCursor, context._currentValue, providerFiber);\n context._currentValue = nextValue;\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}\nfunction popProvider(providerFiber) {\n var currentValue = valueCursor.current;\n pop(valueCursor, providerFiber);\n var context = providerFiber.type._context;\n\n {\n context._currentValue = currentValue;\n }\n}\nfunction calculateChangedBits(context, newValue, oldValue) {\n if (objectIs(oldValue, newValue)) {\n // No change\n return 0;\n } else {\n var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;\n\n {\n if ((changedBits & MAX_SIGNED_31_BIT_INT) !== changedBits) {\n error('calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits);\n }\n }\n\n return changedBits | 0;\n }\n}\nfunction scheduleWorkOnParentPath(parent, renderExpirationTime) {\n // Update the child expiration time of all the ancestors, including\n // the alternates.\n var node = parent;\n\n while (node !== null) {\n var alternate = node.alternate;\n\n if (node.childExpirationTime < renderExpirationTime) {\n node.childExpirationTime = renderExpirationTime;\n\n if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {\n alternate.childExpirationTime = renderExpirationTime;\n }\n } else if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {\n alternate.childExpirationTime = renderExpirationTime;\n } else {\n // Neither alternate was updated, which means the rest of the\n // ancestor path already has sufficient priority.\n break;\n }\n\n node = node.return;\n }\n}\nfunction propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) {\n var fiber = workInProgress.child;\n\n if (fiber !== null) {\n // Set the return pointer of the child to the work-in-progress fiber.\n fiber.return = workInProgress;\n }\n\n while (fiber !== null) {\n var nextFiber = void 0; // Visit this fiber.\n\n var list = fiber.dependencies;\n\n if (list !== null) {\n nextFiber = fiber.child;\n var dependency = list.firstContext;\n\n while (dependency !== null) {\n // Check if the context matches.\n if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) {\n // Match! Schedule an update on this fiber.\n if (fiber.tag === ClassComponent) {\n // Schedule a force update on the work-in-progress.\n var update = createUpdate(renderExpirationTime, null);\n update.tag = ForceUpdate; // TODO: Because we don't have a work-in-progress, this will add the\n // update to the current fiber, too, which means it will persist even if\n // this render is thrown away. Since it's a race condition, not sure it's\n // worth fixing.\n\n enqueueUpdate(fiber, update);\n }\n\n if (fiber.expirationTime < renderExpirationTime) {\n fiber.expirationTime = renderExpirationTime;\n }\n\n var alternate = fiber.alternate;\n\n if (alternate !== null && alternate.expirationTime < renderExpirationTime) {\n alternate.expirationTime = renderExpirationTime;\n }\n\n scheduleWorkOnParentPath(fiber.return, renderExpirationTime); // Mark the expiration time on the list, too.\n\n if (list.expirationTime < renderExpirationTime) {\n list.expirationTime = renderExpirationTime;\n } // Since we already found a match, we can stop traversing the\n // dependency list.\n\n\n break;\n }\n\n dependency = dependency.next;\n }\n } else if (fiber.tag === ContextProvider) {\n // Don't scan deeper if this is a matching provider\n nextFiber = fiber.type === workInProgress.type ? null : fiber.child;\n } else {\n // Traverse down.\n nextFiber = fiber.child;\n }\n\n if (nextFiber !== null) {\n // Set the return pointer of the child to the work-in-progress fiber.\n nextFiber.return = fiber;\n } else {\n // No child. Traverse to next sibling.\n nextFiber = fiber;\n\n while (nextFiber !== null) {\n if (nextFiber === workInProgress) {\n // We're back to the root of this subtree. Exit.\n nextFiber = null;\n break;\n }\n\n var sibling = nextFiber.sibling;\n\n if (sibling !== null) {\n // Set the return pointer of the sibling to the work-in-progress fiber.\n sibling.return = nextFiber.return;\n nextFiber = sibling;\n break;\n } // No more siblings. Traverse up.\n\n\n nextFiber = nextFiber.return;\n }\n }\n\n fiber = nextFiber;\n }\n}\nfunction prepareToReadContext(workInProgress, renderExpirationTime) {\n currentlyRenderingFiber = workInProgress;\n lastContextDependency = null;\n lastContextWithAllBitsObserved = null;\n var dependencies = workInProgress.dependencies;\n\n if (dependencies !== null) {\n var firstContext = dependencies.firstContext;\n\n if (firstContext !== null) {\n if (dependencies.expirationTime >= renderExpirationTime) {\n // Context list has a pending update. Mark that this fiber performed work.\n markWorkInProgressReceivedUpdate();\n } // Reset the work-in-progress list\n\n\n dependencies.firstContext = null;\n }\n }\n}\nfunction readContext(context, observedBits) {\n {\n // This warning would fire if you read context inside a Hook like useMemo.\n // Unlike the class check below, it's not enforced in production for perf.\n if (isDisallowedContextReadInDEV) {\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\n if (lastContextWithAllBitsObserved === context) ; else if (observedBits === false || observedBits === 0) ; else {\n var resolvedObservedBits; // Avoid deopting on observable arguments or heterogeneous types.\n\n if (typeof observedBits !== 'number' || observedBits === MAX_SIGNED_31_BIT_INT) {\n // Observe all updates.\n lastContextWithAllBitsObserved = context;\n resolvedObservedBits = MAX_SIGNED_31_BIT_INT;\n } else {\n resolvedObservedBits = observedBits;\n }\n\n var contextItem = {\n context: context,\n observedBits: resolvedObservedBits,\n next: null\n };\n\n if (lastContextDependency === null) {\n if (!(currentlyRenderingFiber !== null)) {\n {\n throw 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 } // This is the first dependency for this component. Create a new list.\n\n\n lastContextDependency = contextItem;\n currentlyRenderingFiber.dependencies = {\n expirationTime: NoWork,\n firstContext: contextItem,\n responders: null\n };\n } else {\n // Append a new context item.\n lastContextDependency = lastContextDependency.next = contextItem;\n }\n }\n\n return context._currentValue ;\n}\n\nvar UpdateState = 0;\nvar ReplaceState = 1;\nvar ForceUpdate = 2;\nvar CaptureUpdate = 3; // Global state that is reset at the beginning of calling `processUpdateQueue`.\n// It should only be read right after calling `processUpdateQueue`, via\n// `checkHasForceUpdateAfterProcessing`.\n\nvar hasForceUpdate = false;\nvar didWarnUpdateInsideUpdate;\nvar currentlyProcessingQueue;\n\n{\n didWarnUpdateInsideUpdate = false;\n currentlyProcessingQueue = null;\n}\n\nfunction initializeUpdateQueue(fiber) {\n var queue = {\n baseState: fiber.memoizedState,\n baseQueue: null,\n shared: {\n pending: null\n },\n effects: null\n };\n fiber.updateQueue = queue;\n}\nfunction cloneUpdateQueue(current, workInProgress) {\n // Clone the update queue from current. Unless it's already a clone.\n var queue = workInProgress.updateQueue;\n var currentQueue = current.updateQueue;\n\n if (queue === currentQueue) {\n var clone = {\n baseState: currentQueue.baseState,\n baseQueue: currentQueue.baseQueue,\n shared: currentQueue.shared,\n effects: currentQueue.effects\n };\n workInProgress.updateQueue = clone;\n }\n}\nfunction createUpdate(expirationTime, suspenseConfig) {\n var update = {\n expirationTime: expirationTime,\n suspenseConfig: suspenseConfig,\n tag: UpdateState,\n payload: null,\n callback: null,\n next: null\n };\n update.next = update;\n\n {\n update.priority = getCurrentPriorityLevel();\n }\n\n return update;\n}\nfunction enqueueUpdate(fiber, update) {\n var updateQueue = fiber.updateQueue;\n\n if (updateQueue === null) {\n // Only occurs if the fiber has been unmounted.\n return;\n }\n\n var sharedQueue = updateQueue.shared;\n var pending = sharedQueue.pending;\n\n if (pending === null) {\n // This is the first update. Create a circular list.\n update.next = update;\n } else {\n update.next = pending.next;\n pending.next = update;\n }\n\n sharedQueue.pending = update;\n\n {\n if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {\n error('An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.');\n\n didWarnUpdateInsideUpdate = true;\n }\n }\n}\nfunction enqueueCapturedUpdate(workInProgress, update) {\n var current = workInProgress.alternate;\n\n if (current !== null) {\n // Ensure the work-in-progress queue is a clone\n cloneUpdateQueue(current, workInProgress);\n } // Captured updates go only on the work-in-progress queue.\n\n\n var queue = workInProgress.updateQueue; // Append the update to the end of the list.\n\n var last = queue.baseQueue;\n\n if (last === null) {\n queue.baseQueue = update.next = update;\n update.next = update;\n } else {\n update.next = last.next;\n last.next = update;\n }\n}\n\nfunction getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) {\n switch (update.tag) {\n case ReplaceState:\n {\n var payload = update.payload;\n\n if (typeof payload === 'function') {\n // Updater function\n {\n enterDisallowedContextReadInDEV();\n\n if ( workInProgress.mode & StrictMode) {\n payload.call(instance, prevState, nextProps);\n }\n }\n\n var nextState = payload.call(instance, prevState, nextProps);\n\n {\n exitDisallowedContextReadInDEV();\n }\n\n return nextState;\n } // State object\n\n\n return payload;\n }\n\n case CaptureUpdate:\n {\n workInProgress.effectTag = workInProgress.effectTag & ~ShouldCapture | DidCapture;\n }\n // Intentional fallthrough\n\n case UpdateState:\n {\n var _payload = update.payload;\n var partialState;\n\n if (typeof _payload === 'function') {\n // Updater function\n {\n enterDisallowedContextReadInDEV();\n\n if ( workInProgress.mode & StrictMode) {\n _payload.call(instance, prevState, nextProps);\n }\n }\n\n partialState = _payload.call(instance, prevState, nextProps);\n\n {\n exitDisallowedContextReadInDEV();\n }\n } else {\n // Partial state object\n partialState = _payload;\n }\n\n if (partialState === null || partialState === undefined) {\n // Null and undefined are treated as no-ops.\n return prevState;\n } // Merge the partial state and the previous state.\n\n\n return _assign({}, prevState, partialState);\n }\n\n case ForceUpdate:\n {\n hasForceUpdate = true;\n return prevState;\n }\n }\n\n return prevState;\n}\n\nfunction processUpdateQueue(workInProgress, props, instance, renderExpirationTime) {\n // This is always non-null on a ClassComponent or HostRoot\n var queue = workInProgress.updateQueue;\n hasForceUpdate = false;\n\n {\n currentlyProcessingQueue = queue.shared;\n } // The last rebase update that is NOT part of the base state.\n\n\n var baseQueue = queue.baseQueue; // The last pending update that hasn't been processed yet.\n\n var pendingQueue = queue.shared.pending;\n\n if (pendingQueue !== null) {\n // We have new updates that haven't been processed yet.\n // We'll add them to the base queue.\n if (baseQueue !== null) {\n // Merge the pending queue and the base queue.\n var baseFirst = baseQueue.next;\n var pendingFirst = pendingQueue.next;\n baseQueue.next = pendingFirst;\n pendingQueue.next = baseFirst;\n }\n\n baseQueue = pendingQueue;\n queue.shared.pending = null; // TODO: Pass `current` as argument\n\n var current = workInProgress.alternate;\n\n if (current !== null) {\n var currentQueue = current.updateQueue;\n\n if (currentQueue !== null) {\n currentQueue.baseQueue = pendingQueue;\n }\n }\n } // These values may change as we process the queue.\n\n\n if (baseQueue !== null) {\n var first = baseQueue.next; // Iterate through the list of updates to compute the result.\n\n var newState = queue.baseState;\n var newExpirationTime = NoWork;\n var newBaseState = null;\n var newBaseQueueFirst = null;\n var newBaseQueueLast = null;\n\n if (first !== null) {\n var update = first;\n\n do {\n var updateExpirationTime = update.expirationTime;\n\n if (updateExpirationTime < renderExpirationTime) {\n // Priority is insufficient. Skip this update. If this is the first\n // skipped update, the previous update/state is the new base\n // update/state.\n var clone = {\n expirationTime: update.expirationTime,\n suspenseConfig: update.suspenseConfig,\n tag: update.tag,\n payload: update.payload,\n callback: update.callback,\n next: null\n };\n\n if (newBaseQueueLast === null) {\n newBaseQueueFirst = newBaseQueueLast = clone;\n newBaseState = newState;\n } else {\n newBaseQueueLast = newBaseQueueLast.next = clone;\n } // Update the remaining priority in the queue.\n\n\n if (updateExpirationTime > newExpirationTime) {\n newExpirationTime = updateExpirationTime;\n }\n } else {\n // This update does have sufficient priority.\n if (newBaseQueueLast !== null) {\n var _clone = {\n expirationTime: Sync,\n // This update is going to be committed so we never want uncommit it.\n suspenseConfig: update.suspenseConfig,\n tag: update.tag,\n payload: update.payload,\n callback: update.callback,\n next: null\n };\n newBaseQueueLast = newBaseQueueLast.next = _clone;\n } // Mark the event time of this update as relevant to this render pass.\n // TODO: This should ideally use the true event time of this update rather than\n // its priority which is a derived and not reverseable value.\n // TODO: We should skip this update if it was already committed but currently\n // we have no way of detecting the difference between a committed and suspended\n // update here.\n\n\n markRenderEventTimeAndConfig(updateExpirationTime, update.suspenseConfig); // Process this update.\n\n newState = getStateFromUpdate(workInProgress, queue, update, newState, props, instance);\n var callback = update.callback;\n\n if (callback !== null) {\n workInProgress.effectTag |= Callback;\n var effects = queue.effects;\n\n if (effects === null) {\n queue.effects = [update];\n } else {\n effects.push(update);\n }\n }\n }\n\n update = update.next;\n\n if (update === null || update === first) {\n pendingQueue = queue.shared.pending;\n\n if (pendingQueue === null) {\n break;\n } else {\n // An update was scheduled from inside a reducer. Add the new\n // pending updates to the end of the list and keep processing.\n update = baseQueue.next = pendingQueue.next;\n pendingQueue.next = first;\n queue.baseQueue = baseQueue = pendingQueue;\n queue.shared.pending = null;\n }\n }\n } while (true);\n }\n\n if (newBaseQueueLast === null) {\n newBaseState = newState;\n } else {\n newBaseQueueLast.next = newBaseQueueFirst;\n }\n\n queue.baseState = newBaseState;\n queue.baseQueue = newBaseQueueLast; // Set the remaining expiration time to be whatever is remaining in the queue.\n // This should be fine because the only two other things that contribute to\n // expiration time are props and context. We're already in the middle of the\n // begin phase by the time we start processing the queue, so we've already\n // dealt with the props. Context in components that specify\n // shouldComponentUpdate is tricky; but we'll have to account for\n // that regardless.\n\n markUnprocessedUpdateTime(newExpirationTime);\n workInProgress.expirationTime = newExpirationTime;\n workInProgress.memoizedState = newState;\n }\n\n {\n currentlyProcessingQueue = null;\n }\n}\n\nfunction callCallback(callback, context) {\n if (!(typeof callback === 'function')) {\n {\n throw Error( \"Invalid argument passed as callback. Expected a function. Instead received: \" + callback );\n }\n }\n\n callback.call(context);\n}\n\nfunction resetHasForceUpdateBeforeProcessing() {\n hasForceUpdate = false;\n}\nfunction checkHasForceUpdateAfterProcessing() {\n return hasForceUpdate;\n}\nfunction commitUpdateQueue(finishedWork, finishedQueue, instance) {\n // Commit the effects\n var effects = finishedQueue.effects;\n finishedQueue.effects = null;\n\n if (effects !== null) {\n for (var i = 0; i < effects.length; i++) {\n var effect = effects[i];\n var callback = effect.callback;\n\n if (callback !== null) {\n effect.callback = null;\n callCallback(callback, instance);\n }\n }\n }\n}\n\nvar ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;\nfunction requestCurrentSuspenseConfig() {\n return ReactCurrentBatchConfig.suspense;\n}\n\nvar fakeInternalInstance = {};\nvar isArray = Array.isArray; // React.Component uses a shared frozen object by default.\n// We'll use it to determine whether we need to initialize legacy refs.\n\nvar emptyRefsObject = new React.Component().refs;\nvar didWarnAboutStateAssignmentForComponent;\nvar didWarnAboutUninitializedState;\nvar didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;\nvar didWarnAboutLegacyLifecyclesAndDerivedState;\nvar didWarnAboutUndefinedDerivedState;\nvar warnOnUndefinedDerivedState;\nvar warnOnInvalidCallback;\nvar didWarnAboutDirectlyAssigningPropsToState;\nvar didWarnAboutContextTypeAndContextTypes;\nvar didWarnAboutInvalidateContextType;\n\n{\n didWarnAboutStateAssignmentForComponent = new Set();\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 (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\n error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);\n }\n };\n\n warnOnUndefinedDerivedState = function (type, partialState) {\n if (partialState === undefined) {\n var componentName = getComponentName(type) || 'Component';\n\n if (!didWarnAboutUndefinedDerivedState.has(componentName)) {\n didWarnAboutUndefinedDerivedState.add(componentName);\n\n error('%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName);\n }\n }\n }; // This is so gross but it's at least non-critical and can be removed if\n // it causes problems. This is meant to give a nicer error message for\n // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component,\n // ...)) which otherwise throws a \"_processChildContext is not a function\"\n // exception.\n\n\n Object.defineProperty(fakeInternalInstance, '_processChildContext', {\n enumerable: false,\n value: function () {\n {\n {\n throw Error( \"_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).\" );\n }\n }\n }\n });\n Object.freeze(fakeInternalInstance);\n}\n\nfunction applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) {\n var prevState = workInProgress.memoizedState;\n\n {\n if ( workInProgress.mode & StrictMode) {\n // Invoke the function an extra time to help detect side-effects.\n getDerivedStateFromProps(nextProps, prevState);\n }\n }\n\n var partialState = getDerivedStateFromProps(nextProps, prevState);\n\n {\n warnOnUndefinedDerivedState(ctor, partialState);\n } // Merge the partial state and the previous state.\n\n\n var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState);\n workInProgress.memoizedState = memoizedState; // Once the update queue is empty, persist the derived state onto the\n // base state.\n\n if (workInProgress.expirationTime === NoWork) {\n // Queue is always non-null for classes\n var updateQueue = workInProgress.updateQueue;\n updateQueue.baseState = memoizedState;\n }\n}\nvar classComponentUpdater = {\n isMounted: isMounted,\n enqueueSetState: function (inst, payload, callback) {\n var fiber = get(inst);\n var currentTime = requestCurrentTimeForUpdate();\n var suspenseConfig = requestCurrentSuspenseConfig();\n var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);\n var update = createUpdate(expirationTime, suspenseConfig);\n update.payload = payload;\n\n if (callback !== undefined && callback !== null) {\n {\n warnOnInvalidCallback(callback, 'setState');\n }\n\n update.callback = callback;\n }\n\n enqueueUpdate(fiber, update);\n scheduleWork(fiber, expirationTime);\n },\n enqueueReplaceState: function (inst, payload, callback) {\n var fiber = get(inst);\n var currentTime = requestCurrentTimeForUpdate();\n var suspenseConfig = requestCurrentSuspenseConfig();\n var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);\n var update = createUpdate(expirationTime, suspenseConfig);\n update.tag = ReplaceState;\n update.payload = payload;\n\n if (callback !== undefined && callback !== null) {\n {\n warnOnInvalidCallback(callback, 'replaceState');\n }\n\n update.callback = callback;\n }\n\n enqueueUpdate(fiber, update);\n scheduleWork(fiber, expirationTime);\n },\n enqueueForceUpdate: function (inst, callback) {\n var fiber = get(inst);\n var currentTime = requestCurrentTimeForUpdate();\n var suspenseConfig = requestCurrentSuspenseConfig();\n var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);\n var update = createUpdate(expirationTime, suspenseConfig);\n update.tag = ForceUpdate;\n\n if (callback !== undefined && callback !== null) {\n {\n warnOnInvalidCallback(callback, 'forceUpdate');\n }\n\n update.callback = callback;\n }\n\n enqueueUpdate(fiber, update);\n scheduleWork(fiber, expirationTime);\n }\n};\n\nfunction checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) {\n var instance = workInProgress.stateNode;\n\n if (typeof instance.shouldComponentUpdate === 'function') {\n {\n if ( workInProgress.mode & StrictMode) {\n // Invoke the function an extra time to help detect side-effects.\n instance.shouldComponentUpdate(newProps, newState, nextContext);\n }\n }\n\n startPhaseTimer(workInProgress, 'shouldComponentUpdate');\n var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);\n stopPhaseTimer();\n\n {\n if (shouldUpdate === undefined) {\n error('%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component');\n }\n }\n\n return shouldUpdate;\n }\n\n if (ctor.prototype && ctor.prototype.isPureReactComponent) {\n return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);\n }\n\n return true;\n}\n\nfunction checkClassInstance(workInProgress, ctor, newProps) {\n var instance = workInProgress.stateNode;\n\n {\n var name = getComponentName(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\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.', getComponentName(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\n error('%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(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\nfunction adoptClassInstance(workInProgress, instance) {\n instance.updater = classComponentUpdater;\n workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates\n\n set(instance, workInProgress);\n\n {\n instance._reactInternalInstance = fakeInternalInstance;\n }\n}\n\nfunction constructClassInstance(workInProgress, ctor, props) {\n var isLegacyContextConsumer = false;\n var unmaskedContext = emptyContextObject;\n var context = emptyContextObject;\n var contextType = ctor.contextType;\n\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 <Context.Consumer>\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 // <Context.Consumer>\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', getComponentName(ctor) || 'Component', addendum);\n }\n }\n }\n\n if (typeof contextType === 'object' && contextType !== null) {\n context = readContext(contextType);\n } else {\n unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n var contextTypes = ctor.contextTypes;\n isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined;\n context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject;\n } // Instantiate twice to help detect side-effects.\n\n\n {\n if ( workInProgress.mode & StrictMode) {\n new ctor(props, context); // eslint-disable-line no-new\n }\n }\n\n var instance = new ctor(props, context);\n var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null;\n adoptClassInstance(workInProgress, instance);\n\n {\n if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) {\n var componentName = getComponentName(ctor) || 'Component';\n\n if (!didWarnAboutUninitializedState.has(componentName)) {\n didWarnAboutUninitializedState.add(componentName);\n\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 = getComponentName(ctor) || 'Component';\n\n var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';\n\n if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {\n didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);\n\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://fb.me/react-unsafe-component-lifecycles', _componentName, newApiName, foundWillMountName !== null ? \"\\n \" + foundWillMountName : '', foundWillReceivePropsName !== null ? \"\\n \" + foundWillReceivePropsName : '', foundWillUpdateName !== null ? \"\\n \" + foundWillUpdateName : '');\n }\n }\n }\n } // Cache unmasked context so we can avoid recreating masked context unless necessary.\n // ReactFiberContext usually updates this cache but can't for newly-created instances.\n\n\n if (isLegacyContextConsumer) {\n cacheContext(workInProgress, unmaskedContext, context);\n }\n\n return instance;\n}\n\nfunction callComponentWillMount(workInProgress, instance) {\n startPhaseTimer(workInProgress, 'componentWillMount');\n var oldState = instance.state;\n\n if (typeof instance.componentWillMount === 'function') {\n instance.componentWillMount();\n }\n\n if (typeof instance.UNSAFE_componentWillMount === 'function') {\n instance.UNSAFE_componentWillMount();\n }\n\n stopPhaseTimer();\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.', getComponentName(workInProgress.type) || 'Component');\n }\n\n classComponentUpdater.enqueueReplaceState(instance, instance.state, null);\n }\n}\n\nfunction callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) {\n var oldState = instance.state;\n startPhaseTimer(workInProgress, 'componentWillReceiveProps');\n\n if (typeof instance.componentWillReceiveProps === 'function') {\n instance.componentWillReceiveProps(newProps, nextContext);\n }\n\n if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {\n instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);\n }\n\n stopPhaseTimer();\n\n if (instance.state !== oldState) {\n {\n var componentName = getComponentName(workInProgress.type) || 'Component';\n\n if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {\n didWarnAboutStateAssignmentForComponent.add(componentName);\n\n error('%s.componentWillReceiveProps(): Assigning directly to ' + \"this.state is deprecated (except inside a component's \" + 'constructor). Use setState instead.', componentName);\n }\n }\n\n classComponentUpdater.enqueueReplaceState(instance, instance.state, null);\n }\n} // Invokes the mount life-cycles on a previously never rendered instance.\n\n\nfunction mountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {\n {\n checkClassInstance(workInProgress, ctor, newProps);\n }\n\n var instance = workInProgress.stateNode;\n instance.props = newProps;\n instance.state = workInProgress.memoizedState;\n instance.refs = emptyRefsObject;\n initializeUpdateQueue(workInProgress);\n var contextType = ctor.contextType;\n\n if (typeof contextType === 'object' && contextType !== null) {\n instance.context = readContext(contextType);\n } else {\n var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n instance.context = getMaskedContext(workInProgress, unmaskedContext);\n }\n\n {\n if (instance.state === newProps) {\n var componentName = getComponentName(ctor) || 'Component';\n\n if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {\n didWarnAboutDirectlyAssigningPropsToState.add(componentName);\n\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 if (workInProgress.mode & StrictMode) {\n ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance);\n }\n\n {\n ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);\n }\n }\n\n processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);\n instance.state = workInProgress.memoizedState;\n var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n\n if (typeof getDerivedStateFromProps === 'function') {\n applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);\n instance.state = workInProgress.memoizedState;\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(workInProgress, instance); // If we had additional state updates during this life-cycle, let's\n // process them now.\n\n processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);\n instance.state = workInProgress.memoizedState;\n }\n\n if (typeof instance.componentDidMount === 'function') {\n workInProgress.effectTag |= Update;\n }\n}\n\nfunction resumeMountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {\n var instance = workInProgress.stateNode;\n var oldProps = workInProgress.memoizedProps;\n instance.props = oldProps;\n var oldContext = instance.context;\n var contextType = ctor.contextType;\n var nextContext = emptyContextObject;\n\n if (typeof contextType === 'object' && contextType !== null) {\n nextContext = readContext(contextType);\n } else {\n var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext);\n }\n\n var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what\n // ever the previously attempted to render - not the \"current\". However,\n // during componentDidUpdate we pass the \"current\" props.\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 if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {\n if (oldProps !== newProps || oldContext !== nextContext) {\n callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);\n }\n }\n\n resetHasForceUpdateBeforeProcessing();\n var oldState = workInProgress.memoizedState;\n var newState = instance.state = oldState;\n processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);\n newState = workInProgress.memoizedState;\n\n if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {\n // If an update was already in progress, we should schedule an Update\n // effect even though we're bailing out, so that cWU/cDU are called.\n if (typeof instance.componentDidMount === 'function') {\n workInProgress.effectTag |= Update;\n }\n\n return false;\n }\n\n if (typeof getDerivedStateFromProps === 'function') {\n applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);\n newState = workInProgress.memoizedState;\n }\n\n var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);\n\n if (shouldUpdate) {\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for components using the new APIs.\n if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {\n startPhaseTimer(workInProgress, 'componentWillMount');\n\n if (typeof instance.componentWillMount === 'function') {\n instance.componentWillMount();\n }\n\n if (typeof instance.UNSAFE_componentWillMount === 'function') {\n instance.UNSAFE_componentWillMount();\n }\n\n stopPhaseTimer();\n }\n\n if (typeof instance.componentDidMount === 'function') {\n workInProgress.effectTag |= Update;\n }\n } else {\n // If an update was already in progress, we should schedule an Update\n // effect even though we're bailing out, so that cWU/cDU are called.\n if (typeof instance.componentDidMount === 'function') {\n workInProgress.effectTag |= Update;\n } // If shouldComponentUpdate returned false, we should still update the\n // memoized state to indicate that this work can be reused.\n\n\n workInProgress.memoizedProps = newProps;\n workInProgress.memoizedState = newState;\n } // Update the existing instance's state, props, and context pointers even\n // if shouldComponentUpdate returns false.\n\n\n instance.props = newProps;\n instance.state = newState;\n instance.context = nextContext;\n return shouldUpdate;\n} // Invokes the update life-cycles and returns false if it shouldn't rerender.\n\n\nfunction updateClassInstance(current, workInProgress, ctor, newProps, renderExpirationTime) {\n var instance = workInProgress.stateNode;\n cloneUpdateQueue(current, workInProgress);\n var oldProps = workInProgress.memoizedProps;\n instance.props = workInProgress.type === workInProgress.elementType ? oldProps : resolveDefaultProps(workInProgress.type, oldProps);\n var oldContext = instance.context;\n var contextType = ctor.contextType;\n var nextContext = emptyContextObject;\n\n if (typeof contextType === 'object' && contextType !== null) {\n nextContext = readContext(contextType);\n } else {\n var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n nextContext = getMaskedContext(workInProgress, nextUnmaskedContext);\n }\n\n var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what\n // ever the previously attempted to render - not the \"current\". However,\n // during componentDidUpdate we pass the \"current\" props.\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 if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {\n if (oldProps !== newProps || oldContext !== nextContext) {\n callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);\n }\n }\n\n resetHasForceUpdateBeforeProcessing();\n var oldState = workInProgress.memoizedState;\n var newState = instance.state = oldState;\n processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);\n newState = workInProgress.memoizedState;\n\n if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {\n // If an update was already in progress, we should schedule an Update\n // effect even though we're bailing out, so that cWU/cDU are called.\n if (typeof instance.componentDidUpdate === 'function') {\n if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n workInProgress.effectTag |= Update;\n }\n }\n\n if (typeof instance.getSnapshotBeforeUpdate === 'function') {\n if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n workInProgress.effectTag |= Snapshot;\n }\n }\n\n return false;\n }\n\n if (typeof getDerivedStateFromProps === 'function') {\n applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);\n newState = workInProgress.memoizedState;\n }\n\n var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);\n\n if (shouldUpdate) {\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for components using the new APIs.\n if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) {\n startPhaseTimer(workInProgress, 'componentWillUpdate');\n\n if (typeof instance.componentWillUpdate === 'function') {\n instance.componentWillUpdate(newProps, newState, nextContext);\n }\n\n if (typeof instance.UNSAFE_componentWillUpdate === 'function') {\n instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);\n }\n\n stopPhaseTimer();\n }\n\n if (typeof instance.componentDidUpdate === 'function') {\n workInProgress.effectTag |= Update;\n }\n\n if (typeof instance.getSnapshotBeforeUpdate === 'function') {\n workInProgress.effectTag |= Snapshot;\n }\n } else {\n // If an update was already in progress, we should schedule an Update\n // effect even though we're bailing out, so that cWU/cDU are called.\n if (typeof instance.componentDidUpdate === 'function') {\n if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n workInProgress.effectTag |= Update;\n }\n }\n\n if (typeof instance.getSnapshotBeforeUpdate === 'function') {\n if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n workInProgress.effectTag |= Snapshot;\n }\n } // If shouldComponentUpdate returned false, we should still update the\n // memoized props/state to indicate that this work can be reused.\n\n\n workInProgress.memoizedProps = newProps;\n workInProgress.memoizedState = newState;\n } // Update the existing instance's state, props, and context pointers even\n // if shouldComponentUpdate returns false.\n\n\n instance.props = newProps;\n instance.state = newState;\n instance.context = nextContext;\n return shouldUpdate;\n}\n\nvar didWarnAboutMaps;\nvar didWarnAboutGenerators;\nvar didWarnAboutStringRefs;\nvar ownerHasKeyUseWarning;\nvar ownerHasFunctionTypeWarning;\n\nvar warnForMissingKey = function (child) {};\n\n{\n didWarnAboutMaps = false;\n didWarnAboutGenerators = false;\n didWarnAboutStringRefs = {};\n /**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n ownerHasKeyUseWarning = {};\n ownerHasFunctionTypeWarning = {};\n\n warnForMissingKey = function (child) {\n if (child === null || typeof child !== 'object') {\n return;\n }\n\n if (!child._store || child._store.validated || child.key != null) {\n return;\n }\n\n if (!(typeof child._store === 'object')) {\n {\n throw Error( \"React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n child._store.validated = true;\n var currentComponentErrorInfo = 'Each child in a list should have a unique ' + '\"key\" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + getCurrentFiberStackInDev();\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true;\n\n error('Each child in a list should have a unique ' + '\"key\" prop. See https://fb.me/react-warning-keys for ' + 'more information.');\n };\n}\n\nvar isArray$1 = Array.isArray;\n\nfunction coerceRef(returnFiber, current, element) {\n var mixedRef = element.ref;\n\n if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') {\n {\n // TODO: Clean this up once we turn on the string ref warning for\n // everyone, because the strict mode case will no longer be relevant\n if ((returnFiber.mode & StrictMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs\n // because these cannot be automatically converted to an arrow function\n // using a codemod. Therefore, we don't have to warn about string refs again.\n !(element._owner && element._self && element._owner.stateNode !== element._self)) {\n var componentName = getComponentName(returnFiber.type) || 'Component';\n\n if (!didWarnAboutStringRefs[componentName]) {\n {\n error('A string ref, \"%s\", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref%s', mixedRef, getStackByFiberInDevAndProd(returnFiber));\n }\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n\n if (element._owner) {\n var owner = element._owner;\n var inst;\n\n if (owner) {\n var ownerFiber = owner;\n\n if (!(ownerFiber.tag === ClassComponent)) {\n {\n throw Error( \"Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref\" );\n }\n }\n\n inst = ownerFiber.stateNode;\n }\n\n if (!inst) {\n {\n throw Error( \"Missing owner for string ref \" + mixedRef + \". This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n var stringRef = '' + mixedRef; // Check if previous string ref matches new string ref\n\n if (current !== null && current.ref !== null && typeof current.ref === 'function' && current.ref._stringRef === stringRef) {\n return current.ref;\n }\n\n var ref = function (value) {\n var refs = inst.refs;\n\n if (refs === emptyRefsObject) {\n // This is a lazy pooled frozen object, so we need to initialize.\n refs = inst.refs = {};\n }\n\n if (value === null) {\n delete refs[stringRef];\n } else {\n refs[stringRef] = value;\n }\n };\n\n ref._stringRef = stringRef;\n return ref;\n } else {\n if (!(typeof mixedRef === 'string')) {\n {\n throw Error( \"Expected ref to be a function, a string, an object returned by React.createRef(), or null.\" );\n }\n }\n\n if (!element._owner) {\n {\n throw Error( \"Element ref was specified as a string (\" + mixedRef + \") but no owner was set. This could happen for one of the following reasons:\\n1. You may be adding a ref to a function component\\n2. You may be adding a ref to a component that was not created inside a component's render method\\n3. You have multiple copies of React loaded\\nSee https://fb.me/react-refs-must-have-owner for more information.\" );\n }\n }\n }\n }\n\n return mixedRef;\n}\n\nfunction throwOnInvalidObjectType(returnFiber, newChild) {\n if (returnFiber.type !== 'textarea') {\n var addendum = '';\n\n {\n addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getCurrentFiberStackInDev();\n }\n\n {\n {\n throw Error( \"Objects are not valid as a React child (found: \" + (Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild) + \").\" + addendum );\n }\n }\n }\n}\n\nfunction warnOnFunctionType() {\n {\n var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.' + getCurrentFiberStackInDev();\n\n if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true;\n\n error('Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.');\n }\n} // This wrapper function exists because I expect to clone the code in each path\n// to be able to optimize each path individually by branching early. This needs\n// a compiler or we can do it manually. Helpers that don't need this branching\n// live outside of this function.\n\n\nfunction ChildReconciler(shouldTrackSideEffects) {\n function deleteChild(returnFiber, childToDelete) {\n if (!shouldTrackSideEffects) {\n // Noop.\n return;\n } // Deletions are added in reversed order so we add it to the front.\n // At this point, the return fiber's effect list is empty except for\n // deletions, so we can just append the deletion to the list. The remaining\n // effects aren't added until the complete phase. Once we implement\n // resuming, this may not be true.\n\n\n var last = returnFiber.lastEffect;\n\n if (last !== null) {\n last.nextEffect = childToDelete;\n returnFiber.lastEffect = childToDelete;\n } else {\n returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;\n }\n\n childToDelete.nextEffect = null;\n childToDelete.effectTag = Deletion;\n }\n\n function deleteRemainingChildren(returnFiber, currentFirstChild) {\n if (!shouldTrackSideEffects) {\n // Noop.\n return null;\n } // TODO: For the shouldClone case, this could be micro-optimized a bit by\n // assuming that after the first child we've already added everything.\n\n\n var childToDelete = currentFirstChild;\n\n while (childToDelete !== null) {\n deleteChild(returnFiber, childToDelete);\n childToDelete = childToDelete.sibling;\n }\n\n return null;\n }\n\n function mapRemainingChildren(returnFiber, currentFirstChild) {\n // Add the remaining children to a temporary map so that we can find them by\n // keys quickly. Implicit (null) keys get added to this set with their index\n // instead.\n var existingChildren = new Map();\n var existingChild = currentFirstChild;\n\n while (existingChild !== null) {\n if (existingChild.key !== null) {\n existingChildren.set(existingChild.key, existingChild);\n } else {\n existingChildren.set(existingChild.index, existingChild);\n }\n\n existingChild = existingChild.sibling;\n }\n\n return existingChildren;\n }\n\n function useFiber(fiber, pendingProps) {\n // We currently set sibling to null and index to 0 here because it is easy\n // to forget to do before returning it. E.g. for the single child case.\n var clone = createWorkInProgress(fiber, pendingProps);\n clone.index = 0;\n clone.sibling = null;\n return clone;\n }\n\n function placeChild(newFiber, lastPlacedIndex, newIndex) {\n newFiber.index = newIndex;\n\n if (!shouldTrackSideEffects) {\n // Noop.\n return lastPlacedIndex;\n }\n\n var current = newFiber.alternate;\n\n if (current !== null) {\n var oldIndex = current.index;\n\n if (oldIndex < lastPlacedIndex) {\n // This is a move.\n newFiber.effectTag = Placement;\n return lastPlacedIndex;\n } else {\n // This item can stay in place.\n return oldIndex;\n }\n } else {\n // This is an insertion.\n newFiber.effectTag = Placement;\n return lastPlacedIndex;\n }\n }\n\n function placeSingleChild(newFiber) {\n // This is simpler for the single child case. We only need to do a\n // placement for inserting new children.\n if (shouldTrackSideEffects && newFiber.alternate === null) {\n newFiber.effectTag = Placement;\n }\n\n return newFiber;\n }\n\n function updateTextNode(returnFiber, current, textContent, expirationTime) {\n if (current === null || current.tag !== HostText) {\n // Insert\n var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);\n created.return = returnFiber;\n return created;\n } else {\n // Update\n var existing = useFiber(current, textContent);\n existing.return = returnFiber;\n return existing;\n }\n }\n\n function updateElement(returnFiber, current, element, expirationTime) {\n if (current !== null) {\n if (current.elementType === element.type || ( // Keep this check inline so it only runs on the false path:\n isCompatibleFamilyForHotReloading(current, element) )) {\n // Move based on index\n var existing = useFiber(current, element.props);\n existing.ref = coerceRef(returnFiber, current, element);\n existing.return = returnFiber;\n\n {\n existing._debugSource = element._source;\n existing._debugOwner = element._owner;\n }\n\n return existing;\n }\n } // Insert\n\n\n var created = createFiberFromElement(element, returnFiber.mode, expirationTime);\n created.ref = coerceRef(returnFiber, current, element);\n created.return = returnFiber;\n return created;\n }\n\n function updatePortal(returnFiber, current, portal, expirationTime) {\n if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) {\n // Insert\n var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);\n created.return = returnFiber;\n return created;\n } else {\n // Update\n var existing = useFiber(current, portal.children || []);\n existing.return = returnFiber;\n return existing;\n }\n }\n\n function updateFragment(returnFiber, current, fragment, expirationTime, key) {\n if (current === null || current.tag !== Fragment) {\n // Insert\n var created = createFiberFromFragment(fragment, returnFiber.mode, expirationTime, key);\n created.return = returnFiber;\n return created;\n } else {\n // Update\n var existing = useFiber(current, fragment);\n existing.return = returnFiber;\n return existing;\n }\n }\n\n function createChild(returnFiber, newChild, expirationTime) {\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n // Text nodes don't have keys. If the previous node is implicitly keyed\n // we can continue to replace it without aborting even if it is not a text\n // node.\n var created = createFiberFromText('' + newChild, returnFiber.mode, expirationTime);\n created.return = returnFiber;\n return created;\n }\n\n if (typeof newChild === 'object' && newChild !== null) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n {\n var _created = createFiberFromElement(newChild, returnFiber.mode, expirationTime);\n\n _created.ref = coerceRef(returnFiber, null, newChild);\n _created.return = returnFiber;\n return _created;\n }\n\n case REACT_PORTAL_TYPE:\n {\n var _created2 = createFiberFromPortal(newChild, returnFiber.mode, expirationTime);\n\n _created2.return = returnFiber;\n return _created2;\n }\n }\n\n if (isArray$1(newChild) || getIteratorFn(newChild)) {\n var _created3 = createFiberFromFragment(newChild, returnFiber.mode, expirationTime, null);\n\n _created3.return = returnFiber;\n return _created3;\n }\n\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n return null;\n }\n\n function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {\n // Update the fiber if the keys match, otherwise return null.\n var key = oldFiber !== null ? oldFiber.key : null;\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n // Text nodes don't have keys. If the previous node is implicitly keyed\n // we can continue to replace it without aborting even if it is not a text\n // node.\n if (key !== null) {\n return null;\n }\n\n return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime);\n }\n\n if (typeof newChild === 'object' && newChild !== null) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n {\n if (newChild.key === key) {\n if (newChild.type === REACT_FRAGMENT_TYPE) {\n return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key);\n }\n\n return updateElement(returnFiber, oldFiber, newChild, expirationTime);\n } else {\n return null;\n }\n }\n\n case REACT_PORTAL_TYPE:\n {\n if (newChild.key === key) {\n return updatePortal(returnFiber, oldFiber, newChild, expirationTime);\n } else {\n return null;\n }\n }\n }\n\n if (isArray$1(newChild) || getIteratorFn(newChild)) {\n if (key !== null) {\n return null;\n }\n\n return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null);\n }\n\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n return null;\n }\n\n function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) {\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n // Text nodes don't have keys, so we neither have to check the old nor\n // new node for the key. If both are text nodes, they match.\n var matchedFiber = existingChildren.get(newIdx) || null;\n return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime);\n }\n\n if (typeof newChild === 'object' && newChild !== null) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n {\n var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;\n\n if (newChild.type === REACT_FRAGMENT_TYPE) {\n return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key);\n }\n\n return updateElement(returnFiber, _matchedFiber, newChild, expirationTime);\n }\n\n case REACT_PORTAL_TYPE:\n {\n var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;\n\n return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime);\n }\n }\n\n if (isArray$1(newChild) || getIteratorFn(newChild)) {\n var _matchedFiber3 = existingChildren.get(newIdx) || null;\n\n return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null);\n }\n\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n return null;\n }\n /**\n * Warns if there is a duplicate or missing key\n */\n\n\n function warnOnInvalidKey(child, knownKeys) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n }\n }\n\n return knownKeys;\n }\n\n function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) {\n // This algorithm can't optimize by searching from both ends since we\n // don't have backpointers on fibers. I'm trying to see how far we can get\n // with that model. If it ends up not being worth the tradeoffs, we can\n // add it later.\n // Even with a two ended optimization, we'd want to optimize for the case\n // where there are few changes and brute force the comparison instead of\n // going for the Map. It'd like to explore hitting that path first in\n // forward-only mode and only go for the Map once we notice that we need\n // lots of look ahead. This doesn't handle reversal as well as two ended\n // search but that's unusual. Besides, for the two ended optimization to\n // work on Iterables, we'd need to copy the whole set.\n // In this first iteration, we'll just live with hitting the bad case\n // (adding everything to a Map) in for every insert/move.\n // If you change this code, also update reconcileChildrenIterator() which\n // uses the same algorithm.\n {\n // First, validate keys.\n var knownKeys = null;\n\n for (var i = 0; i < newChildren.length; i++) {\n var child = newChildren[i];\n knownKeys = warnOnInvalidKey(child, knownKeys);\n }\n }\n\n var resultingFirstChild = null;\n var previousNewFiber = null;\n var oldFiber = currentFirstChild;\n var lastPlacedIndex = 0;\n var newIdx = 0;\n var nextOldFiber = null;\n\n for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {\n if (oldFiber.index > newIdx) {\n nextOldFiber = oldFiber;\n oldFiber = null;\n } else {\n nextOldFiber = oldFiber.sibling;\n }\n\n var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime);\n\n if (newFiber === null) {\n // TODO: This breaks on empty slots like null children. That's\n // unfortunate because it triggers the slow path all the time. We need\n // a better way to communicate whether this was a miss or null,\n // boolean, undefined, etc.\n if (oldFiber === null) {\n oldFiber = nextOldFiber;\n }\n\n break;\n }\n\n if (shouldTrackSideEffects) {\n if (oldFiber && newFiber.alternate === null) {\n // We matched the slot, but we didn't reuse the existing fiber, so we\n // need to delete the existing child.\n deleteChild(returnFiber, oldFiber);\n }\n }\n\n lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = newFiber;\n } else {\n // TODO: Defer siblings if we're not at the right index for this slot.\n // I.e. if we had null values before, then we want to defer this\n // for each null value. However, we also don't want to call updateSlot\n // with the previous one.\n previousNewFiber.sibling = newFiber;\n }\n\n previousNewFiber = newFiber;\n oldFiber = nextOldFiber;\n }\n\n if (newIdx === newChildren.length) {\n // We've reached the end of the new children. We can delete the rest.\n deleteRemainingChildren(returnFiber, oldFiber);\n return resultingFirstChild;\n }\n\n if (oldFiber === null) {\n // If we don't have any more existing children we can choose a fast path\n // since the rest will all be insertions.\n for (; newIdx < newChildren.length; newIdx++) {\n var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime);\n\n if (_newFiber === null) {\n continue;\n }\n\n lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = _newFiber;\n } else {\n previousNewFiber.sibling = _newFiber;\n }\n\n previousNewFiber = _newFiber;\n }\n\n return resultingFirstChild;\n } // Add all children to a key map for quick lookups.\n\n\n var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.\n\n for (; newIdx < newChildren.length; newIdx++) {\n var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime);\n\n if (_newFiber2 !== null) {\n if (shouldTrackSideEffects) {\n if (_newFiber2.alternate !== null) {\n // The new fiber is a work in progress, but if there exists a\n // current, that means that we reused the fiber. We need to delete\n // it from the child list so that we don't add it to the deletion\n // list.\n existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);\n }\n }\n\n lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n resultingFirstChild = _newFiber2;\n } else {\n previousNewFiber.sibling = _newFiber2;\n }\n\n previousNewFiber = _newFiber2;\n }\n }\n\n if (shouldTrackSideEffects) {\n // Any existing children that weren't consumed above were deleted. We need\n // to add them to the deletion list.\n existingChildren.forEach(function (child) {\n return deleteChild(returnFiber, child);\n });\n }\n\n return resultingFirstChild;\n }\n\n function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) {\n // This is the same implementation as reconcileChildrenArray(),\n // but using the iterator instead.\n var iteratorFn = getIteratorFn(newChildrenIterable);\n\n if (!(typeof iteratorFn === 'function')) {\n {\n throw Error( \"An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\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 newChildrenIterable[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 (newChildrenIterable.entries === iteratorFn) {\n if (!didWarnAboutMaps) {\n error('Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.');\n }\n\n didWarnAboutMaps = true;\n } // First, validate keys.\n // We'll get a different iterator later for the main pass.\n\n\n var _newChildren = iteratorFn.call(newChildrenIterable);\n\n if (_newChildren) {\n var knownKeys = null;\n\n var _step = _newChildren.next();\n\n for (; !_step.done; _step = _newChildren.next()) {\n var child = _step.value;\n knownKeys = warnOnInvalidKey(child, knownKeys);\n }\n }\n }\n\n var newChildren = iteratorFn.call(newChildrenIterable);\n\n if (!(newChildren != null)) {\n {\n throw Error( \"An iterable object provided no iterator.\" );\n }\n }\n\n var resultingFirstChild = null;\n var previousNewFiber = null;\n var oldFiber = currentFirstChild;\n var lastPlacedIndex = 0;\n var newIdx = 0;\n var nextOldFiber = null;\n var step = newChildren.next();\n\n for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {\n if (oldFiber.index > newIdx) {\n nextOldFiber = oldFiber;\n oldFiber = null;\n } else {\n nextOldFiber = oldFiber.sibling;\n }\n\n var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime);\n\n if (newFiber === null) {\n // TODO: This breaks on empty slots like null children. That's\n // unfortunate because it triggers the slow path all the time. We need\n // a better way to communicate whether this was a miss or null,\n // boolean, undefined, etc.\n if (oldFiber === null) {\n oldFiber = nextOldFiber;\n }\n\n break;\n }\n\n if (shouldTrackSideEffects) {\n if (oldFiber && newFiber.alternate === null) {\n // We matched the slot, but we didn't reuse the existing fiber, so we\n // need to delete the existing child.\n deleteChild(returnFiber, oldFiber);\n }\n }\n\n lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = newFiber;\n } else {\n // TODO: Defer siblings if we're not at the right index for this slot.\n // I.e. if we had null values before, then we want to defer this\n // for each null value. However, we also don't want to call updateSlot\n // with the previous one.\n previousNewFiber.sibling = newFiber;\n }\n\n previousNewFiber = newFiber;\n oldFiber = nextOldFiber;\n }\n\n if (step.done) {\n // We've reached the end of the new children. We can delete the rest.\n deleteRemainingChildren(returnFiber, oldFiber);\n return resultingFirstChild;\n }\n\n if (oldFiber === null) {\n // If we don't have any more existing children we can choose a fast path\n // since the rest will all be insertions.\n for (; !step.done; newIdx++, step = newChildren.next()) {\n var _newFiber3 = createChild(returnFiber, step.value, expirationTime);\n\n if (_newFiber3 === null) {\n continue;\n }\n\n lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = _newFiber3;\n } else {\n previousNewFiber.sibling = _newFiber3;\n }\n\n previousNewFiber = _newFiber3;\n }\n\n return resultingFirstChild;\n } // Add all children to a key map for quick lookups.\n\n\n var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.\n\n for (; !step.done; newIdx++, step = newChildren.next()) {\n var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime);\n\n if (_newFiber4 !== null) {\n if (shouldTrackSideEffects) {\n if (_newFiber4.alternate !== null) {\n // The new fiber is a work in progress, but if there exists a\n // current, that means that we reused the fiber. We need to delete\n // it from the child list so that we don't add it to the deletion\n // list.\n existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);\n }\n }\n\n lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n resultingFirstChild = _newFiber4;\n } else {\n previousNewFiber.sibling = _newFiber4;\n }\n\n previousNewFiber = _newFiber4;\n }\n }\n\n if (shouldTrackSideEffects) {\n // Any existing children that weren't consumed above were deleted. We need\n // to add them to the deletion list.\n existingChildren.forEach(function (child) {\n return deleteChild(returnFiber, child);\n });\n }\n\n return resultingFirstChild;\n }\n\n function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {\n // There's no need to check for keys on text nodes since we don't have a\n // way to define them.\n if (currentFirstChild !== null && currentFirstChild.tag === HostText) {\n // We already have an existing node so let's just update it and delete\n // the rest.\n deleteRemainingChildren(returnFiber, currentFirstChild.sibling);\n var existing = useFiber(currentFirstChild, textContent);\n existing.return = returnFiber;\n return existing;\n } // The existing first child is not a text node so we need to create one\n // and delete the existing ones.\n\n\n deleteRemainingChildren(returnFiber, currentFirstChild);\n var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);\n created.return = returnFiber;\n return created;\n }\n\n function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {\n var key = element.key;\n var child = currentFirstChild;\n\n while (child !== null) {\n // TODO: If key === null and child.key === null, then this only applies to\n // the first item in the list.\n if (child.key === key) {\n switch (child.tag) {\n case Fragment:\n {\n if (element.type === REACT_FRAGMENT_TYPE) {\n deleteRemainingChildren(returnFiber, child.sibling);\n var existing = useFiber(child, element.props.children);\n existing.return = returnFiber;\n\n {\n existing._debugSource = element._source;\n existing._debugOwner = element._owner;\n }\n\n return existing;\n }\n\n break;\n }\n\n case Block:\n\n // We intentionally fallthrough here if enableBlocksAPI is not on.\n // eslint-disable-next-lined no-fallthrough\n\n default:\n {\n if (child.elementType === element.type || ( // Keep this check inline so it only runs on the false path:\n isCompatibleFamilyForHotReloading(child, element) )) {\n deleteRemainingChildren(returnFiber, child.sibling);\n\n var _existing3 = useFiber(child, element.props);\n\n _existing3.ref = coerceRef(returnFiber, child, element);\n _existing3.return = returnFiber;\n\n {\n _existing3._debugSource = element._source;\n _existing3._debugOwner = element._owner;\n }\n\n return _existing3;\n }\n\n break;\n }\n } // Didn't match.\n\n\n deleteRemainingChildren(returnFiber, child);\n break;\n } else {\n deleteChild(returnFiber, child);\n }\n\n child = child.sibling;\n }\n\n if (element.type === REACT_FRAGMENT_TYPE) {\n var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key);\n created.return = returnFiber;\n return created;\n } else {\n var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime);\n\n _created4.ref = coerceRef(returnFiber, currentFirstChild, element);\n _created4.return = returnFiber;\n return _created4;\n }\n }\n\n function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {\n var key = portal.key;\n var child = currentFirstChild;\n\n while (child !== null) {\n // TODO: If key === null and child.key === null, then this only applies to\n // the first item in the list.\n if (child.key === key) {\n if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {\n deleteRemainingChildren(returnFiber, child.sibling);\n var existing = useFiber(child, portal.children || []);\n existing.return = returnFiber;\n return existing;\n } else {\n deleteRemainingChildren(returnFiber, child);\n break;\n }\n } else {\n deleteChild(returnFiber, child);\n }\n\n child = child.sibling;\n }\n\n var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);\n created.return = returnFiber;\n return created;\n } // This API will tag the children with the side-effect of the reconciliation\n // itself. They will be added to the side-effect list as we pass through the\n // children and the parent.\n\n\n function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }\n\n return reconcileChildFibers;\n}\n\nvar reconcileChildFibers = ChildReconciler(true);\nvar mountChildFibers = ChildReconciler(false);\nfunction cloneChildFibers(current, workInProgress) {\n if (!(current === null || workInProgress.child === current.child)) {\n {\n throw Error( \"Resuming work not yet implemented.\" );\n }\n }\n\n if (workInProgress.child === null) {\n return;\n }\n\n var currentChild = workInProgress.child;\n var newChild = createWorkInProgress(currentChild, currentChild.pendingProps);\n workInProgress.child = newChild;\n newChild.return = workInProgress;\n\n while (currentChild.sibling !== null) {\n currentChild = currentChild.sibling;\n newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps);\n newChild.return = workInProgress;\n }\n\n newChild.sibling = null;\n} // Reset a workInProgress child set to prepare it for a second pass.\n\nfunction resetChildFibers(workInProgress, renderExpirationTime) {\n var child = workInProgress.child;\n\n while (child !== null) {\n resetWorkInProgress(child, renderExpirationTime);\n child = child.sibling;\n }\n}\n\nvar NO_CONTEXT = {};\nvar contextStackCursor$1 = createCursor(NO_CONTEXT);\nvar contextFiberStackCursor = createCursor(NO_CONTEXT);\nvar rootInstanceStackCursor = createCursor(NO_CONTEXT);\n\nfunction requiredContext(c) {\n if (!(c !== NO_CONTEXT)) {\n {\n throw Error( \"Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n return c;\n}\n\nfunction getRootHostContainer() {\n var rootInstance = requiredContext(rootInstanceStackCursor.current);\n return rootInstance;\n}\n\nfunction pushHostContainer(fiber, nextRootInstance) {\n // Push current root instance onto the stack;\n // This allows us to reset root when portals are popped.\n push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it.\n // This enables us to pop only Fibers that provide unique contexts.\n\n push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack.\n // However, we can't just call getRootHostContext() and push it because\n // we'd have a different number of entries on the stack depending on\n // whether getRootHostContext() throws somewhere in renderer code or not.\n // So we push an empty value first. This lets us safely unwind on errors.\n\n push(contextStackCursor$1, NO_CONTEXT, fiber);\n var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it.\n\n pop(contextStackCursor$1, fiber);\n push(contextStackCursor$1, nextRootContext, fiber);\n}\n\nfunction popHostContainer(fiber) {\n pop(contextStackCursor$1, fiber);\n pop(contextFiberStackCursor, fiber);\n pop(rootInstanceStackCursor, fiber);\n}\n\nfunction getHostContext() {\n var context = requiredContext(contextStackCursor$1.current);\n return context;\n}\n\nfunction pushHostContext(fiber) {\n var rootInstance = requiredContext(rootInstanceStackCursor.current);\n var context = requiredContext(contextStackCursor$1.current);\n var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique.\n\n if (context === nextContext) {\n return;\n } // Track the context and the Fiber that provided it.\n // This enables us to pop only Fibers that provide unique contexts.\n\n\n push(contextFiberStackCursor, fiber, fiber);\n push(contextStackCursor$1, nextContext, fiber);\n}\n\nfunction popHostContext(fiber) {\n // Do not pop unless this Fiber provided the current context.\n // pushHostContext() only pushes Fibers that provide unique contexts.\n if (contextFiberStackCursor.current !== fiber) {\n return;\n }\n\n pop(contextStackCursor$1, fiber);\n pop(contextFiberStackCursor, fiber);\n}\n\nvar DefaultSuspenseContext = 0; // The Suspense Context is split into two parts. The lower bits is\n// inherited deeply down the subtree. The upper bits only affect\n// this immediate suspense boundary and gets reset each new\n// boundary or suspense list.\n\nvar SubtreeSuspenseContextMask = 1; // Subtree Flags:\n// InvisibleParentSuspenseContext indicates that one of our parent Suspense\n// boundaries is not currently showing visible main content.\n// Either because it is already showing a fallback or is not mounted at all.\n// We can use this to determine if it is desirable to trigger a fallback at\n// the parent. If not, then we might need to trigger undesirable boundaries\n// and/or suspend the commit to avoid hiding the parent content.\n\nvar InvisibleParentSuspenseContext = 1; // Shallow Flags:\n// ForceSuspenseFallback can be used by SuspenseList to force newly added\n// items into their fallback state during one of the render passes.\n\nvar ForceSuspenseFallback = 2;\nvar suspenseStackCursor = createCursor(DefaultSuspenseContext);\nfunction hasSuspenseContext(parentContext, flag) {\n return (parentContext & flag) !== 0;\n}\nfunction setDefaultShallowSuspenseContext(parentContext) {\n return parentContext & SubtreeSuspenseContextMask;\n}\nfunction setShallowSuspenseContext(parentContext, shallowContext) {\n return parentContext & SubtreeSuspenseContextMask | shallowContext;\n}\nfunction addSubtreeSuspenseContext(parentContext, subtreeContext) {\n return parentContext | subtreeContext;\n}\nfunction pushSuspenseContext(fiber, newContext) {\n push(suspenseStackCursor, newContext, fiber);\n}\nfunction popSuspenseContext(fiber) {\n pop(suspenseStackCursor, fiber);\n}\n\nfunction shouldCaptureSuspense(workInProgress, hasInvisibleParent) {\n // If it was the primary children that just suspended, capture and render the\n // fallback. Otherwise, don't capture and bubble to the next boundary.\n var nextState = workInProgress.memoizedState;\n\n if (nextState !== null) {\n if (nextState.dehydrated !== null) {\n // A dehydrated boundary always captures.\n return true;\n }\n\n return false;\n }\n\n var props = workInProgress.memoizedProps; // In order to capture, the Suspense component must have a fallback prop.\n\n if (props.fallback === undefined) {\n return false;\n } // Regular boundaries always capture.\n\n\n if (props.unstable_avoidThisFallback !== true) {\n return true;\n } // If it's a boundary we should avoid, then we prefer to bubble up to the\n // parent boundary if it is currently invisible.\n\n\n if (hasInvisibleParent) {\n return false;\n } // If the parent is not able to handle it, we must handle it.\n\n\n return true;\n}\nfunction findFirstSuspended(row) {\n var node = row;\n\n while (node !== null) {\n if (node.tag === SuspenseComponent) {\n var state = node.memoizedState;\n\n if (state !== null) {\n var dehydrated = state.dehydrated;\n\n if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {\n return node;\n }\n }\n } else if (node.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't\n // keep track of whether it suspended or not.\n node.memoizedProps.revealOrder !== undefined) {\n var didSuspend = (node.effectTag & DidCapture) !== NoEffect;\n\n if (didSuspend) {\n return node;\n }\n } else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === row) {\n return null;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === row) {\n return null;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n\n return null;\n}\n\nfunction createDeprecatedResponderListener(responder, props) {\n var eventResponderListener = {\n responder: responder,\n props: props\n };\n\n {\n Object.freeze(eventResponderListener);\n }\n\n return eventResponderListener;\n}\n\nvar HasEffect =\n/* */\n1; // Represents the phase in which the effect (not the clean-up) fires.\n\nvar Layout =\n/* */\n2;\nvar Passive$1 =\n/* */\n4;\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,\n ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;\nvar didWarnAboutMismatchedHooksForComponent;\n\n{\n didWarnAboutMismatchedHooksForComponent = new Set();\n}\n\n// These are set right before calling the component.\nvar renderExpirationTime = NoWork; // The work-in-progress fiber. I've named it differently to distinguish it from\n// the work-in-progress hook.\n\nvar currentlyRenderingFiber$1 = null; // Hooks are stored as a linked list on the fiber's memoizedState field. The\n// current hook list is the list that belongs to the current fiber. The\n// work-in-progress hook list is a new list that will be added to the\n// work-in-progress fiber.\n\nvar currentHook = null;\nvar workInProgressHook = null; // Whether an update was scheduled at any point during the render phase. This\n// does not get reset if we do another render pass; only when we're completely\n// finished evaluating this component. This is an optimization so we know\n// whether we need to clear render phase updates after a throw.\n\nvar didScheduleRenderPhaseUpdate = false;\nvar RE_RENDER_LIMIT = 25; // In DEV, this is the name of the currently executing primitive hook\n\nvar currentHookNameInDev = null; // In DEV, this list ensures that hooks are called in the same order between renders.\n// The list stores the order of hooks used during the initial render (mount).\n// Subsequent renders (updates) reference this list.\n\nvar hookTypesDev = null;\nvar hookTypesUpdateIndexDev = -1; // In DEV, this tracks whether currently rendering component needs to ignore\n// the dependencies for Hooks that need them (e.g. useEffect or useMemo).\n// When true, such Hooks will always be \"remounted\". Only used during hot reload.\n\nvar ignorePreviousDependencies = false;\n\nfunction mountHookTypesDev() {\n {\n var hookName = currentHookNameInDev;\n\n if (hookTypesDev === null) {\n hookTypesDev = [hookName];\n } else {\n hookTypesDev.push(hookName);\n }\n }\n}\n\nfunction updateHookTypesDev() {\n {\n var hookName = currentHookNameInDev;\n\n if (hookTypesDev !== null) {\n hookTypesUpdateIndexDev++;\n\n if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {\n warnOnHookMismatchInDev(hookName);\n }\n }\n }\n}\n\nfunction checkDepsAreArrayDev(deps) {\n {\n if (deps !== undefined && deps !== null && !Array.isArray(deps)) {\n // Verify deps, but only on mount to avoid extra checks.\n // It's unlikely their type would change as usually you define them inline.\n error('%s received a final argument that is not an array (instead, received `%s`). When ' + 'specified, the final argument must be an array.', currentHookNameInDev, typeof deps);\n }\n }\n}\n\nfunction warnOnHookMismatchInDev(currentHookName) {\n {\n var componentName = getComponentName(currentlyRenderingFiber$1.type);\n\n if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {\n didWarnAboutMismatchedHooksForComponent.add(componentName);\n\n if (hookTypesDev !== null) {\n var table = '';\n var secondColumnStart = 30;\n\n for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {\n var oldHookName = hookTypesDev[i];\n var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;\n var row = i + 1 + \". \" + oldHookName; // Extra space so second column lines up\n // lol @ IE not supporting String#repeat\n\n while (row.length < secondColumnStart) {\n row += ' ';\n }\n\n row += newHookName + '\\n';\n table += row;\n }\n\n error('React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://fb.me/rules-of-hooks\\n\\n' + ' Previous render Next render\\n' + ' ------------------------------------------------------\\n' + '%s' + ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', componentName, table);\n }\n }\n }\n}\n\nfunction throwInvalidHookError() {\n {\n {\n throw 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:\\n1. You might have mismatching versions of React and the renderer (such as React DOM)\\n2. You might be breaking the Rules of Hooks\\n3. You might have more than one copy of React in the same app\\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.\" );\n }\n }\n}\n\nfunction areHookInputsEqual(nextDeps, prevDeps) {\n {\n if (ignorePreviousDependencies) {\n // Only true when this component is being hot reloaded.\n return false;\n }\n }\n\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\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, \"[\" + prevDeps.join(', ') + \"]\", \"[\" + nextDeps.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\nfunction renderWithHooks(current, workInProgress, Component, props, secondArg, nextRenderExpirationTime) {\n renderExpirationTime = nextRenderExpirationTime;\n currentlyRenderingFiber$1 = workInProgress;\n\n {\n hookTypesDev = current !== null ? current._debugHookTypes : null;\n hookTypesUpdateIndexDev = -1; // Used for hot reloading:\n\n ignorePreviousDependencies = current !== null && current.type !== workInProgress.type;\n }\n\n workInProgress.memoizedState = null;\n workInProgress.updateQueue = null;\n workInProgress.expirationTime = NoWork; // The following should have already been reset\n // currentHook = null;\n // workInProgressHook = null;\n // didScheduleRenderPhaseUpdate = false;\n // TODO Warn if no hooks are used at all during mount, then some are used during update.\n // Currently we will identify the update render as a mount because memoizedState === null.\n // This is tricky because it's valid for certain types of components (e.g. React.lazy)\n // Using memoizedState to differentiate between mount/update only works if at least one stateful hook is used.\n // Non-stateful hooks (e.g. context) don't get added to memoizedState,\n // so memoizedState would be null during updates and mounts.\n\n {\n if (current !== null && current.memoizedState !== null) {\n ReactCurrentDispatcher.current = HooksDispatcherOnUpdateInDEV;\n } else if (hookTypesDev !== null) {\n // This dispatcher handles an edge case where a component is updating,\n // but no stateful hooks have been used.\n // We want to match the production code behavior (which will use HooksDispatcherOnMount),\n // but with the extra DEV validation to ensure hooks ordering hasn't changed.\n // This dispatcher does that.\n ReactCurrentDispatcher.current = HooksDispatcherOnMountWithHookTypesInDEV;\n } else {\n ReactCurrentDispatcher.current = HooksDispatcherOnMountInDEV;\n }\n }\n\n var children = Component(props, secondArg); // Check if there was a render phase update\n\n if (workInProgress.expirationTime === renderExpirationTime) {\n // Keep rendering in a loop for as long as render phase updates continue to\n // be scheduled. Use a counter to prevent infinite loops.\n var numberOfReRenders = 0;\n\n do {\n workInProgress.expirationTime = NoWork;\n\n if (!(numberOfReRenders < RE_RENDER_LIMIT)) {\n {\n throw Error( \"Too many re-renders. React limits the number of renders to prevent an infinite loop.\" );\n }\n }\n\n numberOfReRenders += 1;\n\n {\n // Even when hot reloading, allow dependencies to stabilize\n // after first render to prevent infinite render phase updates.\n ignorePreviousDependencies = false;\n } // Start over from the beginning of the list\n\n\n currentHook = null;\n workInProgressHook = null;\n workInProgress.updateQueue = null;\n\n {\n // Also validate hook order for cascading updates.\n hookTypesUpdateIndexDev = -1;\n }\n\n ReactCurrentDispatcher.current = HooksDispatcherOnRerenderInDEV ;\n children = Component(props, secondArg);\n } while (workInProgress.expirationTime === renderExpirationTime);\n } // We can assume the previous dispatcher is always this one, since we set it\n // at the beginning of the render phase and there's no re-entrancy.\n\n\n ReactCurrentDispatcher.current = ContextOnlyDispatcher;\n\n {\n workInProgress._debugHookTypes = hookTypesDev;\n } // This check uses currentHook so that it works the same in DEV and prod bundles.\n // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.\n\n\n var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;\n renderExpirationTime = NoWork;\n currentlyRenderingFiber$1 = null;\n currentHook = null;\n workInProgressHook = null;\n\n {\n currentHookNameInDev = null;\n hookTypesDev = null;\n hookTypesUpdateIndexDev = -1;\n }\n\n didScheduleRenderPhaseUpdate = false;\n\n if (!!didRenderTooFewHooks) {\n {\n throw Error( \"Rendered fewer hooks than expected. This may be caused by an accidental early return statement.\" );\n }\n }\n\n return children;\n}\nfunction bailoutHooks(current, workInProgress, expirationTime) {\n workInProgress.updateQueue = current.updateQueue;\n workInProgress.effectTag &= ~(Passive | Update);\n\n if (current.expirationTime <= expirationTime) {\n current.expirationTime = NoWork;\n }\n}\nfunction resetHooksAfterThrow() {\n // We can assume the previous dispatcher is always this one, since we set it\n // at the beginning of the render phase and there's no re-entrancy.\n ReactCurrentDispatcher.current = ContextOnlyDispatcher;\n\n if (didScheduleRenderPhaseUpdate) {\n // There were render phase updates. These are only valid for this render\n // phase, which we are now aborting. Remove the updates from the queues so\n // they do not persist to the next render. Do not remove updates from hooks\n // that weren't processed.\n //\n // Only reset the updates from the queue if it has a clone. If it does\n // not have a clone, that means it wasn't processed, and the updates were\n // scheduled before we entered the render phase.\n var hook = currentlyRenderingFiber$1.memoizedState;\n\n while (hook !== null) {\n var queue = hook.queue;\n\n if (queue !== null) {\n queue.pending = null;\n }\n\n hook = hook.next;\n }\n }\n\n renderExpirationTime = NoWork;\n currentlyRenderingFiber$1 = null;\n currentHook = null;\n workInProgressHook = null;\n\n {\n hookTypesDev = null;\n hookTypesUpdateIndexDev = -1;\n currentHookNameInDev = null;\n }\n\n didScheduleRenderPhaseUpdate = false;\n}\n\nfunction mountWorkInProgressHook() {\n var hook = {\n memoizedState: null,\n baseState: null,\n baseQueue: null,\n queue: null,\n next: null\n };\n\n if (workInProgressHook === null) {\n // This is the first hook in the list\n currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook;\n } else {\n // Append to the end of the list\n workInProgressHook = workInProgressHook.next = hook;\n }\n\n return workInProgressHook;\n}\n\nfunction updateWorkInProgressHook() {\n // This function is used both for updates and for re-renders triggered by a\n // render phase update. It assumes there is either a current hook we can\n // clone, or a work-in-progress hook from a previous render pass that we can\n // use as a base. When we reach the end of the base list, we must switch to\n // the dispatcher used for mounts.\n var nextCurrentHook;\n\n if (currentHook === null) {\n var current = currentlyRenderingFiber$1.alternate;\n\n if (current !== null) {\n nextCurrentHook = current.memoizedState;\n } else {\n nextCurrentHook = null;\n }\n } else {\n nextCurrentHook = currentHook.next;\n }\n\n var nextWorkInProgressHook;\n\n if (workInProgressHook === null) {\n nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState;\n } else {\n nextWorkInProgressHook = workInProgressHook.next;\n }\n\n if (nextWorkInProgressHook !== null) {\n // There's already a work-in-progress. Reuse it.\n workInProgressHook = nextWorkInProgressHook;\n nextWorkInProgressHook = workInProgressHook.next;\n currentHook = nextCurrentHook;\n } else {\n // Clone from the current hook.\n if (!(nextCurrentHook !== null)) {\n {\n throw Error( \"Rendered more hooks than during the previous render.\" );\n }\n }\n\n currentHook = nextCurrentHook;\n var newHook = {\n memoizedState: currentHook.memoizedState,\n baseState: currentHook.baseState,\n baseQueue: currentHook.baseQueue,\n queue: currentHook.queue,\n next: null\n };\n\n if (workInProgressHook === null) {\n // This is the first hook in the list.\n currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook;\n } else {\n // Append to the end of the list.\n workInProgressHook = workInProgressHook.next = newHook;\n }\n }\n\n return workInProgressHook;\n}\n\nfunction createFunctionComponentUpdateQueue() {\n return {\n lastEffect: null\n };\n}\n\nfunction basicStateReducer(state, action) {\n // $FlowFixMe: Flow doesn't like mixed types\n return typeof action === 'function' ? action(state) : action;\n}\n\nfunction mountReducer(reducer, initialArg, init) {\n var hook = mountWorkInProgressHook();\n var initialState;\n\n if (init !== undefined) {\n initialState = init(initialArg);\n } else {\n initialState = initialArg;\n }\n\n hook.memoizedState = hook.baseState = initialState;\n var queue = hook.queue = {\n pending: null,\n dispatch: null,\n lastRenderedReducer: reducer,\n lastRenderedState: initialState\n };\n var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);\n return [hook.memoizedState, dispatch];\n}\n\nfunction updateReducer(reducer, initialArg, init) {\n var hook = updateWorkInProgressHook();\n var queue = hook.queue;\n\n if (!(queue !== null)) {\n {\n throw Error( \"Should have a queue. This is likely a bug in React. Please file an issue.\" );\n }\n }\n\n queue.lastRenderedReducer = reducer;\n var current = currentHook; // The last rebase update that is NOT part of the base state.\n\n var baseQueue = current.baseQueue; // The last pending update that hasn't been processed yet.\n\n var pendingQueue = queue.pending;\n\n if (pendingQueue !== null) {\n // We have new updates that haven't been processed yet.\n // We'll add them to the base queue.\n if (baseQueue !== null) {\n // Merge the pending queue and the base queue.\n var baseFirst = baseQueue.next;\n var pendingFirst = pendingQueue.next;\n baseQueue.next = pendingFirst;\n pendingQueue.next = baseFirst;\n }\n\n current.baseQueue = baseQueue = pendingQueue;\n queue.pending = null;\n }\n\n if (baseQueue !== null) {\n // We have a queue to process.\n var first = baseQueue.next;\n var newState = current.baseState;\n var newBaseState = null;\n var newBaseQueueFirst = null;\n var newBaseQueueLast = null;\n var update = first;\n\n do {\n var updateExpirationTime = update.expirationTime;\n\n if (updateExpirationTime < renderExpirationTime) {\n // Priority is insufficient. Skip this update. If this is the first\n // skipped update, the previous update/state is the new base\n // update/state.\n var clone = {\n expirationTime: update.expirationTime,\n suspenseConfig: update.suspenseConfig,\n action: update.action,\n eagerReducer: update.eagerReducer,\n eagerState: update.eagerState,\n next: null\n };\n\n if (newBaseQueueLast === null) {\n newBaseQueueFirst = newBaseQueueLast = clone;\n newBaseState = newState;\n } else {\n newBaseQueueLast = newBaseQueueLast.next = clone;\n } // Update the remaining priority in the queue.\n\n\n if (updateExpirationTime > currentlyRenderingFiber$1.expirationTime) {\n currentlyRenderingFiber$1.expirationTime = updateExpirationTime;\n markUnprocessedUpdateTime(updateExpirationTime);\n }\n } else {\n // This update does have sufficient priority.\n if (newBaseQueueLast !== null) {\n var _clone = {\n expirationTime: Sync,\n // This update is going to be committed so we never want uncommit it.\n suspenseConfig: update.suspenseConfig,\n action: update.action,\n eagerReducer: update.eagerReducer,\n eagerState: update.eagerState,\n next: null\n };\n newBaseQueueLast = newBaseQueueLast.next = _clone;\n } // Mark the event time of this update as relevant to this render pass.\n // TODO: This should ideally use the true event time of this update rather than\n // its priority which is a derived and not reverseable value.\n // TODO: We should skip this update if it was already committed but currently\n // we have no way of detecting the difference between a committed and suspended\n // update here.\n\n\n markRenderEventTimeAndConfig(updateExpirationTime, update.suspenseConfig); // Process this update.\n\n if (update.eagerReducer === reducer) {\n // If this update was processed eagerly, and its reducer matches the\n // current reducer, we can use the eagerly computed state.\n newState = update.eagerState;\n } else {\n var action = update.action;\n newState = reducer(newState, action);\n }\n }\n\n update = update.next;\n } while (update !== null && update !== first);\n\n if (newBaseQueueLast === null) {\n newBaseState = newState;\n } else {\n newBaseQueueLast.next = newBaseQueueFirst;\n } // Mark that the fiber performed work, but only if the new state is\n // different from the current state.\n\n\n if (!objectIs(newState, hook.memoizedState)) {\n markWorkInProgressReceivedUpdate();\n }\n\n hook.memoizedState = newState;\n hook.baseState = newBaseState;\n hook.baseQueue = newBaseQueueLast;\n queue.lastRenderedState = newState;\n }\n\n var dispatch = queue.dispatch;\n return [hook.memoizedState, dispatch];\n}\n\nfunction rerenderReducer(reducer, initialArg, init) {\n var hook = updateWorkInProgressHook();\n var queue = hook.queue;\n\n if (!(queue !== null)) {\n {\n throw Error( \"Should have a queue. This is likely a bug in React. Please file an issue.\" );\n }\n }\n\n queue.lastRenderedReducer = reducer; // This is a re-render. Apply the new render phase updates to the previous\n // work-in-progress hook.\n\n var dispatch = queue.dispatch;\n var lastRenderPhaseUpdate = queue.pending;\n var newState = hook.memoizedState;\n\n if (lastRenderPhaseUpdate !== null) {\n // The queue doesn't persist past this render pass.\n queue.pending = null;\n var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next;\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 newState = reducer(newState, action);\n update = update.next;\n } while (update !== firstRenderPhaseUpdate); // Mark that the fiber performed work, but only if the new state is\n // different from the current state.\n\n\n if (!objectIs(newState, hook.memoizedState)) {\n markWorkInProgressReceivedUpdate();\n }\n\n hook.memoizedState = newState; // Don't persist the state accumulated from the render phase updates to\n // the base state unless the queue is empty.\n // TODO: Not sure if this is the desired semantics, but it's what we\n // do for gDSFP. I can't remember why.\n\n if (hook.baseQueue === null) {\n hook.baseState = newState;\n }\n\n queue.lastRenderedState = newState;\n }\n\n return [newState, dispatch];\n}\n\nfunction mountState(initialState) {\n var hook = mountWorkInProgressHook();\n\n if (typeof initialState === 'function') {\n // $FlowFixMe: Flow doesn't like mixed types\n initialState = initialState();\n }\n\n hook.memoizedState = hook.baseState = initialState;\n var queue = hook.queue = {\n pending: null,\n dispatch: null,\n lastRenderedReducer: basicStateReducer,\n lastRenderedState: initialState\n };\n var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);\n return [hook.memoizedState, dispatch];\n}\n\nfunction updateState(initialState) {\n return updateReducer(basicStateReducer);\n}\n\nfunction rerenderState(initialState) {\n return rerenderReducer(basicStateReducer);\n}\n\nfunction pushEffect(tag, create, destroy, deps) {\n var effect = {\n tag: tag,\n create: create,\n destroy: destroy,\n deps: deps,\n // Circular\n next: null\n };\n var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;\n\n if (componentUpdateQueue === null) {\n componentUpdateQueue = createFunctionComponentUpdateQueue();\n currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;\n componentUpdateQueue.lastEffect = effect.next = effect;\n } else {\n var lastEffect = componentUpdateQueue.lastEffect;\n\n if (lastEffect === null) {\n componentUpdateQueue.lastEffect = effect.next = effect;\n } else {\n var firstEffect = lastEffect.next;\n lastEffect.next = effect;\n effect.next = firstEffect;\n componentUpdateQueue.lastEffect = effect;\n }\n }\n\n return effect;\n}\n\nfunction mountRef(initialValue) {\n var hook = mountWorkInProgressHook();\n var ref = {\n current: initialValue\n };\n\n {\n Object.seal(ref);\n }\n\n hook.memoizedState = ref;\n return ref;\n}\n\nfunction updateRef(initialValue) {\n var hook = updateWorkInProgressHook();\n return hook.memoizedState;\n}\n\nfunction mountEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {\n var hook = mountWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n currentlyRenderingFiber$1.effectTag |= fiberEffectTag;\n hook.memoizedState = pushEffect(HasEffect | hookEffectTag, create, undefined, nextDeps);\n}\n\nfunction updateEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {\n var hook = updateWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n var destroy = undefined;\n\n if (currentHook !== null) {\n var prevEffect = currentHook.memoizedState;\n destroy = prevEffect.destroy;\n\n if (nextDeps !== null) {\n var prevDeps = prevEffect.deps;\n\n if (areHookInputsEqual(nextDeps, prevDeps)) {\n pushEffect(hookEffectTag, create, destroy, nextDeps);\n return;\n }\n }\n }\n\n currentlyRenderingFiber$1.effectTag |= fiberEffectTag;\n hook.memoizedState = pushEffect(HasEffect | hookEffectTag, create, destroy, nextDeps);\n}\n\nfunction mountEffect(create, deps) {\n {\n // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n if ('undefined' !== typeof jest) {\n warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);\n }\n }\n\n return mountEffectImpl(Update | Passive, Passive$1, create, deps);\n}\n\nfunction updateEffect(create, deps) {\n {\n // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n if ('undefined' !== typeof jest) {\n warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);\n }\n }\n\n return updateEffectImpl(Update | Passive, Passive$1, create, deps);\n}\n\nfunction mountLayoutEffect(create, deps) {\n return mountEffectImpl(Update, Layout, create, deps);\n}\n\nfunction updateLayoutEffect(create, deps) {\n return updateEffectImpl(Update, Layout, create, deps);\n}\n\nfunction imperativeHandleEffect(create, ref) {\n if (typeof ref === 'function') {\n var refCallback = ref;\n\n var _inst = create();\n\n refCallback(_inst);\n return function () {\n refCallback(null);\n };\n } else if (ref !== null && ref !== undefined) {\n var refObject = ref;\n\n {\n if (!refObject.hasOwnProperty('current')) {\n error('Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}');\n }\n }\n\n var _inst2 = create();\n\n refObject.current = _inst2;\n return function () {\n refObject.current = null;\n };\n }\n}\n\nfunction mountImperativeHandle(ref, create, deps) {\n {\n if (typeof create !== 'function') {\n error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');\n }\n } // TODO: If deps are provided, should we skip comparing the ref itself?\n\n\n var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;\n return mountEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);\n}\n\nfunction updateImperativeHandle(ref, create, deps) {\n {\n if (typeof create !== 'function') {\n error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');\n }\n } // TODO: If deps are provided, should we skip comparing the ref itself?\n\n\n var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;\n return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);\n}\n\nfunction mountDebugValue(value, formatterFn) {// This hook is normally a no-op.\n // The react-debug-hooks package injects its own implementation\n // so that e.g. DevTools can display custom hook values.\n}\n\nvar updateDebugValue = mountDebugValue;\n\nfunction mountCallback(callback, deps) {\n var hook = mountWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n hook.memoizedState = [callback, nextDeps];\n return callback;\n}\n\nfunction updateCallback(callback, deps) {\n var hook = updateWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n var prevState = hook.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 hook.memoizedState = [callback, nextDeps];\n return callback;\n}\n\nfunction mountMemo(nextCreate, deps) {\n var hook = mountWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n var nextValue = nextCreate();\n hook.memoizedState = [nextValue, nextDeps];\n return nextValue;\n}\n\nfunction updateMemo(nextCreate, deps) {\n var hook = updateWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n var prevState = hook.memoizedState;\n\n if (prevState !== null) {\n // Assume these are defined. If they're not, areHookInputsEqual will warn.\n if (nextDeps !== null) {\n var prevDeps = prevState[1];\n\n if (areHookInputsEqual(nextDeps, prevDeps)) {\n return prevState[0];\n }\n }\n }\n\n var nextValue = nextCreate();\n hook.memoizedState = [nextValue, nextDeps];\n return nextValue;\n}\n\nfunction mountDeferredValue(value, config) {\n var _mountState = mountState(value),\n prevValue = _mountState[0],\n setValue = _mountState[1];\n\n mountEffect(function () {\n var previousConfig = ReactCurrentBatchConfig$1.suspense;\n ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;\n\n try {\n setValue(value);\n } finally {\n ReactCurrentBatchConfig$1.suspense = previousConfig;\n }\n }, [value, config]);\n return prevValue;\n}\n\nfunction updateDeferredValue(value, config) {\n var _updateState = updateState(),\n prevValue = _updateState[0],\n setValue = _updateState[1];\n\n updateEffect(function () {\n var previousConfig = ReactCurrentBatchConfig$1.suspense;\n ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;\n\n try {\n setValue(value);\n } finally {\n ReactCurrentBatchConfig$1.suspense = previousConfig;\n }\n }, [value, config]);\n return prevValue;\n}\n\nfunction rerenderDeferredValue(value, config) {\n var _rerenderState = rerenderState(),\n prevValue = _rerenderState[0],\n setValue = _rerenderState[1];\n\n updateEffect(function () {\n var previousConfig = ReactCurrentBatchConfig$1.suspense;\n ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;\n\n try {\n setValue(value);\n } finally {\n ReactCurrentBatchConfig$1.suspense = previousConfig;\n }\n }, [value, config]);\n return prevValue;\n}\n\nfunction startTransition(setPending, config, callback) {\n var priorityLevel = getCurrentPriorityLevel();\n runWithPriority$1(priorityLevel < UserBlockingPriority$1 ? UserBlockingPriority$1 : priorityLevel, function () {\n setPending(true);\n });\n runWithPriority$1(priorityLevel > NormalPriority ? NormalPriority : priorityLevel, function () {\n var previousConfig = ReactCurrentBatchConfig$1.suspense;\n ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;\n\n try {\n setPending(false);\n callback();\n } finally {\n ReactCurrentBatchConfig$1.suspense = previousConfig;\n }\n });\n}\n\nfunction mountTransition(config) {\n var _mountState2 = mountState(false),\n isPending = _mountState2[0],\n setPending = _mountState2[1];\n\n var start = mountCallback(startTransition.bind(null, setPending, config), [setPending, config]);\n return [start, isPending];\n}\n\nfunction updateTransition(config) {\n var _updateState2 = updateState(),\n isPending = _updateState2[0],\n setPending = _updateState2[1];\n\n var start = updateCallback(startTransition.bind(null, setPending, config), [setPending, config]);\n return [start, isPending];\n}\n\nfunction rerenderTransition(config) {\n var _rerenderState2 = rerenderState(),\n isPending = _rerenderState2[0],\n setPending = _rerenderState2[1];\n\n var start = updateCallback(startTransition.bind(null, setPending, config), [setPending, config]);\n return [start, isPending];\n}\n\nfunction dispatchAction(fiber, queue, action) {\n {\n if (typeof arguments[3] === 'function') {\n error(\"State updates from the useState() and useReducer() Hooks don't support the \" + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().');\n }\n }\n\n var currentTime = requestCurrentTimeForUpdate();\n var suspenseConfig = requestCurrentSuspenseConfig();\n var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);\n var update = {\n expirationTime: expirationTime,\n suspenseConfig: suspenseConfig,\n action: action,\n eagerReducer: null,\n eagerState: null,\n next: null\n };\n\n {\n update.priority = getCurrentPriorityLevel();\n } // Append the update to the end of the list.\n\n\n var pending = queue.pending;\n\n if (pending === null) {\n // This is the first update. Create a circular list.\n update.next = update;\n } else {\n update.next = pending.next;\n pending.next = update;\n }\n\n queue.pending = update;\n var alternate = fiber.alternate;\n\n if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) {\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 update.expirationTime = renderExpirationTime;\n currentlyRenderingFiber$1.expirationTime = renderExpirationTime;\n } else {\n if (fiber.expirationTime === NoWork && (alternate === null || alternate.expirationTime === NoWork)) {\n // The queue is currently empty, which means we can eagerly compute the\n // next state before entering the render phase. If the new state is the\n // same as the current state, we may be able to bail out entirely.\n var lastRenderedReducer = queue.lastRenderedReducer;\n\n if (lastRenderedReducer !== null) {\n var prevDispatcher;\n\n {\n prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n }\n\n try {\n var currentState = queue.lastRenderedState;\n var eagerState = lastRenderedReducer(currentState, action); // Stash the eagerly computed state, and the reducer used to compute\n // it, on the update object. If the reducer hasn't changed by the\n // time we enter the render phase, then the eager state can be used\n // without calling the reducer again.\n\n update.eagerReducer = lastRenderedReducer;\n update.eagerState = eagerState;\n\n if (objectIs(eagerState, currentState)) {\n // Fast path. We can bail out without scheduling React to re-render.\n // It's still possible that we'll need to rebase this update later,\n // if the component re-renders for a different reason and by that\n // time the reducer has changed.\n return;\n }\n } catch (error) {// Suppress the error. It will throw again in the render phase.\n } finally {\n {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n }\n }\n }\n\n {\n // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n if ('undefined' !== typeof jest) {\n warnIfNotScopedWithMatchingAct(fiber);\n warnIfNotCurrentlyActingUpdatesInDev(fiber);\n }\n }\n\n scheduleWork(fiber, expirationTime);\n }\n}\n\nvar ContextOnlyDispatcher = {\n readContext: readContext,\n useCallback: throwInvalidHookError,\n useContext: throwInvalidHookError,\n useEffect: throwInvalidHookError,\n useImperativeHandle: throwInvalidHookError,\n useLayoutEffect: throwInvalidHookError,\n useMemo: throwInvalidHookError,\n useReducer: throwInvalidHookError,\n useRef: throwInvalidHookError,\n useState: throwInvalidHookError,\n useDebugValue: throwInvalidHookError,\n useResponder: throwInvalidHookError,\n useDeferredValue: throwInvalidHookError,\n useTransition: throwInvalidHookError\n};\nvar HooksDispatcherOnMountInDEV = null;\nvar HooksDispatcherOnMountWithHookTypesInDEV = null;\nvar HooksDispatcherOnUpdateInDEV = null;\nvar HooksDispatcherOnRerenderInDEV = null;\nvar InvalidNestedHooksDispatcherOnMountInDEV = null;\nvar InvalidNestedHooksDispatcherOnUpdateInDEV = null;\nvar InvalidNestedHooksDispatcherOnRerenderInDEV = null;\n\n{\n var warnInvalidContextAccess = function () {\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 var warnInvalidHookAccess = function () {\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://fb.me/rules-of-hooks');\n };\n\n HooksDispatcherOnMountInDEV = {\n readContext: function (context, observedBits) {\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n return mountCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n mountHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n return mountEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n return mountImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n return mountLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountMemo(create, deps);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n mountHookTypesDev();\n return mountRef(initialValue);\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountState(initialState);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n mountHookTypesDev();\n return mountDebugValue();\n },\n useResponder: function (responder, props) {\n currentHookNameInDev = 'useResponder';\n mountHookTypesDev();\n return createDeprecatedResponderListener(responder, props);\n },\n useDeferredValue: function (value, config) {\n currentHookNameInDev = 'useDeferredValue';\n mountHookTypesDev();\n return mountDeferredValue(value, config);\n },\n useTransition: function (config) {\n currentHookNameInDev = 'useTransition';\n mountHookTypesDev();\n return mountTransition(config);\n }\n };\n HooksDispatcherOnMountWithHookTypesInDEV = {\n readContext: function (context, observedBits) {\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n updateHookTypesDev();\n return mountCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n updateHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n updateHookTypesDev();\n return mountEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n updateHookTypesDev();\n return mountImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n updateHookTypesDev();\n return mountLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountMemo(create, deps);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n updateHookTypesDev();\n return mountRef(initialValue);\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountState(initialState);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n updateHookTypesDev();\n return mountDebugValue();\n },\n useResponder: function (responder, props) {\n currentHookNameInDev = 'useResponder';\n updateHookTypesDev();\n return createDeprecatedResponderListener(responder, props);\n },\n useDeferredValue: function (value, config) {\n currentHookNameInDev = 'useDeferredValue';\n updateHookTypesDev();\n return mountDeferredValue(value, config);\n },\n useTransition: function (config) {\n currentHookNameInDev = 'useTransition';\n updateHookTypesDev();\n return mountTransition(config);\n }\n };\n HooksDispatcherOnUpdateInDEV = {\n readContext: function (context, observedBits) {\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n updateHookTypesDev();\n return updateCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n updateHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n updateHookTypesDev();\n return updateEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n updateHookTypesDev();\n return updateImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n updateHookTypesDev();\n return updateLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateMemo(create, deps);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n updateHookTypesDev();\n return updateRef();\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateState(initialState);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n updateHookTypesDev();\n return updateDebugValue();\n },\n useResponder: function (responder, props) {\n currentHookNameInDev = 'useResponder';\n updateHookTypesDev();\n return createDeprecatedResponderListener(responder, props);\n },\n useDeferredValue: function (value, config) {\n currentHookNameInDev = 'useDeferredValue';\n updateHookTypesDev();\n return updateDeferredValue(value, config);\n },\n useTransition: function (config) {\n currentHookNameInDev = 'useTransition';\n updateHookTypesDev();\n return updateTransition(config);\n }\n };\n HooksDispatcherOnRerenderInDEV = {\n readContext: function (context, observedBits) {\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n updateHookTypesDev();\n return updateCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n updateHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n updateHookTypesDev();\n return updateEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n updateHookTypesDev();\n return updateImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n updateHookTypesDev();\n return updateLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;\n\n try {\n return updateMemo(create, deps);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;\n\n try {\n return rerenderReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n updateHookTypesDev();\n return updateRef();\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;\n\n try {\n return rerenderState(initialState);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n updateHookTypesDev();\n return updateDebugValue();\n },\n useResponder: function (responder, props) {\n currentHookNameInDev = 'useResponder';\n updateHookTypesDev();\n return createDeprecatedResponderListener(responder, props);\n },\n useDeferredValue: function (value, config) {\n currentHookNameInDev = 'useDeferredValue';\n updateHookTypesDev();\n return rerenderDeferredValue(value, config);\n },\n useTransition: function (config) {\n currentHookNameInDev = 'useTransition';\n updateHookTypesDev();\n return rerenderTransition(config);\n }\n };\n InvalidNestedHooksDispatcherOnMountInDEV = {\n readContext: function (context, observedBits) {\n warnInvalidContextAccess();\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n warnInvalidHookAccess();\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountMemo(create, deps);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n warnInvalidHookAccess();\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountRef(initialValue);\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n warnInvalidHookAccess();\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountState(initialState);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountDebugValue();\n },\n useResponder: function (responder, props) {\n currentHookNameInDev = 'useResponder';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return createDeprecatedResponderListener(responder, props);\n },\n useDeferredValue: function (value, config) {\n currentHookNameInDev = 'useDeferredValue';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountDeferredValue(value, config);\n },\n useTransition: function (config) {\n currentHookNameInDev = 'useTransition';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountTransition(config);\n }\n };\n InvalidNestedHooksDispatcherOnUpdateInDEV = {\n readContext: function (context, observedBits) {\n warnInvalidContextAccess();\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateMemo(create, deps);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateRef();\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateState(initialState);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateDebugValue();\n },\n useResponder: function (responder, props) {\n currentHookNameInDev = 'useResponder';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return createDeprecatedResponderListener(responder, props);\n },\n useDeferredValue: function (value, config) {\n currentHookNameInDev = 'useDeferredValue';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateDeferredValue(value, config);\n },\n useTransition: function (config) {\n currentHookNameInDev = 'useTransition';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateTransition(config);\n }\n };\n InvalidNestedHooksDispatcherOnRerenderInDEV = {\n readContext: function (context, observedBits) {\n warnInvalidContextAccess();\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateMemo(create, deps);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return rerenderReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateRef();\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher.current;\n ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return rerenderState(initialState);\n } finally {\n ReactCurrentDispatcher.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateDebugValue();\n },\n useResponder: function (responder, props) {\n currentHookNameInDev = 'useResponder';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return createDeprecatedResponderListener(responder, props);\n },\n useDeferredValue: function (value, config) {\n currentHookNameInDev = 'useDeferredValue';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return rerenderDeferredValue(value, config);\n },\n useTransition: function (config) {\n currentHookNameInDev = 'useTransition';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return rerenderTransition(config);\n }\n };\n}\n\nvar now$1 = Scheduler.unstable_now;\nvar commitTime = 0;\nvar profilerStartTime = -1;\n\nfunction getCommitTime() {\n return commitTime;\n}\n\nfunction recordCommitTime() {\n\n commitTime = now$1();\n}\n\nfunction startProfilerTimer(fiber) {\n\n profilerStartTime = now$1();\n\n if (fiber.actualStartTime < 0) {\n fiber.actualStartTime = now$1();\n }\n}\n\nfunction stopProfilerTimerIfRunning(fiber) {\n\n profilerStartTime = -1;\n}\n\nfunction stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {\n\n if (profilerStartTime >= 0) {\n var elapsedTime = now$1() - profilerStartTime;\n fiber.actualDuration += elapsedTime;\n\n if (overrideBaseTime) {\n fiber.selfBaseDuration = elapsedTime;\n }\n\n profilerStartTime = -1;\n }\n}\n\n// This may have been an insertion or a hydration.\n\nvar hydrationParentFiber = null;\nvar nextHydratableInstance = null;\nvar isHydrating = false;\n\nfunction enterHydrationState(fiber) {\n\n var parentInstance = fiber.stateNode.containerInfo;\n nextHydratableInstance = getFirstHydratableChild(parentInstance);\n hydrationParentFiber = fiber;\n isHydrating = true;\n return true;\n}\n\nfunction deleteHydratableInstance(returnFiber, instance) {\n {\n switch (returnFiber.tag) {\n case HostRoot:\n didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);\n break;\n\n case HostComponent:\n didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);\n break;\n }\n }\n\n var childToDelete = createFiberFromHostInstanceForDeletion();\n childToDelete.stateNode = instance;\n childToDelete.return = returnFiber;\n childToDelete.effectTag = Deletion; // This might seem like it belongs on progressedFirstDeletion. However,\n // these children are not part of the reconciliation list of children.\n // Even if we abort and rereconcile the children, that will try to hydrate\n // again and the nodes are still in the host tree so these will be\n // recreated.\n\n if (returnFiber.lastEffect !== null) {\n returnFiber.lastEffect.nextEffect = childToDelete;\n returnFiber.lastEffect = childToDelete;\n } else {\n returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;\n }\n}\n\nfunction insertNonHydratedInstance(returnFiber, fiber) {\n fiber.effectTag = fiber.effectTag & ~Hydrating | Placement;\n\n {\n switch (returnFiber.tag) {\n case HostRoot:\n {\n var parentContainer = returnFiber.stateNode.containerInfo;\n\n switch (fiber.tag) {\n case HostComponent:\n var type = fiber.type;\n var props = fiber.pendingProps;\n didNotFindHydratableContainerInstance(parentContainer, type);\n break;\n\n case HostText:\n var text = fiber.pendingProps;\n didNotFindHydratableContainerTextInstance(parentContainer, text);\n break;\n }\n\n break;\n }\n\n case HostComponent:\n {\n var parentType = returnFiber.type;\n var parentProps = returnFiber.memoizedProps;\n var parentInstance = returnFiber.stateNode;\n\n switch (fiber.tag) {\n case HostComponent:\n var _type = fiber.type;\n var _props = fiber.pendingProps;\n didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type);\n break;\n\n case HostText:\n var _text = fiber.pendingProps;\n didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);\n break;\n\n case SuspenseComponent:\n didNotFindHydratableSuspenseInstance(parentType, parentProps);\n break;\n }\n\n break;\n }\n\n default:\n return;\n }\n }\n}\n\nfunction tryHydrate(fiber, nextInstance) {\n switch (fiber.tag) {\n case HostComponent:\n {\n var type = fiber.type;\n var props = fiber.pendingProps;\n var instance = canHydrateInstance(nextInstance, type);\n\n if (instance !== null) {\n fiber.stateNode = instance;\n return true;\n }\n\n return false;\n }\n\n case HostText:\n {\n var text = fiber.pendingProps;\n var textInstance = canHydrateTextInstance(nextInstance, text);\n\n if (textInstance !== null) {\n fiber.stateNode = textInstance;\n return true;\n }\n\n return false;\n }\n\n case SuspenseComponent:\n {\n\n return false;\n }\n\n default:\n return false;\n }\n}\n\nfunction tryToClaimNextHydratableInstance(fiber) {\n if (!isHydrating) {\n return;\n }\n\n var nextInstance = nextHydratableInstance;\n\n if (!nextInstance) {\n // Nothing to hydrate. Make it an insertion.\n insertNonHydratedInstance(hydrationParentFiber, fiber);\n isHydrating = false;\n hydrationParentFiber = fiber;\n return;\n }\n\n var firstAttemptedInstance = nextInstance;\n\n if (!tryHydrate(fiber, nextInstance)) {\n // If we can't hydrate this instance let's try the next one.\n // We use this as a heuristic. It's based on intuition and not data so it\n // might be flawed or unnecessary.\n nextInstance = getNextHydratableSibling(firstAttemptedInstance);\n\n if (!nextInstance || !tryHydrate(fiber, nextInstance)) {\n // Nothing to hydrate. Make it an insertion.\n insertNonHydratedInstance(hydrationParentFiber, fiber);\n isHydrating = false;\n hydrationParentFiber = fiber;\n return;\n } // We matched the next one, we'll now assume that the first one was\n // superfluous and we'll delete it. Since we can't eagerly delete it\n // we'll have to schedule a deletion. To do that, this node needs a dummy\n // fiber associated with it.\n\n\n deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance);\n }\n\n hydrationParentFiber = fiber;\n nextHydratableInstance = getFirstHydratableChild(nextInstance);\n}\n\nfunction prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {\n\n var instance = fiber.stateNode;\n var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber); // TODO: Type this specific to this type of component.\n\n fiber.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there\n // is a new ref we mark this as an update.\n\n if (updatePayload !== null) {\n return true;\n }\n\n return false;\n}\n\nfunction prepareToHydrateHostTextInstance(fiber) {\n\n var textInstance = fiber.stateNode;\n var textContent = fiber.memoizedProps;\n var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);\n\n {\n if (shouldUpdate) {\n // We assume that prepareToHydrateHostTextInstance is called in a context where the\n // hydration parent is the parent host component of this host text.\n var returnFiber = hydrationParentFiber;\n\n if (returnFiber !== null) {\n switch (returnFiber.tag) {\n case HostRoot:\n {\n var parentContainer = returnFiber.stateNode.containerInfo;\n didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);\n break;\n }\n\n case HostComponent:\n {\n var parentType = returnFiber.type;\n var parentProps = returnFiber.memoizedProps;\n var parentInstance = returnFiber.stateNode;\n didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);\n break;\n }\n }\n }\n }\n }\n\n return shouldUpdate;\n}\n\nfunction skipPastDehydratedSuspenseInstance(fiber) {\n\n var suspenseState = fiber.memoizedState;\n var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;\n\n if (!suspenseInstance) {\n {\n throw Error( \"Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);\n}\n\nfunction popToNextHostParent(fiber) {\n var parent = fiber.return;\n\n while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) {\n parent = parent.return;\n }\n\n hydrationParentFiber = parent;\n}\n\nfunction popHydrationState(fiber) {\n\n if (fiber !== hydrationParentFiber) {\n // We're deeper than the current hydration context, inside an inserted\n // tree.\n return false;\n }\n\n if (!isHydrating) {\n // If we're not currently hydrating but we're in a hydration context, then\n // we were an insertion and now need to pop up reenter hydration of our\n // siblings.\n popToNextHostParent(fiber);\n isHydrating = true;\n return false;\n }\n\n var type = fiber.type; // If we have any remaining hydratable nodes, we need to delete them now.\n // We only do this deeper than head and body since they tend to have random\n // other nodes in them. We also ignore components with pure text content in\n // side of them.\n // TODO: Better heuristic.\n\n if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) {\n var nextInstance = nextHydratableInstance;\n\n while (nextInstance) {\n deleteHydratableInstance(fiber, nextInstance);\n nextInstance = getNextHydratableSibling(nextInstance);\n }\n }\n\n popToNextHostParent(fiber);\n\n if (fiber.tag === SuspenseComponent) {\n nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);\n } else {\n nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;\n }\n\n return true;\n}\n\nfunction resetHydrationState() {\n\n hydrationParentFiber = null;\n nextHydratableInstance = null;\n isHydrating = false;\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar didReceiveUpdate = false;\nvar didWarnAboutBadClass;\nvar didWarnAboutModulePatternComponent;\nvar didWarnAboutContextTypeOnFunctionComponent;\nvar didWarnAboutGetDerivedStateOnFunctionComponent;\nvar didWarnAboutFunctionRefs;\nvar didWarnAboutReassigningProps;\nvar didWarnAboutRevealOrder;\nvar didWarnAboutTailOptions;\n\n{\n didWarnAboutBadClass = {};\n didWarnAboutModulePatternComponent = {};\n didWarnAboutContextTypeOnFunctionComponent = {};\n didWarnAboutGetDerivedStateOnFunctionComponent = {};\n didWarnAboutFunctionRefs = {};\n didWarnAboutReassigningProps = false;\n didWarnAboutRevealOrder = {};\n didWarnAboutTailOptions = {};\n}\n\nfunction reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime) {\n if (current === null) {\n // If this is a fresh new component that hasn't been rendered yet, we\n // won't update its child set by applying minimal side-effects. Instead,\n // we will add them all to the child before it gets rendered. That means\n // we can optimize this reconciliation pass by not tracking side-effects.\n workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);\n } else {\n // If the current child is the same as the work in progress, it means that\n // we haven't yet started any work on these children. Therefore, we use\n // the clone algorithm to create a copy of all the current children.\n // If we had any progressed work already, that is invalid at this point so\n // let's throw it out.\n workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderExpirationTime);\n }\n}\n\nfunction forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderExpirationTime) {\n // This function is fork of reconcileChildren. It's used in cases where we\n // want to reconcile without matching against the existing set. This has the\n // effect of all current children being unmounted; even if the type and key\n // are the same, the old child is unmounted and a new child is created.\n //\n // To do this, we're going to go through the reconcile algorithm twice. In\n // the first pass, we schedule a deletion for all the current children by\n // passing null.\n workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderExpirationTime); // In the second pass, we mount the new children. The trick here is that we\n // pass null in place of where we usually pass the current child set. This has\n // the effect of remounting all children regardless of whether their\n // identities match.\n\n workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);\n}\n\nfunction updateForwardRef(current, workInProgress, Component, nextProps, renderExpirationTime) {\n // TODO: current can be non-null here even if the component\n // hasn't yet mounted. This happens after the first render suspends.\n // We'll need to figure out if this is fine or can cause issues.\n {\n if (workInProgress.type !== workInProgress.elementType) {\n // Lazy component props can't be validated in createElement\n // because they're only guaranteed to be resolved here.\n var innerPropTypes = Component.propTypes;\n\n if (innerPropTypes) {\n checkPropTypes(innerPropTypes, nextProps, // Resolved props\n 'prop', getComponentName(Component), getCurrentFiberStackInDev);\n }\n }\n }\n\n var render = Component.render;\n var ref = workInProgress.ref; // The rest is a fork of updateFunctionComponent\n\n var nextChildren;\n prepareToReadContext(workInProgress, renderExpirationTime);\n\n {\n ReactCurrentOwner$1.current = workInProgress;\n setIsRendering(true);\n nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderExpirationTime);\n\n if ( workInProgress.mode & StrictMode) {\n // Only double-render components with Hooks\n if (workInProgress.memoizedState !== null) {\n nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderExpirationTime);\n }\n }\n\n setIsRendering(false);\n }\n\n if (current !== null && !didReceiveUpdate) {\n bailoutHooks(current, workInProgress, renderExpirationTime);\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n } // React DevTools reads this flag.\n\n\n workInProgress.effectTag |= PerformedWork;\n reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n return workInProgress.child;\n}\n\nfunction updateMemoComponent(current, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {\n if (current === null) {\n var type = Component.type;\n\n if (isSimpleFunctionComponent(type) && Component.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.\n Component.defaultProps === undefined) {\n var resolvedType = type;\n\n {\n resolvedType = resolveFunctionForHotReloading(type);\n } // If this is a plain function component without default props,\n // and with only the default shallow comparison, we upgrade it\n // to a SimpleMemoComponent to allow fast path updates.\n\n\n workInProgress.tag = SimpleMemoComponent;\n workInProgress.type = resolvedType;\n\n {\n validateFunctionComponentInDev(workInProgress, type);\n }\n\n return updateSimpleMemoComponent(current, workInProgress, resolvedType, nextProps, updateExpirationTime, renderExpirationTime);\n }\n\n {\n var innerPropTypes = type.propTypes;\n\n if (innerPropTypes) {\n // Inner memo component props aren't currently validated in createElement.\n // We could move it there, but we'd still need this for lazy code path.\n checkPropTypes(innerPropTypes, nextProps, // Resolved props\n 'prop', getComponentName(type), getCurrentFiberStackInDev);\n }\n }\n\n var child = createFiberFromTypeAndProps(Component.type, null, nextProps, null, workInProgress.mode, renderExpirationTime);\n child.ref = workInProgress.ref;\n child.return = workInProgress;\n workInProgress.child = child;\n return child;\n }\n\n {\n var _type = Component.type;\n var _innerPropTypes = _type.propTypes;\n\n if (_innerPropTypes) {\n // Inner memo component props aren't currently validated in createElement.\n // We could move it there, but we'd still need this for lazy code path.\n checkPropTypes(_innerPropTypes, nextProps, // Resolved props\n 'prop', getComponentName(_type), getCurrentFiberStackInDev);\n }\n }\n\n var currentChild = current.child; // This is always exactly one child\n\n if (updateExpirationTime < renderExpirationTime) {\n // This will be the props with resolved defaultProps,\n // unlike current.memoizedProps which will be the unresolved ones.\n var prevProps = currentChild.memoizedProps; // Default to shallow comparison\n\n var compare = Component.compare;\n compare = compare !== null ? compare : shallowEqual;\n\n if (compare(prevProps, nextProps) && current.ref === workInProgress.ref) {\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n }\n } // React DevTools reads this flag.\n\n\n workInProgress.effectTag |= PerformedWork;\n var newChild = createWorkInProgress(currentChild, nextProps);\n newChild.ref = workInProgress.ref;\n newChild.return = workInProgress;\n workInProgress.child = newChild;\n return newChild;\n}\n\nfunction updateSimpleMemoComponent(current, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {\n // TODO: current can be non-null here even if the component\n // hasn't yet mounted. This happens when the inner render suspends.\n // We'll need to figure out if this is fine or can cause issues.\n {\n if (workInProgress.type !== workInProgress.elementType) {\n // Lazy component props can't be validated in createElement\n // because they're only guaranteed to be resolved here.\n var outerMemoType = workInProgress.elementType;\n\n if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {\n // We warn when you define propTypes on lazy()\n // so let's just skip over it to find memo() outer wrapper.\n // Inner props for memo are validated later.\n outerMemoType = refineResolvedLazyComponent(outerMemoType);\n }\n\n var outerPropTypes = outerMemoType && outerMemoType.propTypes;\n\n if (outerPropTypes) {\n checkPropTypes(outerPropTypes, nextProps, // Resolved (SimpleMemoComponent has no defaultProps)\n 'prop', getComponentName(outerMemoType), getCurrentFiberStackInDev);\n } // Inner propTypes will be validated in the function component path.\n\n }\n }\n\n if (current !== null) {\n var prevProps = current.memoizedProps;\n\n if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress.ref && ( // Prevent bailout if the implementation changed due to hot reload.\n workInProgress.type === current.type )) {\n didReceiveUpdate = false;\n\n if (updateExpirationTime < renderExpirationTime) {\n // The pending update priority was cleared at the beginning of\n // beginWork. We're about to bail out, but there might be additional\n // updates at a lower priority. Usually, the priority level of the\n // remaining updates is accumlated during the evaluation of the\n // component (i.e. when processing the update queue). But since since\n // we're bailing out early *without* evaluating the component, we need\n // to account for it here, too. Reset to the value of the current fiber.\n // NOTE: This only applies to SimpleMemoComponent, not MemoComponent,\n // because a MemoComponent fiber does not have hooks or an update queue;\n // rather, it wraps around an inner component, which may or may not\n // contains hooks.\n // TODO: Move the reset at in beginWork out of the common path so that\n // this is no longer necessary.\n workInProgress.expirationTime = current.expirationTime;\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n }\n }\n }\n\n return updateFunctionComponent(current, workInProgress, Component, nextProps, renderExpirationTime);\n}\n\nfunction updateFragment(current, workInProgress, renderExpirationTime) {\n var nextChildren = workInProgress.pendingProps;\n reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n return workInProgress.child;\n}\n\nfunction updateMode(current, workInProgress, renderExpirationTime) {\n var nextChildren = workInProgress.pendingProps.children;\n reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n return workInProgress.child;\n}\n\nfunction updateProfiler(current, workInProgress, renderExpirationTime) {\n {\n workInProgress.effectTag |= Update;\n }\n\n var nextProps = workInProgress.pendingProps;\n var nextChildren = nextProps.children;\n reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n return workInProgress.child;\n}\n\nfunction markRef(current, workInProgress) {\n var ref = workInProgress.ref;\n\n if (current === null && ref !== null || current !== null && current.ref !== ref) {\n // Schedule a Ref effect\n workInProgress.effectTag |= Ref;\n }\n}\n\nfunction updateFunctionComponent(current, workInProgress, Component, nextProps, renderExpirationTime) {\n {\n if (workInProgress.type !== workInProgress.elementType) {\n // Lazy component props can't be validated in createElement\n // because they're only guaranteed to be resolved here.\n var innerPropTypes = Component.propTypes;\n\n if (innerPropTypes) {\n checkPropTypes(innerPropTypes, nextProps, // Resolved props\n 'prop', getComponentName(Component), getCurrentFiberStackInDev);\n }\n }\n }\n\n var context;\n\n {\n var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);\n context = getMaskedContext(workInProgress, unmaskedContext);\n }\n\n var nextChildren;\n prepareToReadContext(workInProgress, renderExpirationTime);\n\n {\n ReactCurrentOwner$1.current = workInProgress;\n setIsRendering(true);\n nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderExpirationTime);\n\n if ( workInProgress.mode & StrictMode) {\n // Only double-render components with Hooks\n if (workInProgress.memoizedState !== null) {\n nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderExpirationTime);\n }\n }\n\n setIsRendering(false);\n }\n\n if (current !== null && !didReceiveUpdate) {\n bailoutHooks(current, workInProgress, renderExpirationTime);\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n } // React DevTools reads this flag.\n\n\n workInProgress.effectTag |= PerformedWork;\n reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n return workInProgress.child;\n}\n\nfunction updateClassComponent(current, workInProgress, Component, nextProps, renderExpirationTime) {\n {\n if (workInProgress.type !== workInProgress.elementType) {\n // Lazy component props can't be validated in createElement\n // because they're only guaranteed to be resolved here.\n var innerPropTypes = Component.propTypes;\n\n if (innerPropTypes) {\n checkPropTypes(innerPropTypes, nextProps, // Resolved props\n 'prop', getComponentName(Component), getCurrentFiberStackInDev);\n }\n }\n } // Push context providers early to prevent context stack mismatches.\n // During mounting we don't know the child context yet as the instance doesn't exist.\n // We will invalidate the child context in finishClassComponent() right after rendering.\n\n\n var hasContext;\n\n if (isContextProvider(Component)) {\n hasContext = true;\n pushContextProvider(workInProgress);\n } else {\n hasContext = false;\n }\n\n prepareToReadContext(workInProgress, renderExpirationTime);\n var instance = workInProgress.stateNode;\n var shouldUpdate;\n\n if (instance === null) {\n if (current !== null) {\n // A class component without an instance only mounts if it suspended\n // inside a non-concurrent tree, in an inconsistent state. We want to\n // treat it like a new mount, even though an empty version of it already\n // committed. Disconnect the alternate pointers.\n current.alternate = null;\n workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect\n\n workInProgress.effectTag |= Placement;\n } // In the initial pass we might need to construct the instance.\n\n\n constructClassInstance(workInProgress, Component, nextProps);\n mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);\n shouldUpdate = true;\n } else if (current === null) {\n // In a resume, we'll already have an instance we can reuse.\n shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);\n } else {\n shouldUpdate = updateClassInstance(current, workInProgress, Component, nextProps, renderExpirationTime);\n }\n\n var nextUnitOfWork = finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime);\n\n {\n var inst = workInProgress.stateNode;\n\n if (inst.props !== nextProps) {\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.', getComponentName(workInProgress.type) || 'a component');\n }\n\n didWarnAboutReassigningProps = true;\n }\n }\n\n return nextUnitOfWork;\n}\n\nfunction finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime) {\n // Refs should update even if shouldComponentUpdate returns false\n markRef(current, workInProgress);\n var didCaptureError = (workInProgress.effectTag & DidCapture) !== NoEffect;\n\n if (!shouldUpdate && !didCaptureError) {\n // Context providers should defer to sCU for rendering\n if (hasContext) {\n invalidateContextProvider(workInProgress, Component, false);\n }\n\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n }\n\n var instance = workInProgress.stateNode; // Rerender\n\n ReactCurrentOwner$1.current = workInProgress;\n var nextChildren;\n\n if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') {\n // If we captured an error, but getDerivedStateFromError is not defined,\n // unmount all the children. componentDidCatch will schedule an update to\n // re-render a fallback. This is temporary until we migrate everyone to\n // the new API.\n // TODO: Warn in a future release.\n nextChildren = null;\n\n {\n stopProfilerTimerIfRunning();\n }\n } else {\n {\n setIsRendering(true);\n nextChildren = instance.render();\n\n if ( workInProgress.mode & StrictMode) {\n instance.render();\n }\n\n setIsRendering(false);\n }\n } // React DevTools reads this flag.\n\n\n workInProgress.effectTag |= PerformedWork;\n\n if (current !== null && didCaptureError) {\n // If we're recovering from an error, reconcile without reusing any of\n // the existing children. Conceptually, the normal children and the children\n // that are shown on error are two different sets, so we shouldn't reuse\n // normal children even if their identities match.\n forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderExpirationTime);\n } else {\n reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n } // Memoize state using the values we just used to render.\n // TODO: Restructure so we never read values from the instance.\n\n\n workInProgress.memoizedState = instance.state; // The context might have changed so we need to recalculate it.\n\n if (hasContext) {\n invalidateContextProvider(workInProgress, Component, true);\n }\n\n return workInProgress.child;\n}\n\nfunction pushHostRootContext(workInProgress) {\n var root = workInProgress.stateNode;\n\n if (root.pendingContext) {\n pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context);\n } else if (root.context) {\n // Should always be set\n pushTopLevelContextObject(workInProgress, root.context, false);\n }\n\n pushHostContainer(workInProgress, root.containerInfo);\n}\n\nfunction updateHostRoot(current, workInProgress, renderExpirationTime) {\n pushHostRootContext(workInProgress);\n var updateQueue = workInProgress.updateQueue;\n\n if (!(current !== null && updateQueue !== null)) {\n {\n throw Error( \"If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n var nextProps = workInProgress.pendingProps;\n var prevState = workInProgress.memoizedState;\n var prevChildren = prevState !== null ? prevState.element : null;\n cloneUpdateQueue(current, workInProgress);\n processUpdateQueue(workInProgress, nextProps, null, renderExpirationTime);\n var nextState = workInProgress.memoizedState; // Caution: React DevTools currently depends on this property\n // being called \"element\".\n\n var nextChildren = nextState.element;\n\n if (nextChildren === prevChildren) {\n // If the state is the same as before, that's a bailout because we had\n // no work that expires at this time.\n resetHydrationState();\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n }\n\n var root = workInProgress.stateNode;\n\n if (root.hydrate && enterHydrationState(workInProgress)) {\n // If we don't have any current children this might be the first pass.\n // We always try to hydrate. If this isn't a hydration pass there won't\n // be any children to hydrate which is effectively the same thing as\n // not hydrating.\n var child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);\n workInProgress.child = child;\n var node = child;\n\n while (node) {\n // Mark each child as hydrating. This is a fast path to know whether this\n // tree is part of a hydrating tree. This is used to determine if a child\n // node has fully mounted yet, and for scheduling event replaying.\n // Conceptually this is similar to Placement in that a new subtree is\n // inserted into the React tree here. It just happens to not need DOM\n // mutations because it already exists.\n node.effectTag = node.effectTag & ~Placement | Hydrating;\n node = node.sibling;\n }\n } else {\n // Otherwise reset hydration state in case we aborted and resumed another\n // root.\n reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n resetHydrationState();\n }\n\n return workInProgress.child;\n}\n\nfunction updateHostComponent(current, workInProgress, renderExpirationTime) {\n pushHostContext(workInProgress);\n\n if (current === null) {\n tryToClaimNextHydratableInstance(workInProgress);\n }\n\n var type = workInProgress.type;\n var nextProps = workInProgress.pendingProps;\n var prevProps = current !== null ? current.memoizedProps : null;\n var nextChildren = nextProps.children;\n var isDirectTextChild = shouldSetTextContent(type, nextProps);\n\n if (isDirectTextChild) {\n // We special case a direct text child of a host node. This is a common\n // case. We won't handle it as a reified child. We will instead handle\n // this in the host environment that also has access to this prop. That\n // avoids allocating another HostText fiber and traversing it.\n nextChildren = null;\n } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {\n // If we're switching from a direct text child to a normal child, or to\n // empty, we need to schedule the text content to be reset.\n workInProgress.effectTag |= ContentReset;\n }\n\n markRef(current, workInProgress); // Check the host config to see if the children are offscreen/hidden.\n\n if (workInProgress.mode & ConcurrentMode && renderExpirationTime !== Never && shouldDeprioritizeSubtree(type, nextProps)) {\n {\n markSpawnedWork(Never);\n } // Schedule this fiber to re-render at offscreen priority. Then bailout.\n\n\n workInProgress.expirationTime = workInProgress.childExpirationTime = Never;\n return null;\n }\n\n reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n return workInProgress.child;\n}\n\nfunction updateHostText(current, workInProgress) {\n if (current === null) {\n tryToClaimNextHydratableInstance(workInProgress);\n } // Nothing to do here. This is terminal. We'll do the completion step\n // immediately after.\n\n\n return null;\n}\n\nfunction mountLazyComponent(_current, workInProgress, elementType, updateExpirationTime, renderExpirationTime) {\n if (_current !== null) {\n // A lazy component only mounts if it suspended inside a non-\n // concurrent tree, in an inconsistent state. We want to treat it like\n // a new mount, even though an empty version of it already committed.\n // Disconnect the alternate pointers.\n _current.alternate = null;\n workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect\n\n workInProgress.effectTag |= Placement;\n }\n\n var props = workInProgress.pendingProps; // We can't start a User Timing measurement with correct label yet.\n // Cancel and resume right after we know the tag.\n\n cancelWorkTimer(workInProgress);\n var Component = readLazyComponentType(elementType); // Store the unwrapped component in the type.\n\n workInProgress.type = Component;\n var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component);\n startWorkTimer(workInProgress);\n var resolvedProps = resolveDefaultProps(Component, props);\n var child;\n\n switch (resolvedTag) {\n case FunctionComponent:\n {\n {\n validateFunctionComponentInDev(workInProgress, Component);\n workInProgress.type = Component = resolveFunctionForHotReloading(Component);\n }\n\n child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);\n return child;\n }\n\n case ClassComponent:\n {\n {\n workInProgress.type = Component = resolveClassForHotReloading(Component);\n }\n\n child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);\n return child;\n }\n\n case ForwardRef:\n {\n {\n workInProgress.type = Component = resolveForwardRefForHotReloading(Component);\n }\n\n child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderExpirationTime);\n return child;\n }\n\n case MemoComponent:\n {\n {\n if (workInProgress.type !== workInProgress.elementType) {\n var outerPropTypes = Component.propTypes;\n\n if (outerPropTypes) {\n checkPropTypes(outerPropTypes, resolvedProps, // Resolved for outer only\n 'prop', getComponentName(Component), getCurrentFiberStackInDev);\n }\n }\n }\n\n child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too\n updateExpirationTime, renderExpirationTime);\n return child;\n }\n }\n\n var hint = '';\n\n {\n if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) {\n hint = ' Did you wrap a component in React.lazy() more than once?';\n }\n } // This message intentionally doesn't mention ForwardRef or MemoComponent\n // because the fact that it's a separate type of work is an\n // implementation detail.\n\n\n {\n {\n throw Error( \"Element type is invalid. Received a promise that resolves to: \" + Component + \". Lazy element type must resolve to a class or function.\" + hint );\n }\n }\n}\n\nfunction mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderExpirationTime) {\n if (_current !== null) {\n // An incomplete component only mounts if it suspended inside a non-\n // concurrent tree, in an inconsistent state. We want to treat it like\n // a new mount, even though an empty version of it already committed.\n // Disconnect the alternate pointers.\n _current.alternate = null;\n workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect\n\n workInProgress.effectTag |= Placement;\n } // Promote the fiber to a class and try rendering again.\n\n\n workInProgress.tag = ClassComponent; // The rest of this function is a fork of `updateClassComponent`\n // Push context providers early to prevent context stack mismatches.\n // During mounting we don't know the child context yet as the instance doesn't exist.\n // We will invalidate the child context in finishClassComponent() right after rendering.\n\n var hasContext;\n\n if (isContextProvider(Component)) {\n hasContext = true;\n pushContextProvider(workInProgress);\n } else {\n hasContext = false;\n }\n\n prepareToReadContext(workInProgress, renderExpirationTime);\n constructClassInstance(workInProgress, Component, nextProps);\n mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);\n return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);\n}\n\nfunction mountIndeterminateComponent(_current, workInProgress, Component, renderExpirationTime) {\n if (_current !== null) {\n // An indeterminate component only mounts if it suspended inside a non-\n // concurrent tree, in an inconsistent state. We want to treat it like\n // a new mount, even though an empty version of it already committed.\n // Disconnect the alternate pointers.\n _current.alternate = null;\n workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect\n\n workInProgress.effectTag |= Placement;\n }\n\n var props = workInProgress.pendingProps;\n var context;\n\n {\n var unmaskedContext = getUnmaskedContext(workInProgress, Component, false);\n context = getMaskedContext(workInProgress, unmaskedContext);\n }\n\n prepareToReadContext(workInProgress, renderExpirationTime);\n var value;\n\n {\n if (Component.prototype && typeof Component.prototype.render === 'function') {\n var componentName = getComponentName(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\n didWarnAboutBadClass[componentName] = true;\n }\n }\n\n if (workInProgress.mode & StrictMode) {\n ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null);\n }\n\n setIsRendering(true);\n ReactCurrentOwner$1.current = workInProgress;\n value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);\n setIsRendering(false);\n } // React DevTools reads this flag.\n\n\n workInProgress.effectTag |= PerformedWork;\n\n if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {\n {\n var _componentName = getComponentName(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\n didWarnAboutModulePatternComponent[_componentName] = true;\n }\n } // Proceed under the assumption that this is a class instance\n\n\n workInProgress.tag = ClassComponent; // Throw out any hooks that were used.\n\n workInProgress.memoizedState = null;\n workInProgress.updateQueue = null; // Push context providers early to prevent context stack mismatches.\n // During mounting we don't know the child context yet as the instance doesn't exist.\n // We will invalidate the child context in finishClassComponent() right after rendering.\n\n var hasContext = false;\n\n if (isContextProvider(Component)) {\n hasContext = true;\n pushContextProvider(workInProgress);\n } else {\n hasContext = false;\n }\n\n workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null;\n initializeUpdateQueue(workInProgress);\n var getDerivedStateFromProps = Component.getDerivedStateFromProps;\n\n if (typeof getDerivedStateFromProps === 'function') {\n applyDerivedStateFromProps(workInProgress, Component, getDerivedStateFromProps, props);\n }\n\n adoptClassInstance(workInProgress, value);\n mountClassInstance(workInProgress, Component, props, renderExpirationTime);\n return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);\n } else {\n // Proceed under the assumption that this is a function component\n workInProgress.tag = FunctionComponent;\n\n {\n\n if ( workInProgress.mode & StrictMode) {\n // Only double-render components with Hooks\n if (workInProgress.memoizedState !== null) {\n value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);\n }\n }\n }\n\n reconcileChildren(null, workInProgress, value, renderExpirationTime);\n\n {\n validateFunctionComponentInDev(workInProgress, Component);\n }\n\n return workInProgress.child;\n }\n}\n\nfunction validateFunctionComponentInDev(workInProgress, 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 (workInProgress.ref !== null) {\n var info = '';\n var ownerName = getCurrentFiberOwnerNameInDevOrNull();\n\n if (ownerName) {\n info += '\\n\\nCheck the render method of `' + ownerName + '`.';\n }\n\n var warningKey = ownerName || workInProgress._debugID || '';\n var debugSource = workInProgress._debugSource;\n\n if (debugSource) {\n warningKey = debugSource.fileName + ':' + debugSource.lineNumber;\n }\n\n if (!didWarnAboutFunctionRefs[warningKey]) {\n didWarnAboutFunctionRefs[warningKey] = true;\n\n error('Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info);\n }\n }\n\n if (typeof Component.getDerivedStateFromProps === 'function') {\n var _componentName2 = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2]) {\n error('%s: Function components do not support getDerivedStateFromProps.', _componentName2);\n\n didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = true;\n }\n }\n\n if (typeof Component.contextType === 'object' && Component.contextType !== null) {\n var _componentName3 = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) {\n error('%s: Function components do not support contextType.', _componentName3);\n\n didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true;\n }\n }\n }\n}\n\nvar SUSPENDED_MARKER = {\n dehydrated: null,\n retryTime: NoWork\n};\n\nfunction shouldRemainOnFallback(suspenseContext, current, workInProgress) {\n // If the context is telling us that we should show a fallback, and we're not\n // already showing content, then we should show the fallback instead.\n return hasSuspenseContext(suspenseContext, ForceSuspenseFallback) && (current === null || current.memoizedState !== null);\n}\n\nfunction updateSuspenseComponent(current, workInProgress, renderExpirationTime) {\n var mode = workInProgress.mode;\n var nextProps = workInProgress.pendingProps; // This is used by DevTools to force a boundary to suspend.\n\n {\n if (shouldSuspend(workInProgress)) {\n workInProgress.effectTag |= DidCapture;\n }\n }\n\n var suspenseContext = suspenseStackCursor.current;\n var nextDidTimeout = false;\n var didSuspend = (workInProgress.effectTag & DidCapture) !== NoEffect;\n\n if (didSuspend || shouldRemainOnFallback(suspenseContext, current)) {\n // Something in this boundary's subtree already suspended. Switch to\n // rendering the fallback children.\n nextDidTimeout = true;\n workInProgress.effectTag &= ~DidCapture;\n } else {\n // Attempting the main content\n if (current === null || current.memoizedState !== null) {\n // This is a new mount or this boundary is already showing a fallback state.\n // Mark this subtree context as having at least one invisible parent that could\n // handle the fallback state.\n // Boundaries without fallbacks or should be avoided are not considered since\n // they cannot handle preferred fallback states.\n if (nextProps.fallback !== undefined && nextProps.unstable_avoidThisFallback !== true) {\n suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);\n }\n }\n }\n\n suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);\n pushSuspenseContext(workInProgress, suspenseContext); // This next part is a bit confusing. If the children timeout, we switch to\n // showing the fallback children in place of the \"primary\" children.\n // However, we don't want to delete the primary children because then their\n // state will be lost (both the React state and the host state, e.g.\n // uncontrolled form inputs). Instead we keep them mounted and hide them.\n // Both the fallback children AND the primary children are rendered at the\n // same time. Once the primary children are un-suspended, we can delete\n // the fallback children — don't need to preserve their state.\n //\n // The two sets of children are siblings in the host environment, but\n // semantically, for purposes of reconciliation, they are two separate sets.\n // So we store them using two fragment fibers.\n //\n // However, we want to avoid allocating extra fibers for every placeholder.\n // They're only necessary when the children time out, because that's the\n // only time when both sets are mounted.\n //\n // So, the extra fragment fibers are only used if the children time out.\n // Otherwise, we render the primary children directly. This requires some\n // custom reconciliation logic to preserve the state of the primary\n // children. It's essentially a very basic form of re-parenting.\n\n if (current === null) {\n // If we're currently hydrating, try to hydrate this boundary.\n // But only if this has a fallback.\n if (nextProps.fallback !== undefined) {\n tryToClaimNextHydratableInstance(workInProgress); // This could've been a dehydrated suspense component.\n } // This is the initial mount. This branch is pretty simple because there's\n // no previous state that needs to be preserved.\n\n\n if (nextDidTimeout) {\n // Mount separate fragments for primary and fallback children.\n var nextFallbackChildren = nextProps.fallback;\n var primaryChildFragment = createFiberFromFragment(null, mode, NoWork, null);\n primaryChildFragment.return = workInProgress;\n\n if ((workInProgress.mode & BlockingMode) === NoMode) {\n // Outside of blocking mode, we commit the effects from the\n // partially completed, timed-out tree, too.\n var progressedState = workInProgress.memoizedState;\n var progressedPrimaryChild = progressedState !== null ? workInProgress.child.child : workInProgress.child;\n primaryChildFragment.child = progressedPrimaryChild;\n var progressedChild = progressedPrimaryChild;\n\n while (progressedChild !== null) {\n progressedChild.return = primaryChildFragment;\n progressedChild = progressedChild.sibling;\n }\n }\n\n var fallbackChildFragment = createFiberFromFragment(nextFallbackChildren, mode, renderExpirationTime, null);\n fallbackChildFragment.return = workInProgress;\n primaryChildFragment.sibling = fallbackChildFragment; // Skip the primary children, and continue working on the\n // fallback children.\n\n workInProgress.memoizedState = SUSPENDED_MARKER;\n workInProgress.child = primaryChildFragment;\n return fallbackChildFragment;\n } else {\n // Mount the primary children without an intermediate fragment fiber.\n var nextPrimaryChildren = nextProps.children;\n workInProgress.memoizedState = null;\n return workInProgress.child = mountChildFibers(workInProgress, null, nextPrimaryChildren, renderExpirationTime);\n }\n } else {\n // This is an update. This branch is more complicated because we need to\n // ensure the state of the primary children is preserved.\n var prevState = current.memoizedState;\n\n if (prevState !== null) {\n // wrapped in a fragment fiber.\n\n\n var currentPrimaryChildFragment = current.child;\n var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;\n\n if (nextDidTimeout) {\n // Still timed out. Reuse the current primary children by cloning\n // its fragment. We're going to skip over these entirely.\n var _nextFallbackChildren2 = nextProps.fallback;\n\n var _primaryChildFragment2 = createWorkInProgress(currentPrimaryChildFragment, currentPrimaryChildFragment.pendingProps);\n\n _primaryChildFragment2.return = workInProgress;\n\n if ((workInProgress.mode & BlockingMode) === NoMode) {\n // Outside of blocking mode, we commit the effects from the\n // partially completed, timed-out tree, too.\n var _progressedState = workInProgress.memoizedState;\n\n var _progressedPrimaryChild = _progressedState !== null ? workInProgress.child.child : workInProgress.child;\n\n if (_progressedPrimaryChild !== currentPrimaryChildFragment.child) {\n _primaryChildFragment2.child = _progressedPrimaryChild;\n var _progressedChild2 = _progressedPrimaryChild;\n\n while (_progressedChild2 !== null) {\n _progressedChild2.return = _primaryChildFragment2;\n _progressedChild2 = _progressedChild2.sibling;\n }\n }\n } // Because primaryChildFragment is a new fiber that we're inserting as the\n // parent of a new tree, we need to set its treeBaseDuration.\n\n\n if ( workInProgress.mode & ProfileMode) {\n // treeBaseDuration is the sum of all the child tree base durations.\n var _treeBaseDuration = 0;\n var _hiddenChild = _primaryChildFragment2.child;\n\n while (_hiddenChild !== null) {\n _treeBaseDuration += _hiddenChild.treeBaseDuration;\n _hiddenChild = _hiddenChild.sibling;\n }\n\n _primaryChildFragment2.treeBaseDuration = _treeBaseDuration;\n } // Clone the fallback child fragment, too. These we'll continue\n // working on.\n\n\n var _fallbackChildFragment2 = createWorkInProgress(currentFallbackChildFragment, _nextFallbackChildren2);\n\n _fallbackChildFragment2.return = workInProgress;\n _primaryChildFragment2.sibling = _fallbackChildFragment2;\n _primaryChildFragment2.childExpirationTime = NoWork; // Skip the primary children, and continue working on the\n // fallback children.\n\n workInProgress.memoizedState = SUSPENDED_MARKER;\n workInProgress.child = _primaryChildFragment2;\n return _fallbackChildFragment2;\n } else {\n // No longer suspended. Switch back to showing the primary children,\n // and remove the intermediate fragment fiber.\n var _nextPrimaryChildren = nextProps.children;\n var currentPrimaryChild = currentPrimaryChildFragment.child;\n var primaryChild = reconcileChildFibers(workInProgress, currentPrimaryChild, _nextPrimaryChildren, renderExpirationTime); // If this render doesn't suspend, we need to delete the fallback\n // children. Wait until the complete phase, after we've confirmed the\n // fallback is no longer needed.\n // TODO: Would it be better to store the fallback fragment on\n // the stateNode?\n // Continue rendering the children, like we normally do.\n\n workInProgress.memoizedState = null;\n return workInProgress.child = primaryChild;\n }\n } else {\n // The current tree has not already timed out. That means the primary\n // children are not wrapped in a fragment fiber.\n var _currentPrimaryChild = current.child;\n\n if (nextDidTimeout) {\n // Timed out. Wrap the children in a fragment fiber to keep them\n // separate from the fallback children.\n var _nextFallbackChildren3 = nextProps.fallback;\n\n var _primaryChildFragment3 = createFiberFromFragment( // It shouldn't matter what the pending props are because we aren't\n // going to render this fragment.\n null, mode, NoWork, null);\n\n _primaryChildFragment3.return = workInProgress;\n _primaryChildFragment3.child = _currentPrimaryChild;\n\n if (_currentPrimaryChild !== null) {\n _currentPrimaryChild.return = _primaryChildFragment3;\n } // Even though we're creating a new fiber, there are no new children,\n // because we're reusing an already mounted tree. So we don't need to\n // schedule a placement.\n // primaryChildFragment.effectTag |= Placement;\n\n\n if ((workInProgress.mode & BlockingMode) === NoMode) {\n // Outside of blocking mode, we commit the effects from the\n // partially completed, timed-out tree, too.\n var _progressedState2 = workInProgress.memoizedState;\n\n var _progressedPrimaryChild2 = _progressedState2 !== null ? workInProgress.child.child : workInProgress.child;\n\n _primaryChildFragment3.child = _progressedPrimaryChild2;\n var _progressedChild3 = _progressedPrimaryChild2;\n\n while (_progressedChild3 !== null) {\n _progressedChild3.return = _primaryChildFragment3;\n _progressedChild3 = _progressedChild3.sibling;\n }\n } // Because primaryChildFragment is a new fiber that we're inserting as the\n // parent of a new tree, we need to set its treeBaseDuration.\n\n\n if ( workInProgress.mode & ProfileMode) {\n // treeBaseDuration is the sum of all the child tree base durations.\n var _treeBaseDuration2 = 0;\n var _hiddenChild2 = _primaryChildFragment3.child;\n\n while (_hiddenChild2 !== null) {\n _treeBaseDuration2 += _hiddenChild2.treeBaseDuration;\n _hiddenChild2 = _hiddenChild2.sibling;\n }\n\n _primaryChildFragment3.treeBaseDuration = _treeBaseDuration2;\n } // Create a fragment from the fallback children, too.\n\n\n var _fallbackChildFragment3 = createFiberFromFragment(_nextFallbackChildren3, mode, renderExpirationTime, null);\n\n _fallbackChildFragment3.return = workInProgress;\n _primaryChildFragment3.sibling = _fallbackChildFragment3;\n _fallbackChildFragment3.effectTag |= Placement;\n _primaryChildFragment3.childExpirationTime = NoWork; // Skip the primary children, and continue working on the\n // fallback children.\n\n workInProgress.memoizedState = SUSPENDED_MARKER;\n workInProgress.child = _primaryChildFragment3;\n return _fallbackChildFragment3;\n } else {\n // Still haven't timed out. Continue rendering the children, like we\n // normally do.\n workInProgress.memoizedState = null;\n var _nextPrimaryChildren2 = nextProps.children;\n return workInProgress.child = reconcileChildFibers(workInProgress, _currentPrimaryChild, _nextPrimaryChildren2, renderExpirationTime);\n }\n }\n }\n}\n\nfunction scheduleWorkOnFiber(fiber, renderExpirationTime) {\n if (fiber.expirationTime < renderExpirationTime) {\n fiber.expirationTime = renderExpirationTime;\n }\n\n var alternate = fiber.alternate;\n\n if (alternate !== null && alternate.expirationTime < renderExpirationTime) {\n alternate.expirationTime = renderExpirationTime;\n }\n\n scheduleWorkOnParentPath(fiber.return, renderExpirationTime);\n}\n\nfunction propagateSuspenseContextChange(workInProgress, firstChild, renderExpirationTime) {\n // Mark any Suspense boundaries with fallbacks as having work to do.\n // If they were previously forced into fallbacks, they may now be able\n // to unblock.\n var node = firstChild;\n\n while (node !== null) {\n if (node.tag === SuspenseComponent) {\n var state = node.memoizedState;\n\n if (state !== null) {\n scheduleWorkOnFiber(node, renderExpirationTime);\n }\n } else if (node.tag === SuspenseListComponent) {\n // If the tail is hidden there might not be an Suspense boundaries\n // to schedule work on. In this case we have to schedule it on the\n // list itself.\n // We don't have to traverse to the children of the list since\n // the list will propagate the change when it rerenders.\n scheduleWorkOnFiber(node, renderExpirationTime);\n } else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === workInProgress) {\n return;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === workInProgress) {\n return;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n}\n\nfunction findLastContentRow(firstChild) {\n // This is going to find the last row among these children that is already\n // showing content on the screen, as opposed to being in fallback state or\n // new. If a row has multiple Suspense boundaries, any of them being in the\n // fallback state, counts as the whole row being in a fallback state.\n // Note that the \"rows\" will be workInProgress, but any nested children\n // will still be current since we haven't rendered them yet. The mounted\n // order may not be the same as the new order. We use the new order.\n var row = firstChild;\n var lastContentRow = null;\n\n while (row !== null) {\n var currentRow = row.alternate; // New rows can't be content rows.\n\n if (currentRow !== null && findFirstSuspended(currentRow) === null) {\n lastContentRow = row;\n }\n\n row = row.sibling;\n }\n\n return lastContentRow;\n}\n\nfunction validateRevealOrder(revealOrder) {\n {\n if (revealOrder !== undefined && revealOrder !== 'forwards' && revealOrder !== 'backwards' && revealOrder !== 'together' && !didWarnAboutRevealOrder[revealOrder]) {\n didWarnAboutRevealOrder[revealOrder] = true;\n\n if (typeof revealOrder === 'string') {\n switch (revealOrder.toLowerCase()) {\n case 'together':\n case 'forwards':\n case 'backwards':\n {\n error('\"%s\" is not a valid value for revealOrder on <SuspenseList />. ' + 'Use lowercase \"%s\" instead.', revealOrder, revealOrder.toLowerCase());\n\n break;\n }\n\n case 'forward':\n case 'backward':\n {\n error('\"%s\" is not a valid value for revealOrder on <SuspenseList />. ' + 'React uses the -s suffix in the spelling. Use \"%ss\" instead.', revealOrder, revealOrder.toLowerCase());\n\n break;\n }\n\n default:\n error('\"%s\" is not a supported revealOrder on <SuspenseList />. ' + 'Did you mean \"together\", \"forwards\" or \"backwards\"?', revealOrder);\n\n break;\n }\n } else {\n error('%s is not a supported value for revealOrder on <SuspenseList />. ' + 'Did you mean \"together\", \"forwards\" or \"backwards\"?', revealOrder);\n }\n }\n }\n}\n\nfunction validateTailOptions(tailMode, revealOrder) {\n {\n if (tailMode !== undefined && !didWarnAboutTailOptions[tailMode]) {\n if (tailMode !== 'collapsed' && tailMode !== 'hidden') {\n didWarnAboutTailOptions[tailMode] = true;\n\n error('\"%s\" is not a supported value for tail on <SuspenseList />. ' + 'Did you mean \"collapsed\" or \"hidden\"?', tailMode);\n } else if (revealOrder !== 'forwards' && revealOrder !== 'backwards') {\n didWarnAboutTailOptions[tailMode] = true;\n\n error('<SuspenseList tail=\"%s\" /> is only valid if revealOrder is ' + '\"forwards\" or \"backwards\". ' + 'Did you mean to specify revealOrder=\"forwards\"?', tailMode);\n }\n }\n }\n}\n\nfunction validateSuspenseListNestedChild(childSlot, index) {\n {\n var isArray = Array.isArray(childSlot);\n var isIterable = !isArray && typeof getIteratorFn(childSlot) === 'function';\n\n if (isArray || isIterable) {\n var type = isArray ? 'array' : 'iterable';\n\n error('A nested %s was passed to row #%s in <SuspenseList />. Wrap it in ' + 'an additional SuspenseList to configure its revealOrder: ' + '<SuspenseList revealOrder=...> ... ' + '<SuspenseList revealOrder=...>{%s}</SuspenseList> ... ' + '</SuspenseList>', type, index, type);\n\n return false;\n }\n }\n\n return true;\n}\n\nfunction validateSuspenseListChildren(children, revealOrder) {\n {\n if ((revealOrder === 'forwards' || revealOrder === 'backwards') && children !== undefined && children !== null && children !== false) {\n if (Array.isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n if (!validateSuspenseListNestedChild(children[i], i)) {\n return;\n }\n }\n } else {\n var iteratorFn = getIteratorFn(children);\n\n if (typeof iteratorFn === 'function') {\n var childrenIterator = iteratorFn.call(children);\n\n if (childrenIterator) {\n var step = childrenIterator.next();\n var _i = 0;\n\n for (; !step.done; step = childrenIterator.next()) {\n if (!validateSuspenseListNestedChild(step.value, _i)) {\n return;\n }\n\n _i++;\n }\n }\n } else {\n error('A single row was passed to a <SuspenseList revealOrder=\"%s\" />. ' + 'This is not useful since it needs multiple rows. ' + 'Did you mean to pass multiple children or an array?', revealOrder);\n }\n }\n }\n }\n}\n\nfunction initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode, lastEffectBeforeRendering) {\n var renderState = workInProgress.memoizedState;\n\n if (renderState === null) {\n workInProgress.memoizedState = {\n isBackwards: isBackwards,\n rendering: null,\n renderingStartTime: 0,\n last: lastContentRow,\n tail: tail,\n tailExpiration: 0,\n tailMode: tailMode,\n lastEffect: lastEffectBeforeRendering\n };\n } else {\n // We can reuse the existing object from previous renders.\n renderState.isBackwards = isBackwards;\n renderState.rendering = null;\n renderState.renderingStartTime = 0;\n renderState.last = lastContentRow;\n renderState.tail = tail;\n renderState.tailExpiration = 0;\n renderState.tailMode = tailMode;\n renderState.lastEffect = lastEffectBeforeRendering;\n }\n} // This can end up rendering this component multiple passes.\n// The first pass splits the children fibers into two sets. A head and tail.\n// We first render the head. If anything is in fallback state, we do another\n// pass through beginWork to rerender all children (including the tail) with\n// the force suspend context. If the first render didn't have anything in\n// in fallback state. Then we render each row in the tail one-by-one.\n// That happens in the completeWork phase without going back to beginWork.\n\n\nfunction updateSuspenseListComponent(current, workInProgress, renderExpirationTime) {\n var nextProps = workInProgress.pendingProps;\n var revealOrder = nextProps.revealOrder;\n var tailMode = nextProps.tail;\n var newChildren = nextProps.children;\n validateRevealOrder(revealOrder);\n validateTailOptions(tailMode, revealOrder);\n validateSuspenseListChildren(newChildren, revealOrder);\n reconcileChildren(current, workInProgress, newChildren, renderExpirationTime);\n var suspenseContext = suspenseStackCursor.current;\n var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);\n\n if (shouldForceFallback) {\n suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);\n workInProgress.effectTag |= DidCapture;\n } else {\n var didSuspendBefore = current !== null && (current.effectTag & DidCapture) !== NoEffect;\n\n if (didSuspendBefore) {\n // If we previously forced a fallback, we need to schedule work\n // on any nested boundaries to let them know to try to render\n // again. This is the same as context updating.\n propagateSuspenseContextChange(workInProgress, workInProgress.child, renderExpirationTime);\n }\n\n suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);\n }\n\n pushSuspenseContext(workInProgress, suspenseContext);\n\n if ((workInProgress.mode & BlockingMode) === NoMode) {\n // Outside of blocking mode, SuspenseList doesn't work so we just\n // use make it a noop by treating it as the default revealOrder.\n workInProgress.memoizedState = null;\n } else {\n switch (revealOrder) {\n case 'forwards':\n {\n var lastContentRow = findLastContentRow(workInProgress.child);\n var tail;\n\n if (lastContentRow === null) {\n // The whole list is part of the tail.\n // TODO: We could fast path by just rendering the tail now.\n tail = workInProgress.child;\n workInProgress.child = null;\n } else {\n // Disconnect the tail rows after the content row.\n // We're going to render them separately later.\n tail = lastContentRow.sibling;\n lastContentRow.sibling = null;\n }\n\n initSuspenseListRenderState(workInProgress, false, // isBackwards\n tail, lastContentRow, tailMode, workInProgress.lastEffect);\n break;\n }\n\n case 'backwards':\n {\n // We're going to find the first row that has existing content.\n // At the same time we're going to reverse the list of everything\n // we pass in the meantime. That's going to be our tail in reverse\n // order.\n var _tail = null;\n var row = workInProgress.child;\n workInProgress.child = null;\n\n while (row !== null) {\n var currentRow = row.alternate; // New rows can't be content rows.\n\n if (currentRow !== null && findFirstSuspended(currentRow) === null) {\n // This is the beginning of the main content.\n workInProgress.child = row;\n break;\n }\n\n var nextRow = row.sibling;\n row.sibling = _tail;\n _tail = row;\n row = nextRow;\n } // TODO: If workInProgress.child is null, we can continue on the tail immediately.\n\n\n initSuspenseListRenderState(workInProgress, true, // isBackwards\n _tail, null, // last\n tailMode, workInProgress.lastEffect);\n break;\n }\n\n case 'together':\n {\n initSuspenseListRenderState(workInProgress, false, // isBackwards\n null, // tail\n null, // last\n undefined, workInProgress.lastEffect);\n break;\n }\n\n default:\n {\n // The default reveal order is the same as not having\n // a boundary.\n workInProgress.memoizedState = null;\n }\n }\n }\n\n return workInProgress.child;\n}\n\nfunction updatePortalComponent(current, workInProgress, renderExpirationTime) {\n pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);\n var nextChildren = workInProgress.pendingProps;\n\n if (current === null) {\n // Portals are special because we don't append the children during mount\n // but at commit. Therefore we need to track insertions which the normal\n // flow doesn't do during mount. This doesn't happen at the root because\n // the root always starts with a \"current\" with a null child.\n // TODO: Consider unifying this with how the root works.\n workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);\n } else {\n reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n }\n\n return workInProgress.child;\n}\n\nfunction updateContextProvider(current, workInProgress, renderExpirationTime) {\n var providerType = workInProgress.type;\n var context = providerType._context;\n var newProps = workInProgress.pendingProps;\n var oldProps = workInProgress.memoizedProps;\n var newValue = newProps.value;\n\n {\n var providerPropTypes = workInProgress.type.propTypes;\n\n if (providerPropTypes) {\n checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider', getCurrentFiberStackInDev);\n }\n }\n\n pushProvider(workInProgress, newValue);\n\n if (oldProps !== null) {\n var oldValue = oldProps.value;\n var changedBits = calculateChangedBits(context, newValue, oldValue);\n\n if (changedBits === 0) {\n // No change. Bailout early if children are the same.\n if (oldProps.children === newProps.children && !hasContextChanged()) {\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n }\n } else {\n // The context value changed. Search for matching consumers and schedule\n // them to update.\n propagateContextChange(workInProgress, context, changedBits, renderExpirationTime);\n }\n }\n\n var newChildren = newProps.children;\n reconcileChildren(current, workInProgress, newChildren, renderExpirationTime);\n return workInProgress.child;\n}\n\nvar hasWarnedAboutUsingContextAsConsumer = false;\n\nfunction updateContextConsumer(current, workInProgress, renderExpirationTime) {\n var context = workInProgress.type; // 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 {\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\n error('Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');\n }\n }\n } else {\n context = context._context;\n }\n }\n\n var newProps = workInProgress.pendingProps;\n var render = newProps.children;\n\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\n prepareToReadContext(workInProgress, renderExpirationTime);\n var newValue = readContext(context, newProps.unstable_observedBits);\n var newChildren;\n\n {\n ReactCurrentOwner$1.current = workInProgress;\n setIsRendering(true);\n newChildren = render(newValue);\n setIsRendering(false);\n } // React DevTools reads this flag.\n\n\n workInProgress.effectTag |= PerformedWork;\n reconcileChildren(current, workInProgress, newChildren, renderExpirationTime);\n return workInProgress.child;\n}\n\nfunction markWorkInProgressReceivedUpdate() {\n didReceiveUpdate = true;\n}\n\nfunction bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime) {\n cancelWorkTimer(workInProgress);\n\n if (current !== null) {\n // Reuse previous dependencies\n workInProgress.dependencies = current.dependencies;\n }\n\n {\n // Don't update \"base\" render times for bailouts.\n stopProfilerTimerIfRunning();\n }\n\n var updateExpirationTime = workInProgress.expirationTime;\n\n if (updateExpirationTime !== NoWork) {\n markUnprocessedUpdateTime(updateExpirationTime);\n } // Check if the children have any pending work.\n\n\n var childExpirationTime = workInProgress.childExpirationTime;\n\n if (childExpirationTime < renderExpirationTime) {\n // The children don't have any work either. We can skip them.\n // TODO: Once we add back resuming, we should check if the children are\n // a work-in-progress set. If so, we need to transfer their effects.\n return null;\n } else {\n // This fiber doesn't have work, but its subtree does. Clone the child\n // fibers and continue.\n cloneChildFibers(current, workInProgress);\n return workInProgress.child;\n }\n}\n\nfunction remountFiber(current, oldWorkInProgress, newWorkInProgress) {\n {\n var returnFiber = oldWorkInProgress.return;\n\n if (returnFiber === null) {\n throw new Error('Cannot swap the root fiber.');\n } // Disconnect from the old current.\n // It will get deleted.\n\n\n current.alternate = null;\n oldWorkInProgress.alternate = null; // Connect to the new tree.\n\n newWorkInProgress.index = oldWorkInProgress.index;\n newWorkInProgress.sibling = oldWorkInProgress.sibling;\n newWorkInProgress.return = oldWorkInProgress.return;\n newWorkInProgress.ref = oldWorkInProgress.ref; // Replace the child/sibling pointers above it.\n\n if (oldWorkInProgress === returnFiber.child) {\n returnFiber.child = newWorkInProgress;\n } else {\n var prevSibling = returnFiber.child;\n\n if (prevSibling === null) {\n throw new Error('Expected parent to have a child.');\n }\n\n while (prevSibling.sibling !== oldWorkInProgress) {\n prevSibling = prevSibling.sibling;\n\n if (prevSibling === null) {\n throw new Error('Expected to find the previous sibling.');\n }\n }\n\n prevSibling.sibling = newWorkInProgress;\n } // Delete the old fiber and place the new one.\n // Since the old fiber is disconnected, we have to schedule it manually.\n\n\n var last = returnFiber.lastEffect;\n\n if (last !== null) {\n last.nextEffect = current;\n returnFiber.lastEffect = current;\n } else {\n returnFiber.firstEffect = returnFiber.lastEffect = current;\n }\n\n current.nextEffect = null;\n current.effectTag = Deletion;\n newWorkInProgress.effectTag |= Placement; // Restart work from the new fiber.\n\n return newWorkInProgress;\n }\n}\n\nfunction beginWork(current, workInProgress, renderExpirationTime) {\n var updateExpirationTime = workInProgress.expirationTime;\n\n {\n if (workInProgress._debugNeedsRemount && current !== null) {\n // This will restart the begin phase with a new fiber.\n return remountFiber(current, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.expirationTime));\n }\n }\n\n if (current !== null) {\n var oldProps = current.memoizedProps;\n var newProps = workInProgress.pendingProps;\n\n if (oldProps !== newProps || hasContextChanged() || ( // Force a re-render if the implementation changed due to hot reload:\n workInProgress.type !== current.type )) {\n // If props or context changed, mark the fiber as having performed work.\n // This may be unset if the props are determined to be equal later (memo).\n didReceiveUpdate = true;\n } else if (updateExpirationTime < renderExpirationTime) {\n didReceiveUpdate = false; // This fiber does not have any pending work. Bailout without entering\n // the begin phase. There's still some bookkeeping we that needs to be done\n // in this optimized path, mostly pushing stuff onto the stack.\n\n switch (workInProgress.tag) {\n case HostRoot:\n pushHostRootContext(workInProgress);\n resetHydrationState();\n break;\n\n case HostComponent:\n pushHostContext(workInProgress);\n\n if (workInProgress.mode & ConcurrentMode && renderExpirationTime !== Never && shouldDeprioritizeSubtree(workInProgress.type, newProps)) {\n {\n markSpawnedWork(Never);\n } // Schedule this fiber to re-render at offscreen priority. Then bailout.\n\n\n workInProgress.expirationTime = workInProgress.childExpirationTime = Never;\n return null;\n }\n\n break;\n\n case ClassComponent:\n {\n var Component = workInProgress.type;\n\n if (isContextProvider(Component)) {\n pushContextProvider(workInProgress);\n }\n\n break;\n }\n\n case HostPortal:\n pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);\n break;\n\n case ContextProvider:\n {\n var newValue = workInProgress.memoizedProps.value;\n pushProvider(workInProgress, newValue);\n break;\n }\n\n case Profiler:\n {\n // Profiler should only call onRender when one of its descendants actually rendered.\n var hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime;\n\n if (hasChildWork) {\n workInProgress.effectTag |= Update;\n }\n }\n\n break;\n\n case SuspenseComponent:\n {\n var state = workInProgress.memoizedState;\n\n if (state !== null) {\n // whether to retry the primary children, or to skip over it and\n // go straight to the fallback. Check the priority of the primary\n // child fragment.\n\n\n var primaryChildFragment = workInProgress.child;\n var primaryChildExpirationTime = primaryChildFragment.childExpirationTime;\n\n if (primaryChildExpirationTime !== NoWork && primaryChildExpirationTime >= renderExpirationTime) {\n // The primary children have pending work. Use the normal path\n // to attempt to render the primary children again.\n return updateSuspenseComponent(current, workInProgress, renderExpirationTime);\n } else {\n pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // The primary children do not have pending work with sufficient\n // priority. Bailout.\n\n var child = bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n\n if (child !== null) {\n // The fallback children have pending work. Skip over the\n // primary children and work on the fallback.\n return child.sibling;\n } else {\n return null;\n }\n }\n } else {\n pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current));\n }\n\n break;\n }\n\n case SuspenseListComponent:\n {\n var didSuspendBefore = (current.effectTag & DidCapture) !== NoEffect;\n\n var _hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime;\n\n if (didSuspendBefore) {\n if (_hasChildWork) {\n // If something was in fallback state last time, and we have all the\n // same children then we're still in progressive loading state.\n // Something might get unblocked by state updates or retries in the\n // tree which will affect the tail. So we need to use the normal\n // path to compute the correct tail.\n return updateSuspenseListComponent(current, workInProgress, renderExpirationTime);\n } // If none of the children had any work, that means that none of\n // them got retried so they'll still be blocked in the same way\n // as before. We can fast bail out.\n\n\n workInProgress.effectTag |= DidCapture;\n } // If nothing suspended before and we're rendering the same children,\n // then the tail doesn't matter. Anything new that suspends will work\n // in the \"together\" mode, so we can continue from the state we had.\n\n\n var renderState = workInProgress.memoizedState;\n\n if (renderState !== null) {\n // Reset to the \"together\" mode in case we've started a different\n // update in the past but didn't complete it.\n renderState.rendering = null;\n renderState.tail = null;\n }\n\n pushSuspenseContext(workInProgress, suspenseStackCursor.current);\n\n if (_hasChildWork) {\n break;\n } else {\n // If none of the children had any work, that means that none of\n // them got retried so they'll still be blocked in the same way\n // as before. We can fast bail out.\n return null;\n }\n }\n }\n\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n } else {\n // An update was scheduled on this fiber, but there are no new props\n // nor legacy context. Set this to false. If an update queue or context\n // consumer produces a changed value, it will set this to true. Otherwise,\n // the component will assume the children have not changed and bail out.\n didReceiveUpdate = false;\n }\n } else {\n didReceiveUpdate = false;\n } // Before entering the begin phase, clear pending update priority.\n // TODO: This assumes that we're about to evaluate the component and process\n // the update queue. However, there's an exception: SimpleMemoComponent\n // sometimes bails out later in the begin phase. This indicates that we should\n // move this assignment out of the common path and into each branch.\n\n\n workInProgress.expirationTime = NoWork;\n\n switch (workInProgress.tag) {\n case IndeterminateComponent:\n {\n return mountIndeterminateComponent(current, workInProgress, workInProgress.type, renderExpirationTime);\n }\n\n case LazyComponent:\n {\n var elementType = workInProgress.elementType;\n return mountLazyComponent(current, workInProgress, elementType, updateExpirationTime, renderExpirationTime);\n }\n\n case FunctionComponent:\n {\n var _Component = workInProgress.type;\n var unresolvedProps = workInProgress.pendingProps;\n var resolvedProps = workInProgress.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps);\n return updateFunctionComponent(current, workInProgress, _Component, resolvedProps, renderExpirationTime);\n }\n\n case ClassComponent:\n {\n var _Component2 = workInProgress.type;\n var _unresolvedProps = workInProgress.pendingProps;\n\n var _resolvedProps = workInProgress.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps);\n\n return updateClassComponent(current, workInProgress, _Component2, _resolvedProps, renderExpirationTime);\n }\n\n case HostRoot:\n return updateHostRoot(current, workInProgress, renderExpirationTime);\n\n case HostComponent:\n return updateHostComponent(current, workInProgress, renderExpirationTime);\n\n case HostText:\n return updateHostText(current, workInProgress);\n\n case SuspenseComponent:\n return updateSuspenseComponent(current, workInProgress, renderExpirationTime);\n\n case HostPortal:\n return updatePortalComponent(current, workInProgress, renderExpirationTime);\n\n case ForwardRef:\n {\n var type = workInProgress.type;\n var _unresolvedProps2 = workInProgress.pendingProps;\n\n var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);\n\n return updateForwardRef(current, workInProgress, type, _resolvedProps2, renderExpirationTime);\n }\n\n case Fragment:\n return updateFragment(current, workInProgress, renderExpirationTime);\n\n case Mode:\n return updateMode(current, workInProgress, renderExpirationTime);\n\n case Profiler:\n return updateProfiler(current, workInProgress, renderExpirationTime);\n\n case ContextProvider:\n return updateContextProvider(current, workInProgress, renderExpirationTime);\n\n case ContextConsumer:\n return updateContextConsumer(current, workInProgress, renderExpirationTime);\n\n case MemoComponent:\n {\n var _type2 = workInProgress.type;\n var _unresolvedProps3 = workInProgress.pendingProps; // Resolve outer props first, then resolve inner props.\n\n var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);\n\n {\n if (workInProgress.type !== workInProgress.elementType) {\n var outerPropTypes = _type2.propTypes;\n\n if (outerPropTypes) {\n checkPropTypes(outerPropTypes, _resolvedProps3, // Resolved for outer only\n 'prop', getComponentName(_type2), getCurrentFiberStackInDev);\n }\n }\n }\n\n _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);\n return updateMemoComponent(current, workInProgress, _type2, _resolvedProps3, updateExpirationTime, renderExpirationTime);\n }\n\n case SimpleMemoComponent:\n {\n return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, updateExpirationTime, renderExpirationTime);\n }\n\n case IncompleteClassComponent:\n {\n var _Component3 = workInProgress.type;\n var _unresolvedProps4 = workInProgress.pendingProps;\n\n var _resolvedProps4 = workInProgress.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4);\n\n return mountIncompleteClassComponent(current, workInProgress, _Component3, _resolvedProps4, renderExpirationTime);\n }\n\n case SuspenseListComponent:\n {\n return updateSuspenseListComponent(current, workInProgress, renderExpirationTime);\n }\n }\n\n {\n {\n throw Error( \"Unknown unit of work tag (\" + workInProgress.tag + \"). This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n}\n\nfunction markUpdate(workInProgress) {\n // Tag the fiber with an update effect. This turns a Placement into\n // a PlacementAndUpdate.\n workInProgress.effectTag |= Update;\n}\n\nfunction markRef$1(workInProgress) {\n workInProgress.effectTag |= Ref;\n}\n\nvar appendAllChildren;\nvar updateHostContainer;\nvar updateHostComponent$1;\nvar updateHostText$1;\n\n{\n // Mutation mode\n appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {\n // We only have the top Fiber that was created but we need recurse down its\n // children to find all the terminal nodes.\n var node = workInProgress.child;\n\n while (node !== null) {\n if (node.tag === HostComponent || node.tag === HostText) {\n appendInitialChild(parent, node.stateNode);\n } else if (node.tag === HostPortal) ; else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === workInProgress) {\n return;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === workInProgress) {\n return;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n };\n\n updateHostContainer = function (workInProgress) {// Noop\n };\n\n updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {\n // If we have an alternate, that means this is an update and we need to\n // schedule a side-effect to do the updates.\n var oldProps = current.memoizedProps;\n\n if (oldProps === newProps) {\n // In mutation mode, this is sufficient for a bailout because\n // we won't touch this node even if children changed.\n return;\n } // If we get updated because one of our children updated, we don't\n // have newProps so we'll have to reuse them.\n // TODO: Split the update API as separate for the props vs. children.\n // Even better would be if children weren't special cased at all tho.\n\n\n var instance = workInProgress.stateNode;\n var currentHostContext = getHostContext(); // TODO: Experiencing an error where oldProps is null. Suggests a host\n // component is hitting the resume path. Figure out why. Possibly\n // related to `hidden`.\n\n var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); // TODO: Type this specific to this type of component.\n\n workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there\n // is a new ref we mark this as an update. All the work is done in commitWork.\n\n if (updatePayload) {\n markUpdate(workInProgress);\n }\n };\n\n updateHostText$1 = function (current, workInProgress, oldText, newText) {\n // If the text differs, mark it as an update. All the work in done in commitWork.\n if (oldText !== newText) {\n markUpdate(workInProgress);\n }\n };\n}\n\nfunction cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {\n switch (renderState.tailMode) {\n case 'hidden':\n {\n // Any insertions at the end of the tail list after this point\n // should be invisible. If there are already mounted boundaries\n // anything before them are not considered for collapsing.\n // Therefore we need to go through the whole tail to find if\n // there are any.\n var tailNode = renderState.tail;\n var lastTailNode = null;\n\n while (tailNode !== null) {\n if (tailNode.alternate !== null) {\n lastTailNode = tailNode;\n }\n\n tailNode = tailNode.sibling;\n } // Next we're simply going to delete all insertions after the\n // last rendered item.\n\n\n if (lastTailNode === null) {\n // All remaining items in the tail are insertions.\n renderState.tail = null;\n } else {\n // Detach the insertion after the last node that was already\n // inserted.\n lastTailNode.sibling = null;\n }\n\n break;\n }\n\n case 'collapsed':\n {\n // Any insertions at the end of the tail list after this point\n // should be invisible. If there are already mounted boundaries\n // anything before them are not considered for collapsing.\n // Therefore we need to go through the whole tail to find if\n // there are any.\n var _tailNode = renderState.tail;\n var _lastTailNode = null;\n\n while (_tailNode !== null) {\n if (_tailNode.alternate !== null) {\n _lastTailNode = _tailNode;\n }\n\n _tailNode = _tailNode.sibling;\n } // Next we're simply going to delete all insertions after the\n // last rendered item.\n\n\n if (_lastTailNode === null) {\n // All remaining items in the tail are insertions.\n if (!hasRenderedATailFallback && renderState.tail !== null) {\n // We suspended during the head. We want to show at least one\n // row at the tail. So we'll keep on and cut off the rest.\n renderState.tail.sibling = null;\n } else {\n renderState.tail = null;\n }\n } else {\n // Detach the insertion after the last node that was already\n // inserted.\n _lastTailNode.sibling = null;\n }\n\n break;\n }\n }\n}\n\nfunction completeWork(current, workInProgress, renderExpirationTime) {\n var newProps = workInProgress.pendingProps;\n\n switch (workInProgress.tag) {\n case IndeterminateComponent:\n case LazyComponent:\n case SimpleMemoComponent:\n case FunctionComponent:\n case ForwardRef:\n case Fragment:\n case Mode:\n case Profiler:\n case ContextConsumer:\n case MemoComponent:\n return null;\n\n case ClassComponent:\n {\n var Component = workInProgress.type;\n\n if (isContextProvider(Component)) {\n popContext(workInProgress);\n }\n\n return null;\n }\n\n case HostRoot:\n {\n popHostContainer(workInProgress);\n popTopLevelContextObject(workInProgress);\n var fiberRoot = workInProgress.stateNode;\n\n if (fiberRoot.pendingContext) {\n fiberRoot.context = fiberRoot.pendingContext;\n fiberRoot.pendingContext = null;\n }\n\n if (current === null || current.child === null) {\n // If we hydrated, pop so that we can delete any remaining children\n // that weren't hydrated.\n var wasHydrated = popHydrationState(workInProgress);\n\n if (wasHydrated) {\n // If we hydrated, then we'll need to schedule an update for\n // the commit side-effects on the root.\n markUpdate(workInProgress);\n }\n }\n\n updateHostContainer(workInProgress);\n return null;\n }\n\n case HostComponent:\n {\n popHostContext(workInProgress);\n var rootContainerInstance = getRootHostContainer();\n var type = workInProgress.type;\n\n if (current !== null && workInProgress.stateNode != null) {\n updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance);\n\n if (current.ref !== workInProgress.ref) {\n markRef$1(workInProgress);\n }\n } else {\n if (!newProps) {\n if (!(workInProgress.stateNode !== null)) {\n {\n throw Error( \"We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n } // This can happen when we abort work.\n\n\n return null;\n }\n\n var currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context\n // \"stack\" as the parent. Then append children as we go in beginWork\n // or completeWork depending on whether we want to add them top->down or\n // bottom->up. Top->down is faster in IE11.\n\n var _wasHydrated = popHydrationState(workInProgress);\n\n if (_wasHydrated) {\n // TODO: Move this and createInstance step into the beginPhase\n // to consolidate.\n if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, currentHostContext)) {\n // If changes to the hydrated node need to be applied at the\n // commit-phase we mark this as such.\n markUpdate(workInProgress);\n }\n } else {\n var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress);\n appendAllChildren(instance, workInProgress, false, false); // This needs to be set before we mount Flare event listeners\n\n workInProgress.stateNode = instance;\n // (eg DOM renderer supports auto-focus for certain elements).\n // Make sure such renderers get scheduled for later work.\n\n\n if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) {\n markUpdate(workInProgress);\n }\n }\n\n if (workInProgress.ref !== null) {\n // If there is a ref on a host node we need to schedule a callback\n markRef$1(workInProgress);\n }\n }\n\n return null;\n }\n\n case HostText:\n {\n var newText = newProps;\n\n if (current && workInProgress.stateNode != null) {\n var oldText = current.memoizedProps; // If we have an alternate, that means this is an update and we need\n // to schedule a side-effect to do the updates.\n\n updateHostText$1(current, workInProgress, oldText, newText);\n } else {\n if (typeof newText !== 'string') {\n if (!(workInProgress.stateNode !== null)) {\n {\n throw Error( \"We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n } // This can happen when we abort work.\n\n }\n\n var _rootContainerInstance = getRootHostContainer();\n\n var _currentHostContext = getHostContext();\n\n var _wasHydrated2 = popHydrationState(workInProgress);\n\n if (_wasHydrated2) {\n if (prepareToHydrateHostTextInstance(workInProgress)) {\n markUpdate(workInProgress);\n }\n } else {\n workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress);\n }\n }\n\n return null;\n }\n\n case SuspenseComponent:\n {\n popSuspenseContext(workInProgress);\n var nextState = workInProgress.memoizedState;\n\n if ((workInProgress.effectTag & DidCapture) !== NoEffect) {\n // Something suspended. Re-render with the fallback children.\n workInProgress.expirationTime = renderExpirationTime; // Do not reset the effect list.\n\n return workInProgress;\n }\n\n var nextDidTimeout = nextState !== null;\n var prevDidTimeout = false;\n\n if (current === null) {\n if (workInProgress.memoizedProps.fallback !== undefined) {\n popHydrationState(workInProgress);\n }\n } else {\n var prevState = current.memoizedState;\n prevDidTimeout = prevState !== null;\n\n if (!nextDidTimeout && prevState !== null) {\n // We just switched from the fallback to the normal children.\n // Delete the fallback.\n // TODO: Would it be better to store the fallback fragment on\n // the stateNode during the begin phase?\n var currentFallbackChild = current.child.sibling;\n\n if (currentFallbackChild !== null) {\n // Deletions go at the beginning of the return fiber's effect list\n var first = workInProgress.firstEffect;\n\n if (first !== null) {\n workInProgress.firstEffect = currentFallbackChild;\n currentFallbackChild.nextEffect = first;\n } else {\n workInProgress.firstEffect = workInProgress.lastEffect = currentFallbackChild;\n currentFallbackChild.nextEffect = null;\n }\n\n currentFallbackChild.effectTag = Deletion;\n }\n }\n }\n\n if (nextDidTimeout && !prevDidTimeout) {\n // If this subtreee is running in blocking mode we can suspend,\n // otherwise we won't suspend.\n // TODO: This will still suspend a synchronous tree if anything\n // in the concurrent tree already suspended during this render.\n // This is a known bug.\n if ((workInProgress.mode & BlockingMode) !== NoMode) {\n // TODO: Move this back to throwException because this is too late\n // if this is a large tree which is common for initial loads. We\n // don't know if we should restart a render or not until we get\n // this marker, and this is too late.\n // If this render already had a ping or lower pri updates,\n // and this is the first time we know we're going to suspend we\n // should be able to immediately restart from within throwException.\n var hasInvisibleChildContext = current === null && workInProgress.memoizedProps.unstable_avoidThisFallback !== true;\n\n if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {\n // If this was in an invisible tree or a new render, then showing\n // this boundary is ok.\n renderDidSuspend();\n } else {\n // Otherwise, we're going to have to hide content so we should\n // suspend for longer if possible.\n renderDidSuspendDelayIfPossible();\n }\n }\n }\n\n {\n // TODO: Only schedule updates if these values are non equal, i.e. it changed.\n if (nextDidTimeout || prevDidTimeout) {\n // If this boundary just timed out, schedule an effect to attach a\n // retry listener to the promise. This flag is also used to hide the\n // primary children. In mutation mode, we also need the flag to\n // *unhide* children that were previously hidden, so check if this\n // is currently timed out, too.\n workInProgress.effectTag |= Update;\n }\n }\n\n return null;\n }\n\n case HostPortal:\n popHostContainer(workInProgress);\n updateHostContainer(workInProgress);\n return null;\n\n case ContextProvider:\n // Pop provider fiber\n popProvider(workInProgress);\n return null;\n\n case IncompleteClassComponent:\n {\n // Same as class component case. I put it down here so that the tags are\n // sequential to ensure this switch is compiled to a jump table.\n var _Component = workInProgress.type;\n\n if (isContextProvider(_Component)) {\n popContext(workInProgress);\n }\n\n return null;\n }\n\n case SuspenseListComponent:\n {\n popSuspenseContext(workInProgress);\n var renderState = workInProgress.memoizedState;\n\n if (renderState === null) {\n // We're running in the default, \"independent\" mode.\n // We don't do anything in this mode.\n return null;\n }\n\n var didSuspendAlready = (workInProgress.effectTag & DidCapture) !== NoEffect;\n var renderedTail = renderState.rendering;\n\n if (renderedTail === null) {\n // We just rendered the head.\n if (!didSuspendAlready) {\n // This is the first pass. We need to figure out if anything is still\n // suspended in the rendered set.\n // If new content unsuspended, but there's still some content that\n // didn't. Then we need to do a second pass that forces everything\n // to keep showing their fallbacks.\n // We might be suspended if something in this render pass suspended, or\n // something in the previous committed pass suspended. Otherwise,\n // there's no chance so we can skip the expensive call to\n // findFirstSuspended.\n var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.effectTag & DidCapture) === NoEffect);\n\n if (!cannotBeSuspended) {\n var row = workInProgress.child;\n\n while (row !== null) {\n var suspended = findFirstSuspended(row);\n\n if (suspended !== null) {\n didSuspendAlready = true;\n workInProgress.effectTag |= DidCapture;\n cutOffTailIfNeeded(renderState, false); // If this is a newly suspended tree, it might not get committed as\n // part of the second pass. In that case nothing will subscribe to\n // its thennables. Instead, we'll transfer its thennables to the\n // SuspenseList so that it can retry if they resolve.\n // There might be multiple of these in the list but since we're\n // going to wait for all of them anyway, it doesn't really matter\n // which ones gets to ping. In theory we could get clever and keep\n // track of how many dependencies remain but it gets tricky because\n // in the meantime, we can add/remove/change items and dependencies.\n // We might bail out of the loop before finding any but that\n // doesn't matter since that means that the other boundaries that\n // we did find already has their listeners attached.\n\n var newThennables = suspended.updateQueue;\n\n if (newThennables !== null) {\n workInProgress.updateQueue = newThennables;\n workInProgress.effectTag |= Update;\n } // Rerender the whole list, but this time, we'll force fallbacks\n // to stay in place.\n // Reset the effect list before doing the second pass since that's now invalid.\n\n\n if (renderState.lastEffect === null) {\n workInProgress.firstEffect = null;\n }\n\n workInProgress.lastEffect = renderState.lastEffect; // Reset the child fibers to their original state.\n\n resetChildFibers(workInProgress, renderExpirationTime); // Set up the Suspense Context to force suspense and immediately\n // rerender the children.\n\n pushSuspenseContext(workInProgress, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));\n return workInProgress.child;\n }\n\n row = row.sibling;\n }\n }\n } else {\n cutOffTailIfNeeded(renderState, false);\n } // Next we're going to render the tail.\n\n } else {\n // Append the rendered row to the child list.\n if (!didSuspendAlready) {\n var _suspended = findFirstSuspended(renderedTail);\n\n if (_suspended !== null) {\n workInProgress.effectTag |= DidCapture;\n didSuspendAlready = true; // Ensure we transfer the update queue to the parent so that it doesn't\n // get lost if this row ends up dropped during a second pass.\n\n var _newThennables = _suspended.updateQueue;\n\n if (_newThennables !== null) {\n workInProgress.updateQueue = _newThennables;\n workInProgress.effectTag |= Update;\n }\n\n cutOffTailIfNeeded(renderState, true); // This might have been modified.\n\n if (renderState.tail === null && renderState.tailMode === 'hidden' && !renderedTail.alternate) {\n // We need to delete the row we just rendered.\n // Reset the effect list to what it was before we rendered this\n // child. The nested children have already appended themselves.\n var lastEffect = workInProgress.lastEffect = renderState.lastEffect; // Remove any effects that were appended after this point.\n\n if (lastEffect !== null) {\n lastEffect.nextEffect = null;\n } // We're done.\n\n\n return null;\n }\n } else if ( // The time it took to render last row is greater than time until\n // the expiration.\n now() * 2 - renderState.renderingStartTime > renderState.tailExpiration && renderExpirationTime > Never) {\n // We have now passed our CPU deadline and we'll just give up further\n // attempts to render the main content and only render fallbacks.\n // The assumption is that this is usually faster.\n workInProgress.effectTag |= DidCapture;\n didSuspendAlready = true;\n cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this\n // to get it started back up to attempt the next item. If we can show\n // them, then they really have the same priority as this render.\n // So we'll pick it back up the very next render pass once we've had\n // an opportunity to yield for paint.\n\n var nextPriority = renderExpirationTime - 1;\n workInProgress.expirationTime = workInProgress.childExpirationTime = nextPriority;\n\n {\n markSpawnedWork(nextPriority);\n }\n }\n }\n\n if (renderState.isBackwards) {\n // The effect list of the backwards tail will have been added\n // to the end. This breaks the guarantee that life-cycles fire in\n // sibling order but that isn't a strong guarantee promised by React.\n // Especially since these might also just pop in during future commits.\n // Append to the beginning of the list.\n renderedTail.sibling = workInProgress.child;\n workInProgress.child = renderedTail;\n } else {\n var previousSibling = renderState.last;\n\n if (previousSibling !== null) {\n previousSibling.sibling = renderedTail;\n } else {\n workInProgress.child = renderedTail;\n }\n\n renderState.last = renderedTail;\n }\n }\n\n if (renderState.tail !== null) {\n // We still have tail rows to render.\n if (renderState.tailExpiration === 0) {\n // Heuristic for how long we're willing to spend rendering rows\n // until we just give up and show what we have so far.\n var TAIL_EXPIRATION_TIMEOUT_MS = 500;\n renderState.tailExpiration = now() + TAIL_EXPIRATION_TIMEOUT_MS; // TODO: This is meant to mimic the train model or JND but this\n // is a per component value. It should really be since the start\n // of the total render or last commit. Consider using something like\n // globalMostRecentFallbackTime. That doesn't account for being\n // suspended for part of the time or when it's a new render.\n // It should probably use a global start time value instead.\n } // Pop a row.\n\n\n var next = renderState.tail;\n renderState.rendering = next;\n renderState.tail = next.sibling;\n renderState.lastEffect = workInProgress.lastEffect;\n renderState.renderingStartTime = now();\n next.sibling = null; // Restore the context.\n // TODO: We can probably just avoid popping it instead and only\n // setting it the first time we go from not suspended to suspended.\n\n var suspenseContext = suspenseStackCursor.current;\n\n if (didSuspendAlready) {\n suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);\n } else {\n suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);\n }\n\n pushSuspenseContext(workInProgress, suspenseContext); // Do a pass over the next row.\n\n return next;\n }\n\n return null;\n }\n }\n\n {\n {\n throw Error( \"Unknown unit of work tag (\" + workInProgress.tag + \"). This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n}\n\nfunction unwindWork(workInProgress, renderExpirationTime) {\n switch (workInProgress.tag) {\n case ClassComponent:\n {\n var Component = workInProgress.type;\n\n if (isContextProvider(Component)) {\n popContext(workInProgress);\n }\n\n var effectTag = workInProgress.effectTag;\n\n if (effectTag & ShouldCapture) {\n workInProgress.effectTag = effectTag & ~ShouldCapture | DidCapture;\n return workInProgress;\n }\n\n return null;\n }\n\n case HostRoot:\n {\n popHostContainer(workInProgress);\n popTopLevelContextObject(workInProgress);\n var _effectTag = workInProgress.effectTag;\n\n if (!((_effectTag & DidCapture) === NoEffect)) {\n {\n throw Error( \"The root failed to unmount after an error. This is likely a bug in React. Please file an issue.\" );\n }\n }\n\n workInProgress.effectTag = _effectTag & ~ShouldCapture | DidCapture;\n return workInProgress;\n }\n\n case HostComponent:\n {\n // TODO: popHydrationState\n popHostContext(workInProgress);\n return null;\n }\n\n case SuspenseComponent:\n {\n popSuspenseContext(workInProgress);\n\n var _effectTag2 = workInProgress.effectTag;\n\n if (_effectTag2 & ShouldCapture) {\n workInProgress.effectTag = _effectTag2 & ~ShouldCapture | DidCapture; // Captured a suspense effect. Re-render the boundary.\n\n return workInProgress;\n }\n\n return null;\n }\n\n case SuspenseListComponent:\n {\n popSuspenseContext(workInProgress); // SuspenseList doesn't actually catch anything. It should've been\n // caught by a nested boundary. If not, it should bubble through.\n\n return null;\n }\n\n case HostPortal:\n popHostContainer(workInProgress);\n return null;\n\n case ContextProvider:\n popProvider(workInProgress);\n return null;\n\n default:\n return null;\n }\n}\n\nfunction unwindInterruptedWork(interruptedWork) {\n switch (interruptedWork.tag) {\n case ClassComponent:\n {\n var childContextTypes = interruptedWork.type.childContextTypes;\n\n if (childContextTypes !== null && childContextTypes !== undefined) {\n popContext(interruptedWork);\n }\n\n break;\n }\n\n case HostRoot:\n {\n popHostContainer(interruptedWork);\n popTopLevelContextObject(interruptedWork);\n break;\n }\n\n case HostComponent:\n {\n popHostContext(interruptedWork);\n break;\n }\n\n case HostPortal:\n popHostContainer(interruptedWork);\n break;\n\n case SuspenseComponent:\n popSuspenseContext(interruptedWork);\n break;\n\n case SuspenseListComponent:\n popSuspenseContext(interruptedWork);\n break;\n\n case ContextProvider:\n popProvider(interruptedWork);\n break;\n }\n}\n\nfunction createCapturedValue(value, source) {\n // If the value is an error, call this function immediately after it is thrown\n // so the stack is accurate.\n return {\n value: value,\n source: source,\n stack: getStackByFiberInDevAndProd(source)\n };\n}\n\nfunction logCapturedError(capturedError) {\n\n var error = capturedError.error;\n\n {\n var componentName = capturedError.componentName,\n componentStack = capturedError.componentStack,\n errorBoundaryName = capturedError.errorBoundaryName,\n errorBoundaryFound = capturedError.errorBoundaryFound,\n willRetry = capturedError.willRetry; // Browsers support silencing uncaught errors by calling\n // `preventDefault()` in window `error` handler.\n // We record this information as an expando on the error.\n\n if (error != null && error._suppressLogging) {\n if (errorBoundaryFound && willRetry) {\n // The error is recoverable and was silenced.\n // Ignore it and don't print the stack addendum.\n // This is handy for testing error boundaries without noise.\n return;\n } // The error is fatal. Since the silencing might have\n // been accidental, we'll surface it anyway.\n // However, the browser would have silenced the original error\n // so we'll print it first, and then print the stack addendum.\n\n\n console['error'](error); // Don't transform to our wrapper\n // For a more detailed description of this block, see:\n // https://github.com/facebook/react/pull/13384\n }\n\n var componentNameMessage = componentName ? \"The above error occurred in the <\" + componentName + \"> component:\" : 'The above error occurred in one of your React components:';\n var errorBoundaryMessage; // errorBoundaryFound check is sufficient; errorBoundaryName check is to satisfy Flow.\n\n if (errorBoundaryFound && errorBoundaryName) {\n if (willRetry) {\n errorBoundaryMessage = \"React will try to recreate this component tree from scratch \" + (\"using the error boundary you provided, \" + errorBoundaryName + \".\");\n } else {\n errorBoundaryMessage = \"This error was initially handled by the error boundary \" + errorBoundaryName + \".\\n\" + \"Recreating the tree from scratch failed so React will unmount the tree.\";\n }\n } else {\n errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.\\n' + 'Visit https://fb.me/react-error-boundaries to learn more about error boundaries.';\n }\n\n var combinedMessage = \"\" + componentNameMessage + componentStack + \"\\n\\n\" + (\"\" + errorBoundaryMessage); // In development, we provide our own message with just the component stack.\n // We don't include the original error message and JS stack because the browser\n // has already printed it. Even if the application swallows the error, it is still\n // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils.\n\n console['error'](combinedMessage); // Don't transform to our wrapper\n }\n}\n\nvar didWarnAboutUndefinedSnapshotBeforeUpdate = null;\n\n{\n didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();\n}\n\nvar PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set;\nfunction logError(boundary, errorInfo) {\n var source = errorInfo.source;\n var stack = errorInfo.stack;\n\n if (stack === null && source !== null) {\n stack = getStackByFiberInDevAndProd(source);\n }\n\n var capturedError = {\n componentName: source !== null ? getComponentName(source.type) : null,\n componentStack: stack !== null ? stack : '',\n error: errorInfo.value,\n errorBoundary: null,\n errorBoundaryName: null,\n errorBoundaryFound: false,\n willRetry: false\n };\n\n if (boundary !== null && boundary.tag === ClassComponent) {\n capturedError.errorBoundary = boundary.stateNode;\n capturedError.errorBoundaryName = getComponentName(boundary.type);\n capturedError.errorBoundaryFound = true;\n capturedError.willRetry = true;\n }\n\n try {\n logCapturedError(capturedError);\n } catch (e) {\n // This method must not throw, or React internal state will get messed up.\n // If console.error is overridden, or logCapturedError() shows a dialog that throws,\n // we want to report this error outside of the normal stack as a last resort.\n // https://github.com/facebook/react/issues/13188\n setTimeout(function () {\n throw e;\n });\n }\n}\n\nvar callComponentWillUnmountWithTimer = function (current, instance) {\n startPhaseTimer(current, 'componentWillUnmount');\n instance.props = current.memoizedProps;\n instance.state = current.memoizedState;\n instance.componentWillUnmount();\n stopPhaseTimer();\n}; // Capture errors so they don't interrupt unmounting.\n\n\nfunction safelyCallComponentWillUnmount(current, instance) {\n {\n invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current, instance);\n\n if (hasCaughtError()) {\n var unmountError = clearCaughtError();\n captureCommitPhaseError(current, unmountError);\n }\n }\n}\n\nfunction safelyDetachRef(current) {\n var ref = current.ref;\n\n if (ref !== null) {\n if (typeof ref === 'function') {\n {\n invokeGuardedCallback(null, ref, null, null);\n\n if (hasCaughtError()) {\n var refError = clearCaughtError();\n captureCommitPhaseError(current, refError);\n }\n }\n } else {\n ref.current = null;\n }\n }\n}\n\nfunction safelyCallDestroy(current, destroy) {\n {\n invokeGuardedCallback(null, destroy, null);\n\n if (hasCaughtError()) {\n var error = clearCaughtError();\n captureCommitPhaseError(current, error);\n }\n }\n}\n\nfunction commitBeforeMutationLifeCycles(current, finishedWork) {\n switch (finishedWork.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n case Block:\n {\n return;\n }\n\n case ClassComponent:\n {\n if (finishedWork.effectTag & Snapshot) {\n if (current !== null) {\n var prevProps = current.memoizedProps;\n var prevState = current.memoizedState;\n startPhaseTimer(finishedWork, 'getSnapshotBeforeUpdate');\n var instance = finishedWork.stateNode; // We could update instance props and state here,\n // but instead we rely on them being set during last render.\n // TODO: revisit this when we implement resuming.\n\n {\n if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n if (instance.props !== finishedWork.memoizedProps) {\n error('Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n\n if (instance.state !== finishedWork.memoizedState) {\n error('Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n }\n }\n\n var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);\n\n {\n var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;\n\n if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) {\n didWarnSet.add(finishedWork.type);\n\n error('%s.getSnapshotBeforeUpdate(): A snapshot value (or null) ' + 'must be returned. You have returned undefined.', getComponentName(finishedWork.type));\n }\n }\n\n instance.__reactInternalSnapshotBeforeUpdate = snapshot;\n stopPhaseTimer();\n }\n }\n\n return;\n }\n\n case HostRoot:\n case HostComponent:\n case HostText:\n case HostPortal:\n case IncompleteClassComponent:\n // Nothing to do for these component types\n return;\n }\n\n {\n {\n throw Error( \"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n}\n\nfunction commitHookEffectListUnmount(tag, finishedWork) {\n var updateQueue = finishedWork.updateQueue;\n var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;\n\n if (lastEffect !== null) {\n var firstEffect = lastEffect.next;\n var effect = firstEffect;\n\n do {\n if ((effect.tag & tag) === tag) {\n // Unmount\n var destroy = effect.destroy;\n effect.destroy = undefined;\n\n if (destroy !== undefined) {\n destroy();\n }\n }\n\n effect = effect.next;\n } while (effect !== firstEffect);\n }\n}\n\nfunction commitHookEffectListMount(tag, finishedWork) {\n var updateQueue = finishedWork.updateQueue;\n var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;\n\n if (lastEffect !== null) {\n var firstEffect = lastEffect.next;\n var effect = firstEffect;\n\n do {\n if ((effect.tag & tag) === tag) {\n // Mount\n var create = effect.create;\n effect.destroy = create();\n\n {\n var destroy = effect.destroy;\n\n if (destroy !== undefined && typeof destroy !== 'function') {\n var addendum = void 0;\n\n if (destroy === null) {\n addendum = ' You returned null. If your effect does not require clean ' + 'up, return undefined (or nothing).';\n } else if (typeof destroy.then === 'function') {\n addendum = '\\n\\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. ' + 'Instead, write the async function inside your effect ' + 'and call it immediately:\\n\\n' + 'useEffect(() => {\\n' + ' async function fetchData() {\\n' + ' // You can await here\\n' + ' const response = await MyAPI.getData(someId);\\n' + ' // ...\\n' + ' }\\n' + ' fetchData();\\n' + \"}, [someId]); // Or [] if effect doesn't need props or state\\n\\n\" + 'Learn more about data fetching with Hooks: https://fb.me/react-hooks-data-fetching';\n } else {\n addendum = ' You returned: ' + destroy;\n }\n\n error('An effect function must not return anything besides a function, ' + 'which is used for clean-up.%s%s', addendum, getStackByFiberInDevAndProd(finishedWork));\n }\n }\n }\n\n effect = effect.next;\n } while (effect !== firstEffect);\n }\n}\n\nfunction commitPassiveHookEffects(finishedWork) {\n if ((finishedWork.effectTag & Passive) !== NoEffect) {\n switch (finishedWork.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n case Block:\n {\n // TODO (#17945) We should call all passive destroy functions (for all fibers)\n // before calling any create functions. The current approach only serializes\n // these for a single fiber.\n commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork);\n commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);\n break;\n }\n }\n }\n}\n\nfunction commitLifeCycles(finishedRoot, current, finishedWork, committedExpirationTime) {\n switch (finishedWork.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n case Block:\n {\n // At this point layout effects have already been destroyed (during mutation phase).\n // This is done to prevent sibling component effects from interfering with each other,\n // e.g. a destroy function in one component should never override a ref set\n // by a create function in another component during the same commit.\n commitHookEffectListMount(Layout | HasEffect, finishedWork);\n\n return;\n }\n\n case ClassComponent:\n {\n var instance = finishedWork.stateNode;\n\n if (finishedWork.effectTag & Update) {\n if (current === null) {\n startPhaseTimer(finishedWork, 'componentDidMount'); // We could update instance props and state here,\n // but instead we rely on them being set during last render.\n // TODO: revisit this when we implement resuming.\n\n {\n if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n if (instance.props !== finishedWork.memoizedProps) {\n error('Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n\n if (instance.state !== finishedWork.memoizedState) {\n error('Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n }\n }\n\n instance.componentDidMount();\n stopPhaseTimer();\n } else {\n var prevProps = finishedWork.elementType === finishedWork.type ? current.memoizedProps : resolveDefaultProps(finishedWork.type, current.memoizedProps);\n var prevState = current.memoizedState;\n startPhaseTimer(finishedWork, 'componentDidUpdate'); // We could update instance props and state here,\n // but instead we rely on them being set during last render.\n // TODO: revisit this when we implement resuming.\n\n {\n if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n if (instance.props !== finishedWork.memoizedProps) {\n error('Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n\n if (instance.state !== finishedWork.memoizedState) {\n error('Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n }\n }\n\n instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);\n stopPhaseTimer();\n }\n }\n\n var updateQueue = finishedWork.updateQueue;\n\n if (updateQueue !== null) {\n {\n if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n if (instance.props !== finishedWork.memoizedProps) {\n error('Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n\n if (instance.state !== finishedWork.memoizedState) {\n error('Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n }\n } // We could update instance props and state here,\n // but instead we rely on them being set during last render.\n // TODO: revisit this when we implement resuming.\n\n\n commitUpdateQueue(finishedWork, updateQueue, instance);\n }\n\n return;\n }\n\n case HostRoot:\n {\n var _updateQueue = finishedWork.updateQueue;\n\n if (_updateQueue !== null) {\n var _instance = null;\n\n if (finishedWork.child !== null) {\n switch (finishedWork.child.tag) {\n case HostComponent:\n _instance = getPublicInstance(finishedWork.child.stateNode);\n break;\n\n case ClassComponent:\n _instance = finishedWork.child.stateNode;\n break;\n }\n }\n\n commitUpdateQueue(finishedWork, _updateQueue, _instance);\n }\n\n return;\n }\n\n case HostComponent:\n {\n var _instance2 = finishedWork.stateNode; // Renderers may schedule work to be done after host components are mounted\n // (eg DOM renderer may schedule auto-focus for inputs and form controls).\n // These effects should only be committed when components are first mounted,\n // aka when there is no current/alternate.\n\n if (current === null && finishedWork.effectTag & Update) {\n var type = finishedWork.type;\n var props = finishedWork.memoizedProps;\n commitMount(_instance2, type, props);\n }\n\n return;\n }\n\n case HostText:\n {\n // We have no life-cycles associated with text.\n return;\n }\n\n case HostPortal:\n {\n // We have no life-cycles associated with portals.\n return;\n }\n\n case Profiler:\n {\n {\n var onRender = finishedWork.memoizedProps.onRender;\n\n if (typeof onRender === 'function') {\n {\n onRender(finishedWork.memoizedProps.id, current === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime(), finishedRoot.memoizedInteractions);\n }\n }\n }\n\n return;\n }\n\n case SuspenseComponent:\n {\n commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);\n return;\n }\n\n case SuspenseListComponent:\n case IncompleteClassComponent:\n case FundamentalComponent:\n case ScopeComponent:\n return;\n }\n\n {\n {\n throw Error( \"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n}\n\nfunction hideOrUnhideAllChildren(finishedWork, isHidden) {\n {\n // We only have the top Fiber that was inserted but we need to recurse down its\n // children to find all the terminal nodes.\n var node = finishedWork;\n\n while (true) {\n if (node.tag === HostComponent) {\n var instance = node.stateNode;\n\n if (isHidden) {\n hideInstance(instance);\n } else {\n unhideInstance(node.stateNode, node.memoizedProps);\n }\n } else if (node.tag === HostText) {\n var _instance3 = node.stateNode;\n\n if (isHidden) {\n hideTextInstance(_instance3);\n } else {\n unhideTextInstance(_instance3, node.memoizedProps);\n }\n } else if (node.tag === SuspenseComponent && node.memoizedState !== null && node.memoizedState.dehydrated === null) {\n // Found a nested Suspense component that timed out. Skip over the\n // primary child fragment, which should remain hidden.\n var fallbackChildFragment = node.child.sibling;\n fallbackChildFragment.return = node;\n node = fallbackChildFragment;\n continue;\n } else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === finishedWork) {\n return;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === finishedWork) {\n return;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n }\n}\n\nfunction commitAttachRef(finishedWork) {\n var ref = finishedWork.ref;\n\n if (ref !== null) {\n var instance = finishedWork.stateNode;\n var instanceToUse;\n\n switch (finishedWork.tag) {\n case HostComponent:\n instanceToUse = getPublicInstance(instance);\n break;\n\n default:\n instanceToUse = instance;\n } // Moved outside to ensure DCE works with this flag\n\n if (typeof ref === 'function') {\n ref(instanceToUse);\n } else {\n {\n if (!ref.hasOwnProperty('current')) {\n error('Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().%s', getComponentName(finishedWork.type), getStackByFiberInDevAndProd(finishedWork));\n }\n }\n\n ref.current = instanceToUse;\n }\n }\n}\n\nfunction commitDetachRef(current) {\n var currentRef = current.ref;\n\n if (currentRef !== null) {\n if (typeof currentRef === 'function') {\n currentRef(null);\n } else {\n currentRef.current = null;\n }\n }\n} // User-originating errors (lifecycles and refs) should not interrupt\n// deletion, so don't let them throw. Host-originating errors should\n// interrupt deletion, so it's okay\n\n\nfunction commitUnmount(finishedRoot, current, renderPriorityLevel) {\n onCommitUnmount(current);\n\n switch (current.tag) {\n case FunctionComponent:\n case ForwardRef:\n case MemoComponent:\n case SimpleMemoComponent:\n case Block:\n {\n var updateQueue = current.updateQueue;\n\n if (updateQueue !== null) {\n var lastEffect = updateQueue.lastEffect;\n\n if (lastEffect !== null) {\n var firstEffect = lastEffect.next;\n\n {\n // When the owner fiber is deleted, the destroy function of a passive\n // effect hook is called during the synchronous commit phase. This is\n // a concession to implementation complexity. Calling it in the\n // passive effect phase (like they usually are, when dependencies\n // change during an update) would require either traversing the\n // children of the deleted fiber again, or including unmount effects\n // as part of the fiber effect list.\n //\n // Because this is during the sync commit phase, we need to change\n // the priority.\n //\n // TODO: Reconsider this implementation trade off.\n var priorityLevel = renderPriorityLevel > NormalPriority ? NormalPriority : renderPriorityLevel;\n runWithPriority$1(priorityLevel, function () {\n var effect = firstEffect;\n\n do {\n var _destroy = effect.destroy;\n\n if (_destroy !== undefined) {\n safelyCallDestroy(current, _destroy);\n }\n\n effect = effect.next;\n } while (effect !== firstEffect);\n });\n }\n }\n }\n\n return;\n }\n\n case ClassComponent:\n {\n safelyDetachRef(current);\n var instance = current.stateNode;\n\n if (typeof instance.componentWillUnmount === 'function') {\n safelyCallComponentWillUnmount(current, instance);\n }\n\n return;\n }\n\n case HostComponent:\n {\n\n safelyDetachRef(current);\n return;\n }\n\n case HostPortal:\n {\n // TODO: this is recursive.\n // We are also not using this parent because\n // the portal will get pushed immediately.\n {\n unmountHostComponents(finishedRoot, current, renderPriorityLevel);\n }\n\n return;\n }\n\n case FundamentalComponent:\n {\n\n return;\n }\n\n case DehydratedFragment:\n {\n\n return;\n }\n\n case ScopeComponent:\n {\n\n return;\n }\n }\n}\n\nfunction commitNestedUnmounts(finishedRoot, root, renderPriorityLevel) {\n // While we're inside a removed host node we don't want to call\n // removeChild on the inner nodes because they're removed by the top\n // call anyway. We also want to call componentWillUnmount on all\n // composites before this host node is removed from the tree. Therefore\n // we do an inner loop while we're still inside the host node.\n var node = root;\n\n while (true) {\n commitUnmount(finishedRoot, node, renderPriorityLevel); // Visit children because they may contain more composite or host nodes.\n // Skip portals because commitUnmount() currently visits them recursively.\n\n if (node.child !== null && ( // If we use mutation we drill down into portals using commitUnmount above.\n // If we don't use mutation we drill down into portals here instead.\n node.tag !== HostPortal)) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === root) {\n return;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === root) {\n return;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n}\n\nfunction detachFiber(current) {\n var alternate = current.alternate; // Cut off the return pointers to disconnect it from the tree. Ideally, we\n // should clear the child pointer of the parent alternate to let this\n // get GC:ed but we don't know which for sure which parent is the current\n // one so we'll settle for GC:ing the subtree of this child. This child\n // itself will be GC:ed when the parent updates the next time.\n\n current.return = null;\n current.child = null;\n current.memoizedState = null;\n current.updateQueue = null;\n current.dependencies = null;\n current.alternate = null;\n current.firstEffect = null;\n current.lastEffect = null;\n current.pendingProps = null;\n current.memoizedProps = null;\n current.stateNode = null;\n\n if (alternate !== null) {\n detachFiber(alternate);\n }\n}\n\nfunction getHostParentFiber(fiber) {\n var parent = fiber.return;\n\n while (parent !== null) {\n if (isHostParent(parent)) {\n return parent;\n }\n\n parent = parent.return;\n }\n\n {\n {\n throw Error( \"Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n}\n\nfunction isHostParent(fiber) {\n return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;\n}\n\nfunction getHostSibling(fiber) {\n // We're going to search forward into the tree until we find a sibling host\n // node. Unfortunately, if multiple insertions are done in a row we have to\n // search past them. This leads to exponential search for the next sibling.\n // TODO: Find a more efficient way to do this.\n var node = fiber;\n\n siblings: while (true) {\n // If we didn't find anything, let's try the next sibling.\n while (node.sibling === null) {\n if (node.return === null || isHostParent(node.return)) {\n // If we pop out of the root or hit the parent the fiber we are the\n // last sibling.\n return null;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n\n while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {\n // If it is not host node and, we might have a host node inside it.\n // Try to search down until we find one.\n if (node.effectTag & Placement) {\n // If we don't have a child, try the siblings instead.\n continue siblings;\n } // If we don't have a child, try the siblings instead.\n // We also skip portals because they are not part of this host tree.\n\n\n if (node.child === null || node.tag === HostPortal) {\n continue siblings;\n } else {\n node.child.return = node;\n node = node.child;\n }\n } // Check if this host node is stable or about to be placed.\n\n\n if (!(node.effectTag & Placement)) {\n // Found it!\n return node.stateNode;\n }\n }\n}\n\nfunction commitPlacement(finishedWork) {\n\n\n var parentFiber = getHostParentFiber(finishedWork); // Note: these two variables *must* always be updated together.\n\n var parent;\n var isContainer;\n var parentStateNode = parentFiber.stateNode;\n\n switch (parentFiber.tag) {\n case HostComponent:\n parent = parentStateNode;\n isContainer = false;\n break;\n\n case HostRoot:\n parent = parentStateNode.containerInfo;\n isContainer = true;\n break;\n\n case HostPortal:\n parent = parentStateNode.containerInfo;\n isContainer = true;\n break;\n\n case FundamentalComponent:\n\n // eslint-disable-next-line-no-fallthrough\n\n default:\n {\n {\n throw Error( \"Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n }\n\n if (parentFiber.effectTag & ContentReset) {\n // Reset the text content of the parent before doing any insertions\n resetTextContent(parent); // Clear ContentReset from the effect tag\n\n parentFiber.effectTag &= ~ContentReset;\n }\n\n var before = getHostSibling(finishedWork); // We only have the top Fiber that was inserted but we need to recurse down its\n // children to find all the terminal nodes.\n\n if (isContainer) {\n insertOrAppendPlacementNodeIntoContainer(finishedWork, before, parent);\n } else {\n insertOrAppendPlacementNode(finishedWork, before, parent);\n }\n}\n\nfunction insertOrAppendPlacementNodeIntoContainer(node, before, parent) {\n var tag = node.tag;\n var isHost = tag === HostComponent || tag === HostText;\n\n if (isHost || enableFundamentalAPI ) {\n var stateNode = isHost ? node.stateNode : node.stateNode.instance;\n\n if (before) {\n insertInContainerBefore(parent, stateNode, before);\n } else {\n appendChildToContainer(parent, stateNode);\n }\n } else if (tag === HostPortal) ; else {\n var child = node.child;\n\n if (child !== null) {\n insertOrAppendPlacementNodeIntoContainer(child, before, parent);\n var sibling = child.sibling;\n\n while (sibling !== null) {\n insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);\n sibling = sibling.sibling;\n }\n }\n }\n}\n\nfunction insertOrAppendPlacementNode(node, before, parent) {\n var tag = node.tag;\n var isHost = tag === HostComponent || tag === HostText;\n\n if (isHost || enableFundamentalAPI ) {\n var stateNode = isHost ? node.stateNode : node.stateNode.instance;\n\n if (before) {\n insertBefore(parent, stateNode, before);\n } else {\n appendChild(parent, stateNode);\n }\n } else if (tag === HostPortal) ; else {\n var child = node.child;\n\n if (child !== null) {\n insertOrAppendPlacementNode(child, before, parent);\n var sibling = child.sibling;\n\n while (sibling !== null) {\n insertOrAppendPlacementNode(sibling, before, parent);\n sibling = sibling.sibling;\n }\n }\n }\n}\n\nfunction unmountHostComponents(finishedRoot, current, renderPriorityLevel) {\n // We only have the top Fiber that was deleted but we need to recurse down its\n // children to find all the terminal nodes.\n var node = current; // Each iteration, currentParent is populated with node's host parent if not\n // currentParentIsValid.\n\n var currentParentIsValid = false; // Note: these two variables *must* always be updated together.\n\n var currentParent;\n var currentParentIsContainer;\n\n while (true) {\n if (!currentParentIsValid) {\n var parent = node.return;\n\n findParent: while (true) {\n if (!(parent !== null)) {\n {\n throw Error( \"Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n var parentStateNode = parent.stateNode;\n\n switch (parent.tag) {\n case HostComponent:\n currentParent = parentStateNode;\n currentParentIsContainer = false;\n break findParent;\n\n case HostRoot:\n currentParent = parentStateNode.containerInfo;\n currentParentIsContainer = true;\n break findParent;\n\n case HostPortal:\n currentParent = parentStateNode.containerInfo;\n currentParentIsContainer = true;\n break findParent;\n\n }\n\n parent = parent.return;\n }\n\n currentParentIsValid = true;\n }\n\n if (node.tag === HostComponent || node.tag === HostText) {\n commitNestedUnmounts(finishedRoot, node, renderPriorityLevel); // After all the children have unmounted, it is now safe to remove the\n // node from the tree.\n\n if (currentParentIsContainer) {\n removeChildFromContainer(currentParent, node.stateNode);\n } else {\n removeChild(currentParent, node.stateNode);\n } // Don't visit children because we already visited them.\n\n } else if (node.tag === HostPortal) {\n if (node.child !== null) {\n // When we go into a portal, it becomes the parent to remove from.\n // We will reassign it back when we pop the portal on the way up.\n currentParent = node.stateNode.containerInfo;\n currentParentIsContainer = true; // Visit children because portals might contain host components.\n\n node.child.return = node;\n node = node.child;\n continue;\n }\n } else {\n commitUnmount(finishedRoot, node, renderPriorityLevel); // Visit children because we may find more host components below.\n\n if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n }\n\n if (node === current) {\n return;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === current) {\n return;\n }\n\n node = node.return;\n\n if (node.tag === HostPortal) {\n // When we go out of the portal, we need to restore the parent.\n // Since we don't keep a stack of them, we will search for it.\n currentParentIsValid = false;\n }\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n}\n\nfunction commitDeletion(finishedRoot, current, renderPriorityLevel) {\n {\n // Recursively delete all host nodes from the parent.\n // Detach refs and call componentWillUnmount() on the whole subtree.\n unmountHostComponents(finishedRoot, current, renderPriorityLevel);\n }\n\n detachFiber(current);\n}\n\nfunction commitWork(current, finishedWork) {\n\n switch (finishedWork.tag) {\n case FunctionComponent:\n case ForwardRef:\n case MemoComponent:\n case SimpleMemoComponent:\n case Block:\n {\n // Layout effects are destroyed during the mutation phase so that all\n // destroy functions for all fibers are called before any create functions.\n // This prevents sibling component effects from interfering with each other,\n // e.g. a destroy function in one component should never override a ref set\n // by a create function in another component during the same commit.\n commitHookEffectListUnmount(Layout | HasEffect, finishedWork);\n return;\n }\n\n case ClassComponent:\n {\n return;\n }\n\n case HostComponent:\n {\n var instance = finishedWork.stateNode;\n\n if (instance != null) {\n // Commit the work prepared earlier.\n var newProps = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps\n // as the newProps. The updatePayload will contain the real change in\n // this case.\n\n var oldProps = current !== null ? current.memoizedProps : newProps;\n var type = finishedWork.type; // TODO: Type the updateQueue to be specific to host components.\n\n var updatePayload = finishedWork.updateQueue;\n finishedWork.updateQueue = null;\n\n if (updatePayload !== null) {\n commitUpdate(instance, updatePayload, type, oldProps, newProps);\n }\n }\n\n return;\n }\n\n case HostText:\n {\n if (!(finishedWork.stateNode !== null)) {\n {\n throw Error( \"This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n var textInstance = finishedWork.stateNode;\n var newText = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps\n // as the newProps. The updatePayload will contain the real change in\n // this case.\n\n var oldText = current !== null ? current.memoizedProps : newText;\n commitTextUpdate(textInstance, oldText, newText);\n return;\n }\n\n case HostRoot:\n {\n {\n var _root = finishedWork.stateNode;\n\n if (_root.hydrate) {\n // We've just hydrated. No need to hydrate again.\n _root.hydrate = false;\n commitHydratedContainer(_root.containerInfo);\n }\n }\n\n return;\n }\n\n case Profiler:\n {\n return;\n }\n\n case SuspenseComponent:\n {\n commitSuspenseComponent(finishedWork);\n attachSuspenseRetryListeners(finishedWork);\n return;\n }\n\n case SuspenseListComponent:\n {\n attachSuspenseRetryListeners(finishedWork);\n return;\n }\n\n case IncompleteClassComponent:\n {\n return;\n }\n }\n\n {\n {\n throw Error( \"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n}\n\nfunction commitSuspenseComponent(finishedWork) {\n var newState = finishedWork.memoizedState;\n var newDidTimeout;\n var primaryChildParent = finishedWork;\n\n if (newState === null) {\n newDidTimeout = false;\n } else {\n newDidTimeout = true;\n primaryChildParent = finishedWork.child;\n markCommitTimeOfFallback();\n }\n\n if ( primaryChildParent !== null) {\n hideOrUnhideAllChildren(primaryChildParent, newDidTimeout);\n }\n}\n\nfunction commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {\n\n var newState = finishedWork.memoizedState;\n\n if (newState === null) {\n var current = finishedWork.alternate;\n\n if (current !== null) {\n var prevState = current.memoizedState;\n\n if (prevState !== null) {\n var suspenseInstance = prevState.dehydrated;\n\n if (suspenseInstance !== null) {\n commitHydratedSuspenseInstance(suspenseInstance);\n }\n }\n }\n }\n}\n\nfunction attachSuspenseRetryListeners(finishedWork) {\n // If this boundary just timed out, then it will have a set of thenables.\n // For each thenable, attach a listener so that when it resolves, React\n // attempts to re-render the boundary in the primary (pre-timeout) state.\n var thenables = finishedWork.updateQueue;\n\n if (thenables !== null) {\n finishedWork.updateQueue = null;\n var retryCache = finishedWork.stateNode;\n\n if (retryCache === null) {\n retryCache = finishedWork.stateNode = new PossiblyWeakSet();\n }\n\n thenables.forEach(function (thenable) {\n // Memoize using the boundary fiber to prevent redundant listeners.\n var retry = resolveRetryThenable.bind(null, finishedWork, thenable);\n\n if (!retryCache.has(thenable)) {\n {\n if (thenable.__reactDoNotTraceInteractions !== true) {\n retry = tracing.unstable_wrap(retry);\n }\n }\n\n retryCache.add(thenable);\n thenable.then(retry, retry);\n }\n });\n }\n}\n\nfunction commitResetTextContent(current) {\n\n resetTextContent(current.stateNode);\n}\n\nvar PossiblyWeakMap$1 = typeof WeakMap === 'function' ? WeakMap : Map;\n\nfunction createRootErrorUpdate(fiber, errorInfo, expirationTime) {\n var update = createUpdate(expirationTime, null); // Unmount the root by rendering null.\n\n update.tag = CaptureUpdate; // Caution: React DevTools currently depends on this property\n // being called \"element\".\n\n update.payload = {\n element: null\n };\n var error = errorInfo.value;\n\n update.callback = function () {\n onUncaughtError(error);\n logError(fiber, errorInfo);\n };\n\n return update;\n}\n\nfunction createClassErrorUpdate(fiber, errorInfo, expirationTime) {\n var update = createUpdate(expirationTime, null);\n update.tag = CaptureUpdate;\n var getDerivedStateFromError = fiber.type.getDerivedStateFromError;\n\n if (typeof getDerivedStateFromError === 'function') {\n var error$1 = errorInfo.value;\n\n update.payload = function () {\n logError(fiber, errorInfo);\n return getDerivedStateFromError(error$1);\n };\n }\n\n var inst = fiber.stateNode;\n\n if (inst !== null && typeof inst.componentDidCatch === 'function') {\n update.callback = function callback() {\n {\n markFailedErrorBoundaryForHotReloading(fiber);\n }\n\n if (typeof getDerivedStateFromError !== 'function') {\n // To preserve the preexisting retry behavior of error boundaries,\n // we keep track of which ones already failed during this batch.\n // This gets reset before we yield back to the browser.\n // TODO: Warn in strict mode if getDerivedStateFromError is\n // not defined.\n markLegacyErrorBoundaryAsFailed(this); // Only log here if componentDidCatch is the only error boundary method defined\n\n logError(fiber, errorInfo);\n }\n\n var error$1 = errorInfo.value;\n var stack = errorInfo.stack;\n this.componentDidCatch(error$1, {\n componentStack: stack !== null ? stack : ''\n });\n\n {\n if (typeof getDerivedStateFromError !== 'function') {\n // If componentDidCatch is the only error boundary method defined,\n // then it needs to call setState to recover from errors.\n // If no state update is scheduled then the boundary will swallow the error.\n if (fiber.expirationTime !== Sync) {\n error('%s: Error boundaries should implement getDerivedStateFromError(). ' + 'In that method, return a state update to display an error message or fallback UI.', getComponentName(fiber.type) || 'Unknown');\n }\n }\n }\n };\n } else {\n update.callback = function () {\n markFailedErrorBoundaryForHotReloading(fiber);\n };\n }\n\n return update;\n}\n\nfunction attachPingListener(root, renderExpirationTime, thenable) {\n // Attach a listener to the promise to \"ping\" the root and retry. But\n // only if one does not already exist for the current render expiration\n // time (which acts like a \"thread ID\" here).\n var pingCache = root.pingCache;\n var threadIDs;\n\n if (pingCache === null) {\n pingCache = root.pingCache = new PossiblyWeakMap$1();\n threadIDs = new Set();\n pingCache.set(thenable, threadIDs);\n } else {\n threadIDs = pingCache.get(thenable);\n\n if (threadIDs === undefined) {\n threadIDs = new Set();\n pingCache.set(thenable, threadIDs);\n }\n }\n\n if (!threadIDs.has(renderExpirationTime)) {\n // Memoize using the thread ID to prevent redundant listeners.\n threadIDs.add(renderExpirationTime);\n var ping = pingSuspendedRoot.bind(null, root, thenable, renderExpirationTime);\n thenable.then(ping, ping);\n }\n}\n\nfunction throwException(root, returnFiber, sourceFiber, value, renderExpirationTime) {\n // The source fiber did not complete.\n sourceFiber.effectTag |= Incomplete; // Its effect list is no longer valid.\n\n sourceFiber.firstEffect = sourceFiber.lastEffect = null;\n\n if (value !== null && typeof value === 'object' && typeof value.then === 'function') {\n // This is a thenable.\n var thenable = value;\n\n if ((sourceFiber.mode & BlockingMode) === NoMode) {\n // Reset the memoizedState to what it was before we attempted\n // to render it.\n var currentSource = sourceFiber.alternate;\n\n if (currentSource) {\n sourceFiber.updateQueue = currentSource.updateQueue;\n sourceFiber.memoizedState = currentSource.memoizedState;\n sourceFiber.expirationTime = currentSource.expirationTime;\n } else {\n sourceFiber.updateQueue = null;\n sourceFiber.memoizedState = null;\n }\n }\n\n var hasInvisibleParentBoundary = hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext); // Schedule the nearest Suspense to re-render the timed out view.\n\n var _workInProgress = returnFiber;\n\n do {\n if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress, hasInvisibleParentBoundary)) {\n // Found the nearest boundary.\n // Stash the promise on the boundary fiber. If the boundary times out, we'll\n // attach another listener to flip the boundary back to its normal state.\n var thenables = _workInProgress.updateQueue;\n\n if (thenables === null) {\n var updateQueue = new Set();\n updateQueue.add(thenable);\n _workInProgress.updateQueue = updateQueue;\n } else {\n thenables.add(thenable);\n } // If the boundary is outside of blocking mode, we should *not*\n // suspend the commit. Pretend as if the suspended component rendered\n // null and keep rendering. In the commit phase, we'll schedule a\n // subsequent synchronous update to re-render the Suspense.\n //\n // Note: It doesn't matter whether the component that suspended was\n // inside a blocking mode tree. If the Suspense is outside of it, we\n // should *not* suspend the commit.\n\n\n if ((_workInProgress.mode & BlockingMode) === NoMode) {\n _workInProgress.effectTag |= DidCapture; // We're going to commit this fiber even though it didn't complete.\n // But we shouldn't call any lifecycle methods or callbacks. Remove\n // all lifecycle effect tags.\n\n sourceFiber.effectTag &= ~(LifecycleEffectMask | Incomplete);\n\n if (sourceFiber.tag === ClassComponent) {\n var currentSourceFiber = sourceFiber.alternate;\n\n if (currentSourceFiber === null) {\n // This is a new mount. Change the tag so it's not mistaken for a\n // completed class component. For example, we should not call\n // componentWillUnmount if it is deleted.\n sourceFiber.tag = IncompleteClassComponent;\n } else {\n // When we try rendering again, we should not reuse the current fiber,\n // since it's known to be in an inconsistent state. Use a force update to\n // prevent a bail out.\n var update = createUpdate(Sync, null);\n update.tag = ForceUpdate;\n enqueueUpdate(sourceFiber, update);\n }\n } // The source fiber did not complete. Mark it with Sync priority to\n // indicate that it still has pending work.\n\n\n sourceFiber.expirationTime = Sync; // Exit without suspending.\n\n return;\n } // Confirmed that the boundary is in a concurrent mode tree. Continue\n // with the normal suspend path.\n //\n // After this we'll use a set of heuristics to determine whether this\n // render pass will run to completion or restart or \"suspend\" the commit.\n // The actual logic for this is spread out in different places.\n //\n // This first principle is that if we're going to suspend when we complete\n // a root, then we should also restart if we get an update or ping that\n // might unsuspend it, and vice versa. The only reason to suspend is\n // because you think you might want to restart before committing. However,\n // it doesn't make sense to restart only while in the period we're suspended.\n //\n // Restarting too aggressively is also not good because it starves out any\n // intermediate loading state. So we use heuristics to determine when.\n // Suspense Heuristics\n //\n // If nothing threw a Promise or all the same fallbacks are already showing,\n // then don't suspend/restart.\n //\n // If this is an initial render of a new tree of Suspense boundaries and\n // those trigger a fallback, then don't suspend/restart. We want to ensure\n // that we can show the initial loading state as quickly as possible.\n //\n // If we hit a \"Delayed\" case, such as when we'd switch from content back into\n // a fallback, then we should always suspend/restart. SuspenseConfig applies to\n // this case. If none is defined, JND is used instead.\n //\n // If we're already showing a fallback and it gets \"retried\", allowing us to show\n // another level, but there's still an inner boundary that would show a fallback,\n // then we suspend/restart for 500ms since the last time we showed a fallback\n // anywhere in the tree. This effectively throttles progressive loading into a\n // consistent train of commits. This also gives us an opportunity to restart to\n // get to the completed state slightly earlier.\n //\n // If there's ambiguity due to batching it's resolved in preference of:\n // 1) \"delayed\", 2) \"initial render\", 3) \"retry\".\n //\n // We want to ensure that a \"busy\" state doesn't get force committed. We want to\n // ensure that new initial loading states can commit as soon as possible.\n\n\n attachPingListener(root, renderExpirationTime, thenable);\n _workInProgress.effectTag |= ShouldCapture;\n _workInProgress.expirationTime = renderExpirationTime;\n return;\n } // This boundary already captured during this render. Continue to the next\n // boundary.\n\n\n _workInProgress = _workInProgress.return;\n } while (_workInProgress !== null); // No boundary was found. Fallthrough to error mode.\n // TODO: Use invariant so the message is stripped in prod?\n\n\n value = new Error((getComponentName(sourceFiber.type) || 'A React component') + ' suspended while rendering, but no fallback UI was specified.\\n' + '\\n' + 'Add a <Suspense fallback=...> component higher in the tree to ' + 'provide a loading indicator or placeholder to display.' + getStackByFiberInDevAndProd(sourceFiber));\n } // We didn't find a boundary that could handle this type of exception. Start\n // over and traverse parent path again, this time treating the exception\n // as an error.\n\n\n renderDidError();\n value = createCapturedValue(value, sourceFiber);\n var workInProgress = returnFiber;\n\n do {\n switch (workInProgress.tag) {\n case HostRoot:\n {\n var _errorInfo = value;\n workInProgress.effectTag |= ShouldCapture;\n workInProgress.expirationTime = renderExpirationTime;\n\n var _update = createRootErrorUpdate(workInProgress, _errorInfo, renderExpirationTime);\n\n enqueueCapturedUpdate(workInProgress, _update);\n return;\n }\n\n case ClassComponent:\n // Capture and retry\n var errorInfo = value;\n var ctor = workInProgress.type;\n var instance = workInProgress.stateNode;\n\n if ((workInProgress.effectTag & DidCapture) === NoEffect && (typeof ctor.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance))) {\n workInProgress.effectTag |= ShouldCapture;\n workInProgress.expirationTime = renderExpirationTime; // Schedule the error boundary to re-render using updated state\n\n var _update2 = createClassErrorUpdate(workInProgress, errorInfo, renderExpirationTime);\n\n enqueueCapturedUpdate(workInProgress, _update2);\n return;\n }\n\n break;\n }\n\n workInProgress = workInProgress.return;\n } while (workInProgress !== null);\n}\n\nvar ceil = Math.ceil;\nvar ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,\n ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner,\n IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing;\nvar NoContext =\n/* */\n0;\nvar BatchedContext =\n/* */\n1;\nvar EventContext =\n/* */\n2;\nvar DiscreteEventContext =\n/* */\n4;\nvar LegacyUnbatchedContext =\n/* */\n8;\nvar RenderContext =\n/* */\n16;\nvar CommitContext =\n/* */\n32;\nvar RootIncomplete = 0;\nvar RootFatalErrored = 1;\nvar RootErrored = 2;\nvar RootSuspended = 3;\nvar RootSuspendedWithDelay = 4;\nvar RootCompleted = 5;\n// Describes where we are in the React execution stack\nvar executionContext = NoContext; // The root we're working on\n\nvar workInProgressRoot = null; // The fiber we're working on\n\nvar workInProgress = null; // The expiration time we're rendering\n\nvar renderExpirationTime$1 = NoWork; // Whether to root completed, errored, suspended, etc.\n\nvar workInProgressRootExitStatus = RootIncomplete; // A fatal error, if one is thrown\n\nvar workInProgressRootFatalError = null; // Most recent event time among processed updates during this render.\n// This is conceptually a time stamp but expressed in terms of an ExpirationTime\n// because we deal mostly with expiration times in the hot path, so this avoids\n// the conversion happening in the hot path.\n\nvar workInProgressRootLatestProcessedExpirationTime = Sync;\nvar workInProgressRootLatestSuspenseTimeout = Sync;\nvar workInProgressRootCanSuspendUsingConfig = null; // The work left over by components that were visited during this render. Only\n// includes unprocessed updates, not work in bailed out children.\n\nvar workInProgressRootNextUnprocessedUpdateTime = NoWork; // If we're pinged while rendering we don't always restart immediately.\n// This flag determines if it might be worthwhile to restart if an opportunity\n// happens latere.\n\nvar workInProgressRootHasPendingPing = false; // The most recent time we committed a fallback. This lets us ensure a train\n// model where we don't commit new loading states in too quick succession.\n\nvar globalMostRecentFallbackTime = 0;\nvar FALLBACK_THROTTLE_MS = 500;\nvar nextEffect = null;\nvar hasUncaughtError = false;\nvar firstUncaughtError = null;\nvar legacyErrorBoundariesThatAlreadyFailed = null;\nvar rootDoesHavePassiveEffects = false;\nvar rootWithPendingPassiveEffects = null;\nvar pendingPassiveEffectsRenderPriority = NoPriority;\nvar pendingPassiveEffectsExpirationTime = NoWork;\nvar rootsWithPendingDiscreteUpdates = null; // Use these to prevent an infinite loop of nested updates\n\nvar NESTED_UPDATE_LIMIT = 50;\nvar nestedUpdateCount = 0;\nvar rootWithNestedUpdates = null;\nvar NESTED_PASSIVE_UPDATE_LIMIT = 50;\nvar nestedPassiveUpdateCount = 0;\nvar interruptedBy = null; // Marks the need to reschedule pending interactions at these expiration times\n// during the commit phase. This enables them to be traced across components\n// that spawn new work during render. E.g. hidden boundaries, suspended SSR\n// hydration or SuspenseList.\n\nvar spawnedWorkDuringRender = null; // Expiration times are computed by adding to the current time (the start\n// time). However, if two updates are scheduled within the same event, we\n// should treat their start times as simultaneous, even if the actual clock\n// time has advanced between the first and second call.\n// In other words, because expiration times determine how updates are batched,\n// we want all updates of like priority that occur within the same event to\n// receive the same expiration time. Otherwise we get tearing.\n\nvar currentEventTime = NoWork;\nfunction requestCurrentTimeForUpdate() {\n if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {\n // We're inside React, so it's fine to read the actual time.\n return msToExpirationTime(now());\n } // We're not inside React, so we may be in the middle of a browser event.\n\n\n if (currentEventTime !== NoWork) {\n // Use the same start time for all updates until we enter React again.\n return currentEventTime;\n } // This is the first update since React yielded. Compute a new start time.\n\n\n currentEventTime = msToExpirationTime(now());\n return currentEventTime;\n}\nfunction getCurrentTime() {\n return msToExpirationTime(now());\n}\nfunction computeExpirationForFiber(currentTime, fiber, suspenseConfig) {\n var mode = fiber.mode;\n\n if ((mode & BlockingMode) === NoMode) {\n return Sync;\n }\n\n var priorityLevel = getCurrentPriorityLevel();\n\n if ((mode & ConcurrentMode) === NoMode) {\n return priorityLevel === ImmediatePriority ? Sync : Batched;\n }\n\n if ((executionContext & RenderContext) !== NoContext) {\n // Use whatever time we're already rendering\n // TODO: Should there be a way to opt out, like with `runWithPriority`?\n return renderExpirationTime$1;\n }\n\n var expirationTime;\n\n if (suspenseConfig !== null) {\n // Compute an expiration time based on the Suspense timeout.\n expirationTime = computeSuspenseExpiration(currentTime, suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION);\n } else {\n // Compute an expiration time based on the Scheduler priority.\n switch (priorityLevel) {\n case ImmediatePriority:\n expirationTime = Sync;\n break;\n\n case UserBlockingPriority$1:\n // TODO: Rename this to computeUserBlockingExpiration\n expirationTime = computeInteractiveExpiration(currentTime);\n break;\n\n case NormalPriority:\n case LowPriority:\n // TODO: Handle LowPriority\n // TODO: Rename this to... something better.\n expirationTime = computeAsyncExpiration(currentTime);\n break;\n\n case IdlePriority:\n expirationTime = Idle;\n break;\n\n default:\n {\n {\n throw Error( \"Expected a valid priority level\" );\n }\n }\n\n }\n } // If we're in the middle of rendering a tree, do not update at the same\n // expiration time that is already rendering.\n // TODO: We shouldn't have to do this if the update is on a different root.\n // Refactor computeExpirationForFiber + scheduleUpdate so we have access to\n // the root when we check for this condition.\n\n\n if (workInProgressRoot !== null && expirationTime === renderExpirationTime$1) {\n // This is a trick to move this update into a separate batch\n expirationTime -= 1;\n }\n\n return expirationTime;\n}\nfunction scheduleUpdateOnFiber(fiber, expirationTime) {\n checkForNestedUpdates();\n warnAboutRenderPhaseUpdatesInDEV(fiber);\n var root = markUpdateTimeFromFiberToRoot(fiber, expirationTime);\n\n if (root === null) {\n warnAboutUpdateOnUnmountedFiberInDEV(fiber);\n return;\n }\n\n checkForInterruption(fiber, expirationTime);\n recordScheduleUpdate(); // TODO: computeExpirationForFiber also reads the priority. Pass the\n // priority as an argument to that function and this one.\n\n var priorityLevel = getCurrentPriorityLevel();\n\n if (expirationTime === Sync) {\n if ( // Check if we're inside unbatchedUpdates\n (executionContext & LegacyUnbatchedContext) !== NoContext && // Check if we're not already rendering\n (executionContext & (RenderContext | CommitContext)) === NoContext) {\n // Register pending interactions on the root to avoid losing traced interaction data.\n schedulePendingInteractions(root, expirationTime); // This is a legacy edge case. The initial mount of a ReactDOM.render-ed\n // root inside of batchedUpdates should be synchronous, but layout updates\n // should be deferred until the end of the batch.\n\n performSyncWorkOnRoot(root);\n } else {\n ensureRootIsScheduled(root);\n schedulePendingInteractions(root, expirationTime);\n\n if (executionContext === NoContext) {\n // Flush the synchronous work now, unless we're already working or inside\n // a batch. This is intentionally inside scheduleUpdateOnFiber instead of\n // scheduleCallbackForFiber to preserve the ability to schedule a callback\n // without immediately flushing it. We only do this for user-initiated\n // updates, to preserve historical behavior of legacy mode.\n flushSyncCallbackQueue();\n }\n }\n } else {\n ensureRootIsScheduled(root);\n schedulePendingInteractions(root, expirationTime);\n }\n\n if ((executionContext & DiscreteEventContext) !== NoContext && ( // Only updates at user-blocking priority or greater are considered\n // discrete, even inside a discrete event.\n priorityLevel === UserBlockingPriority$1 || priorityLevel === ImmediatePriority)) {\n // This is the result of a discrete event. Track the lowest priority\n // discrete update per root so we can flush them early, if needed.\n if (rootsWithPendingDiscreteUpdates === null) {\n rootsWithPendingDiscreteUpdates = new Map([[root, expirationTime]]);\n } else {\n var lastDiscreteTime = rootsWithPendingDiscreteUpdates.get(root);\n\n if (lastDiscreteTime === undefined || lastDiscreteTime > expirationTime) {\n rootsWithPendingDiscreteUpdates.set(root, expirationTime);\n }\n }\n }\n}\nvar scheduleWork = scheduleUpdateOnFiber; // This is split into a separate function so we can mark a fiber with pending\n// work without treating it as a typical update that originates from an event;\n// e.g. retrying a Suspense boundary isn't an update, but it does schedule work\n// on a fiber.\n\nfunction markUpdateTimeFromFiberToRoot(fiber, expirationTime) {\n // Update the source fiber's expiration time\n if (fiber.expirationTime < expirationTime) {\n fiber.expirationTime = expirationTime;\n }\n\n var alternate = fiber.alternate;\n\n if (alternate !== null && alternate.expirationTime < expirationTime) {\n alternate.expirationTime = expirationTime;\n } // Walk the parent path to the root and update the child expiration time.\n\n\n var node = fiber.return;\n var root = null;\n\n if (node === null && fiber.tag === HostRoot) {\n root = fiber.stateNode;\n } else {\n while (node !== null) {\n alternate = node.alternate;\n\n if (node.childExpirationTime < expirationTime) {\n node.childExpirationTime = expirationTime;\n\n if (alternate !== null && alternate.childExpirationTime < expirationTime) {\n alternate.childExpirationTime = expirationTime;\n }\n } else if (alternate !== null && alternate.childExpirationTime < expirationTime) {\n alternate.childExpirationTime = expirationTime;\n }\n\n if (node.return === null && node.tag === HostRoot) {\n root = node.stateNode;\n break;\n }\n\n node = node.return;\n }\n }\n\n if (root !== null) {\n if (workInProgressRoot === root) {\n // Received an update to a tree that's in the middle of rendering. Mark\n // that's unprocessed work on this root.\n markUnprocessedUpdateTime(expirationTime);\n\n if (workInProgressRootExitStatus === RootSuspendedWithDelay) {\n // The root already suspended with a delay, which means this render\n // definitely won't finish. Since we have a new update, let's mark it as\n // suspended now, right before marking the incoming update. This has the\n // effect of interrupting the current render and switching to the update.\n // TODO: This happens to work when receiving an update during the render\n // phase, because of the trick inside computeExpirationForFiber to\n // subtract 1 from `renderExpirationTime` to move it into a\n // separate bucket. But we should probably model it with an exception,\n // using the same mechanism we use to force hydration of a subtree.\n // TODO: This does not account for low pri updates that were already\n // scheduled before the root started rendering. Need to track the next\n // pending expiration time (perhaps by backtracking the return path) and\n // then trigger a restart in the `renderDidSuspendDelayIfPossible` path.\n markRootSuspendedAtTime(root, renderExpirationTime$1);\n }\n } // Mark that the root has a pending update.\n\n\n markRootUpdatedAtTime(root, expirationTime);\n }\n\n return root;\n}\n\nfunction getNextRootExpirationTimeToWorkOn(root) {\n // Determines the next expiration time that the root should render, taking\n // into account levels that may be suspended, or levels that may have\n // received a ping.\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n return lastExpiredTime;\n } // \"Pending\" refers to any update that hasn't committed yet, including if it\n // suspended. The \"suspended\" range is therefore a subset.\n\n\n var firstPendingTime = root.firstPendingTime;\n\n if (!isRootSuspendedAtTime(root, firstPendingTime)) {\n // The highest priority pending time is not suspended. Let's work on that.\n return firstPendingTime;\n } // If the first pending time is suspended, check if there's a lower priority\n // pending level that we know about. Or check if we received a ping. Work\n // on whichever is higher priority.\n\n\n var lastPingedTime = root.lastPingedTime;\n var nextKnownPendingLevel = root.nextKnownPendingLevel;\n var nextLevel = lastPingedTime > nextKnownPendingLevel ? lastPingedTime : nextKnownPendingLevel;\n\n if ( nextLevel <= Idle && firstPendingTime !== nextLevel) {\n // Don't work on Idle/Never priority unless everything else is committed.\n return NoWork;\n }\n\n return nextLevel;\n} // Use this function to schedule a task for a root. There's only one task per\n// root; if a task was already scheduled, we'll check to make sure the\n// expiration time of the existing task is the same as the expiration time of\n// the next level that the root has work on. This function is called on every\n// update, and right before exiting a task.\n\n\nfunction ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that\n// goes through Scheduler.\n\n\nfunction performConcurrentWorkOnRoot(root, didTimeout) {\n // Since we know we're in a React event, we can clear the current\n // event time. The next update will compute a new event time.\n currentEventTime = NoWork;\n\n if (didTimeout) {\n // The render task took too long to complete. Mark the current time as\n // expired to synchronously render all expired work in a single batch.\n var currentTime = requestCurrentTimeForUpdate();\n markRootExpiredAtTime(root, currentTime); // This will schedule a synchronous callback.\n\n ensureRootIsScheduled(root);\n return null;\n } // Determine the next expiration time to work on, using the fields stored\n // on the root.\n\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n\n if (expirationTime !== NoWork) {\n var originalCallbackNode = root.callbackNode;\n\n if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n {\n throw Error( \"Should not already be working.\" );\n }\n }\n\n flushPassiveEffects(); // If the root or expiration time have changed, throw out the existing stack\n // and prepare a fresh one. Otherwise we'll continue where we left off.\n\n if (root !== workInProgressRoot || expirationTime !== renderExpirationTime$1) {\n prepareFreshStack(root, expirationTime);\n startWorkOnPendingInteractions(root, expirationTime);\n } // If we have a work-in-progress fiber, it means there's still work to do\n // in this root.\n\n\n if (workInProgress !== null) {\n var prevExecutionContext = executionContext;\n executionContext |= RenderContext;\n var prevDispatcher = pushDispatcher();\n var prevInteractions = pushInteractions(root);\n startWorkLoopTimer(workInProgress);\n\n do {\n try {\n workLoopConcurrent();\n break;\n } catch (thrownValue) {\n handleError(root, thrownValue);\n }\n } while (true);\n\n resetContextDependencies();\n executionContext = prevExecutionContext;\n popDispatcher(prevDispatcher);\n\n {\n popInteractions(prevInteractions);\n }\n\n if (workInProgressRootExitStatus === RootFatalErrored) {\n var fatalError = workInProgressRootFatalError;\n stopInterruptedWorkLoopTimer();\n prepareFreshStack(root, expirationTime);\n markRootSuspendedAtTime(root, expirationTime);\n ensureRootIsScheduled(root);\n throw fatalError;\n }\n\n if (workInProgress !== null) {\n // There's still work left over. Exit without committing.\n stopInterruptedWorkLoopTimer();\n } else {\n // We now have a consistent tree. The next step is either to commit it,\n // or, if something suspended, wait to commit it after a timeout.\n stopFinishedWorkLoopTimer();\n var finishedWork = root.finishedWork = root.current.alternate;\n root.finishedExpirationTime = expirationTime;\n finishConcurrentRender(root, finishedWork, workInProgressRootExitStatus, expirationTime);\n }\n\n ensureRootIsScheduled(root);\n\n if (root.callbackNode === originalCallbackNode) {\n // The task node scheduled for this root is the same one that's\n // currently executed. Need to return a continuation.\n return performConcurrentWorkOnRoot.bind(null, root);\n }\n }\n }\n\n return null;\n}\n\nfunction finishConcurrentRender(root, finishedWork, exitStatus, expirationTime) {\n // Set this to null to indicate there's no in-progress render.\n workInProgressRoot = null;\n\n switch (exitStatus) {\n case RootIncomplete:\n case RootFatalErrored:\n {\n {\n {\n throw Error( \"Root did not complete. This is a bug in React.\" );\n }\n }\n }\n // Flow knows about invariant, so it complains if I add a break\n // statement, but eslint doesn't know about invariant, so it complains\n // if I do. eslint-disable-next-line no-fallthrough\n\n case RootErrored:\n {\n // If this was an async render, the error may have happened due to\n // a mutation in a concurrent event. Try rendering one more time,\n // synchronously, to see if the error goes away. If there are\n // lower priority updates, let's include those, too, in case they\n // fix the inconsistency. Render at Idle to include all updates.\n // If it was Idle or Never or some not-yet-invented time, render\n // at that time.\n markRootExpiredAtTime(root, expirationTime > Idle ? Idle : expirationTime); // We assume that this second render pass will be synchronous\n // and therefore not hit this path again.\n\n break;\n }\n\n case RootSuspended:\n {\n markRootSuspendedAtTime(root, expirationTime);\n var lastSuspendedTime = root.lastSuspendedTime;\n\n if (expirationTime === lastSuspendedTime) {\n root.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork);\n } // We have an acceptable loading state. We need to figure out if we\n // should immediately commit it or wait a bit.\n // If we have processed new updates during this render, we may now\n // have a new loading state ready. We want to ensure that we commit\n // that as soon as possible.\n\n\n var hasNotProcessedNewUpdates = workInProgressRootLatestProcessedExpirationTime === Sync;\n\n if (hasNotProcessedNewUpdates && // do not delay if we're inside an act() scope\n !( IsThisRendererActing.current)) {\n // If we have not processed any new updates during this pass, then\n // this is either a retry of an existing fallback state or a\n // hidden tree. Hidden trees shouldn't be batched with other work\n // and after that's fixed it can only be a retry. We're going to\n // throttle committing retries so that we don't show too many\n // loading states too quickly.\n var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now(); // Don't bother with a very short suspense time.\n\n if (msUntilTimeout > 10) {\n if (workInProgressRootHasPendingPing) {\n var lastPingedTime = root.lastPingedTime;\n\n if (lastPingedTime === NoWork || lastPingedTime >= expirationTime) {\n // This render was pinged but we didn't get to restart\n // earlier so try restarting now instead.\n root.lastPingedTime = expirationTime;\n prepareFreshStack(root, expirationTime);\n break;\n }\n }\n\n var nextTime = getNextRootExpirationTimeToWorkOn(root);\n\n if (nextTime !== NoWork && nextTime !== expirationTime) {\n // There's additional work on this root.\n break;\n }\n\n if (lastSuspendedTime !== NoWork && lastSuspendedTime !== expirationTime) {\n // We should prefer to render the fallback of at the last\n // suspended level. Ping the last suspended level to try\n // rendering it again.\n root.lastPingedTime = lastSuspendedTime;\n break;\n } // The render is suspended, it hasn't timed out, and there's no\n // lower priority work to do. Instead of committing the fallback\n // immediately, wait for more data to arrive.\n\n\n root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), msUntilTimeout);\n break;\n }\n } // The work expired. Commit immediately.\n\n\n commitRoot(root);\n break;\n }\n\n case RootSuspendedWithDelay:\n {\n markRootSuspendedAtTime(root, expirationTime);\n var _lastSuspendedTime = root.lastSuspendedTime;\n\n if (expirationTime === _lastSuspendedTime) {\n root.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork);\n }\n\n if ( // do not delay if we're inside an act() scope\n !( IsThisRendererActing.current)) {\n // We're suspended in a state that should be avoided. We'll try to\n // avoid committing it for as long as the timeouts let us.\n if (workInProgressRootHasPendingPing) {\n var _lastPingedTime = root.lastPingedTime;\n\n if (_lastPingedTime === NoWork || _lastPingedTime >= expirationTime) {\n // This render was pinged but we didn't get to restart earlier\n // so try restarting now instead.\n root.lastPingedTime = expirationTime;\n prepareFreshStack(root, expirationTime);\n break;\n }\n }\n\n var _nextTime = getNextRootExpirationTimeToWorkOn(root);\n\n if (_nextTime !== NoWork && _nextTime !== expirationTime) {\n // There's additional work on this root.\n break;\n }\n\n if (_lastSuspendedTime !== NoWork && _lastSuspendedTime !== expirationTime) {\n // We should prefer to render the fallback of at the last\n // suspended level. Ping the last suspended level to try\n // rendering it again.\n root.lastPingedTime = _lastSuspendedTime;\n break;\n }\n\n var _msUntilTimeout;\n\n if (workInProgressRootLatestSuspenseTimeout !== Sync) {\n // We have processed a suspense config whose expiration time we\n // can use as the timeout.\n _msUntilTimeout = expirationTimeToMs(workInProgressRootLatestSuspenseTimeout) - now();\n } else if (workInProgressRootLatestProcessedExpirationTime === Sync) {\n // This should never normally happen because only new updates\n // cause delayed states, so we should have processed something.\n // However, this could also happen in an offscreen tree.\n _msUntilTimeout = 0;\n } else {\n // If we don't have a suspense config, we're going to use a\n // heuristic to determine how long we can suspend.\n var eventTimeMs = inferTimeFromExpirationTime(workInProgressRootLatestProcessedExpirationTime);\n var currentTimeMs = now();\n var timeUntilExpirationMs = expirationTimeToMs(expirationTime) - currentTimeMs;\n var timeElapsed = currentTimeMs - eventTimeMs;\n\n if (timeElapsed < 0) {\n // We get this wrong some time since we estimate the time.\n timeElapsed = 0;\n }\n\n _msUntilTimeout = jnd(timeElapsed) - timeElapsed; // Clamp the timeout to the expiration time. TODO: Once the\n // event time is exact instead of inferred from expiration time\n // we don't need this.\n\n if (timeUntilExpirationMs < _msUntilTimeout) {\n _msUntilTimeout = timeUntilExpirationMs;\n }\n } // Don't bother with a very short suspense time.\n\n\n if (_msUntilTimeout > 10) {\n // The render is suspended, it hasn't timed out, and there's no\n // lower priority work to do. Instead of committing the fallback\n // immediately, wait for more data to arrive.\n root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout);\n break;\n }\n } // The work expired. Commit immediately.\n\n\n commitRoot(root);\n break;\n }\n\n case RootCompleted:\n {\n // The work completed. Ready to commit.\n if ( // do not delay if we're inside an act() scope\n !( IsThisRendererActing.current) && workInProgressRootLatestProcessedExpirationTime !== Sync && workInProgressRootCanSuspendUsingConfig !== null) {\n // If we have exceeded the minimum loading delay, which probably\n // means we have shown a spinner already, we might have to suspend\n // a bit longer to ensure that the spinner is shown for\n // enough time.\n var _msUntilTimeout2 = computeMsUntilSuspenseLoadingDelay(workInProgressRootLatestProcessedExpirationTime, expirationTime, workInProgressRootCanSuspendUsingConfig);\n\n if (_msUntilTimeout2 > 10) {\n markRootSuspendedAtTime(root, expirationTime);\n root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout2);\n break;\n }\n }\n\n commitRoot(root);\n break;\n }\n\n default:\n {\n {\n {\n throw Error( \"Unknown root exit status.\" );\n }\n }\n }\n }\n} // This is the entry point for synchronous tasks that don't go\n// through Scheduler\n\n\nfunction performSyncWorkOnRoot(root) {\n // Check if there's expired work on this root. Otherwise, render at Sync.\n var lastExpiredTime = root.lastExpiredTime;\n var expirationTime = lastExpiredTime !== NoWork ? lastExpiredTime : Sync;\n\n if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n {\n throw Error( \"Should not already be working.\" );\n }\n }\n\n flushPassiveEffects(); // If the root or expiration time have changed, throw out the existing stack\n // and prepare a fresh one. Otherwise we'll continue where we left off.\n\n if (root !== workInProgressRoot || expirationTime !== renderExpirationTime$1) {\n prepareFreshStack(root, expirationTime);\n startWorkOnPendingInteractions(root, expirationTime);\n } // If we have a work-in-progress fiber, it means there's still work to do\n // in this root.\n\n\n if (workInProgress !== null) {\n var prevExecutionContext = executionContext;\n executionContext |= RenderContext;\n var prevDispatcher = pushDispatcher();\n var prevInteractions = pushInteractions(root);\n startWorkLoopTimer(workInProgress);\n\n do {\n try {\n workLoopSync();\n break;\n } catch (thrownValue) {\n handleError(root, thrownValue);\n }\n } while (true);\n\n resetContextDependencies();\n executionContext = prevExecutionContext;\n popDispatcher(prevDispatcher);\n\n {\n popInteractions(prevInteractions);\n }\n\n if (workInProgressRootExitStatus === RootFatalErrored) {\n var fatalError = workInProgressRootFatalError;\n stopInterruptedWorkLoopTimer();\n prepareFreshStack(root, expirationTime);\n markRootSuspendedAtTime(root, expirationTime);\n ensureRootIsScheduled(root);\n throw fatalError;\n }\n\n if (workInProgress !== null) {\n // This is a sync render, so we should have finished the whole tree.\n {\n {\n throw Error( \"Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n } else {\n // We now have a consistent tree. Because this is a sync render, we\n // will commit it even if something suspended.\n stopFinishedWorkLoopTimer();\n root.finishedWork = root.current.alternate;\n root.finishedExpirationTime = expirationTime;\n finishSyncRender(root);\n } // Before exiting, make sure there's a callback scheduled for the next\n // pending level.\n\n\n ensureRootIsScheduled(root);\n }\n\n return null;\n}\n\nfunction finishSyncRender(root) {\n // Set this to null to indicate there's no in-progress render.\n workInProgressRoot = null;\n commitRoot(root);\n}\nfunction flushDiscreteUpdates() {\n // TODO: Should be able to flush inside batchedUpdates, but not inside `act`.\n // However, `act` uses `batchedUpdates`, so there's no way to distinguish\n // those two cases. Need to fix this before exposing flushDiscreteUpdates\n // as a public API.\n if ((executionContext & (BatchedContext | RenderContext | CommitContext)) !== NoContext) {\n {\n if ((executionContext & RenderContext) !== NoContext) {\n error('unstable_flushDiscreteUpdates: Cannot flush updates when React is ' + 'already rendering.');\n }\n } // We're already rendering, so we can't synchronously flush pending work.\n // This is probably a nested event dispatch triggered by a lifecycle/effect,\n // like `el.focus()`. Exit.\n\n\n return;\n }\n\n flushPendingDiscreteUpdates(); // If the discrete updates scheduled passive effects, flush them now so that\n // they fire before the next serial event.\n\n flushPassiveEffects();\n}\nfunction syncUpdates(fn, a, b, c) {\n return runWithPriority$1(ImmediatePriority, fn.bind(null, a, b, c));\n}\n\nfunction flushPendingDiscreteUpdates() {\n if (rootsWithPendingDiscreteUpdates !== null) {\n // For each root with pending discrete updates, schedule a callback to\n // immediately flush them.\n var roots = rootsWithPendingDiscreteUpdates;\n rootsWithPendingDiscreteUpdates = null;\n roots.forEach(function (expirationTime, root) {\n markRootExpiredAtTime(root, expirationTime);\n ensureRootIsScheduled(root);\n }); // Now flush the immediate queue.\n\n flushSyncCallbackQueue();\n }\n}\n\nfunction batchedUpdates$1(fn, a) {\n var prevExecutionContext = executionContext;\n executionContext |= BatchedContext;\n\n try {\n return fn(a);\n } finally {\n executionContext = prevExecutionContext;\n\n if (executionContext === NoContext) {\n // Flush the immediate callbacks that were scheduled during this batch\n flushSyncCallbackQueue();\n }\n }\n}\nfunction batchedEventUpdates$1(fn, a) {\n var prevExecutionContext = executionContext;\n executionContext |= EventContext;\n\n try {\n return fn(a);\n } finally {\n executionContext = prevExecutionContext;\n\n if (executionContext === NoContext) {\n // Flush the immediate callbacks that were scheduled during this batch\n flushSyncCallbackQueue();\n }\n }\n}\nfunction discreteUpdates$1(fn, a, b, c, d) {\n var prevExecutionContext = executionContext;\n executionContext |= DiscreteEventContext;\n\n try {\n // Should this\n return runWithPriority$1(UserBlockingPriority$1, fn.bind(null, a, b, c, d));\n } finally {\n executionContext = prevExecutionContext;\n\n if (executionContext === NoContext) {\n // Flush the immediate callbacks that were scheduled during this batch\n flushSyncCallbackQueue();\n }\n }\n}\nfunction unbatchedUpdates(fn, a) {\n var prevExecutionContext = executionContext;\n executionContext &= ~BatchedContext;\n executionContext |= LegacyUnbatchedContext;\n\n try {\n return fn(a);\n } finally {\n executionContext = prevExecutionContext;\n\n if (executionContext === NoContext) {\n // Flush the immediate callbacks that were scheduled during this batch\n flushSyncCallbackQueue();\n }\n }\n}\nfunction flushSync(fn, a) {\n if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {\n {\n {\n throw Error( \"flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.\" );\n }\n }\n }\n\n var prevExecutionContext = executionContext;\n executionContext |= BatchedContext;\n\n try {\n return runWithPriority$1(ImmediatePriority, fn.bind(null, a));\n } finally {\n executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch.\n // Note that this will happen even if batchedUpdates is higher up\n // the stack.\n\n flushSyncCallbackQueue();\n }\n}\n\nfunction prepareFreshStack(root, expirationTime) {\n root.finishedWork = null;\n root.finishedExpirationTime = NoWork;\n var timeoutHandle = root.timeoutHandle;\n\n if (timeoutHandle !== noTimeout) {\n // The root previous suspended and scheduled a timeout to commit a fallback\n // state. Now that we have additional work, cancel the timeout.\n root.timeoutHandle = noTimeout; // $FlowFixMe Complains noTimeout is not a TimeoutID, despite the check above\n\n cancelTimeout(timeoutHandle);\n }\n\n if (workInProgress !== null) {\n var interruptedWork = workInProgress.return;\n\n while (interruptedWork !== null) {\n unwindInterruptedWork(interruptedWork);\n interruptedWork = interruptedWork.return;\n }\n }\n\n workInProgressRoot = root;\n workInProgress = createWorkInProgress(root.current, null);\n renderExpirationTime$1 = expirationTime;\n workInProgressRootExitStatus = RootIncomplete;\n workInProgressRootFatalError = null;\n workInProgressRootLatestProcessedExpirationTime = Sync;\n workInProgressRootLatestSuspenseTimeout = Sync;\n workInProgressRootCanSuspendUsingConfig = null;\n workInProgressRootNextUnprocessedUpdateTime = NoWork;\n workInProgressRootHasPendingPing = false;\n\n {\n spawnedWorkDuringRender = null;\n }\n\n {\n ReactStrictModeWarnings.discardPendingWarnings();\n }\n}\n\nfunction handleError(root, thrownValue) {\n do {\n try {\n // Reset module-level state that was set during the render phase.\n resetContextDependencies();\n resetHooksAfterThrow();\n resetCurrentFiber();\n\n if (workInProgress === null || workInProgress.return === null) {\n // Expected to be working on a non-root fiber. This is a fatal error\n // because there's no ancestor that can handle it; the root is\n // supposed to capture all errors that weren't caught by an error\n // boundary.\n workInProgressRootExitStatus = RootFatalErrored;\n workInProgressRootFatalError = thrownValue; // Set `workInProgress` to null. This represents advancing to the next\n // sibling, or the parent if there are no siblings. But since the root\n // has no siblings nor a parent, we set it to null. Usually this is\n // handled by `completeUnitOfWork` or `unwindWork`, but since we're\n // interntionally not calling those, we need set it here.\n // TODO: Consider calling `unwindWork` to pop the contexts.\n\n workInProgress = null;\n return null;\n }\n\n if (enableProfilerTimer && workInProgress.mode & ProfileMode) {\n // Record the time spent rendering before an error was thrown. This\n // avoids inaccurate Profiler durations in the case of a\n // suspended render.\n stopProfilerTimerIfRunningAndRecordDelta(workInProgress, true);\n }\n\n throwException(root, workInProgress.return, workInProgress, thrownValue, renderExpirationTime$1);\n workInProgress = completeUnitOfWork(workInProgress);\n } catch (yetAnotherThrownValue) {\n // Something in the return path also threw.\n thrownValue = yetAnotherThrownValue;\n continue;\n } // Return to the normal work loop.\n\n\n return;\n } while (true);\n}\n\nfunction pushDispatcher(root) {\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;\n\n if (prevDispatcher === null) {\n // The React isomorphic package does not include a default dispatcher.\n // Instead the first renderer will lazily attach one, in order to give\n // nicer error messages.\n return ContextOnlyDispatcher;\n } else {\n return prevDispatcher;\n }\n}\n\nfunction popDispatcher(prevDispatcher) {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n}\n\nfunction pushInteractions(root) {\n {\n var prevInteractions = tracing.__interactionsRef.current;\n tracing.__interactionsRef.current = root.memoizedInteractions;\n return prevInteractions;\n }\n}\n\nfunction popInteractions(prevInteractions) {\n {\n tracing.__interactionsRef.current = prevInteractions;\n }\n}\n\nfunction markCommitTimeOfFallback() {\n globalMostRecentFallbackTime = now();\n}\nfunction markRenderEventTimeAndConfig(expirationTime, suspenseConfig) {\n if (expirationTime < workInProgressRootLatestProcessedExpirationTime && expirationTime > Idle) {\n workInProgressRootLatestProcessedExpirationTime = expirationTime;\n }\n\n if (suspenseConfig !== null) {\n if (expirationTime < workInProgressRootLatestSuspenseTimeout && expirationTime > Idle) {\n workInProgressRootLatestSuspenseTimeout = expirationTime; // Most of the time we only have one config and getting wrong is not bad.\n\n workInProgressRootCanSuspendUsingConfig = suspenseConfig;\n }\n }\n}\nfunction markUnprocessedUpdateTime(expirationTime) {\n if (expirationTime > workInProgressRootNextUnprocessedUpdateTime) {\n workInProgressRootNextUnprocessedUpdateTime = expirationTime;\n }\n}\nfunction renderDidSuspend() {\n if (workInProgressRootExitStatus === RootIncomplete) {\n workInProgressRootExitStatus = RootSuspended;\n }\n}\nfunction renderDidSuspendDelayIfPossible() {\n if (workInProgressRootExitStatus === RootIncomplete || workInProgressRootExitStatus === RootSuspended) {\n workInProgressRootExitStatus = RootSuspendedWithDelay;\n } // Check if there's a lower priority update somewhere else in the tree.\n\n\n if (workInProgressRootNextUnprocessedUpdateTime !== NoWork && workInProgressRoot !== null) {\n // Mark the current render as suspended, and then mark that there's a\n // pending update.\n // TODO: This should immediately interrupt the current render, instead\n // of waiting until the next time we yield.\n markRootSuspendedAtTime(workInProgressRoot, renderExpirationTime$1);\n markRootUpdatedAtTime(workInProgressRoot, workInProgressRootNextUnprocessedUpdateTime);\n }\n}\nfunction renderDidError() {\n if (workInProgressRootExitStatus !== RootCompleted) {\n workInProgressRootExitStatus = RootErrored;\n }\n} // Called during render to determine if anything has suspended.\n// Returns false if we're not sure.\n\nfunction renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}\n\nfunction inferTimeFromExpirationTime(expirationTime) {\n // We don't know exactly when the update was scheduled, but we can infer an\n // approximate start time from the expiration time.\n var earliestExpirationTimeMs = expirationTimeToMs(expirationTime);\n return earliestExpirationTimeMs - LOW_PRIORITY_EXPIRATION;\n}\n\nfunction inferTimeFromExpirationTimeWithSuspenseConfig(expirationTime, suspenseConfig) {\n // We don't know exactly when the update was scheduled, but we can infer an\n // approximate start time from the expiration time by subtracting the timeout\n // that was added to the event time.\n var earliestExpirationTimeMs = expirationTimeToMs(expirationTime);\n return earliestExpirationTimeMs - (suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION);\n} // The work loop is an extremely hot path. Tell Closure not to inline it.\n\n/** @noinline */\n\n\nfunction workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}\n/** @noinline */\n\n\nfunction workLoopConcurrent() {\n // Perform work until Scheduler asks us to yield\n while (workInProgress !== null && !shouldYield()) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}\n\nfunction performUnitOfWork(unitOfWork) {\n // The current, flushed, state of this fiber is the alternate. Ideally\n // nothing should rely on this, but relying on it here means that we don't\n // need an additional field on the work in progress.\n var current = unitOfWork.alternate;\n startWorkTimer(unitOfWork);\n setCurrentFiber(unitOfWork);\n var next;\n\n if ( (unitOfWork.mode & ProfileMode) !== NoMode) {\n startProfilerTimer(unitOfWork);\n next = beginWork$1(current, unitOfWork, renderExpirationTime$1);\n stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);\n } else {\n next = beginWork$1(current, unitOfWork, renderExpirationTime$1);\n }\n\n resetCurrentFiber();\n unitOfWork.memoizedProps = unitOfWork.pendingProps;\n\n if (next === null) {\n // If this doesn't spawn new work, complete the current work.\n next = completeUnitOfWork(unitOfWork);\n }\n\n ReactCurrentOwner$2.current = null;\n return next;\n}\n\nfunction completeUnitOfWork(unitOfWork) {\n // Attempt to complete the current unit of work, then move to the next\n // sibling. If there are no more siblings, return to the parent fiber.\n workInProgress = unitOfWork;\n\n do {\n // The current, flushed, state of this fiber is the alternate. Ideally\n // nothing should rely on this, but relying on it here means that we don't\n // need an additional field on the work in progress.\n var current = workInProgress.alternate;\n var returnFiber = workInProgress.return; // Check if the work completed or if something threw.\n\n if ((workInProgress.effectTag & Incomplete) === NoEffect) {\n setCurrentFiber(workInProgress);\n var next = void 0;\n\n if ( (workInProgress.mode & ProfileMode) === NoMode) {\n next = completeWork(current, workInProgress, renderExpirationTime$1);\n } else {\n startProfilerTimer(workInProgress);\n next = completeWork(current, workInProgress, renderExpirationTime$1); // Update render duration assuming we didn't error.\n\n stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false);\n }\n\n stopWorkTimer(workInProgress);\n resetCurrentFiber();\n resetChildExpirationTime(workInProgress);\n\n if (next !== null) {\n // Completing this fiber spawned new work. Work on that next.\n return next;\n }\n\n if (returnFiber !== null && // Do not append effects to parents if a sibling failed to complete\n (returnFiber.effectTag & Incomplete) === NoEffect) {\n // Append all the effects of the subtree and this fiber onto the effect\n // list of the parent. The completion order of the children affects the\n // side-effect order.\n if (returnFiber.firstEffect === null) {\n returnFiber.firstEffect = workInProgress.firstEffect;\n }\n\n if (workInProgress.lastEffect !== null) {\n if (returnFiber.lastEffect !== null) {\n returnFiber.lastEffect.nextEffect = workInProgress.firstEffect;\n }\n\n returnFiber.lastEffect = workInProgress.lastEffect;\n } // If this fiber had side-effects, we append it AFTER the children's\n // side-effects. We can perform certain side-effects earlier if needed,\n // by doing multiple passes over the effect list. We don't want to\n // schedule our own side-effect on our own list because if end up\n // reusing children we'll schedule this effect onto itself since we're\n // at the end.\n\n\n var effectTag = workInProgress.effectTag; // Skip both NoWork and PerformedWork tags when creating the effect\n // list. PerformedWork effect is read by React DevTools but shouldn't be\n // committed.\n\n if (effectTag > PerformedWork) {\n if (returnFiber.lastEffect !== null) {\n returnFiber.lastEffect.nextEffect = workInProgress;\n } else {\n returnFiber.firstEffect = workInProgress;\n }\n\n returnFiber.lastEffect = workInProgress;\n }\n }\n } else {\n // This fiber did not complete because something threw. Pop values off\n // the stack without entering the complete phase. If this is a boundary,\n // capture values if possible.\n var _next = unwindWork(workInProgress); // Because this fiber did not complete, don't reset its expiration time.\n\n\n if ( (workInProgress.mode & ProfileMode) !== NoMode) {\n // Record the render duration for the fiber that errored.\n stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false); // Include the time spent working on failed children before continuing.\n\n var actualDuration = workInProgress.actualDuration;\n var child = workInProgress.child;\n\n while (child !== null) {\n actualDuration += child.actualDuration;\n child = child.sibling;\n }\n\n workInProgress.actualDuration = actualDuration;\n }\n\n if (_next !== null) {\n // If completing this work spawned new work, do that next. We'll come\n // back here again.\n // Since we're restarting, remove anything that is not a host effect\n // from the effect tag.\n // TODO: The name stopFailedWorkTimer is misleading because Suspense\n // also captures and restarts.\n stopFailedWorkTimer(workInProgress);\n _next.effectTag &= HostEffectMask;\n return _next;\n }\n\n stopWorkTimer(workInProgress);\n\n if (returnFiber !== null) {\n // Mark the parent fiber as incomplete and clear its effect list.\n returnFiber.firstEffect = returnFiber.lastEffect = null;\n returnFiber.effectTag |= Incomplete;\n }\n }\n\n var siblingFiber = workInProgress.sibling;\n\n if (siblingFiber !== null) {\n // If there is more work to do in this returnFiber, do that next.\n return siblingFiber;\n } // Otherwise, return to the parent\n\n\n workInProgress = returnFiber;\n } while (workInProgress !== null); // We've reached the root.\n\n\n if (workInProgressRootExitStatus === RootIncomplete) {\n workInProgressRootExitStatus = RootCompleted;\n }\n\n return null;\n}\n\nfunction getRemainingExpirationTime(fiber) {\n var updateExpirationTime = fiber.expirationTime;\n var childExpirationTime = fiber.childExpirationTime;\n return updateExpirationTime > childExpirationTime ? updateExpirationTime : childExpirationTime;\n}\n\nfunction resetChildExpirationTime(completedWork) {\n if (renderExpirationTime$1 !== Never && completedWork.childExpirationTime === Never) {\n // The children of this component are hidden. Don't bubble their\n // expiration times.\n return;\n }\n\n var newChildExpirationTime = NoWork; // Bubble up the earliest expiration time.\n\n if ( (completedWork.mode & ProfileMode) !== NoMode) {\n // In profiling mode, resetChildExpirationTime is also used to reset\n // profiler durations.\n var actualDuration = completedWork.actualDuration;\n var treeBaseDuration = completedWork.selfBaseDuration; // When a fiber is cloned, its actualDuration is reset to 0. This value will\n // only be updated if work is done on the fiber (i.e. it doesn't bailout).\n // When work is done, it should bubble to the parent's actualDuration. If\n // the fiber has not been cloned though, (meaning no work was done), then\n // this value will reflect the amount of time spent working on a previous\n // render. In that case it should not bubble. We determine whether it was\n // cloned by comparing the child pointer.\n\n var shouldBubbleActualDurations = completedWork.alternate === null || completedWork.child !== completedWork.alternate.child;\n var child = completedWork.child;\n\n while (child !== null) {\n var childUpdateExpirationTime = child.expirationTime;\n var childChildExpirationTime = child.childExpirationTime;\n\n if (childUpdateExpirationTime > newChildExpirationTime) {\n newChildExpirationTime = childUpdateExpirationTime;\n }\n\n if (childChildExpirationTime > newChildExpirationTime) {\n newChildExpirationTime = childChildExpirationTime;\n }\n\n if (shouldBubbleActualDurations) {\n actualDuration += child.actualDuration;\n }\n\n treeBaseDuration += child.treeBaseDuration;\n child = child.sibling;\n }\n\n completedWork.actualDuration = actualDuration;\n completedWork.treeBaseDuration = treeBaseDuration;\n } else {\n var _child = completedWork.child;\n\n while (_child !== null) {\n var _childUpdateExpirationTime = _child.expirationTime;\n var _childChildExpirationTime = _child.childExpirationTime;\n\n if (_childUpdateExpirationTime > newChildExpirationTime) {\n newChildExpirationTime = _childUpdateExpirationTime;\n }\n\n if (_childChildExpirationTime > newChildExpirationTime) {\n newChildExpirationTime = _childChildExpirationTime;\n }\n\n _child = _child.sibling;\n }\n }\n\n completedWork.childExpirationTime = newChildExpirationTime;\n}\n\nfunction commitRoot(root) {\n var renderPriorityLevel = getCurrentPriorityLevel();\n runWithPriority$1(ImmediatePriority, commitRootImpl.bind(null, root, renderPriorityLevel));\n return null;\n}\n\nfunction commitRootImpl(root, renderPriorityLevel) {\n do {\n // `flushPassiveEffects` will call `flushSyncUpdateQueue` at the end, which\n // means `flushPassiveEffects` will sometimes result in additional\n // passive effects. So we need to keep flushing in a loop until there are\n // no more pending effects.\n // TODO: Might be better if `flushPassiveEffects` did not automatically\n // flush synchronous work at the end, to avoid factoring hazards like this.\n flushPassiveEffects();\n } while (rootWithPendingPassiveEffects !== null);\n\n flushRenderPhaseStrictModeWarningsInDEV();\n\n if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n {\n throw Error( \"Should not already be working.\" );\n }\n }\n\n var finishedWork = root.finishedWork;\n var expirationTime = root.finishedExpirationTime;\n\n if (finishedWork === null) {\n return null;\n }\n\n root.finishedWork = null;\n root.finishedExpirationTime = NoWork;\n\n if (!(finishedWork !== root.current)) {\n {\n throw Error( \"Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n } // commitRoot never returns a continuation; it always finishes synchronously.\n // So we can clear these now to allow a new callback to be scheduled.\n\n\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n root.nextKnownPendingLevel = NoWork;\n startCommitTimer(); // Update the first and last pending times on this root. The new first\n // pending time is whatever is left on the root fiber.\n\n var remainingExpirationTimeBeforeCommit = getRemainingExpirationTime(finishedWork);\n markRootFinishedAtTime(root, expirationTime, remainingExpirationTimeBeforeCommit);\n\n if (root === workInProgressRoot) {\n // We can reset these now that they are finished.\n workInProgressRoot = null;\n workInProgress = null;\n renderExpirationTime$1 = NoWork;\n } // This indicates that the last root we worked on is not the same one that\n // we're committing now. This most commonly happens when a suspended root\n // times out.\n // Get the list of effects.\n\n\n var firstEffect;\n\n if (finishedWork.effectTag > PerformedWork) {\n // A fiber's effect list consists only of its children, not itself. So if\n // the root has an effect, we need to add it to the end of the list. The\n // resulting list is the set that would belong to the root's parent, if it\n // had one; that is, all the effects in the tree including the root.\n if (finishedWork.lastEffect !== null) {\n finishedWork.lastEffect.nextEffect = finishedWork;\n firstEffect = finishedWork.firstEffect;\n } else {\n firstEffect = finishedWork;\n }\n } else {\n // There is no effect on the root.\n firstEffect = finishedWork.firstEffect;\n }\n\n if (firstEffect !== null) {\n var prevExecutionContext = executionContext;\n executionContext |= CommitContext;\n var prevInteractions = pushInteractions(root); // Reset this to null before calling lifecycles\n\n ReactCurrentOwner$2.current = null; // The commit phase is broken into several sub-phases. We do a separate pass\n // of the effect list for each phase: all mutation effects come before all\n // layout effects, and so on.\n // The first phase a \"before mutation\" phase. We use this phase to read the\n // state of the host tree right before we mutate it. This is where\n // getSnapshotBeforeUpdate is called.\n\n startCommitSnapshotEffectsTimer();\n prepareForCommit(root.containerInfo);\n nextEffect = firstEffect;\n\n do {\n {\n invokeGuardedCallback(null, commitBeforeMutationEffects, null);\n\n if (hasCaughtError()) {\n if (!(nextEffect !== null)) {\n {\n throw Error( \"Should be working on an effect.\" );\n }\n }\n\n var error = clearCaughtError();\n captureCommitPhaseError(nextEffect, error);\n nextEffect = nextEffect.nextEffect;\n }\n }\n } while (nextEffect !== null);\n\n stopCommitSnapshotEffectsTimer();\n\n {\n // Mark the current commit time to be shared by all Profilers in this\n // batch. This enables them to be grouped later.\n recordCommitTime();\n } // The next phase is the mutation phase, where we mutate the host tree.\n\n\n startCommitHostEffectsTimer();\n nextEffect = firstEffect;\n\n do {\n {\n invokeGuardedCallback(null, commitMutationEffects, null, root, renderPriorityLevel);\n\n if (hasCaughtError()) {\n if (!(nextEffect !== null)) {\n {\n throw Error( \"Should be working on an effect.\" );\n }\n }\n\n var _error = clearCaughtError();\n\n captureCommitPhaseError(nextEffect, _error);\n nextEffect = nextEffect.nextEffect;\n }\n }\n } while (nextEffect !== null);\n\n stopCommitHostEffectsTimer();\n resetAfterCommit(root.containerInfo); // The work-in-progress tree is now the current tree. This must come after\n // the mutation phase, so that the previous tree is still current during\n // componentWillUnmount, but before the layout phase, so that the finished\n // work is current during componentDidMount/Update.\n\n root.current = finishedWork; // The next phase is the layout phase, where we call effects that read\n // the host tree after it's been mutated. The idiomatic use case for this is\n // layout, but class component lifecycles also fire here for legacy reasons.\n\n startCommitLifeCyclesTimer();\n nextEffect = firstEffect;\n\n do {\n {\n invokeGuardedCallback(null, commitLayoutEffects, null, root, expirationTime);\n\n if (hasCaughtError()) {\n if (!(nextEffect !== null)) {\n {\n throw Error( \"Should be working on an effect.\" );\n }\n }\n\n var _error2 = clearCaughtError();\n\n captureCommitPhaseError(nextEffect, _error2);\n nextEffect = nextEffect.nextEffect;\n }\n }\n } while (nextEffect !== null);\n\n stopCommitLifeCyclesTimer();\n nextEffect = null; // Tell Scheduler to yield at the end of the frame, so the browser has an\n // opportunity to paint.\n\n requestPaint();\n\n {\n popInteractions(prevInteractions);\n }\n\n executionContext = prevExecutionContext;\n } else {\n // No effects.\n root.current = finishedWork; // Measure these anyway so the flamegraph explicitly shows that there were\n // no effects.\n // TODO: Maybe there's a better way to report this.\n\n startCommitSnapshotEffectsTimer();\n stopCommitSnapshotEffectsTimer();\n\n {\n recordCommitTime();\n }\n\n startCommitHostEffectsTimer();\n stopCommitHostEffectsTimer();\n startCommitLifeCyclesTimer();\n stopCommitLifeCyclesTimer();\n }\n\n stopCommitTimer();\n var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;\n\n if (rootDoesHavePassiveEffects) {\n // This commit has passive effects. Stash a reference to them. But don't\n // schedule a callback until after flushing layout work.\n rootDoesHavePassiveEffects = false;\n rootWithPendingPassiveEffects = root;\n pendingPassiveEffectsExpirationTime = expirationTime;\n pendingPassiveEffectsRenderPriority = renderPriorityLevel;\n } else {\n // We are done with the effect chain at this point so let's clear the\n // nextEffect pointers to assist with GC. If we have passive effects, we'll\n // clear this in flushPassiveEffects.\n nextEffect = firstEffect;\n\n while (nextEffect !== null) {\n var nextNextEffect = nextEffect.nextEffect;\n nextEffect.nextEffect = null;\n nextEffect = nextNextEffect;\n }\n } // Check if there's remaining work on this root\n\n\n var remainingExpirationTime = root.firstPendingTime;\n\n if (remainingExpirationTime !== NoWork) {\n {\n if (spawnedWorkDuringRender !== null) {\n var expirationTimes = spawnedWorkDuringRender;\n spawnedWorkDuringRender = null;\n\n for (var i = 0; i < expirationTimes.length; i++) {\n scheduleInteractions(root, expirationTimes[i], root.memoizedInteractions);\n }\n }\n\n schedulePendingInteractions(root, remainingExpirationTime);\n }\n } else {\n // If there's no remaining work, we can clear the set of already failed\n // error boundaries.\n legacyErrorBoundariesThatAlreadyFailed = null;\n }\n\n {\n if (!rootDidHavePassiveEffects) {\n // If there are no passive effects, then we can complete the pending interactions.\n // Otherwise, we'll wait until after the passive effects are flushed.\n // Wait to do this until after remaining work has been scheduled,\n // so that we don't prematurely signal complete for interactions when there's e.g. hidden work.\n finishPendingInteractions(root, expirationTime);\n }\n }\n\n if (remainingExpirationTime === Sync) {\n // Count the number of times the root synchronously re-renders without\n // finishing. If there are too many, it indicates an infinite update loop.\n if (root === rootWithNestedUpdates) {\n nestedUpdateCount++;\n } else {\n nestedUpdateCount = 0;\n rootWithNestedUpdates = root;\n }\n } else {\n nestedUpdateCount = 0;\n }\n\n onCommitRoot(finishedWork.stateNode, expirationTime); // Always call this before exiting `commitRoot`, to ensure that any\n // additional work on this root is scheduled.\n\n ensureRootIsScheduled(root);\n\n if (hasUncaughtError) {\n hasUncaughtError = false;\n var _error3 = firstUncaughtError;\n firstUncaughtError = null;\n throw _error3;\n }\n\n if ((executionContext & LegacyUnbatchedContext) !== NoContext) {\n // This is a legacy edge case. We just committed the initial mount of\n // a ReactDOM.render-ed root inside of batchedUpdates. The commit fired\n // synchronously, but layout updates should be deferred until the end\n // of the batch.\n return null;\n } // If layout work was scheduled, flush it now.\n\n\n flushSyncCallbackQueue();\n return null;\n}\n\nfunction commitBeforeMutationEffects() {\n while (nextEffect !== null) {\n var effectTag = nextEffect.effectTag;\n\n if ((effectTag & Snapshot) !== NoEffect) {\n setCurrentFiber(nextEffect);\n recordEffect();\n var current = nextEffect.alternate;\n commitBeforeMutationLifeCycles(current, nextEffect);\n resetCurrentFiber();\n }\n\n if ((effectTag & Passive) !== NoEffect) {\n // If there are passive effects, schedule a callback to flush at\n // the earliest opportunity.\n if (!rootDoesHavePassiveEffects) {\n rootDoesHavePassiveEffects = true;\n scheduleCallback(NormalPriority, function () {\n flushPassiveEffects();\n return null;\n });\n }\n }\n\n nextEffect = nextEffect.nextEffect;\n }\n}\n\nfunction commitMutationEffects(root, renderPriorityLevel) {\n // TODO: Should probably move the bulk of this function to commitWork.\n while (nextEffect !== null) {\n setCurrentFiber(nextEffect);\n var effectTag = nextEffect.effectTag;\n\n if (effectTag & ContentReset) {\n commitResetTextContent(nextEffect);\n }\n\n if (effectTag & Ref) {\n var current = nextEffect.alternate;\n\n if (current !== null) {\n commitDetachRef(current);\n }\n } // The following switch statement is only concerned about placement,\n // updates, and deletions. To avoid needing to add a case for every possible\n // bitmap value, we remove the secondary effects from the effect tag and\n // switch on that value.\n\n\n var primaryEffectTag = effectTag & (Placement | Update | Deletion | Hydrating);\n\n switch (primaryEffectTag) {\n case Placement:\n {\n commitPlacement(nextEffect); // Clear the \"placement\" from effect tag so that we know that this is\n // inserted, before any life-cycles like componentDidMount gets called.\n // TODO: findDOMNode doesn't rely on this any more but isMounted does\n // and isMounted is deprecated anyway so we should be able to kill this.\n\n nextEffect.effectTag &= ~Placement;\n break;\n }\n\n case PlacementAndUpdate:\n {\n // Placement\n commitPlacement(nextEffect); // Clear the \"placement\" from effect tag so that we know that this is\n // inserted, before any life-cycles like componentDidMount gets called.\n\n nextEffect.effectTag &= ~Placement; // Update\n\n var _current = nextEffect.alternate;\n commitWork(_current, nextEffect);\n break;\n }\n\n case Hydrating:\n {\n nextEffect.effectTag &= ~Hydrating;\n break;\n }\n\n case HydratingAndUpdate:\n {\n nextEffect.effectTag &= ~Hydrating; // Update\n\n var _current2 = nextEffect.alternate;\n commitWork(_current2, nextEffect);\n break;\n }\n\n case Update:\n {\n var _current3 = nextEffect.alternate;\n commitWork(_current3, nextEffect);\n break;\n }\n\n case Deletion:\n {\n commitDeletion(root, nextEffect, renderPriorityLevel);\n break;\n }\n } // TODO: Only record a mutation effect if primaryEffectTag is non-zero.\n\n\n recordEffect();\n resetCurrentFiber();\n nextEffect = nextEffect.nextEffect;\n }\n}\n\nfunction commitLayoutEffects(root, committedExpirationTime) {\n // TODO: Should probably move the bulk of this function to commitWork.\n while (nextEffect !== null) {\n setCurrentFiber(nextEffect);\n var effectTag = nextEffect.effectTag;\n\n if (effectTag & (Update | Callback)) {\n recordEffect();\n var current = nextEffect.alternate;\n commitLifeCycles(root, current, nextEffect);\n }\n\n if (effectTag & Ref) {\n recordEffect();\n commitAttachRef(nextEffect);\n }\n\n resetCurrentFiber();\n nextEffect = nextEffect.nextEffect;\n }\n}\n\nfunction flushPassiveEffects() {\n if (pendingPassiveEffectsRenderPriority !== NoPriority) {\n var priorityLevel = pendingPassiveEffectsRenderPriority > NormalPriority ? NormalPriority : pendingPassiveEffectsRenderPriority;\n pendingPassiveEffectsRenderPriority = NoPriority;\n return runWithPriority$1(priorityLevel, flushPassiveEffectsImpl);\n }\n}\n\nfunction flushPassiveEffectsImpl() {\n if (rootWithPendingPassiveEffects === null) {\n return false;\n }\n\n var root = rootWithPendingPassiveEffects;\n var expirationTime = pendingPassiveEffectsExpirationTime;\n rootWithPendingPassiveEffects = null;\n pendingPassiveEffectsExpirationTime = NoWork;\n\n if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n {\n throw Error( \"Cannot flush passive effects while already rendering.\" );\n }\n }\n\n var prevExecutionContext = executionContext;\n executionContext |= CommitContext;\n var prevInteractions = pushInteractions(root);\n\n {\n // Note: This currently assumes there are no passive effects on the root fiber\n // because the root is not part of its own effect list.\n // This could change in the future.\n var _effect2 = root.current.firstEffect;\n\n while (_effect2 !== null) {\n {\n setCurrentFiber(_effect2);\n invokeGuardedCallback(null, commitPassiveHookEffects, null, _effect2);\n\n if (hasCaughtError()) {\n if (!(_effect2 !== null)) {\n {\n throw Error( \"Should be working on an effect.\" );\n }\n }\n\n var _error5 = clearCaughtError();\n\n captureCommitPhaseError(_effect2, _error5);\n }\n\n resetCurrentFiber();\n }\n\n var nextNextEffect = _effect2.nextEffect; // Remove nextEffect pointer to assist GC\n\n _effect2.nextEffect = null;\n _effect2 = nextNextEffect;\n }\n }\n\n {\n popInteractions(prevInteractions);\n finishPendingInteractions(root, expirationTime);\n }\n\n executionContext = prevExecutionContext;\n flushSyncCallbackQueue(); // If additional passive effects were scheduled, increment a counter. If this\n // exceeds the limit, we'll fire a warning.\n\n nestedPassiveUpdateCount = rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1;\n return true;\n}\n\nfunction isAlreadyFailedLegacyErrorBoundary(instance) {\n return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);\n}\nfunction markLegacyErrorBoundaryAsFailed(instance) {\n if (legacyErrorBoundariesThatAlreadyFailed === null) {\n legacyErrorBoundariesThatAlreadyFailed = new Set([instance]);\n } else {\n legacyErrorBoundariesThatAlreadyFailed.add(instance);\n }\n}\n\nfunction prepareToThrowUncaughtError(error) {\n if (!hasUncaughtError) {\n hasUncaughtError = true;\n firstUncaughtError = error;\n }\n}\n\nvar onUncaughtError = prepareToThrowUncaughtError;\n\nfunction captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {\n var errorInfo = createCapturedValue(error, sourceFiber);\n var update = createRootErrorUpdate(rootFiber, errorInfo, Sync);\n enqueueUpdate(rootFiber, update);\n var root = markUpdateTimeFromFiberToRoot(rootFiber, Sync);\n\n if (root !== null) {\n ensureRootIsScheduled(root);\n schedulePendingInteractions(root, Sync);\n }\n}\n\nfunction captureCommitPhaseError(sourceFiber, error) {\n if (sourceFiber.tag === HostRoot) {\n // Error was thrown at the root. There is no parent, so the root\n // itself should capture it.\n captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);\n return;\n }\n\n var fiber = sourceFiber.return;\n\n while (fiber !== null) {\n if (fiber.tag === HostRoot) {\n captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error);\n return;\n } else if (fiber.tag === ClassComponent) {\n var ctor = fiber.type;\n var instance = fiber.stateNode;\n\n if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {\n var errorInfo = createCapturedValue(error, sourceFiber);\n var update = createClassErrorUpdate(fiber, errorInfo, // TODO: This is always sync\n Sync);\n enqueueUpdate(fiber, update);\n var root = markUpdateTimeFromFiberToRoot(fiber, Sync);\n\n if (root !== null) {\n ensureRootIsScheduled(root);\n schedulePendingInteractions(root, Sync);\n }\n\n return;\n }\n }\n\n fiber = fiber.return;\n }\n}\nfunction pingSuspendedRoot(root, thenable, suspendedTime) {\n var pingCache = root.pingCache;\n\n if (pingCache !== null) {\n // The thenable resolved, so we no longer need to memoize, because it will\n // never be thrown again.\n pingCache.delete(thenable);\n }\n\n if (workInProgressRoot === root && renderExpirationTime$1 === suspendedTime) {\n // Received a ping at the same priority level at which we're currently\n // rendering. We might want to restart this render. This should mirror\n // the logic of whether or not a root suspends once it completes.\n // TODO: If we're rendering sync either due to Sync, Batched or expired,\n // we should probably never restart.\n // If we're suspended with delay, we'll always suspend so we can always\n // restart. If we're suspended without any updates, it might be a retry.\n // If it's early in the retry we can restart. We can't know for sure\n // whether we'll eventually process an update during this render pass,\n // but it's somewhat unlikely that we get to a ping before that, since\n // getting to the root most update is usually very fast.\n if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && workInProgressRootLatestProcessedExpirationTime === Sync && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {\n // Restart from the root. Don't need to schedule a ping because\n // we're already working on this tree.\n prepareFreshStack(root, renderExpirationTime$1);\n } else {\n // Even though we can't restart right now, we might get an\n // opportunity later. So we mark this render as having a ping.\n workInProgressRootHasPendingPing = true;\n }\n\n return;\n }\n\n if (!isRootSuspendedAtTime(root, suspendedTime)) {\n // The root is no longer suspended at this time.\n return;\n }\n\n var lastPingedTime = root.lastPingedTime;\n\n if (lastPingedTime !== NoWork && lastPingedTime < suspendedTime) {\n // There's already a lower priority ping scheduled.\n return;\n } // Mark the time at which this ping was scheduled.\n\n\n root.lastPingedTime = suspendedTime;\n\n ensureRootIsScheduled(root);\n schedulePendingInteractions(root, suspendedTime);\n}\n\nfunction retryTimedOutBoundary(boundaryFiber, retryTime) {\n // The boundary fiber (a Suspense component or SuspenseList component)\n // previously was rendered in its fallback state. One of the promises that\n // suspended it has resolved, which means at least part of the tree was\n // likely unblocked. Try rendering again, at a new expiration time.\n if (retryTime === NoWork) {\n var suspenseConfig = null; // Retries don't carry over the already committed update.\n\n var currentTime = requestCurrentTimeForUpdate();\n retryTime = computeExpirationForFiber(currentTime, boundaryFiber, suspenseConfig);\n } // TODO: Special case idle priority?\n\n\n var root = markUpdateTimeFromFiberToRoot(boundaryFiber, retryTime);\n\n if (root !== null) {\n ensureRootIsScheduled(root);\n schedulePendingInteractions(root, retryTime);\n }\n}\nfunction resolveRetryThenable(boundaryFiber, thenable) {\n var retryTime = NoWork; // Default\n\n var retryCache;\n\n {\n retryCache = boundaryFiber.stateNode;\n }\n\n if (retryCache !== null) {\n // The thenable resolved, so we no longer need to memoize, because it will\n // never be thrown again.\n retryCache.delete(thenable);\n }\n\n retryTimedOutBoundary(boundaryFiber, retryTime);\n} // Computes the next Just Noticeable Difference (JND) boundary.\n// The theory is that a person can't tell the difference between small differences in time.\n// Therefore, if we wait a bit longer than necessary that won't translate to a noticeable\n// difference in the experience. However, waiting for longer might mean that we can avoid\n// showing an intermediate loading state. The longer we have already waited, the harder it\n// is to tell small differences in time. Therefore, the longer we've already waited,\n// the longer we can wait additionally. At some point we have to give up though.\n// We pick a train model where the next boundary commits at a consistent schedule.\n// These particular numbers are vague estimates. We expect to adjust them based on research.\n\nfunction jnd(timeElapsed) {\n return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;\n}\n\nfunction computeMsUntilSuspenseLoadingDelay(mostRecentEventTime, committedExpirationTime, suspenseConfig) {\n var busyMinDurationMs = suspenseConfig.busyMinDurationMs | 0;\n\n if (busyMinDurationMs <= 0) {\n return 0;\n }\n\n var busyDelayMs = suspenseConfig.busyDelayMs | 0; // Compute the time until this render pass would expire.\n\n var currentTimeMs = now();\n var eventTimeMs = inferTimeFromExpirationTimeWithSuspenseConfig(mostRecentEventTime, suspenseConfig);\n var timeElapsed = currentTimeMs - eventTimeMs;\n\n if (timeElapsed <= busyDelayMs) {\n // If we haven't yet waited longer than the initial delay, we don't\n // have to wait any additional time.\n return 0;\n }\n\n var msUntilTimeout = busyDelayMs + busyMinDurationMs - timeElapsed; // This is the value that is passed to `setTimeout`.\n\n return msUntilTimeout;\n}\n\nfunction checkForNestedUpdates() {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n nestedUpdateCount = 0;\n rootWithNestedUpdates = null;\n\n {\n {\n throw Error( \"Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.\" );\n }\n }\n }\n\n {\n if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {\n nestedPassiveUpdateCount = 0;\n\n error('Maximum update depth exceeded. This can happen when a component ' + \"calls setState inside useEffect, but useEffect either doesn't \" + 'have a dependency array, or one of the dependencies changes on ' + 'every render.');\n }\n }\n}\n\nfunction flushRenderPhaseStrictModeWarningsInDEV() {\n {\n ReactStrictModeWarnings.flushLegacyContextWarning();\n\n {\n ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();\n }\n }\n}\n\nfunction stopFinishedWorkLoopTimer() {\n var didCompleteRoot = true;\n stopWorkLoopTimer(interruptedBy, didCompleteRoot);\n interruptedBy = null;\n}\n\nfunction stopInterruptedWorkLoopTimer() {\n // TODO: Track which fiber caused the interruption.\n var didCompleteRoot = false;\n stopWorkLoopTimer(interruptedBy, didCompleteRoot);\n interruptedBy = null;\n}\n\nfunction checkForInterruption(fiberThatReceivedUpdate, updateExpirationTime) {\n if ( workInProgressRoot !== null && updateExpirationTime > renderExpirationTime$1) {\n interruptedBy = fiberThatReceivedUpdate;\n }\n}\n\nvar didWarnStateUpdateForUnmountedComponent = null;\n\nfunction warnAboutUpdateOnUnmountedFiberInDEV(fiber) {\n {\n var tag = fiber.tag;\n\n if (tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {\n // Only warn for user-defined components, not internal ones like Suspense.\n return;\n }\n // the problematic code almost always lies inside that component.\n\n\n var componentName = getComponentName(fiber.type) || 'ReactComponent';\n\n if (didWarnStateUpdateForUnmountedComponent !== null) {\n if (didWarnStateUpdateForUnmountedComponent.has(componentName)) {\n return;\n }\n\n didWarnStateUpdateForUnmountedComponent.add(componentName);\n } else {\n didWarnStateUpdateForUnmountedComponent = new Set([componentName]);\n }\n\n error(\"Can't perform a React state update on an unmounted component. This \" + 'is a no-op, but it indicates a memory leak in your application. To ' + 'fix, cancel all subscriptions and asynchronous tasks in %s.%s', tag === ClassComponent ? 'the componentWillUnmount method' : 'a useEffect cleanup function', getStackByFiberInDevAndProd(fiber));\n }\n}\n\nvar beginWork$1;\n\n{\n var dummyFiber = null;\n\n beginWork$1 = function (current, unitOfWork, expirationTime) {\n // If a component throws an error, we replay it again in a synchronously\n // dispatched event, so that the debugger will treat it as an uncaught\n // error See ReactErrorUtils for more information.\n // Before entering the begin phase, copy the work-in-progress onto a dummy\n // fiber. If beginWork throws, we'll use this to reset the state.\n var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);\n\n try {\n return beginWork(current, unitOfWork, expirationTime);\n } catch (originalError) {\n if (originalError !== null && typeof originalError === 'object' && typeof originalError.then === 'function') {\n // Don't replay promises. Treat everything else like an error.\n throw originalError;\n } // Keep this code in sync with handleError; any changes here must have\n // corresponding changes there.\n\n\n resetContextDependencies();\n resetHooksAfterThrow(); // Don't reset current debug fiber, since we're about to work on the\n // same fiber again.\n // Unwind the failed stack frame\n\n unwindInterruptedWork(unitOfWork); // Restore the original properties of the fiber.\n\n assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);\n\n if ( unitOfWork.mode & ProfileMode) {\n // Reset the profiler timer.\n startProfilerTimer(unitOfWork);\n } // Run beginWork again.\n\n\n invokeGuardedCallback(null, beginWork, null, current, unitOfWork, expirationTime);\n\n if (hasCaughtError()) {\n var replayError = clearCaughtError(); // `invokeGuardedCallback` sometimes sets an expando `_suppressLogging`.\n // Rethrow this error instead of the original one.\n\n throw replayError;\n } else {\n // This branch is reachable if the render phase is impure.\n throw originalError;\n }\n }\n };\n}\n\nvar didWarnAboutUpdateInRender = false;\nvar didWarnAboutUpdateInRenderForAnotherComponent;\n\n{\n didWarnAboutUpdateInRenderForAnotherComponent = new Set();\n}\n\nfunction warnAboutRenderPhaseUpdatesInDEV(fiber) {\n {\n if (isRendering && (executionContext & RenderContext) !== NoContext) {\n switch (fiber.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n {\n var renderingComponentName = workInProgress && getComponentName(workInProgress.type) || 'Unknown'; // Dedupe by the rendering component because it's the one that needs to be fixed.\n\n var dedupeKey = renderingComponentName;\n\n if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {\n didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);\n var setStateComponentName = getComponentName(fiber.type) || 'Unknown';\n\n error('Cannot update a component (`%s`) while rendering a ' + 'different component (`%s`). To locate the bad setState() call inside `%s`, ' + 'follow the stack trace as described in https://fb.me/setstate-in-render', setStateComponentName, renderingComponentName, renderingComponentName);\n }\n\n break;\n }\n\n case ClassComponent:\n {\n if (!didWarnAboutUpdateInRender) {\n error('Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure ' + 'function of props and state.');\n\n didWarnAboutUpdateInRender = true;\n }\n\n break;\n }\n }\n }\n }\n} // a 'shared' variable that changes when act() opens/closes in tests.\n\n\nvar IsThisRendererActing = {\n current: false\n};\nfunction warnIfNotScopedWithMatchingAct(fiber) {\n {\n if ( IsSomeRendererActing.current === true && IsThisRendererActing.current !== true) {\n error(\"It looks like you're using the wrong act() around your test interactions.\\n\" + 'Be sure to use the matching version of act() corresponding to your renderer:\\n\\n' + '// for react-dom:\\n' + \"import {act} from 'react-dom/test-utils';\\n\" + '// ...\\n' + 'act(() => ...);\\n\\n' + '// for react-test-renderer:\\n' + \"import TestRenderer from 'react-test-renderer';\\n\" + 'const {act} = TestRenderer;\\n' + '// ...\\n' + 'act(() => ...);' + '%s', getStackByFiberInDevAndProd(fiber));\n }\n }\n}\nfunction warnIfNotCurrentlyActingEffectsInDEV(fiber) {\n {\n if ( (fiber.mode & StrictMode) !== NoMode && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {\n error('An update to %s ran an effect, but was not wrapped in act(...).\\n\\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\\n\\n' + 'act(() => {\\n' + ' /* fire events that update state */\\n' + '});\\n' + '/* assert on the output */\\n\\n' + \"This ensures that you're testing the behavior the user would see \" + 'in the browser.' + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber));\n }\n }\n}\n\nfunction warnIfNotCurrentlyActingUpdatesInDEV(fiber) {\n {\n if ( executionContext === NoContext && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {\n error('An update to %s inside a test was not wrapped in act(...).\\n\\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\\n\\n' + 'act(() => {\\n' + ' /* fire events that update state */\\n' + '});\\n' + '/* assert on the output */\\n\\n' + \"This ensures that you're testing the behavior the user would see \" + 'in the browser.' + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber));\n }\n }\n}\n\nvar warnIfNotCurrentlyActingUpdatesInDev = warnIfNotCurrentlyActingUpdatesInDEV; // In tests, we want to enforce a mocked scheduler.\n\nvar didWarnAboutUnmockedScheduler = false; // TODO Before we release concurrent mode, revisit this and decide whether a mocked\n// scheduler is the actual recommendation. The alternative could be a testing build,\n// a new lib, or whatever; we dunno just yet. This message is for early adopters\n// to get their tests right.\n\nfunction warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}\n\nfunction computeThreadID(root, expirationTime) {\n // Interaction threads are unique per root and expiration time.\n return expirationTime * 1000 + root.interactionThreadID;\n}\n\nfunction markSpawnedWork(expirationTime) {\n\n if (spawnedWorkDuringRender === null) {\n spawnedWorkDuringRender = [expirationTime];\n } else {\n spawnedWorkDuringRender.push(expirationTime);\n }\n}\n\nfunction scheduleInteractions(root, expirationTime, interactions) {\n\n if (interactions.size > 0) {\n var pendingInteractionMap = root.pendingInteractionMap;\n var pendingInteractions = pendingInteractionMap.get(expirationTime);\n\n if (pendingInteractions != null) {\n interactions.forEach(function (interaction) {\n if (!pendingInteractions.has(interaction)) {\n // Update the pending async work count for previously unscheduled interaction.\n interaction.__count++;\n }\n\n pendingInteractions.add(interaction);\n });\n } else {\n pendingInteractionMap.set(expirationTime, new Set(interactions)); // Update the pending async work count for the current interactions.\n\n interactions.forEach(function (interaction) {\n interaction.__count++;\n });\n }\n\n var subscriber = tracing.__subscriberRef.current;\n\n if (subscriber !== null) {\n var threadID = computeThreadID(root, expirationTime);\n subscriber.onWorkScheduled(interactions, threadID);\n }\n }\n}\n\nfunction schedulePendingInteractions(root, expirationTime) {\n\n scheduleInteractions(root, expirationTime, tracing.__interactionsRef.current);\n}\n\nfunction startWorkOnPendingInteractions(root, expirationTime) {\n // we can accurately attribute time spent working on it, And so that cascading\n // work triggered during the render phase will be associated with it.\n\n\n var interactions = new Set();\n root.pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {\n if (scheduledExpirationTime >= expirationTime) {\n scheduledInteractions.forEach(function (interaction) {\n return interactions.add(interaction);\n });\n }\n }); // Store the current set of interactions on the FiberRoot for a few reasons:\n // We can re-use it in hot functions like performConcurrentWorkOnRoot()\n // without having to recalculate it. We will also use it in commitWork() to\n // pass to any Profiler onRender() hooks. This also provides DevTools with a\n // way to access it when the onCommitRoot() hook is called.\n\n root.memoizedInteractions = interactions;\n\n if (interactions.size > 0) {\n var subscriber = tracing.__subscriberRef.current;\n\n if (subscriber !== null) {\n var threadID = computeThreadID(root, expirationTime);\n\n try {\n subscriber.onWorkStarted(interactions, threadID);\n } catch (error) {\n // If the subscriber throws, rethrow it in a separate task\n scheduleCallback(ImmediatePriority, function () {\n throw error;\n });\n }\n }\n }\n}\n\nfunction finishPendingInteractions(root, committedExpirationTime) {\n\n var earliestRemainingTimeAfterCommit = root.firstPendingTime;\n var subscriber;\n\n try {\n subscriber = tracing.__subscriberRef.current;\n\n if (subscriber !== null && root.memoizedInteractions.size > 0) {\n var threadID = computeThreadID(root, committedExpirationTime);\n subscriber.onWorkStopped(root.memoizedInteractions, threadID);\n }\n } catch (error) {\n // If the subscriber throws, rethrow it in a separate task\n scheduleCallback(ImmediatePriority, function () {\n throw error;\n });\n } finally {\n // Clear completed interactions from the pending Map.\n // Unless the render was suspended or cascading work was scheduled,\n // In which case– leave pending interactions until the subsequent render.\n var pendingInteractionMap = root.pendingInteractionMap;\n pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {\n // Only decrement the pending interaction count if we're done.\n // If there's still work at the current priority,\n // That indicates that we are waiting for suspense data.\n if (scheduledExpirationTime > earliestRemainingTimeAfterCommit) {\n pendingInteractionMap.delete(scheduledExpirationTime);\n scheduledInteractions.forEach(function (interaction) {\n interaction.__count--;\n\n if (subscriber !== null && interaction.__count === 0) {\n try {\n subscriber.onInteractionScheduledWorkCompleted(interaction);\n } catch (error) {\n // If the subscriber throws, rethrow it in a separate task\n scheduleCallback(ImmediatePriority, function () {\n throw error;\n });\n }\n }\n });\n }\n });\n }\n}\n\nvar onScheduleFiberRoot = null;\nvar onCommitFiberRoot = null;\nvar onCommitFiberUnmount = null;\nvar hasLoggedError = false;\nvar isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined';\nfunction injectInternals(internals) {\n if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {\n // No DevTools\n return false;\n }\n\n var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;\n\n if (hook.isDisabled) {\n // This isn't a real property on the hook, but it can be set to opt out\n // of DevTools integration and associated warnings and logs.\n // https://github.com/facebook/react/issues/3877\n return true;\n }\n\n if (!hook.supportsFiber) {\n {\n error('The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://fb.me/react-devtools');\n } // DevTools exists, even though it doesn't support Fiber.\n\n\n return true;\n }\n\n try {\n var rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks.\n\n if (true) {\n // Only used by Fast Refresh\n if (typeof hook.onScheduleFiberRoot === 'function') {\n onScheduleFiberRoot = function (root, children) {\n try {\n hook.onScheduleFiberRoot(rendererID, root, children);\n } catch (err) {\n if (true && !hasLoggedError) {\n hasLoggedError = true;\n\n error('React instrumentation encountered an error: %s', err);\n }\n }\n };\n }\n }\n\n onCommitFiberRoot = function (root, expirationTime) {\n try {\n var didError = (root.current.effectTag & DidCapture) === DidCapture;\n\n if (enableProfilerTimer) {\n var currentTime = getCurrentTime();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime);\n hook.onCommitFiberRoot(rendererID, root, priorityLevel, didError);\n } else {\n hook.onCommitFiberRoot(rendererID, root, undefined, didError);\n }\n } catch (err) {\n if (true) {\n if (!hasLoggedError) {\n hasLoggedError = true;\n\n error('React instrumentation encountered an error: %s', err);\n }\n }\n }\n };\n\n onCommitFiberUnmount = function (fiber) {\n try {\n hook.onCommitFiberUnmount(rendererID, fiber);\n } catch (err) {\n if (true) {\n if (!hasLoggedError) {\n hasLoggedError = true;\n\n error('React instrumentation encountered an error: %s', err);\n }\n }\n }\n };\n } catch (err) {\n // Catch all errors because it is unsafe to throw during initialization.\n {\n error('React instrumentation encountered an error: %s.', err);\n }\n } // DevTools exists\n\n\n return true;\n}\nfunction onScheduleRoot(root, children) {\n if (typeof onScheduleFiberRoot === 'function') {\n onScheduleFiberRoot(root, children);\n }\n}\nfunction onCommitRoot(root, expirationTime) {\n if (typeof onCommitFiberRoot === 'function') {\n onCommitFiberRoot(root, expirationTime);\n }\n}\nfunction onCommitUnmount(fiber) {\n if (typeof onCommitFiberUnmount === 'function') {\n onCommitFiberUnmount(fiber);\n }\n}\n\nvar hasBadMapPolyfill;\n\n{\n hasBadMapPolyfill = false;\n\n try {\n var nonExtensibleObject = Object.preventExtensions({});\n var testMap = new Map([[nonExtensibleObject, null]]);\n var testSet = new Set([nonExtensibleObject]); // This is necessary for Rollup to not consider these unused.\n // https://github.com/rollup/rollup/issues/1771\n // TODO: we can remove these if Rollup fixes the bug.\n\n testMap.set(0, 0);\n testSet.add(0);\n } catch (e) {\n // TODO: Consider warning about bad polyfills\n hasBadMapPolyfill = true;\n }\n}\n\nvar debugCounter = 1;\n\nfunction FiberNode(tag, pendingProps, key, mode) {\n // Instance\n this.tag = tag;\n this.key = key;\n this.elementType = null;\n this.type = null;\n this.stateNode = null; // Fiber\n\n this.return = null;\n this.child = null;\n this.sibling = null;\n this.index = 0;\n this.ref = null;\n this.pendingProps = pendingProps;\n this.memoizedProps = null;\n this.updateQueue = null;\n this.memoizedState = null;\n this.dependencies = null;\n this.mode = mode; // Effects\n\n this.effectTag = NoEffect;\n this.nextEffect = null;\n this.firstEffect = null;\n this.lastEffect = null;\n this.expirationTime = NoWork;\n this.childExpirationTime = NoWork;\n this.alternate = null;\n\n {\n // Note: The following is done to avoid a v8 performance cliff.\n //\n // Initializing the fields below to smis and later updating them with\n // double values will cause Fibers to end up having separate shapes.\n // This behavior/bug has something to do with Object.preventExtension().\n // Fortunately this only impacts DEV builds.\n // Unfortunately it makes React unusably slow for some applications.\n // To work around this, initialize the fields below with doubles.\n //\n // Learn more about this here:\n // https://github.com/facebook/react/issues/14365\n // https://bugs.chromium.org/p/v8/issues/detail?id=8538\n this.actualDuration = Number.NaN;\n this.actualStartTime = Number.NaN;\n this.selfBaseDuration = Number.NaN;\n this.treeBaseDuration = Number.NaN; // It's okay to replace the initial doubles with smis after initialization.\n // This won't trigger the performance cliff mentioned above,\n // and it simplifies other profiler code (including DevTools).\n\n this.actualDuration = 0;\n this.actualStartTime = -1;\n this.selfBaseDuration = 0;\n this.treeBaseDuration = 0;\n } // This is normally DEV-only except www when it adds listeners.\n // TODO: remove the User Timing integration in favor of Root Events.\n\n\n {\n this._debugID = debugCounter++;\n this._debugIsCurrentlyTiming = false;\n }\n\n {\n this._debugSource = null;\n this._debugOwner = null;\n this._debugNeedsRemount = false;\n this._debugHookTypes = null;\n\n if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {\n Object.preventExtensions(this);\n }\n }\n} // This is a constructor function, rather than a POJO constructor, still\n// please ensure we do the following:\n// 1) Nobody should add any instance methods on this. Instance methods can be\n// more difficult to predict when they get optimized and they are almost\n// never inlined properly in static compilers.\n// 2) Nobody should rely on `instanceof Fiber` for type testing. We should\n// always know when it is a fiber.\n// 3) We might want to experiment with using numeric keys since they are easier\n// to optimize in a non-JIT environment.\n// 4) We can easily go from a constructor to a createFiber object literal if that\n// is faster.\n// 5) It should be easy to port this to a C struct and keep a C implementation\n// compatible.\n\n\nvar createFiber = function (tag, pendingProps, key, mode) {\n // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors\n return new FiberNode(tag, pendingProps, key, mode);\n};\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction isSimpleFunctionComponent(type) {\n return typeof type === 'function' && !shouldConstruct(type) && type.defaultProps === undefined;\n}\nfunction resolveLazyComponentTag(Component) {\n if (typeof Component === 'function') {\n return shouldConstruct(Component) ? ClassComponent : FunctionComponent;\n } else if (Component !== undefined && Component !== null) {\n var $$typeof = Component.$$typeof;\n\n if ($$typeof === REACT_FORWARD_REF_TYPE) {\n return ForwardRef;\n }\n\n if ($$typeof === REACT_MEMO_TYPE) {\n return MemoComponent;\n }\n }\n\n return IndeterminateComponent;\n} // This is used to create an alternate fiber to do work on.\n\nfunction createWorkInProgress(current, pendingProps) {\n var workInProgress = current.alternate;\n\n if (workInProgress === null) {\n // We use a double buffering pooling technique because we know that we'll\n // only ever need at most two versions of a tree. We pool the \"other\" unused\n // node that we're free to reuse. This is lazily created to avoid allocating\n // extra objects for things that are never updated. It also allow us to\n // reclaim the extra memory if needed.\n workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode);\n workInProgress.elementType = current.elementType;\n workInProgress.type = current.type;\n workInProgress.stateNode = current.stateNode;\n\n {\n // DEV-only fields\n {\n workInProgress._debugID = current._debugID;\n }\n\n workInProgress._debugSource = current._debugSource;\n workInProgress._debugOwner = current._debugOwner;\n workInProgress._debugHookTypes = current._debugHookTypes;\n }\n\n workInProgress.alternate = current;\n current.alternate = workInProgress;\n } else {\n workInProgress.pendingProps = pendingProps; // We already have an alternate.\n // Reset the effect tag.\n\n workInProgress.effectTag = NoEffect; // The effect list is no longer valid.\n\n workInProgress.nextEffect = null;\n workInProgress.firstEffect = null;\n workInProgress.lastEffect = null;\n\n {\n // We intentionally reset, rather than copy, actualDuration & actualStartTime.\n // This prevents time from endlessly accumulating in new commits.\n // This has the downside of resetting values for different priority renders,\n // But works for yielding (the common case) and should support resuming.\n workInProgress.actualDuration = 0;\n workInProgress.actualStartTime = -1;\n }\n }\n\n workInProgress.childExpirationTime = current.childExpirationTime;\n workInProgress.expirationTime = current.expirationTime;\n workInProgress.child = current.child;\n workInProgress.memoizedProps = current.memoizedProps;\n workInProgress.memoizedState = current.memoizedState;\n workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so\n // it cannot be shared with the current fiber.\n\n var currentDependencies = current.dependencies;\n workInProgress.dependencies = currentDependencies === null ? null : {\n expirationTime: currentDependencies.expirationTime,\n firstContext: currentDependencies.firstContext,\n responders: currentDependencies.responders\n }; // These will be overridden during the parent's reconciliation\n\n workInProgress.sibling = current.sibling;\n workInProgress.index = current.index;\n workInProgress.ref = current.ref;\n\n {\n workInProgress.selfBaseDuration = current.selfBaseDuration;\n workInProgress.treeBaseDuration = current.treeBaseDuration;\n }\n\n {\n workInProgress._debugNeedsRemount = current._debugNeedsRemount;\n\n switch (workInProgress.tag) {\n case IndeterminateComponent:\n case FunctionComponent:\n case SimpleMemoComponent:\n workInProgress.type = resolveFunctionForHotReloading(current.type);\n break;\n\n case ClassComponent:\n workInProgress.type = resolveClassForHotReloading(current.type);\n break;\n\n case ForwardRef:\n workInProgress.type = resolveForwardRefForHotReloading(current.type);\n break;\n }\n }\n\n return workInProgress;\n} // Used to reuse a Fiber for a second pass.\n\nfunction resetWorkInProgress(workInProgress, renderExpirationTime) {\n // This resets the Fiber to what createFiber or createWorkInProgress would\n // have set the values to before during the first pass. Ideally this wouldn't\n // be necessary but unfortunately many code paths reads from the workInProgress\n // when they should be reading from current and writing to workInProgress.\n // We assume pendingProps, index, key, ref, return are still untouched to\n // avoid doing another reconciliation.\n // Reset the effect tag but keep any Placement tags, since that's something\n // that child fiber is setting, not the reconciliation.\n workInProgress.effectTag &= Placement; // The effect list is no longer valid.\n\n workInProgress.nextEffect = null;\n workInProgress.firstEffect = null;\n workInProgress.lastEffect = null;\n var current = workInProgress.alternate;\n\n if (current === null) {\n // Reset to createFiber's initial values.\n workInProgress.childExpirationTime = NoWork;\n workInProgress.expirationTime = renderExpirationTime;\n workInProgress.child = null;\n workInProgress.memoizedProps = null;\n workInProgress.memoizedState = null;\n workInProgress.updateQueue = null;\n workInProgress.dependencies = null;\n\n {\n // Note: We don't reset the actualTime counts. It's useful to accumulate\n // actual time across multiple render passes.\n workInProgress.selfBaseDuration = 0;\n workInProgress.treeBaseDuration = 0;\n }\n } else {\n // Reset to the cloned values that createWorkInProgress would've.\n workInProgress.childExpirationTime = current.childExpirationTime;\n workInProgress.expirationTime = current.expirationTime;\n workInProgress.child = current.child;\n workInProgress.memoizedProps = current.memoizedProps;\n workInProgress.memoizedState = current.memoizedState;\n workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so\n // it cannot be shared with the current fiber.\n\n var currentDependencies = current.dependencies;\n workInProgress.dependencies = currentDependencies === null ? null : {\n expirationTime: currentDependencies.expirationTime,\n firstContext: currentDependencies.firstContext,\n responders: currentDependencies.responders\n };\n\n {\n // Note: We don't reset the actualTime counts. It's useful to accumulate\n // actual time across multiple render passes.\n workInProgress.selfBaseDuration = current.selfBaseDuration;\n workInProgress.treeBaseDuration = current.treeBaseDuration;\n }\n }\n\n return workInProgress;\n}\nfunction createHostRootFiber(tag) {\n var mode;\n\n if (tag === ConcurrentRoot) {\n mode = ConcurrentMode | BlockingMode | StrictMode;\n } else if (tag === BlockingRoot) {\n mode = BlockingMode | StrictMode;\n } else {\n mode = NoMode;\n }\n\n if ( isDevToolsPresent) {\n // Always collect profile timings when DevTools are present.\n // This enables DevTools to start capturing timing at any point–\n // Without some nodes in the tree having empty base times.\n mode |= ProfileMode;\n }\n\n return createFiber(HostRoot, null, null, mode);\n}\nfunction createFiberFromTypeAndProps(type, // React$ElementType\nkey, pendingProps, owner, mode, expirationTime) {\n var fiber;\n var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy.\n\n var resolvedType = type;\n\n if (typeof type === 'function') {\n if (shouldConstruct(type)) {\n fiberTag = ClassComponent;\n\n {\n resolvedType = resolveClassForHotReloading(resolvedType);\n }\n } else {\n {\n resolvedType = resolveFunctionForHotReloading(resolvedType);\n }\n }\n } else if (typeof type === 'string') {\n fiberTag = HostComponent;\n } else {\n getTag: switch (type) {\n case REACT_FRAGMENT_TYPE:\n return createFiberFromFragment(pendingProps.children, mode, expirationTime, key);\n\n case REACT_CONCURRENT_MODE_TYPE:\n fiberTag = Mode;\n mode |= ConcurrentMode | BlockingMode | StrictMode;\n break;\n\n case REACT_STRICT_MODE_TYPE:\n fiberTag = Mode;\n mode |= StrictMode;\n break;\n\n case REACT_PROFILER_TYPE:\n return createFiberFromProfiler(pendingProps, mode, expirationTime, key);\n\n case REACT_SUSPENSE_TYPE:\n return createFiberFromSuspense(pendingProps, mode, expirationTime, key);\n\n case REACT_SUSPENSE_LIST_TYPE:\n return createFiberFromSuspenseList(pendingProps, mode, expirationTime, key);\n\n default:\n {\n if (typeof type === 'object' && type !== null) {\n switch (type.$$typeof) {\n case REACT_PROVIDER_TYPE:\n fiberTag = ContextProvider;\n break getTag;\n\n case REACT_CONTEXT_TYPE:\n // This is a consumer\n fiberTag = ContextConsumer;\n break getTag;\n\n case REACT_FORWARD_REF_TYPE:\n fiberTag = ForwardRef;\n\n {\n resolvedType = resolveForwardRefForHotReloading(resolvedType);\n }\n\n break getTag;\n\n case REACT_MEMO_TYPE:\n fiberTag = MemoComponent;\n break getTag;\n\n case REACT_LAZY_TYPE:\n fiberTag = LazyComponent;\n resolvedType = null;\n break getTag;\n\n case REACT_BLOCK_TYPE:\n fiberTag = Block;\n break getTag;\n\n }\n }\n\n var info = '';\n\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 var ownerName = owner ? getComponentName(owner.type) : null;\n\n if (ownerName) {\n info += '\\n\\nCheck the render method of `' + ownerName + '`.';\n }\n }\n\n {\n {\n throw 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 }\n }\n }\n\n fiber = createFiber(fiberTag, pendingProps, key, mode);\n fiber.elementType = type;\n fiber.type = resolvedType;\n fiber.expirationTime = expirationTime;\n return fiber;\n}\nfunction createFiberFromElement(element, mode, expirationTime) {\n var owner = null;\n\n {\n owner = element._owner;\n }\n\n var type = element.type;\n var key = element.key;\n var pendingProps = element.props;\n var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, expirationTime);\n\n {\n fiber._debugSource = element._source;\n fiber._debugOwner = element._owner;\n }\n\n return fiber;\n}\nfunction createFiberFromFragment(elements, mode, expirationTime, key) {\n var fiber = createFiber(Fragment, elements, key, mode);\n fiber.expirationTime = expirationTime;\n return fiber;\n}\n\nfunction createFiberFromProfiler(pendingProps, mode, expirationTime, key) {\n {\n if (typeof pendingProps.id !== 'string' || typeof pendingProps.onRender !== 'function') {\n error('Profiler must specify an \"id\" string and \"onRender\" function as props');\n }\n }\n\n var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode); // TODO: The Profiler fiber shouldn't have a type. It has a tag.\n\n fiber.elementType = REACT_PROFILER_TYPE;\n fiber.type = REACT_PROFILER_TYPE;\n fiber.expirationTime = expirationTime;\n return fiber;\n}\n\nfunction createFiberFromSuspense(pendingProps, mode, expirationTime, key) {\n var fiber = createFiber(SuspenseComponent, pendingProps, key, mode); // TODO: The SuspenseComponent fiber shouldn't have a type. It has a tag.\n // This needs to be fixed in getComponentName so that it relies on the tag\n // instead.\n\n fiber.type = REACT_SUSPENSE_TYPE;\n fiber.elementType = REACT_SUSPENSE_TYPE;\n fiber.expirationTime = expirationTime;\n return fiber;\n}\nfunction createFiberFromSuspenseList(pendingProps, mode, expirationTime, key) {\n var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);\n\n {\n // TODO: The SuspenseListComponent fiber shouldn't have a type. It has a tag.\n // This needs to be fixed in getComponentName so that it relies on the tag\n // instead.\n fiber.type = REACT_SUSPENSE_LIST_TYPE;\n }\n\n fiber.elementType = REACT_SUSPENSE_LIST_TYPE;\n fiber.expirationTime = expirationTime;\n return fiber;\n}\nfunction createFiberFromText(content, mode, expirationTime) {\n var fiber = createFiber(HostText, content, null, mode);\n fiber.expirationTime = expirationTime;\n return fiber;\n}\nfunction createFiberFromHostInstanceForDeletion() {\n var fiber = createFiber(HostComponent, null, null, NoMode); // TODO: These should not need a type.\n\n fiber.elementType = 'DELETED';\n fiber.type = 'DELETED';\n return fiber;\n}\nfunction createFiberFromPortal(portal, mode, expirationTime) {\n var pendingProps = portal.children !== null ? portal.children : [];\n var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);\n fiber.expirationTime = expirationTime;\n fiber.stateNode = {\n containerInfo: portal.containerInfo,\n pendingChildren: null,\n // Used by persistent updates\n implementation: portal.implementation\n };\n return fiber;\n} // Used for stashing WIP properties to replay failed work in DEV.\n\nfunction assignFiberPropertiesInDEV(target, source) {\n if (target === null) {\n // This Fiber's initial properties will always be overwritten.\n // We only use a Fiber to ensure the same hidden class so DEV isn't slow.\n target = createFiber(IndeterminateComponent, null, null, NoMode);\n } // This is intentionally written as a list of all properties.\n // We tried to use Object.assign() instead but this is called in\n // the hottest path, and Object.assign() was too slow:\n // https://github.com/facebook/react/issues/12502\n // This code is DEV-only so size is not a concern.\n\n\n target.tag = source.tag;\n target.key = source.key;\n target.elementType = source.elementType;\n target.type = source.type;\n target.stateNode = source.stateNode;\n target.return = source.return;\n target.child = source.child;\n target.sibling = source.sibling;\n target.index = source.index;\n target.ref = source.ref;\n target.pendingProps = source.pendingProps;\n target.memoizedProps = source.memoizedProps;\n target.updateQueue = source.updateQueue;\n target.memoizedState = source.memoizedState;\n target.dependencies = source.dependencies;\n target.mode = source.mode;\n target.effectTag = source.effectTag;\n target.nextEffect = source.nextEffect;\n target.firstEffect = source.firstEffect;\n target.lastEffect = source.lastEffect;\n target.expirationTime = source.expirationTime;\n target.childExpirationTime = source.childExpirationTime;\n target.alternate = source.alternate;\n\n {\n target.actualDuration = source.actualDuration;\n target.actualStartTime = source.actualStartTime;\n target.selfBaseDuration = source.selfBaseDuration;\n target.treeBaseDuration = source.treeBaseDuration;\n }\n\n {\n target._debugID = source._debugID;\n }\n\n target._debugSource = source._debugSource;\n target._debugOwner = source._debugOwner;\n target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming;\n target._debugNeedsRemount = source._debugNeedsRemount;\n target._debugHookTypes = source._debugHookTypes;\n return target;\n}\n\nfunction FiberRootNode(containerInfo, tag, hydrate) {\n this.tag = tag;\n this.current = null;\n this.containerInfo = containerInfo;\n this.pendingChildren = null;\n this.pingCache = null;\n this.finishedExpirationTime = NoWork;\n this.finishedWork = null;\n this.timeoutHandle = noTimeout;\n this.context = null;\n this.pendingContext = null;\n this.hydrate = hydrate;\n this.callbackNode = null;\n this.callbackPriority = NoPriority;\n this.firstPendingTime = NoWork;\n this.firstSuspendedTime = NoWork;\n this.lastSuspendedTime = NoWork;\n this.nextKnownPendingLevel = NoWork;\n this.lastPingedTime = NoWork;\n this.lastExpiredTime = NoWork;\n\n {\n this.interactionThreadID = tracing.unstable_getThreadID();\n this.memoizedInteractions = new Set();\n this.pendingInteractionMap = new Map();\n }\n}\n\nfunction createFiberRoot(containerInfo, tag, hydrate, hydrationCallbacks) {\n var root = new FiberRootNode(containerInfo, tag, hydrate);\n // stateNode is any.\n\n\n var uninitializedFiber = createHostRootFiber(tag);\n root.current = uninitializedFiber;\n uninitializedFiber.stateNode = root;\n initializeUpdateQueue(uninitializedFiber);\n return root;\n}\nfunction isRootSuspendedAtTime(root, expirationTime) {\n var firstSuspendedTime = root.firstSuspendedTime;\n var lastSuspendedTime = root.lastSuspendedTime;\n return firstSuspendedTime !== NoWork && firstSuspendedTime >= expirationTime && lastSuspendedTime <= expirationTime;\n}\nfunction markRootSuspendedAtTime(root, expirationTime) {\n var firstSuspendedTime = root.firstSuspendedTime;\n var lastSuspendedTime = root.lastSuspendedTime;\n\n if (firstSuspendedTime < expirationTime) {\n root.firstSuspendedTime = expirationTime;\n }\n\n if (lastSuspendedTime > expirationTime || firstSuspendedTime === NoWork) {\n root.lastSuspendedTime = expirationTime;\n }\n\n if (expirationTime <= root.lastPingedTime) {\n root.lastPingedTime = NoWork;\n }\n\n if (expirationTime <= root.lastExpiredTime) {\n root.lastExpiredTime = NoWork;\n }\n}\nfunction markRootUpdatedAtTime(root, expirationTime) {\n // Update the range of pending times\n var firstPendingTime = root.firstPendingTime;\n\n if (expirationTime > firstPendingTime) {\n root.firstPendingTime = expirationTime;\n } // Update the range of suspended times. Treat everything lower priority or\n // equal to this update as unsuspended.\n\n\n var firstSuspendedTime = root.firstSuspendedTime;\n\n if (firstSuspendedTime !== NoWork) {\n if (expirationTime >= firstSuspendedTime) {\n // The entire suspended range is now unsuspended.\n root.firstSuspendedTime = root.lastSuspendedTime = root.nextKnownPendingLevel = NoWork;\n } else if (expirationTime >= root.lastSuspendedTime) {\n root.lastSuspendedTime = expirationTime + 1;\n } // This is a pending level. Check if it's higher priority than the next\n // known pending level.\n\n\n if (expirationTime > root.nextKnownPendingLevel) {\n root.nextKnownPendingLevel = expirationTime;\n }\n }\n}\nfunction markRootFinishedAtTime(root, finishedExpirationTime, remainingExpirationTime) {\n // Update the range of pending times\n root.firstPendingTime = remainingExpirationTime; // Update the range of suspended times. Treat everything higher priority or\n // equal to this update as unsuspended.\n\n if (finishedExpirationTime <= root.lastSuspendedTime) {\n // The entire suspended range is now unsuspended.\n root.firstSuspendedTime = root.lastSuspendedTime = root.nextKnownPendingLevel = NoWork;\n } else if (finishedExpirationTime <= root.firstSuspendedTime) {\n // Part of the suspended range is now unsuspended. Narrow the range to\n // include everything between the unsuspended time (non-inclusive) and the\n // last suspended time.\n root.firstSuspendedTime = finishedExpirationTime - 1;\n }\n\n if (finishedExpirationTime <= root.lastPingedTime) {\n // Clear the pinged time\n root.lastPingedTime = NoWork;\n }\n\n if (finishedExpirationTime <= root.lastExpiredTime) {\n // Clear the expired time\n root.lastExpiredTime = NoWork;\n }\n}\nfunction markRootExpiredAtTime(root, expirationTime) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime === NoWork || lastExpiredTime > expirationTime) {\n root.lastExpiredTime = expirationTime;\n }\n}\n\nvar didWarnAboutNestedUpdates;\nvar didWarnAboutFindNodeInStrictMode;\n\n{\n didWarnAboutNestedUpdates = false;\n didWarnAboutFindNodeInStrictMode = {};\n}\n\nfunction getContextForSubtree(parentComponent) {\n if (!parentComponent) {\n return emptyContextObject;\n }\n\n var fiber = get(parentComponent);\n var parentContext = findCurrentUnmaskedContext(fiber);\n\n if (fiber.tag === ClassComponent) {\n var Component = fiber.type;\n\n if (isContextProvider(Component)) {\n return processChildContext(fiber, Component, parentContext);\n }\n }\n\n return parentContext;\n}\n\nfunction findHostInstanceWithWarning(component, methodName) {\n {\n var fiber = get(component);\n\n if (fiber === undefined) {\n if (typeof component.render === 'function') {\n {\n {\n throw Error( \"Unable to find node on an unmounted component.\" );\n }\n }\n } else {\n {\n {\n throw Error( \"Argument appears to not be a ReactComponent. Keys: \" + Object.keys(component) );\n }\n }\n }\n }\n\n var hostFiber = findCurrentHostFiber(fiber);\n\n if (hostFiber === null) {\n return null;\n }\n\n if (hostFiber.mode & StrictMode) {\n var componentName = getComponentName(fiber.type) || 'Component';\n\n if (!didWarnAboutFindNodeInStrictMode[componentName]) {\n didWarnAboutFindNodeInStrictMode[componentName] = true;\n\n if (fiber.mode & StrictMode) {\n error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which is inside StrictMode. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-find-node%s', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));\n } else {\n error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which renders StrictMode children. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-find-node%s', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));\n }\n }\n }\n\n return hostFiber.stateNode;\n }\n}\n\nfunction createContainer(containerInfo, tag, hydrate, hydrationCallbacks) {\n return createFiberRoot(containerInfo, tag, hydrate);\n}\nfunction updateContainer(element, container, parentComponent, callback) {\n {\n onScheduleRoot(container, element);\n }\n\n var current$1 = container.current;\n var currentTime = requestCurrentTimeForUpdate();\n\n {\n // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n if ('undefined' !== typeof jest) {\n warnIfUnmockedScheduler(current$1);\n warnIfNotScopedWithMatchingAct(current$1);\n }\n }\n\n var suspenseConfig = requestCurrentSuspenseConfig();\n var expirationTime = computeExpirationForFiber(currentTime, current$1, suspenseConfig);\n var context = getContextForSubtree(parentComponent);\n\n if (container.context === null) {\n container.context = context;\n } else {\n container.pendingContext = context;\n }\n\n {\n if (isRendering && current !== null && !didWarnAboutNestedUpdates) {\n didWarnAboutNestedUpdates = true;\n\n error('Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\\n\\n' + 'Check the render method of %s.', getComponentName(current.type) || 'Unknown');\n }\n }\n\n var update = createUpdate(expirationTime, suspenseConfig); // Caution: React DevTools currently depends on this property\n // being called \"element\".\n\n update.payload = {\n element: element\n };\n callback = callback === undefined ? null : callback;\n\n if (callback !== null) {\n {\n if (typeof callback !== 'function') {\n error('render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback);\n }\n }\n\n update.callback = callback;\n }\n\n enqueueUpdate(current$1, update);\n scheduleWork(current$1, expirationTime);\n return expirationTime;\n}\nfunction getPublicRootInstance(container) {\n var containerFiber = container.current;\n\n if (!containerFiber.child) {\n return null;\n }\n\n switch (containerFiber.child.tag) {\n case HostComponent:\n return getPublicInstance(containerFiber.child.stateNode);\n\n default:\n return containerFiber.child.stateNode;\n }\n}\n\nfunction markRetryTimeImpl(fiber, retryTime) {\n var suspenseState = fiber.memoizedState;\n\n if (suspenseState !== null && suspenseState.dehydrated !== null) {\n if (suspenseState.retryTime < retryTime) {\n suspenseState.retryTime = retryTime;\n }\n }\n} // Increases the priority of thennables when they resolve within this boundary.\n\n\nfunction markRetryTimeIfNotHydrated(fiber, retryTime) {\n markRetryTimeImpl(fiber, retryTime);\n var alternate = fiber.alternate;\n\n if (alternate) {\n markRetryTimeImpl(alternate, retryTime);\n }\n}\n\nfunction attemptUserBlockingHydration$1(fiber) {\n if (fiber.tag !== SuspenseComponent) {\n // We ignore HostRoots here because we can't increase\n // their priority and they should not suspend on I/O,\n // since you have to wrap anything that might suspend in\n // Suspense.\n return;\n }\n\n var expTime = computeInteractiveExpiration(requestCurrentTimeForUpdate());\n scheduleWork(fiber, expTime);\n markRetryTimeIfNotHydrated(fiber, expTime);\n}\nfunction attemptContinuousHydration$1(fiber) {\n if (fiber.tag !== SuspenseComponent) {\n // We ignore HostRoots here because we can't increase\n // their priority and they should not suspend on I/O,\n // since you have to wrap anything that might suspend in\n // Suspense.\n return;\n }\n\n scheduleWork(fiber, ContinuousHydration);\n markRetryTimeIfNotHydrated(fiber, ContinuousHydration);\n}\nfunction attemptHydrationAtCurrentPriority$1(fiber) {\n if (fiber.tag !== SuspenseComponent) {\n // We ignore HostRoots here because we can't increase\n // their priority other than synchronously flush it.\n return;\n }\n\n var currentTime = requestCurrentTimeForUpdate();\n var expTime = computeExpirationForFiber(currentTime, fiber, null);\n scheduleWork(fiber, expTime);\n markRetryTimeIfNotHydrated(fiber, expTime);\n}\nfunction findHostInstanceWithNoPortals(fiber) {\n var hostFiber = findCurrentHostFiberWithNoPortals(fiber);\n\n if (hostFiber === null) {\n return null;\n }\n\n if (hostFiber.tag === FundamentalComponent) {\n return hostFiber.stateNode.instance;\n }\n\n return hostFiber.stateNode;\n}\n\nvar shouldSuspendImpl = function (fiber) {\n return false;\n};\n\nfunction shouldSuspend(fiber) {\n return shouldSuspendImpl(fiber);\n}\nvar overrideHookState = null;\nvar overrideProps = null;\nvar scheduleUpdate = null;\nvar setSuspenseHandler = null;\n\n{\n var copyWithSetImpl = function (obj, path, idx, value) {\n if (idx >= path.length) {\n return value;\n }\n\n var key = path[idx];\n var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj); // $FlowFixMe number or string is fine here\n\n updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value);\n return updated;\n };\n\n var copyWithSet = function (obj, path, value) {\n return copyWithSetImpl(obj, path, 0, value);\n }; // Support DevTools editable values for useState and useReducer.\n\n\n overrideHookState = function (fiber, id, path, value) {\n // For now, the \"id\" of stateful hooks is just the stateful hook index.\n // This may change in the future with e.g. nested hooks.\n var currentHook = fiber.memoizedState;\n\n while (currentHook !== null && id > 0) {\n currentHook = currentHook.next;\n id--;\n }\n\n if (currentHook !== null) {\n var newState = copyWithSet(currentHook.memoizedState, path, value);\n currentHook.memoizedState = newState;\n currentHook.baseState = newState; // We aren't actually adding an update to the queue,\n // because there is no update we can add for useReducer hooks that won't trigger an error.\n // (There's no appropriate action type for DevTools overrides.)\n // As a result though, React will see the scheduled update as a noop and bailout.\n // Shallow cloning props works as a workaround for now to bypass the bailout check.\n\n fiber.memoizedProps = _assign({}, fiber.memoizedProps);\n scheduleWork(fiber, Sync);\n }\n }; // Support DevTools props for function components, forwardRef, memo, host components, etc.\n\n\n overrideProps = function (fiber, path, value) {\n fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);\n\n if (fiber.alternate) {\n fiber.alternate.pendingProps = fiber.pendingProps;\n }\n\n scheduleWork(fiber, Sync);\n };\n\n scheduleUpdate = function (fiber) {\n scheduleWork(fiber, Sync);\n };\n\n setSuspenseHandler = function (newShouldSuspendImpl) {\n shouldSuspendImpl = newShouldSuspendImpl;\n };\n}\n\nfunction injectIntoDevTools(devToolsConfig) {\n var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;\n var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\n return injectInternals(_assign({}, devToolsConfig, {\n overrideHookState: overrideHookState,\n overrideProps: overrideProps,\n setSuspenseHandler: setSuspenseHandler,\n scheduleUpdate: scheduleUpdate,\n currentDispatcherRef: ReactCurrentDispatcher,\n findHostInstanceByFiber: function (fiber) {\n var hostFiber = findCurrentHostFiber(fiber);\n\n if (hostFiber === null) {\n return null;\n }\n\n return hostFiber.stateNode;\n },\n findFiberByHostInstance: function (instance) {\n if (!findFiberByHostInstance) {\n // Might not be implemented by the renderer.\n return null;\n }\n\n return findFiberByHostInstance(instance);\n },\n // React Refresh\n findHostInstancesForRefresh: findHostInstancesForRefresh ,\n scheduleRefresh: scheduleRefresh ,\n scheduleRoot: scheduleRoot ,\n setRefreshHandler: setRefreshHandler ,\n // Enables DevTools to append owner stacks to error messages in DEV mode.\n getCurrentFiber: function () {\n return current;\n } \n }));\n}\nvar IsSomeRendererActing$1 = ReactSharedInternals.IsSomeRendererActing;\n\nfunction ReactDOMRoot(container, options) {\n this._internalRoot = createRootImpl(container, ConcurrentRoot, options);\n}\n\nfunction ReactDOMBlockingRoot(container, tag, options) {\n this._internalRoot = createRootImpl(container, tag, options);\n}\n\nReactDOMRoot.prototype.render = ReactDOMBlockingRoot.prototype.render = function (children) {\n var root = this._internalRoot;\n\n {\n if (typeof arguments[1] === 'function') {\n error('render(...): does not support the second callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');\n }\n\n var container = root.containerInfo;\n\n if (container.nodeType !== COMMENT_NODE) {\n var hostInstance = findHostInstanceWithNoPortals(root.current);\n\n if (hostInstance) {\n if (hostInstance.parentNode !== container) {\n error('render(...): It looks like the React-rendered content of the ' + 'root container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + \"root.unmount() to empty a root's container.\");\n }\n }\n }\n }\n\n updateContainer(children, root, null, null);\n};\n\nReactDOMRoot.prototype.unmount = ReactDOMBlockingRoot.prototype.unmount = function () {\n {\n if (typeof arguments[0] === 'function') {\n error('unmount(...): does not support a callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');\n }\n }\n\n var root = this._internalRoot;\n var container = root.containerInfo;\n updateContainer(null, root, null, function () {\n unmarkContainerAsRoot(container);\n });\n};\n\nfunction createRootImpl(container, tag, options) {\n // Tag is either LegacyRoot or Concurrent Root\n var hydrate = options != null && options.hydrate === true;\n var hydrationCallbacks = options != null && options.hydrationOptions || null;\n var root = createContainer(container, tag, hydrate);\n markContainerAsRoot(root.current, container);\n\n if (hydrate && tag !== LegacyRoot) {\n var doc = container.nodeType === DOCUMENT_NODE ? container : container.ownerDocument;\n eagerlyTrapReplayableEvents(container, doc);\n }\n\n return root;\n}\nfunction createLegacyRoot(container, options) {\n return new ReactDOMBlockingRoot(container, LegacyRoot, options);\n}\nfunction isValidContainer(node) {\n return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable '));\n}\n\nvar ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;\nvar topLevelUpdateWarnings;\nvar warnedAboutHydrateAPI = false;\n\n{\n topLevelUpdateWarnings = function (container) {\n if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {\n var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.current);\n\n if (hostInstance) {\n if (hostInstance.parentNode !== container) {\n error('render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.');\n }\n }\n }\n\n var isRootRenderedBySomeReact = !!container._reactRootContainer;\n var rootEl = getReactRootElementInContainer(container);\n var hasNonRootReactChild = !!(rootEl && getInstanceFromNode$1(rootEl));\n\n if (hasNonRootReactChild && !isRootRenderedBySomeReact) {\n error('render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.');\n }\n\n if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === 'BODY') {\n error('render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.');\n }\n };\n}\n\nfunction getReactRootElementInContainer(container) {\n if (!container) {\n return null;\n }\n\n if (container.nodeType === DOCUMENT_NODE) {\n return container.documentElement;\n } else {\n return container.firstChild;\n }\n}\n\nfunction shouldHydrateDueToLegacyHeuristic(container) {\n var rootElement = getReactRootElementInContainer(container);\n return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));\n}\n\nfunction legacyCreateRootFromDOMContainer(container, forceHydrate) {\n var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container); // First clear any existing content.\n\n if (!shouldHydrate) {\n var warned = false;\n var rootSibling;\n\n while (rootSibling = container.lastChild) {\n {\n if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {\n warned = true;\n\n error('render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.');\n }\n }\n\n container.removeChild(rootSibling);\n }\n }\n\n {\n if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {\n warnedAboutHydrateAPI = true;\n\n warn('render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + 'will stop working in React v17. Replace the ReactDOM.render() call ' + 'with ReactDOM.hydrate() if you want React to attach to the server HTML.');\n }\n }\n\n return createLegacyRoot(container, shouldHydrate ? {\n hydrate: true\n } : undefined);\n}\n\nfunction warnOnInvalidCallback$1(callback, callerName) {\n {\n if (callback !== null && typeof callback !== 'function') {\n error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);\n }\n }\n}\n\nfunction legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {\n {\n topLevelUpdateWarnings(container);\n warnOnInvalidCallback$1(callback === undefined ? null : callback, 'render');\n } // TODO: Without `any` type, Flow says \"Property cannot be accessed on any\n // member of intersection type.\" Whyyyyyy.\n\n\n var root = container._reactRootContainer;\n var fiberRoot;\n\n if (!root) {\n // Initial mount\n root = container._reactRootContainer = legacyCreateRootFromDOMContainer(container, forceHydrate);\n fiberRoot = root._internalRoot;\n\n if (typeof callback === 'function') {\n var originalCallback = callback;\n\n callback = function () {\n var instance = getPublicRootInstance(fiberRoot);\n originalCallback.call(instance);\n };\n } // Initial mount should not be batched.\n\n\n unbatchedUpdates(function () {\n updateContainer(children, fiberRoot, parentComponent, callback);\n });\n } else {\n fiberRoot = root._internalRoot;\n\n if (typeof callback === 'function') {\n var _originalCallback = callback;\n\n callback = function () {\n var instance = getPublicRootInstance(fiberRoot);\n\n _originalCallback.call(instance);\n };\n } // Update\n\n\n updateContainer(children, fiberRoot, parentComponent, callback);\n }\n\n return getPublicRootInstance(fiberRoot);\n}\n\nfunction findDOMNode(componentOrElement) {\n {\n var owner = ReactCurrentOwner$3.current;\n\n if (owner !== null && owner.stateNode !== null) {\n var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;\n\n if (!warnedAboutRefsInRender) {\n error('%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(owner.type) || 'A component');\n }\n\n owner.stateNode._warnedAboutRefsInRender = true;\n }\n }\n\n if (componentOrElement == null) {\n return null;\n }\n\n if (componentOrElement.nodeType === ELEMENT_NODE) {\n return componentOrElement;\n }\n\n {\n return findHostInstanceWithWarning(componentOrElement, 'findDOMNode');\n }\n}\nfunction hydrate(element, container, callback) {\n if (!isValidContainer(container)) {\n {\n throw Error( \"Target container is not a DOM element.\" );\n }\n }\n\n {\n var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;\n\n if (isModernRoot) {\n error('You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call createRoot(container, {hydrate: true}).render(element)?');\n }\n } // TODO: throw or warn if we couldn't hydrate?\n\n\n return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);\n}\nfunction render(element, container, callback) {\n if (!isValidContainer(container)) {\n {\n throw Error( \"Target container is not a DOM element.\" );\n }\n }\n\n {\n var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;\n\n if (isModernRoot) {\n error('You are calling ReactDOM.render() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call root.render(element)?');\n }\n }\n\n return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);\n}\nfunction unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {\n if (!isValidContainer(containerNode)) {\n {\n throw Error( \"Target container is not a DOM element.\" );\n }\n }\n\n if (!(parentComponent != null && has(parentComponent))) {\n {\n throw Error( \"parentComponent must be a valid React Component\" );\n }\n }\n\n return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);\n}\nfunction unmountComponentAtNode(container) {\n if (!isValidContainer(container)) {\n {\n throw Error( \"unmountComponentAtNode(...): Target container is not a DOM element.\" );\n }\n }\n\n {\n var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;\n\n if (isModernRoot) {\n error('You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?');\n }\n }\n\n if (container._reactRootContainer) {\n {\n var rootEl = getReactRootElementInContainer(container);\n var renderedByDifferentReact = rootEl && !getInstanceFromNode$1(rootEl);\n\n if (renderedByDifferentReact) {\n error(\"unmountComponentAtNode(): The node you're attempting to unmount \" + 'was rendered by another copy of React.');\n }\n } // Unmount should not be batched.\n\n\n unbatchedUpdates(function () {\n legacyRenderSubtreeIntoContainer(null, null, container, false, function () {\n // $FlowFixMe This should probably use `delete container._reactRootContainer`\n container._reactRootContainer = null;\n unmarkContainerAsRoot(container);\n });\n }); // If you call unmountComponentAtNode twice in quick succession, you'll\n // get `true` twice. That's probably fine?\n\n return true;\n } else {\n {\n var _rootEl = getReactRootElementInContainer(container);\n\n var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode$1(_rootEl)); // Check if the container itself is a React root node.\n\n var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;\n\n if (hasNonRootReactChild) {\n error(\"unmountComponentAtNode(): The node you're attempting to unmount \" + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.');\n }\n }\n\n return false;\n }\n}\n\nfunction createPortal(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.\nimplementation) {\n var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n return {\n // This tag allow us to uniquely identify this as a React Portal\n $$typeof: REACT_PORTAL_TYPE,\n key: key == null ? null : '' + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n}\n\nvar ReactVersion = '16.13.1';\n\nsetAttemptUserBlockingHydration(attemptUserBlockingHydration$1);\nsetAttemptContinuousHydration(attemptContinuousHydration$1);\nsetAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);\nvar didWarnAboutUnstableCreatePortal = false;\n\n{\n if (typeof Map !== 'function' || // $FlowIssue Flow incorrectly thinks Map has no prototype\n Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' || // $FlowIssue Flow incorrectly thinks Set has no prototype\n Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') {\n error('React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');\n }\n}\n\nsetRestoreImplementation(restoreControlledState$3);\nsetBatchingImplementation(batchedUpdates$1, discreteUpdates$1, flushDiscreteUpdates, batchedEventUpdates$1);\n\nfunction createPortal$1(children, container) {\n var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n if (!isValidContainer(container)) {\n {\n throw Error( \"Target container is not a DOM element.\" );\n }\n } // TODO: pass ReactDOM portal implementation as third argument\n // $FlowFixMe The Flow type is opaque but there's no way to actually create it.\n\n\n return createPortal(children, container, null, key);\n}\n\nfunction renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {\n\n return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);\n}\n\nfunction unstable_createPortal(children, container) {\n var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n {\n if (!didWarnAboutUnstableCreatePortal) {\n didWarnAboutUnstableCreatePortal = true;\n\n warn('The ReactDOM.unstable_createPortal() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactDOM.createPortal() instead. It has the exact same API, ' + 'but without the \"unstable_\" prefix.');\n }\n }\n\n return createPortal$1(children, container, key);\n}\n\nvar Internals = {\n // Keep in sync with ReactDOMUnstableNativeDependencies.js\n // ReactTestUtils.js, and ReactTestUtilsAct.js. This is an array for better minification.\n Events: [getInstanceFromNode$1, getNodeFromInstance$1, getFiberCurrentPropsFromNode$1, injectEventPluginsByName, eventNameDispatchConfigs, accumulateTwoPhaseDispatches, accumulateDirectDispatches, enqueueStateRestore, restoreStateIfNeeded, dispatchEvent, runEventsInBatch, flushPassiveEffects, IsThisRendererActing]\n};\nvar foundDevTools = injectIntoDevTools({\n findFiberByHostInstance: getClosestInstanceFromNode,\n bundleType: 1 ,\n version: ReactVersion,\n rendererPackageName: 'react-dom'\n});\n\n{\n if (!foundDevTools && canUseDOM && window.top === window.self) {\n // If we're in Chrome or Firefox, provide a download link if not installed.\n if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {\n var protocol = window.location.protocol; // Don't warn in exotic cases like chrome-extension://.\n\n if (/^(https?|file):$/.test(protocol)) {\n // eslint-disable-next-line react-internal/no-production-logging\n console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https://fb.me/react-devtools' + (protocol === 'file:' ? '\\nYou might need to use a local HTTP server (instead of file://): ' + 'https://fb.me/react-devtools-faq' : ''), 'font-weight:bold');\n }\n }\n }\n}\n\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;\nexports.createPortal = createPortal$1;\nexports.findDOMNode = findDOMNode;\nexports.flushSync = flushSync;\nexports.hydrate = hydrate;\nexports.render = render;\nexports.unmountComponentAtNode = unmountComponentAtNode;\nexports.unstable_batchedUpdates = batchedUpdates$1;\nexports.unstable_createPortal = unstable_createPortal;\nexports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;\nexports.version = ReactVersion;\n })();\n}\n","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.min.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}\n","/** @license React v16.13.1\n * react-is.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\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\n// (unstable) APIs that have been removed. Can we remove the symbols?\n\nvar REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;\nvar REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;\nvar REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;\nvar REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;\n\nfunction isValidElementType(type) {\n return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.\n type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);\n}\n\nfunction typeOf(object) {\n if (typeof object === 'object' && object !== null) {\n var $$typeof = object.$$typeof;\n\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n var type = object.type;\n\n switch (type) {\n case REACT_ASYNC_MODE_TYPE:\n case REACT_CONCURRENT_MODE_TYPE:\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n return type;\n\n default:\n var $$typeofType = type && type.$$typeof;\n\n switch ($$typeofType) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n case REACT_PROVIDER_TYPE:\n return $$typeofType;\n\n default:\n return $$typeof;\n }\n\n }\n\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n\n return undefined;\n} // AsyncMode is deprecated along with isAsyncMode\n\nvar AsyncMode = REACT_ASYNC_MODE_TYPE;\nvar ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;\nvar ContextConsumer = REACT_CONTEXT_TYPE;\nvar ContextProvider = REACT_PROVIDER_TYPE;\nvar Element = REACT_ELEMENT_TYPE;\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Fragment = REACT_FRAGMENT_TYPE;\nvar Lazy = REACT_LAZY_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nvar Portal = REACT_PORTAL_TYPE;\nvar Profiler = REACT_PROFILER_TYPE;\nvar StrictMode = REACT_STRICT_MODE_TYPE;\nvar Suspense = REACT_SUSPENSE_TYPE;\nvar hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated\n\nfunction isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}\nfunction isConcurrentMode(object) {\n return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;\n}\nfunction isContextConsumer(object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isContextProvider(object) {\n return typeOf(object) === REACT_PROVIDER_TYPE;\n}\nfunction isElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\nfunction isForwardRef(object) {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\nfunction isFragment(object) {\n return typeOf(object) === REACT_FRAGMENT_TYPE;\n}\nfunction isLazy(object) {\n return typeOf(object) === REACT_LAZY_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\nfunction isPortal(object) {\n return typeOf(object) === REACT_PORTAL_TYPE;\n}\nfunction isProfiler(object) {\n return typeOf(object) === REACT_PROFILER_TYPE;\n}\nfunction isStrictMode(object) {\n return typeOf(object) === REACT_STRICT_MODE_TYPE;\n}\nfunction isSuspense(object) {\n return typeOf(object) === REACT_SUSPENSE_TYPE;\n}\n\nexports.AsyncMode = AsyncMode;\nexports.ConcurrentMode = ConcurrentMode;\nexports.ContextConsumer = ContextConsumer;\nexports.ContextProvider = ContextProvider;\nexports.Element = Element;\nexports.ForwardRef = ForwardRef;\nexports.Fragment = Fragment;\nexports.Lazy = Lazy;\nexports.Memo = Memo;\nexports.Portal = Portal;\nexports.Profiler = Profiler;\nexports.StrictMode = StrictMode;\nexports.Suspense = Suspense;\nexports.isAsyncMode = isAsyncMode;\nexports.isConcurrentMode = isConcurrentMode;\nexports.isContextConsumer = isContextConsumer;\nexports.isContextProvider = isContextProvider;\nexports.isElement = isElement;\nexports.isForwardRef = isForwardRef;\nexports.isFragment = isFragment;\nexports.isLazy = isLazy;\nexports.isMemo = isMemo;\nexports.isPortal = isPortal;\nexports.isProfiler = isProfiler;\nexports.isStrictMode = isStrictMode;\nexports.isSuspense = isSuspense;\nexports.isValidElementType = isValidElementType;\nexports.typeOf = typeOf;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","import React from 'react';\nexport var ReactReduxContext =\n/*#__PURE__*/\nReact.createContext(null);\n\nif (process.env.NODE_ENV !== 'production') {\n ReactReduxContext.displayName = 'ReactRedux';\n}\n\nexport default ReactReduxContext;","import React, { useMemo, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { ReactReduxContext } from './Context';\nimport Subscription from '../utils/Subscription';\n\nfunction Provider(_ref) {\n var store = _ref.store,\n context = _ref.context,\n children = _ref.children;\n var contextValue = useMemo(function () {\n var subscription = new Subscription(store);\n subscription.onStateChange = subscription.notifyNestedSubs;\n return {\n store: store,\n subscription: subscription\n };\n }, [store]);\n var previousState = useMemo(function () {\n return store.getState();\n }, [store]);\n useEffect(function () {\n var subscription = contextValue.subscription;\n subscription.trySubscribe();\n\n if (previousState !== store.getState()) {\n subscription.notifyNestedSubs();\n }\n\n return function () {\n subscription.tryUnsubscribe();\n subscription.onStateChange = null;\n };\n }, [contextValue, previousState]);\n var Context = context || ReactReduxContext;\n return React.createElement(Context.Provider, {\n value: contextValue\n }, children);\n}\n\nif (process.env.NODE_ENV !== 'production') {\n Provider.propTypes = {\n store: PropTypes.shape({\n subscribe: PropTypes.func.isRequired,\n dispatch: PropTypes.func.isRequired,\n getState: PropTypes.func.isRequired\n }),\n context: PropTypes.object,\n children: PropTypes.any\n };\n}\n\nexport default Provider;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport hoistStatics from 'hoist-non-react-statics';\nimport React, { useContext, useMemo, useRef, useReducer } from 'react';\nimport { isValidElementType, isContextConsumer } from 'react-is';\nimport Subscription from '../utils/Subscription';\nimport { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';\nimport { ReactReduxContext } from './Context'; // Define some constant arrays just to avoid re-creating these\n\nvar EMPTY_ARRAY = [];\nvar NO_SUBSCRIPTION_ARRAY = [null, null];\n\nvar stringifyComponent = function stringifyComponent(Comp) {\n try {\n return JSON.stringify(Comp);\n } catch (err) {\n return String(Comp);\n }\n};\n\nfunction storeStateUpdatesReducer(state, action) {\n var updateCount = state[1];\n return [action.payload, updateCount + 1];\n}\n\nfunction useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {\n useIsomorphicLayoutEffect(function () {\n return effectFunc.apply(void 0, effectArgs);\n }, dependencies);\n}\n\nfunction captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, actualChildProps, childPropsFromStoreUpdate, notifyNestedSubs) {\n // We want to capture the wrapper props and child props we used for later comparisons\n lastWrapperProps.current = wrapperProps;\n lastChildProps.current = actualChildProps;\n renderIsScheduled.current = false; // If the render was from a store update, clear out that reference and cascade the subscriber update\n\n if (childPropsFromStoreUpdate.current) {\n childPropsFromStoreUpdate.current = null;\n notifyNestedSubs();\n }\n}\n\nfunction subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, childPropsFromStoreUpdate, notifyNestedSubs, forceComponentUpdateDispatch) {\n // If we're not subscribed to the store, nothing to do here\n if (!shouldHandleStateChanges) return; // Capture values for checking if and when this component unmounts\n\n var didUnsubscribe = false;\n var lastThrownError = null; // We'll run this callback every time a store subscription update propagates to this component\n\n var checkForUpdates = function checkForUpdates() {\n if (didUnsubscribe) {\n // Don't run stale listeners.\n // Redux doesn't guarantee unsubscriptions happen until next dispatch.\n return;\n }\n\n var latestStoreState = store.getState();\n var newChildProps, error;\n\n try {\n // Actually run the selector with the most recent store state and wrapper props\n // to determine what the child props should be\n newChildProps = childPropsSelector(latestStoreState, lastWrapperProps.current);\n } catch (e) {\n error = e;\n lastThrownError = e;\n }\n\n if (!error) {\n lastThrownError = null;\n } // If the child props haven't changed, nothing to do here - cascade the subscription update\n\n\n if (newChildProps === lastChildProps.current) {\n if (!renderIsScheduled.current) {\n notifyNestedSubs();\n }\n } else {\n // Save references to the new child props. Note that we track the \"child props from store update\"\n // as a ref instead of a useState/useReducer because we need a way to determine if that value has\n // been processed. If this went into useState/useReducer, we couldn't clear out the value without\n // forcing another re-render, which we don't want.\n lastChildProps.current = newChildProps;\n childPropsFromStoreUpdate.current = newChildProps;\n renderIsScheduled.current = true; // If the child props _did_ change (or we caught an error), this wrapper component needs to re-render\n\n forceComponentUpdateDispatch({\n type: 'STORE_UPDATED',\n payload: {\n error: error\n }\n });\n }\n }; // Actually subscribe to the nearest connected ancestor (or store)\n\n\n subscription.onStateChange = checkForUpdates;\n subscription.trySubscribe(); // Pull data from the store after first render in case the store has\n // changed since we began.\n\n checkForUpdates();\n\n var unsubscribeWrapper = function unsubscribeWrapper() {\n didUnsubscribe = true;\n subscription.tryUnsubscribe();\n subscription.onStateChange = null;\n\n if (lastThrownError) {\n // It's possible that we caught an error due to a bad mapState function, but the\n // parent re-rendered without this component and we're about to unmount.\n // This shouldn't happen as long as we do top-down subscriptions correctly, but\n // if we ever do those wrong, this throw will surface the error in our tests.\n // In that case, throw the error from here so it doesn't get lost.\n throw lastThrownError;\n }\n };\n\n return unsubscribeWrapper;\n}\n\nvar initStateUpdates = function initStateUpdates() {\n return [null, 0];\n};\n\nexport default function connectAdvanced(\n/*\r\n selectorFactory is a func that is responsible for returning the selector function used to\r\n compute new props from state, props, and dispatch. For example:\r\n export default connectAdvanced((dispatch, options) => (state, props) => ({\r\n thing: state.things[props.thingId],\r\n saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),\r\n }))(YourComponent)\r\n Access to dispatch is provided to the factory so selectorFactories can bind actionCreators\r\n outside of their selector as an optimization. Options passed to connectAdvanced are passed to\r\n the selectorFactory, along with displayName and WrappedComponent, as the second argument.\r\n Note that selectorFactory is responsible for all caching/memoization of inbound and outbound\r\n props. Do not use connectAdvanced directly without memoizing results between calls to your\r\n selector, otherwise the Connect component will re-render on every state or props change.\r\n*/\nselectorFactory, // options object:\n_ref) {\n if (_ref === void 0) {\n _ref = {};\n }\n\n var _ref2 = _ref,\n _ref2$getDisplayName = _ref2.getDisplayName,\n getDisplayName = _ref2$getDisplayName === void 0 ? function (name) {\n return \"ConnectAdvanced(\" + name + \")\";\n } : _ref2$getDisplayName,\n _ref2$methodName = _ref2.methodName,\n methodName = _ref2$methodName === void 0 ? 'connectAdvanced' : _ref2$methodName,\n _ref2$renderCountProp = _ref2.renderCountProp,\n renderCountProp = _ref2$renderCountProp === void 0 ? undefined : _ref2$renderCountProp,\n _ref2$shouldHandleSta = _ref2.shouldHandleStateChanges,\n shouldHandleStateChanges = _ref2$shouldHandleSta === void 0 ? true : _ref2$shouldHandleSta,\n _ref2$storeKey = _ref2.storeKey,\n storeKey = _ref2$storeKey === void 0 ? 'store' : _ref2$storeKey,\n _ref2$withRef = _ref2.withRef,\n withRef = _ref2$withRef === void 0 ? false : _ref2$withRef,\n _ref2$forwardRef = _ref2.forwardRef,\n forwardRef = _ref2$forwardRef === void 0 ? false : _ref2$forwardRef,\n _ref2$context = _ref2.context,\n context = _ref2$context === void 0 ? ReactReduxContext : _ref2$context,\n connectOptions = _objectWithoutPropertiesLoose(_ref2, [\"getDisplayName\", \"methodName\", \"renderCountProp\", \"shouldHandleStateChanges\", \"storeKey\", \"withRef\", \"forwardRef\", \"context\"]);\n\n if (process.env.NODE_ENV !== 'production') {\n if (renderCountProp !== undefined) {\n throw new Error(\"renderCountProp is removed. render counting is built into the latest React Dev Tools profiling extension\");\n }\n\n if (withRef) {\n throw new Error('withRef is removed. To access the wrapped instance, use a ref on the connected component');\n }\n\n var customStoreWarningMessage = 'To use a custom Redux store for specific components, create a custom React context with ' + \"React.createContext(), and pass the context object to React Redux's Provider and specific components\" + ' like: <Provider context={MyContext}><ConnectedComponent context={MyContext} /></Provider>. ' + 'You may also pass a {context : MyContext} option to connect';\n\n if (storeKey !== 'store') {\n throw new Error('storeKey has been removed and does not do anything. ' + customStoreWarningMessage);\n }\n }\n\n var Context = context;\n return function wrapWithConnect(WrappedComponent) {\n if (process.env.NODE_ENV !== 'production' && !isValidElementType(WrappedComponent)) {\n throw new Error(\"You must pass a component to the function returned by \" + (methodName + \". Instead received \" + stringifyComponent(WrappedComponent)));\n }\n\n var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n var displayName = getDisplayName(wrappedComponentName);\n\n var selectorFactoryOptions = _extends({}, connectOptions, {\n getDisplayName: getDisplayName,\n methodName: methodName,\n renderCountProp: renderCountProp,\n shouldHandleStateChanges: shouldHandleStateChanges,\n storeKey: storeKey,\n displayName: displayName,\n wrappedComponentName: wrappedComponentName,\n WrappedComponent: WrappedComponent\n });\n\n var pure = connectOptions.pure;\n\n function createChildSelector(store) {\n return selectorFactory(store.dispatch, selectorFactoryOptions);\n } // If we aren't running in \"pure\" mode, we don't want to memoize values.\n // To avoid conditionally calling hooks, we fall back to a tiny wrapper\n // that just executes the given callback immediately.\n\n\n var usePureOnlyMemo = pure ? useMemo : function (callback) {\n return callback();\n };\n\n function ConnectFunction(props) {\n var _useMemo = useMemo(function () {\n // Distinguish between actual \"data\" props that were passed to the wrapper component,\n // and values needed to control behavior (forwarded refs, alternate context instances).\n // To maintain the wrapperProps object reference, memoize this destructuring.\n var reactReduxForwardedRef = props.reactReduxForwardedRef,\n wrapperProps = _objectWithoutPropertiesLoose(props, [\"reactReduxForwardedRef\"]);\n\n return [props.context, reactReduxForwardedRef, wrapperProps];\n }, [props]),\n propsContext = _useMemo[0],\n reactReduxForwardedRef = _useMemo[1],\n wrapperProps = _useMemo[2];\n\n var ContextToUse = useMemo(function () {\n // Users may optionally pass in a custom context instance to use instead of our ReactReduxContext.\n // Memoize the check that determines which context instance we should use.\n return propsContext && propsContext.Consumer && isContextConsumer(React.createElement(propsContext.Consumer, null)) ? propsContext : Context;\n }, [propsContext, Context]); // Retrieve the store and ancestor subscription via context, if available\n\n var contextValue = useContext(ContextToUse); // The store _must_ exist as either a prop or in context.\n // We'll check to see if it _looks_ like a Redux store first.\n // This allows us to pass through a `store` prop that is just a plain value.\n\n var didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);\n var didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);\n\n if (process.env.NODE_ENV !== 'production' && !didStoreComeFromProps && !didStoreComeFromContext) {\n throw new Error(\"Could not find \\\"store\\\" in the context of \" + (\"\\\"\" + displayName + \"\\\". Either wrap the root component in a <Provider>, \") + \"or pass a custom React context provider to <Provider> and the corresponding \" + (\"React context consumer to \" + displayName + \" in connect options.\"));\n } // Based on the previous check, one of these must be true\n\n\n var store = didStoreComeFromProps ? props.store : contextValue.store;\n var childPropsSelector = useMemo(function () {\n // The child props selector needs the store reference as an input.\n // Re-create this selector whenever the store changes.\n return createChildSelector(store);\n }, [store]);\n\n var _useMemo2 = useMemo(function () {\n if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY; // This Subscription's source should match where store came from: props vs. context. A component\n // connected to the store via props shouldn't use subscription from context, or vice versa.\n\n var subscription = new Subscription(store, didStoreComeFromProps ? null : contextValue.subscription); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in\n // the middle of the notification loop, where `subscription` will then be null. This can\n // probably be avoided if Subscription's listeners logic is changed to not call listeners\n // that have been unsubscribed in the middle of the notification loop.\n\n var notifyNestedSubs = subscription.notifyNestedSubs.bind(subscription);\n return [subscription, notifyNestedSubs];\n }, [store, didStoreComeFromProps, contextValue]),\n subscription = _useMemo2[0],\n notifyNestedSubs = _useMemo2[1]; // Determine what {store, subscription} value should be put into nested context, if necessary,\n // and memoize that value to avoid unnecessary context updates.\n\n\n var overriddenContextValue = useMemo(function () {\n if (didStoreComeFromProps) {\n // This component is directly subscribed to a store from props.\n // We don't want descendants reading from this store - pass down whatever\n // the existing context value is from the nearest connected ancestor.\n return contextValue;\n } // Otherwise, put this component's subscription instance into context, so that\n // connected descendants won't update until after this component is done\n\n\n return _extends({}, contextValue, {\n subscription: subscription\n });\n }, [didStoreComeFromProps, contextValue, subscription]); // We need to force this wrapper component to re-render whenever a Redux store update\n // causes a change to the calculated child component props (or we caught an error in mapState)\n\n var _useReducer = useReducer(storeStateUpdatesReducer, EMPTY_ARRAY, initStateUpdates),\n _useReducer$ = _useReducer[0],\n previousStateUpdateResult = _useReducer$[0],\n forceComponentUpdateDispatch = _useReducer[1]; // Propagate any mapState/mapDispatch errors upwards\n\n\n if (previousStateUpdateResult && previousStateUpdateResult.error) {\n throw previousStateUpdateResult.error;\n } // Set up refs to coordinate values between the subscription effect and the render logic\n\n\n var lastChildProps = useRef();\n var lastWrapperProps = useRef(wrapperProps);\n var childPropsFromStoreUpdate = useRef();\n var renderIsScheduled = useRef(false);\n var actualChildProps = usePureOnlyMemo(function () {\n // Tricky logic here:\n // - This render may have been triggered by a Redux store update that produced new child props\n // - However, we may have gotten new wrapper props after that\n // If we have new child props, and the same wrapper props, we know we should use the new child props as-is.\n // But, if we have new wrapper props, those might change the child props, so we have to recalculate things.\n // So, we'll use the child props from store update only if the wrapper props are the same as last time.\n if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) {\n return childPropsFromStoreUpdate.current;\n } // TODO We're reading the store directly in render() here. Bad idea?\n // This will likely cause Bad Things (TM) to happen in Concurrent Mode.\n // Note that we do this because on renders _not_ caused by store updates, we need the latest store state\n // to determine what the child props should be.\n\n\n return childPropsSelector(store.getState(), wrapperProps);\n }, [store, previousStateUpdateResult, wrapperProps]); // We need this to execute synchronously every time we re-render. However, React warns\n // about useLayoutEffect in SSR, so we try to detect environment and fall back to\n // just useEffect instead to avoid the warning, since neither will run anyway.\n\n useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, actualChildProps, childPropsFromStoreUpdate, notifyNestedSubs]); // Our re-subscribe logic only runs when the store/subscription setup changes\n\n useIsomorphicLayoutEffectWithArgs(subscribeUpdates, [shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, childPropsFromStoreUpdate, notifyNestedSubs, forceComponentUpdateDispatch], [store, subscription, childPropsSelector]); // Now that all that's done, we can finally try to actually render the child component.\n // We memoize the elements for the rendered child component as an optimization.\n\n var renderedWrappedComponent = useMemo(function () {\n return React.createElement(WrappedComponent, _extends({}, actualChildProps, {\n ref: reactReduxForwardedRef\n }));\n }, [reactReduxForwardedRef, WrappedComponent, actualChildProps]); // If React sees the exact same element reference as last time, it bails out of re-rendering\n // that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate.\n\n var renderedChild = useMemo(function () {\n if (shouldHandleStateChanges) {\n // If this component is subscribed to store updates, we need to pass its own\n // subscription instance down to our descendants. That means rendering the same\n // Context instance, and putting a different value into the context.\n return React.createElement(ContextToUse.Provider, {\n value: overriddenContextValue\n }, renderedWrappedComponent);\n }\n\n return renderedWrappedComponent;\n }, [ContextToUse, renderedWrappedComponent, overriddenContextValue]);\n return renderedChild;\n } // If we're in \"pure\" mode, ensure our wrapper component only re-renders when incoming props have changed.\n\n\n var Connect = pure ? React.memo(ConnectFunction) : ConnectFunction;\n Connect.WrappedComponent = WrappedComponent;\n Connect.displayName = displayName;\n\n if (forwardRef) {\n var forwarded = React.forwardRef(function forwardConnectRef(props, ref) {\n return React.createElement(Connect, _extends({}, props, {\n reactReduxForwardedRef: ref\n }));\n });\n forwarded.displayName = displayName;\n forwarded.WrappedComponent = WrappedComponent;\n return hoistStatics(forwarded, WrappedComponent);\n }\n\n return hoistStatics(Connect, WrappedComponent);\n };\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport connectAdvanced from '../components/connectAdvanced';\nimport shallowEqual from '../utils/shallowEqual';\nimport defaultMapDispatchToPropsFactories from './mapDispatchToProps';\nimport defaultMapStateToPropsFactories from './mapStateToProps';\nimport defaultMergePropsFactories from './mergeProps';\nimport defaultSelectorFactory from './selectorFactory';\n/*\r\n connect is a facade over connectAdvanced. It turns its args into a compatible\r\n selectorFactory, which has the signature:\r\n\r\n (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps\r\n \r\n connect passes its args to connectAdvanced as options, which will in turn pass them to\r\n selectorFactory each time a Connect component instance is instantiated or hot reloaded.\r\n\r\n selectorFactory returns a final props selector from its mapStateToProps,\r\n mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,\r\n mergePropsFactories, and pure args.\r\n\r\n The resulting final props selector is called by the Connect component instance whenever\r\n it receives new props or store state.\r\n */\n\nfunction match(arg, factories, name) {\n for (var i = factories.length - 1; i >= 0; i--) {\n var result = factories[i](arg);\n if (result) return result;\n }\n\n return function (dispatch, options) {\n throw new Error(\"Invalid value of type \" + typeof arg + \" for \" + name + \" argument when connecting component \" + options.wrappedComponentName + \".\");\n };\n}\n\nfunction strictEqual(a, b) {\n return a === b;\n} // createConnect with default args builds the 'official' connect behavior. Calling it with\n// different options opens up some testing and extensibility scenarios\n\n\nexport function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? defaultMergePropsFactories : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? defaultSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,\n extraOptions = _objectWithoutPropertiesLoose(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}\nexport default\n/*#__PURE__*/\ncreateConnect();","import { bindActionCreators } from 'redux';\nimport { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';\nexport function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {\n return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined;\n}\nexport function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {\n return !mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) {\n return {\n dispatch: dispatch\n };\n }) : undefined;\n}\nexport function whenMapDispatchToPropsIsObject(mapDispatchToProps) {\n return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? wrapMapToPropsConstant(function (dispatch) {\n return bindActionCreators(mapDispatchToProps, dispatch);\n }) : undefined;\n}\nexport default [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];","import { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';\nexport function whenMapStateToPropsIsFunction(mapStateToProps) {\n return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined;\n}\nexport function whenMapStateToPropsIsMissing(mapStateToProps) {\n return !mapStateToProps ? wrapMapToPropsConstant(function () {\n return {};\n }) : undefined;\n}\nexport default [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport verifyPlainObject from '../utils/verifyPlainObject';\nexport function defaultMergeProps(stateProps, dispatchProps, ownProps) {\n return _extends({}, ownProps, {}, stateProps, {}, dispatchProps);\n}\nexport function wrapMergePropsFunc(mergeProps) {\n return function initMergePropsProxy(dispatch, _ref) {\n var displayName = _ref.displayName,\n pure = _ref.pure,\n areMergedPropsEqual = _ref.areMergedPropsEqual;\n var hasRunOnce = false;\n var mergedProps;\n return function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n if (hasRunOnce) {\n if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;\n } else {\n hasRunOnce = true;\n mergedProps = nextMergedProps;\n if (process.env.NODE_ENV !== 'production') verifyPlainObject(mergedProps, displayName, 'mergeProps');\n }\n\n return mergedProps;\n };\n };\n}\nexport function whenMergePropsIsFunction(mergeProps) {\n return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;\n}\nexport function whenMergePropsIsOmitted(mergeProps) {\n return !mergeProps ? function () {\n return defaultMergeProps;\n } : undefined;\n}\nexport default [whenMergePropsIsFunction, whenMergePropsIsOmitted];","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport verifySubselectors from './verifySubselectors';\nexport function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {\n return function impureFinalPropsSelector(state, ownProps) {\n return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);\n };\n}\nexport function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {\n var areStatesEqual = _ref.areStatesEqual,\n areOwnPropsEqual = _ref.areOwnPropsEqual,\n areStatePropsEqual = _ref.areStatePropsEqual;\n var hasRunAtLeastOnce = false;\n var state;\n var ownProps;\n var stateProps;\n var dispatchProps;\n var mergedProps;\n\n function handleFirstCall(firstState, firstOwnProps) {\n state = firstState;\n ownProps = firstOwnProps;\n stateProps = mapStateToProps(state, ownProps);\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n hasRunAtLeastOnce = true;\n return mergedProps;\n }\n\n function handleNewPropsAndNewState() {\n stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewProps() {\n if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewState() {\n var nextStateProps = mapStateToProps(state, ownProps);\n var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n stateProps = nextStateProps;\n if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleSubsequentCalls(nextState, nextOwnProps) {\n var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n var stateChanged = !areStatesEqual(nextState, state);\n state = nextState;\n ownProps = nextOwnProps;\n if (propsChanged && stateChanged) return handleNewPropsAndNewState();\n if (propsChanged) return handleNewProps();\n if (stateChanged) return handleNewState();\n return mergedProps;\n }\n\n return function pureFinalPropsSelector(nextState, nextOwnProps) {\n return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n };\n} // TODO: Add more comments\n// If pure is true, the selector returned by selectorFactory will memoize its results,\n// allowing connectAdvanced's shouldComponentUpdate to return false if final\n// props have not changed. If false, the selector will always return a new\n// object and shouldComponentUpdate will always return true.\n\nexport default function finalPropsSelectorFactory(dispatch, _ref2) {\n var initMapStateToProps = _ref2.initMapStateToProps,\n initMapDispatchToProps = _ref2.initMapDispatchToProps,\n initMergeProps = _ref2.initMergeProps,\n options = _objectWithoutPropertiesLoose(_ref2, [\"initMapStateToProps\", \"initMapDispatchToProps\", \"initMergeProps\"]);\n\n var mapStateToProps = initMapStateToProps(dispatch, options);\n var mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n var mergeProps = initMergeProps(dispatch, options);\n\n if (process.env.NODE_ENV !== 'production') {\n verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);\n }\n\n var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;\n return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}","import warning from '../utils/warning';\n\nfunction verify(selector, methodName, displayName) {\n if (!selector) {\n throw new Error(\"Unexpected value for \" + methodName + \" in \" + displayName + \".\");\n } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {\n if (!Object.prototype.hasOwnProperty.call(selector, 'dependsOnOwnProps')) {\n warning(\"The selector for \" + methodName + \" of \" + displayName + \" did not specify a value for dependsOnOwnProps.\");\n }\n }\n}\n\nexport default function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) {\n verify(mapStateToProps, 'mapStateToProps', displayName);\n verify(mapDispatchToProps, 'mapDispatchToProps', displayName);\n verify(mergeProps, 'mergeProps', displayName);\n}","import verifyPlainObject from '../utils/verifyPlainObject';\nexport function wrapMapToPropsConstant(getConstant) {\n return function initConstantSelector(dispatch, options) {\n var constant = getConstant(dispatch, options);\n\n function constantSelector() {\n return constant;\n }\n\n constantSelector.dependsOnOwnProps = false;\n return constantSelector;\n };\n} // dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args\n// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine\n// whether mapToProps needs to be invoked when props have changed.\n//\n// A length of one signals that mapToProps does not depend on props from the parent component.\n// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and\n// therefore not reporting its length accurately..\n\nexport function getDependsOnOwnProps(mapToProps) {\n return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n} // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,\n// this function wraps mapToProps in a proxy function which does several things:\n//\n// * Detects whether the mapToProps function being called depends on props, which\n// is used by selectorFactory to decide if it should reinvoke on props changes.\n//\n// * On first call, handles mapToProps if returns another function, and treats that\n// new function as the true mapToProps for subsequent calls.\n//\n// * On first call, verifies the first result is a plain object, in order to warn\n// the developer that their mapToProps function is not returning a valid result.\n//\n\nexport function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') verifyPlainObject(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}","import { ReactReduxContext } from '../components/Context';\nimport { useStore as useDefaultStore, createStoreHook } from './useStore';\n/**\r\n * Hook factory, which creates a `useDispatch` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\r\n * @returns {Function} A `useDispatch` hook bound to the specified context.\r\n */\n\nexport function createDispatchHook(context) {\n if (context === void 0) {\n context = ReactReduxContext;\n }\n\n var useStore = context === ReactReduxContext ? useDefaultStore : createStoreHook(context);\n return function useDispatch() {\n var store = useStore();\n return store.dispatch;\n };\n}\n/**\r\n * A hook to access the redux `dispatch` function.\r\n *\r\n * @returns {any|function} redux store's `dispatch` function\r\n *\r\n * @example\r\n *\r\n * import React, { useCallback } from 'react'\r\n * import { useDispatch } from 'react-redux'\r\n *\r\n * export const CounterComponent = ({ value }) => {\r\n * const dispatch = useDispatch()\r\n * const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])\r\n * return (\r\n * <div>\r\n * <span>{value}</span>\r\n * <button onClick={increaseCounter}>Increase counter</button>\r\n * </div>\r\n * )\r\n * }\r\n */\n\nexport var useDispatch =\n/*#__PURE__*/\ncreateDispatchHook();","import { useContext } from 'react';\nimport { ReactReduxContext } from '../components/Context';\n/**\r\n * A hook to access the value of the `ReactReduxContext`. This is a low-level\r\n * hook that you should usually not need to call directly.\r\n *\r\n * @returns {any} the value of the `ReactReduxContext`\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useReduxContext } from 'react-redux'\r\n *\r\n * export const CounterComponent = ({ value }) => {\r\n * const { store } = useReduxContext()\r\n * return <div>{store.getState()}</div>\r\n * }\r\n */\n\nexport function useReduxContext() {\n var contextValue = useContext(ReactReduxContext);\n\n if (process.env.NODE_ENV !== 'production' && !contextValue) {\n throw new Error('could not find react-redux context value; please ensure the component is wrapped in a <Provider>');\n }\n\n return contextValue;\n}","import { useReducer, useRef, useMemo, useContext, useDebugValue } from 'react';\nimport { useReduxContext as useDefaultReduxContext } from './useReduxContext';\nimport Subscription from '../utils/Subscription';\nimport { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';\nimport { ReactReduxContext } from '../components/Context';\n\nvar refEquality = function refEquality(a, b) {\n return a === b;\n};\n\nfunction useSelectorWithStoreAndSubscription(selector, equalityFn, store, contextSub) {\n var _useReducer = useReducer(function (s) {\n return s + 1;\n }, 0),\n forceRender = _useReducer[1];\n\n var subscription = useMemo(function () {\n return new Subscription(store, contextSub);\n }, [store, contextSub]);\n var latestSubscriptionCallbackError = useRef();\n var latestSelector = useRef();\n var latestStoreState = useRef();\n var latestSelectedState = useRef();\n var storeState = store.getState();\n var selectedState;\n\n try {\n if (selector !== latestSelector.current || storeState !== latestStoreState.current || latestSubscriptionCallbackError.current) {\n selectedState = selector(storeState);\n } else {\n selectedState = latestSelectedState.current;\n }\n } catch (err) {\n if (latestSubscriptionCallbackError.current) {\n err.message += \"\\nThe error may be correlated with this previous error:\\n\" + latestSubscriptionCallbackError.current.stack + \"\\n\\n\";\n }\n\n throw err;\n }\n\n useIsomorphicLayoutEffect(function () {\n latestSelector.current = selector;\n latestStoreState.current = storeState;\n latestSelectedState.current = selectedState;\n latestSubscriptionCallbackError.current = undefined;\n });\n useIsomorphicLayoutEffect(function () {\n function checkForUpdates() {\n try {\n var newSelectedState = latestSelector.current(store.getState());\n\n if (equalityFn(newSelectedState, latestSelectedState.current)) {\n return;\n }\n\n latestSelectedState.current = newSelectedState;\n } catch (err) {\n // we ignore all errors here, since when the component\n // is re-rendered, the selectors are called again, and\n // will throw again, if neither props nor store state\n // changed\n latestSubscriptionCallbackError.current = err;\n }\n\n forceRender();\n }\n\n subscription.onStateChange = checkForUpdates;\n subscription.trySubscribe();\n checkForUpdates();\n return function () {\n return subscription.tryUnsubscribe();\n };\n }, [store, subscription]);\n return selectedState;\n}\n/**\r\n * Hook factory, which creates a `useSelector` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\r\n * @returns {Function} A `useSelector` hook bound to the specified context.\r\n */\n\n\nexport function createSelectorHook(context) {\n if (context === void 0) {\n context = ReactReduxContext;\n }\n\n var useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : function () {\n return useContext(context);\n };\n return function useSelector(selector, equalityFn) {\n if (equalityFn === void 0) {\n equalityFn = refEquality;\n }\n\n if (process.env.NODE_ENV !== 'production' && !selector) {\n throw new Error(\"You must pass a selector to useSelector\");\n }\n\n var _useReduxContext = useReduxContext(),\n store = _useReduxContext.store,\n contextSub = _useReduxContext.subscription;\n\n var selectedState = useSelectorWithStoreAndSubscription(selector, equalityFn, store, contextSub);\n useDebugValue(selectedState);\n return selectedState;\n };\n}\n/**\r\n * A hook to access the redux store's state. This hook takes a selector function\r\n * as an argument. The selector is called with the store state.\r\n *\r\n * This hook takes an optional equality comparison function as the second parameter\r\n * that allows you to customize the way the selected state is compared to determine\r\n * whether the component needs to be re-rendered.\r\n *\r\n * @param {Function} selector the selector function\r\n * @param {Function=} equalityFn the function that will be used to determine equality\r\n *\r\n * @returns {any} the selected state\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useSelector } from 'react-redux'\r\n *\r\n * export const CounterComponent = () => {\r\n * const counter = useSelector(state => state.counter)\r\n * return <div>{counter}</div>\r\n * }\r\n */\n\nexport var useSelector =\n/*#__PURE__*/\ncreateSelectorHook();","import { useContext } from 'react';\nimport { ReactReduxContext } from '../components/Context';\nimport { useReduxContext as useDefaultReduxContext } from './useReduxContext';\n/**\r\n * Hook factory, which creates a `useStore` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\r\n * @returns {Function} A `useStore` hook bound to the specified context.\r\n */\n\nexport function createStoreHook(context) {\n if (context === void 0) {\n context = ReactReduxContext;\n }\n\n var useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : function () {\n return useContext(context);\n };\n return function useStore() {\n var _useReduxContext = useReduxContext(),\n store = _useReduxContext.store;\n\n return store;\n };\n}\n/**\r\n * A hook to access the redux store.\r\n *\r\n * @returns {any} the redux store\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useStore } from 'react-redux'\r\n *\r\n * export const ExampleComponent = () => {\r\n * const store = useStore()\r\n * return <div>{store.getState()}</div>\r\n * }\r\n */\n\nexport var useStore =\n/*#__PURE__*/\ncreateStoreHook();","import Provider from './components/Provider';\nimport connectAdvanced from './components/connectAdvanced';\nimport { ReactReduxContext } from './components/Context';\nimport connect from './connect/connect';\nimport { useDispatch, createDispatchHook } from './hooks/useDispatch';\nimport { useSelector, createSelectorHook } from './hooks/useSelector';\nimport { useStore, createStoreHook } from './hooks/useStore';\nimport { setBatch } from './utils/batch';\nimport { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates';\nimport shallowEqual from './utils/shallowEqual';\nsetBatch(batch);\nexport { Provider, connectAdvanced, ReactReduxContext, connect, batch, useDispatch, createDispatchHook, useSelector, createSelectorHook, useStore, createStoreHook, shallowEqual };","import { getBatch } from './batch'; // encapsulates the subscription logic for connecting a component to the redux store, as\n// well as nesting subscriptions of descendant components, so that we can ensure the\n// ancestor components re-render before descendants\n\nvar nullListeners = {\n notify: function notify() {}\n};\n\nfunction createListenerCollection() {\n var batch = getBatch();\n var first = null;\n var last = null;\n return {\n clear: function clear() {\n first = null;\n last = null;\n },\n notify: function notify() {\n batch(function () {\n var listener = first;\n\n while (listener) {\n listener.callback();\n listener = listener.next;\n }\n });\n },\n get: function get() {\n var listeners = [];\n var listener = first;\n\n while (listener) {\n listeners.push(listener);\n listener = listener.next;\n }\n\n return listeners;\n },\n subscribe: function subscribe(callback) {\n var isSubscribed = true;\n var listener = last = {\n callback: callback,\n next: null,\n prev: last\n };\n\n if (listener.prev) {\n listener.prev.next = listener;\n } else {\n first = listener;\n }\n\n return function unsubscribe() {\n if (!isSubscribed || first === null) return;\n isSubscribed = false;\n\n if (listener.next) {\n listener.next.prev = listener.prev;\n } else {\n last = listener.prev;\n }\n\n if (listener.prev) {\n listener.prev.next = listener.next;\n } else {\n first = listener.next;\n }\n };\n }\n };\n}\n\nvar Subscription =\n/*#__PURE__*/\nfunction () {\n function Subscription(store, parentSub) {\n this.store = store;\n this.parentSub = parentSub;\n this.unsubscribe = null;\n this.listeners = nullListeners;\n this.handleChangeWrapper = this.handleChangeWrapper.bind(this);\n }\n\n var _proto = Subscription.prototype;\n\n _proto.addNestedSub = function addNestedSub(listener) {\n this.trySubscribe();\n return this.listeners.subscribe(listener);\n };\n\n _proto.notifyNestedSubs = function notifyNestedSubs() {\n this.listeners.notify();\n };\n\n _proto.handleChangeWrapper = function handleChangeWrapper() {\n if (this.onStateChange) {\n this.onStateChange();\n }\n };\n\n _proto.isSubscribed = function isSubscribed() {\n return Boolean(this.unsubscribe);\n };\n\n _proto.trySubscribe = function trySubscribe() {\n if (!this.unsubscribe) {\n this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.handleChangeWrapper) : this.store.subscribe(this.handleChangeWrapper);\n this.listeners = createListenerCollection();\n }\n };\n\n _proto.tryUnsubscribe = function tryUnsubscribe() {\n if (this.unsubscribe) {\n this.unsubscribe();\n this.unsubscribe = null;\n this.listeners.clear();\n this.listeners = nullListeners;\n }\n };\n\n return Subscription;\n}();\n\nexport { Subscription as default };","// Default to a dummy \"batch\" implementation that just runs the callback\nfunction defaultNoopBatch(callback) {\n callback();\n}\n\nvar batch = defaultNoopBatch; // Allow injecting another batching function later\n\nexport var setBatch = function setBatch(newBatch) {\n return batch = newBatch;\n}; // Supply a getter just to skip dealing with ESM bindings\n\nexport var getBatch = function getBatch() {\n return batch;\n};","/**\r\n * @param {any} obj The object to inspect.\r\n * @returns {boolean} True if the argument appears to be a plain object.\r\n */\nexport default function isPlainObject(obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n var proto = Object.getPrototypeOf(obj);\n if (proto === null) return true;\n var baseProto = proto;\n\n while (Object.getPrototypeOf(baseProto) !== null) {\n baseProto = Object.getPrototypeOf(baseProto);\n }\n\n return proto === baseProto;\n}","/* eslint-disable import/no-unresolved */\nexport { unstable_batchedUpdates } from 'react-dom';","function is(x, y) {\n if (x === y) {\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\n\nexport default function shallowEqual(objA, objB) {\n if (is(objA, objB)) return true;\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n if (keysA.length !== keysB.length) return false;\n\n for (var i = 0; i < keysA.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n}","import { useEffect, useLayoutEffect } from 'react'; // React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser. We need useLayoutEffect to ensure the store\n// subscription callback always has the selector from the latest render commit\n// available, otherwise a store update may happen between render and the effect,\n// which may cause missed updates; we also must ensure the store subscription\n// is created synchronously, otherwise a store update may occur before the\n// subscription is created and an inconsistent state may be observed\n\nexport var useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? useLayoutEffect : useEffect;","import isPlainObject from './isPlainObject';\nimport warning from './warning';\nexport default function verifyPlainObject(value, displayName, methodName) {\n if (!isPlainObject(value)) {\n warning(methodName + \"() in \" + displayName + \" must return a plain object. Instead received \" + value + \".\");\n }\n}","/**\r\n * Prints a warning in the console if it exists.\r\n *\r\n * @param {String} message The warning message.\r\n * @returns {void}\r\n */\nexport default function warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n\n\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n /* eslint-disable no-empty */\n } catch (e) {}\n /* eslint-enable no-empty */\n\n}","/** @license React v16.13.1\n * react.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\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar _assign = require('object-assign');\nvar checkPropTypes = require('prop-types/checkPropTypes');\n\nvar ReactVersion = '16.13.1';\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;\nvar REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;\nvar REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;\nvar REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;\nvar MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction 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/**\n * Keeps track of the current dispatcher.\n */\nvar ReactCurrentDispatcher = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\n/**\n * Keeps track of the current batch's configuration such as how long an update\n * should suspend for if it needs to.\n */\nvar ReactCurrentBatchConfig = {\n suspense: null\n};\n\n/**\n * Keeps track of the current owner.\n *\n * The current owner is the component who should own any components that are\n * currently being constructed.\n */\nvar ReactCurrentOwner = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\nvar BEFORE_SLASH_RE = /^(.*)[\\\\\\/]/;\nfunction describeComponentFrame (name, source, ownerName) {\n var sourceInfo = '';\n\n if (source) {\n var path = source.fileName;\n var fileName = path.replace(BEFORE_SLASH_RE, '');\n\n {\n // In DEV, include code for a common special case:\n // prefer \"folder/index.js\" instead of just \"index.js\".\n if (/^index\\./.test(fileName)) {\n var match = path.match(BEFORE_SLASH_RE);\n\n if (match) {\n var pathBeforeSlash = match[1];\n\n if (pathBeforeSlash) {\n var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');\n fileName = folderName + '/' + fileName;\n }\n }\n }\n }\n\n sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';\n } else if (ownerName) {\n sourceInfo = ' (created by ' + ownerName + ')';\n }\n\n return '\\n in ' + (name || 'Unknown') + sourceInfo;\n}\n\nvar Resolved = 1;\nfunction refineResolvedLazyComponent(lazyComponent) {\n return lazyComponent._status === Resolved ? lazyComponent._result : null;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var functionName = innerType.displayName || innerType.name || '';\n return outerType.displayName || (functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName);\n}\n\nfunction getComponentName(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 getComponentName(). ' + '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 return 'Context.Consumer';\n\n case REACT_PROVIDER_TYPE:\n return 'Context.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n return getComponentName(type.type);\n\n case REACT_BLOCK_TYPE:\n return getComponentName(type.render);\n\n case REACT_LAZY_TYPE:\n {\n var thenable = type;\n var resolvedThenable = refineResolvedLazyComponent(thenable);\n\n if (resolvedThenable) {\n return getComponentName(resolvedThenable);\n }\n\n break;\n }\n }\n }\n\n return null;\n}\n\nvar ReactDebugCurrentFrame = {};\nvar currentlyValidatingElement = null;\nfunction setCurrentlyValidatingElement(element) {\n {\n currentlyValidatingElement = element;\n }\n}\n\n{\n // Stack implementation injected by the current renderer.\n ReactDebugCurrentFrame.getCurrentStack = null;\n\n ReactDebugCurrentFrame.getStackAddendum = function () {\n var stack = ''; // Add an extra top frame while an element is being validated\n\n if (currentlyValidatingElement) {\n var name = getComponentName(currentlyValidatingElement.type);\n var owner = currentlyValidatingElement._owner;\n stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));\n } // Delegate to the injected renderer-specific implementation\n\n\n var impl = ReactDebugCurrentFrame.getCurrentStack;\n\n if (impl) {\n stack += impl() || '';\n }\n\n return stack;\n };\n}\n\n/**\n * Used by act() to track whether you're inside an act() scope.\n */\nvar IsSomeRendererActing = {\n current: false\n};\n\nvar ReactSharedInternals = {\n ReactCurrentDispatcher: ReactCurrentDispatcher,\n ReactCurrentBatchConfig: ReactCurrentBatchConfig,\n ReactCurrentOwner: ReactCurrentOwner,\n IsSomeRendererActing: IsSomeRendererActing,\n // Used by renderers to avoid bundling object-assign twice in UMD bundles:\n assign: _assign\n};\n\n{\n _assign(ReactSharedInternals, {\n // These should not be included in production.\n ReactDebugCurrentFrame: ReactDebugCurrentFrame,\n // Shim for React DOM 16.0.0 which still destructured (but not used) this.\n // TODO: remove in React 17.0.\n ReactComponentTreeHook: {}\n });\n}\n\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\nfunction warn(format) {\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}\nfunction error(format) {\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\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\\n in') === 0;\n\n if (!hasExistingStack) {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n }\n }\n\n var argsWithFormat = args.map(function (item) {\n return '' + 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 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 var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n throw new Error(message);\n } catch (x) {}\n }\n}\n\nvar didWarnStateUpdateForUnmountedComponent = {};\n\nfunction warnNoop(publicInstance, callerName) {\n {\n var _constructor = publicInstance.constructor;\n var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';\n var warningKey = componentName + \".\" + callerName;\n\n if (didWarnStateUpdateForUnmountedComponent[warningKey]) {\n return;\n }\n\n error(\"Can't call %s on a component that is not yet mounted. \" + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);\n\n didWarnStateUpdateForUnmountedComponent[warningKey] = true;\n }\n}\n/**\n * This is the abstract API for an update queue.\n */\n\n\nvar ReactNoopUpdateQueue = {\n /**\n * Checks whether or not this composite component is mounted.\n * @param {ReactClass} publicInstance The instance we want to test.\n * @return {boolean} True if mounted, false otherwise.\n * @protected\n * @final\n */\n isMounted: function (publicInstance) {\n return false;\n },\n\n /**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueForceUpdate: function (publicInstance, callback, callerName) {\n warnNoop(publicInstance, 'forceUpdate');\n },\n\n /**\n * Replaces all of the state. Always use this or `setState` to mutate state.\n * You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} completeState Next state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {\n warnNoop(publicInstance, 'replaceState');\n },\n\n /**\n * Sets a subset of the state. This only exists because _pendingState is\n * internal. This provides a merging strategy that is not available to deep\n * properties which is confusing. TODO: Expose pendingState or don't use it\n * during the merge.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} partialState Next partial state to be merged with state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} Name of the calling function in the public API.\n * @internal\n */\n enqueueSetState: function (publicInstance, partialState, callback, callerName) {\n warnNoop(publicInstance, 'setState');\n }\n};\n\nvar emptyObject = {};\n\n{\n Object.freeze(emptyObject);\n}\n/**\n * Base class helpers for the updating state of a component.\n */\n\n\nfunction Component(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the\n // renderer.\n\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nComponent.prototype.isReactComponent = {};\n/**\n * Sets a subset of the state. Always use this to mutate\n * state. You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * There is no guarantee that calls to `setState` will run synchronously,\n * as they may eventually be batched together. You can provide an optional\n * callback that will be executed when the call to setState is actually\n * completed.\n *\n * When a function is provided to setState, it will be called at some point in\n * the future (not synchronously). It will be called with the up to date\n * component arguments (state, props, context). These values can be different\n * from this.* because your function may be called after receiveProps but before\n * shouldComponentUpdate, and this new state, props, and context will not yet be\n * assigned to this.\n *\n * @param {object|function} partialState Next partial state or function to\n * produce next partial state to be merged with current state.\n * @param {?function} callback Called after state is updated.\n * @final\n * @protected\n */\n\nComponent.prototype.setState = function (partialState, callback) {\n if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {\n {\n throw Error( \"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\" );\n }\n }\n\n this.updater.enqueueSetState(this, partialState, callback, 'setState');\n};\n/**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {?function} callback Called after update is complete.\n * @final\n * @protected\n */\n\n\nComponent.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');\n};\n/**\n * Deprecated APIs. These APIs used to exist on classic React classes but since\n * we would like to deprecate them, we're not going to move them over to this\n * modern base class. Instead, we define a getter that warns if it's accessed.\n */\n\n\n{\n var deprecatedAPIs = {\n isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],\n replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']\n };\n\n var defineDeprecationWarning = function (methodName, info) {\n Object.defineProperty(Component.prototype, methodName, {\n get: function () {\n warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);\n\n return undefined;\n }\n });\n };\n\n for (var fnName in deprecatedAPIs) {\n if (deprecatedAPIs.hasOwnProperty(fnName)) {\n defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);\n }\n }\n}\n\nfunction ComponentDummy() {}\n\nComponentDummy.prototype = Component.prototype;\n/**\n * Convenience component with default shallow equality check for sCU.\n */\n\nfunction PureComponent(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nvar pureComponentPrototype = PureComponent.prototype = new ComponentDummy();\npureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.\n\n_assign(pureComponentPrototype, Component.prototype);\n\npureComponentPrototype.isPureReactComponent = true;\n\n// an immutable object with a single mutable value\nfunction createRef() {\n var refObject = {\n current: null\n };\n\n {\n Object.seal(refObject);\n }\n\n return refObject;\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n var warnAboutAccessingKey = function () {\n {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n var warnAboutAccessingRef = function () {\n {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {\n var componentName = getComponentName(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * Create and return a new ReactElement of the given type.\n * See https://reactjs.org/docs/react-api.html#createelement\n */\n\nfunction createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n}\n/**\n * Clone and return a new ReactElement using element as the starting point.\n * See https://reactjs.org/docs/react-api.html#cloneelement\n */\n\nfunction cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\nfunction isValidElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\n\nvar SEPARATOR = '.';\nvar SUBSEPARATOR = ':';\n/**\n * Escape and wrap key so it is safe to use as a reactid\n *\n * @param {string} key to be escaped.\n * @return {string} the escaped key.\n */\n\nfunction escape(key) {\n var escapeRegex = /[=:]/g;\n var escaperLookup = {\n '=': '=0',\n ':': '=2'\n };\n var escapedString = ('' + key).replace(escapeRegex, function (match) {\n return escaperLookup[match];\n });\n return '$' + escapedString;\n}\n/**\n * TODO: Test that a single child and an array with one item have the same key\n * pattern.\n */\n\n\nvar didWarnAboutMaps = false;\nvar userProvidedKeyEscapeRegex = /\\/+/g;\n\nfunction escapeUserProvidedKey(text) {\n return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');\n}\n\nvar POOL_SIZE = 10;\nvar traverseContextPool = [];\n\nfunction getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {\n if (traverseContextPool.length) {\n var traverseContext = traverseContextPool.pop();\n traverseContext.result = mapResult;\n traverseContext.keyPrefix = keyPrefix;\n traverseContext.func = mapFunction;\n traverseContext.context = mapContext;\n traverseContext.count = 0;\n return traverseContext;\n } else {\n return {\n result: mapResult,\n keyPrefix: keyPrefix,\n func: mapFunction,\n context: mapContext,\n count: 0\n };\n }\n}\n\nfunction releaseTraverseContext(traverseContext) {\n traverseContext.result = null;\n traverseContext.keyPrefix = null;\n traverseContext.func = null;\n traverseContext.context = null;\n traverseContext.count = 0;\n\n if (traverseContextPool.length < POOL_SIZE) {\n traverseContextPool.push(traverseContext);\n }\n}\n/**\n * @param {?*} children Children tree container.\n * @param {!string} nameSoFar Name of the key path so far.\n * @param {!function} callback Callback to invoke with each child found.\n * @param {?*} traverseContext Used to pass information throughout the traversal\n * process.\n * @return {!number} The number of children in this subtree.\n */\n\n\nfunction traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {\n var type = typeof children;\n\n if (type === 'undefined' || type === 'boolean') {\n // All of the above are perceived as null.\n children = null;\n }\n\n var invokeCallback = false;\n\n if (children === null) {\n invokeCallback = true;\n } else {\n switch (type) {\n case 'string':\n case 'number':\n invokeCallback = true;\n break;\n\n case 'object':\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = true;\n }\n\n }\n }\n\n if (invokeCallback) {\n callback(traverseContext, children, // If it's the only child, treat the name as if it was wrapped in an array\n // so that it's consistent if the number of children grows.\n nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);\n return 1;\n }\n\n var child;\n var nextName;\n var subtreeCount = 0; // Count of children found in the current subtree.\n\n var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;\n\n if (Array.isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n nextName = nextNamePrefix + getComponentKey(child, i);\n subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);\n }\n } else {\n var iteratorFn = getIteratorFn(children);\n\n if (typeof iteratorFn === 'function') {\n\n {\n // Warn about using Maps as children\n if (iteratorFn === children.entries) {\n if (!didWarnAboutMaps) {\n warn('Using Maps as children is deprecated and will be removed in ' + 'a future major release. Consider converting children to ' + 'an array of keyed ReactElements instead.');\n }\n\n didWarnAboutMaps = true;\n }\n }\n\n var iterator = iteratorFn.call(children);\n var step;\n var ii = 0;\n\n while (!(step = iterator.next()).done) {\n child = step.value;\n nextName = nextNamePrefix + getComponentKey(child, ii++);\n subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);\n }\n } else if (type === 'object') {\n var addendum = '';\n\n {\n addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();\n }\n\n var childrenString = '' + children;\n\n {\n {\n throw Error( \"Objects are not valid as a React child (found: \" + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + \").\" + addendum );\n }\n }\n }\n }\n\n return subtreeCount;\n}\n/**\n * Traverses children that are typically specified as `props.children`, but\n * might also be specified through attributes:\n *\n * - `traverseAllChildren(this.props.children, ...)`\n * - `traverseAllChildren(this.props.leftPanelChildren, ...)`\n *\n * The `traverseContext` is an optional argument that is passed through the\n * entire traversal. It can be used to store accumulations or anything else that\n * the callback might find relevant.\n *\n * @param {?*} children Children tree object.\n * @param {!function} callback To invoke upon traversing each child.\n * @param {?*} traverseContext Context for traversal.\n * @return {!number} The number of children in this subtree.\n */\n\n\nfunction traverseAllChildren(children, callback, traverseContext) {\n if (children == null) {\n return 0;\n }\n\n return traverseAllChildrenImpl(children, '', callback, traverseContext);\n}\n/**\n * Generate a key string that identifies a component within a set.\n *\n * @param {*} component A component that could contain a manual key.\n * @param {number} index Index that is used if a manual key is not provided.\n * @return {string}\n */\n\n\nfunction getComponentKey(component, index) {\n // Do some typechecking here since we call this blindly. We want to ensure\n // that we don't block potential future ES APIs.\n if (typeof component === 'object' && component !== null && component.key != null) {\n // Explicit key\n return escape(component.key);\n } // Implicit key determined by the index in the set\n\n\n return index.toString(36);\n}\n\nfunction forEachSingleChild(bookKeeping, child, name) {\n var func = bookKeeping.func,\n context = bookKeeping.context;\n func.call(context, child, bookKeeping.count++);\n}\n/**\n * Iterates through children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenforeach\n *\n * The provided forEachFunc(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} forEachFunc\n * @param {*} forEachContext Context for forEachContext.\n */\n\n\nfunction forEachChildren(children, forEachFunc, forEachContext) {\n if (children == null) {\n return children;\n }\n\n var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);\n traverseAllChildren(children, forEachSingleChild, traverseContext);\n releaseTraverseContext(traverseContext);\n}\n\nfunction mapSingleChildIntoContext(bookKeeping, child, childKey) {\n var result = bookKeeping.result,\n keyPrefix = bookKeeping.keyPrefix,\n func = bookKeeping.func,\n context = bookKeeping.context;\n var mappedChild = func.call(context, child, bookKeeping.count++);\n\n if (Array.isArray(mappedChild)) {\n mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {\n return c;\n });\n } else if (mappedChild != null) {\n if (isValidElement(mappedChild)) {\n mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as\n // traverseAllChildren used to do for objects as children\n keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);\n }\n\n result.push(mappedChild);\n }\n}\n\nfunction mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {\n var escapedPrefix = '';\n\n if (prefix != null) {\n escapedPrefix = escapeUserProvidedKey(prefix) + '/';\n }\n\n var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);\n traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);\n releaseTraverseContext(traverseContext);\n}\n/**\n * Maps children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenmap\n *\n * The provided mapFunction(child, key, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} func The map function.\n * @param {*} context Context for mapFunction.\n * @return {object} Object containing the ordered map of results.\n */\n\n\nfunction mapChildren(children, func, context) {\n if (children == null) {\n return children;\n }\n\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, func, context);\n return result;\n}\n/**\n * Count the number of children that are typically specified as\n * `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrencount\n *\n * @param {?*} children Children tree container.\n * @return {number} The number of children.\n */\n\n\nfunction countChildren(children) {\n return traverseAllChildren(children, function () {\n return null;\n }, null);\n}\n/**\n * Flatten a children object (typically specified as `props.children`) and\n * return an array with appropriately re-keyed children.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrentoarray\n */\n\n\nfunction toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n}\n/**\n * Returns the first child in a collection of children and verifies that there\n * is only one child in the collection.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenonly\n *\n * The current implementation of this function assumes that a single child gets\n * passed without a wrapper, but the purpose of this helper function is to\n * abstract away the particular structure of children.\n *\n * @param {?object} children Child collection structure.\n * @return {ReactElement} The first and only `ReactElement` contained in the\n * structure.\n */\n\n\nfunction onlyChild(children) {\n if (!isValidElement(children)) {\n {\n throw Error( \"React.Children.only expected to receive a single React element child.\" );\n }\n }\n\n return children;\n}\n\nfunction createContext(defaultValue, calculateChangedBits) {\n if (calculateChangedBits === undefined) {\n calculateChangedBits = null;\n } else {\n {\n if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') {\n error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits);\n }\n }\n }\n\n var context = {\n $$typeof: REACT_CONTEXT_TYPE,\n _calculateChangedBits: calculateChangedBits,\n // As a workaround to support multiple concurrent renderers, we categorize\n // some renderers as primary and others as secondary. We only expect\n // there to be two concurrent renderers at most: React Native (primary) and\n // Fabric (secondary); React DOM (primary) and React ART (secondary).\n // Secondary renderers store their context values on separate fields.\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n // Used to track how many concurrent renderers this context currently\n // supports within in a single renderer. Such as parallel server rendering.\n _threadCount: 0,\n // These are circular\n Provider: null,\n Consumer: null\n };\n context.Provider = {\n $$typeof: REACT_PROVIDER_TYPE,\n _context: context\n };\n var hasWarnedAboutUsingNestedContextConsumers = false;\n var hasWarnedAboutUsingConsumerProvider = false;\n\n {\n // A separate object, but proxies back to the original context object for\n // backwards compatibility. It has a different $$typeof, so we can properly\n // warn for the incorrect usage of Context as a Consumer.\n var Consumer = {\n $$typeof: REACT_CONTEXT_TYPE,\n _context: context,\n _calculateChangedBits: context._calculateChangedBits\n }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here\n\n Object.defineProperties(Consumer, {\n Provider: {\n get: function () {\n if (!hasWarnedAboutUsingConsumerProvider) {\n hasWarnedAboutUsingConsumerProvider = true;\n\n error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');\n }\n\n return context.Provider;\n },\n set: function (_Provider) {\n context.Provider = _Provider;\n }\n },\n _currentValue: {\n get: function () {\n return context._currentValue;\n },\n set: function (_currentValue) {\n context._currentValue = _currentValue;\n }\n },\n _currentValue2: {\n get: function () {\n return context._currentValue2;\n },\n set: function (_currentValue2) {\n context._currentValue2 = _currentValue2;\n }\n },\n _threadCount: {\n get: function () {\n return context._threadCount;\n },\n set: function (_threadCount) {\n context._threadCount = _threadCount;\n }\n },\n Consumer: {\n get: function () {\n if (!hasWarnedAboutUsingNestedContextConsumers) {\n hasWarnedAboutUsingNestedContextConsumers = true;\n\n error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');\n }\n\n return context.Consumer;\n }\n }\n }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty\n\n context.Consumer = Consumer;\n }\n\n {\n context._currentRenderer = null;\n context._currentRenderer2 = null;\n }\n\n return context;\n}\n\nfunction lazy(ctor) {\n var lazyType = {\n $$typeof: REACT_LAZY_TYPE,\n _ctor: ctor,\n // React uses these fields to store the result.\n _status: -1,\n _result: null\n };\n\n {\n // In production, this would just set it on the object.\n var defaultProps;\n var propTypes;\n Object.defineProperties(lazyType, {\n defaultProps: {\n configurable: true,\n get: function () {\n return defaultProps;\n },\n set: function (newDefaultProps) {\n error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n defaultProps = newDefaultProps; // Match production behavior more closely:\n\n Object.defineProperty(lazyType, 'defaultProps', {\n enumerable: true\n });\n }\n },\n propTypes: {\n configurable: true,\n get: function () {\n return propTypes;\n },\n set: function (newPropTypes) {\n error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n propTypes = newPropTypes; // Match production behavior more closely:\n\n Object.defineProperty(lazyType, 'propTypes', {\n enumerable: true\n });\n }\n }\n });\n }\n\n return lazyType;\n}\n\nfunction forwardRef(render) {\n {\n if (render != null && render.$$typeof === REACT_MEMO_TYPE) {\n error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');\n } else if (typeof render !== 'function') {\n error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);\n } else {\n if (render.length !== 0 && render.length !== 2) {\n error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');\n }\n }\n\n if (render != null) {\n if (render.defaultProps != null || render.propTypes != null) {\n error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');\n }\n }\n }\n\n return {\n $$typeof: REACT_FORWARD_REF_TYPE,\n render: render\n };\n}\n\nfunction isValidElementType(type) {\n return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.\n type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);\n}\n\nfunction memo(type, compare) {\n {\n if (!isValidElementType(type)) {\n error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);\n }\n }\n\n return {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: compare === undefined ? null : compare\n };\n}\n\nfunction resolveDispatcher() {\n var dispatcher = ReactCurrentDispatcher.current;\n\n if (!(dispatcher !== null)) {\n {\n throw 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:\\n1. You might have mismatching versions of React and the renderer (such as React DOM)\\n2. You might be breaking the Rules of Hooks\\n3. You might have more than one copy of React in the same app\\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.\" );\n }\n }\n\n return dispatcher;\n}\n\nfunction useContext(Context, unstable_observedBits) {\n var dispatcher = resolveDispatcher();\n\n {\n if (unstable_observedBits !== undefined) {\n error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\\n\\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '');\n } // TODO: add a more generic warning for invalid values.\n\n\n if (Context._context !== undefined) {\n var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs\n // and nobody should be using this in existing code.\n\n if (realContext.Consumer === Context) {\n error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');\n } else if (realContext.Provider === Context) {\n error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');\n }\n }\n }\n\n return dispatcher.useContext(Context, unstable_observedBits);\n}\nfunction useState(initialState) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useState(initialState);\n}\nfunction useReducer(reducer, initialArg, init) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useReducer(reducer, initialArg, init);\n}\nfunction useRef(initialValue) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useRef(initialValue);\n}\nfunction useEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useEffect(create, deps);\n}\nfunction useLayoutEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useLayoutEffect(create, deps);\n}\nfunction useCallback(callback, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useCallback(callback, deps);\n}\nfunction useMemo(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useMemo(create, deps);\n}\nfunction useImperativeHandle(ref, create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useImperativeHandle(ref, create, deps);\n}\nfunction useDebugValue(value, formatterFn) {\n {\n var dispatcher = resolveDispatcher();\n return dispatcher.useDebugValue(value, formatterFn);\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n\nfunction getDeclarationErrorAddendum() {\n if (ReactCurrentOwner.current) {\n var name = getComponentName(ReactCurrentOwner.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendumForProps(elementProps) {\n if (elementProps !== null && elementProps !== undefined) {\n return getSourceInfoErrorAddendum(elementProps.__source);\n }\n\n return '';\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentName(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement(element);\n\n {\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);\n }\n\n setCurrentlyValidatingElement(null);\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n if (typeof node !== 'object') {\n return;\n }\n\n if (Array.isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var name = getComponentName(type);\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n setCurrentlyValidatingElement(element);\n checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);\n setCurrentlyValidatingElement(null);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true;\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n setCurrentlyValidatingElement(fragment);\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n break;\n }\n }\n\n if (fragment.ref !== null) {\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n }\n\n setCurrentlyValidatingElement(null);\n }\n}\nfunction createElementWithValidation(type, props, children) {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\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 var sourceInfo = getSourceInfoErrorAddendumForProps(props);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (Array.isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentName(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n {\n error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n }\n\n var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], type);\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n}\nvar didWarnAboutDeprecatedCreateFactory = false;\nfunction createFactoryWithValidation(type) {\n var validatedFactory = createElementWithValidation.bind(null, type);\n validatedFactory.type = type;\n\n {\n if (!didWarnAboutDeprecatedCreateFactory) {\n didWarnAboutDeprecatedCreateFactory = true;\n\n warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');\n } // Legacy hook: remove it\n\n\n Object.defineProperty(validatedFactory, 'type', {\n enumerable: false,\n get: function () {\n warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');\n\n Object.defineProperty(this, 'type', {\n value: type\n });\n return type;\n }\n });\n }\n\n return validatedFactory;\n}\nfunction cloneElementWithValidation(element, props, children) {\n var newElement = cloneElement.apply(this, arguments);\n\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], newElement.type);\n }\n\n validatePropTypes(newElement);\n return newElement;\n}\n\n{\n\n try {\n var frozenObject = Object.freeze({});\n var testMap = new Map([[frozenObject, null]]);\n var testSet = new Set([frozenObject]); // This is necessary for Rollup to not consider these unused.\n // https://github.com/rollup/rollup/issues/1771\n // TODO: we can remove these if Rollup fixes the bug.\n\n testMap.set(0, 0);\n testSet.add(0);\n } catch (e) {\n }\n}\n\nvar createElement$1 = createElementWithValidation ;\nvar cloneElement$1 = cloneElementWithValidation ;\nvar createFactory = createFactoryWithValidation ;\nvar Children = {\n map: mapChildren,\n forEach: forEachChildren,\n count: countChildren,\n toArray: toArray,\n only: onlyChild\n};\n\nexports.Children = Children;\nexports.Component = Component;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.PureComponent = PureComponent;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;\nexports.cloneElement = cloneElement$1;\nexports.createContext = createContext;\nexports.createElement = createElement$1;\nexports.createFactory = createFactory;\nexports.createRef = createRef;\nexports.forwardRef = forwardRef;\nexports.isValidElement = isValidElement;\nexports.lazy = lazy;\nexports.memo = memo;\nexports.useCallback = useCallback;\nexports.useContext = useContext;\nexports.useDebugValue = useDebugValue;\nexports.useEffect = useEffect;\nexports.useImperativeHandle = useImperativeHandle;\nexports.useLayoutEffect = useLayoutEffect;\nexports.useMemo = useMemo;\nexports.useReducer = useReducer;\nexports.useRef = useRef;\nexports.useState = useState;\nexports.version = ReactVersion;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.min.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n","// Imports\nimport ___CSS_LOADER_API_IMPORT___ from \"../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(true);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".popup-content{margin:auto;background:#fff;width:50%;padding:5px;border:1px solid #d7d7d7}[role=tooltip].popup-content{width:200px;box-shadow:0 0 3px rgba(0,0,0,.16);border-radius:5px}.popup-overlay{background:rgba(0,0,0,.5)}[data-popup=tooltip].popup-overlay{background:transparent}.popup-arrow{-webkit-filter:drop-shadow(0 -3px 3px rgba(0,0,0,.16));filter:drop-shadow(0 -3px 3px rgba(0,0,0,.16));color:#fff;stroke-width:2px;stroke:#d7d7d7;stroke-dasharray:30px;stroke-dashoffset:-54px}\", \"\",{\"version\":3,\"sources\":[\"webpack://node_modules/reactjs-popup/dist/index.css\"],\"names\":[],\"mappings\":\"AAAA,eAAe,WAAW,CAAC,eAAe,CAAC,SAAS,CAAC,WAAW,CAAC,wBAAwB,CAAC,6BAA6B,WAAW,CAAC,kCAAkC,CAAC,iBAAiB,CAAC,eAAe,yBAAyB,CAAC,mCAAmC,sBAAsB,CAAC,aAAa,sDAAsD,CAAC,8CAA8C,CAAC,UAAU,CAAC,gBAAgB,CAAC,cAAc,CAAC,qBAAqB,CAAC,uBAAuB\",\"sourcesContent\":[\".popup-content{margin:auto;background:#fff;width:50%;padding:5px;border:1px solid #d7d7d7}[role=tooltip].popup-content{width:200px;box-shadow:0 0 3px rgba(0,0,0,.16);border-radius:5px}.popup-overlay{background:rgba(0,0,0,.5)}[data-popup=tooltip].popup-overlay{background:transparent}.popup-arrow{-webkit-filter:drop-shadow(0 -3px 3px rgba(0,0,0,.16));filter:drop-shadow(0 -3px 3px rgba(0,0,0,.16));color:#fff;stroke-width:2px;stroke:#d7d7d7;stroke-dasharray:30px;stroke-dashoffset:-54px}\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","import React, { useEffect, useLayoutEffect, forwardRef, useState, useRef, useImperativeHandle } from 'react';\nimport ReactDOM from 'react-dom';\n\nfunction _extends() {\n _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\n return _extends.apply(this, arguments);\n}\n\nvar useOnEscape = function useOnEscape(handler, active) {\n if (active === void 0) {\n active = true;\n }\n\n useEffect(function () {\n if (!active) return;\n\n var listener = function listener(event) {\n // check if key is an Escape\n if (event.key === 'Escape') handler();\n };\n\n document.addEventListener('keyup', listener);\n return function () {\n if (!active) return;\n document.removeEventListener('keyup', listener);\n };\n }, [handler, active]);\n};\nvar useRepositionOnResize = function useRepositionOnResize(handler, active) {\n if (active === void 0) {\n active = true;\n }\n\n useEffect(function () {\n if (!active) return;\n\n var listener = function listener() {\n handler();\n };\n\n window.addEventListener('resize', listener);\n return function () {\n if (!active) return;\n window.removeEventListener('resize', listener);\n };\n }, [handler, active]);\n};\nvar useOnClickOutside = function useOnClickOutside(ref, handler, active) {\n if (active === void 0) {\n active = true;\n }\n\n useEffect(function () {\n if (!active) return;\n\n var listener = function listener(event) {\n // Do nothing if clicking ref's element or descendent elements\n var refs = Array.isArray(ref) ? ref : [ref];\n var contains = false;\n refs.forEach(function (r) {\n if (!r.current || r.current.contains(event.target)) {\n contains = true;\n return;\n }\n });\n event.stopPropagation();\n if (!contains) handler();\n };\n\n document.addEventListener('mousedown', listener);\n document.addEventListener('touchstart', listener);\n return function () {\n if (!active) return;\n document.removeEventListener('mousedown', listener);\n document.removeEventListener('touchstart', listener);\n };\n }, [ref, handler, active]);\n}; // Make sure that user is not able TAB out of the Modal content on Open\n\nvar useTabbing = function useTabbing(contentRef, active) {\n if (active === void 0) {\n active = true;\n }\n\n useEffect(function () {\n if (!active) return;\n\n var listener = function listener(event) {\n // check if key is an Tab\n if (event.keyCode === 9) {\n var _contentRef$current;\n\n var els = contentRef === null || contentRef === void 0 ? void 0 : (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex=\"0\"]');\n var focusableEls = Array.prototype.slice.call(els);\n\n if (focusableEls.length === 1) {\n event.preventDefault();\n return;\n }\n\n var firstFocusableEl = focusableEls[0];\n var lastFocusableEl = focusableEls[focusableEls.length - 1];\n\n if (event.shiftKey && document.activeElement === firstFocusableEl) {\n event.preventDefault();\n lastFocusableEl.focus();\n } else if (document.activeElement === lastFocusableEl) {\n event.preventDefault();\n firstFocusableEl.focus();\n }\n }\n };\n\n document.addEventListener('keydown', listener);\n return function () {\n if (!active) return;\n document.removeEventListener('keydown', listener);\n };\n }, [contentRef, active]);\n};\nvar useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nvar Style = {\n popupContent: {\n tooltip: {\n position: 'absolute',\n zIndex: 999\n },\n modal: {\n position: 'relative',\n margin: 'auto'\n }\n },\n popupArrow: {\n height: '8px',\n width: '16px',\n position: 'absolute',\n background: 'transparent',\n color: '#FFF',\n zIndex: -1\n },\n overlay: {\n tooltip: {\n position: 'fixed',\n top: '0',\n bottom: '0',\n left: '0',\n right: '0',\n zIndex: 999\n },\n modal: {\n position: 'fixed',\n top: '0',\n bottom: '0',\n left: '0',\n right: '0',\n display: 'flex',\n zIndex: 999\n }\n }\n};\n\nvar POSITION_TYPES = ['top left', 'top center', 'top right', 'right top', 'right center', 'right bottom', 'bottom left', 'bottom center', 'bottom right', 'left top', 'left center', 'left bottom'];\n\nvar getCoordinatesForPosition = function getCoordinatesForPosition(triggerBounding, ContentBounding, position, //PopupPosition | PopupPosition[],\narrow, _ref) {\n var offsetX = _ref.offsetX,\n offsetY = _ref.offsetY;\n var margin = arrow ? 8 : 0;\n var args = position.split(' '); // the step N 1 : center the popup content => ok\n\n var CenterTop = triggerBounding.top + triggerBounding.height / 2;\n var CenterLeft = triggerBounding.left + triggerBounding.width / 2;\n var height = ContentBounding.height,\n width = ContentBounding.width;\n var top = CenterTop - height / 2;\n var left = CenterLeft - width / 2;\n var transform = '';\n var arrowTop = '0%';\n var arrowLeft = '0%'; // the step N 2 : => ok\n\n switch (args[0]) {\n case 'top':\n top -= height / 2 + triggerBounding.height / 2 + margin;\n transform = \"rotate(180deg) translateX(50%)\";\n arrowTop = '100%';\n arrowLeft = '50%';\n break;\n\n case 'bottom':\n top += height / 2 + triggerBounding.height / 2 + margin;\n transform = \"rotate(0deg) translateY(-100%) translateX(-50%)\";\n arrowLeft = '50%';\n break;\n\n case 'left':\n left -= width / 2 + triggerBounding.width / 2 + margin;\n transform = \" rotate(90deg) translateY(50%) translateX(-25%)\";\n arrowLeft = '100%';\n arrowTop = '50%';\n break;\n\n case 'right':\n left += width / 2 + triggerBounding.width / 2 + margin;\n transform = \"rotate(-90deg) translateY(-150%) translateX(25%)\";\n arrowTop = '50%';\n break;\n }\n\n switch (args[1]) {\n case 'top':\n top = triggerBounding.top;\n arrowTop = triggerBounding.height / 2 + \"px\";\n break;\n\n case 'bottom':\n top = triggerBounding.top - height + triggerBounding.height;\n arrowTop = height - triggerBounding.height / 2 + \"px\";\n break;\n\n case 'left':\n left = triggerBounding.left;\n arrowLeft = triggerBounding.width / 2 + \"px\";\n break;\n\n case 'right':\n left = triggerBounding.left - width + triggerBounding.width;\n arrowLeft = width - triggerBounding.width / 2 + \"px\";\n break;\n }\n\n top = args[0] === 'top' ? top - offsetY : top + offsetY;\n left = args[0] === 'left' ? left - offsetX : left + offsetX;\n return {\n top: top,\n left: left,\n transform: transform,\n arrowLeft: arrowLeft,\n arrowTop: arrowTop\n };\n};\n\nvar getTooltipBoundary = function getTooltipBoundary(keepTooltipInside) {\n // add viewport\n var boundingBox = {\n top: 0,\n left: 0,\n\n /* eslint-disable-next-line no-undef */\n width: window.innerWidth,\n\n /* eslint-disable-next-line no-undef */\n height: window.innerHeight\n };\n\n if (typeof keepTooltipInside === 'string') {\n /* eslint-disable-next-line no-undef */\n var selector = document.querySelector(keepTooltipInside);\n\n if (process.env.NODE_ENV !== 'production') {\n if (selector === null) throw new Error(keepTooltipInside + \" selector does not exist : keepTooltipInside must be a valid html selector 'class' or 'Id' or a boolean value\");\n }\n\n if (selector !== null) boundingBox = selector.getBoundingClientRect();\n }\n\n return boundingBox;\n};\n\nvar calculatePosition = function calculatePosition(triggerBounding, ContentBounding, position, arrow, _ref2, keepTooltipInside) {\n var offsetX = _ref2.offsetX,\n offsetY = _ref2.offsetY;\n var bestCoords = {\n arrowLeft: '0%',\n arrowTop: '0%',\n left: 0,\n top: 0,\n transform: 'rotate(135deg)'\n };\n var i = 0;\n var wrapperBox = getTooltipBoundary(keepTooltipInside);\n var positions = Array.isArray(position) ? position : [position]; // keepTooltipInside would be activated if the keepTooltipInside exist or the position is Array\n\n if (keepTooltipInside || Array.isArray(position)) positions = [].concat(positions, POSITION_TYPES); // add viewPort for WarpperBox\n // wrapperBox.top = wrapperBox.top + window.scrollY;\n // wrapperBox.left = wrapperBox.left + window.scrollX;\n\n while (i < positions.length) {\n bestCoords = getCoordinatesForPosition(triggerBounding, ContentBounding, positions[i], arrow, {\n offsetX: offsetX,\n offsetY: offsetY\n });\n var contentBox = {\n top: bestCoords.top,\n left: bestCoords.left,\n width: ContentBounding.width,\n height: ContentBounding.height\n };\n\n if (contentBox.top <= wrapperBox.top || contentBox.left <= wrapperBox.left || contentBox.top + contentBox.height >= wrapperBox.top + wrapperBox.height || contentBox.left + contentBox.width >= wrapperBox.left + wrapperBox.width) {\n i++;\n } else {\n break;\n }\n }\n\n return bestCoords;\n};\n\nvar popupIdCounter = 0;\n\nvar getRootPopup = function getRootPopup() {\n var PopupRoot = document.getElementById('popup-root');\n\n if (PopupRoot === null) {\n PopupRoot = document.createElement('div');\n PopupRoot.setAttribute('id', 'popup-root');\n document.body.appendChild(PopupRoot);\n }\n\n return PopupRoot;\n};\n\nvar Popup = /*#__PURE__*/forwardRef(function (_ref, ref) {\n var _ref$trigger = _ref.trigger,\n trigger = _ref$trigger === void 0 ? null : _ref$trigger,\n _ref$onOpen = _ref.onOpen,\n onOpen = _ref$onOpen === void 0 ? function () {} : _ref$onOpen,\n _ref$onClose = _ref.onClose,\n onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,\n _ref$defaultOpen = _ref.defaultOpen,\n defaultOpen = _ref$defaultOpen === void 0 ? false : _ref$defaultOpen,\n _ref$open = _ref.open,\n open = _ref$open === void 0 ? undefined : _ref$open,\n _ref$disabled = _ref.disabled,\n disabled = _ref$disabled === void 0 ? false : _ref$disabled,\n _ref$nested = _ref.nested,\n nested = _ref$nested === void 0 ? false : _ref$nested,\n _ref$closeOnDocumentC = _ref.closeOnDocumentClick,\n closeOnDocumentClick = _ref$closeOnDocumentC === void 0 ? true : _ref$closeOnDocumentC,\n _ref$repositionOnResi = _ref.repositionOnResize,\n repositionOnResize = _ref$repositionOnResi === void 0 ? true : _ref$repositionOnResi,\n _ref$closeOnEscape = _ref.closeOnEscape,\n closeOnEscape = _ref$closeOnEscape === void 0 ? true : _ref$closeOnEscape,\n _ref$on = _ref.on,\n on = _ref$on === void 0 ? ['click'] : _ref$on,\n _ref$contentStyle = _ref.contentStyle,\n contentStyle = _ref$contentStyle === void 0 ? {} : _ref$contentStyle,\n _ref$arrowStyle = _ref.arrowStyle,\n arrowStyle = _ref$arrowStyle === void 0 ? {} : _ref$arrowStyle,\n _ref$overlayStyle = _ref.overlayStyle,\n overlayStyle = _ref$overlayStyle === void 0 ? {} : _ref$overlayStyle,\n _ref$className = _ref.className,\n className = _ref$className === void 0 ? '' : _ref$className,\n _ref$position = _ref.position,\n position = _ref$position === void 0 ? 'bottom center' : _ref$position,\n _ref$modal = _ref.modal,\n modal = _ref$modal === void 0 ? false : _ref$modal,\n _ref$lockScroll = _ref.lockScroll,\n lockScroll = _ref$lockScroll === void 0 ? false : _ref$lockScroll,\n _ref$arrow = _ref.arrow,\n arrow = _ref$arrow === void 0 ? true : _ref$arrow,\n _ref$offsetX = _ref.offsetX,\n offsetX = _ref$offsetX === void 0 ? 0 : _ref$offsetX,\n _ref$offsetY = _ref.offsetY,\n offsetY = _ref$offsetY === void 0 ? 0 : _ref$offsetY,\n _ref$mouseEnterDelay = _ref.mouseEnterDelay,\n mouseEnterDelay = _ref$mouseEnterDelay === void 0 ? 100 : _ref$mouseEnterDelay,\n _ref$mouseLeaveDelay = _ref.mouseLeaveDelay,\n mouseLeaveDelay = _ref$mouseLeaveDelay === void 0 ? 100 : _ref$mouseLeaveDelay,\n _ref$keepTooltipInsid = _ref.keepTooltipInside,\n keepTooltipInside = _ref$keepTooltipInsid === void 0 ? false : _ref$keepTooltipInsid,\n children = _ref.children;\n\n var _useState = useState(open || defaultOpen),\n isOpen = _useState[0],\n setIsOpen = _useState[1];\n\n var triggerRef = useRef(null);\n var contentRef = useRef(null);\n var arrowRef = useRef(null);\n var focusedElBeforeOpen = useRef(null);\n var popupId = useRef(\"popup-\" + ++popupIdCounter);\n var isModal = modal ? true : !trigger;\n var timeOut = useRef(0);\n useIsomorphicLayoutEffect(function () {\n if (isOpen) {\n focusedElBeforeOpen.current = document.activeElement;\n setPosition();\n focusContentOnOpen(); // for accessibility\n\n lockScrolll();\n } else {\n resetScroll();\n }\n\n return function () {\n clearTimeout(timeOut.current);\n };\n }, [isOpen]); // for uncontrolled popup we need to sync isOpen with open prop\n\n useEffect(function () {\n if (typeof open === 'boolean') {\n if (open) openPopup();else closePopup();\n }\n }, [open, disabled]);\n\n var openPopup = function openPopup() {\n if (isOpen || disabled) return;\n setIsOpen(true);\n setTimeout(onOpen, 0);\n };\n\n var closePopup = function closePopup() {\n if (!isOpen || disabled) return;\n setIsOpen(false);\n if (isModal) focusedElBeforeOpen.current.focus();\n setTimeout(onClose, 0);\n };\n\n var togglePopup = function togglePopup(event) {\n event === null || event === void 0 ? void 0 : event.stopPropagation();\n if (!isOpen) openPopup();else closePopup();\n };\n\n var onMouseEnter = function onMouseEnter() {\n clearTimeout(timeOut.current);\n timeOut.current = setTimeout(openPopup, mouseEnterDelay);\n };\n\n var onContextMenu = function onContextMenu(event) {\n event === null || event === void 0 ? void 0 : event.preventDefault();\n togglePopup();\n };\n\n var onMouseLeave = function onMouseLeave() {\n clearTimeout(timeOut.current);\n timeOut.current = setTimeout(closePopup, mouseLeaveDelay);\n };\n\n var lockScrolll = function lockScrolll() {\n if (isModal && lockScroll) document.getElementsByTagName('body')[0].style.overflow = 'hidden'; // migrate to document.body\n };\n\n var resetScroll = function resetScroll() {\n if (isModal && lockScroll) document.getElementsByTagName('body')[0].style.overflow = 'auto';\n };\n\n var focusContentOnOpen = function focusContentOnOpen() {\n var _contentRef$current;\n\n var focusableEls = contentRef === null || contentRef === void 0 ? void 0 : (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex=\"0\"]');\n var firstEl = Array.prototype.slice.call(focusableEls)[0];\n firstEl === null || firstEl === void 0 ? void 0 : firstEl.focus();\n };\n\n useImperativeHandle(ref, function () {\n return {\n open: function open() {\n openPopup();\n },\n close: function close() {\n closePopup();\n },\n toggle: function toggle() {\n togglePopup();\n }\n };\n }); // set Position\n\n var setPosition = function setPosition() {\n if (isModal || !isOpen) return;\n if (!(triggerRef === null || triggerRef === void 0 ? void 0 : triggerRef.current) || !(triggerRef === null || triggerRef === void 0 ? void 0 : triggerRef.current) || !(contentRef === null || contentRef === void 0 ? void 0 : contentRef.current)) return; /// show error as one of ref is undefined\n\n var trigger = triggerRef.current.getBoundingClientRect();\n var content = contentRef.current.getBoundingClientRect();\n var cords = calculatePosition(trigger, content, position, arrow, {\n offsetX: offsetX,\n offsetY: offsetY\n }, keepTooltipInside);\n contentRef.current.style.top = cords.top + window.scrollY + \"px\";\n contentRef.current.style.left = cords.left + window.scrollX + \"px\";\n\n if (arrow && !!arrowRef.current) {\n var _arrowStyle$top, _arrowStyle$left;\n\n arrowRef.current.style.transform = cords.transform;\n arrowRef.current.style.setProperty('-ms-transform', cords.transform);\n arrowRef.current.style.setProperty('-webkit-transform', cords.transform);\n arrowRef.current.style.top = ((_arrowStyle$top = arrowStyle.top) === null || _arrowStyle$top === void 0 ? void 0 : _arrowStyle$top.toString()) || cords.arrowTop;\n arrowRef.current.style.left = ((_arrowStyle$left = arrowStyle.left) === null || _arrowStyle$left === void 0 ? void 0 : _arrowStyle$left.toString()) || cords.arrowLeft;\n }\n }; // hooks\n\n\n useOnEscape(closePopup, closeOnEscape); // can be optimized if we disabled for hover\n\n useTabbing(contentRef, isOpen && isModal);\n useRepositionOnResize(setPosition, repositionOnResize);\n useOnClickOutside(!!trigger ? [contentRef, triggerRef] : [contentRef], closePopup, closeOnDocumentClick && !nested); // we need to add a ne\n // render the trigger element and add events\n\n var renderTrigger = function renderTrigger() {\n var triggerProps = {\n key: 'T',\n ref: triggerRef,\n 'aria-describedby': popupId.current\n };\n var onAsArray = Array.isArray(on) ? on : [on];\n\n for (var i = 0, len = onAsArray.length; i < len; i++) {\n switch (onAsArray[i]) {\n case 'click':\n triggerProps.onClick = togglePopup;\n break;\n\n case 'right-click':\n triggerProps.onContextMenu = onContextMenu;\n break;\n\n case 'hover':\n triggerProps.onMouseEnter = onMouseEnter;\n triggerProps.onMouseLeave = onMouseLeave;\n break;\n\n case 'focus':\n triggerProps.onFocus = onMouseEnter;\n triggerProps.onBlur = onMouseLeave;\n break;\n }\n }\n\n if (typeof trigger === 'function') {\n var comp = trigger(isOpen);\n return !!trigger && React.cloneElement(comp, triggerProps);\n }\n\n return !!trigger && React.cloneElement(trigger, triggerProps);\n };\n\n var addWarperAction = function addWarperAction() {\n var popupContentStyle = isModal ? Style.popupContent.modal : Style.popupContent.tooltip;\n var childrenElementProps = {\n className: \"popup-content \" + (className !== '' ? className.split(' ').map(function (c) {\n return c + \"-content\";\n }).join(' ') : ''),\n style: _extends({}, popupContentStyle, contentStyle, {\n pointerEvents: 'auto'\n }),\n ref: contentRef,\n onClick: function onClick(e) {\n e.stopPropagation();\n }\n };\n\n if (!modal && on.indexOf('hover') >= 0) {\n childrenElementProps.onMouseEnter = onMouseEnter;\n childrenElementProps.onMouseLeave = onMouseLeave;\n }\n\n return childrenElementProps;\n };\n\n var renderContent = function renderContent() {\n return React.createElement(\"div\", Object.assign({}, addWarperAction(), {\n key: \"C\",\n role: isModal ? 'dialog' : 'tooltip',\n id: popupId.current\n }), arrow && !isModal && React.createElement(\"div\", {\n ref: arrowRef,\n style: Style.popupArrow\n }, React.createElement(\"svg\", {\n \"data-testid\": \"arrow\",\n className: \"popup-arrow \" + (className !== '' ? className.split(' ').map(function (c) {\n return c + \"-arrow\";\n }).join(' ') : ''),\n viewBox: \"0 0 32 16\",\n style: _extends({\n position: 'absolute'\n }, arrowStyle)\n }, React.createElement(\"path\", {\n d: \"M16 0l16 16H0z\",\n fill: \"currentcolor\"\n }))), children && typeof children === 'function' ? children(closePopup, isOpen) : children);\n };\n\n var overlay = !(on.indexOf('hover') >= 0);\n var ovStyle = isModal ? Style.overlay.modal : Style.overlay.tooltip;\n var content = [overlay && React.createElement(\"div\", {\n key: \"O\",\n \"data-testid\": \"overlay\",\n \"data-popup\": isModal ? 'modal' : 'tooltip',\n className: \"popup-overlay \" + (className !== '' ? className.split(' ').map(function (c) {\n return c + \"-overlay\";\n }).join(' ') : ''),\n style: _extends({}, ovStyle, overlayStyle, {\n pointerEvents: closeOnDocumentClick && nested || isModal ? 'auto' : 'none'\n }),\n onClick: closeOnDocumentClick && nested ? closePopup : undefined,\n tabIndex: -1\n }, isModal && renderContent()), !isModal && renderContent()];\n return React.createElement(React.Fragment, null, renderTrigger(), isOpen && ReactDOM.createPortal(content, getRootPopup()));\n});\n\nexport default Popup;\nexport { Popup };\n//# sourceMappingURL=reactjs-popup.esm.js.map\n","module.exports = require('./lib/_stream_duplex.js');\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\n/*<replacement>*/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n keys.push(key);\n }return keys;\n};\n/*</replacement>*/\n\nmodule.exports = Duplex;\n\n/*<replacement>*/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/*</replacement>*/\n\nvar Readable = require('./_stream_readable');\nvar Writable = require('./_stream_writable');\n\nutil.inherits(Duplex, Readable);\n\n{\n // avoid scope creep, the keys array can then be collected\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n\n Readable.call(this, options);\n Writable.call(this, options);\n\n if (options && options.readable === false) this.readable = false;\n\n if (options && options.writable === false) this.writable = false;\n\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n this.once('end', onend);\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we're ok.\n if (this.allowHalfOpen || this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n pna.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n this.push(null);\n this.end();\n\n pna.nextTick(cb, err);\n};","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict';\n\nmodule.exports = PassThrough;\n\nvar Transform = require('./_stream_transform');\n\n/*<replacement>*/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/*</replacement>*/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\nmodule.exports = Readable;\n\n/*<replacement>*/\nvar isArray = require('isarray');\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nReadable.ReadableState = ReadableState;\n\n/*<replacement>*/\nvar EE = require('events').EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n return emitter.listeners(type).length;\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = require('./internal/streams/stream');\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = require('safe-buffer').Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\n/*<replacement>*/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/*</replacement>*/\n\n/*<replacement>*/\nvar debugUtil = require('util');\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function () {};\n}\n/*</replacement>*/\n\nvar BufferList = require('./internal/streams/BufferList');\nvar destroyImpl = require('./internal/streams/destroy');\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n var hwm = options.highWaterMark;\n var readableHwm = options.readableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n if (!(this instanceof Readable)) return new Readable(options);\n\n this._readableState = new ReadableState(options, this);\n\n // legacy\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\n\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n this.push(null);\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n stream.emit('error', er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n stream.emit('error', new Error('stream.push() after EOF'));\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n }\n\n return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n return er;\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n\n // emit 'readable' now to make sure it gets picked up.\n emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n pna.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;else len = state.length;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\n\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n // If the user pushes more data while we're writing to dest then we'll end up\n // in ondata again. However, we only want to increase awaitDrain once because\n // dest will only emit one 'drain' event for the multiple writes.\n // => Introduce a guard on increasing awaitDrain.\n var increasedAwaitDrain = false;\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n increasedAwaitDrain = false;\n var ret = dest.write(chunk);\n if (false === ret && !increasedAwaitDrain) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', src._readableState.awaitDrain);\n src._readableState.awaitDrain++;\n increasedAwaitDrain = true;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function () {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = { hasUnpiped: false };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, unpipeInfo);\n }return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n dest.emit('unpipe', this, unpipeInfo);\n\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n if (ev === 'data') {\n // Start flowing on next tick if stream isn't explicitly paused\n if (this._readableState.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n var state = this._readableState;\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.emittedReadable = false;\n if (!state.reading) {\n pna.nextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this);\n }\n }\n }\n\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n pna.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n state.awaitDrain = 0;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function (method) {\n return function () {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._readableState.highWaterMark;\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = fromListPartial(n, state.buffer, state.decoder);\n }\n\n return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n var ret;\n if (n < list.head.data.length) {\n // slice is the same for buffers and strings\n ret = list.head.data.slice(0, n);\n list.head.data = list.head.data.slice(n);\n } else if (n === list.head.data.length) {\n // first chunk is a perfect match\n ret = list.shift();\n } else {\n // result spans more than one buffer\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n }\n return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n\n // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n pna.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n'use strict';\n\nmodule.exports = Transform;\n\nvar Duplex = require('./_stream_duplex');\n\n/*<replacement>*/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/*</replacement>*/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n\n var cb = ts.writecb;\n\n if (!cb) {\n return this.emit('error', new Error('write callback called multiple times'));\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n\n cb(er);\n\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n\n Duplex.call(this, options);\n\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function') {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n var _this2 = this;\n\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n _this2.emit('close');\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n\n if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n\n return stream.push(null);\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\nmodule.exports = Writable;\n\n/* <replacement> */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* </replacement> */\n\n/*<replacement>*/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nWritable.WritableState = WritableState;\n\n/*<replacement>*/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/*</replacement>*/\n\n/*<replacement>*/\nvar internalUtil = {\n deprecate: require('util-deprecate')\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = require('./internal/streams/stream');\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = require('safe-buffer').Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\nvar destroyImpl = require('./internal/streams/destroy');\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n var hwm = options.highWaterMark;\n var writableHwm = options.writableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function () {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function (object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function (object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n return new Writable(options);\n }\n\n this._writableState = new WritableState(options, this);\n\n // legacy.\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n\n if (typeof options.writev === 'function') this._writev = options.writev;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n\n if (typeof options.final === 'function') this._final = options.final;\n }\n\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end');\n // TODO: defer error events consistently everywhere, not just the cb\n stream.emit('error', er);\n pna.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n pna.nextTick(cb, er);\n valid = false;\n }\n return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n if (typeof cb !== 'function') cb = nop;\n\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n\n return ret;\n};\n\nWritable.prototype.cork = function () {\n var state = this._writableState;\n\n state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n\n if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n pna.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n pna.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n\n onwriteStateUpdate(state);\n\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n /*<replacement>*/\n asyncWrite(afterWrite, stream, state, finished, cb);\n /*</replacement>*/\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending && !state.finished) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n stream.emit('error', err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function') {\n state.pendingcb++;\n state.finalCalled = true;\n pna.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n }\n }\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n if (state.corkedRequestsFree) {\n state.corkedRequestsFree.next = corkReq;\n } else {\n state.corkedRequestsFree = corkReq;\n }\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n get: function () {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\n\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n this.end();\n cb(err);\n};","'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Buffer = require('safe-buffer').Buffer;\nvar util = require('util');\n\nfunction copyBuffer(src, target, offset) {\n src.copy(target, offset);\n}\n\nmodule.exports = function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n BufferList.prototype.push = function push(v) {\n var entry = { data: v, next: null };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n };\n\n BufferList.prototype.unshift = function unshift(v) {\n var entry = { data: v, next: this.head };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n };\n\n BufferList.prototype.shift = function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n };\n\n BufferList.prototype.clear = function clear() {\n this.head = this.tail = null;\n this.length = 0;\n };\n\n BufferList.prototype.join = function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) {\n ret += s + p.data;\n }return ret;\n };\n\n BufferList.prototype.concat = function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n if (this.length === 1) return this.head.data;\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n };\n\n return BufferList;\n}();\n\nif (util && util.inspect && util.inspect.custom) {\n module.exports.prototype[util.inspect.custom] = function () {\n var obj = util.inspect({ length: this.length });\n return this.constructor.name + ' ' + obj;\n };\n}","'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\n pna.nextTick(emitErrorNT, this, err);\n }\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n pna.nextTick(emitErrorNT, _this, err);\n if (_this._writableState) {\n _this._writableState.errorEmitted = true;\n }\n } else if (cb) {\n cb(err);\n }\n });\n\n return this;\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy\n};","module.exports = require('events').EventEmitter;\n","module.exports = require('./readable').PassThrough\n","exports = module.exports = require('./lib/_stream_readable.js');\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = require('./lib/_stream_writable.js');\nexports.Duplex = require('./lib/_stream_duplex.js');\nexports.Transform = require('./lib/_stream_transform.js');\nexports.PassThrough = require('./lib/_stream_passthrough.js');\n","module.exports = require('./readable').Transform\n","module.exports = require('./lib/_stream_writable.js');\n","function createThunkMiddleware(extraArgument) {\n return function (_ref) {\n var dispatch = _ref.dispatch,\n getState = _ref.getState;\n return function (next) {\n return function (action) {\n if (typeof action === 'function') {\n return action(dispatch, getState, extraArgument);\n }\n\n return next(action);\n };\n };\n };\n}\n\nvar thunk = createThunkMiddleware();\nthunk.withExtraArgument = createThunkMiddleware;\n\nexport default thunk;","import $$observable from 'symbol-observable';\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar randomString = function randomString() {\n return Math.random().toString(36).substring(7).split('').join('.');\n};\n\nvar ActionTypes = {\n INIT: \"@@redux/INIT\" + randomString(),\n REPLACE: \"@@redux/REPLACE\" + randomString(),\n PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {\n return \"@@redux/PROBE_UNKNOWN_ACTION\" + randomString();\n }\n};\n\n/**\n * @param {any} obj The object to inspect.\n * @returns {boolean} True if the argument appears to be a plain object.\n */\nfunction isPlainObject(obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n var proto = obj;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(obj) === proto;\n}\n\n/**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {\n throw new Error('It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function.');\n }\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error('Expected the enhancer to be a function.');\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error('Expected the reducer to be a function.');\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n /**\n * This makes a shallow copy of currentListeners so we can use\n * nextListeners as a temporary list while dispatching.\n *\n * This prevents any bugs around consumers calling\n * subscribe/unsubscribe in the middle of a dispatch.\n */\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n\n\n function getState() {\n if (isDispatching) {\n throw new Error('You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n\n return currentState;\n }\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n\n\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Expected the listener to be a function.');\n }\n\n if (isDispatching) {\n throw new Error('You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api-reference/store#subscribelistener for more details.');\n }\n\n var isSubscribed = true;\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n if (isDispatching) {\n throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribelistener for more details.');\n }\n\n isSubscribed = false;\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n currentListeners = null;\n };\n }\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n\n\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error('Actions may not have an undefined \"type\" property. ' + 'Have you misspelled a constant?');\n }\n\n if (isDispatching) {\n throw new Error('Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n\n\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error('Expected the nextReducer to be a function.');\n }\n\n currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.\n // Any reducers that existed in both the new and old rootReducer\n // will receive the previous state. This effectively populates\n // the new state tree with any relevant data from the old one.\n\n dispatch({\n type: ActionTypes.REPLACE\n });\n }\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n\n\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n throw new TypeError('Expected the observer to be an object.');\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe: unsubscribe\n };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n } // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n\n\n dispatch({\n type: ActionTypes.INIT\n });\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n\n\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n\n}\n\nfunction getUndefinedStateErrorMessage(key, action) {\n var actionType = action && action.type;\n var actionDescription = actionType && \"action \\\"\" + String(actionType) + \"\\\"\" || 'an action';\n return \"Given \" + actionDescription + \", reducer \\\"\" + key + \"\\\" returned undefined. \" + \"To ignore an action, you must explicitly return the previous state. \" + \"If you want this reducer to hold no value, you can return null instead of undefined.\";\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return \"The \" + argumentName + \" has unexpected type of \\\"\" + {}.toString.call(inputState).match(/\\s([a-z|A-Z]+)/)[1] + \"\\\". Expected argument to be an object with the following \" + (\"keys: \\\"\" + reducerKeys.join('\", \"') + \"\\\"\");\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === ActionTypes.REPLACE) return;\n\n if (unexpectedKeys.length > 0) {\n return \"Unexpected \" + (unexpectedKeys.length > 1 ? 'keys' : 'key') + \" \" + (\"\\\"\" + unexpectedKeys.join('\", \"') + \"\\\" found in \" + argumentName + \". \") + \"Expected to find one of the known reducer keys instead: \" + (\"\\\"\" + reducerKeys.join('\", \"') + \"\\\". Unexpected keys will be ignored.\");\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, {\n type: ActionTypes.INIT\n });\n\n if (typeof initialState === 'undefined') {\n throw new Error(\"Reducer \\\"\" + key + \"\\\" returned undefined during initialization. \" + \"If the state passed to the reducer is undefined, you must \" + \"explicitly return the initial state. The initial state may \" + \"not be undefined. If you don't want to set a value for this reducer, \" + \"you can use null instead of undefined.\");\n }\n\n if (typeof reducer(undefined, {\n type: ActionTypes.PROBE_UNKNOWN_ACTION()\n }) === 'undefined') {\n throw new Error(\"Reducer \\\"\" + key + \"\\\" returned undefined when probed with a random type. \" + (\"Don't try to handle \" + ActionTypes.INIT + \" or other actions in \\\"redux/*\\\" \") + \"namespace. They are considered private. Instead, you must return the \" + \"current state for any unknown actions, unless it is undefined, \" + \"in which case you must return the initial state, regardless of the \" + \"action type. The initial state may not be undefined, but can be null.\");\n }\n });\n}\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\n\n\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning(\"No reducer provided for key \\\"\" + key + \"\\\"\");\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n\n var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same\n // keys multiple times.\n\n var unexpectedKeyCache;\n\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError;\n\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination(state, action) {\n if (state === void 0) {\n state = {};\n }\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n\n if (typeof nextStateForKey === 'undefined') {\n var errorMessage = getUndefinedStateErrorMessage(_key, action);\n throw new Error(errorMessage);\n }\n\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(this, arguments));\n };\n}\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass an action creator as the first argument,\n * and get a dispatch wrapped function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\n\n\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error(\"bindActionCreators expected an object or a function, instead received \" + (actionCreators === null ? 'null' : typeof actionCreators) + \". \" + \"Did you write \\\"import ActionCreators from\\\" instead of \\\"import * as ActionCreators from\\\"?\");\n }\n\n var boundActionCreators = {};\n\n for (var key in actionCreators) {\n var actionCreator = actionCreators[key];\n\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n\n return boundActionCreators;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n keys.push.apply(keys, Object.getOwnPropertySymbols(object));\n }\n\n if (enumerableOnly) keys = keys.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\nfunction compose() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(void 0, arguments));\n };\n });\n}\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\n\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function () {\n var store = createStore.apply(void 0, arguments);\n\n var _dispatch = function dispatch() {\n throw new Error('Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');\n };\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch() {\n return _dispatch.apply(void 0, arguments);\n }\n };\n var chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(void 0, chain)(store.dispatch);\n return _objectSpread2({}, store, {\n dispatch: _dispatch\n });\n };\n };\n}\n\n/*\n * This is a dummy function to check if the function name has been altered by minification.\n * If the function has been minified and NODE_ENV !== 'production', warn the user.\n */\n\nfunction isCrushed() {}\n\nif (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {\n warning('You are currently using minified code outside of NODE_ENV === \"production\". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');\n}\n\nexport { ActionTypes as __DO_NOT_USE__ActionTypes, applyMiddleware, bindActionCreators, combineReducers, compose, createStore };\n","/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","/** @license React v0.19.1\n * scheduler-tracing.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\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs.\n\nvar interactionIDCounter = 0;\nvar threadIDCounter = 0; // Set of currently traced interactions.\n// Interactions \"stack\"–\n// Meaning that newly traced interactions are appended to the previously active set.\n// When an interaction goes out of scope, the previous set (if any) is restored.\n\nexports.__interactionsRef = null; // Listener(s) to notify when interactions begin and end.\n\nexports.__subscriberRef = null;\n\n{\n exports.__interactionsRef = {\n current: new Set()\n };\n exports.__subscriberRef = {\n current: null\n };\n}\nfunction unstable_clear(callback) {\n\n var prevInteractions = exports.__interactionsRef.current;\n exports.__interactionsRef.current = new Set();\n\n try {\n return callback();\n } finally {\n exports.__interactionsRef.current = prevInteractions;\n }\n}\nfunction unstable_getCurrent() {\n {\n return exports.__interactionsRef.current;\n }\n}\nfunction unstable_getThreadID() {\n return ++threadIDCounter;\n}\nfunction unstable_trace(name, timestamp, callback) {\n var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID;\n\n var interaction = {\n __count: 1,\n id: interactionIDCounter++,\n name: name,\n timestamp: timestamp\n };\n var prevInteractions = exports.__interactionsRef.current; // Traced interactions should stack/accumulate.\n // To do that, clone the current interactions.\n // The previous set will be restored upon completion.\n\n var interactions = new Set(prevInteractions);\n interactions.add(interaction);\n exports.__interactionsRef.current = interactions;\n var subscriber = exports.__subscriberRef.current;\n var returnValue;\n\n try {\n if (subscriber !== null) {\n subscriber.onInteractionTraced(interaction);\n }\n } finally {\n try {\n if (subscriber !== null) {\n subscriber.onWorkStarted(interactions, threadID);\n }\n } finally {\n try {\n returnValue = callback();\n } finally {\n exports.__interactionsRef.current = prevInteractions;\n\n try {\n if (subscriber !== null) {\n subscriber.onWorkStopped(interactions, threadID);\n }\n } finally {\n interaction.__count--; // If no async work was scheduled for this interaction,\n // Notify subscribers that it's completed.\n\n if (subscriber !== null && interaction.__count === 0) {\n subscriber.onInteractionScheduledWorkCompleted(interaction);\n }\n }\n }\n }\n }\n\n return returnValue;\n}\nfunction unstable_wrap(callback) {\n var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID;\n\n var wrappedInteractions = exports.__interactionsRef.current;\n var subscriber = exports.__subscriberRef.current;\n\n if (subscriber !== null) {\n subscriber.onWorkScheduled(wrappedInteractions, threadID);\n } // Update the pending async work count for the current interactions.\n // Update after calling subscribers in case of error.\n\n\n wrappedInteractions.forEach(function (interaction) {\n interaction.__count++;\n });\n var hasRun = false;\n\n function wrapped() {\n var prevInteractions = exports.__interactionsRef.current;\n exports.__interactionsRef.current = wrappedInteractions;\n subscriber = exports.__subscriberRef.current;\n\n try {\n var returnValue;\n\n try {\n if (subscriber !== null) {\n subscriber.onWorkStarted(wrappedInteractions, threadID);\n }\n } finally {\n try {\n returnValue = callback.apply(undefined, arguments);\n } finally {\n exports.__interactionsRef.current = prevInteractions;\n\n if (subscriber !== null) {\n subscriber.onWorkStopped(wrappedInteractions, threadID);\n }\n }\n }\n\n return returnValue;\n } finally {\n if (!hasRun) {\n // We only expect a wrapped function to be executed once,\n // But in the event that it's executed more than once–\n // Only decrement the outstanding interaction counts once.\n hasRun = true; // Update pending async counts for all wrapped interactions.\n // If this was the last scheduled async work for any of them,\n // Mark them as completed.\n\n wrappedInteractions.forEach(function (interaction) {\n interaction.__count--;\n\n if (subscriber !== null && interaction.__count === 0) {\n subscriber.onInteractionScheduledWorkCompleted(interaction);\n }\n });\n }\n }\n }\n\n wrapped.cancel = function cancel() {\n subscriber = exports.__subscriberRef.current;\n\n try {\n if (subscriber !== null) {\n subscriber.onWorkCanceled(wrappedInteractions, threadID);\n }\n } finally {\n // Update pending async counts for all wrapped interactions.\n // If this was the last scheduled async work for any of them,\n // Mark them as completed.\n wrappedInteractions.forEach(function (interaction) {\n interaction.__count--;\n\n if (subscriber && interaction.__count === 0) {\n subscriber.onInteractionScheduledWorkCompleted(interaction);\n }\n });\n }\n };\n\n return wrapped;\n}\n\nvar subscribers = null;\n\n{\n subscribers = new Set();\n}\n\nfunction unstable_subscribe(subscriber) {\n {\n subscribers.add(subscriber);\n\n if (subscribers.size === 1) {\n exports.__subscriberRef.current = {\n onInteractionScheduledWorkCompleted: onInteractionScheduledWorkCompleted,\n onInteractionTraced: onInteractionTraced,\n onWorkCanceled: onWorkCanceled,\n onWorkScheduled: onWorkScheduled,\n onWorkStarted: onWorkStarted,\n onWorkStopped: onWorkStopped\n };\n }\n }\n}\nfunction unstable_unsubscribe(subscriber) {\n {\n subscribers.delete(subscriber);\n\n if (subscribers.size === 0) {\n exports.__subscriberRef.current = null;\n }\n }\n}\n\nfunction onInteractionTraced(interaction) {\n var didCatchError = false;\n var caughtError = null;\n subscribers.forEach(function (subscriber) {\n try {\n subscriber.onInteractionTraced(interaction);\n } catch (error) {\n if (!didCatchError) {\n didCatchError = true;\n caughtError = error;\n }\n }\n });\n\n if (didCatchError) {\n throw caughtError;\n }\n}\n\nfunction onInteractionScheduledWorkCompleted(interaction) {\n var didCatchError = false;\n var caughtError = null;\n subscribers.forEach(function (subscriber) {\n try {\n subscriber.onInteractionScheduledWorkCompleted(interaction);\n } catch (error) {\n if (!didCatchError) {\n didCatchError = true;\n caughtError = error;\n }\n }\n });\n\n if (didCatchError) {\n throw caughtError;\n }\n}\n\nfunction onWorkScheduled(interactions, threadID) {\n var didCatchError = false;\n var caughtError = null;\n subscribers.forEach(function (subscriber) {\n try {\n subscriber.onWorkScheduled(interactions, threadID);\n } catch (error) {\n if (!didCatchError) {\n didCatchError = true;\n caughtError = error;\n }\n }\n });\n\n if (didCatchError) {\n throw caughtError;\n }\n}\n\nfunction onWorkStarted(interactions, threadID) {\n var didCatchError = false;\n var caughtError = null;\n subscribers.forEach(function (subscriber) {\n try {\n subscriber.onWorkStarted(interactions, threadID);\n } catch (error) {\n if (!didCatchError) {\n didCatchError = true;\n caughtError = error;\n }\n }\n });\n\n if (didCatchError) {\n throw caughtError;\n }\n}\n\nfunction onWorkStopped(interactions, threadID) {\n var didCatchError = false;\n var caughtError = null;\n subscribers.forEach(function (subscriber) {\n try {\n subscriber.onWorkStopped(interactions, threadID);\n } catch (error) {\n if (!didCatchError) {\n didCatchError = true;\n caughtError = error;\n }\n }\n });\n\n if (didCatchError) {\n throw caughtError;\n }\n}\n\nfunction onWorkCanceled(interactions, threadID) {\n var didCatchError = false;\n var caughtError = null;\n subscribers.forEach(function (subscriber) {\n try {\n subscriber.onWorkCanceled(interactions, threadID);\n } catch (error) {\n if (!didCatchError) {\n didCatchError = true;\n caughtError = error;\n }\n }\n });\n\n if (didCatchError) {\n throw caughtError;\n }\n}\n\nexports.unstable_clear = unstable_clear;\nexports.unstable_getCurrent = unstable_getCurrent;\nexports.unstable_getThreadID = unstable_getThreadID;\nexports.unstable_subscribe = unstable_subscribe;\nexports.unstable_trace = unstable_trace;\nexports.unstable_unsubscribe = unstable_unsubscribe;\nexports.unstable_wrap = unstable_wrap;\n })();\n}\n","/** @license React v0.19.1\n * scheduler.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\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar enableSchedulerDebugging = false;\nvar enableProfiling = true;\n\nvar requestHostCallback;\nvar requestHostTimeout;\nvar cancelHostTimeout;\nvar shouldYieldToHost;\nvar requestPaint;\n\nif ( // If Scheduler runs in a non-DOM environment, it falls back to a naive\n// implementation using setTimeout.\ntypeof window === 'undefined' || // Check if MessageChannel is supported, too.\ntypeof MessageChannel !== 'function') {\n // If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore,\n // fallback to a naive implementation.\n var _callback = null;\n var _timeoutID = null;\n\n var _flushCallback = function () {\n if (_callback !== null) {\n try {\n var currentTime = exports.unstable_now();\n var hasRemainingTime = true;\n\n _callback(hasRemainingTime, currentTime);\n\n _callback = null;\n } catch (e) {\n setTimeout(_flushCallback, 0);\n throw e;\n }\n }\n };\n\n var initialTime = Date.now();\n\n exports.unstable_now = function () {\n return Date.now() - initialTime;\n };\n\n requestHostCallback = function (cb) {\n if (_callback !== null) {\n // Protect against re-entrancy.\n setTimeout(requestHostCallback, 0, cb);\n } else {\n _callback = cb;\n setTimeout(_flushCallback, 0);\n }\n };\n\n requestHostTimeout = function (cb, ms) {\n _timeoutID = setTimeout(cb, ms);\n };\n\n cancelHostTimeout = function () {\n clearTimeout(_timeoutID);\n };\n\n shouldYieldToHost = function () {\n return false;\n };\n\n requestPaint = exports.unstable_forceFrameRate = function () {};\n} else {\n // Capture local references to native APIs, in case a polyfill overrides them.\n var performance = window.performance;\n var _Date = window.Date;\n var _setTimeout = window.setTimeout;\n var _clearTimeout = window.clearTimeout;\n\n if (typeof console !== 'undefined') {\n // TODO: Scheduler no longer requires these methods to be polyfilled. But\n // maybe we want to continue warning if they don't exist, to preserve the\n // option to rely on it in the future?\n var requestAnimationFrame = window.requestAnimationFrame;\n var cancelAnimationFrame = window.cancelAnimationFrame; // TODO: Remove fb.me link\n\n if (typeof requestAnimationFrame !== 'function') {\n // Using console['error'] to evade Babel and ESLint\n console['error'](\"This browser doesn't support requestAnimationFrame. \" + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');\n }\n\n if (typeof cancelAnimationFrame !== 'function') {\n // Using console['error'] to evade Babel and ESLint\n console['error'](\"This browser doesn't support cancelAnimationFrame. \" + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');\n }\n }\n\n if (typeof performance === 'object' && typeof performance.now === 'function') {\n exports.unstable_now = function () {\n return performance.now();\n };\n } else {\n var _initialTime = _Date.now();\n\n exports.unstable_now = function () {\n return _Date.now() - _initialTime;\n };\n }\n\n var isMessageLoopRunning = false;\n var scheduledHostCallback = null;\n var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main\n // thread, like user events. By default, it yields multiple times per frame.\n // It does not attempt to align with frame boundaries, since most tasks don't\n // need to be frame aligned; for those that do, use requestAnimationFrame.\n\n var yieldInterval = 5;\n var deadline = 0; // TODO: Make this configurable\n\n {\n // `isInputPending` is not available. Since we have no way of knowing if\n // there's pending input, always yield at the end of the frame.\n shouldYieldToHost = function () {\n return exports.unstable_now() >= deadline;\n }; // Since we yield every frame regardless, `requestPaint` has no effect.\n\n\n requestPaint = function () {};\n }\n\n exports.unstable_forceFrameRate = function (fps) {\n if (fps < 0 || fps > 125) {\n // Using console['error'] to evade Babel and ESLint\n console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing framerates higher than 125 fps is not unsupported');\n return;\n }\n\n if (fps > 0) {\n yieldInterval = Math.floor(1000 / fps);\n } else {\n // reset the framerate\n yieldInterval = 5;\n }\n };\n\n var performWorkUntilDeadline = function () {\n if (scheduledHostCallback !== null) {\n var currentTime = exports.unstable_now(); // Yield after `yieldInterval` ms, regardless of where we are in the vsync\n // cycle. This means there's always time remaining at the beginning of\n // the message event.\n\n deadline = currentTime + yieldInterval;\n var hasTimeRemaining = true;\n\n try {\n var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);\n\n if (!hasMoreWork) {\n isMessageLoopRunning = false;\n scheduledHostCallback = null;\n } else {\n // If there's more work, schedule the next message event at the end\n // of the preceding one.\n port.postMessage(null);\n }\n } catch (error) {\n // If a scheduler task throws, exit the current browser task so the\n // error can be observed.\n port.postMessage(null);\n throw error;\n }\n } else {\n isMessageLoopRunning = false;\n } // Yielding to the browser will give it a chance to paint, so we can\n };\n\n var channel = new MessageChannel();\n var port = channel.port2;\n channel.port1.onmessage = performWorkUntilDeadline;\n\n requestHostCallback = function (callback) {\n scheduledHostCallback = callback;\n\n if (!isMessageLoopRunning) {\n isMessageLoopRunning = true;\n port.postMessage(null);\n }\n };\n\n requestHostTimeout = function (callback, ms) {\n taskTimeoutID = _setTimeout(function () {\n callback(exports.unstable_now());\n }, ms);\n };\n\n cancelHostTimeout = function () {\n _clearTimeout(taskTimeoutID);\n\n taskTimeoutID = -1;\n };\n}\n\nfunction push(heap, node) {\n var index = heap.length;\n heap.push(node);\n siftUp(heap, node, index);\n}\nfunction peek(heap) {\n var first = heap[0];\n return first === undefined ? null : first;\n}\nfunction pop(heap) {\n var first = heap[0];\n\n if (first !== undefined) {\n var last = heap.pop();\n\n if (last !== first) {\n heap[0] = last;\n siftDown(heap, last, 0);\n }\n\n return first;\n } else {\n return null;\n }\n}\n\nfunction siftUp(heap, node, i) {\n var index = i;\n\n while (true) {\n var parentIndex = index - 1 >>> 1;\n var parent = heap[parentIndex];\n\n if (parent !== undefined && compare(parent, node) > 0) {\n // The parent is larger. Swap positions.\n heap[parentIndex] = node;\n heap[index] = parent;\n index = parentIndex;\n } else {\n // The parent is smaller. Exit.\n return;\n }\n }\n}\n\nfunction siftDown(heap, node, i) {\n var index = i;\n var length = heap.length;\n\n while (index < length) {\n var leftIndex = (index + 1) * 2 - 1;\n var left = heap[leftIndex];\n var rightIndex = leftIndex + 1;\n var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.\n\n if (left !== undefined && compare(left, node) < 0) {\n if (right !== undefined && compare(right, left) < 0) {\n heap[index] = right;\n heap[rightIndex] = node;\n index = rightIndex;\n } else {\n heap[index] = left;\n heap[leftIndex] = node;\n index = leftIndex;\n }\n } else if (right !== undefined && compare(right, node) < 0) {\n heap[index] = right;\n heap[rightIndex] = node;\n index = rightIndex;\n } else {\n // Neither child is smaller. Exit.\n return;\n }\n }\n}\n\nfunction compare(a, b) {\n // Compare sort index first, then task id.\n var diff = a.sortIndex - b.sortIndex;\n return diff !== 0 ? diff : a.id - b.id;\n}\n\n// TODO: Use symbols?\nvar NoPriority = 0;\nvar ImmediatePriority = 1;\nvar UserBlockingPriority = 2;\nvar NormalPriority = 3;\nvar LowPriority = 4;\nvar IdlePriority = 5;\n\nvar runIdCounter = 0;\nvar mainThreadIdCounter = 0;\nvar profilingStateSize = 4;\nvar sharedProfilingBuffer = // $FlowFixMe Flow doesn't know about SharedArrayBuffer\ntypeof SharedArrayBuffer === 'function' ? new SharedArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : // $FlowFixMe Flow doesn't know about ArrayBuffer\ntypeof ArrayBuffer === 'function' ? new ArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : null // Don't crash the init path on IE9\n;\nvar profilingState = sharedProfilingBuffer !== null ? new Int32Array(sharedProfilingBuffer) : []; // We can't read this but it helps save bytes for null checks\n\nvar PRIORITY = 0;\nvar CURRENT_TASK_ID = 1;\nvar CURRENT_RUN_ID = 2;\nvar QUEUE_SIZE = 3;\n\n{\n profilingState[PRIORITY] = NoPriority; // This is maintained with a counter, because the size of the priority queue\n // array might include canceled tasks.\n\n profilingState[QUEUE_SIZE] = 0;\n profilingState[CURRENT_TASK_ID] = 0;\n} // Bytes per element is 4\n\n\nvar INITIAL_EVENT_LOG_SIZE = 131072;\nvar MAX_EVENT_LOG_SIZE = 524288; // Equivalent to 2 megabytes\n\nvar eventLogSize = 0;\nvar eventLogBuffer = null;\nvar eventLog = null;\nvar eventLogIndex = 0;\nvar TaskStartEvent = 1;\nvar TaskCompleteEvent = 2;\nvar TaskErrorEvent = 3;\nvar TaskCancelEvent = 4;\nvar TaskRunEvent = 5;\nvar TaskYieldEvent = 6;\nvar SchedulerSuspendEvent = 7;\nvar SchedulerResumeEvent = 8;\n\nfunction logEvent(entries) {\n if (eventLog !== null) {\n var offset = eventLogIndex;\n eventLogIndex += entries.length;\n\n if (eventLogIndex + 1 > eventLogSize) {\n eventLogSize *= 2;\n\n if (eventLogSize > MAX_EVENT_LOG_SIZE) {\n // Using console['error'] to evade Babel and ESLint\n console['error'](\"Scheduler Profiling: Event log exceeded maximum size. Don't \" + 'forget to call `stopLoggingProfilingEvents()`.');\n stopLoggingProfilingEvents();\n return;\n }\n\n var newEventLog = new Int32Array(eventLogSize * 4);\n newEventLog.set(eventLog);\n eventLogBuffer = newEventLog.buffer;\n eventLog = newEventLog;\n }\n\n eventLog.set(entries, offset);\n }\n}\n\nfunction startLoggingProfilingEvents() {\n eventLogSize = INITIAL_EVENT_LOG_SIZE;\n eventLogBuffer = new ArrayBuffer(eventLogSize * 4);\n eventLog = new Int32Array(eventLogBuffer);\n eventLogIndex = 0;\n}\nfunction stopLoggingProfilingEvents() {\n var buffer = eventLogBuffer;\n eventLogSize = 0;\n eventLogBuffer = null;\n eventLog = null;\n eventLogIndex = 0;\n return buffer;\n}\nfunction markTaskStart(task, ms) {\n {\n profilingState[QUEUE_SIZE]++;\n\n if (eventLog !== null) {\n // performance.now returns a float, representing milliseconds. When the\n // event is logged, it's coerced to an int. Convert to microseconds to\n // maintain extra degrees of precision.\n logEvent([TaskStartEvent, ms * 1000, task.id, task.priorityLevel]);\n }\n }\n}\nfunction markTaskCompleted(task, ms) {\n {\n profilingState[PRIORITY] = NoPriority;\n profilingState[CURRENT_TASK_ID] = 0;\n profilingState[QUEUE_SIZE]--;\n\n if (eventLog !== null) {\n logEvent([TaskCompleteEvent, ms * 1000, task.id]);\n }\n }\n}\nfunction markTaskCanceled(task, ms) {\n {\n profilingState[QUEUE_SIZE]--;\n\n if (eventLog !== null) {\n logEvent([TaskCancelEvent, ms * 1000, task.id]);\n }\n }\n}\nfunction markTaskErrored(task, ms) {\n {\n profilingState[PRIORITY] = NoPriority;\n profilingState[CURRENT_TASK_ID] = 0;\n profilingState[QUEUE_SIZE]--;\n\n if (eventLog !== null) {\n logEvent([TaskErrorEvent, ms * 1000, task.id]);\n }\n }\n}\nfunction markTaskRun(task, ms) {\n {\n runIdCounter++;\n profilingState[PRIORITY] = task.priorityLevel;\n profilingState[CURRENT_TASK_ID] = task.id;\n profilingState[CURRENT_RUN_ID] = runIdCounter;\n\n if (eventLog !== null) {\n logEvent([TaskRunEvent, ms * 1000, task.id, runIdCounter]);\n }\n }\n}\nfunction markTaskYield(task, ms) {\n {\n profilingState[PRIORITY] = NoPriority;\n profilingState[CURRENT_TASK_ID] = 0;\n profilingState[CURRENT_RUN_ID] = 0;\n\n if (eventLog !== null) {\n logEvent([TaskYieldEvent, ms * 1000, task.id, runIdCounter]);\n }\n }\n}\nfunction markSchedulerSuspended(ms) {\n {\n mainThreadIdCounter++;\n\n if (eventLog !== null) {\n logEvent([SchedulerSuspendEvent, ms * 1000, mainThreadIdCounter]);\n }\n }\n}\nfunction markSchedulerUnsuspended(ms) {\n {\n if (eventLog !== null) {\n logEvent([SchedulerResumeEvent, ms * 1000, mainThreadIdCounter]);\n }\n }\n}\n\n/* eslint-disable no-var */\n// Math.pow(2, 30) - 1\n// 0b111111111111111111111111111111\n\nvar maxSigned31BitInt = 1073741823; // Times out immediately\n\nvar IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out\n\nvar USER_BLOCKING_PRIORITY = 250;\nvar NORMAL_PRIORITY_TIMEOUT = 5000;\nvar LOW_PRIORITY_TIMEOUT = 10000; // Never times out\n\nvar IDLE_PRIORITY = maxSigned31BitInt; // Tasks are stored on a min heap\n\nvar taskQueue = [];\nvar timerQueue = []; // Incrementing id counter. Used to maintain insertion order.\n\nvar taskIdCounter = 1; // Pausing the scheduler is useful for debugging.\nvar currentTask = null;\nvar currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrancy.\n\nvar isPerformingWork = false;\nvar isHostCallbackScheduled = false;\nvar isHostTimeoutScheduled = false;\n\nfunction advanceTimers(currentTime) {\n // Check for tasks that are no longer delayed and add them to the queue.\n var timer = peek(timerQueue);\n\n while (timer !== null) {\n if (timer.callback === null) {\n // Timer was cancelled.\n pop(timerQueue);\n } else if (timer.startTime <= currentTime) {\n // Timer fired. Transfer to the task queue.\n pop(timerQueue);\n timer.sortIndex = timer.expirationTime;\n push(taskQueue, timer);\n\n {\n markTaskStart(timer, currentTime);\n timer.isQueued = true;\n }\n } else {\n // Remaining timers are pending.\n return;\n }\n\n timer = peek(timerQueue);\n }\n}\n\nfunction handleTimeout(currentTime) {\n isHostTimeoutScheduled = false;\n advanceTimers(currentTime);\n\n if (!isHostCallbackScheduled) {\n if (peek(taskQueue) !== null) {\n isHostCallbackScheduled = true;\n requestHostCallback(flushWork);\n } else {\n var firstTimer = peek(timerQueue);\n\n if (firstTimer !== null) {\n requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);\n }\n }\n }\n}\n\nfunction flushWork(hasTimeRemaining, initialTime) {\n {\n markSchedulerUnsuspended(initialTime);\n } // We'll need a host callback the next time work is scheduled.\n\n\n isHostCallbackScheduled = false;\n\n if (isHostTimeoutScheduled) {\n // We scheduled a timeout but it's no longer needed. Cancel it.\n isHostTimeoutScheduled = false;\n cancelHostTimeout();\n }\n\n isPerformingWork = true;\n var previousPriorityLevel = currentPriorityLevel;\n\n try {\n if (enableProfiling) {\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } catch (error) {\n if (currentTask !== null) {\n var currentTime = exports.unstable_now();\n markTaskErrored(currentTask, currentTime);\n currentTask.isQueued = false;\n }\n\n throw error;\n }\n } else {\n // No catch in prod codepath.\n return workLoop(hasTimeRemaining, initialTime);\n }\n } finally {\n currentTask = null;\n currentPriorityLevel = previousPriorityLevel;\n isPerformingWork = false;\n\n {\n var _currentTime = exports.unstable_now();\n\n markSchedulerSuspended(_currentTime);\n }\n }\n}\n\nfunction workLoop(hasTimeRemaining, initialTime) {\n var currentTime = initialTime;\n advanceTimers(currentTime);\n currentTask = peek(taskQueue);\n\n while (currentTask !== null && !(enableSchedulerDebugging )) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n // This currentTask hasn't expired, and we've reached the deadline.\n break;\n }\n\n var callback = currentTask.callback;\n\n if (callback !== null) {\n currentTask.callback = null;\n currentPriorityLevel = currentTask.priorityLevel;\n var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n markTaskRun(currentTask, currentTime);\n var continuationCallback = callback(didUserCallbackTimeout);\n currentTime = exports.unstable_now();\n\n if (typeof continuationCallback === 'function') {\n currentTask.callback = continuationCallback;\n markTaskYield(currentTask, currentTime);\n } else {\n {\n markTaskCompleted(currentTask, currentTime);\n currentTask.isQueued = false;\n }\n\n if (currentTask === peek(taskQueue)) {\n pop(taskQueue);\n }\n }\n\n advanceTimers(currentTime);\n } else {\n pop(taskQueue);\n }\n\n currentTask = peek(taskQueue);\n } // Return whether there's additional work\n\n\n if (currentTask !== null) {\n return true;\n } else {\n var firstTimer = peek(timerQueue);\n\n if (firstTimer !== null) {\n requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);\n }\n\n return false;\n }\n}\n\nfunction unstable_runWithPriority(priorityLevel, eventHandler) {\n switch (priorityLevel) {\n case ImmediatePriority:\n case UserBlockingPriority:\n case NormalPriority:\n case LowPriority:\n case IdlePriority:\n break;\n\n default:\n priorityLevel = NormalPriority;\n }\n\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n}\n\nfunction unstable_next(eventHandler) {\n var priorityLevel;\n\n switch (currentPriorityLevel) {\n case ImmediatePriority:\n case UserBlockingPriority:\n case NormalPriority:\n // Shift down to normal priority\n priorityLevel = NormalPriority;\n break;\n\n default:\n // Anything lower than normal priority should remain at the current level.\n priorityLevel = currentPriorityLevel;\n break;\n }\n\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n}\n\nfunction unstable_wrapCallback(callback) {\n var parentPriorityLevel = currentPriorityLevel;\n return function () {\n // This is a fork of runWithPriority, inlined for performance.\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = parentPriorityLevel;\n\n try {\n return callback.apply(this, arguments);\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n };\n}\n\nfunction timeoutForPriorityLevel(priorityLevel) {\n switch (priorityLevel) {\n case ImmediatePriority:\n return IMMEDIATE_PRIORITY_TIMEOUT;\n\n case UserBlockingPriority:\n return USER_BLOCKING_PRIORITY;\n\n case IdlePriority:\n return IDLE_PRIORITY;\n\n case LowPriority:\n return LOW_PRIORITY_TIMEOUT;\n\n case NormalPriority:\n default:\n return NORMAL_PRIORITY_TIMEOUT;\n }\n}\n\nfunction unstable_scheduleCallback(priorityLevel, callback, options) {\n var currentTime = exports.unstable_now();\n var startTime;\n var timeout;\n\n if (typeof options === 'object' && options !== null) {\n var delay = options.delay;\n\n if (typeof delay === 'number' && delay > 0) {\n startTime = currentTime + delay;\n } else {\n startTime = currentTime;\n }\n\n timeout = typeof options.timeout === 'number' ? options.timeout : timeoutForPriorityLevel(priorityLevel);\n } else {\n timeout = timeoutForPriorityLevel(priorityLevel);\n startTime = currentTime;\n }\n\n var expirationTime = startTime + timeout;\n var newTask = {\n id: taskIdCounter++,\n callback: callback,\n priorityLevel: priorityLevel,\n startTime: startTime,\n expirationTime: expirationTime,\n sortIndex: -1\n };\n\n {\n newTask.isQueued = false;\n }\n\n if (startTime > currentTime) {\n // This is a delayed task.\n newTask.sortIndex = startTime;\n push(timerQueue, newTask);\n\n if (peek(taskQueue) === null && newTask === peek(timerQueue)) {\n // All tasks are delayed, and this is the task with the earliest delay.\n if (isHostTimeoutScheduled) {\n // Cancel an existing timeout.\n cancelHostTimeout();\n } else {\n isHostTimeoutScheduled = true;\n } // Schedule a timeout.\n\n\n requestHostTimeout(handleTimeout, startTime - currentTime);\n }\n } else {\n newTask.sortIndex = expirationTime;\n push(taskQueue, newTask);\n\n {\n markTaskStart(newTask, currentTime);\n newTask.isQueued = true;\n } // Schedule a host callback, if needed. If we're already performing work,\n // wait until the next time we yield.\n\n\n if (!isHostCallbackScheduled && !isPerformingWork) {\n isHostCallbackScheduled = true;\n requestHostCallback(flushWork);\n }\n }\n\n return newTask;\n}\n\nfunction unstable_pauseExecution() {\n}\n\nfunction unstable_continueExecution() {\n\n if (!isHostCallbackScheduled && !isPerformingWork) {\n isHostCallbackScheduled = true;\n requestHostCallback(flushWork);\n }\n}\n\nfunction unstable_getFirstCallbackNode() {\n return peek(taskQueue);\n}\n\nfunction unstable_cancelCallback(task) {\n {\n if (task.isQueued) {\n var currentTime = exports.unstable_now();\n markTaskCanceled(task, currentTime);\n task.isQueued = false;\n }\n } // Null out the callback to indicate the task has been canceled. (Can't\n // remove from the queue because you can't remove arbitrary nodes from an\n // array based heap, only the first one.)\n\n\n task.callback = null;\n}\n\nfunction unstable_getCurrentPriorityLevel() {\n return currentPriorityLevel;\n}\n\nfunction unstable_shouldYield() {\n var currentTime = exports.unstable_now();\n advanceTimers(currentTime);\n var firstTask = peek(taskQueue);\n return firstTask !== currentTask && currentTask !== null && firstTask !== null && firstTask.callback !== null && firstTask.startTime <= currentTime && firstTask.expirationTime < currentTask.expirationTime || shouldYieldToHost();\n}\n\nvar unstable_requestPaint = requestPaint;\nvar unstable_Profiling = {\n startLoggingProfilingEvents: startLoggingProfilingEvents,\n stopLoggingProfilingEvents: stopLoggingProfilingEvents,\n sharedProfilingBuffer: sharedProfilingBuffer\n} ;\n\nexports.unstable_IdlePriority = IdlePriority;\nexports.unstable_ImmediatePriority = ImmediatePriority;\nexports.unstable_LowPriority = LowPriority;\nexports.unstable_NormalPriority = NormalPriority;\nexports.unstable_Profiling = unstable_Profiling;\nexports.unstable_UserBlockingPriority = UserBlockingPriority;\nexports.unstable_cancelCallback = unstable_cancelCallback;\nexports.unstable_continueExecution = unstable_continueExecution;\nexports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;\nexports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;\nexports.unstable_next = unstable_next;\nexports.unstable_pauseExecution = unstable_pauseExecution;\nexports.unstable_requestPaint = unstable_requestPaint;\nexports.unstable_runWithPriority = unstable_runWithPriority;\nexports.unstable_scheduleCallback = unstable_scheduleCallback;\nexports.unstable_shouldYield = unstable_shouldYield;\nexports.unstable_wrapCallback = unstable_wrapCallback;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler-tracing.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler-tracing.development.js');\n}\n","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var script = doc.createElement(\"script\");\n script.onreadystatechange = function () {\n runIfPresent(handle);\n script.onreadystatechange = null;\n html.removeChild(script);\n script = null;\n };\n html.appendChild(script);\n };\n }\n\n function installSetTimeoutImplementation() {\n registerImmediate = function(handle) {\n setTimeout(runIfPresent, 0, handle);\n };\n }\n\n // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.\n var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);\n attachTo = attachTo && attachTo.setTimeout ? attachTo : global;\n\n // Don't get fooled by e.g. browserify environments.\n if ({}.toString.call(global.process) === \"[object process]\") {\n // For Node.js before 0.9\n installNextTickImplementation();\n\n } else if (canUsePostMessage()) {\n // For non-IE10 modern browsers\n installPostMessageImplementation();\n\n } else if (global.MessageChannel) {\n // For web workers, where supported\n installMessageChannelImplementation();\n\n } else if (doc && \"onreadystatechange\" in doc.createElement(\"script\")) {\n // For IE 6–8\n installReadyStateChangeImplementation();\n\n } else {\n // For older browsers\n installSetTimeoutImplementation();\n }\n\n attachTo.setImmediate = setImmediate;\n attachTo.clearImmediate = clearImmediate;\n}(typeof self === \"undefined\" ? typeof global === \"undefined\" ? this : global : self));\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nmodule.exports = Stream;\n\nvar EE = require('events').EventEmitter;\nvar inherits = require('inherits');\n\ninherits(Stream, EE);\nStream.Readable = require('readable-stream/readable.js');\nStream.Writable = require('readable-stream/writable.js');\nStream.Duplex = require('readable-stream/duplex.js');\nStream.Transform = require('readable-stream/transform.js');\nStream.PassThrough = require('readable-stream/passthrough.js');\n\n// Backwards-compat with node 0.4.x\nStream.Stream = Stream;\n\n\n\n// old-style streams. Note that the pipe method (the only relevant\n// part of this class) is overridden in the Readable class.\n\nfunction Stream() {\n EE.call(this);\n}\n\nStream.prototype.pipe = function(dest, options) {\n var source = this;\n\n function ondata(chunk) {\n if (dest.writable) {\n if (false === dest.write(chunk) && source.pause) {\n source.pause();\n }\n }\n }\n\n source.on('data', ondata);\n\n function ondrain() {\n if (source.readable && source.resume) {\n source.resume();\n }\n }\n\n dest.on('drain', ondrain);\n\n // If the 'end' option is not supplied, dest.end() will be called when\n // source gets the 'end' or 'close' events. Only dest.end() once.\n if (!dest._isStdio && (!options || options.end !== false)) {\n source.on('end', onend);\n source.on('close', onclose);\n }\n\n var didOnEnd = false;\n function onend() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n dest.end();\n }\n\n\n function onclose() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n if (typeof dest.destroy === 'function') dest.destroy();\n }\n\n // don't leave dangling pipes when there are errors.\n function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }\n\n source.on('error', onerror);\n dest.on('error', onerror);\n\n // remove all the event listeners that were added.\n function cleanup() {\n source.removeListener('data', ondata);\n dest.removeListener('drain', ondrain);\n\n source.removeListener('end', onend);\n source.removeListener('close', onclose);\n\n source.removeListener('error', onerror);\n dest.removeListener('error', onerror);\n\n source.removeListener('end', cleanup);\n source.removeListener('close', cleanup);\n\n dest.removeListener('close', cleanup);\n }\n\n source.on('end', cleanup);\n source.on('close', cleanup);\n\n dest.on('close', cleanup);\n\n dest.emit('pipe', source);\n\n // Allow for unix-like usage: A.pipe(B).pipe(C)\n return dest;\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/*<replacement>*/\n\nvar Buffer = require('safe-buffer').Buffer;\n/*</replacement>*/\n\nvar isEncoding = Buffer.isEncoding || function (encoding) {\n encoding = '' + encoding;\n switch (encoding && encoding.toLowerCase()) {\n case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':\n return true;\n default:\n return false;\n }\n};\n\nfunction _normalizeEncoding(enc) {\n if (!enc) return 'utf8';\n var retried;\n while (true) {\n switch (enc) {\n case 'utf8':\n case 'utf-8':\n return 'utf8';\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return 'utf16le';\n case 'latin1':\n case 'binary':\n return 'latin1';\n case 'base64':\n case 'ascii':\n case 'hex':\n return enc;\n default:\n if (retried) return; // undefined\n enc = ('' + enc).toLowerCase();\n retried = true;\n }\n }\n};\n\n// Do not cache `Buffer.isEncoding` when checking encoding names as some\n// modules monkey-patch it to support additional encodings\nfunction normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}\n\n// StringDecoder provides an interface for efficiently splitting a series of\n// buffers into a series of JS strings without breaking apart multi-byte\n// characters.\nexports.StringDecoder = StringDecoder;\nfunction StringDecoder(encoding) {\n this.encoding = normalizeEncoding(encoding);\n var nb;\n switch (this.encoding) {\n case 'utf16le':\n this.text = utf16Text;\n this.end = utf16End;\n nb = 4;\n break;\n case 'utf8':\n this.fillLast = utf8FillLast;\n nb = 4;\n break;\n case 'base64':\n this.text = base64Text;\n this.end = base64End;\n nb = 3;\n break;\n default:\n this.write = simpleWrite;\n this.end = simpleEnd;\n return;\n }\n this.lastNeed = 0;\n this.lastTotal = 0;\n this.lastChar = Buffer.allocUnsafe(nb);\n}\n\nStringDecoder.prototype.write = function (buf) {\n if (buf.length === 0) return '';\n var r;\n var i;\n if (this.lastNeed) {\n r = this.fillLast(buf);\n if (r === undefined) return '';\n i = this.lastNeed;\n this.lastNeed = 0;\n } else {\n i = 0;\n }\n if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);\n return r || '';\n};\n\nStringDecoder.prototype.end = utf8End;\n\n// Returns only complete characters in a Buffer\nStringDecoder.prototype.text = utf8Text;\n\n// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer\nStringDecoder.prototype.fillLast = function (buf) {\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);\n this.lastNeed -= buf.length;\n};\n\n// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a\n// continuation byte. If an invalid byte is detected, -2 is returned.\nfunction utf8CheckByte(byte) {\n if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;\n return byte >> 6 === 0x02 ? -1 : -2;\n}\n\n// Checks at most 3 bytes at the end of a Buffer in order to detect an\n// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)\n// needed to complete the UTF-8 character (if applicable) are returned.\nfunction utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}\n\n// Validates as many continuation bytes for a multi-byte UTF-8 character as\n// needed or are available. If we see a non-continuation byte where we expect\n// one, we \"replace\" the validated continuation bytes we've seen so far with\n// a single UTF-8 replacement character ('\\ufffd'), to match v8's UTF-8 decoding\n// behavior. The continuation byte check is included three times in the case\n// where all of the continuation bytes for a character exist in the same buffer.\n// It is also done this way as a slight performance increase instead of using a\n// loop.\nfunction utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}\n\n// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.\nfunction utf8FillLast(buf) {\n var p = this.lastTotal - this.lastNeed;\n var r = utf8CheckExtraBytes(this, buf, p);\n if (r !== undefined) return r;\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, p, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, p, 0, buf.length);\n this.lastNeed -= buf.length;\n}\n\n// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a\n// partial character, the character's bytes are buffered until the required\n// number of bytes are available.\nfunction utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}\n\n// For UTF-8, a replacement character is added when ending on a partial\n// character.\nfunction utf8End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + '\\ufffd';\n return r;\n}\n\n// UTF-16LE typically needs two bytes per character, but even if we have an even\n// number of bytes available, we need to check if we end on a leading/high\n// surrogate. In that case, we need to wait for the next two bytes in order to\n// decode the last character properly.\nfunction utf16Text(buf, i) {\n if ((buf.length - i) % 2 === 0) {\n var r = buf.toString('utf16le', i);\n if (r) {\n var c = r.charCodeAt(r.length - 1);\n if (c >= 0xD800 && c <= 0xDBFF) {\n this.lastNeed = 2;\n this.lastTotal = 4;\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n return r.slice(0, -1);\n }\n }\n return r;\n }\n this.lastNeed = 1;\n this.lastTotal = 2;\n this.lastChar[0] = buf[buf.length - 1];\n return buf.toString('utf16le', i, buf.length - 1);\n}\n\n// For UTF-16LE we do not explicitly append special replacement characters if we\n// end on a partial character, we simply let v8 handle that.\nfunction utf16End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) {\n var end = this.lastTotal - this.lastNeed;\n return r + this.lastChar.toString('utf16le', 0, end);\n }\n return r;\n}\n\nfunction base64Text(buf, i) {\n var n = (buf.length - i) % 3;\n if (n === 0) return buf.toString('base64', i);\n this.lastNeed = 3 - n;\n this.lastTotal = 3;\n if (n === 1) {\n this.lastChar[0] = buf[buf.length - 1];\n } else {\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n }\n return buf.toString('base64', i, buf.length - n);\n}\n\nfunction base64End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);\n return r;\n}\n\n// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)\nfunction simpleWrite(buf) {\n return buf.toString(this.encoding);\n}\n\nfunction simpleEnd(buf) {\n return buf && buf.length ? this.write(buf) : '';\n}","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\t\t\tresult = Symbol('observable');\n\t\t\tSymbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n","var scope = (typeof global !== \"undefined\" && global) ||\n (typeof self !== \"undefined\" && self) ||\n window;\nvar apply = Function.prototype.apply;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) {\n if (timeout) {\n timeout.close();\n }\n};\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(scope, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// setimmediate attaches itself to the global object\nrequire(\"setimmediate\");\n// On some exotic environments, it's not clear which object `setimmediate` was\n// able to install onto. Search each possibility in the same order as the\n// `setimmediate` library.\nexports.setImmediate = (typeof self !== \"undefined\" && self.setImmediate) ||\n (typeof global !== \"undefined\" && global.setImmediate) ||\n (this && this.setImmediate);\nexports.clearImmediate = (typeof self !== \"undefined\" && self.clearImmediate) ||\n (typeof global !== \"undefined\" && global.clearImmediate) ||\n (this && this.clearImmediate);\n","\nmodule.exports = function () {\n var selection = document.getSelection();\n if (!selection.rangeCount) {\n return function () {};\n }\n var active = document.activeElement;\n\n var ranges = [];\n for (var i = 0; i < selection.rangeCount; i++) {\n ranges.push(selection.getRangeAt(i));\n }\n\n switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML\n case 'INPUT':\n case 'TEXTAREA':\n active.blur();\n break;\n\n default:\n active = null;\n break;\n }\n\n selection.removeAllRanges();\n return function () {\n selection.type === 'Caret' &&\n selection.removeAllRanges();\n\n if (!selection.rangeCount) {\n ranges.forEach(function(range) {\n selection.addRange(range);\n });\n }\n\n active &&\n active.focus();\n };\n};\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","\n/**\n * Module exports.\n */\n\nmodule.exports = deprecate;\n\n/**\n * Mark that a method should not be used.\n * Returns a modified function which warns once by default.\n *\n * If `localStorage.noDeprecation = true` is set, then it is a no-op.\n *\n * If `localStorage.throwDeprecation = true` is set, then deprecated functions\n * will throw an Error when invoked.\n *\n * If `localStorage.traceDeprecation = true` is set, then deprecated functions\n * will invoke `console.trace()` instead of `console.error()`.\n *\n * @param {Function} fn - the function to deprecate\n * @param {String} msg - the string to print to the console when `fn` is invoked\n * @returns {Function} a new \"deprecated\" version of `fn`\n * @api public\n */\n\nfunction deprecate (fn, msg) {\n if (config('noDeprecation')) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (config('throwDeprecation')) {\n throw new Error(msg);\n } else if (config('traceDeprecation')) {\n console.trace(msg);\n } else {\n console.warn(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n}\n\n/**\n * Checks `localStorage` for boolean values for the given `name`.\n *\n * @param {String} name\n * @returns {Boolean}\n * @api private\n */\n\nfunction config (name) {\n // accessing global.localStorage can trigger a DOMException in sandboxed iframes\n try {\n if (!global.localStorage) return false;\n } catch (_) {\n return false;\n }\n var val = global.localStorage[name];\n if (null == val) return false;\n return String(val).toLowerCase() === 'true';\n}\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","module.exports = function(originalModule) {\n\tif (!originalModule.webpackPolyfill) {\n\t\tvar module = Object.create(originalModule);\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"exports\", {\n\t\t\tenumerable: true\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","/* (ignored) */","/* (ignored) */"],"sourceRoot":""} \ No newline at end of file